agora-rte-sdk 2.8.30 → 2.8.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/lib/configs/index.d.ts +8 -6
- package/lib/configs/index.js +8 -6
- package/lib/core/engine/index.js +1 -7
- package/lib/core/logger/index.js +6 -2
- package/lib/core/processor/channel-msg/data.d.ts +1 -0
- package/lib/core/processor/channel-msg/data.js +5 -0
- package/lib/core/processor/channel-msg/handler.d.ts +1 -3
- package/lib/core/processor/channel-msg/handler.js +20 -21
- package/lib/core/processor/channel-msg/message-parser.d.ts +6 -0
- package/lib/core/processor/channel-msg/message-parser.js +57 -0
- package/lib/core/processor/channel-msg/struct.d.ts +5 -0
- package/lib/core/processor/channel-msg/synchronizer.d.ts +7 -14
- package/lib/core/processor/channel-msg/synchronizer.js +33 -48
- package/lib/core/processor/peer-msg/handler.d.ts +16 -0
- package/lib/core/processor/peer-msg/handler.js +57 -0
- package/lib/core/processor/peer-msg/struct.d.ts +4 -0
- package/lib/core/processor/type.d.ts +200 -0
- package/lib/core/rc/index.js +6 -2
- package/lib/core/rtc/adapter/base.d.ts +2 -3
- package/lib/core/rtc/adapter/electron/index.d.ts +2 -3
- package/lib/core/rtc/adapter/electron/index.js +4 -0
- package/lib/core/rtc/adapter/web/client.d.ts +4 -4
- package/lib/core/rtc/adapter/web/client.js +7 -10
- package/lib/core/rtc/adapter/web/index.d.ts +3 -3
- package/lib/core/rtc/channel.d.ts +2 -3
- package/lib/core/services/api.d.ts +11 -0
- package/lib/core/services/api.js +7 -1
- package/lib/core/utils/events.d.ts +0 -1
- package/lib/scene/index.d.ts +0 -5
- package/lib/scene/index.js +76 -64
- package/package.json +1 -1
- package/lib/core/decorator/handlers/log-handler.d.ts +0 -2
- package/lib/core/decorator/handlers/log-handler.js +0 -34
- package/lib/core/decorator/log/log-serializer.d.ts +0 -7
- package/lib/core/decorator/log/log-serializer.js +0 -38
- package/lib/core/decorator/utils.d.ts +0 -2
- package/lib/core/decorator/utils.js +0 -19
- package/lib/core/utils/decorator.d.ts +0 -2
- package/lib/core/utils/decorator.js +0 -65
package/dist/index.js
CHANGED
|
@@ -452,4 +452,4 @@ _e.exports=function(j){return null!=j&&(isBuffer(j)||function isSlowBuffer(j){re
|
|
|
452
452
|
*
|
|
453
453
|
* Copyright © 2012-2019 Faisal Salman <f@faisalman.com>
|
|
454
454
|
* Licensed under MIT License
|
|
455
|
-
*/!function(Tt,Ut){"use strict";var _r="function",_n="undefined",_i="object",Ei="model",Ci="name",Di="type",Fi="vendor",_o="version",ga="architecture",_a="console",_s="mobile",_c="tablet",kc="smarttv",_u="wearable",_l={extend:function(j,_e){var _t={};for(var St in j)_e[St]&&_e[St].length%2==0?_t[St]=_e[St].concat(j[St]):_t[St]=j[St];return _t},has:function(j,_e){return"string"==typeof j&&-1!==_e.toLowerCase().indexOf(j.toLowerCase())},lowerize:function(j){return j.toLowerCase()},major:function(j){return"string"==typeof j?j.replace(/[^\d\.]/g,"").split(".")[0]:Ut},trim:function(j){return j.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},_d={rgx:function(j,_e){for(var _t,St,Tt,_n,Ei,Ci,Di=0;Di<_e.length&&!Ei;){var Fi=_e[Di],_o=_e[Di+1];for(_t=St=0;_t<Fi.length&&!Ei;)if(Ei=Fi[_t++].exec(j))for(Tt=0;Tt<_o.length;Tt++)Ci=Ei[++St],typeof(_n=_o[Tt])===_i&&_n.length>0?2==_n.length?typeof _n[1]==_r?this[_n[0]]=_n[1].call(this,Ci):this[_n[0]]=_n[1]:3==_n.length?typeof _n[1]!==_r||_n[1].exec&&_n[1].test?this[_n[0]]=Ci?Ci.replace(_n[1],_n[2]):Ut:this[_n[0]]=Ci?_n[1].call(this,Ci,_n[2]):Ut:4==_n.length&&(this[_n[0]]=Ci?_n[3].call(this,Ci.replace(_n[1],_n[2])):Ut):this[_n]=Ci||Ut;Di+=2}},str:function(j,_e){for(var _t in _e)if(typeof _e[_t]===_i&&_e[_t].length>0){for(var St=0;St<_e[_t].length;St++)if(_l.has(_e[_t][St],j))return"?"===_t?Ut:_t}else if(_l.has(_e[_t],j))return"?"===_t?Ut:_t;return j}},_h={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},_f={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6}).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[Ci,_o],[/(opios)[\/\s]+([\w\.]+)/i],[[Ci,"Opera Mini"],_o],[/\s(opr)\/([\w\.]+)/i],[[Ci,"Opera"],_o],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[Ci,_o],[/(konqueror)\/([\w\.]+)/i],[[Ci,"Konqueror"],_o],[/(trident).+rv[:\s]([\w\.]{1,9}).+like\sgecko/i],[[Ci,"IE"],_o],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[Ci,"Edge"],_o],[/(yabrowser)\/([\w\.]+)/i],[[Ci,"Yandex"],_o],[/(Avast)\/([\w\.]+)/i],[[Ci,"Avast Secure Browser"],_o],[/(AVG)\/([\w\.]+)/i],[[Ci,"AVG Secure Browser"],_o],[/(puffin)\/([\w\.]+)/i],[[Ci,"Puffin"],_o],[/(focus)\/([\w\.]+)/i],[[Ci,"Firefox Focus"],_o],[/(opt)\/([\w\.]+)/i],[[Ci,"Opera Touch"],_o],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[Ci,"UCBrowser"],_o],[/(comodo_dragon)\/([\w\.]+)/i],[[Ci,/_/g," "],_o],[/(windowswechat qbcore)\/([\w\.]+)/i],[[Ci,"WeChat(Win) Desktop"],_o],[/(micromessenger)\/([\w\.]+)/i],[[Ci,"WeChat"],_o],[/(brave)\/([\w\.]+)/i],[[Ci,"Brave"],_o],[/(whale)\/([\w\.]+)/i],[[Ci,"Whale"],_o],[/(qqbrowserlite)\/([\w\.]+)/i],[Ci,_o],[/(QQ)\/([\d\.]+)/i],[Ci,_o],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[Ci,_o],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[Ci,_o],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[Ci,_o],[/(MetaSr)[\/\s]?([\w\.]+)/i],[Ci],[/(LBBROWSER)/i],[Ci],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[_o,[Ci,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[_o,[Ci,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[Ci,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[Ci,_o],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[_o,[Ci,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[Ci,/(.+)/,"$1 WebView"],_o],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[Ci,/(.+(?:g|us))(.+)/,"$1 $2"],_o],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[_o,[Ci,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[Ci,"Sailfish Browser"],_o],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[Ci,_o],[/(dolfin)\/([\w\.]+)/i],[[Ci,"Dolphin"],_o],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[Ci,"360 Browser"]],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[Ci,"Chrome"],_o],[/(coast)\/([\w\.]+)/i],[[Ci,"Opera Coast"],_o],[/fxios\/([\w\.-]+)/i],[_o,[Ci,"Firefox"]],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[_o,[Ci,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[_o,Ci],[/webkit.+?(gsa)\/([\w\.]+)\s.*(mobile\s?safari|safari)(\/[\w\.]+)/i],[[Ci,"GSA"],_o],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[Ci,[_o,_d.str,_h.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[Ci,_o],[/(navigator|netscape)\/([\w\.-]+)/i],[[Ci,"Netscape"],_o],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[Ci,_o]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[ga,"amd64"]],[/(ia32(?=;))/i],[[ga,_l.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[ga,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[ga,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[ga,/ower/,"",_l.lowerize]],[/(sun4\w)[;\)]/i],[[ga,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[ga,_l.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[Ei,Fi,[Di,_c]],[/applecoremedia\/[\w\.]+ \((ipad)/],[Ei,[Fi,"Apple"],[Di,_c]],[/(apple\s{0,1}tv)/i],[[Ei,"Apple TV"],[Fi,"Apple"],[Di,kc]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[Fi,Ei,[Di,_c]],[/(kf[A-z]+)(\sbuild\/|\)).+silk\//i],[Ei,[Fi,"Amazon"],[Di,_c]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[Ei,_d.str,_h.device.amazon.model],[Fi,"Amazon"],[Di,_s]],[/android.+aft([bms])\sbuild/i],[Ei,[Fi,"Amazon"],[Di,kc]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[Ei,Fi,[Di,_s]],[/\((ip[honed|\s\w*]+);/i],[Ei,[Fi,"Apple"],[Di,_s]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[Fi,Ei,[Di,_s]],[/\(bb10;\s(\w+)/i],[Ei,[Fi,"BlackBerry"],[Di,_s]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[Ei,[Fi,"Asus"],[Di,_c]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[Fi,"Sony"],[Ei,"Xperia Tablet"],[Di,_c]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[Ei,[Fi,"Sony"],[Di,_s]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[Fi,Ei,[Di,_a]],[/android.+;\s(shield)\sbuild/i],[Ei,[Fi,"Nvidia"],[Di,_a]],[/(playstation\s[34portablevi]+)/i],[Ei,[Fi,"Sony"],[Di,_a]],[/(sprint\s(\w+))/i],[[Fi,_d.str,_h.device.sprint.vendor],[Ei,_d.str,_h.device.sprint.model],[Di,_s]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[Fi,[Ei,/_/g," "],[Di,_s]],[/(nexus\s9)/i],[Ei,[Fi,"HTC"],[Di,_c]],[/d\/huawei([\w\s-]+)[;\)]/i,/android.+\s(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?)/i],[Ei,[Fi,"Huawei"],[Di,_s]],[/android.+(bah2?-a?[lw]\d{2})/i],[Ei,[Fi,"Huawei"],[Di,_c]],[/(microsoft);\s(lumia[\s\w]+)/i],[Fi,Ei,[Di,_s]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[Ei,[Fi,"Microsoft"],[Di,_a]],[/(kin\.[onetw]{3})/i],[[Ei,/\./g," "],[Fi,"Microsoft"],[Di,_s]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[Ei,[Fi,"Motorola"],[Di,_s]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[Ei,[Fi,"Motorola"],[Di,_c]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[Fi,_l.trim],[Ei,_l.trim],[Di,kc]],[/hbbtv.+maple;(\d+)/i],[[Ei,/^/,"SmartTV"],[Fi,"Samsung"],[Di,kc]],[/\(dtv[\);].+(aquos)/i],[Ei,[Fi,"Sharp"],[Di,kc]],[/android.+((sch-i[89]0\d|shw-m380s|SM-P605|SM-P610|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[Fi,"Samsung"],Ei,[Di,_c]],[/smart-tv.+(samsung)/i],[Fi,[Di,kc],Ei],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[Fi,"Samsung"],Ei,[Di,_s]],[/sie-(\w*)/i],[Ei,[Fi,"Siemens"],[Di,_s]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[Fi,"Nokia"],Ei,[Di,_s]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[Ei,[Fi,"Acer"],[Di,_c]],[/android.+([vl]k\-?\d{3})\s+build/i],[Ei,[Fi,"LG"],[Di,_c]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[Fi,"LG"],Ei,[Di,_c]],[/linux;\snetcast.+smarttv/i,/lg\snetcast\.tv-201\d/i],[[Fi,"LG"],Ei,[Di,kc]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[Ei,[Fi,"LG"],[Di,_s]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[Fi,Ei,[Di,_c]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[Ei,[Fi,"Lenovo"],[Di,_c]],[/(lenovo)[_\s-]?([\w-]+)/i],[Fi,Ei,[Di,_s]],[/linux;.+((jolla));/i],[Fi,Ei,[Di,_s]],[/((pebble))app\/[\d\.]+\s/i],[Fi,Ei,[Di,_u]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[Fi,Ei,[Di,_s]],[/crkey/i],[[Ei,"Chromecast"],[Fi,"Google"],[Di,kc]],[/android.+;\s(glass)\s\d/i],[Ei,[Fi,"Google"],[Di,_u]],[/android.+;\s(pixel c)[\s)]/i],[Ei,[Fi,"Google"],[Di,_c]],[/android.+;\s(pixel( [2-9]a?)?( xl)?)[\s)]/i],[Ei,[Fi,"Google"],[Di,_s]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/android.+(redmi[\s\-_]?(?:note|k)?(?:[\s_]?[\w\s]+))(?:\sbuild|\))/i,/android.+(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[Ei,/_/g," "],[Fi,"Xiaomi"],[Di,_s]],[/android.+(mi[\s\-_]?(?:pad)(?:[\s_]?[\w\s]+))(?:\sbuild|\))/i],[[Ei,/_/g," "],[Fi,"Xiaomi"],[Di,_c]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[Ei,[Fi,"Meizu"],[Di,_s]],[/(mz)-([\w-]{2,})/i],[[Fi,"Meizu"],Ei,[Di,_s]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[Ei,[Fi,"OnePlus"],[Di,_s]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[Ei,[Fi,"RCA"],[Di,_c]],[/android.+[;\/\s](Venue[\d\s]{2,7})\s+build/i],[Ei,[Fi,"Dell"],[Di,_c]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[Ei,[Fi,"Verizon"],[Di,_c]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[Fi,"Barnes & Noble"],Ei,[Di,_c]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[Ei,[Fi,"NuVision"],[Di,_c]],[/android.+;\s(k88)\sbuild/i],[Ei,[Fi,"ZTE"],[Di,_c]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[Ei,[Fi,"Swiss"],[Di,_s]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[Ei,[Fi,"Swiss"],[Di,_c]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[Ei,[Fi,"Zeki"],[Di,_c]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[Fi,"Dragon Touch"],Ei,[Di,_c]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[Ei,[Fi,"Insignia"],[Di,_c]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[Ei,[Fi,"NextBook"],[Di,_c]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[Fi,"Voice"],Ei,[Di,_s]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[Fi,"LvTel"],Ei,[Di,_s]],[/android.+;\s(PH-1)\s/i],[Ei,[Fi,"Essential"],[Di,_s]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[Ei,[Fi,"Envizen"],[Di,_c]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[Fi,Ei,[Di,_c]],[/android.+[;\/]\s*(Trio[\s\w\-\.]+)\s+build/i],[Ei,[Fi,"MachSpeed"],[Di,_c]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[Fi,Ei,[Di,_c]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[Ei,[Fi,"Rotor"],[Di,_c]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[Fi,Ei,[Di,_c]],[/android .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[Ei,[Di,_s]],[/android .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[Ei,[Di,_c]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[Di,_l.lowerize],Fi,Ei],[/[\s\/\(](smart-?tv)[;\)]/i],[[Di,kc]],[/(android[\w\.\s\-]{0,9});.+build/i],[Ei,[Fi,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[_o,[Ci,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[_o,[Ci,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[Ci,_o],[/rv\:([\w\.]{1,9}).+(gecko)/i],[_o,Ci]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[Ci,_o],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[Ci,[_o,_d.str,_h.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[Ci,"Windows"],[_o,_d.str,_h.os.windows.version]],[/\((bb)(10);/i],[[Ci,"BlackBerry"],_o],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[Ci,_o],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[Ci,"Symbian"],_o],[/\((series40);/i],[Ci],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[Ci,"Firefox OS"],_o],[/crkey\/([\d\.]+)/i],[_o,[Ci,"Chromecast"]],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[Ci,_o],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[Ci,"Chromium OS"],_o],[/(sunos)\s?([\w\.\d]*)/i],[[Ci,"Solaris"],_o],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[Ci,_o],[/(haiku)\s(\w+)/i],[Ci,_o],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[_o,/_/g,"."],[Ci,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[Ci,"Mac OS"],[_o,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[Ci,_o]]},UAParser=function(j,_e){if("object"==typeof j&&(_e=j,j=Ut),!(this instanceof UAParser))return new UAParser(j,_e).getResult();var _t=j||(Tt&&Tt.navigator&&Tt.navigator.userAgent?Tt.navigator.userAgent:""),St=_e?_l.extend(_f,_e):_f;return this.getBrowser=function(){var j={name:Ut,version:Ut};return _d.rgx.call(j,_t,St.browser),j.major=_l.major(j.version),j},this.getCPU=function(){var j={architecture:Ut};return _d.rgx.call(j,_t,St.cpu),j},this.getDevice=function(){var j={vendor:Ut,model:Ut,type:Ut};return _d.rgx.call(j,_t,St.device),j},this.getEngine=function(){var j={name:Ut,version:Ut};return _d.rgx.call(j,_t,St.engine),j},this.getOS=function(){var j={name:Ut,version:Ut};return _d.rgx.call(j,_t,St.os),j},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return _t},this.setUA=function(j){return _t=j,this},this};UAParser.VERSION="0.7.23",UAParser.BROWSER={NAME:Ci,MAJOR:"major",VERSION:_o},UAParser.CPU={ARCHITECTURE:ga},UAParser.DEVICE={MODEL:Ei,VENDOR:Fi,TYPE:Di,CONSOLE:_a,MOBILE:_s,SMARTTV:kc,TABLET:_c,WEARABLE:_u,EMBEDDED:"embedded"},UAParser.ENGINE={NAME:Ci,VERSION:_o},UAParser.OS={NAME:Ci,VERSION:_o},typeof _e!==_n?(j.exports&&(_e=j.exports=UAParser),_e.UAParser=UAParser):(St=function(){return UAParser}.call(_e,_t,_e,j))===Ut||(j.exports=St);var _p=Tt&&(Tt.jQuery||Tt.Zepto);if(_p&&!_p.ua){var Eg=new UAParser;_p.ua=Eg.getResult(),_p.ua.get=function(){return Eg.getUA()},_p.ua.set=function(j){Eg.setUA(j);var _e=Eg.getResult();for(var _t in _e)_p.ua[_t]=_e[_t]}}}("object"==typeof window?window:this)},1005:j=>{"use strict";j.exports=function(j,_e,_t,St){var Tt=self||window;try{try{var Ut;try{Ut=new Tt.Blob([j])}catch(_e){(Ut=new(Tt.BlobBuilder||Tt.WebKitBlobBuilder||Tt.MozBlobBuilder||Tt.MSBlobBuilder)).append(j),Ut=Ut.getBlob()}var _r=Tt.URL||Tt.webkitURL,_n=_r.createObjectURL(Ut),_i=new Tt[_e](_n,_t);return _r.revokeObjectURL(_n),_i}catch(St){return new Tt[_e]("data:application/javascript,".concat(encodeURIComponent(j)),_t)}}catch(j){if(!St)throw Error("Inline worker is not supported");return new Tt[_e](St,_t)}}},9662:(j,_e,_t)=>{var St=_t(7854),Tt=_t(614),Ut=_t(6330),_r=St.TypeError;j.exports=function(j){if(Tt(j))return j;throw _r(Ut(j)+" is not a function")}},9483:(j,_e,_t)=>{var St=_t(7854),Tt=_t(4411),Ut=_t(6330),_r=St.TypeError;j.exports=function(j){if(Tt(j))return j;throw _r(Ut(j)+" is not a constructor")}},6077:(j,_e,_t)=>{var St=_t(7854),Tt=_t(614),Ut=St.String,_r=St.TypeError;j.exports=function(j){if("object"==typeof j||Tt(j))return j;throw _r("Can't set "+Ut(j)+" as a prototype")}},1223:(j,_e,_t)=>{var St=_t(5112),Tt=_t(30),Ut=_t(3070),_r=St("unscopables"),_n=Array.prototype;null==_n[_r]&&Ut.f(_n,_r,{configurable:!0,value:Tt(null)}),j.exports=function(j){_n[_r][j]=!0}},1530:(j,_e,_t)=>{"use strict";var St=_t(8710).charAt;j.exports=function(j,_e,_t){return _e+(_t?St(j,_e).length:1)}},5787:(j,_e,_t)=>{var St=_t(7854),Tt=_t(7976),Ut=St.TypeError;j.exports=function(j,_e){if(Tt(_e,j))return j;throw Ut("Incorrect invocation")}},9670:(j,_e,_t)=>{var St=_t(7854),Tt=_t(111),Ut=St.String,_r=St.TypeError;j.exports=function(j){if(Tt(j))return j;throw _r(Ut(j)+" is not an object")}},5381:j=>{j.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7556:(j,_e,_t)=>{var St=_t(7293);j.exports=St((function(){if("function"==typeof ArrayBuffer){var j=new ArrayBuffer(8);Object.isExtensible(j)&&Object.defineProperty(j,"a",{value:8})}}))},260:(j,_e,_t)=>{"use strict";var St,Tt,Ut,_r=_t(5381),_n=_t(9781),_i=_t(7854),Ei=_t(614),Ci=_t(111),Di=_t(2597),Fi=_t(648),_o=_t(6330),ga=_t(8880),_a=_t(1320),_s=_t(3070).f,_c=_t(7976),kc=_t(9518),_u=_t(7674),_l=_t(5112),_d=_t(9711),_h=_i.Int8Array,_f=_h&&_h.prototype,_p=_i.Uint8ClampedArray,Eg=_p&&_p.prototype,_v=_h&&kc(_h),_m=_f&&kc(_f),Pm=Object.prototype,_y=_i.TypeError,_A=_l("toStringTag"),e_=_d("TYPED_ARRAY_TAG"),t_=_d("TYPED_ARRAY_CONSTRUCTOR"),r_=_r&&!!_u&&"Opera"!==Fi(_i.opera),i_=!1,a_={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},s_={BigInt64Array:8,BigUint64Array:8},isTypedArray=function(j){if(!Ci(j))return!1;var _e=Fi(j);return Di(a_,_e)||Di(s_,_e)};for(St in a_)(Ut=(Tt=_i[St])&&Tt.prototype)?ga(Ut,t_,Tt):r_=!1;for(St in s_)(Ut=(Tt=_i[St])&&Tt.prototype)&&ga(Ut,t_,Tt);if((!r_||!Ei(_v)||_v===Function.prototype)&&(_v=function TypedArray(){throw _y("Incorrect invocation")},r_))for(St in a_)_i[St]&&_u(_i[St],_v);if((!r_||!_m||_m===Pm)&&(_m=_v.prototype,r_))for(St in a_)_i[St]&&_u(_i[St].prototype,_m);if(r_&&kc(Eg)!==_m&&_u(Eg,_m),_n&&!Di(_m,_A))for(St in i_=!0,_s(_m,_A,{get:function(){return Ci(this)?this[e_]:void 0}}),a_)_i[St]&&ga(_i[St],e_,St);j.exports={NATIVE_ARRAY_BUFFER_VIEWS:r_,TYPED_ARRAY_CONSTRUCTOR:t_,TYPED_ARRAY_TAG:i_&&e_,aTypedArray:function(j){if(isTypedArray(j))return j;throw _y("Target is not a typed array")},aTypedArrayConstructor:function(j){if(Ei(j)&&(!_u||_c(_v,j)))return j;throw _y(_o(j)+" is not a typed array constructor")},exportTypedArrayMethod:function(j,_e,_t,St){if(_n){if(_t)for(var Tt in a_){var Ut=_i[Tt];if(Ut&&Di(Ut.prototype,j))try{delete Ut.prototype[j]}catch(j){}}_m[j]&&!_t||_a(_m,j,_t?_e:r_&&_f[j]||_e,St)}},exportTypedArrayStaticMethod:function(j,_e,_t){var St,Tt;if(_n){if(_u){if(_t)for(St in a_)if((Tt=_i[St])&&Di(Tt,j))try{delete Tt[j]}catch(j){}if(_v[j]&&!_t)return;try{return _a(_v,j,_t?_e:r_&&_v[j]||_e)}catch(j){}}for(St in a_)!(Tt=_i[St])||Tt[j]&&!_t||_a(Tt,j,_e)}},isView:function isView(j){if(!Ci(j))return!1;var _e=Fi(j);return"DataView"===_e||Di(a_,_e)||Di(s_,_e)},isTypedArray,TypedArray:_v,TypedArrayPrototype:_m}},3331:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(1702),Ut=_t(9781),_r=_t(5381),_n=_t(6530),_i=_t(8880),Ei=_t(2248),Ci=_t(7293),Di=_t(5787),Fi=_t(9303),_o=_t(7466),ga=_t(7067),_a=_t(1179),_s=_t(9518),_c=_t(7674),kc=_t(8006).f,_u=_t(3070).f,_l=_t(1285),_d=_t(1589),_h=_t(8003),_f=_t(9909),_p=_n.PROPER,Eg=_n.CONFIGURABLE,_v=_f.get,_m=_f.set,Pm="ArrayBuffer",_y="DataView",_A="prototype",e_="Wrong index",t_=St[Pm],r_=t_,i_=r_&&r_[_A],a_=St[_y],s_=a_&&a_[_A],c_=Object.prototype,u_=St.Array,l_=St.RangeError,d_=Tt(_l),h_=Tt([].reverse),f_=_a.pack,p_=_a.unpack,packInt8=function(j){return[255&j]},packInt16=function(j){return[255&j,j>>8&255]},packInt32=function(j){return[255&j,j>>8&255,j>>16&255,j>>24&255]},unpackInt32=function(j){return j[3]<<24|j[2]<<16|j[1]<<8|j[0]},packFloat32=function(j){return f_(j,23,4)},packFloat64=function(j){return f_(j,52,8)},addGetter=function(j,_e){_u(j[_A],_e,{get:function(){return _v(this)[_e]}})},get=function(j,_e,_t,St){var Tt=ga(_t),Ut=_v(j);if(Tt+_e>Ut.byteLength)throw l_(e_);var _r=_v(Ut.buffer).bytes,_n=Tt+Ut.byteOffset,_i=_d(_r,_n,_n+_e);return St?_i:h_(_i)},set=function(j,_e,_t,St,Tt,Ut){var _r=ga(_t),_n=_v(j);if(_r+_e>_n.byteLength)throw l_(e_);for(var _i=_v(_n.buffer).bytes,Ei=_r+_n.byteOffset,Ci=St(+Tt),Di=0;Di<_e;Di++)_i[Ei+Di]=Ci[Ut?Di:_e-Di-1]};if(_r){var v_=_p&&t_.name!==Pm;if(Ci((function(){t_(1)}))&&Ci((function(){new t_(-1)}))&&!Ci((function(){return new t_,new t_(1.5),new t_(NaN),v_&&!Eg})))v_&&Eg&&_i(t_,"name",Pm);else{(r_=function ArrayBuffer(j){return Di(this,i_),new t_(ga(j))})[_A]=i_;for(var m_,y_=kc(t_),A_=0;y_.length>A_;)(m_=y_[A_++])in r_||_i(r_,m_,t_[m_]);i_.constructor=r_}_c&&_s(s_)!==c_&&_c(s_,c_);var __=new a_(new r_(2)),b_=Tt(s_.setInt8);__.setInt8(0,2147483648),__.setInt8(1,2147483649),!__.getInt8(0)&&__.getInt8(1)||Ei(s_,{setInt8:function setInt8(j,_e){b_(this,j,_e<<24>>24)},setUint8:function setUint8(j,_e){b_(this,j,_e<<24>>24)}},{unsafe:!0})}else i_=(r_=function ArrayBuffer(j){Di(this,i_);var _e=ga(j);_m(this,{bytes:d_(u_(_e),0),byteLength:_e}),Ut||(this.byteLength=_e)})[_A],s_=(a_=function DataView(j,_e,_t){Di(this,s_),Di(j,i_);var St=_v(j).byteLength,Tt=Fi(_e);if(Tt<0||Tt>St)throw l_("Wrong offset");if(Tt+(_t=void 0===_t?St-Tt:_o(_t))>St)throw l_("Wrong length");_m(this,{buffer:j,byteLength:_t,byteOffset:Tt}),Ut||(this.buffer=j,this.byteLength=_t,this.byteOffset=Tt)})[_A],Ut&&(addGetter(r_,"byteLength"),addGetter(a_,"buffer"),addGetter(a_,"byteLength"),addGetter(a_,"byteOffset")),Ei(s_,{getInt8:function getInt8(j){return get(this,1,j)[0]<<24>>24},getUint8:function getUint8(j){return get(this,1,j)[0]},getInt16:function getInt16(j){var _e=get(this,2,j,arguments.length>1?arguments[1]:void 0);return(_e[1]<<8|_e[0])<<16>>16},getUint16:function getUint16(j){var _e=get(this,2,j,arguments.length>1?arguments[1]:void 0);return _e[1]<<8|_e[0]},getInt32:function getInt32(j){return unpackInt32(get(this,4,j,arguments.length>1?arguments[1]:void 0))},getUint32:function getUint32(j){return unpackInt32(get(this,4,j,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function getFloat32(j){return p_(get(this,4,j,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function getFloat64(j){return p_(get(this,8,j,arguments.length>1?arguments[1]:void 0),52)},setInt8:function setInt8(j,_e){set(this,1,j,packInt8,_e)},setUint8:function setUint8(j,_e){set(this,1,j,packInt8,_e)},setInt16:function setInt16(j,_e){set(this,2,j,packInt16,_e,arguments.length>2?arguments[2]:void 0)},setUint16:function setUint16(j,_e){set(this,2,j,packInt16,_e,arguments.length>2?arguments[2]:void 0)},setInt32:function setInt32(j,_e){set(this,4,j,packInt32,_e,arguments.length>2?arguments[2]:void 0)},setUint32:function setUint32(j,_e){set(this,4,j,packInt32,_e,arguments.length>2?arguments[2]:void 0)},setFloat32:function setFloat32(j,_e){set(this,4,j,packFloat32,_e,arguments.length>2?arguments[2]:void 0)},setFloat64:function setFloat64(j,_e){set(this,8,j,packFloat64,_e,arguments.length>2?arguments[2]:void 0)}});_h(r_,Pm),_h(a_,_y),j.exports={ArrayBuffer:r_,DataView:a_}},1048:(j,_e,_t)=>{"use strict";var St=_t(7908),Tt=_t(1400),Ut=_t(6244),_r=Math.min;j.exports=[].copyWithin||function copyWithin(j,_e){var _t=St(this),_n=Ut(_t),_i=Tt(j,_n),Ei=Tt(_e,_n),Ci=arguments.length>2?arguments[2]:void 0,Di=_r((void 0===Ci?_n:Tt(Ci,_n))-Ei,_n-_i),Fi=1;for(Ei<_i&&_i<Ei+Di&&(Fi=-1,Ei+=Di-1,_i+=Di-1);Di-- >0;)Ei in _t?_t[_i]=_t[Ei]:delete _t[_i],_i+=Fi,Ei+=Fi;return _t}},1285:(j,_e,_t)=>{"use strict";var St=_t(7908),Tt=_t(1400),Ut=_t(6244);j.exports=function fill(j){for(var _e=St(this),_t=Ut(_e),_r=arguments.length,_n=Tt(_r>1?arguments[1]:void 0,_t),_i=_r>2?arguments[2]:void 0,Ei=void 0===_i?_t:Tt(_i,_t);Ei>_n;)_e[_n++]=j;return _e}},8533:(j,_e,_t)=>{"use strict";var St=_t(2092).forEach,Tt=_t(2133)("forEach");j.exports=Tt?[].forEach:function forEach(j){return St(this,j,arguments.length>1?arguments[1]:void 0)}},7745:(j,_e,_t)=>{var St=_t(6244);j.exports=function(j,_e){for(var _t=0,Tt=St(_e),Ut=new j(Tt);Tt>_t;)Ut[_t]=_e[_t++];return Ut}},8457:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(9974),Ut=_t(6916),_r=_t(7908),_n=_t(3411),_i=_t(7659),Ei=_t(4411),Ci=_t(6244),Di=_t(6135),Fi=_t(8554),_o=_t(1246),ga=St.Array;j.exports=function from(j){var _e=_r(j),_t=Ei(this),St=arguments.length,_a=St>1?arguments[1]:void 0,_s=void 0!==_a;_s&&(_a=Tt(_a,St>2?arguments[2]:void 0));var _c,kc,_u,_l,_d,_h,_f=_o(_e),_p=0;if(!_f||this==ga&&_i(_f))for(_c=Ci(_e),kc=_t?new this(_c):ga(_c);_c>_p;_p++)_h=_s?_a(_e[_p],_p):_e[_p],Di(kc,_p,_h);else for(_d=(_l=Fi(_e,_f)).next,kc=_t?new this:[];!(_u=Ut(_d,_l)).done;_p++)_h=_s?_n(_l,_a,[_u.value,_p],!0):_u.value,Di(kc,_p,_h);return kc.length=_p,kc}},5367:(j,_e,_t)=>{var St=_t(5656),Tt=_t(1400),Ut=_t(6244),createMethod=function(j){return function(_e,_t,_r){var _n,_i=St(_e),Ei=Ut(_i),Ci=Tt(_r,Ei);if(j&&_t!=_t){for(;Ei>Ci;)if((_n=_i[Ci++])!=_n)return!0}else for(;Ei>Ci;Ci++)if((j||Ci in _i)&&_i[Ci]===_t)return j||Ci||0;return!j&&-1}};j.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},2092:(j,_e,_t)=>{var St=_t(9974),Tt=_t(1702),Ut=_t(8361),_r=_t(7908),_n=_t(6244),_i=_t(5417),Ei=Tt([].push),createMethod=function(j){var _e=1==j,_t=2==j,Tt=3==j,Ci=4==j,Di=6==j,Fi=7==j,_o=5==j||Di;return function(ga,_a,_s,_c){for(var kc,_u,_l=_r(ga),_d=Ut(_l),_h=St(_a,_s),_f=_n(_d),_p=0,Eg=_c||_i,_v=_e?Eg(ga,_f):_t||Fi?Eg(ga,0):void 0;_f>_p;_p++)if((_o||_p in _d)&&(_u=_h(kc=_d[_p],_p,_l),j))if(_e)_v[_p]=_u;else if(_u)switch(j){case 3:return!0;case 5:return kc;case 6:return _p;case 2:Ei(_v,kc)}else switch(j){case 4:return!1;case 7:Ei(_v,kc)}return Di?-1:Tt||Ci?Ci:_v}};j.exports={forEach:createMethod(0),map:createMethod(1),filter:createMethod(2),some:createMethod(3),every:createMethod(4),find:createMethod(5),findIndex:createMethod(6),filterReject:createMethod(7)}},6583:(j,_e,_t)=>{"use strict";var St=_t(2104),Tt=_t(5656),Ut=_t(9303),_r=_t(6244),_n=_t(2133),_i=Math.min,Ei=[].lastIndexOf,Ci=!!Ei&&1/[1].lastIndexOf(1,-0)<0,Di=_n("lastIndexOf"),Fi=Ci||!Di;j.exports=Fi?function lastIndexOf(j){if(Ci)return St(Ei,this,arguments)||0;var _e=Tt(this),_t=_r(_e),_n=_t-1;for(arguments.length>1&&(_n=_i(_n,Ut(arguments[1]))),_n<0&&(_n=_t+_n);_n>=0;_n--)if(_n in _e&&_e[_n]===j)return _n||0;return-1}:Ei},1194:(j,_e,_t)=>{var St=_t(7293),Tt=_t(5112),Ut=_t(7392),_r=Tt("species");j.exports=function(j){return Ut>=51||!St((function(){var _e=[];return(_e.constructor={})[_r]=function(){return{foo:1}},1!==_e[j](Boolean).foo}))}},2133:(j,_e,_t)=>{"use strict";var St=_t(7293);j.exports=function(j,_e){var _t=[][j];return!!_t&&St((function(){_t.call(null,_e||function(){throw 1},1)}))}},3671:(j,_e,_t)=>{var St=_t(7854),Tt=_t(9662),Ut=_t(7908),_r=_t(8361),_n=_t(6244),_i=St.TypeError,createMethod=function(j){return function(_e,_t,St,Ei){Tt(_t);var Ci=Ut(_e),Di=_r(Ci),Fi=_n(Ci),_o=j?Fi-1:0,ga=j?-1:1;if(St<2)for(;;){if(_o in Di){Ei=Di[_o],_o+=ga;break}if(_o+=ga,j?_o<0:Fi<=_o)throw _i("Reduce of empty array with no initial value")}for(;j?_o>=0:Fi>_o;_o+=ga)_o in Di&&(Ei=_t(Ei,Di[_o],_o,Ci));return Ei}};j.exports={left:createMethod(!1),right:createMethod(!0)}},1589:(j,_e,_t)=>{var St=_t(7854),Tt=_t(1400),Ut=_t(6244),_r=_t(6135),_n=St.Array,_i=Math.max;j.exports=function(j,_e,_t){for(var St=Ut(j),Ei=Tt(_e,St),Ci=Tt(void 0===_t?St:_t,St),Di=_n(_i(Ci-Ei,0)),Fi=0;Ei<Ci;Ei++,Fi++)_r(Di,Fi,j[Ei]);return Di.length=Fi,Di}},206:(j,_e,_t)=>{var St=_t(1702);j.exports=St([].slice)},4362:(j,_e,_t)=>{var St=_t(1589),Tt=Math.floor,mergeSort=function(j,_e){var _t=j.length,Ut=Tt(_t/2);return _t<8?insertionSort(j,_e):merge(j,mergeSort(St(j,0,Ut),_e),mergeSort(St(j,Ut),_e),_e)},insertionSort=function(j,_e){for(var _t,St,Tt=j.length,Ut=1;Ut<Tt;){for(St=Ut,_t=j[Ut];St&&_e(j[St-1],_t)>0;)j[St]=j[--St];St!==Ut++&&(j[St]=_t)}return j},merge=function(j,_e,_t,St){for(var Tt=_e.length,Ut=_t.length,_r=0,_n=0;_r<Tt||_n<Ut;)j[_r+_n]=_r<Tt&&_n<Ut?St(_e[_r],_t[_n])<=0?_e[_r++]:_t[_n++]:_r<Tt?_e[_r++]:_t[_n++];return j};j.exports=mergeSort},7475:(j,_e,_t)=>{var St=_t(7854),Tt=_t(3157),Ut=_t(4411),_r=_t(111),_n=_t(5112)("species"),_i=St.Array;j.exports=function(j){var _e;return Tt(j)&&(_e=j.constructor,(Ut(_e)&&(_e===_i||Tt(_e.prototype))||_r(_e)&&null===(_e=_e[_n]))&&(_e=void 0)),void 0===_e?_i:_e}},5417:(j,_e,_t)=>{var St=_t(7475);j.exports=function(j,_e){return new(St(j))(0===_e?0:_e)}},3411:(j,_e,_t)=>{var St=_t(9670),Tt=_t(9212);j.exports=function(j,_e,_t,Ut){try{return Ut?_e(St(_t)[0],_t[1]):_e(_t)}catch(_e){Tt(j,"throw",_e)}}},7072:(j,_e,_t)=>{var St=_t(5112)("iterator"),Tt=!1;try{var Ut=0,_r={next:function(){return{done:!!Ut++}},return:function(){Tt=!0}};_r[St]=function(){return this},Array.from(_r,(function(){throw 2}))}catch(j){}j.exports=function(j,_e){if(!_e&&!Tt)return!1;var _t=!1;try{var Ut={};Ut[St]=function(){return{next:function(){return{done:_t=!0}}}},j(Ut)}catch(j){}return _t}},4326:(j,_e,_t)=>{var St=_t(1702),Tt=St({}.toString),Ut=St("".slice);j.exports=function(j){return Ut(Tt(j),8,-1)}},648:(j,_e,_t)=>{var St=_t(7854),Tt=_t(1694),Ut=_t(614),_r=_t(4326),_n=_t(5112)("toStringTag"),_i=St.Object,Ei="Arguments"==_r(function(){return arguments}());j.exports=Tt?_r:function(j){var _e,_t,St;return void 0===j?"Undefined":null===j?"Null":"string"==typeof(_t=function(j,_e){try{return j[_e]}catch(j){}}(_e=_i(j),_n))?_t:Ei?_r(_e):"Object"==(St=_r(_e))&&Ut(_e.callee)?"Arguments":St}},1501:(j,_e,_t)=>{"use strict";var St=_t(6916),Tt=_t(9662),Ut=_t(9670);j.exports=function addAll(){for(var j=Ut(this),_e=Tt(j.add),_t=0,_r=arguments.length;_t<_r;_t++)St(_e,j,arguments[_t]);return j}},4092:(j,_e,_t)=>{"use strict";var St=_t(6916),Tt=_t(9662),Ut=_t(9670);j.exports=function deleteAll(){for(var j,_e=Ut(this),_t=Tt(_e.delete),_r=!0,_n=0,_i=arguments.length;_n<_i;_n++)j=St(_t,_e,arguments[_n]),_r=_r&&j;return!!_r}},5631:(j,_e,_t)=>{"use strict";var St=_t(3070).f,Tt=_t(30),Ut=_t(2248),_r=_t(9974),_n=_t(5787),_i=_t(612),Ei=_t(654),Ci=_t(6340),Di=_t(9781),Fi=_t(2423).fastKey,_o=_t(9909),ga=_o.set,_a=_o.getterFor;j.exports={getConstructor:function(j,_e,_t,Ei){var Ci=j((function(j,St){_n(j,_o),ga(j,{type:_e,index:Tt(null),first:void 0,last:void 0,size:0}),Di||(j.size=0),null!=St&&_i(St,j[Ei],{that:j,AS_ENTRIES:_t})})),_o=Ci.prototype,_s=_a(_e),define=function(j,_e,_t){var St,Tt,Ut=_s(j),_r=getEntry(j,_e);return _r?_r.value=_t:(Ut.last=_r={index:Tt=Fi(_e,!0),key:_e,value:_t,previous:St=Ut.last,next:void 0,removed:!1},Ut.first||(Ut.first=_r),St&&(St.next=_r),Di?Ut.size++:j.size++,"F"!==Tt&&(Ut.index[Tt]=_r)),j},getEntry=function(j,_e){var _t,St=_s(j),Tt=Fi(_e);if("F"!==Tt)return St.index[Tt];for(_t=St.first;_t;_t=_t.next)if(_t.key==_e)return _t};return Ut(_o,{clear:function clear(){for(var j=_s(this),_e=j.index,_t=j.first;_t;)_t.removed=!0,_t.previous&&(_t.previous=_t.previous.next=void 0),delete _e[_t.index],_t=_t.next;j.first=j.last=void 0,Di?j.size=0:this.size=0},delete:function(j){var _e=this,_t=_s(_e),St=getEntry(_e,j);if(St){var Tt=St.next,Ut=St.previous;delete _t.index[St.index],St.removed=!0,Ut&&(Ut.next=Tt),Tt&&(Tt.previous=Ut),_t.first==St&&(_t.first=Tt),_t.last==St&&(_t.last=Ut),Di?_t.size--:_e.size--}return!!St},forEach:function forEach(j){for(var _e,_t=_s(this),St=_r(j,arguments.length>1?arguments[1]:void 0);_e=_e?_e.next:_t.first;)for(St(_e.value,_e.key,this);_e&&_e.removed;)_e=_e.previous},has:function has(j){return!!getEntry(this,j)}}),Ut(_o,_t?{get:function get(j){var _e=getEntry(this,j);return _e&&_e.value},set:function set(j,_e){return define(this,0===j?0:j,_e)}}:{add:function add(j){return define(this,j=0===j?0:j,j)}}),Di&&St(_o,"size",{get:function(){return _s(this).size}}),Ci},setStrong:function(j,_e,_t){var St=_e+" Iterator",Tt=_a(_e),Ut=_a(St);Ei(j,_e,(function(j,_e){ga(this,{type:St,target:j,state:Tt(j),kind:_e,last:void 0})}),(function(){for(var j=Ut(this),_e=j.kind,_t=j.last;_t&&_t.removed;)_t=_t.previous;return j.target&&(j.last=_t=_t?_t.next:j.state.first)?"keys"==_e?{value:_t.key,done:!1}:"values"==_e?{value:_t.value,done:!1}:{value:[_t.key,_t.value],done:!1}:(j.target=void 0,{value:void 0,done:!0})}),_t?"entries":"values",!_t,!0),Ci(_e)}}},9320:(j,_e,_t)=>{"use strict";var St=_t(1702),Tt=_t(2248),Ut=_t(2423).getWeakData,_r=_t(9670),_n=_t(111),_i=_t(5787),Ei=_t(612),Ci=_t(2092),Di=_t(2597),Fi=_t(9909),_o=Fi.set,ga=Fi.getterFor,_a=Ci.find,_s=Ci.findIndex,_c=St([].splice),kc=0,uncaughtFrozenStore=function(j){return j.frozen||(j.frozen=new UncaughtFrozenStore)},UncaughtFrozenStore=function(){this.entries=[]},findUncaughtFrozen=function(j,_e){return _a(j.entries,(function(j){return j[0]===_e}))};UncaughtFrozenStore.prototype={get:function(j){var _e=findUncaughtFrozen(this,j);if(_e)return _e[1]},has:function(j){return!!findUncaughtFrozen(this,j)},set:function(j,_e){var _t=findUncaughtFrozen(this,j);_t?_t[1]=_e:this.entries.push([j,_e])},delete:function(j){var _e=_s(this.entries,(function(_e){return _e[0]===j}));return~_e&&_c(this.entries,_e,1),!!~_e}},j.exports={getConstructor:function(j,_e,_t,St){var Ci=j((function(j,Tt){_i(j,Fi),_o(j,{type:_e,id:kc++,frozen:void 0}),null!=Tt&&Ei(Tt,j[St],{that:j,AS_ENTRIES:_t})})),Fi=Ci.prototype,_a=ga(_e),define=function(j,_e,_t){var St=_a(j),Tt=Ut(_r(_e),!0);return!0===Tt?uncaughtFrozenStore(St).set(_e,_t):Tt[St.id]=_t,j};return Tt(Fi,{delete:function(j){var _e=_a(this);if(!_n(j))return!1;var _t=Ut(j);return!0===_t?uncaughtFrozenStore(_e).delete(j):_t&&Di(_t,_e.id)&&delete _t[_e.id]},has:function has(j){var _e=_a(this);if(!_n(j))return!1;var _t=Ut(j);return!0===_t?uncaughtFrozenStore(_e).has(j):_t&&Di(_t,_e.id)}}),Tt(Fi,_t?{get:function get(j){var _e=_a(this);if(_n(j)){var _t=Ut(j);return!0===_t?uncaughtFrozenStore(_e).get(j):_t?_t[_e.id]:void 0}},set:function set(j,_e){return define(this,j,_e)}}:{add:function add(j){return define(this,j,!0)}}),Ci}}},7710:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(1702),_r=_t(4705),_n=_t(1320),_i=_t(2423),Ei=_t(612),Ci=_t(5787),Di=_t(614),Fi=_t(111),_o=_t(7293),ga=_t(7072),_a=_t(8003),_s=_t(9587);j.exports=function(j,_e,_t){var _c=-1!==j.indexOf("Map"),kc=-1!==j.indexOf("Weak"),_u=_c?"set":"add",_l=Tt[j],_d=_l&&_l.prototype,_h=_l,_f={},fixMethod=function(j){var _e=Ut(_d[j]);_n(_d,j,"add"==j?function add(j){return _e(this,0===j?0:j),this}:"delete"==j?function(j){return!(kc&&!Fi(j))&&_e(this,0===j?0:j)}:"get"==j?function get(j){return kc&&!Fi(j)?void 0:_e(this,0===j?0:j)}:"has"==j?function has(j){return!(kc&&!Fi(j))&&_e(this,0===j?0:j)}:function set(j,_t){return _e(this,0===j?0:j,_t),this})};if(_r(j,!Di(_l)||!(kc||_d.forEach&&!_o((function(){(new _l).entries().next()})))))_h=_t.getConstructor(_e,j,_c,_u),_i.enable();else if(_r(j,!0)){var _p=new _h,Eg=_p[_u](kc?{}:-0,1)!=_p,_v=_o((function(){_p.has(1)})),_m=ga((function(j){new _l(j)})),Pm=!kc&&_o((function(){for(var j=new _l,_e=5;_e--;)j[_u](_e,_e);return!j.has(-0)}));_m||((_h=_e((function(j,_e){Ci(j,_d);var _t=_s(new _l,j,_h);return null!=_e&&Ei(_e,_t[_u],{that:_t,AS_ENTRIES:_c}),_t}))).prototype=_d,_d.constructor=_h),(_v||Pm)&&(fixMethod("delete"),fixMethod("has"),_c&&fixMethod("get")),(Pm||Eg)&&fixMethod(_u),kc&&_d.clear&&delete _d.clear}return _f[j]=_h,St({global:!0,forced:_h!=_l},_f),_a(_h,j),kc||_t.setStrong(_h,j,_c),_h}},9920:(j,_e,_t)=>{var St=_t(2597),Tt=_t(3887),Ut=_t(1236),_r=_t(3070);j.exports=function(j,_e,_t){for(var _n=Tt(_e),_i=_r.f,Ei=Ut.f,Ci=0;Ci<_n.length;Ci++){var Di=_n[Ci];St(j,Di)||_t&&St(_t,Di)||_i(j,Di,Ei(_e,Di))}}},4964:(j,_e,_t)=>{var St=_t(5112)("match");j.exports=function(j){var _e=/./;try{"/./"[j](_e)}catch(_t){try{return _e[St]=!1,"/./"[j](_e)}catch(j){}}return!1}},8544:(j,_e,_t)=>{var St=_t(7293);j.exports=!St((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype}))},4230:(j,_e,_t)=>{var St=_t(1702),Tt=_t(4488),Ut=_t(1340),_r=/"/g,_n=St("".replace);j.exports=function(j,_e,_t,St){var _i=Ut(Tt(j)),Ei="<"+_e;return""!==_t&&(Ei+=" "+_t+'="'+_n(Ut(St),_r,""")+'"'),Ei+">"+_i+"</"+_e+">"}},4994:(j,_e,_t)=>{"use strict";var St=_t(3383).IteratorPrototype,Tt=_t(30),Ut=_t(9114),_r=_t(8003),_n=_t(7497),returnThis=function(){return this};j.exports=function(j,_e,_t,_i){var Ei=_e+" Iterator";return j.prototype=Tt(St,{next:Ut(+!_i,_t)}),_r(j,Ei,!1,!0),_n[Ei]=returnThis,j}},8880:(j,_e,_t)=>{var St=_t(9781),Tt=_t(3070),Ut=_t(9114);j.exports=St?function(j,_e,_t){return Tt.f(j,_e,Ut(1,_t))}:function(j,_e,_t){return j[_e]=_t,j}},9114:j=>{j.exports=function(j,_e){return{enumerable:!(1&j),configurable:!(2&j),writable:!(4&j),value:_e}}},6135:(j,_e,_t)=>{"use strict";var St=_t(4948),Tt=_t(3070),Ut=_t(9114);j.exports=function(j,_e,_t){var _r=St(_e);_r in j?Tt.f(j,_r,Ut(0,_t)):j[_r]=_t}},654:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(6916),Ut=_t(1913),_r=_t(6530),_n=_t(614),_i=_t(4994),Ei=_t(9518),Ci=_t(7674),Di=_t(8003),Fi=_t(8880),_o=_t(1320),ga=_t(5112),_a=_t(7497),_s=_t(3383),_c=_r.PROPER,kc=_r.CONFIGURABLE,_u=_s.IteratorPrototype,_l=_s.BUGGY_SAFARI_ITERATORS,_d=ga("iterator"),_h="keys",_f="values",_p="entries",returnThis=function(){return this};j.exports=function(j,_e,_t,_r,ga,_s,Eg){_i(_t,_e,_r);var _v,_m,Pm,getIterationMethod=function(j){if(j===ga&&r_)return r_;if(!_l&&j in e_)return e_[j];switch(j){case _h:return function keys(){return new _t(this,j)};case _f:return function values(){return new _t(this,j)};case _p:return function entries(){return new _t(this,j)}}return function(){return new _t(this)}},_y=_e+" Iterator",_A=!1,e_=j.prototype,t_=e_[_d]||e_["@@iterator"]||ga&&e_[ga],r_=!_l&&t_||getIterationMethod(ga),i_="Array"==_e&&e_.entries||t_;if(i_&&(_v=Ei(i_.call(new j)))!==Object.prototype&&_v.next&&(Ut||Ei(_v)===_u||(Ci?Ci(_v,_u):_n(_v[_d])||_o(_v,_d,returnThis)),Di(_v,_y,!0,!0),Ut&&(_a[_y]=returnThis)),_c&&ga==_f&&t_&&t_.name!==_f&&(!Ut&&kc?Fi(e_,"name",_f):(_A=!0,r_=function values(){return Tt(t_,this)})),ga)if(_m={values:getIterationMethod(_f),keys:_s?r_:getIterationMethod(_h),entries:getIterationMethod(_p)},Eg)for(Pm in _m)(_l||_A||!(Pm in e_))&&_o(e_,Pm,_m[Pm]);else St({target:_e,proto:!0,forced:_l||_A},_m);return Ut&&!Eg||e_[_d]===r_||_o(e_,_d,r_,{name:ga}),_a[_e]=r_,_m}},7235:(j,_e,_t)=>{var St=_t(857),Tt=_t(2597),Ut=_t(6061),_r=_t(3070).f;j.exports=function(j){var _e=St.Symbol||(St.Symbol={});Tt(_e,j)||_r(_e,j,{value:Ut.f(j)})}},9781:(j,_e,_t)=>{var St=_t(7293);j.exports=!St((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(j,_e,_t)=>{var St=_t(7854),Tt=_t(111),Ut=St.document,_r=Tt(Ut)&&Tt(Ut.createElement);j.exports=function(j){return _r?Ut.createElement(j):{}}},8324:j=>{j.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:(j,_e,_t)=>{var St=_t(317)("span").classList,Tt=St&&St.constructor&&St.constructor.prototype;j.exports=Tt===Object.prototype?void 0:Tt},8886:(j,_e,_t)=>{var St=_t(8113).match(/firefox\/(\d+)/i);j.exports=!!St&&+St[1]},7871:j=>{j.exports="object"==typeof window},256:(j,_e,_t)=>{var St=_t(8113);j.exports=/MSIE|Trident/.test(St)},1528:(j,_e,_t)=>{var St=_t(8113),Tt=_t(7854);j.exports=/ipad|iphone|ipod/i.test(St)&&void 0!==Tt.Pebble},6833:(j,_e,_t)=>{var St=_t(8113);j.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(St)},5268:(j,_e,_t)=>{var St=_t(4326),Tt=_t(7854);j.exports="process"==St(Tt.process)},1036:(j,_e,_t)=>{var St=_t(8113);j.exports=/web0s(?!.*chrome)/i.test(St)},8113:(j,_e,_t)=>{var St=_t(5005);j.exports=St("navigator","userAgent")||""},7392:(j,_e,_t)=>{var St,Tt,Ut=_t(7854),_r=_t(8113),_n=Ut.process,_i=Ut.Deno,Ei=_n&&_n.versions||_i&&_i.version,Ci=Ei&&Ei.v8;Ci&&(Tt=(St=Ci.split("."))[0]>0&&St[0]<4?1:+(St[0]+St[1])),!Tt&&_r&&(!(St=_r.match(/Edge\/(\d+)/))||St[1]>=74)&&(St=_r.match(/Chrome\/(\d+)/))&&(Tt=+St[1]),j.exports=Tt},8008:(j,_e,_t)=>{var St=_t(8113).match(/AppleWebKit\/(\d+)\./);j.exports=!!St&&+St[1]},748:j=>{j.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(j,_e,_t)=>{var St=_t(7854),Tt=_t(1236).f,Ut=_t(8880),_r=_t(1320),_n=_t(3505),_i=_t(9920),Ei=_t(4705);j.exports=function(j,_e){var _t,Ci,Di,Fi,_o,ga=j.target,_a=j.global,_s=j.stat;if(_t=_a?St:_s?St[ga]||_n(ga,{}):(St[ga]||{}).prototype)for(Ci in _e){if(Fi=_e[Ci],Di=j.noTargetGet?(_o=Tt(_t,Ci))&&_o.value:_t[Ci],!Ei(_a?Ci:ga+(_s?".":"#")+Ci,j.forced)&&void 0!==Di){if(typeof Fi==typeof Di)continue;_i(Fi,Di)}(j.sham||Di&&Di.sham)&&Ut(Fi,"sham",!0),_r(_t,Ci,Fi,j)}}},7293:j=>{j.exports=function(j){try{return!!j()}catch(j){return!0}}},7007:(j,_e,_t)=>{"use strict";_t(4916);var St=_t(1702),Tt=_t(1320),Ut=_t(2261),_r=_t(7293),_n=_t(5112),_i=_t(8880),Ei=_n("species"),Ci=RegExp.prototype;j.exports=function(j,_e,_t,Di){var Fi=_n(j),_o=!_r((function(){var _e={};return _e[Fi]=function(){return 7},7!=""[j](_e)})),ga=_o&&!_r((function(){var _e=!1,_t=/a/;return"split"===j&&((_t={}).constructor={},_t.constructor[Ei]=function(){return _t},_t.flags="",_t[Fi]=/./[Fi]),_t.exec=function(){return _e=!0,null},_t[Fi](""),!_e}));if(!_o||!ga||_t){var _a=St(/./[Fi]),_s=_e(Fi,""[j],(function(j,_e,_t,Tt,_r){var _n=St(j),_i=_e.exec;return _i===Ut||_i===Ci.exec?_o&&!_r?{done:!0,value:_a(_e,_t,Tt)}:{done:!0,value:_n(_t,_e,Tt)}:{done:!1}}));Tt(String.prototype,j,_s[0]),Tt(Ci,Fi,_s[1])}Di&&_i(Ci[Fi],"sham",!0)}},6677:(j,_e,_t)=>{var St=_t(7293);j.exports=!St((function(){return Object.isExtensible(Object.preventExtensions({}))}))},2104:j=>{var _e=Function.prototype,_t=_e.apply,St=_e.bind,Tt=_e.call;j.exports="object"==typeof Reflect&&Reflect.apply||(St?Tt.bind(_t):function(){return Tt.apply(_t,arguments)})},9974:(j,_e,_t)=>{var St=_t(1702),Tt=_t(9662),Ut=St(St.bind);j.exports=function(j,_e){return Tt(j),void 0===_e?j:Ut?Ut(j,_e):function(){return j.apply(_e,arguments)}}},7065:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(1702),Ut=_t(9662),_r=_t(111),_n=_t(2597),_i=_t(206),Ei=St.Function,Ci=Tt([].concat),Di=Tt([].join),Fi={},construct=function(j,_e,_t){if(!_n(Fi,_e)){for(var St=[],Tt=0;Tt<_e;Tt++)St[Tt]="a["+Tt+"]";Fi[_e]=Ei("C,a","return new C("+Di(St,",")+")")}return Fi[_e](j,_t)};j.exports=Ei.bind||function bind(j){var _e=Ut(this),_t=_e.prototype,St=_i(arguments,1),Tt=function bound(){var _t=Ci(St,_i(arguments));return this instanceof Tt?construct(_e,_t.length,_t):_e.apply(j,_t)};return _r(_t)&&(Tt.prototype=_t),Tt}},6916:j=>{var _e=Function.prototype.call;j.exports=_e.bind?_e.bind(_e):function(){return _e.apply(_e,arguments)}},6530:(j,_e,_t)=>{var St=_t(9781),Tt=_t(2597),Ut=Function.prototype,_r=St&&Object.getOwnPropertyDescriptor,_n=Tt(Ut,"name"),_i=_n&&"something"===function something(){}.name,Ei=_n&&(!St||St&&_r(Ut,"name").configurable);j.exports={EXISTS:_n,PROPER:_i,CONFIGURABLE:Ei}},1702:j=>{var _e=Function.prototype,_t=_e.bind,St=_e.call,Tt=_t&&_t.bind(St);j.exports=_t?function(j){return j&&Tt(St,j)}:function(j){return j&&function(){return St.apply(j,arguments)}}},5005:(j,_e,_t)=>{var St=_t(7854),Tt=_t(614),aFunction=function(j){return Tt(j)?j:void 0};j.exports=function(j,_e){return arguments.length<2?aFunction(St[j]):St[j]&&St[j][_e]}},1246:(j,_e,_t)=>{var St=_t(648),Tt=_t(8173),Ut=_t(7497),_r=_t(5112)("iterator");j.exports=function(j){if(null!=j)return Tt(j,_r)||Tt(j,"@@iterator")||Ut[St(j)]}},8554:(j,_e,_t)=>{var St=_t(7854),Tt=_t(6916),Ut=_t(9662),_r=_t(9670),_n=_t(6330),_i=_t(1246),Ei=St.TypeError;j.exports=function(j,_e){var _t=arguments.length<2?_i(j):_e;if(Ut(_t))return _r(Tt(_t,j));throw Ei(_n(j)+" is not iterable")}},4647:(j,_e,_t)=>{var St=_t(6916);j.exports=function(j){return St(Map.prototype.entries,j)}},8173:(j,_e,_t)=>{var St=_t(9662);j.exports=function(j,_e){var _t=j[_e];return null==_t?void 0:St(_t)}},6767:(j,_e,_t)=>{var St=_t(6916);j.exports=function(j){return St(Set.prototype.values,j)}},647:(j,_e,_t)=>{var St=_t(1702),Tt=_t(7908),Ut=Math.floor,_r=St("".charAt),_n=St("".replace),_i=St("".slice),Ei=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Ci=/\$([$&'`]|\d{1,2})/g;j.exports=function(j,_e,_t,St,Di,Fi){var _o=_t+j.length,ga=St.length,_a=Ci;return void 0!==Di&&(Di=Tt(Di),_a=Ei),_n(Fi,_a,(function(Tt,_n){var Ei;switch(_r(_n,0)){case"$":return"$";case"&":return j;case"`":return _i(_e,0,_t);case"'":return _i(_e,_o);case"<":Ei=Di[_i(_n,1,-1)];break;default:var Ci=+_n;if(0===Ci)return Tt;if(Ci>ga){var Fi=Ut(Ci/10);return 0===Fi?Tt:Fi<=ga?void 0===St[Fi-1]?_r(_n,1):St[Fi-1]+_r(_n,1):Tt}Ei=St[Ci-1]}return void 0===Ei?"":Ei}))}},7854:(j,_e,_t)=>{var check=function(j){return j&&j.Math==Math&&j};j.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof _t.g&&_t.g)||function(){return this}()||Function("return this")()},2597:(j,_e,_t)=>{var St=_t(1702),Tt=_t(7908),Ut=St({}.hasOwnProperty);j.exports=Object.hasOwn||function hasOwn(j,_e){return Ut(Tt(j),_e)}},3501:j=>{j.exports={}},842:(j,_e,_t)=>{var St=_t(7854);j.exports=function(j,_e){var _t=St.console;_t&&_t.error&&(1==arguments.length?_t.error(j):_t.error(j,_e))}},490:(j,_e,_t)=>{var St=_t(5005);j.exports=St("document","documentElement")},4664:(j,_e,_t)=>{var St=_t(9781),Tt=_t(7293),Ut=_t(317);j.exports=!St&&!Tt((function(){return 7!=Object.defineProperty(Ut("div"),"a",{get:function(){return 7}}).a}))},1179:(j,_e,_t)=>{var St=_t(7854).Array,Tt=Math.abs,Ut=Math.pow,_r=Math.floor,_n=Math.log,_i=Math.LN2;j.exports={pack:function(j,_e,_t){var Ei,Ci,Di,Fi=St(_t),_o=8*_t-_e-1,ga=(1<<_o)-1,_a=ga>>1,_s=23===_e?Ut(2,-24)-Ut(2,-77):0,_c=j<0||0===j&&1/j<0?1:0,kc=0;for((j=Tt(j))!=j||j===1/0?(Ci=j!=j?1:0,Ei=ga):(Ei=_r(_n(j)/_i),j*(Di=Ut(2,-Ei))<1&&(Ei--,Di*=2),(j+=Ei+_a>=1?_s/Di:_s*Ut(2,1-_a))*Di>=2&&(Ei++,Di/=2),Ei+_a>=ga?(Ci=0,Ei=ga):Ei+_a>=1?(Ci=(j*Di-1)*Ut(2,_e),Ei+=_a):(Ci=j*Ut(2,_a-1)*Ut(2,_e),Ei=0));_e>=8;)Fi[kc++]=255&Ci,Ci/=256,_e-=8;for(Ei=Ei<<_e|Ci,_o+=_e;_o>0;)Fi[kc++]=255&Ei,Ei/=256,_o-=8;return Fi[--kc]|=128*_c,Fi},unpack:function(j,_e){var _t,St=j.length,Tt=8*St-_e-1,_r=(1<<Tt)-1,_n=_r>>1,_i=Tt-7,Ei=St-1,Ci=j[Ei--],Di=127&Ci;for(Ci>>=7;_i>0;)Di=256*Di+j[Ei--],_i-=8;for(_t=Di&(1<<-_i)-1,Di>>=-_i,_i+=_e;_i>0;)_t=256*_t+j[Ei--],_i-=8;if(0===Di)Di=1-_n;else{if(Di===_r)return _t?NaN:Ci?-1/0:1/0;_t+=Ut(2,_e),Di-=_n}return(Ci?-1:1)*_t*Ut(2,Di-_e)}}},8361:(j,_e,_t)=>{var St=_t(7854),Tt=_t(1702),Ut=_t(7293),_r=_t(4326),_n=St.Object,_i=Tt("".split);j.exports=Ut((function(){return!_n("z").propertyIsEnumerable(0)}))?function(j){return"String"==_r(j)?_i(j,""):_n(j)}:_n},9587:(j,_e,_t)=>{var St=_t(614),Tt=_t(111),Ut=_t(7674);j.exports=function(j,_e,_t){var _r,_n;return Ut&&St(_r=_e.constructor)&&_r!==_t&&Tt(_n=_r.prototype)&&_n!==_t.prototype&&Ut(j,_n),j}},2788:(j,_e,_t)=>{var St=_t(1702),Tt=_t(614),Ut=_t(5465),_r=St(Function.toString);Tt(Ut.inspectSource)||(Ut.inspectSource=function(j){return _r(j)}),j.exports=Ut.inspectSource},2423:(j,_e,_t)=>{var St=_t(2109),Tt=_t(1702),Ut=_t(3501),_r=_t(111),_n=_t(2597),_i=_t(3070).f,Ei=_t(8006),Ci=_t(1156),Di=_t(2050),Fi=_t(9711),_o=_t(6677),ga=!1,_a=Fi("meta"),_s=0,setMetadata=function(j){_i(j,_a,{value:{objectID:"O"+_s++,weakData:{}}})},_c=j.exports={enable:function(){_c.enable=function(){},ga=!0;var j=Ei.f,_e=Tt([].splice),_t={};_t[_a]=1,j(_t).length&&(Ei.f=function(_t){for(var St=j(_t),Tt=0,Ut=St.length;Tt<Ut;Tt++)if(St[Tt]===_a){_e(St,Tt,1);break}return St},St({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Ci.f}))},fastKey:function(j,_e){if(!_r(j))return"symbol"==typeof j?j:("string"==typeof j?"S":"P")+j;if(!_n(j,_a)){if(!Di(j))return"F";if(!_e)return"E";setMetadata(j)}return j[_a].objectID},getWeakData:function(j,_e){if(!_n(j,_a)){if(!Di(j))return!0;if(!_e)return!1;setMetadata(j)}return j[_a].weakData},onFreeze:function(j){return _o&&ga&&Di(j)&&!_n(j,_a)&&setMetadata(j),j}};Ut[_a]=!0},9909:(j,_e,_t)=>{var St,Tt,Ut,_r=_t(8536),_n=_t(7854),_i=_t(1702),Ei=_t(111),Ci=_t(8880),Di=_t(2597),Fi=_t(5465),_o=_t(6200),ga=_t(3501),_a="Object already initialized",_s=_n.TypeError,_c=_n.WeakMap;if(_r||Fi.state){var kc=Fi.state||(Fi.state=new _c),_u=_i(kc.get),_l=_i(kc.has),_d=_i(kc.set);St=function(j,_e){if(_l(kc,j))throw new _s(_a);return _e.facade=j,_d(kc,j,_e),_e},Tt=function(j){return _u(kc,j)||{}},Ut=function(j){return _l(kc,j)}}else{var _h=_o("state");ga[_h]=!0,St=function(j,_e){if(Di(j,_h))throw new _s(_a);return _e.facade=j,Ci(j,_h,_e),_e},Tt=function(j){return Di(j,_h)?j[_h]:{}},Ut=function(j){return Di(j,_h)}}j.exports={set:St,get:Tt,has:Ut,enforce:function(j){return Ut(j)?Tt(j):St(j,{})},getterFor:function(j){return function(_e){var _t;if(!Ei(_e)||(_t=Tt(_e)).type!==j)throw _s("Incompatible receiver, "+j+" required");return _t}}}},7659:(j,_e,_t)=>{var St=_t(5112),Tt=_t(7497),Ut=St("iterator"),_r=Array.prototype;j.exports=function(j){return void 0!==j&&(Tt.Array===j||_r[Ut]===j)}},3157:(j,_e,_t)=>{var St=_t(4326);j.exports=Array.isArray||function isArray(j){return"Array"==St(j)}},614:j=>{j.exports=function(j){return"function"==typeof j}},4411:(j,_e,_t)=>{var St=_t(1702),Tt=_t(7293),Ut=_t(614),_r=_t(648),_n=_t(5005),_i=_t(2788),noop=function(){},Ei=[],Ci=_n("Reflect","construct"),Di=/^\s*(?:class|function)\b/,Fi=St(Di.exec),_o=!Di.exec(noop),ga=function isConstructor(j){if(!Ut(j))return!1;try{return Ci(noop,Ei,j),!0}catch(j){return!1}},_a=function isConstructor(j){if(!Ut(j))return!1;switch(_r(j)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _o||!!Fi(Di,_i(j))}catch(j){return!0}};_a.sham=!0,j.exports=!Ci||Tt((function(){var j;return ga(ga.call)||!ga(Object)||!ga((function(){j=!0}))||j}))?_a:ga},4705:(j,_e,_t)=>{var St=_t(7293),Tt=_t(614),Ut=/#|\.prototype\./,isForced=function(j,_e){var _t=_n[_r(j)];return _t==Ei||_t!=_i&&(Tt(_e)?St(_e):!!_e)},_r=isForced.normalize=function(j){return String(j).replace(Ut,".").toLowerCase()},_n=isForced.data={},_i=isForced.NATIVE="N",Ei=isForced.POLYFILL="P";j.exports=isForced},5988:(j,_e,_t)=>{var St=_t(111),Tt=Math.floor;j.exports=Number.isInteger||function isInteger(j){return!St(j)&&isFinite(j)&&Tt(j)===j}},111:(j,_e,_t)=>{var St=_t(614);j.exports=function(j){return"object"==typeof j?null!==j:St(j)}},1913:j=>{j.exports=!1},7850:(j,_e,_t)=>{var St=_t(111),Tt=_t(4326),Ut=_t(5112)("match");j.exports=function(j){var _e;return St(j)&&(void 0!==(_e=j[Ut])?!!_e:"RegExp"==Tt(j))}},2190:(j,_e,_t)=>{var St=_t(7854),Tt=_t(5005),Ut=_t(614),_r=_t(7976),_n=_t(3307),_i=St.Object;j.exports=_n?function(j){return"symbol"==typeof j}:function(j){var _e=Tt("Symbol");return Ut(_e)&&_r(_e.prototype,_i(j))}},612:(j,_e,_t)=>{var St=_t(7854),Tt=_t(9974),Ut=_t(6916),_r=_t(9670),_n=_t(6330),_i=_t(7659),Ei=_t(6244),Ci=_t(7976),Di=_t(8554),Fi=_t(1246),_o=_t(9212),ga=St.TypeError,Result=function(j,_e){this.stopped=j,this.result=_e},_a=Result.prototype;j.exports=function(j,_e,_t){var St,_s,_c,kc,_u,_l,_d,_h=_t&&_t.that,_f=!(!_t||!_t.AS_ENTRIES),_p=!(!_t||!_t.IS_ITERATOR),Eg=!(!_t||!_t.INTERRUPTED),_v=Tt(_e,_h),stop=function(j){return St&&_o(St,"normal",j),new Result(!0,j)},callFn=function(j){return _f?(_r(j),Eg?_v(j[0],j[1],stop):_v(j[0],j[1])):Eg?_v(j,stop):_v(j)};if(_p)St=j;else{if(!(_s=Fi(j)))throw ga(_n(j)+" is not iterable");if(_i(_s)){for(_c=0,kc=Ei(j);kc>_c;_c++)if((_u=callFn(j[_c]))&&Ci(_a,_u))return _u;return new Result(!1)}St=Di(j,_s)}for(_l=St.next;!(_d=Ut(_l,St)).done;){try{_u=callFn(_d.value)}catch(j){_o(St,"throw",j)}if("object"==typeof _u&&_u&&Ci(_a,_u))return _u}return new Result(!1)}},9212:(j,_e,_t)=>{var St=_t(6916),Tt=_t(9670),Ut=_t(8173);j.exports=function(j,_e,_t){var _r,_n;Tt(j);try{if(!(_r=Ut(j,"return"))){if("throw"===_e)throw _t;return _t}_r=St(_r,j)}catch(j){_n=!0,_r=j}if("throw"===_e)throw _t;if(_n)throw _r;return Tt(_r),_t}},3383:(j,_e,_t)=>{"use strict";var St,Tt,Ut,_r=_t(7293),_n=_t(614),_i=_t(30),Ei=_t(9518),Ci=_t(1320),Di=_t(5112),Fi=_t(1913),_o=Di("iterator"),ga=!1;[].keys&&("next"in(Ut=[].keys())?(Tt=Ei(Ei(Ut)))!==Object.prototype&&(St=Tt):ga=!0),null==St||_r((function(){var j={};return St[_o].call(j)!==j}))?St={}:Fi&&(St=_i(St)),_n(St[_o])||Ci(St,_o,(function(){return this})),j.exports={IteratorPrototype:St,BUGGY_SAFARI_ITERATORS:ga}},7497:j=>{j.exports={}},6244:(j,_e,_t)=>{var St=_t(7466);j.exports=function(j){return St(j.length)}},5948:(j,_e,_t)=>{var St,Tt,Ut,_r,_n,_i,Ei,Ci,Di=_t(7854),Fi=_t(9974),_o=_t(1236).f,ga=_t(261).set,_a=_t(6833),_s=_t(1528),_c=_t(1036),kc=_t(5268),_u=Di.MutationObserver||Di.WebKitMutationObserver,_l=Di.document,_d=Di.process,_h=Di.Promise,_f=_o(Di,"queueMicrotask"),_p=_f&&_f.value;_p||(St=function(){var j,_e;for(kc&&(j=_d.domain)&&j.exit();Tt;){_e=Tt.fn,Tt=Tt.next;try{_e()}catch(j){throw Tt?_r():Ut=void 0,j}}Ut=void 0,j&&j.enter()},_a||kc||_c||!_u||!_l?!_s&&_h&&_h.resolve?((Ei=_h.resolve(void 0)).constructor=_h,Ci=Fi(Ei.then,Ei),_r=function(){Ci(St)}):kc?_r=function(){_d.nextTick(St)}:(ga=Fi(ga,Di),_r=function(){ga(St)}):(_n=!0,_i=_l.createTextNode(""),new _u(St).observe(_i,{characterData:!0}),_r=function(){_i.data=_n=!_n})),j.exports=_p||function(j){var _e={fn:j,next:void 0};Ut&&(Ut.next=_e),Tt||(Tt=_e,_r()),Ut=_e}},3366:(j,_e,_t)=>{var St=_t(7854);j.exports=St.Promise},133:(j,_e,_t)=>{var St=_t(7392),Tt=_t(7293);j.exports=!!Object.getOwnPropertySymbols&&!Tt((function(){var j=Symbol();return!String(j)||!(Object(j)instanceof Symbol)||!Symbol.sham&&St&&St<41}))},8536:(j,_e,_t)=>{var St=_t(7854),Tt=_t(614),Ut=_t(2788),_r=St.WeakMap;j.exports=Tt(_r)&&/native code/.test(Ut(_r))},8523:(j,_e,_t)=>{"use strict";var St=_t(9662),PromiseCapability=function(j){var _e,_t;this.promise=new j((function(j,St){if(void 0!==_e||void 0!==_t)throw TypeError("Bad Promise constructor");_e=j,_t=St})),this.resolve=St(_e),this.reject=St(_t)};j.exports.f=function(j){return new PromiseCapability(j)}},3929:(j,_e,_t)=>{var St=_t(7854),Tt=_t(7850),Ut=St.TypeError;j.exports=function(j){if(Tt(j))throw Ut("The method doesn't accept regular expressions");return j}},3009:(j,_e,_t)=>{var St=_t(7854),Tt=_t(7293),Ut=_t(1702),_r=_t(1340),_n=_t(3111).trim,_i=_t(1361),Ei=St.parseInt,Ci=St.Symbol,Di=Ci&&Ci.iterator,Fi=/^[+-]?0x/i,_o=Ut(Fi.exec),ga=8!==Ei(_i+"08")||22!==Ei(_i+"0x16")||Di&&!Tt((function(){Ei(Object(Di))}));j.exports=ga?function parseInt(j,_e){var _t=_n(_r(j));return Ei(_t,_e>>>0||(_o(Fi,_t)?16:10))}:Ei},1574:(j,_e,_t)=>{"use strict";var St=_t(9781),Tt=_t(1702),Ut=_t(6916),_r=_t(7293),_n=_t(1956),_i=_t(5181),Ei=_t(5296),Ci=_t(7908),Di=_t(8361),Fi=Object.assign,_o=Object.defineProperty,ga=Tt([].concat);j.exports=!Fi||_r((function(){if(St&&1!==Fi({b:1},Fi(_o({},"a",{enumerable:!0,get:function(){_o(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var j={},_e={},_t=Symbol(),Tt="abcdefghijklmnopqrst";return j[_t]=7,Tt.split("").forEach((function(j){_e[j]=j})),7!=Fi({},j)[_t]||_n(Fi({},_e)).join("")!=Tt}))?function assign(j,_e){for(var _t=Ci(j),Tt=arguments.length,_r=1,Fi=_i.f,_o=Ei.f;Tt>_r;)for(var _a,_s=Di(arguments[_r++]),_c=Fi?ga(_n(_s),Fi(_s)):_n(_s),kc=_c.length,_u=0;kc>_u;)_a=_c[_u++],St&&!Ut(_o,_s,_a)||(_t[_a]=_s[_a]);return _t}:Fi},30:(j,_e,_t)=>{var St,Tt=_t(9670),Ut=_t(6048),_r=_t(748),_n=_t(3501),_i=_t(490),Ei=_t(317),Ci=_t(6200),Di="prototype",Fi="script",_o=Ci("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(j){return"<"+Fi+">"+j+"</"+Fi+">"},NullProtoObjectViaActiveX=function(j){j.write(scriptTag("")),j.close();var _e=j.parentWindow.Object;return j=null,_e},NullProtoObject=function(){try{St=new ActiveXObject("htmlfile")}catch(j){}var j,_e,_t;NullProtoObject="undefined"!=typeof document?document.domain&&St?NullProtoObjectViaActiveX(St):(_e=Ei("iframe"),_t="java"+Fi+":",_e.style.display="none",_i.appendChild(_e),_e.src=String(_t),(j=_e.contentWindow.document).open(),j.write(scriptTag("document.F=Object")),j.close(),j.F):NullProtoObjectViaActiveX(St);for(var Tt=_r.length;Tt--;)delete NullProtoObject[Di][_r[Tt]];return NullProtoObject()};_n[_o]=!0,j.exports=Object.create||function create(j,_e){var _t;return null!==j?(EmptyConstructor[Di]=Tt(j),_t=new EmptyConstructor,EmptyConstructor[Di]=null,_t[_o]=j):_t=NullProtoObject(),void 0===_e?_t:Ut(_t,_e)}},6048:(j,_e,_t)=>{var St=_t(9781),Tt=_t(3070),Ut=_t(9670),_r=_t(5656),_n=_t(1956);j.exports=St?Object.defineProperties:function defineProperties(j,_e){Ut(j);for(var _t,St=_r(_e),_i=_n(_e),Ei=_i.length,Ci=0;Ei>Ci;)Tt.f(j,_t=_i[Ci++],St[_t]);return j}},3070:(j,_e,_t)=>{var St=_t(7854),Tt=_t(9781),Ut=_t(4664),_r=_t(9670),_n=_t(4948),_i=St.TypeError,Ei=Object.defineProperty;_e.f=Tt?Ei:function defineProperty(j,_e,_t){if(_r(j),_e=_n(_e),_r(_t),Ut)try{return Ei(j,_e,_t)}catch(j){}if("get"in _t||"set"in _t)throw _i("Accessors not supported");return"value"in _t&&(j[_e]=_t.value),j}},1236:(j,_e,_t)=>{var St=_t(9781),Tt=_t(6916),Ut=_t(5296),_r=_t(9114),_n=_t(5656),_i=_t(4948),Ei=_t(2597),Ci=_t(4664),Di=Object.getOwnPropertyDescriptor;_e.f=St?Di:function getOwnPropertyDescriptor(j,_e){if(j=_n(j),_e=_i(_e),Ci)try{return Di(j,_e)}catch(j){}if(Ei(j,_e))return _r(!Tt(Ut.f,j,_e),j[_e])}},1156:(j,_e,_t)=>{var St=_t(4326),Tt=_t(5656),Ut=_t(8006).f,_r=_t(1589),_n="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];j.exports.f=function getOwnPropertyNames(j){return _n&&"Window"==St(j)?function(j){try{return Ut(j)}catch(j){return _r(_n)}}(j):Ut(Tt(j))}},8006:(j,_e,_t)=>{var St=_t(6324),Tt=_t(748).concat("length","prototype");_e.f=Object.getOwnPropertyNames||function getOwnPropertyNames(j){return St(j,Tt)}},5181:(j,_e)=>{_e.f=Object.getOwnPropertySymbols},9518:(j,_e,_t)=>{var St=_t(7854),Tt=_t(2597),Ut=_t(614),_r=_t(7908),_n=_t(6200),_i=_t(8544),Ei=_n("IE_PROTO"),Ci=St.Object,Di=Ci.prototype;j.exports=_i?Ci.getPrototypeOf:function(j){var _e=_r(j);if(Tt(_e,Ei))return _e[Ei];var _t=_e.constructor;return Ut(_t)&&_e instanceof _t?_t.prototype:_e instanceof Ci?Di:null}},2050:(j,_e,_t)=>{var St=_t(7293),Tt=_t(111),Ut=_t(4326),_r=_t(7556),_n=Object.isExtensible,_i=St((function(){_n(1)}));j.exports=_i||_r?function isExtensible(j){return!!Tt(j)&&((!_r||"ArrayBuffer"!=Ut(j))&&(!_n||_n(j)))}:_n},7976:(j,_e,_t)=>{var St=_t(1702);j.exports=St({}.isPrototypeOf)},6324:(j,_e,_t)=>{var St=_t(1702),Tt=_t(2597),Ut=_t(5656),_r=_t(5367).indexOf,_n=_t(3501),_i=St([].push);j.exports=function(j,_e){var _t,St=Ut(j),Ei=0,Ci=[];for(_t in St)!Tt(_n,_t)&&Tt(St,_t)&&_i(Ci,_t);for(;_e.length>Ei;)Tt(St,_t=_e[Ei++])&&(~_r(Ci,_t)||_i(Ci,_t));return Ci}},1956:(j,_e,_t)=>{var St=_t(6324),Tt=_t(748);j.exports=Object.keys||function keys(j){return St(j,Tt)}},5296:(j,_e)=>{"use strict";var _t={}.propertyIsEnumerable,St=Object.getOwnPropertyDescriptor,Tt=St&&!_t.call({1:2},1);_e.f=Tt?function propertyIsEnumerable(j){var _e=St(this,j);return!!_e&&_e.enumerable}:_t},7674:(j,_e,_t)=>{var St=_t(1702),Tt=_t(9670),Ut=_t(6077);j.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var j,_e=!1,_t={};try{(j=St(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(_t,[]),_e=_t instanceof Array}catch(j){}return function setPrototypeOf(_t,St){return Tt(_t),Ut(St),_e?j(_t,St):_t.__proto__=St,_t}}():void 0)},4699:(j,_e,_t)=>{var St=_t(9781),Tt=_t(1702),Ut=_t(1956),_r=_t(5656),_n=Tt(_t(5296).f),_i=Tt([].push),createMethod=function(j){return function(_e){for(var _t,Tt=_r(_e),Ei=Ut(Tt),Ci=Ei.length,Di=0,Fi=[];Ci>Di;)_t=Ei[Di++],St&&!_n(Tt,_t)||_i(Fi,j?[_t,Tt[_t]]:Tt[_t]);return Fi}};j.exports={entries:createMethod(!0),values:createMethod(!1)}},288:(j,_e,_t)=>{"use strict";var St=_t(1694),Tt=_t(648);j.exports=St?{}.toString:function toString(){return"[object "+Tt(this)+"]"}},2140:(j,_e,_t)=>{var St=_t(7854),Tt=_t(6916),Ut=_t(614),_r=_t(111),_n=St.TypeError;j.exports=function(j,_e){var _t,St;if("string"===_e&&Ut(_t=j.toString)&&!_r(St=Tt(_t,j)))return St;if(Ut(_t=j.valueOf)&&!_r(St=Tt(_t,j)))return St;if("string"!==_e&&Ut(_t=j.toString)&&!_r(St=Tt(_t,j)))return St;throw _n("Can't convert object to primitive value")}},3887:(j,_e,_t)=>{var St=_t(5005),Tt=_t(1702),Ut=_t(8006),_r=_t(5181),_n=_t(9670),_i=Tt([].concat);j.exports=St("Reflect","ownKeys")||function ownKeys(j){var _e=Ut.f(_n(j)),_t=_r.f;return _t?_i(_e,_t(j)):_e}},857:(j,_e,_t)=>{var St=_t(7854);j.exports=St},2534:j=>{j.exports=function(j){try{return{error:!1,value:j()}}catch(j){return{error:!0,value:j}}}},9478:(j,_e,_t)=>{var St=_t(9670),Tt=_t(111),Ut=_t(8523);j.exports=function(j,_e){if(St(j),Tt(_e)&&_e.constructor===j)return _e;var _t=Ut.f(j);return(0,_t.resolve)(_e),_t.promise}},8572:j=>{var Queue=function(){this.head=null,this.tail=null};Queue.prototype={add:function(j){var _e={item:j,next:null};this.head?this.tail.next=_e:this.head=_e,this.tail=_e},get:function(){var j=this.head;if(j)return this.head=j.next,this.tail===j&&(this.tail=null),j.item}},j.exports=Queue},2248:(j,_e,_t)=>{var St=_t(1320);j.exports=function(j,_e,_t){for(var Tt in _e)St(j,Tt,_e[Tt],_t);return j}},1320:(j,_e,_t)=>{var St=_t(7854),Tt=_t(614),Ut=_t(2597),_r=_t(8880),_n=_t(3505),_i=_t(2788),Ei=_t(9909),Ci=_t(6530).CONFIGURABLE,Di=Ei.get,Fi=Ei.enforce,_o=String(String).split("String");(j.exports=function(j,_e,_t,_i){var Ei,Di=!!_i&&!!_i.unsafe,ga=!!_i&&!!_i.enumerable,_a=!!_i&&!!_i.noTargetGet,_s=_i&&void 0!==_i.name?_i.name:_e;Tt(_t)&&("Symbol("===String(_s).slice(0,7)&&(_s="["+String(_s).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Ut(_t,"name")||Ci&&_t.name!==_s)&&_r(_t,"name",_s),(Ei=Fi(_t)).source||(Ei.source=_o.join("string"==typeof _s?_s:""))),j!==St?(Di?!_a&&j[_e]&&(ga=!0):delete j[_e],ga?j[_e]=_t:_r(j,_e,_t)):ga?j[_e]=_t:_n(_e,_t)})(Function.prototype,"toString",(function toString(){return Tt(this)&&Di(this).source||_i(this)}))},7651:(j,_e,_t)=>{var St=_t(7854),Tt=_t(6916),Ut=_t(9670),_r=_t(614),_n=_t(4326),_i=_t(2261),Ei=St.TypeError;j.exports=function(j,_e){var _t=j.exec;if(_r(_t)){var St=Tt(_t,j,_e);return null!==St&&Ut(St),St}if("RegExp"===_n(j))return Tt(_i,j,_e);throw Ei("RegExp#exec called on incompatible receiver")}},2261:(j,_e,_t)=>{"use strict";var St,Tt,Ut=_t(6916),_r=_t(1702),_n=_t(1340),_i=_t(7066),Ei=_t(2999),Ci=_t(2309),Di=_t(30),Fi=_t(9909).get,_o=_t(9441),ga=_t(7168),_a=Ci("native-string-replace",String.prototype.replace),_s=RegExp.prototype.exec,_c=_s,kc=_r("".charAt),_u=_r("".indexOf),_l=_r("".replace),_d=_r("".slice),_h=(Tt=/b*/g,Ut(_s,St=/a/,"a"),Ut(_s,Tt,"a"),0!==St.lastIndex||0!==Tt.lastIndex),_f=Ei.BROKEN_CARET,_p=void 0!==/()??/.exec("")[1];(_h||_p||_f||_o||ga)&&(_c=function exec(j){var _e,_t,St,Tt,_r,Ei,Ci,_o=this,ga=Fi(_o),Eg=_n(j),_v=ga.raw;if(_v)return _v.lastIndex=_o.lastIndex,_e=Ut(_c,_v,Eg),_o.lastIndex=_v.lastIndex,_e;var _m=ga.groups,Pm=_f&&_o.sticky,_y=Ut(_i,_o),_A=_o.source,e_=0,t_=Eg;if(Pm&&(_y=_l(_y,"y",""),-1===_u(_y,"g")&&(_y+="g"),t_=_d(Eg,_o.lastIndex),_o.lastIndex>0&&(!_o.multiline||_o.multiline&&"\n"!==kc(Eg,_o.lastIndex-1))&&(_A="(?: "+_A+")",t_=" "+t_,e_++),_t=new RegExp("^(?:"+_A+")",_y)),_p&&(_t=new RegExp("^"+_A+"$(?!\\s)",_y)),_h&&(St=_o.lastIndex),Tt=Ut(_s,Pm?_t:_o,t_),Pm?Tt?(Tt.input=_d(Tt.input,e_),Tt[0]=_d(Tt[0],e_),Tt.index=_o.lastIndex,_o.lastIndex+=Tt[0].length):_o.lastIndex=0:_h&&Tt&&(_o.lastIndex=_o.global?Tt.index+Tt[0].length:St),_p&&Tt&&Tt.length>1&&Ut(_a,Tt[0],_t,(function(){for(_r=1;_r<arguments.length-2;_r++)void 0===arguments[_r]&&(Tt[_r]=void 0)})),Tt&&_m)for(Tt.groups=Ei=Di(null),_r=0;_r<_m.length;_r++)Ei[(Ci=_m[_r])[0]]=Tt[Ci[1]];return Tt}),j.exports=_c},7066:(j,_e,_t)=>{"use strict";var St=_t(9670);j.exports=function(){var j=St(this),_e="";return j.global&&(_e+="g"),j.ignoreCase&&(_e+="i"),j.multiline&&(_e+="m"),j.dotAll&&(_e+="s"),j.unicode&&(_e+="u"),j.sticky&&(_e+="y"),_e}},2999:(j,_e,_t)=>{var St=_t(7293),Tt=_t(7854).RegExp,Ut=St((function(){var j=Tt("a","y");return j.lastIndex=2,null!=j.exec("abcd")})),_r=Ut||St((function(){return!Tt("a","y").sticky})),_n=Ut||St((function(){var j=Tt("^r","gy");return j.lastIndex=2,null!=j.exec("str")}));j.exports={BROKEN_CARET:_n,MISSED_STICKY:_r,UNSUPPORTED_Y:Ut}},9441:(j,_e,_t)=>{var St=_t(7293),Tt=_t(7854).RegExp;j.exports=St((function(){var j=Tt(".","s");return!(j.dotAll&&j.exec("\n")&&"s"===j.flags)}))},7168:(j,_e,_t)=>{var St=_t(7293),Tt=_t(7854).RegExp;j.exports=St((function(){var j=Tt("(?<a>b)","g");return"b"!==j.exec("b").groups.a||"bc"!=="b".replace(j,"$<a>c")}))},4488:(j,_e,_t)=>{var St=_t(7854).TypeError;j.exports=function(j){if(null==j)throw St("Can't call method on "+j);return j}},6465:j=>{j.exports=function(j,_e){return j===_e||j!=j&&_e!=_e}},3505:(j,_e,_t)=>{var St=_t(7854),Tt=Object.defineProperty;j.exports=function(j,_e){try{Tt(St,j,{value:_e,configurable:!0,writable:!0})}catch(_t){St[j]=_e}return _e}},6340:(j,_e,_t)=>{"use strict";var St=_t(5005),Tt=_t(3070),Ut=_t(5112),_r=_t(9781),_n=Ut("species");j.exports=function(j){var _e=St(j),_t=Tt.f;_r&&_e&&!_e[_n]&&_t(_e,_n,{configurable:!0,get:function(){return this}})}},8003:(j,_e,_t)=>{var St=_t(3070).f,Tt=_t(2597),Ut=_t(5112)("toStringTag");j.exports=function(j,_e,_t){j&&!_t&&(j=j.prototype),j&&!Tt(j,Ut)&&St(j,Ut,{configurable:!0,value:_e})}},6200:(j,_e,_t)=>{var St=_t(2309),Tt=_t(9711),Ut=St("keys");j.exports=function(j){return Ut[j]||(Ut[j]=Tt(j))}},5465:(j,_e,_t)=>{var St=_t(7854),Tt=_t(3505),Ut="__core-js_shared__",_r=St[Ut]||Tt(Ut,{});j.exports=_r},2309:(j,_e,_t)=>{var St=_t(1913),Tt=_t(5465);(j.exports=function(j,_e){return Tt[j]||(Tt[j]=void 0!==_e?_e:{})})("versions",[]).push({version:"3.20.1",mode:St?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},6707:(j,_e,_t)=>{var St=_t(9670),Tt=_t(9483),Ut=_t(5112)("species");j.exports=function(j,_e){var _t,_r=St(j).constructor;return void 0===_r||null==(_t=St(_r)[Ut])?_e:Tt(_t)}},3429:(j,_e,_t)=>{var St=_t(7293);j.exports=function(j){return St((function(){var _e=""[j]('"');return _e!==_e.toLowerCase()||_e.split('"').length>3}))}},8710:(j,_e,_t)=>{var St=_t(1702),Tt=_t(9303),Ut=_t(1340),_r=_t(4488),_n=St("".charAt),_i=St("".charCodeAt),Ei=St("".slice),createMethod=function(j){return function(_e,_t){var St,Ci,Di=Ut(_r(_e)),Fi=Tt(_t),_o=Di.length;return Fi<0||Fi>=_o?j?"":void 0:(St=_i(Di,Fi))<55296||St>56319||Fi+1===_o||(Ci=_i(Di,Fi+1))<56320||Ci>57343?j?_n(Di,Fi):St:j?Ei(Di,Fi,Fi+2):Ci-56320+(St-55296<<10)+65536}};j.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},3111:(j,_e,_t)=>{var St=_t(1702),Tt=_t(4488),Ut=_t(1340),_r=_t(1361),_n=St("".replace),_i="["+_r+"]",Ei=RegExp("^"+_i+_i+"*"),Ci=RegExp(_i+_i+"*$"),createMethod=function(j){return function(_e){var _t=Ut(Tt(_e));return 1&j&&(_t=_n(_t,Ei,"")),2&j&&(_t=_n(_t,Ci,"")),_t}};j.exports={start:createMethod(1),end:createMethod(2),trim:createMethod(3)}},261:(j,_e,_t)=>{var St,Tt,Ut,_r,_n=_t(7854),_i=_t(2104),Ei=_t(9974),Ci=_t(614),Di=_t(2597),Fi=_t(7293),_o=_t(490),ga=_t(206),_a=_t(317),_s=_t(6833),_c=_t(5268),kc=_n.setImmediate,_u=_n.clearImmediate,_l=_n.process,_d=_n.Dispatch,_h=_n.Function,_f=_n.MessageChannel,_p=_n.String,Eg=0,_v={},_m="onreadystatechange";try{St=_n.location}catch(j){}var run=function(j){if(Di(_v,j)){var _e=_v[j];delete _v[j],_e()}},runner=function(j){return function(){run(j)}},listener=function(j){run(j.data)},post=function(j){_n.postMessage(_p(j),St.protocol+"//"+St.host)};kc&&_u||(kc=function setImmediate(j){var _e=ga(arguments,1);return _v[++Eg]=function(){_i(Ci(j)?j:_h(j),void 0,_e)},Tt(Eg),Eg},_u=function clearImmediate(j){delete _v[j]},_c?Tt=function(j){_l.nextTick(runner(j))}:_d&&_d.now?Tt=function(j){_d.now(runner(j))}:_f&&!_s?(_r=(Ut=new _f).port2,Ut.port1.onmessage=listener,Tt=Ei(_r.postMessage,_r)):_n.addEventListener&&Ci(_n.postMessage)&&!_n.importScripts&&St&&"file:"!==St.protocol&&!Fi(post)?(Tt=post,_n.addEventListener("message",listener,!1)):Tt=_m in _a("script")?function(j){_o.appendChild(_a("script"))[_m]=function(){_o.removeChild(this),run(j)}}:function(j){setTimeout(runner(j),0)}),j.exports={set:kc,clear:_u}},1400:(j,_e,_t)=>{var St=_t(9303),Tt=Math.max,Ut=Math.min;j.exports=function(j,_e){var _t=St(j);return _t<0?Tt(_t+_e,0):Ut(_t,_e)}},7067:(j,_e,_t)=>{var St=_t(7854),Tt=_t(9303),Ut=_t(7466),_r=St.RangeError;j.exports=function(j){if(void 0===j)return 0;var _e=Tt(j),_t=Ut(_e);if(_e!==_t)throw _r("Wrong length or index");return _t}},5656:(j,_e,_t)=>{var St=_t(8361),Tt=_t(4488);j.exports=function(j){return St(Tt(j))}},9303:j=>{var _e=Math.ceil,_t=Math.floor;j.exports=function(j){var St=+j;return St!=St||0===St?0:(St>0?_t:_e)(St)}},7466:(j,_e,_t)=>{var St=_t(9303),Tt=Math.min;j.exports=function(j){return j>0?Tt(St(j),9007199254740991):0}},7908:(j,_e,_t)=>{var St=_t(7854),Tt=_t(4488),Ut=St.Object;j.exports=function(j){return Ut(Tt(j))}},4590:(j,_e,_t)=>{var St=_t(7854),Tt=_t(3002),Ut=St.RangeError;j.exports=function(j,_e){var _t=Tt(j);if(_t%_e)throw Ut("Wrong offset");return _t}},3002:(j,_e,_t)=>{var St=_t(7854),Tt=_t(9303),Ut=St.RangeError;j.exports=function(j){var _e=Tt(j);if(_e<0)throw Ut("The argument can't be less than 0");return _e}},7593:(j,_e,_t)=>{var St=_t(7854),Tt=_t(6916),Ut=_t(111),_r=_t(2190),_n=_t(8173),_i=_t(2140),Ei=_t(5112),Ci=St.TypeError,Di=Ei("toPrimitive");j.exports=function(j,_e){if(!Ut(j)||_r(j))return j;var _t,St=_n(j,Di);if(St){if(void 0===_e&&(_e="default"),_t=Tt(St,j,_e),!Ut(_t)||_r(_t))return _t;throw Ci("Can't convert object to primitive value")}return void 0===_e&&(_e="number"),_i(j,_e)}},4948:(j,_e,_t)=>{var St=_t(7593),Tt=_t(2190);j.exports=function(j){var _e=St(j,"string");return Tt(_e)?_e:_e+""}},1694:(j,_e,_t)=>{var St={};St[_t(5112)("toStringTag")]="z",j.exports="[object z]"===String(St)},1340:(j,_e,_t)=>{var St=_t(7854),Tt=_t(648),Ut=St.String;j.exports=function(j){if("Symbol"===Tt(j))throw TypeError("Cannot convert a Symbol value to a string");return Ut(j)}},6330:(j,_e,_t)=>{var St=_t(7854).String;j.exports=function(j){try{return St(j)}catch(j){return"Object"}}},9843:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(6916),_r=_t(9781),_n=_t(3832),_i=_t(260),Ei=_t(3331),Ci=_t(5787),Di=_t(9114),Fi=_t(8880),_o=_t(5988),ga=_t(7466),_a=_t(7067),_s=_t(4590),_c=_t(4948),kc=_t(2597),_u=_t(648),_l=_t(111),_d=_t(2190),_h=_t(30),_f=_t(7976),_p=_t(7674),Eg=_t(8006).f,_v=_t(7321),_m=_t(2092).forEach,Pm=_t(6340),_y=_t(3070),_A=_t(1236),e_=_t(9909),t_=_t(9587),r_=e_.get,i_=e_.set,a_=_y.f,s_=_A.f,c_=Math.round,u_=Tt.RangeError,l_=Ei.ArrayBuffer,d_=l_.prototype,h_=Ei.DataView,f_=_i.NATIVE_ARRAY_BUFFER_VIEWS,p_=_i.TYPED_ARRAY_CONSTRUCTOR,v_=_i.TYPED_ARRAY_TAG,m_=_i.TypedArray,y_=_i.TypedArrayPrototype,A_=_i.aTypedArrayConstructor,__=_i.isTypedArray,b_="BYTES_PER_ELEMENT",E_="Wrong length",fromList=function(j,_e){A_(j);for(var _t=0,St=_e.length,Tt=new j(St);St>_t;)Tt[_t]=_e[_t++];return Tt},addGetter=function(j,_e){a_(j,_e,{get:function(){return r_(this)[_e]}})},isArrayBuffer=function(j){var _e;return _f(d_,j)||"ArrayBuffer"==(_e=_u(j))||"SharedArrayBuffer"==_e},isTypedArrayIndex=function(j,_e){return __(j)&&!_d(_e)&&_e in j&&_o(+_e)&&_e>=0},w_=function getOwnPropertyDescriptor(j,_e){return _e=_c(_e),isTypedArrayIndex(j,_e)?Di(2,j[_e]):s_(j,_e)},I_=function defineProperty(j,_e,_t){return _e=_c(_e),!(isTypedArrayIndex(j,_e)&&_l(_t)&&kc(_t,"value"))||kc(_t,"get")||kc(_t,"set")||_t.configurable||kc(_t,"writable")&&!_t.writable||kc(_t,"enumerable")&&!_t.enumerable?a_(j,_e,_t):(j[_e]=_t.value,j)};_r?(f_||(_A.f=w_,_y.f=I_,addGetter(y_,"buffer"),addGetter(y_,"byteOffset"),addGetter(y_,"byteLength"),addGetter(y_,"length")),St({target:"Object",stat:!0,forced:!f_},{getOwnPropertyDescriptor:w_,defineProperty:I_}),j.exports=function(j,_e,_t){var _r=j.match(/\d+$/)[0]/8,_i=j+(_t?"Clamped":"")+"Array",Ei="get"+j,Di="set"+j,_o=Tt[_i],_c=_o,kc=_c&&_c.prototype,_u={},addElement=function(j,_e){a_(j,_e,{get:function(){return function(j,_e){var _t=r_(j);return _t.view[Ei](_e*_r+_t.byteOffset,!0)}(this,_e)},set:function(j){return function(j,_e,St){var Tt=r_(j);_t&&(St=(St=c_(St))<0?0:St>255?255:255&St),Tt.view[Di](_e*_r+Tt.byteOffset,St,!0)}(this,_e,j)},enumerable:!0})};f_?_n&&(_c=_e((function(j,_e,_t,St){return Ci(j,kc),t_(_l(_e)?isArrayBuffer(_e)?void 0!==St?new _o(_e,_s(_t,_r),St):void 0!==_t?new _o(_e,_s(_t,_r)):new _o(_e):__(_e)?fromList(_c,_e):Ut(_v,_c,_e):new _o(_a(_e)),j,_c)})),_p&&_p(_c,m_),_m(Eg(_o),(function(j){j in _c||Fi(_c,j,_o[j])})),_c.prototype=kc):(_c=_e((function(j,_e,_t,St){Ci(j,kc);var Tt,_n,_i,Ei=0,Di=0;if(_l(_e)){if(!isArrayBuffer(_e))return __(_e)?fromList(_c,_e):Ut(_v,_c,_e);Tt=_e,Di=_s(_t,_r);var Fi=_e.byteLength;if(void 0===St){if(Fi%_r)throw u_(E_);if((_n=Fi-Di)<0)throw u_(E_)}else if((_n=ga(St)*_r)+Di>Fi)throw u_(E_);_i=_n/_r}else _i=_a(_e),Tt=new l_(_n=_i*_r);for(i_(j,{buffer:Tt,byteOffset:Di,byteLength:_n,length:_i,view:new h_(Tt)});Ei<_i;)addElement(j,Ei++)})),_p&&_p(_c,m_),kc=_c.prototype=_h(y_)),kc.constructor!==_c&&Fi(kc,"constructor",_c),Fi(kc,p_,_c),v_&&Fi(kc,v_,_i),_u[_i]=_c,St({global:!0,forced:_c!=_o,sham:!f_},_u),b_ in _c||Fi(_c,b_,_r),b_ in kc||Fi(kc,b_,_r),Pm(_i)}):j.exports=function(){}},3832:(j,_e,_t)=>{var St=_t(7854),Tt=_t(7293),Ut=_t(7072),_r=_t(260).NATIVE_ARRAY_BUFFER_VIEWS,_n=St.ArrayBuffer,_i=St.Int8Array;j.exports=!_r||!Tt((function(){_i(1)}))||!Tt((function(){new _i(-1)}))||!Ut((function(j){new _i,new _i(null),new _i(1.5),new _i(j)}),!0)||Tt((function(){return 1!==new _i(new _n(2),1,void 0).length}))},3074:(j,_e,_t)=>{var St=_t(7745),Tt=_t(6304);j.exports=function(j,_e){return St(Tt(j),_e)}},7321:(j,_e,_t)=>{var St=_t(9974),Tt=_t(6916),Ut=_t(9483),_r=_t(7908),_n=_t(6244),_i=_t(8554),Ei=_t(1246),Ci=_t(7659),Di=_t(260).aTypedArrayConstructor;j.exports=function from(j){var _e,_t,Fi,_o,ga,_a,_s=Ut(this),_c=_r(j),kc=arguments.length,_u=kc>1?arguments[1]:void 0,_l=void 0!==_u,_d=Ei(_c);if(_d&&!Ci(_d))for(_a=(ga=_i(_c,_d)).next,_c=[];!(_o=Tt(_a,ga)).done;)_c.push(_o.value);for(_l&&kc>2&&(_u=St(_u,arguments[2])),_t=_n(_c),Fi=new(Di(_s))(_t),_e=0;_t>_e;_e++)Fi[_e]=_l?_u(_c[_e],_e):_c[_e];return Fi}},6304:(j,_e,_t)=>{var St=_t(260),Tt=_t(6707),Ut=St.TYPED_ARRAY_CONSTRUCTOR,_r=St.aTypedArrayConstructor;j.exports=function(j){return _r(Tt(j,j[Ut]))}},9711:(j,_e,_t)=>{var St=_t(1702),Tt=0,Ut=Math.random(),_r=St(1..toString);j.exports=function(j){return"Symbol("+(void 0===j?"":j)+")_"+_r(++Tt+Ut,36)}},3307:(j,_e,_t)=>{var St=_t(133);j.exports=St&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},6061:(j,_e,_t)=>{var St=_t(5112);_e.f=St},5112:(j,_e,_t)=>{var St=_t(7854),Tt=_t(2309),Ut=_t(2597),_r=_t(9711),_n=_t(133),_i=_t(3307),Ei=Tt("wks"),Ci=St.Symbol,Di=Ci&&Ci.for,Fi=_i?Ci:Ci&&Ci.withoutSetter||_r;j.exports=function(j){if(!Ut(Ei,j)||!_n&&"string"!=typeof Ei[j]){var _e="Symbol."+j;_n&&Ut(Ci,j)?Ei[j]=Ci[j]:Ei[j]=_i&&Di?Di(_e):Fi(_e)}return Ei[j]}},1361:j=>{j.exports="\t\n\v\f\r \u2028\u2029\ufeff"},9575:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1702),Ut=_t(7293),_r=_t(3331),_n=_t(9670),_i=_t(1400),Ei=_t(7466),Ci=_t(6707),Di=_r.ArrayBuffer,Fi=_r.DataView,_o=Fi.prototype,ga=Tt(Di.prototype.slice),_a=Tt(_o.getUint8),_s=Tt(_o.setUint8);St({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Ut((function(){return!new Di(2).slice(1,void 0).byteLength}))},{slice:function slice(j,_e){if(ga&&void 0===_e)return ga(_n(this),j);for(var _t=_n(this).byteLength,St=_i(j,_t),Tt=_i(void 0===_e?_t:_e,_t),Ut=new(Ci(this,Di))(Ei(Tt-St)),_r=new Fi(this),_o=new Fi(Ut),_c=0;St<Tt;)_s(_o,_c++,_a(_r,St++));return Ut}})},2222:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(7293),_r=_t(3157),_n=_t(111),_i=_t(7908),Ei=_t(6244),Ci=_t(6135),Di=_t(5417),Fi=_t(1194),_o=_t(5112),ga=_t(7392),_a=_o("isConcatSpreadable"),_s=9007199254740991,_c="Maximum allowed index exceeded",kc=Tt.TypeError,_u=ga>=51||!Ut((function(){var j=[];return j[_a]=!1,j.concat()[0]!==j})),_l=Fi("concat"),isConcatSpreadable=function(j){if(!_n(j))return!1;var _e=j[_a];return void 0!==_e?!!_e:_r(j)};St({target:"Array",proto:!0,forced:!_u||!_l},{concat:function concat(j){var _e,_t,St,Tt,Ut,_r=_i(this),_n=Di(_r,0),Fi=0;for(_e=-1,St=arguments.length;_e<St;_e++)if(isConcatSpreadable(Ut=-1===_e?_r:arguments[_e])){if(Fi+(Tt=Ei(Ut))>_s)throw kc(_c);for(_t=0;_t<Tt;_t++,Fi++)_t in Ut&&Ci(_n,Fi,Ut[_t])}else{if(Fi>=_s)throw kc(_c);Ci(_n,Fi++,Ut)}return _n.length=Fi,_n}})},6541:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(2092).every;St({target:"Array",proto:!0,forced:!_t(2133)("every")},{every:function every(j){return Tt(this,j,arguments.length>1?arguments[1]:void 0)}})},3290:(j,_e,_t)=>{var St=_t(2109),Tt=_t(1285),Ut=_t(1223);St({target:"Array",proto:!0},{fill:Tt}),Ut("fill")},7327:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(2092).filter;St({target:"Array",proto:!0,forced:!_t(1194)("filter")},{filter:function filter(j){return Tt(this,j,arguments.length>1?arguments[1]:void 0)}})},9826:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(2092).find,Ut=_t(1223),_r="find",_n=!0;_r in[]&&Array(1)[_r]((function(){_n=!1})),St({target:"Array",proto:!0,forced:_n},{find:function find(j){return Tt(this,j,arguments.length>1?arguments[1]:void 0)}}),Ut(_r)},9554:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(8533);St({target:"Array",proto:!0,forced:[].forEach!=Tt},{forEach:Tt})},1038:(j,_e,_t)=>{var St=_t(2109),Tt=_t(8457);St({target:"Array",stat:!0,forced:!_t(7072)((function(j){Array.from(j)}))},{from:Tt})},6699:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(5367).includes,Ut=_t(1223);St({target:"Array",proto:!0},{includes:function includes(j){return Tt(this,j,arguments.length>1?arguments[1]:void 0)}}),Ut("includes")},2772:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1702),Ut=_t(5367).indexOf,_r=_t(2133),_n=Tt([].indexOf),_i=!!_n&&1/_n([1],1,-0)<0,Ei=_r("indexOf");St({target:"Array",proto:!0,forced:_i||!Ei},{indexOf:function indexOf(j){var _e=arguments.length>1?arguments[1]:void 0;return _i?_n(this,j,_e)||0:Ut(this,j,_e)}})},9753:(j,_e,_t)=>{_t(2109)({target:"Array",stat:!0},{isArray:_t(3157)})},6992:(j,_e,_t)=>{"use strict";var St=_t(5656),Tt=_t(1223),Ut=_t(7497),_r=_t(9909),_n=_t(3070).f,_i=_t(654),Ei=_t(1913),Ci=_t(9781),Di="Array Iterator",Fi=_r.set,_o=_r.getterFor(Di);j.exports=_i(Array,"Array",(function(j,_e){Fi(this,{type:Di,target:St(j),index:0,kind:_e})}),(function(){var j=_o(this),_e=j.target,_t=j.kind,St=j.index++;return!_e||St>=_e.length?(j.target=void 0,{value:void 0,done:!0}):"keys"==_t?{value:St,done:!1}:"values"==_t?{value:_e[St],done:!1}:{value:[St,_e[St]],done:!1}}),"values");var ga=Ut.Arguments=Ut.Array;if(Tt("keys"),Tt("values"),Tt("entries"),!Ei&&Ci&&"values"!==ga.name)try{_n(ga,"name",{value:"values"})}catch(j){}},9600:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1702),Ut=_t(8361),_r=_t(5656),_n=_t(2133),_i=Tt([].join),Ei=Ut!=Object,Ci=_n("join",",");St({target:"Array",proto:!0,forced:Ei||!Ci},{join:function join(j){return _i(_r(this),void 0===j?",":j)}})},1249:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(2092).map;St({target:"Array",proto:!0,forced:!_t(1194)("map")},{map:function map(j){return Tt(this,j,arguments.length>1?arguments[1]:void 0)}})},5827:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(3671).left,Ut=_t(2133),_r=_t(7392),_n=_t(5268);St({target:"Array",proto:!0,forced:!Ut("reduce")||!_n&&_r>79&&_r<83},{reduce:function reduce(j){var _e=arguments.length;return Tt(this,j,_e,_e>1?arguments[1]:void 0)}})},5069:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1702),Ut=_t(3157),_r=Tt([].reverse),_n=[1,2];St({target:"Array",proto:!0,forced:String(_n)===String(_n.reverse())},{reverse:function reverse(){return Ut(this)&&(this.length=this.length),_r(this)}})},7042:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(3157),_r=_t(4411),_n=_t(111),_i=_t(1400),Ei=_t(6244),Ci=_t(5656),Di=_t(6135),Fi=_t(5112),_o=_t(1194),ga=_t(206),_a=_o("slice"),_s=Fi("species"),_c=Tt.Array,kc=Math.max;St({target:"Array",proto:!0,forced:!_a},{slice:function slice(j,_e){var _t,St,Tt,Fi=Ci(this),_o=Ei(Fi),_a=_i(j,_o),_u=_i(void 0===_e?_o:_e,_o);if(Ut(Fi)&&(_t=Fi.constructor,(_r(_t)&&(_t===_c||Ut(_t.prototype))||_n(_t)&&null===(_t=_t[_s]))&&(_t=void 0),_t===_c||void 0===_t))return ga(Fi,_a,_u);for(St=new(void 0===_t?_c:_t)(kc(_u-_a,0)),Tt=0;_a<_u;_a++,Tt++)_a in Fi&&Di(St,Tt,Fi[_a]);return St.length=Tt,St}})},5212:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(2092).some;St({target:"Array",proto:!0,forced:!_t(2133)("some")},{some:function some(j){return Tt(this,j,arguments.length>1?arguments[1]:void 0)}})},2707:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1702),Ut=_t(9662),_r=_t(7908),_n=_t(6244),_i=_t(1340),Ei=_t(7293),Ci=_t(4362),Di=_t(2133),Fi=_t(8886),_o=_t(256),ga=_t(7392),_a=_t(8008),_s=[],_c=Tt(_s.sort),kc=Tt(_s.push),_u=Ei((function(){_s.sort(void 0)})),_l=Ei((function(){_s.sort(null)})),_d=Di("sort"),_h=!Ei((function(){if(ga)return ga<70;if(!(Fi&&Fi>3)){if(_o)return!0;if(_a)return _a<603;var j,_e,_t,St,Tt="";for(j=65;j<76;j++){switch(_e=String.fromCharCode(j),j){case 66:case 69:case 70:case 72:_t=3;break;case 68:case 71:_t=4;break;default:_t=2}for(St=0;St<47;St++)_s.push({k:_e+St,v:_t})}for(_s.sort((function(j,_e){return _e.v-j.v})),St=0;St<_s.length;St++)_e=_s[St].k.charAt(0),Tt.charAt(Tt.length-1)!==_e&&(Tt+=_e);return"DGBEFHACIJK"!==Tt}}));St({target:"Array",proto:!0,forced:_u||!_l||!_d||!_h},{sort:function sort(j){void 0!==j&&Ut(j);var _e=_r(this);if(_h)return void 0===j?_c(_e):_c(_e,j);var _t,St,Tt=[],Ei=_n(_e);for(St=0;St<Ei;St++)St in _e&&kc(Tt,_e[St]);for(Ci(Tt,function(j){return function(_e,_t){return void 0===_t?-1:void 0===_e?1:void 0!==j?+j(_e,_t)||0:_i(_e)>_i(_t)?1:-1}}(j)),_t=Tt.length,St=0;St<_t;)_e[St]=Tt[St++];for(;St<Ei;)delete _e[St++];return _e}})},561:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(1400),_r=_t(9303),_n=_t(6244),_i=_t(7908),Ei=_t(5417),Ci=_t(6135),Di=_t(1194)("splice"),Fi=Tt.TypeError,_o=Math.max,ga=Math.min,_a=9007199254740991,_s="Maximum allowed length exceeded";St({target:"Array",proto:!0,forced:!Di},{splice:function splice(j,_e){var _t,St,Tt,Di,_c,kc,_u=_i(this),_l=_n(_u),_d=Ut(j,_l),_h=arguments.length;if(0===_h?_t=St=0:1===_h?(_t=0,St=_l-_d):(_t=_h-2,St=ga(_o(_r(_e),0),_l-_d)),_l+_t-St>_a)throw Fi(_s);for(Tt=Ei(_u,St),Di=0;Di<St;Di++)(_c=_d+Di)in _u&&Ci(Tt,Di,_u[_c]);if(Tt.length=St,_t<St){for(Di=_d;Di<_l-St;Di++)kc=Di+_t,(_c=Di+St)in _u?_u[kc]=_u[_c]:delete _u[kc];for(Di=_l;Di>_l-St+_t;Di--)delete _u[Di-1]}else if(_t>St)for(Di=_l-St;Di>_d;Di--)kc=Di+_t-1,(_c=Di+St-1)in _u?_u[kc]=_u[_c]:delete _u[kc];for(Di=0;Di<_t;Di++)_u[Di+_d]=arguments[Di+2];return _u.length=_l-St+_t,Tt}})},3843:(j,_e,_t)=>{var St=_t(2109),Tt=_t(7854),Ut=_t(1702),_r=Tt.Date,_n=Ut(_r.prototype.getTime);St({target:"Date",stat:!0},{now:function now(){return _n(new _r)}})},3710:(j,_e,_t)=>{var St=_t(1702),Tt=_t(1320),Ut=Date.prototype,_r="Invalid Date",_n="toString",_i=St(Ut[_n]),Ei=St(Ut.getTime);String(new Date(NaN))!=_r&&Tt(Ut,_n,(function toString(){var j=Ei(this);return j==j?_i(this):_r}))},4812:(j,_e,_t)=>{_t(2109)({target:"Function",proto:!0},{bind:_t(7065)})},8309:(j,_e,_t)=>{var St=_t(9781),Tt=_t(6530).EXISTS,Ut=_t(1702),_r=_t(3070).f,_n=Function.prototype,_i=Ut(_n.toString),Ei=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Ci=Ut(Ei.exec);St&&!Tt&&_r(_n,"name",{configurable:!0,get:function(){try{return Ci(Ei,_i(this))[1]}catch(j){return""}}})},3706:(j,_e,_t)=>{var St=_t(7854);_t(8003)(St.JSON,"JSON",!0)},1532:(j,_e,_t)=>{"use strict";_t(7710)("Map",(function(j){return function Map(){return j(this,arguments.length?arguments[0]:void 0)}}),_t(5631))},408:(j,_e,_t)=>{_t(8003)(Math,"Math",!0)},9601:(j,_e,_t)=>{var St=_t(2109),Tt=_t(1574);St({target:"Object",stat:!0,forced:Object.assign!==Tt},{assign:Tt})},8011:(j,_e,_t)=>{_t(2109)({target:"Object",stat:!0,sham:!_t(9781)},{create:_t(30)})},3321:(j,_e,_t)=>{var St=_t(2109),Tt=_t(9781);St({target:"Object",stat:!0,forced:!Tt,sham:!Tt},{defineProperties:_t(6048)})},9070:(j,_e,_t)=>{var St=_t(2109),Tt=_t(9781);St({target:"Object",stat:!0,forced:!Tt,sham:!Tt},{defineProperty:_t(3070).f})},9720:(j,_e,_t)=>{var St=_t(2109),Tt=_t(4699).entries;St({target:"Object",stat:!0},{entries:function entries(j){return Tt(j)}})},3371:(j,_e,_t)=>{var St=_t(2109),Tt=_t(6677),Ut=_t(7293),_r=_t(111),_n=_t(2423).onFreeze,_i=Object.freeze;St({target:"Object",stat:!0,forced:Ut((function(){_i(1)})),sham:!Tt},{freeze:function freeze(j){return _i&&_r(j)?_i(_n(j)):j}})},5003:(j,_e,_t)=>{var St=_t(2109),Tt=_t(7293),Ut=_t(5656),_r=_t(1236).f,_n=_t(9781),_i=Tt((function(){_r(1)}));St({target:"Object",stat:!0,forced:!_n||_i,sham:!_n},{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(j,_e){return _r(Ut(j),_e)}})},9337:(j,_e,_t)=>{var St=_t(2109),Tt=_t(9781),Ut=_t(3887),_r=_t(5656),_n=_t(1236),_i=_t(6135);St({target:"Object",stat:!0,sham:!Tt},{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(j){for(var _e,_t,St=_r(j),Tt=_n.f,Ei=Ut(St),Ci={},Di=0;Ei.length>Di;)void 0!==(_t=Tt(St,_e=Ei[Di++]))&&_i(Ci,_e,_t);return Ci}})},6210:(j,_e,_t)=>{var St=_t(2109),Tt=_t(7293),Ut=_t(1156).f;St({target:"Object",stat:!0,forced:Tt((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:Ut})},489:(j,_e,_t)=>{var St=_t(2109),Tt=_t(7293),Ut=_t(7908),_r=_t(9518),_n=_t(8544);St({target:"Object",stat:!0,forced:Tt((function(){_r(1)})),sham:!_n},{getPrototypeOf:function getPrototypeOf(j){return _r(Ut(j))}})},7941:(j,_e,_t)=>{var St=_t(2109),Tt=_t(7908),Ut=_t(1956);St({target:"Object",stat:!0,forced:_t(7293)((function(){Ut(1)}))},{keys:function keys(j){return Ut(Tt(j))}})},8304:(j,_e,_t)=>{_t(2109)({target:"Object",stat:!0},{setPrototypeOf:_t(7674)})},1539:(j,_e,_t)=>{var St=_t(1694),Tt=_t(1320),Ut=_t(288);St||Tt(Object.prototype,"toString",Ut,{unsafe:!0})},2479:(j,_e,_t)=>{var St=_t(2109),Tt=_t(4699).values;St({target:"Object",stat:!0},{values:function values(j){return Tt(j)}})},1058:(j,_e,_t)=>{var St=_t(2109),Tt=_t(3009);St({global:!0,forced:parseInt!=Tt},{parseInt:Tt})},7727:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(3366),_r=_t(7293),_n=_t(5005),_i=_t(614),Ei=_t(6707),Ci=_t(9478),Di=_t(1320);if(St({target:"Promise",proto:!0,real:!0,forced:!!Ut&&_r((function(){Ut.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(j){var _e=Ei(this,_n("Promise")),_t=_i(j);return this.then(_t?function(_t){return Ci(_e,j()).then((function(){return _t}))}:j,_t?function(_t){return Ci(_e,j()).then((function(){throw _t}))}:j)}}),!Tt&&_i(Ut)){var Fi=_n("Promise").prototype.finally;Ut.prototype.finally!==Fi&&Di(Ut.prototype,"finally",Fi,{unsafe:!0})}},8674:(j,_e,_t)=>{"use strict";var St,Tt,Ut,_r,_n=_t(2109),_i=_t(1913),Ei=_t(7854),Ci=_t(5005),Di=_t(6916),Fi=_t(3366),_o=_t(1320),ga=_t(2248),_a=_t(7674),_s=_t(8003),_c=_t(6340),kc=_t(9662),_u=_t(614),_l=_t(111),_d=_t(5787),_h=_t(2788),_f=_t(612),_p=_t(7072),Eg=_t(6707),_v=_t(261).set,_m=_t(5948),Pm=_t(9478),_y=_t(842),_A=_t(8523),e_=_t(2534),t_=_t(8572),r_=_t(9909),i_=_t(4705),a_=_t(5112),s_=_t(7871),c_=_t(5268),u_=_t(7392),l_=a_("species"),d_="Promise",h_=r_.getterFor(d_),f_=r_.set,p_=r_.getterFor(d_),v_=Fi&&Fi.prototype,m_=Fi,y_=v_,A_=Ei.TypeError,__=Ei.document,b_=Ei.process,E_=_A.f,w_=E_,I_=!!(__&&__.createEvent&&Ei.dispatchEvent),T_=_u(Ei.PromiseRejectionEvent),C_="unhandledrejection",R_=!1,k_=i_(d_,(function(){var j=_h(m_),_e=j!==String(m_);if(!_e&&66===u_)return!0;if(_i&&!y_.finally)return!0;if(u_>=51&&/native code/.test(j))return!1;var _t=new m_((function(j){j(1)})),FakePromise=function(j){j((function(){}),(function(){}))};return(_t.constructor={})[l_]=FakePromise,!(R_=_t.then((function(){}))instanceof FakePromise)||!_e&&s_&&!T_})),O_=k_||!_p((function(j){m_.all(j).catch((function(){}))})),isThenable=function(j){var _e;return!(!_l(j)||!_u(_e=j.then))&&_e},callReaction=function(j,_e){var _t,St,Tt,Ut=_e.value,_r=1==_e.state,_n=_r?j.ok:j.fail,_i=j.resolve,Ei=j.reject,Ci=j.domain;try{_n?(_r||(2===_e.rejection&&onHandleUnhandled(_e),_e.rejection=1),!0===_n?_t=Ut:(Ci&&Ci.enter(),_t=_n(Ut),Ci&&(Ci.exit(),Tt=!0)),_t===j.promise?Ei(A_("Promise-chain cycle")):(St=isThenable(_t))?Di(St,_t,_i,Ei):_i(_t)):Ei(Ut)}catch(j){Ci&&!Tt&&Ci.exit(),Ei(j)}},notify=function(j,_e){j.notified||(j.notified=!0,_m((function(){for(var _t,St=j.reactions;_t=St.get();)callReaction(_t,j);j.notified=!1,_e&&!j.rejection&&onUnhandled(j)})))},dispatchEvent=function(j,_e,_t){var St,Tt;I_?((St=__.createEvent("Event")).promise=_e,St.reason=_t,St.initEvent(j,!1,!0),Ei.dispatchEvent(St)):St={promise:_e,reason:_t},!T_&&(Tt=Ei["on"+j])?Tt(St):j===C_&&_y("Unhandled promise rejection",_t)},onUnhandled=function(j){Di(_v,Ei,(function(){var _e,_t=j.facade,St=j.value;if(isUnhandled(j)&&(_e=e_((function(){c_?b_.emit("unhandledRejection",St,_t):dispatchEvent(C_,_t,St)})),j.rejection=c_||isUnhandled(j)?2:1,_e.error))throw _e.value}))},isUnhandled=function(j){return 1!==j.rejection&&!j.parent},onHandleUnhandled=function(j){Di(_v,Ei,(function(){var _e=j.facade;c_?b_.emit("rejectionHandled",_e):dispatchEvent("rejectionhandled",_e,j.value)}))},bind=function(j,_e,_t){return function(St){j(_e,St,_t)}},internalReject=function(j,_e,_t){j.done||(j.done=!0,_t&&(j=_t),j.value=_e,j.state=2,notify(j,!0))},internalResolve=function(j,_e,_t){if(!j.done){j.done=!0,_t&&(j=_t);try{if(j.facade===_e)throw A_("Promise can't be resolved itself");var St=isThenable(_e);St?_m((function(){var _t={done:!1};try{Di(St,_e,bind(internalResolve,_t,j),bind(internalReject,_t,j))}catch(_e){internalReject(_t,_e,j)}})):(j.value=_e,j.state=1,notify(j,!1))}catch(_e){internalReject({done:!1},_e,j)}}};if(k_&&(y_=(m_=function Promise(j){_d(this,y_),kc(j),Di(St,this);var _e=h_(this);try{j(bind(internalResolve,_e),bind(internalReject,_e))}catch(j){internalReject(_e,j)}}).prototype,(St=function Promise(j){f_(this,{type:d_,done:!1,notified:!1,parent:!1,reactions:new t_,rejection:!1,state:0,value:void 0})}).prototype=ga(y_,{then:function then(j,_e){var _t=p_(this),St=E_(Eg(this,m_));return _t.parent=!0,St.ok=!_u(j)||j,St.fail=_u(_e)&&_e,St.domain=c_?b_.domain:void 0,0==_t.state?_t.reactions.add(St):_m((function(){callReaction(St,_t)})),St.promise},catch:function(j){return this.then(void 0,j)}}),Tt=function(){var j=new St,_e=h_(j);this.promise=j,this.resolve=bind(internalResolve,_e),this.reject=bind(internalReject,_e)},_A.f=E_=function(j){return j===m_||j===Ut?new Tt(j):w_(j)},!_i&&_u(Fi)&&v_!==Object.prototype)){_r=v_.then,R_||(_o(v_,"then",(function then(j,_e){var _t=this;return new m_((function(j,_e){Di(_r,_t,j,_e)})).then(j,_e)}),{unsafe:!0}),_o(v_,"catch",y_.catch,{unsafe:!0}));try{delete v_.constructor}catch(j){}_a&&_a(v_,y_)}_n({global:!0,wrap:!0,forced:k_},{Promise:m_}),_s(m_,d_,!1,!0),_c(d_),Ut=Ci(d_),_n({target:d_,stat:!0,forced:k_},{reject:function reject(j){var _e=E_(this);return Di(_e.reject,void 0,j),_e.promise}}),_n({target:d_,stat:!0,forced:_i||k_},{resolve:function resolve(j){return Pm(_i&&this===Ut?m_:this,j)}}),_n({target:d_,stat:!0,forced:O_},{all:function all(j){var _e=this,_t=E_(_e),St=_t.resolve,Tt=_t.reject,Ut=e_((function(){var _t=kc(_e.resolve),Ut=[],_r=0,_n=1;_f(j,(function(j){var _i=_r++,Ei=!1;_n++,Di(_t,_e,j).then((function(j){Ei||(Ei=!0,Ut[_i]=j,--_n||St(Ut))}),Tt)})),--_n||St(Ut)}));return Ut.error&&Tt(Ut.value),_t.promise},race:function race(j){var _e=this,_t=E_(_e),St=_t.reject,Tt=e_((function(){var Tt=kc(_e.resolve);_f(j,(function(j){Di(Tt,_e,j).then(_t.resolve,St)}))}));return Tt.error&&St(Tt.value),_t.promise}})},2419:(j,_e,_t)=>{var St=_t(2109),Tt=_t(5005),Ut=_t(2104),_r=_t(7065),_n=_t(9483),_i=_t(9670),Ei=_t(111),Ci=_t(30),Di=_t(7293),Fi=Tt("Reflect","construct"),_o=Object.prototype,ga=[].push,_a=Di((function(){function F(){}return!(Fi((function(){}),[],F)instanceof F)})),_s=!Di((function(){Fi((function(){}))})),_c=_a||_s;St({target:"Reflect",stat:!0,forced:_c,sham:_c},{construct:function construct(j,_e){_n(j),_i(_e);var _t=arguments.length<3?j:_n(arguments[2]);if(_s&&!_a)return Fi(j,_e,_t);if(j==_t){switch(_e.length){case 0:return new j;case 1:return new j(_e[0]);case 2:return new j(_e[0],_e[1]);case 3:return new j(_e[0],_e[1],_e[2]);case 4:return new j(_e[0],_e[1],_e[2],_e[3])}var St=[null];return Ut(ga,St,_e),new(Ut(_r,j,St))}var Tt=_t.prototype,Di=Ci(Ei(Tt)?Tt:_o),_c=Ut(j,Di,_e);return Ei(_c)?_c:Di}})},4916:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(2261);St({target:"RegExp",proto:!0,forced:/./.exec!==Tt},{exec:Tt})},189:(j,_e,_t)=>{"use strict";_t(7710)("Set",(function(j){return function Set(){return j(this,arguments.length?arguments[0]:void 0)}}),_t(5631))},2023:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1702),Ut=_t(3929),_r=_t(4488),_n=_t(1340),_i=_t(4964),Ei=Tt("".indexOf);St({target:"String",proto:!0,forced:!_i("includes")},{includes:function includes(j){return!!~Ei(_n(_r(this)),_n(Ut(j)),arguments.length>1?arguments[1]:void 0)}})},8783:(j,_e,_t)=>{"use strict";var St=_t(8710).charAt,Tt=_t(1340),Ut=_t(9909),_r=_t(654),_n="String Iterator",_i=Ut.set,Ei=Ut.getterFor(_n);_r(String,"String",(function(j){_i(this,{type:_n,string:Tt(j),index:0})}),(function next(){var j,_e=Ei(this),_t=_e.string,Tt=_e.index;return Tt>=_t.length?{value:void 0,done:!0}:(j=St(_t,Tt),_e.index+=j.length,{value:j,done:!1})}))},4723:(j,_e,_t)=>{"use strict";var St=_t(6916),Tt=_t(7007),Ut=_t(9670),_r=_t(7466),_n=_t(1340),_i=_t(4488),Ei=_t(8173),Ci=_t(1530),Di=_t(7651);Tt("match",(function(j,_e,_t){return[function match(_e){var _t=_i(this),Tt=null==_e?void 0:Ei(_e,j);return Tt?St(Tt,_e,_t):new RegExp(_e)[j](_n(_t))},function(j){var St=Ut(this),Tt=_n(j),_i=_t(_e,St,Tt);if(_i.done)return _i.value;if(!St.global)return Di(St,Tt);var Ei=St.unicode;St.lastIndex=0;for(var Fi,_o=[],ga=0;null!==(Fi=Di(St,Tt));){var _a=_n(Fi[0]);_o[ga]=_a,""===_a&&(St.lastIndex=Ci(Tt,_r(St.lastIndex),Ei)),ga++}return 0===ga?null:_o}]}))},5306:(j,_e,_t)=>{"use strict";var St=_t(2104),Tt=_t(6916),Ut=_t(1702),_r=_t(7007),_n=_t(7293),_i=_t(9670),Ei=_t(614),Ci=_t(9303),Di=_t(7466),Fi=_t(1340),_o=_t(4488),ga=_t(1530),_a=_t(8173),_s=_t(647),_c=_t(7651),kc=_t(5112)("replace"),_u=Math.max,_l=Math.min,_d=Ut([].concat),_h=Ut([].push),_f=Ut("".indexOf),_p=Ut("".slice),Eg="$0"==="a".replace(/./,"$0"),_v=!!/./[kc]&&""===/./[kc]("a","$0");_r("replace",(function(j,_e,_t){var Ut=_v?"$":"$0";return[function replace(j,_t){var St=_o(this),Ut=null==j?void 0:_a(j,kc);return Ut?Tt(Ut,j,St,_t):Tt(_e,Fi(St),j,_t)},function(j,Tt){var _r=_i(this),_n=Fi(j);if("string"==typeof Tt&&-1===_f(Tt,Ut)&&-1===_f(Tt,"$<")){var _o=_t(_e,_r,_n,Tt);if(_o.done)return _o.value}var _a=Ei(Tt);_a||(Tt=Fi(Tt));var kc=_r.global;if(kc){var Eg=_r.unicode;_r.lastIndex=0}for(var _v=[];;){var _m=_c(_r,_n);if(null===_m)break;if(_h(_v,_m),!kc)break;""===Fi(_m[0])&&(_r.lastIndex=ga(_n,Di(_r.lastIndex),Eg))}for(var Pm,_y="",_A=0,e_=0;e_<_v.length;e_++){for(var t_=Fi((_m=_v[e_])[0]),r_=_u(_l(Ci(_m.index),_n.length),0),i_=[],a_=1;a_<_m.length;a_++)_h(i_,void 0===(Pm=_m[a_])?Pm:String(Pm));var s_=_m.groups;if(_a){var c_=_d([t_],i_,r_,_n);void 0!==s_&&_h(c_,s_);var u_=Fi(St(Tt,void 0,c_))}else u_=_s(t_,_n,r_,i_,s_,Tt);r_>=_A&&(_y+=_p(_n,_A,r_)+u_,_A=r_+t_.length)}return _y+_p(_n,_A)}]}),!!_n((function(){var j=/./;return j.exec=function(){var j=[];return j.groups={a:"7"},j},"7"!=="".replace(j,"$<a>")}))||!Eg||_v)},3123:(j,_e,_t)=>{"use strict";var St=_t(2104),Tt=_t(6916),Ut=_t(1702),_r=_t(7007),_n=_t(7850),_i=_t(9670),Ei=_t(4488),Ci=_t(6707),Di=_t(1530),Fi=_t(7466),_o=_t(1340),ga=_t(8173),_a=_t(1589),_s=_t(7651),_c=_t(2261),kc=_t(2999),_u=_t(7293),_l=kc.UNSUPPORTED_Y,_d=4294967295,_h=Math.min,_f=[].push,_p=Ut(/./.exec),Eg=Ut(_f),_v=Ut("".slice),_m=!_u((function(){var j=/(?:)/,_e=j.exec;j.exec=function(){return _e.apply(this,arguments)};var _t="ab".split(j);return 2!==_t.length||"a"!==_t[0]||"b"!==_t[1]}));_r("split",(function(j,_e,_t){var Ut;return Ut="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(j,_t){var Ut=_o(Ei(this)),_r=void 0===_t?_d:_t>>>0;if(0===_r)return[];if(void 0===j)return[Ut];if(!_n(j))return Tt(_e,Ut,j,_r);for(var _i,Ci,Di,Fi=[],ga=(j.ignoreCase?"i":"")+(j.multiline?"m":"")+(j.unicode?"u":"")+(j.sticky?"y":""),_s=0,kc=new RegExp(j.source,ga+"g");(_i=Tt(_c,kc,Ut))&&!((Ci=kc.lastIndex)>_s&&(Eg(Fi,_v(Ut,_s,_i.index)),_i.length>1&&_i.index<Ut.length&&St(_f,Fi,_a(_i,1)),Di=_i[0].length,_s=Ci,Fi.length>=_r));)kc.lastIndex===_i.index&&kc.lastIndex++;return _s===Ut.length?!Di&&_p(kc,"")||Eg(Fi,""):Eg(Fi,_v(Ut,_s)),Fi.length>_r?_a(Fi,0,_r):Fi}:"0".split(void 0,0).length?function(j,_t){return void 0===j&&0===_t?[]:Tt(_e,this,j,_t)}:_e,[function split(_e,_t){var St=Ei(this),_r=null==_e?void 0:ga(_e,j);return _r?Tt(_r,_e,St,_t):Tt(Ut,_o(St),_e,_t)},function(j,St){var Tt=_i(this),_r=_o(j),_n=_t(Ut,Tt,_r,St,Ut!==_e);if(_n.done)return _n.value;var Ei=Ci(Tt,RegExp),ga=Tt.unicode,_a=(Tt.ignoreCase?"i":"")+(Tt.multiline?"m":"")+(Tt.unicode?"u":"")+(_l?"g":"y"),_c=new Ei(_l?"^(?:"+Tt.source+")":Tt,_a),kc=void 0===St?_d:St>>>0;if(0===kc)return[];if(0===_r.length)return null===_s(_c,_r)?[_r]:[];for(var _u=0,_f=0,_p=[];_f<_r.length;){_c.lastIndex=_l?0:_f;var _m,Pm=_s(_c,_l?_v(_r,_f):_r);if(null===Pm||(_m=_h(Fi(_c.lastIndex+(_l?_f:0)),_r.length))===_u)_f=Di(_r,_f,ga);else{if(Eg(_p,_v(_r,_u,_f)),_p.length===kc)return _p;for(var _y=1;_y<=Pm.length-1;_y++)if(Eg(_p,Pm[_y]),_p.length===kc)return _p;_f=_u=_m}}return Eg(_p,_v(_r,_u)),_p}]}),!_m,_l)},86:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(4230);St({target:"String",proto:!0,forced:_t(3429)("sub")},{sub:function sub(){return Tt(this,"sub","","")}})},2443:(j,_e,_t)=>{_t(7235)("asyncIterator")},1817:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(9781),Ut=_t(7854),_r=_t(1702),_n=_t(2597),_i=_t(614),Ei=_t(7976),Ci=_t(1340),Di=_t(3070).f,Fi=_t(9920),_o=Ut.Symbol,ga=_o&&_o.prototype;if(Tt&&_i(_o)&&(!("description"in ga)||void 0!==_o().description)){var _a={},_s=function Symbol(){var j=arguments.length<1||void 0===arguments[0]?void 0:Ci(arguments[0]),_e=Ei(ga,this)?new _o(j):void 0===j?_o():_o(j);return""===j&&(_a[_e]=!0),_e};Fi(_s,_o),_s.prototype=ga,ga.constructor=_s;var _c="Symbol(test)"==String(_o("test")),kc=_r(ga.toString),_u=_r(ga.valueOf),_l=/^Symbol\((.*)\)[^)]+$/,_d=_r("".replace),_h=_r("".slice);Di(ga,"description",{configurable:!0,get:function description(){var j=_u(this),_e=kc(j);if(_n(_a,j))return"";var _t=_c?_h(_e,7,-1):_d(_e,_l,"$1");return""===_t?void 0:_t}}),St({global:!0,forced:!0},{Symbol:_s})}},2165:(j,_e,_t)=>{_t(7235)("iterator")},2526:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(5005),_r=_t(2104),_n=_t(6916),_i=_t(1702),Ei=_t(1913),Ci=_t(9781),Di=_t(133),Fi=_t(7293),_o=_t(2597),ga=_t(3157),_a=_t(614),_s=_t(111),_c=_t(7976),kc=_t(2190),_u=_t(9670),_l=_t(7908),_d=_t(5656),_h=_t(4948),_f=_t(1340),_p=_t(9114),Eg=_t(30),_v=_t(1956),_m=_t(8006),Pm=_t(1156),_y=_t(5181),_A=_t(1236),e_=_t(3070),t_=_t(5296),r_=_t(206),i_=_t(1320),a_=_t(2309),s_=_t(6200),c_=_t(3501),u_=_t(9711),l_=_t(5112),d_=_t(6061),h_=_t(7235),f_=_t(8003),p_=_t(9909),v_=_t(2092).forEach,m_=s_("hidden"),y_="Symbol",A_="prototype",__=l_("toPrimitive"),b_=p_.set,E_=p_.getterFor(y_),w_=Object[A_],I_=Tt.Symbol,T_=I_&&I_[A_],C_=Tt.TypeError,R_=Tt.QObject,k_=Ut("JSON","stringify"),O_=_A.f,D_=e_.f,N_=Pm.f,P_=t_.f,M_=_i([].push),B_=a_("symbols"),j_=a_("op-symbols"),U_=a_("string-to-symbol-registry"),F_=a_("symbol-to-string-registry"),G_=a_("wks"),V_=!R_||!R_[A_]||!R_[A_].findChild,K_=Ci&&Fi((function(){return 7!=Eg(D_({},"a",{get:function(){return D_(this,"a",{value:7}).a}})).a}))?function(j,_e,_t){var St=O_(w_,_e);St&&delete w_[_e],D_(j,_e,_t),St&&j!==w_&&D_(w_,_e,St)}:D_,wrap=function(j,_e){var _t=B_[j]=Eg(T_);return b_(_t,{type:y_,tag:j,description:_e}),Ci||(_t.description=_e),_t},W_=function defineProperty(j,_e,_t){j===w_&&W_(j_,_e,_t),_u(j);var St=_h(_e);return _u(_t),_o(B_,St)?(_t.enumerable?(_o(j,m_)&&j[m_][St]&&(j[m_][St]=!1),_t=Eg(_t,{enumerable:_p(0,!1)})):(_o(j,m_)||D_(j,m_,_p(1,{})),j[m_][St]=!0),K_(j,St,_t)):D_(j,St,_t)},H_=function defineProperties(j,_e){_u(j);var _t=_d(_e),St=_v(_t).concat(Z_(_t));return v_(St,(function(_e){Ci&&!_n(Y_,_t,_e)||W_(j,_e,_t[_e])})),j},Y_=function propertyIsEnumerable(j){var _e=_h(j),_t=_n(P_,this,_e);return!(this===w_&&_o(B_,_e)&&!_o(j_,_e))&&(!(_t||!_o(this,_e)||!_o(B_,_e)||_o(this,m_)&&this[m_][_e])||_t)},J_=function getOwnPropertyDescriptor(j,_e){var _t=_d(j),St=_h(_e);if(_t!==w_||!_o(B_,St)||_o(j_,St)){var Tt=O_(_t,St);return!Tt||!_o(B_,St)||_o(_t,m_)&&_t[m_][St]||(Tt.enumerable=!0),Tt}},X_=function getOwnPropertyNames(j){var _e=N_(_d(j)),_t=[];return v_(_e,(function(j){_o(B_,j)||_o(c_,j)||M_(_t,j)})),_t},Z_=function getOwnPropertySymbols(j){var _e=j===w_,_t=N_(_e?j_:_d(j)),St=[];return v_(_t,(function(j){!_o(B_,j)||_e&&!_o(w_,j)||M_(St,B_[j])})),St};(Di||(I_=function Symbol(){if(_c(T_,this))throw C_("Symbol is not a constructor");var j=arguments.length&&void 0!==arguments[0]?_f(arguments[0]):void 0,_e=u_(j),setter=function(j){this===w_&&_n(setter,j_,j),_o(this,m_)&&_o(this[m_],_e)&&(this[m_][_e]=!1),K_(this,_e,_p(1,j))};return Ci&&V_&&K_(w_,_e,{configurable:!0,set:setter}),wrap(_e,j)},i_(T_=I_[A_],"toString",(function toString(){return E_(this).tag})),i_(I_,"withoutSetter",(function(j){return wrap(u_(j),j)})),t_.f=Y_,e_.f=W_,_A.f=J_,_m.f=Pm.f=X_,_y.f=Z_,d_.f=function(j){return wrap(l_(j),j)},Ci&&(D_(T_,"description",{configurable:!0,get:function description(){return E_(this).description}}),Ei||i_(w_,"propertyIsEnumerable",Y_,{unsafe:!0}))),St({global:!0,wrap:!0,forced:!Di,sham:!Di},{Symbol:I_}),v_(_v(G_),(function(j){h_(j)})),St({target:y_,stat:!0,forced:!Di},{for:function(j){var _e=_f(j);if(_o(U_,_e))return U_[_e];var _t=I_(_e);return U_[_e]=_t,F_[_t]=_e,_t},keyFor:function keyFor(j){if(!kc(j))throw C_(j+" is not a symbol");if(_o(F_,j))return F_[j]},useSetter:function(){V_=!0},useSimple:function(){V_=!1}}),St({target:"Object",stat:!0,forced:!Di,sham:!Ci},{create:function create(j,_e){return void 0===_e?Eg(j):H_(Eg(j),_e)},defineProperty:W_,defineProperties:H_,getOwnPropertyDescriptor:J_}),St({target:"Object",stat:!0,forced:!Di},{getOwnPropertyNames:X_,getOwnPropertySymbols:Z_}),St({target:"Object",stat:!0,forced:Fi((function(){_y.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(j){return _y.f(_l(j))}}),k_)&&St({target:"JSON",stat:!0,forced:!Di||Fi((function(){var j=I_();return"[null]"!=k_([j])||"{}"!=k_({a:j})||"{}"!=k_(Object(j))}))},{stringify:function stringify(j,_e,_t){var St=r_(arguments),Tt=_e;if((_s(_e)||void 0!==j)&&!kc(j))return ga(_e)||(_e=function(j,_e){if(_a(Tt)&&(_e=_n(Tt,this,j,_e)),!kc(_e))return _e}),St[1]=_e,_r(k_,null,St)}});if(!T_[__]){var $_=T_.valueOf;i_(T_,__,(function(j){return _n($_,this)}))}f_(I_,y_),c_[m_]=!0},9341:(j,_e,_t)=>{_t(7235)("toStringTag")},2990:(j,_e,_t)=>{"use strict";var St=_t(1702),Tt=_t(260),Ut=St(_t(1048)),_r=Tt.aTypedArray;(0,Tt.exportTypedArrayMethod)("copyWithin",(function copyWithin(j,_e){return Ut(_r(this),j,_e,arguments.length>2?arguments[2]:void 0)}))},8927:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).every,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("every",(function every(j){return Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},3105:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(6916),Ut=_t(1285),_r=St.aTypedArray;(0,St.exportTypedArrayMethod)("fill",(function fill(j){var _e=arguments.length;return Tt(Ut,_r(this),j,_e>1?arguments[1]:void 0,_e>2?arguments[2]:void 0)}))},5035:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).filter,Ut=_t(3074),_r=St.aTypedArray;(0,St.exportTypedArrayMethod)("filter",(function filter(j){var _e=Tt(_r(this),j,arguments.length>1?arguments[1]:void 0);return Ut(this,_e)}))},7174:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).findIndex,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("findIndex",(function findIndex(j){return Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},4345:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).find,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("find",(function find(j){return Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},4197:(j,_e,_t)=>{_t(9843)("Float32",(function(j){return function Float32Array(_e,_t,St){return j(this,_e,_t,St)}}))},2846:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).forEach,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("forEach",(function forEach(j){Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},4731:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(5367).includes,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("includes",(function includes(j){return Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},7209:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(5367).indexOf,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("indexOf",(function indexOf(j){return Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},6319:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(7293),Ut=_t(1702),_r=_t(260),_n=_t(6992),_i=_t(5112)("iterator"),Ei=St.Uint8Array,Ci=Ut(_n.values),Di=Ut(_n.keys),Fi=Ut(_n.entries),_o=_r.aTypedArray,ga=_r.exportTypedArrayMethod,_a=Ei&&Ei.prototype,_s=!Tt((function(){_a[_i].call([1])})),_c=!!_a&&_a.values&&_a[_i]===_a.values&&"values"===_a.values.name,kc=function values(){return Ci(_o(this))};ga("entries",(function entries(){return Fi(_o(this))}),_s),ga("keys",(function keys(){return Di(_o(this))}),_s),ga("values",kc,_s||!_c,{name:"values"}),ga(_i,kc,_s||!_c,{name:"values"})},8867:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(1702),Ut=St.aTypedArray,_r=St.exportTypedArrayMethod,_n=Tt([].join);_r("join",(function join(j){return _n(Ut(this),j)}))},7789:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2104),Ut=_t(6583),_r=St.aTypedArray;(0,St.exportTypedArrayMethod)("lastIndexOf",(function lastIndexOf(j){var _e=arguments.length;return Tt(Ut,_r(this),_e>1?[j,arguments[1]]:[j])}))},3739:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).map,Ut=_t(6304),_r=St.aTypedArray;(0,St.exportTypedArrayMethod)("map",(function map(j){return Tt(_r(this),j,arguments.length>1?arguments[1]:void 0,(function(j,_e){return new(Ut(j))(_e)}))}))},4483:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(3671).right,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("reduceRight",(function reduceRight(j){var _e=arguments.length;return Tt(Ut(this),j,_e,_e>1?arguments[1]:void 0)}))},9368:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(3671).left,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("reduce",(function reduce(j){var _e=arguments.length;return Tt(Ut(this),j,_e,_e>1?arguments[1]:void 0)}))},2056:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=St.aTypedArray,Ut=St.exportTypedArrayMethod,_r=Math.floor;Ut("reverse",(function reverse(){for(var j,_e=this,_t=Tt(_e).length,St=_r(_t/2),Ut=0;Ut<St;)j=_e[Ut],_e[Ut++]=_e[--_t],_e[_t]=j;return _e}))},3462:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(260),Ut=_t(6244),_r=_t(4590),_n=_t(7908),_i=_t(7293),Ei=St.RangeError,Ci=Tt.aTypedArray;(0,Tt.exportTypedArrayMethod)("set",(function set(j){Ci(this);var _e=_r(arguments.length>1?arguments[1]:void 0,1),_t=this.length,St=_n(j),Tt=Ut(St),_i=0;if(Tt+_e>_t)throw Ei("Wrong length");for(;_i<Tt;)this[_e+_i]=St[_i++]}),_i((function(){new Int8Array(1).set({})})))},678:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(6304),Ut=_t(7293),_r=_t(206),_n=St.aTypedArray;(0,St.exportTypedArrayMethod)("slice",(function slice(j,_e){for(var _t=_r(_n(this),j,_e),St=Tt(this),Ut=0,_i=_t.length,Ei=new St(_i);_i>Ut;)Ei[Ut]=_t[Ut++];return Ei}),Ut((function(){new Int8Array(1).slice()})))},7462:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).some,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("some",(function some(j){return Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},3824:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(1702),Ut=_t(7293),_r=_t(9662),_n=_t(4362),_i=_t(260),Ei=_t(8886),Ci=_t(256),Di=_t(7392),Fi=_t(8008),_o=St.Array,ga=_i.aTypedArray,_a=_i.exportTypedArrayMethod,_s=St.Uint16Array,_c=_s&&Tt(_s.prototype.sort),kc=!(!_c||Ut((function(){_c(new _s(2),null)}))&&Ut((function(){_c(new _s(2),{})}))),_u=!!_c&&!Ut((function(){if(Di)return Di<74;if(Ei)return Ei<67;if(Ci)return!0;if(Fi)return Fi<602;var j,_e,_t=new _s(516),St=_o(516);for(j=0;j<516;j++)_e=j%4,_t[j]=515-j,St[j]=j-2*_e+3;for(_c(_t,(function(j,_e){return(j/4|0)-(_e/4|0)})),j=0;j<516;j++)if(_t[j]!==St[j])return!0}));_a("sort",(function sort(j){return void 0!==j&&_r(j),_u?_c(this,j):_n(ga(this),function(j){return function(_e,_t){return void 0!==j?+j(_e,_t)||0:_t!=_t?-1:_e!=_e?1:0===_e&&0===_t?1/_e>0&&1/_t<0?1:-1:_e>_t}}(j))}),!_u||kc)},5021:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(7466),Ut=_t(1400),_r=_t(6304),_n=St.aTypedArray;(0,St.exportTypedArrayMethod)("subarray",(function subarray(j,_e){var _t=_n(this),St=_t.length,_i=Ut(j,St);return new(_r(_t))(_t.buffer,_t.byteOffset+_i*_t.BYTES_PER_ELEMENT,Tt((void 0===_e?St:Ut(_e,St))-_i))}))},2974:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(2104),Ut=_t(260),_r=_t(7293),_n=_t(206),_i=St.Int8Array,Ei=Ut.aTypedArray,Ci=Ut.exportTypedArrayMethod,Di=[].toLocaleString,Fi=!!_i&&_r((function(){Di.call(new _i(1))}));Ci("toLocaleString",(function toLocaleString(){return Tt(Di,Fi?_n(Ei(this)):Ei(this),_n(arguments))}),_r((function(){return[1,2].toLocaleString()!=new _i([1,2]).toLocaleString()}))||!_r((function(){_i.prototype.toLocaleString.call([1,2])})))},5016:(j,_e,_t)=>{"use strict";var St=_t(260).exportTypedArrayMethod,Tt=_t(7293),Ut=_t(7854),_r=_t(1702),_n=Ut.Uint8Array,_i=_n&&_n.prototype||{},Ei=[].toString,Ci=_r([].join);Tt((function(){Ei.call({})}))&&(Ei=function toString(){return Ci(this)});var Di=_i.toString!=Ei;St("toString",Ei,Di)},2472:(j,_e,_t)=>{_t(9843)("Uint8",(function(j){return function Uint8Array(_e,_t,St){return j(this,_e,_t,St)}}))},4129:(j,_e,_t)=>{"use strict";var St,Tt=_t(7854),Ut=_t(1702),_r=_t(2248),_n=_t(2423),_i=_t(7710),Ei=_t(9320),Ci=_t(111),Di=_t(2050),Fi=_t(9909).enforce,_o=_t(8536),ga=!Tt.ActiveXObject&&"ActiveXObject"in Tt,wrapper=function(j){return function WeakMap(){return j(this,arguments.length?arguments[0]:void 0)}},_a=_i("WeakMap",wrapper,Ei);if(_o&&ga){St=Ei.getConstructor(wrapper,"WeakMap",!0),_n.enable();var _s=_a.prototype,_c=Ut(_s.delete),kc=Ut(_s.has),_u=Ut(_s.get),_l=Ut(_s.set);_r(_s,{delete:function(j){if(Ci(j)&&!Di(j)){var _e=Fi(this);return _e.frozen||(_e.frozen=new St),_c(this,j)||_e.frozen.delete(j)}return _c(this,j)},has:function has(j){if(Ci(j)&&!Di(j)){var _e=Fi(this);return _e.frozen||(_e.frozen=new St),kc(this,j)||_e.frozen.has(j)}return kc(this,j)},get:function get(j){if(Ci(j)&&!Di(j)){var _e=Fi(this);return _e.frozen||(_e.frozen=new St),kc(this,j)?_u(this,j):_e.frozen.get(j)}return _u(this,j)},set:function set(j,_e){if(Ci(j)&&!Di(j)){var _t=Fi(this);_t.frozen||(_t.frozen=new St),kc(this,j)?_l(this,j,_e):_t.frozen.set(j,_e)}else _l(this,j,_e);return this}})}},8478:(j,_e,_t)=>{"use strict";_t(7710)("WeakSet",(function(j){return function WeakSet(){return j(this,arguments.length?arguments[0]:void 0)}}),_t(9320))},72:(j,_e,_t)=>{"use strict";_t(2109)({target:"Map",proto:!0,real:!0,forced:_t(1913)},{deleteAll:_t(4092)})},9137:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(4647),_i=_t(612);St({target:"Map",proto:!0,real:!0,forced:Tt},{every:function every(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return!_i(_t,(function(j,_t,Tt){if(!St(_t,j,_e))return Tt()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},1957:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(9974),_n=_t(6916),_i=_t(9662),Ei=_t(9670),Ci=_t(6707),Di=_t(4647),Fi=_t(612);Tt({target:"Map",proto:!0,real:!0,forced:St},{filter:function filter(j){var _e=Ei(this),_t=Di(_e),St=_r(j,arguments.length>1?arguments[1]:void 0),Tt=new(Ci(_e,Ut("Map"))),_o=_i(Tt.set);return Fi(_t,(function(j,_t){St(_t,j,_e)&&_n(_o,Tt,j,_t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),Tt}})},103:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(4647),_i=_t(612);St({target:"Map",proto:!0,real:!0,forced:Tt},{findKey:function findKey(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return _i(_t,(function(j,_t,Tt){if(St(_t,j,_e))return Tt(j)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},6306:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(4647),_i=_t(612);St({target:"Map",proto:!0,real:!0,forced:Tt},{find:function find(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return _i(_t,(function(j,_t,Tt){if(St(_t,j,_e))return Tt(_t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},4592:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(9670),_r=_t(4647),_n=_t(6465),_i=_t(612);Tt({target:"Map",proto:!0,real:!0,forced:St},{includes:function includes(j){return _i(_r(Ut(this)),(function(_e,_t,St){if(_n(_t,j))return St()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},8276:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(4647),_n=_t(612);St({target:"Map",proto:!0,real:!0,forced:Tt},{keyOf:function keyOf(j){return _n(_r(Ut(this)),(function(_e,_t,St){if(_t===j)return St(_e)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},5082:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(9974),_n=_t(6916),_i=_t(9662),Ei=_t(9670),Ci=_t(6707),Di=_t(4647),Fi=_t(612);Tt({target:"Map",proto:!0,real:!0,forced:St},{mapKeys:function mapKeys(j){var _e=Ei(this),_t=Di(_e),St=_r(j,arguments.length>1?arguments[1]:void 0),Tt=new(Ci(_e,Ut("Map"))),_o=_i(Tt.set);return Fi(_t,(function(j,_t){_n(_o,Tt,St(_t,j,_e),_t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),Tt}})},2813:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(9974),_n=_t(6916),_i=_t(9662),Ei=_t(9670),Ci=_t(6707),Di=_t(4647),Fi=_t(612);Tt({target:"Map",proto:!0,real:!0,forced:St},{mapValues:function mapValues(j){var _e=Ei(this),_t=Di(_e),St=_r(j,arguments.length>1?arguments[1]:void 0),Tt=new(Ci(_e,Ut("Map"))),_o=_i(Tt.set);return Fi(_t,(function(j,_t){_n(_o,Tt,j,St(_t,j,_e))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),Tt}})},8222:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9662),_r=_t(9670),_n=_t(612);St({target:"Map",proto:!0,real:!0,forced:Tt},{merge:function merge(j){for(var _e=_r(this),_t=Ut(_e.set),St=arguments.length,Tt=0;Tt<St;)_n(arguments[Tt++],_t,{that:_e,AS_ENTRIES:!0});return _e}})},8563:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(1913),_r=_t(9670),_n=_t(9662),_i=_t(4647),Ei=_t(612),Ci=Tt.TypeError;St({target:"Map",proto:!0,real:!0,forced:Ut},{reduce:function reduce(j){var _e=_r(this),_t=_i(_e),St=arguments.length<2,Tt=St?void 0:arguments[1];if(_n(j),Ei(_t,(function(_t,Ut){St?(St=!1,Tt=Ut):Tt=j(Tt,Ut,_t,_e)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),St)throw Ci("Reduce of empty map with no initial value");return Tt}})},336:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(4647),_i=_t(612);St({target:"Map",proto:!0,real:!0,forced:Tt},{some:function some(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return _i(_t,(function(j,_t,Tt){if(St(_t,j,_e))return Tt()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},7512:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(7854),_r=_t(6916),_n=_t(9670),_i=_t(9662),Ei=Ut.TypeError;Tt({target:"Map",proto:!0,real:!0,forced:St},{update:function update(j,_e){var _t=_n(this),St=_i(_t.get),Tt=_i(_t.has),Ut=_i(_t.set),Ci=arguments.length;_i(_e);var Di=_r(Tt,_t,j);if(!Di&&Ci<3)throw Ei("Updating absent value");var Fi=Di?_r(St,_t,j):_i(Ci>2?arguments[2]:void 0)(j,_t);return _r(Ut,_t,j,_e(Fi,j,_t)),_t}})},8921:(j,_e,_t)=>{"use strict";_t(2109)({target:"Set",proto:!0,real:!0,forced:_t(1913)},{addAll:_t(1501)})},6248:(j,_e,_t)=>{"use strict";_t(2109)({target:"Set",proto:!0,real:!0,forced:_t(1913)},{deleteAll:_t(4092)})},3599:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(6916),_n=_t(9662),_i=_t(9670),Ei=_t(6707),Ci=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{difference:function difference(j){var _e=_i(this),_t=new(Ei(_e,Ut("Set")))(_e),St=_n(_t.delete);return Ci(j,(function(j){_r(St,_t,j)})),_t}})},1477:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(6767),_i=_t(612);St({target:"Set",proto:!0,real:!0,forced:Tt},{every:function every(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return!_i(_t,(function(j,_t){if(!St(j,j,_e))return _t()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},3066:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(6916),_n=_t(9662),_i=_t(9670),Ei=_t(9974),Ci=_t(6707),Di=_t(6767),Fi=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{filter:function filter(j){var _e=_i(this),_t=Di(_e),St=Ei(j,arguments.length>1?arguments[1]:void 0),Tt=new(Ci(_e,Ut("Set"))),_o=_n(Tt.add);return Fi(_t,(function(j){St(j,j,_e)&&_r(_o,Tt,j)}),{IS_ITERATOR:!0}),Tt}})},5389:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(6767),_i=_t(612);St({target:"Set",proto:!0,real:!0,forced:Tt},{find:function find(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return _i(_t,(function(j,_t){if(St(j,j,_e))return _t(j)}),{IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},401:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(6916),_n=_t(9662),_i=_t(9670),Ei=_t(6707),Ci=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{intersection:function intersection(j){var _e=_i(this),_t=new(Ei(_e,Ut("Set"))),St=_n(_e.has),Tt=_n(_t.add);return Ci(j,(function(j){_r(St,_e,j)&&_r(Tt,_t,j)})),_t}})},5164:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(6916),_r=_t(9662),_n=_t(9670),_i=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{isDisjointFrom:function isDisjointFrom(j){var _e=_n(this),_t=_r(_e.has);return!_i(j,(function(j,St){if(!0===Ut(_t,_e,j))return St()}),{INTERRUPTED:!0}).stopped}})},1238:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(6916),_n=_t(9662),_i=_t(614),Ei=_t(9670),Ci=_t(8554),Di=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{isSubsetOf:function isSubsetOf(j){var _e=Ci(this),_t=Ei(j),St=_t.has;return _i(St)||(_t=new(Ut("Set"))(j),St=_n(_t.has)),!Di(_e,(function(j,_e){if(!1===_r(St,_t,j))return _e()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},4837:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(6916),_r=_t(9662),_n=_t(9670),_i=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{isSupersetOf:function isSupersetOf(j){var _e=_n(this),_t=_r(_e.has);return!_i(j,(function(j,St){if(!1===Ut(_t,_e,j))return St()}),{INTERRUPTED:!0}).stopped}})},7485:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(1702),_r=_t(9670),_n=_t(1340),_i=_t(6767),Ei=_t(612),Ci=Ut([].join),Di=[].push;Tt({target:"Set",proto:!0,real:!0,forced:St},{join:function join(j){var _e=_r(this),_t=_i(_e),St=void 0===j?",":_n(j),Tt=[];return Ei(_t,Di,{that:Tt,IS_ITERATOR:!0}),Ci(Tt,St)}})},465:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(9974),_n=_t(6916),_i=_t(9662),Ei=_t(9670),Ci=_t(6707),Di=_t(6767),Fi=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{map:function map(j){var _e=Ei(this),_t=Di(_e),St=_r(j,arguments.length>1?arguments[1]:void 0),Tt=new(Ci(_e,Ut("Set"))),_o=_i(Tt.add);return Fi(_t,(function(j){_n(_o,Tt,St(j,j,_e))}),{IS_ITERATOR:!0}),Tt}})},6651:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(1913),_r=_t(9662),_n=_t(9670),_i=_t(6767),Ei=_t(612),Ci=Tt.TypeError;St({target:"Set",proto:!0,real:!0,forced:Ut},{reduce:function reduce(j){var _e=_n(this),_t=_i(_e),St=arguments.length<2,Tt=St?void 0:arguments[1];if(_r(j),Ei(_t,(function(_t){St?(St=!1,Tt=_t):Tt=j(Tt,_t,_t,_e)}),{IS_ITERATOR:!0}),St)throw Ci("Reduce of empty set with no initial value");return Tt}})},1437:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(6767),_i=_t(612);St({target:"Set",proto:!0,real:!0,forced:Tt},{some:function some(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return _i(_t,(function(j,_t){if(St(j,j,_e))return _t()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},5285:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(6916),_n=_t(9662),_i=_t(9670),Ei=_t(6707),Ci=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{symmetricDifference:function symmetricDifference(j){var _e=_i(this),_t=new(Ei(_e,Ut("Set")))(_e),St=_n(_t.delete),Tt=_n(_t.add);return Ci(j,(function(j){_r(St,_t,j)||_r(Tt,_t,j)})),_t}})},9865:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(5005),_r=_t(9662),_n=_t(9670),_i=_t(6707),Ei=_t(612);St({target:"Set",proto:!0,real:!0,forced:Tt},{union:function union(j){var _e=_n(this),_t=new(_i(_e,Ut("Set")))(_e);return Ei(j,_r(_t.add),{that:_t}),_t}})},8206:(j,_e,_t)=>{"use strict";_t(2109)({target:"WeakMap",proto:!0,real:!0,forced:_t(1913)},{deleteAll:_t(4092)})},3561:(j,_e,_t)=>{"use strict";_t(2109)({target:"WeakSet",proto:!0,real:!0,forced:_t(1913)},{addAll:_t(1501)})},2049:(j,_e,_t)=>{"use strict";_t(2109)({target:"WeakSet",proto:!0,real:!0,forced:_t(1913)},{deleteAll:_t(4092)})},4747:(j,_e,_t)=>{var St=_t(7854),Tt=_t(8324),Ut=_t(8509),_r=_t(8533),_n=_t(8880),handlePrototype=function(j){if(j&&j.forEach!==_r)try{_n(j,"forEach",_r)}catch(_e){j.forEach=_r}};for(var _i in Tt)Tt[_i]&&handlePrototype(St[_i]&&St[_i].prototype);handlePrototype(Ut)},3948:(j,_e,_t)=>{var St=_t(7854),Tt=_t(8324),Ut=_t(8509),_r=_t(6992),_n=_t(8880),_i=_t(5112),Ei=_i("iterator"),Ci=_i("toStringTag"),Di=_r.values,handlePrototype=function(j,_e){if(j){if(j[Ei]!==Di)try{_n(j,Ei,Di)}catch(_e){j[Ei]=Di}if(j[Ci]||_n(j,Ci,_e),Tt[_e])for(var _t in _r)if(j[_t]!==_r[_t])try{_n(j,_t,_r[_t])}catch(_e){j[_t]=_r[_t]}}};for(var Fi in Tt)handlePrototype(St[Fi]&&St[Fi].prototype,Fi);handlePrototype(Ut,"DOMTokenList")},2564:(j,_e,_t)=>{var St=_t(2109),Tt=_t(7854),Ut=_t(2104),_r=_t(614),_n=_t(8113),_i=_t(206),Ei=/MSIE .\./.test(_n),Ci=Tt.Function,wrap=function(j){return function(_e,_t){var St=arguments.length>2,Tt=St?_i(arguments,2):void 0;return j(St?function(){Ut(_r(_e)?_e:Ci(_e),this,Tt)}:_e,_t)}};St({global:!0,bind:!0,forced:Ei},{setTimeout:wrap(Tt.setTimeout),setInterval:wrap(Tt.setInterval)})},5455:j=>{"use strict";j.exports=require("agora-electron-sdk")},5760:j=>{"use strict";j.exports=__WEBPACK_EXTERNAL_MODULE__5760__}},__webpack_module_cache__={};function __webpack_require__(j){var _e=__webpack_module_cache__[j];if(void 0!==_e)return _e.exports;var _t=__webpack_module_cache__[j]={id:j,loaded:!1,exports:{}};return __webpack_modules__[j].call(_t.exports,_t,_t.exports,__webpack_require__),_t.loaded=!0,_t.exports}__webpack_require__.amdO={},__webpack_require__.n=j=>{var _e=j&&j.__esModule?()=>j.default:()=>j;return __webpack_require__.d(_e,{a:_e}),_e},__webpack_require__.d=(j,_e)=>{for(var _t in _e)__webpack_require__.o(_e,_t)&&!__webpack_require__.o(j,_t)&&Object.defineProperty(j,_t,{enumerable:!0,get:_e[_t]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(j){if("object"==typeof window)return window}}(),__webpack_require__.o=(j,_e)=>Object.prototype.hasOwnProperty.call(j,_e),__webpack_require__.r=j=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})},__webpack_require__.nmd=j=>(j.paths=[],j.children||(j.children=[]),j);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AGChannelProfile:()=>TE,AGError:()=>JE,AGErrorWrapper:()=>XE,AGEventEmitter:()=>_a,AGLighteningLevel:()=>LR,AGMediaEncryptionMode:()=>OR,AGNetworkQuality:()=>TR,AGRemoteVideoStreamType:()=>NR,AGRenderMode:()=>xR,AGRtcConnectionType:()=>_R,AGRtcState:()=>kR,AGRteErrorCode:()=>QE,AGRteTrackErrorReason:()=>CR,AGScreenShareType:()=>DR,AbstractErrorCenter:()=>YE,ActionWhenTaskFail:()=>rR,AgoraChatMessage:()=>NT,AgoraLatencyLevel:()=>zE,AgoraMediaControl:()=>tO,AgoraMediaControlEventType:()=>$R,AgoraMediaPlayerCanvas:()=>AD,AgoraRCEventType:()=>UP,AgoraRCRole:()=>BP,AgoraRegion:()=>WE,AgoraRoom:()=>xT,AgoraRtcLocalVideoCanvas:()=>pD,AgoraRtcVideoCanvas:()=>uD,AgoraRteAudioRawDataPosition:()=>XR,AgoraRteAudioSourceType:()=>vR,AgoraRteCameraVideoTrack:()=>wR,AgoraRteConnectionState:()=>IE,AgoraRteEngine:()=>YP,AgoraRteEngineConfig:()=>$E,AgoraRteEventType:()=>RT,AgoraRteLogLevel:()=>SE,AgoraRteMediaPublishState:()=>mR,AgoraRteMediaSourceState:()=>RR,AgoraRteMediaTrack:()=>bR,AgoraRteMicrophoneAudioTrack:()=>SR,AgoraRteRuntimePlatform:()=>KE,AgoraRteScene:()=>ZR,AgoraRteScreenShareTrack:()=>IR,AgoraRteStreamMediaTrack:()=>ER,AgoraRteThread:()=>BO,AgoraRteVideoSourceType:()=>pR,AgoraStream:()=>DT,AgoraUser:()=>OT,ApiBase:()=>JT,Duration:()=>cR,Lodash:()=>NS,Log:()=>kS,Logger:()=>ME,MediaPlayerEvents:()=>uR,Scheduler:()=>j,StreamMediaPlayer:()=>yR,bound:()=>xS,retryAttempt:()=>gS});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{Duration:()=>cR,createScheduler:()=>hR,shared:()=>fR});var _e={};__webpack_require__.r(_e),__webpack_require__.d(_e,{identity:()=>BD});var _t={};__webpack_require__.r(_t),__webpack_require__.d(_t,{base2:()=>UD});var St={};__webpack_require__.r(St),__webpack_require__.d(St,{base8:()=>FD});var Tt={};__webpack_require__.r(Tt),__webpack_require__.d(Tt,{base10:()=>VD});var Ut={};__webpack_require__.r(Ut),__webpack_require__.d(Ut,{base16:()=>qD,base16upper:()=>QD});var _r={};__webpack_require__.r(_r),__webpack_require__.d(_r,{base32:()=>HD,base32hex:()=>rL,base32hexpad:()=>iL,base32hexpadupper:()=>oL,base32hexupper:()=>nL,base32pad:()=>_x,base32padupper:()=>tL,base32upper:()=>XD,base32z:()=>sL});var _n={};__webpack_require__.r(_n),__webpack_require__.d(_n,{base36:()=>cL,base36upper:()=>uL});var _i={};__webpack_require__.r(_i),__webpack_require__.d(_i,{base58btc:()=>dL,base58flickr:()=>hL});var Ei={};__webpack_require__.r(Ei),__webpack_require__.d(Ei,{base64:()=>pL,base64pad:()=>gL,base64url:()=>vL,base64urlpad:()=>mL});var Ci={};__webpack_require__.r(Ci),__webpack_require__.d(Ci,{base256emoji:()=>bL});var Di={};__webpack_require__.r(Di),__webpack_require__.d(Di,{sha256:()=>BL,sha512:()=>jL});var Fi={};__webpack_require__.r(Fi),__webpack_require__.d(Fi,{identity:()=>FL});var _o={};__webpack_require__.r(_o),__webpack_require__.d(_o,{code:()=>VL,decode:()=>raw_decode,encode:()=>raw_encode,name:()=>GL});var ga={};__webpack_require__.r(ga),__webpack_require__.d(ga,{code:()=>HL,decode:()=>json_decode,encode:()=>json_encode,name:()=>WL});__webpack_require__(2419),__webpack_require__(9070),__webpack_require__(2526),__webpack_require__(1817),__webpack_require__(1539),__webpack_require__(2165),__webpack_require__(6992),__webpack_require__(8783),__webpack_require__(3948),__webpack_require__(2443),__webpack_require__(9341),__webpack_require__(3706),__webpack_require__(408),__webpack_require__(8011),__webpack_require__(489),__webpack_require__(9554),__webpack_require__(4747),__webpack_require__(8309),__webpack_require__(8304),__webpack_require__(8674),__webpack_require__(5069),__webpack_require__(7042);function _typeof(j){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(j){return typeof j}:function(j){return j&&"function"==typeof Symbol&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},_typeof(j)}function _arrayLikeToArray(j,_e){(null==_e||_e>j.length)&&(_e=j.length);for(var _t=0,St=new Array(_e);_t<_e;_t++)St[_t]=j[_t];return St}function _unsupportedIterableToArray(j,_e){if(j){if("string"==typeof j)return _arrayLikeToArray(j,_e);var _t=Object.prototype.toString.call(j).slice(8,-1);return"Object"===_t&&j.constructor&&(_t=j.constructor.name),"Map"===_t||"Set"===_t?Array.from(j):"Arguments"===_t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_t)?_arrayLikeToArray(j,_e):void 0}}function _slicedToArray(j,_e){return function _arrayWithHoles(j){if(Array.isArray(j))return j}(j)||function _iterableToArrayLimit(j,_e){var _t=null==j?null:"undefined"!=typeof Symbol&&j[Symbol.iterator]||j["@@iterator"];if(null!=_t){var St,Tt,Ut,_r,_n=[],_i=!0,Ei=!1;try{if(Ut=(_t=_t.call(j)).next,0===_e){if(Object(_t)!==_t)return;_i=!1}else for(;!(_i=(St=Ut.call(_t)).done)&&(_n.push(St.value),_n.length!==_e);_i=!0);}catch(j){Ei=!0,Tt=j}finally{try{if(!_i&&null!=_t.return&&(_r=_t.return(),Object(_r)!==_r))return}finally{if(Ei)throw Tt}}return _n}}(j,_e)||_unsupportedIterableToArray(j,_e)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function asyncGeneratorStep(j,_e,_t,St,Tt,Ut,_r){try{var _n=j[Ut](_r),_i=_n.value}catch(j){return void _t(j)}_n.done?_e(_i):Promise.resolve(_i).then(St,Tt)}function _asyncToGenerator(j){return function(){var _e=this,_t=arguments;return new Promise((function(St,Tt){var Ut=j.apply(_e,_t);function _next(j){asyncGeneratorStep(Ut,St,Tt,_next,_throw,"next",j)}function _throw(j){asyncGeneratorStep(Ut,St,Tt,_next,_throw,"throw",j)}_next(void 0)}))}}function _classCallCheck(j,_e){if(!(j instanceof _e))throw new TypeError("Cannot call a class as a function")}function _toPropertyKey(j){var _e=function _toPrimitive(j,_e){if("object"!==_typeof(j)||null===j)return j;var _t=j[Symbol.toPrimitive];if(void 0!==_t){var St=_t.call(j,_e||"default");if("object"!==_typeof(St))return St;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===_e?String:Number)(j)}(j,"string");return"symbol"===_typeof(_e)?_e:String(_e)}function _defineProperties(j,_e){for(var _t=0;_t<_e.length;_t++){var St=_e[_t];St.enumerable=St.enumerable||!1,St.configurable=!0,"value"in St&&(St.writable=!0),Object.defineProperty(j,_toPropertyKey(St.key),St)}}function _createClass(j,_e,_t){return _e&&_defineProperties(j.prototype,_e),_t&&_defineProperties(j,_t),Object.defineProperty(j,"prototype",{writable:!1}),j}function _setPrototypeOf(j,_e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(j,_e){return j.__proto__=_e,j},_setPrototypeOf(j,_e)}function _inherits(j,_e){if("function"!=typeof _e&&null!==_e)throw new TypeError("Super expression must either be null or a function");j.prototype=Object.create(_e&&_e.prototype,{constructor:{value:j,writable:!0,configurable:!0}}),Object.defineProperty(j,"prototype",{writable:!1}),_e&&_setPrototypeOf(j,_e)}function _assertThisInitialized(j){if(void 0===j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function _possibleConstructorReturn(j,_e){if(_e&&("object"===_typeof(_e)||"function"==typeof _e))return _e;if(void 0!==_e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(j)}function _getPrototypeOf(j){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(j){return j.__proto__||Object.getPrototypeOf(j)},_getPrototypeOf(j)}__webpack_require__(2222),__webpack_require__(1038),__webpack_require__(9753),__webpack_require__(1532),__webpack_require__(72),__webpack_require__(9137),__webpack_require__(1957),__webpack_require__(6306),__webpack_require__(103),__webpack_require__(4592),__webpack_require__(8276),__webpack_require__(5082),__webpack_require__(2813),__webpack_require__(8222),__webpack_require__(8563),__webpack_require__(336),__webpack_require__(7512),__webpack_require__(7327);function _createForOfIteratorHelper(j,_e){var _t="undefined"!=typeof Symbol&&j[Symbol.iterator]||j["@@iterator"];if(!_t){if(Array.isArray(j)||(_t=function events_unsupportedIterableToArray(j,_e){if(!j)return;if("string"==typeof j)return events_arrayLikeToArray(j,_e);var _t=Object.prototype.toString.call(j).slice(8,-1);"Object"===_t&&j.constructor&&(_t=j.constructor.name);if("Map"===_t||"Set"===_t)return Array.from(j);if("Arguments"===_t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_t))return events_arrayLikeToArray(j,_e)}(j))||_e&&j&&"number"==typeof j.length){_t&&(j=_t);var St=0,Tt=function F(){};return{s:Tt,n:function n(){return St>=j.length?{done:!0}:{done:!1,value:j[St++]}},e:function e(j){throw j},f:Tt}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Ut,_r=!0,_n=!1;return{s:function s(){_t=_t.call(j)},n:function n(){var j=_t.next();return _r=j.done,j},e:function e(j){_n=!0,Ut=j},f:function f(){try{_r||null==_t.return||_t.return()}finally{if(_n)throw Ut}}}}function events_arrayLikeToArray(j,_e){(null==_e||_e>j.length)&&(_e=j.length);for(var _t=0,St=new Array(_e);_t<_e;_t++)St[_t]=j[_t];return St}var _a=function(){function AGEventEmitter(){_classCallCheck(this,AGEventEmitter),this._eventMap=new Map}return _createClass(AGEventEmitter,[{key:"once",value:function once(j,_e){var _t=this;return this.on(j,(function wrapper(){_t.off(j,wrapper),_e.apply(void 0,arguments)})),this}},{key:"on",value:function on(j,_e){var _t,St=null!==(_t=this._eventMap.get(j))&&void 0!==_t?_t:[];return St.push(_e),this._eventMap.set(j,St),this}},{key:"off",value:function off(j,_e){var _t=this._eventMap.get(j);return _t&&this._eventMap.set(j,_t.filter((function(j){return j!==_e}))),this}},{key:"removeAllEventListeners",value:function removeAllEventListeners(){this._eventMap.clear()}},{key:"emit",value:function emit(j){for(var _e,_t=null!==(_e=this._eventMap.get(j))&&void 0!==_e?_e:[],St=arguments.length,Tt=new Array(St>1?St-1:0),Ut=1;Ut<St;Ut++)Tt[Ut-1]=arguments[Ut];var _r,_n=_createForOfIteratorHelper(_t);try{for(_n.s();!(_r=_n.n()).done;){var _i=_r.value;try{_i&&_i.apply(void 0,Tt)}catch(_e){var Ei=_e,Ci=Ei.stack||Ei.message;console.error("[event] handling event ".concat(j," fail: ").concat(Ci))}}}catch(j){_n.e(j)}finally{_n.f()}return this}}]),AGEventEmitter}();__webpack_require__(7941),__webpack_require__(5003),__webpack_require__(9337),__webpack_require__(3321);function _defineProperty(j,_e,_t){return(_e=_toPropertyKey(_e))in j?Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}):j[_e]=_t,j}__webpack_require__(2772);function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}function _construct(j,_e,_t){return _construct=_isNativeReflectConstruct()?Reflect.construct.bind():function _construct(j,_e,_t){var St=[null];St.push.apply(St,_e);var Tt=new(Function.bind.apply(j,St));return _t&&_setPrototypeOf(Tt,_t.prototype),Tt},_construct.apply(null,arguments)}function _wrapNativeSuper(j){var _e="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(j){if(null===j||!function _isNativeFunction(j){return-1!==Function.toString.call(j).indexOf("[native code]")}(j))return j;if("function"!=typeof j)throw new TypeError("Super expression must either be null or a function");if(void 0!==_e){if(_e.has(j))return _e.get(j);_e.set(j,Wrapper)}function Wrapper(){return _construct(j,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(j.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,j)},_wrapNativeSuper(j)}__webpack_require__(6699),__webpack_require__(2023);function _toConsumableArray(j){return function _arrayWithoutHoles(j){if(Array.isArray(j))return _arrayLikeToArray(j)}(j)||function _iterableToArray(j){if("undefined"!=typeof Symbol&&null!=j[Symbol.iterator]||null!=j["@@iterator"])return Array.from(j)}(j)||_unsupportedIterableToArray(j)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}__webpack_require__(9600),__webpack_require__(3843),__webpack_require__(3710),__webpack_require__(9720);var __assign=function(){return __assign=Object.assign||function __assign(j){for(var _e,_t=1,St=arguments.length;_t<St;_t++)for(var Tt in _e=arguments[_t])Object.prototype.hasOwnProperty.call(_e,Tt)&&(j[Tt]=_e[Tt]);return j},__assign.apply(this,arguments)};function __spreadArrays(){for(var j=0,_e=0,_t=arguments.length;_e<_t;_e++)j+=arguments[_e].length;var St=Array(j),Tt=0;for(_e=0;_e<_t;_e++)for(var Ut=arguments[_e],_r=0,_n=Ut.length;_r<_n;_r++,Tt++)St[Tt]=Ut[_r];return St}var _s=Object.keys,_c=Array.isArray,kc="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function extend(j,_e){return"object"!=typeof _e||_s(_e).forEach((function(_t){j[_t]=_e[_t]})),j}"undefined"==typeof Promise||kc.Promise||(kc.Promise=Promise);var _u=Object.getPrototypeOf,_l={}.hasOwnProperty;function hasOwn(j,_e){return _l.call(j,_e)}function props(j,_e){"function"==typeof _e&&(_e=_e(_u(j))),_s(_e).forEach((function(_t){setProp(j,_t,_e[_t])}))}var _d=Object.defineProperty;function setProp(j,_e,_t,St){_d(j,_e,extend(_t&&hasOwn(_t,"get")&&"function"==typeof _t.get?{get:_t.get,set:_t.set,configurable:!0}:{value:_t,configurable:!0,writable:!0},St))}function derive(j){return{from:function(_e){return j.prototype=Object.create(_e.prototype),setProp(j.prototype,"constructor",j),{extend:props.bind(null,j.prototype)}}}}var _h=Object.getOwnPropertyDescriptor;function getPropertyDescriptor(j,_e){var _t;return _h(j,_e)||(_t=_u(j))&&getPropertyDescriptor(_t,_e)}var _f=[].slice;function slice(j,_e,_t){return _f.call(j,_e,_t)}function override(j,_e){return _e(j)}function assert(j){if(!j)throw new Error("Assertion Failed")}function asap(j){kc.setImmediate?setImmediate(j):setTimeout(j,0)}function arrayToObject(j,_e){return j.reduce((function(j,_t,St){var Tt=_e(_t,St);return Tt&&(j[Tt[0]]=Tt[1]),j}),{})}function getByKeyPath(j,_e){if(hasOwn(j,_e))return j[_e];if(!_e)return j;if("string"!=typeof _e){for(var _t=[],St=0,Tt=_e.length;St<Tt;++St){var Ut=getByKeyPath(j,_e[St]);_t.push(Ut)}return _t}var _r=_e.indexOf(".");if(-1!==_r){var _n=j[_e.substr(0,_r)];return void 0===_n?void 0:getByKeyPath(_n,_e.substr(_r+1))}}function setByKeyPath(j,_e,_t){if(j&&void 0!==_e&&(!("isFrozen"in Object)||!Object.isFrozen(j)))if("string"!=typeof _e&&"length"in _e){assert("string"!=typeof _t&&"length"in _t);for(var St=0,Tt=_e.length;St<Tt;++St)setByKeyPath(j,_e[St],_t[St])}else{var Ut=_e.indexOf(".");if(-1!==Ut){var _r=_e.substr(0,Ut),_n=_e.substr(Ut+1);if(""===_n)void 0===_t?_c(j)&&!isNaN(parseInt(_r))?j.splice(_r,1):delete j[_r]:j[_r]=_t;else{var _i=j[_r];_i||(_i=j[_r]={}),setByKeyPath(_i,_n,_t)}}else void 0===_t?_c(j)&&!isNaN(parseInt(_e))?j.splice(_e,1):delete j[_e]:j[_e]=_t}}function delByKeyPath(j,_e){"string"==typeof _e?setByKeyPath(j,_e,void 0):"length"in _e&&[].map.call(_e,(function(_e){setByKeyPath(j,_e,void 0)}))}function shallowClone(j){var _e={};for(var _t in j)hasOwn(j,_t)&&(_e[_t]=j[_t]);return _e}var _p=[].concat;function flatten(j){return _p.apply([],j)}var Eg="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(flatten([8,16,32,64].map((function(j){return["Int","Uint","Float"].map((function(_e){return _e+j+"Array"}))})))).filter((function(j){return kc[j]})),_v=Eg.map((function(j){return kc[j]})),_m=arrayToObject(Eg,(function(j){return[j,!0]}));function deepClone(j){if(!j||"object"!=typeof j)return j;var _e;if(_c(j)){_e=[];for(var _t=0,St=j.length;_t<St;++_t)_e.push(deepClone(j[_t]))}else if(_v.indexOf(j.constructor)>=0)_e=j;else for(var Tt in _e=j.constructor?Object.create(j.constructor.prototype):{},j)hasOwn(j,Tt)&&(_e[Tt]=deepClone(j[Tt]));return _e}var Pm={}.toString;function toStringTag(j){return Pm.call(j).slice(8,-1)}var getValueOf=function(j,_e){return"Array"===_e?""+j.map((function(j){return getValueOf(j,toStringTag(j))})):"ArrayBuffer"===_e?""+new Uint8Array(j):"Date"===_e?j.getTime():ArrayBuffer.isView(j)?""+new Uint8Array(j.buffer):j};function getObjectDiff(j,_e,_t,St){return _t=_t||{},St=St||"",_s(j).forEach((function(Tt){if(hasOwn(_e,Tt)){var Ut=j[Tt],_r=_e[Tt];if("object"==typeof Ut&&"object"==typeof _r&&Ut&&_r){var _n=toStringTag(Ut),_i=toStringTag(_r);_n===_i?_m[_n]?getValueOf(Ut,_n)!==getValueOf(_r,_i)&&(_t[St+Tt]=_e[Tt]):getObjectDiff(Ut,_r,_t,St+Tt+"."):_t[St+Tt]=_e[Tt]}else Ut!==_r&&(_t[St+Tt]=_e[Tt])}else _t[St+Tt]=void 0})),_s(_e).forEach((function(Tt){hasOwn(j,Tt)||(_t[St+Tt]=_e[Tt])})),_t}var _y="undefined"!=typeof Symbol&&Symbol.iterator,_A=_y?function(j){var _e;return null!=j&&(_e=j[_y])&&_e.apply(j)}:function(){return null},e_={};function getArrayOf(j){var _e,_t,St,Tt;if(1===arguments.length){if(_c(j))return j.slice();if(this===e_&&"string"==typeof j)return[j];if(Tt=_A(j)){for(_t=[];!(St=Tt.next()).done;)_t.push(St.value);return _t}if(null==j)return[j];if("number"==typeof(_e=j.length)){for(_t=new Array(_e);_e--;)_t[_e]=j[_e];return _t}return[j]}for(_e=arguments.length,_t=new Array(_e);_e--;)_t[_e]=arguments[_e];return _t}var t_="undefined"!=typeof Symbol?function(j){return"AsyncFunction"===j[Symbol.toStringTag]}:function(){return!1},r_="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function setDebug(j,_e){r_=j,libraryFilter=_e}var libraryFilter=function(){return!0},i_=!new Error("").stack;function getErrorWithStack(){if(i_)try{throw new Error}catch(j){return j}return new Error}function prettyStack(j,_e){var _t=j.stack;return _t?(_e=_e||0,0===_t.indexOf(j.name)&&(_e+=(j.name+j.message).split("\n").length),_t.split("\n").slice(_e).filter(libraryFilter).map((function(j){return"\n"+j})).join("")):""}var a_=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],s_=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(a_),c_={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function DexieError(j,_e){this._e=getErrorWithStack(),this.name=j,this.message=_e}function getMultiErrorMessage(j,_e){return j+". Errors: "+Object.keys(_e).map((function(j){return _e[j].toString()})).filter((function(j,_e,_t){return _t.indexOf(j)===_e})).join("\n")}function ModifyError(j,_e,_t,St){this._e=getErrorWithStack(),this.failures=_e,this.failedKeys=St,this.successCount=_t,this.message=getMultiErrorMessage(j,_e)}function BulkError(j,_e){this._e=getErrorWithStack(),this.name="BulkError",this.failures=_e,this.message=getMultiErrorMessage(j,_e)}derive(DexieError).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+prettyStack(this._e,2))}},toString:function(){return this.name+": "+this.message}}),derive(ModifyError).from(DexieError),derive(BulkError).from(DexieError);var u_=s_.reduce((function(j,_e){return j[_e]=_e+"Error",j}),{}),l_=DexieError,d_=s_.reduce((function(j,_e){var _t=_e+"Error";function DexieError(j,St){this._e=getErrorWithStack(),this.name=_t,j?"string"==typeof j?(this.message=j+(St?"\n "+St:""),this.inner=St||null):"object"==typeof j&&(this.message=j.name+" "+j.message,this.inner=j):(this.message=c_[_e]||_t,this.inner=null)}return derive(DexieError).from(l_),j[_e]=DexieError,j}),{});d_.Syntax=SyntaxError,d_.Type=TypeError,d_.Range=RangeError;var h_=a_.reduce((function(j,_e){return j[_e+"Error"]=d_[_e],j}),{});var f_=s_.reduce((function(j,_e){return-1===["Syntax","Type","Range"].indexOf(_e)&&(j[_e+"Error"]=d_[_e]),j}),{});function nop(){}function mirror(j){return j}function pureFunctionChain(j,_e){return null==j||j===mirror?_e:function(_t){return _e(j(_t))}}function callBoth(j,_e){return function(){j.apply(this,arguments),_e.apply(this,arguments)}}function hookCreatingChain(j,_e){return j===nop?_e:function(){var _t=j.apply(this,arguments);void 0!==_t&&(arguments[0]=_t);var St=this.onsuccess,Tt=this.onerror;this.onsuccess=null,this.onerror=null;var Ut=_e.apply(this,arguments);return St&&(this.onsuccess=this.onsuccess?callBoth(St,this.onsuccess):St),Tt&&(this.onerror=this.onerror?callBoth(Tt,this.onerror):Tt),void 0!==Ut?Ut:_t}}function hookDeletingChain(j,_e){return j===nop?_e:function(){j.apply(this,arguments);var _t=this.onsuccess,St=this.onerror;this.onsuccess=this.onerror=null,_e.apply(this,arguments),_t&&(this.onsuccess=this.onsuccess?callBoth(_t,this.onsuccess):_t),St&&(this.onerror=this.onerror?callBoth(St,this.onerror):St)}}function hookUpdatingChain(j,_e){return j===nop?_e:function(_t){var St=j.apply(this,arguments);extend(_t,St);var Tt=this.onsuccess,Ut=this.onerror;this.onsuccess=null,this.onerror=null;var _r=_e.apply(this,arguments);return Tt&&(this.onsuccess=this.onsuccess?callBoth(Tt,this.onsuccess):Tt),Ut&&(this.onerror=this.onerror?callBoth(Ut,this.onerror):Ut),void 0===St?void 0===_r?void 0:_r:extend(St,_r)}}function reverseStoppableEventChain(j,_e){return j===nop?_e:function(){return!1!==_e.apply(this,arguments)&&j.apply(this,arguments)}}function promisableChain(j,_e){return j===nop?_e:function(){var _t=j.apply(this,arguments);if(_t&&"function"==typeof _t.then){for(var St=this,Tt=arguments.length,Ut=new Array(Tt);Tt--;)Ut[Tt]=arguments[Tt];return _t.then((function(){return _e.apply(St,Ut)}))}return _e.apply(this,arguments)}}f_.ModifyError=ModifyError,f_.DexieError=DexieError,f_.BulkError=BulkError;var p_={},v_="undefined"==typeof Promise?[]:function(){var j=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[j,j.__proto__,j];var _e=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[_e,_e.__proto__,j]}(),m_=v_[0],y_=v_[1],A_=v_[2],__=y_&&y_.then,b_=m_&&m_.constructor,E_=!!A_,w_=!1,I_=A_?function(){A_.then(physicalTick)}:kc.setImmediate?setImmediate.bind(null,physicalTick):kc.MutationObserver?function(){var j=document.createElement("div");new MutationObserver((function(){physicalTick(),j=null})).observe(j,{attributes:!0}),j.setAttribute("i","1")}:function(){setTimeout(physicalTick,0)},asap$1=function(j,_e){M_.push([j,_e]),C_&&(I_(),C_=!1)},T_=!0,C_=!0,R_=[],k_=[],O_=null,D_=mirror,N_={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:globalError,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(j){try{globalError(j[0],j[1])}catch(j){}}))}},P_=N_,M_=[],B_=0,j_=[];function DexiePromise(j){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=nop,this._lib=!1;var _e=this._PSD=P_;if(r_&&(this._stackHolder=getErrorWithStack(),this._prev=null,this._numPrev=0),"function"!=typeof j){if(j!==p_)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&handleRejection(this,this._value))}this._state=null,this._value=null,++_e.ref,executePromiseTask(this,j)}var U_={get:function(){var j=P_,_e=W_;function then(_t,St){var Tt=this,Ut=!j.global&&(j!==P_||_e!==W_),_r=Ut&&!decrementExpectedAwaits(),_n=new DexiePromise((function(_e,_n){propagateToListener(Tt,new Listener(nativeAwaitCompatibleWrap(_t,j,Ut,_r),nativeAwaitCompatibleWrap(St,j,Ut,_r),_e,_n,j))}));return r_&&linkToPreviousPromise(_n,this),_n}return then.prototype=p_,then},set:function(j){setProp(this,"then",j&&j.prototype===p_?U_:{get:function(){return j},set:U_.set})}};function Listener(j,_e,_t,St,Tt){this.onFulfilled="function"==typeof j?j:null,this.onRejected="function"==typeof _e?_e:null,this.resolve=_t,this.reject=St,this.psd=Tt}function executePromiseTask(j,_e){try{_e((function(_e){if(null===j._state){if(_e===j)throw new TypeError("A promise cannot be resolved with itself.");var _t=j._lib&&beginMicroTickScope();_e&&"function"==typeof _e.then?executePromiseTask(j,(function(j,_t){_e instanceof DexiePromise?_e._then(j,_t):_e.then(j,_t)})):(j._state=!0,j._value=_e,propagateAllListeners(j)),_t&&endMicroTickScope()}}),handleRejection.bind(null,j))}catch(_e){handleRejection(j,_e)}}function handleRejection(j,_e){if(k_.push(_e),null===j._state){var _t=j._lib&&beginMicroTickScope();_e=D_(_e),j._state=!1,j._value=_e,r_&&null!==_e&&"object"==typeof _e&&!_e._promise&&function tryCatch(j,_e,_t){try{j.apply(null,_t)}catch(j){_e&&_e(j)}}((function(){var _t=getPropertyDescriptor(_e,"stack");_e._promise=j,setProp(_e,"stack",{get:function(){return w_?_t&&(_t.get?_t.get.apply(_e):_t.value):j.stack}})})),function addPossiblyUnhandledError(j){R_.some((function(_e){return _e._value===j._value}))||R_.push(j)}(j),propagateAllListeners(j),_t&&endMicroTickScope()}}function propagateAllListeners(j){var _e=j._listeners;j._listeners=[];for(var _t=0,St=_e.length;_t<St;++_t)propagateToListener(j,_e[_t]);var Tt=j._PSD;--Tt.ref||Tt.finalize(),0===B_&&(++B_,asap$1((function(){0==--B_&&finalizePhysicalTick()}),[]))}function propagateToListener(j,_e){if(null!==j._state){var _t=j._state?_e.onFulfilled:_e.onRejected;if(null===_t)return(j._state?_e.resolve:_e.reject)(j._value);++_e.psd.ref,++B_,asap$1(callListener,[_t,j,_e])}else j._listeners.push(_e)}function callListener(j,_e,_t){try{O_=_e;var St,Tt=_e._value;_e._state?St=j(Tt):(k_.length&&(k_=[]),St=j(Tt),-1===k_.indexOf(Tt)&&function markErrorAsHandled(j){var _e=R_.length;for(;_e;)if(R_[--_e]._value===j._value)return void R_.splice(_e,1)}(_e)),_t.resolve(St)}catch(j){_t.reject(j)}finally{O_=null,0==--B_&&finalizePhysicalTick(),--_t.psd.ref||_t.psd.finalize()}}function getStack(j,_e,_t){if(_e.length===_t)return _e;var St="";if(!1===j._state){var Tt,Ut,_r=j._value;null!=_r?(Tt=_r.name||"Error",Ut=_r.message||_r,St=prettyStack(_r,0)):(Tt=_r,Ut=""),_e.push(Tt+(Ut?": "+Ut:"")+St)}return r_&&((St=prettyStack(j._stackHolder,2))&&-1===_e.indexOf(St)&&_e.push(St),j._prev&&getStack(j._prev,_e,_t)),_e}function linkToPreviousPromise(j,_e){var _t=_e?_e._numPrev+1:0;_t<100&&(j._prev=_e,j._numPrev=_t)}function physicalTick(){beginMicroTickScope()&&endMicroTickScope()}function beginMicroTickScope(){var j=T_;return T_=!1,C_=!1,j}function endMicroTickScope(){var j,_e,_t;do{for(;M_.length>0;)for(j=M_,M_=[],_t=j.length,_e=0;_e<_t;++_e){var St=j[_e];St[0].apply(null,St[1])}}while(M_.length>0);T_=!0,C_=!0}function finalizePhysicalTick(){var j=R_;R_=[],j.forEach((function(j){j._PSD.onunhandled.call(null,j._value,j)}));for(var _e=j_.slice(0),_t=_e.length;_t;)_e[--_t]()}function PromiseReject(j){return new DexiePromise(p_,!1,j)}function wrap(j,_e){var _t=P_;return function(){var St=beginMicroTickScope(),Tt=P_;try{return switchToZone(_t,!0),j.apply(this,arguments)}catch(j){_e&&_e(j)}finally{switchToZone(Tt,!1),St&&endMicroTickScope()}}}props(DexiePromise.prototype,{then:U_,_then:function(j,_e){propagateToListener(this,new Listener(null,null,j,_e,P_))},catch:function(j){if(1===arguments.length)return this.then(null,j);var _e=arguments[0],_t=arguments[1];return"function"==typeof _e?this.then(null,(function(j){return j instanceof _e?_t(j):PromiseReject(j)})):this.then(null,(function(j){return j&&j.name===_e?_t(j):PromiseReject(j)}))},finally:function(j){return this.then((function(_e){return j(),_e}),(function(_e){return j(),PromiseReject(_e)}))},stack:{get:function(){if(this._stack)return this._stack;try{w_=!0;var j=getStack(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=j),j}finally{w_=!1}}},timeout:function(j,_e){var _t=this;return j<1/0?new DexiePromise((function(St,Tt){var Ut=setTimeout((function(){return Tt(new d_.Timeout(_e))}),j);_t.then(St,Tt).finally(clearTimeout.bind(null,Ut))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&setProp(DexiePromise.prototype,Symbol.toStringTag,"Dexie.Promise"),N_.env=snapShot(),props(DexiePromise,{all:function(){var j=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(_e,_t){0===j.length&&_e([]);var St=j.length;j.forEach((function(Tt,Ut){return DexiePromise.resolve(Tt).then((function(_t){j[Ut]=_t,--St||_e(j)}),_t)}))}))},resolve:function(j){if(j instanceof DexiePromise)return j;if(j&&"function"==typeof j.then)return new DexiePromise((function(_e,_t){j.then(_e,_t)}));var _e=new DexiePromise(p_,!0,j);return linkToPreviousPromise(_e,O_),_e},reject:PromiseReject,race:function(){var j=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(_e,_t){j.map((function(j){return DexiePromise.resolve(j).then(_e,_t)}))}))},PSD:{get:function(){return P_},set:function(j){return P_=j}},totalEchoes:{get:function(){return W_}},newPSD:newScope,usePSD,scheduler:{get:function(){return asap$1},set:function(j){asap$1=j}},rejectionMapper:{get:function(){return D_},set:function(j){D_=j}},follow:function(j,_e){return new DexiePromise((function(_t,St){return newScope((function(_e,_t){var St=P_;St.unhandleds=[],St.onunhandled=_t,St.finalize=callBoth((function(){var j=this;!function run_at_end_of_this_or_next_physical_tick(j){function finalizer(){j(),j_.splice(j_.indexOf(finalizer),1)}j_.push(finalizer),++B_,asap$1((function(){0==--B_&&finalizePhysicalTick()}),[])}((function(){0===j.unhandleds.length?_e():_t(j.unhandleds[0])}))}),St.finalize),j()}),_e,_t,St)}))}}),b_&&(b_.allSettled&&setProp(DexiePromise,"allSettled",(function(){var j=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(_e){0===j.length&&_e([]);var _t=j.length,St=new Array(_t);j.forEach((function(j,Tt){return DexiePromise.resolve(j).then((function(j){return St[Tt]={status:"fulfilled",value:j}}),(function(j){return St[Tt]={status:"rejected",reason:j}})).then((function(){return--_t||_e(St)}))}))}))})),b_.any&&"undefined"!=typeof AggregateError&&setProp(DexiePromise,"any",(function(){var j=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(_e,_t){0===j.length&&_t(new AggregateError([]));var St=j.length,Tt=new Array(St);j.forEach((function(j,Ut){return DexiePromise.resolve(j).then((function(j){return _e(j)}),(function(j){Tt[Ut]=j,--St||_t(new AggregateError(Tt))}))}))}))})));var F_={awaits:0,echoes:0,id:0},G_=0,V_=[],K_=0,W_=0,H_=0;function newScope(j,_e,_t,St){var Tt=P_,Ut=Object.create(Tt);Ut.parent=Tt,Ut.ref=0,Ut.global=!1,Ut.id=++H_;var _r=N_.env;Ut.env=E_?{Promise:DexiePromise,PromiseProp:{value:DexiePromise,configurable:!0,writable:!0},all:DexiePromise.all,race:DexiePromise.race,allSettled:DexiePromise.allSettled,any:DexiePromise.any,resolve:DexiePromise.resolve,reject:DexiePromise.reject,nthen:getPatchedPromiseThen(_r.nthen,Ut),gthen:getPatchedPromiseThen(_r.gthen,Ut)}:{},_e&&extend(Ut,_e),++Tt.ref,Ut.finalize=function(){--this.parent.ref||this.parent.finalize()};var _n=usePSD(Ut,j,_t,St);return 0===Ut.ref&&Ut.finalize(),_n}function incrementExpectedAwaits(){return F_.id||(F_.id=++G_),++F_.awaits,F_.echoes+=100,F_.id}function decrementExpectedAwaits(){return!!F_.awaits&&(0==--F_.awaits&&(F_.id=0),F_.echoes=100*F_.awaits,!0)}function onPossibleParallellAsync(j){return F_.echoes&&j&&j.constructor===b_?(incrementExpectedAwaits(),j.then((function(j){return decrementExpectedAwaits(),j}),(function(j){return decrementExpectedAwaits(),J_(j)}))):j}function zoneEnterEcho(j){++W_,F_.echoes&&0!=--F_.echoes||(F_.echoes=F_.id=0),V_.push(P_),switchToZone(j,!0)}function zoneLeaveEcho(){var j=V_[V_.length-1];V_.pop(),switchToZone(j,!1)}function switchToZone(j,_e){var _t=P_;if((_e?!F_.echoes||K_++&&j===P_:!K_||--K_&&j===P_)||enqueueNativeMicroTask(_e?zoneEnterEcho.bind(null,j):zoneLeaveEcho),j!==P_&&(P_=j,_t===N_&&(N_.env=snapShot()),E_)){var St=N_.env.Promise,Tt=j.env;y_.then=Tt.nthen,St.prototype.then=Tt.gthen,(_t.global||j.global)&&(Object.defineProperty(kc,"Promise",Tt.PromiseProp),St.all=Tt.all,St.race=Tt.race,St.resolve=Tt.resolve,St.reject=Tt.reject,Tt.allSettled&&(St.allSettled=Tt.allSettled),Tt.any&&(St.any=Tt.any))}}function snapShot(){var j=kc.Promise;return E_?{Promise:j,PromiseProp:Object.getOwnPropertyDescriptor(kc,"Promise"),all:j.all,race:j.race,allSettled:j.allSettled,any:j.any,resolve:j.resolve,reject:j.reject,nthen:y_.then,gthen:j.prototype.then}:{}}function usePSD(j,_e,_t,St,Tt){var Ut=P_;try{return switchToZone(j,!0),_e(_t,St,Tt)}finally{switchToZone(Ut,!1)}}function enqueueNativeMicroTask(j){__.call(m_,j)}function nativeAwaitCompatibleWrap(j,_e,_t,St){return"function"!=typeof j?j:function(){var Tt=P_;_t&&incrementExpectedAwaits(),switchToZone(_e,!0);try{return j.apply(this,arguments)}finally{switchToZone(Tt,!1),St&&enqueueNativeMicroTask(decrementExpectedAwaits)}}}function getPatchedPromiseThen(j,_e){return function(_t,St){return j.call(this,nativeAwaitCompatibleWrap(_t,_e),nativeAwaitCompatibleWrap(St,_e))}}-1===(""+__).indexOf("[native code]")&&(incrementExpectedAwaits=decrementExpectedAwaits=nop);var Y_="unhandledrejection";function globalError(j,_e){var _t;try{_t=_e.onuncatched(j)}catch(j){}if(!1!==_t)try{var St,Tt={promise:_e,reason:j};if(kc.document&&document.createEvent?((St=document.createEvent("Event")).initEvent(Y_,!0,!0),extend(St,Tt)):kc.CustomEvent&&extend(St=new CustomEvent(Y_,{detail:Tt}),Tt),St&&kc.dispatchEvent&&(dispatchEvent(St),!kc.PromiseRejectionEvent&&kc.onunhandledrejection))try{kc.onunhandledrejection(St)}catch(j){}r_&&St&&!St.defaultPrevented&&console.warn("Unhandled rejection: "+(j.stack||j))}catch(j){}}var J_=DexiePromise.reject;function tempTransaction(j,_e,_t,St){if(j._state.openComplete||P_.letThrough){var Tt=j._createTransaction(_e,_t,j._dbSchema);try{Tt.create()}catch(j){return J_(j)}return Tt._promise(_e,(function(j,_e){return newScope((function(){return P_.trans=Tt,St(j,_e,Tt)}))})).then((function(j){return Tt._completion.then((function(){return j}))}))}if(!j._state.isBeingOpened){if(!j._options.autoOpen)return J_(new d_.DatabaseClosed);j.open().catch(nop)}return j._state.dbReadyPromise.then((function(){return tempTransaction(j,_e,_t,St)}))}var X_="3.0.3",Z_=String.fromCharCode(65535),$_=-1/0,Lb="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Mb="String expected.",eE=[],tE="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),rE=tE,nE=tE,dexieStackFrameFilter=function(j){return!/(dexie\.js|dexie\.min\.js)/.test(j)},iE="__dbnames",oE="readonly",aE="readwrite";function combine(j,_e){return j?_e?function(){return j.apply(this,arguments)&&_e.apply(this,arguments)}:j:_e}var sE={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function workaroundForUndefinedPrimKey(j){return function(_e){return void 0===getByKeyPath(_e,j)&&delByKeyPath(_e=deepClone(_e),j),_e}}var cE=function(){function Table(){}return Table.prototype._trans=function(j,_e,_t){var St=this._tx||P_.trans,Tt=this.name;function checkTableInTransaction(j,_t,St){if(!St.schema[Tt])throw new d_.NotFound("Table "+Tt+" not part of transaction");return _e(St.idbtrans,St)}var Ut=beginMicroTickScope();try{return St&&St.db===this.db?St===P_.trans?St._promise(j,checkTableInTransaction,_t):newScope((function(){return St._promise(j,checkTableInTransaction,_t)}),{trans:St,transless:P_.transless||P_}):tempTransaction(this.db,j,[this.name],checkTableInTransaction)}finally{Ut&&endMicroTickScope()}},Table.prototype.get=function(j,_e){var _t=this;return j&&j.constructor===Object?this.where(j).first(_e):this._trans("readonly",(function(_e){return _t.core.get({trans:_e,key:j}).then((function(j){return _t.hook.reading.fire(j)}))})).then(_e)},Table.prototype.where=function(j){if("string"==typeof j)return new this.db.WhereClause(this,j);if(_c(j))return new this.db.WhereClause(this,"["+j.join("+")+"]");var _e=_s(j);if(1===_e.length)return this.where(_e[0]).equals(j[_e[0]]);var _t=this.schema.indexes.concat(this.schema.primKey).filter((function(j){return j.compound&&_e.every((function(_e){return j.keyPath.indexOf(_e)>=0}))&&j.keyPath.every((function(j){return _e.indexOf(j)>=0}))}))[0];if(_t&&this.db._maxKey!==Z_)return this.where(_t.name).equals(_t.keyPath.map((function(_e){return j[_e]})));!_t&&r_&&console.warn("The query "+JSON.stringify(j)+" on "+this.name+" would benefit of a compound index ["+_e.join("+")+"]");var St=this.schema.idxByName,Tt=this.db._deps.indexedDB;function equals(j,_e){try{return 0===Tt.cmp(j,_e)}catch(j){return!1}}var Ut=_e.reduce((function(_e,_t){var Tt=_e[0],Ut=_e[1],_r=St[_t],_n=j[_t];return[Tt||_r,Tt||!_r?combine(Ut,_r&&_r.multi?function(j){var _e=getByKeyPath(j,_t);return _c(_e)&&_e.some((function(j){return equals(_n,j)}))}:function(j){return equals(_n,getByKeyPath(j,_t))}):Ut]}),[null,null]),_r=Ut[0],_n=Ut[1];return _r?this.where(_r.name).equals(j[_r.keyPath]).filter(_n):_t?this.filter(_n):this.where(_e).equals("")},Table.prototype.filter=function(j){return this.toCollection().and(j)},Table.prototype.count=function(j){return this.toCollection().count(j)},Table.prototype.offset=function(j){return this.toCollection().offset(j)},Table.prototype.limit=function(j){return this.toCollection().limit(j)},Table.prototype.each=function(j){return this.toCollection().each(j)},Table.prototype.toArray=function(j){return this.toCollection().toArray(j)},Table.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Table.prototype.orderBy=function(j){return new this.db.Collection(new this.db.WhereClause(this,_c(j)?"["+j.join("+")+"]":j))},Table.prototype.reverse=function(){return this.toCollection().reverse()},Table.prototype.mapToClass=function(j){this.schema.mappedClass=j;var readHook=function(_e){if(!_e)return _e;var _t=Object.create(j.prototype);for(var St in _e)if(hasOwn(_e,St))try{_t[St]=_e[St]}catch(j){}return _t};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=readHook,this.hook("reading",readHook),j},Table.prototype.defineClass=function(){return this.mapToClass((function Class(j){extend(this,j)}))},Table.prototype.add=function(j,_e){var _t=this,St=this.schema.primKey,Tt=St.auto,Ut=St.keyPath,_r=j;return Ut&&Tt&&(_r=workaroundForUndefinedPrimKey(Ut)(j)),this._trans("readwrite",(function(j){return _t.core.mutate({trans:j,type:"add",keys:null!=_e?[_e]:null,values:[_r]})})).then((function(j){return j.numFailures?DexiePromise.reject(j.failures[0]):j.lastResult})).then((function(_e){if(Ut)try{setByKeyPath(j,Ut,_e)}catch(j){}return _e}))},Table.prototype.update=function(j,_e){if("object"!=typeof _e||_c(_e))throw new d_.InvalidArgument("Modifications must be an object.");if("object"!=typeof j||_c(j))return this.where(":id").equals(j).modify(_e);_s(_e).forEach((function(_t){setByKeyPath(j,_t,_e[_t])}));var _t=getByKeyPath(j,this.schema.primKey.keyPath);return void 0===_t?J_(new d_.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(_t).modify(_e)},Table.prototype.put=function(j,_e){var _t=this,St=this.schema.primKey,Tt=St.auto,Ut=St.keyPath,_r=j;return Ut&&Tt&&(_r=workaroundForUndefinedPrimKey(Ut)(j)),this._trans("readwrite",(function(j){return _t.core.mutate({trans:j,type:"put",values:[_r],keys:null!=_e?[_e]:null})})).then((function(j){return j.numFailures?DexiePromise.reject(j.failures[0]):j.lastResult})).then((function(_e){if(Ut)try{setByKeyPath(j,Ut,_e)}catch(j){}return _e}))},Table.prototype.delete=function(j){var _e=this;return this._trans("readwrite",(function(_t){return _e.core.mutate({trans:_t,type:"delete",keys:[j]})})).then((function(j){return j.numFailures?DexiePromise.reject(j.failures[0]):void 0}))},Table.prototype.clear=function(){var j=this;return this._trans("readwrite",(function(_e){return j.core.mutate({trans:_e,type:"deleteRange",range:sE})})).then((function(j){return j.numFailures?DexiePromise.reject(j.failures[0]):void 0}))},Table.prototype.bulkGet=function(j){var _e=this;return this._trans("readonly",(function(_t){return _e.core.getMany({keys:j,trans:_t}).then((function(j){return j.map((function(j){return _e.hook.reading.fire(j)}))}))}))},Table.prototype.bulkAdd=function(j,_e,_t){var St=this,Tt=Array.isArray(_e)?_e:void 0,Ut=(_t=_t||(Tt?void 0:_e))?_t.allKeys:void 0;return this._trans("readwrite",(function(_e){var _t=St.schema.primKey,_r=_t.auto,_n=_t.keyPath;if(_n&&Tt)throw new d_.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(Tt&&Tt.length!==j.length)throw new d_.InvalidArgument("Arguments objects and keys must have the same length");var _i=j.length,Ei=_n&&_r?j.map(workaroundForUndefinedPrimKey(_n)):j;return St.core.mutate({trans:_e,type:"add",keys:Tt,values:Ei,wantResults:Ut}).then((function(j){var _e=j.numFailures,_t=j.results,Tt=j.lastResult,_r=j.failures;if(0===_e)return Ut?_t:Tt;throw new BulkError(St.name+".bulkAdd(): "+_e+" of "+_i+" operations failed",Object.keys(_r).map((function(j){return _r[j]})))}))}))},Table.prototype.bulkPut=function(j,_e,_t){var St=this,Tt=Array.isArray(_e)?_e:void 0,Ut=(_t=_t||(Tt?void 0:_e))?_t.allKeys:void 0;return this._trans("readwrite",(function(_e){var _t=St.schema.primKey,_r=_t.auto,_n=_t.keyPath;if(_n&&Tt)throw new d_.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(Tt&&Tt.length!==j.length)throw new d_.InvalidArgument("Arguments objects and keys must have the same length");var _i=j.length,Ei=_n&&_r?j.map(workaroundForUndefinedPrimKey(_n)):j;return St.core.mutate({trans:_e,type:"put",keys:Tt,values:Ei,wantResults:Ut}).then((function(j){var _e=j.numFailures,_t=j.results,Tt=j.lastResult,_r=j.failures;if(0===_e)return Ut?_t:Tt;throw new BulkError(St.name+".bulkPut(): "+_e+" of "+_i+" operations failed",Object.keys(_r).map((function(j){return _r[j]})))}))}))},Table.prototype.bulkDelete=function(j){var _e=this,_t=j.length;return this._trans("readwrite",(function(_t){return _e.core.mutate({trans:_t,type:"delete",keys:j})})).then((function(j){var St=j.numFailures,Tt=j.lastResult,Ut=j.failures;if(0===St)return Tt;throw new BulkError(_e.name+".bulkDelete(): "+St+" of "+_t+" operations failed",Ut)}))},Table}();function Events(j){var _e={},rv=function(_t,St){if(St){for(var Tt=arguments.length,Ut=new Array(Tt-1);--Tt;)Ut[Tt-1]=arguments[Tt];return _e[_t].subscribe.apply(null,Ut),j}if("string"==typeof _t)return _e[_t]};rv.addEventType=add;for(var _t=1,St=arguments.length;_t<St;++_t)add(arguments[_t]);return rv;function add(j,_t,St){if("object"==typeof j)return addConfiguredEvents(j);_t||(_t=reverseStoppableEventChain),St||(St=nop);var Tt={subscribers:[],fire:St,subscribe:function(j){-1===Tt.subscribers.indexOf(j)&&(Tt.subscribers.push(j),Tt.fire=_t(Tt.fire,j))},unsubscribe:function(j){Tt.subscribers=Tt.subscribers.filter((function(_e){return _e!==j})),Tt.fire=Tt.subscribers.reduce(_t,St)}};return _e[j]=rv[j]=Tt,Tt}function addConfiguredEvents(j){_s(j).forEach((function(_e){var _t=j[_e];if(_c(_t))add(_e,j[_e][0],j[_e][1]);else{if("asap"!==_t)throw new d_.InvalidArgument("Invalid event config");var St=add(_e,mirror,(function fire(){for(var j=arguments.length,_e=new Array(j);j--;)_e[j]=arguments[j];St.subscribers.forEach((function(j){asap((function fireEvent(){j.apply(null,_e)}))}))}))}}))}}function makeClassConstructor(j,_e){return derive(_e).from({prototype:j}),_e}function isPlainKeyRange(j,_e){return!(j.filter||j.algorithm||j.or)&&(_e?j.justLimit:!j.replayFilter)}function addFilter(j,_e){j.filter=combine(j.filter,_e)}function addReplayFilter(j,_e,_t){var St=j.replayFilter;j.replayFilter=St?function(){return combine(St(),_e())}:_e,j.justLimit=_t&&!St}function getIndexOrStore(j,_e){if(j.isPrimKey)return _e.primaryKey;var _t=_e.getIndexByKeyPath(j.index);if(!_t)throw new d_.Schema("KeyPath "+j.index+" on object store "+_e.name+" is not indexed");return _t}function openCursor(j,_e,_t){var St=getIndexOrStore(j,_e.schema);return _e.openCursor({trans:_t,values:!j.keysOnly,reverse:"prev"===j.dir,unique:!!j.unique,query:{index:St,range:j.range}})}function iter(j,_e,_t,St){var Tt=j.replayFilter?combine(j.filter,j.replayFilter()):j.filter;if(j.or){var Ut={},union=function(j,_t,St){if(!Tt||Tt(_t,St,(function(j){return _t.stop(j)}),(function(j){return _t.fail(j)}))){var _r=_t.primaryKey,_n=""+_r;"[object ArrayBuffer]"===_n&&(_n=""+new Uint8Array(_r)),hasOwn(Ut,_n)||(Ut[_n]=!0,_e(j,_t,St))}};return Promise.all([j.or._iterate(union,_t),iterate(openCursor(j,St,_t),j.algorithm,union,!j.keysOnly&&j.valueMapper)])}return iterate(openCursor(j,St,_t),combine(j.algorithm,Tt),_e,!j.keysOnly&&j.valueMapper)}function iterate(j,_e,_t,St){var Tt=wrap(St?function(j,_e,Tt){return _t(St(j),_e,Tt)}:_t);return j.then((function(j){if(j)return j.start((function(){var c=function(){return j.continue()};_e&&!_e(j,(function(j){return c=j}),(function(_e){j.stop(_e),c=nop}),(function(_e){j.fail(_e),c=nop}))||Tt(j.value,j,(function(j){return c=j})),c()}))}))}var uE=function(){function Collection(){}return Collection.prototype._read=function(j,_e){var _t=this._ctx;return _t.error?_t.table._trans(null,J_.bind(null,_t.error)):_t.table._trans("readonly",j).then(_e)},Collection.prototype._write=function(j){var _e=this._ctx;return _e.error?_e.table._trans(null,J_.bind(null,_e.error)):_e.table._trans("readwrite",j,"locked")},Collection.prototype._addAlgorithm=function(j){var _e=this._ctx;_e.algorithm=combine(_e.algorithm,j)},Collection.prototype._iterate=function(j,_e){return iter(this._ctx,j,_e,this._ctx.table.core)},Collection.prototype.clone=function(j){var _e=Object.create(this.constructor.prototype),_t=Object.create(this._ctx);return j&&extend(_t,j),_e._ctx=_t,_e},Collection.prototype.raw=function(){return this._ctx.valueMapper=null,this},Collection.prototype.each=function(j){var _e=this._ctx;return this._read((function(_t){return iter(_e,j,_t,_e.table.core)}))},Collection.prototype.count=function(j){var _e=this;return this._read((function(j){var _t=_e._ctx,St=_t.table.core;if(isPlainKeyRange(_t,!0))return St.count({trans:j,query:{index:getIndexOrStore(_t,St.schema),range:_t.range}}).then((function(j){return Math.min(j,_t.limit)}));var Tt=0;return iter(_t,(function(){return++Tt,!1}),j,St).then((function(){return Tt}))})).then(j)},Collection.prototype.sortBy=function(j,_e){var _t=j.split(".").reverse(),St=_t[0],Tt=_t.length-1;function getval(j,_e){return _e?getval(j[_t[_e]],_e-1):j[St]}var Ut="next"===this._ctx.dir?1:-1;function sorter(j,_e){var _t=getval(j,Tt),St=getval(_e,Tt);return _t<St?-Ut:_t>St?Ut:0}return this.toArray((function(j){return j.sort(sorter)})).then(_e)},Collection.prototype.toArray=function(j){var _e=this;return this._read((function(j){var _t=_e._ctx;if("next"===_t.dir&&isPlainKeyRange(_t,!0)&&_t.limit>0){var St=_t.valueMapper,Tt=getIndexOrStore(_t,_t.table.core.schema);return _t.table.core.query({trans:j,limit:_t.limit,values:!0,query:{index:Tt,range:_t.range}}).then((function(j){var _e=j.result;return St?_e.map(St):_e}))}var Ut=[];return iter(_t,(function(j){return Ut.push(j)}),j,_t.table.core).then((function(){return Ut}))}),j)},Collection.prototype.offset=function(j){var _e=this._ctx;return j<=0||(_e.offset+=j,isPlainKeyRange(_e)?addReplayFilter(_e,(function(){var _e=j;return function(j,_t){return 0===_e||(1===_e?(--_e,!1):(_t((function(){j.advance(_e),_e=0})),!1))}})):addReplayFilter(_e,(function(){var _e=j;return function(){return--_e<0}}))),this},Collection.prototype.limit=function(j){return this._ctx.limit=Math.min(this._ctx.limit,j),addReplayFilter(this._ctx,(function(){var _e=j;return function(j,_t,St){return--_e<=0&&_t(St),_e>=0}}),!0),this},Collection.prototype.until=function(j,_e){return addFilter(this._ctx,(function(_t,St,Tt){return!j(_t.value)||(St(Tt),_e)})),this},Collection.prototype.first=function(j){return this.limit(1).toArray((function(j){return j[0]})).then(j)},Collection.prototype.last=function(j){return this.reverse().first(j)},Collection.prototype.filter=function(j){return addFilter(this._ctx,(function(_e){return j(_e.value)})),function addMatchFilter(j,_e){j.isMatch=combine(j.isMatch,_e)}(this._ctx,j),this},Collection.prototype.and=function(j){return this.filter(j)},Collection.prototype.or=function(j){return new this.db.WhereClause(this._ctx.table,j,this)},Collection.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Collection.prototype.desc=function(){return this.reverse()},Collection.prototype.eachKey=function(j){var _e=this._ctx;return _e.keysOnly=!_e.isMatch,this.each((function(_e,_t){j(_t.key,_t)}))},Collection.prototype.eachUniqueKey=function(j){return this._ctx.unique="unique",this.eachKey(j)},Collection.prototype.eachPrimaryKey=function(j){var _e=this._ctx;return _e.keysOnly=!_e.isMatch,this.each((function(_e,_t){j(_t.primaryKey,_t)}))},Collection.prototype.keys=function(j){var _e=this._ctx;_e.keysOnly=!_e.isMatch;var _t=[];return this.each((function(j,_e){_t.push(_e.key)})).then((function(){return _t})).then(j)},Collection.prototype.primaryKeys=function(j){var _e=this._ctx;if("next"===_e.dir&&isPlainKeyRange(_e,!0)&&_e.limit>0)return this._read((function(j){var _t=getIndexOrStore(_e,_e.table.core.schema);return _e.table.core.query({trans:j,values:!1,limit:_e.limit,query:{index:_t,range:_e.range}})})).then((function(j){return j.result})).then(j);_e.keysOnly=!_e.isMatch;var _t=[];return this.each((function(j,_e){_t.push(_e.primaryKey)})).then((function(){return _t})).then(j)},Collection.prototype.uniqueKeys=function(j){return this._ctx.unique="unique",this.keys(j)},Collection.prototype.firstKey=function(j){return this.limit(1).keys((function(j){return j[0]})).then(j)},Collection.prototype.lastKey=function(j){return this.reverse().firstKey(j)},Collection.prototype.distinct=function(){var j=this._ctx,_e=j.index&&j.table.schema.idxByName[j.index];if(!_e||!_e.multi)return this;var _t={};return addFilter(this._ctx,(function(j){var _e=j.primaryKey.toString(),St=hasOwn(_t,_e);return _t[_e]=!0,!St})),this},Collection.prototype.modify=function(j){var _e=this,_t=this._ctx;return this._write((function(St){var Tt;if("function"==typeof j)Tt=j;else{var Ut=_s(j),_r=Ut.length;Tt=function(_e){for(var _t=!1,St=0;St<_r;++St){var Tt=Ut[St],_n=j[Tt];getByKeyPath(_e,Tt)!==_n&&(setByKeyPath(_e,Tt,_n),_t=!0)}return _t}}var _n=_t.table.core,_i=_n.schema.primaryKey,Ei=_i.outbound,Ci=_i.extractKey,Di="testmode"in _E?1:2e3,Fi=_e.db.core.cmp,_o=[],ga=0,_a=[],applyMutateResult=function(j,_e){var _t=_e.failures,St=_e.numFailures;ga+=j-St;for(var Tt=0,Ut=_s(_t);Tt<Ut.length;Tt++){var _r=Ut[Tt];_o.push(_t[_r])}};return _e.clone().primaryKeys().then((function(j){var nextChunk=function(_e){var _t=Math.min(Di,j.length-_e);return _n.getMany({trans:St,keys:j.slice(_e,_e+_t)}).then((function(Ut){for(var _r=[],_i=[],_o=Ei?[]:null,ga=[],_a=0;_a<_t;++_a){var _s=Ut[_a],_c={value:deepClone(_s),primKey:j[_e+_a]};!1!==Tt.call(_c,_c.value,_c)&&(null==_c.value?ga.push(j[_e+_a]):Ei||0===Fi(Ci(_s),Ci(_c.value))?(_i.push(_c.value),Ei&&_o.push(j[_e+_a])):(ga.push(j[_e+_a]),_r.push(_c.value)))}return Promise.resolve(_r.length>0&&_n.mutate({trans:St,type:"add",values:_r}).then((function(j){for(var _e in j.failures)ga.splice(parseInt(_e),1);applyMutateResult(_r.length,j)}))).then((function(j){return _i.length>0&&_n.mutate({trans:St,type:"put",keys:_o,values:_i}).then((function(j){return applyMutateResult(_i.length,j)}))})).then((function(){return ga.length>0&&_n.mutate({trans:St,type:"delete",keys:ga}).then((function(j){return applyMutateResult(ga.length,j)}))})).then((function(){return j.length>_e+_t&&nextChunk(_e+Di)}))}))};return nextChunk(0).then((function(){if(_o.length>0)throw new ModifyError("Error modifying one or more objects",_o,ga,_a);return j.length}))}))}))},Collection.prototype.delete=function(){var j=this._ctx,_e=j.range;return isPlainKeyRange(j)&&(j.isPrimKey&&!nE||3===_e.type)?this._write((function(_t){var St=j.table.core.schema.primaryKey,Tt=_e;return j.table.core.count({trans:_t,query:{index:St,range:Tt}}).then((function(_e){return j.table.core.mutate({trans:_t,type:"deleteRange",range:Tt}).then((function(j){var _t=j.failures,St=(j.lastResult,j.results,j.numFailures);if(St)throw new ModifyError("Could not delete some values",Object.keys(_t).map((function(j){return _t[j]})),_e-St);return _e-St}))}))})):this.modify((function(j,_e){return _e.value=null}))},Collection}();function simpleCompare(j,_e){return j<_e?-1:j===_e?0:1}function simpleCompareReverse(j,_e){return j>_e?-1:j===_e?0:1}function fail(j,_e,_t){var St=j instanceof lE?new j.Collection(j):j;return St._ctx.error=_t?new _t(_e):new TypeError(_e),St}function emptyCollection(j){return new j.Collection(j,(function(){return rangeEqual("")})).limit(0)}function nextCasing(j,_e,_t,St,Tt,Ut){for(var _r=Math.min(j.length,St.length),_n=-1,_i=0;_i<_r;++_i){var Ei=_e[_i];if(Ei!==St[_i])return Tt(j[_i],_t[_i])<0?j.substr(0,_i)+_t[_i]+_t.substr(_i+1):Tt(j[_i],St[_i])<0?j.substr(0,_i)+St[_i]+_t.substr(_i+1):_n>=0?j.substr(0,_n)+_e[_n]+_t.substr(_n+1):null;Tt(j[_i],Ei)<0&&(_n=_i)}return _r<St.length&&"next"===Ut?j+_t.substr(j.length):_r<j.length&&"prev"===Ut?j.substr(0,_t.length):_n<0?null:j.substr(0,_n)+St[_n]+_t.substr(_n+1)}function addIgnoreCaseAlgorithm(j,_e,_t,St){var Tt,Ut,_r,_n,_i,Ei,Ci,Di=_t.length;if(!_t.every((function(j){return"string"==typeof j})))return fail(j,Mb);function initDirection(j){Tt=function upperFactory(j){return"next"===j?function(j){return j.toUpperCase()}:function(j){return j.toLowerCase()}}(j),Ut=function lowerFactory(j){return"next"===j?function(j){return j.toLowerCase()}:function(j){return j.toUpperCase()}}(j),_r="next"===j?simpleCompare:simpleCompareReverse;var _e=_t.map((function(j){return{lower:Ut(j),upper:Tt(j)}})).sort((function(j,_e){return _r(j.lower,_e.lower)}));_n=_e.map((function(j){return j.upper})),_i=_e.map((function(j){return j.lower})),Ei=j,Ci="next"===j?"":St}initDirection("next");var Fi=new j.Collection(j,(function(){return createRange(_n[0],_i[Di-1]+St)}));Fi._ondirectionchange=function(j){initDirection(j)};var _o=0;return Fi._addAlgorithm((function(j,_t,St){var Tt=j.key;if("string"!=typeof Tt)return!1;var Fi=Ut(Tt);if(_e(Fi,_i,_o))return!0;for(var ga=null,_a=_o;_a<Di;++_a){var _s=nextCasing(Tt,Fi,_n[_a],_i[_a],_r,Ei);null===_s&&null===ga?_o=_a+1:(null===ga||_r(ga,_s)>0)&&(ga=_s)}return _t(null!==ga?function(){j.continue(ga+Ci)}:St),!1})),Fi}function createRange(j,_e,_t,St){return{type:2,lower:j,upper:_e,lowerOpen:_t,upperOpen:St}}function rangeEqual(j){return{type:1,lower:j,upper:j}}var lE=function(){function WhereClause(){}return Object.defineProperty(WhereClause.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),WhereClause.prototype.between=function(j,_e,_t,St){_t=!1!==_t,St=!0===St;try{return this._cmp(j,_e)>0||0===this._cmp(j,_e)&&(_t||St)&&(!_t||!St)?emptyCollection(this):new this.Collection(this,(function(){return createRange(j,_e,!_t,!St)}))}catch(j){return fail(this,Lb)}},WhereClause.prototype.equals=function(j){return null==j?fail(this,Lb):new this.Collection(this,(function(){return rangeEqual(j)}))},WhereClause.prototype.above=function(j){return null==j?fail(this,Lb):new this.Collection(this,(function(){return createRange(j,void 0,!0)}))},WhereClause.prototype.aboveOrEqual=function(j){return null==j?fail(this,Lb):new this.Collection(this,(function(){return createRange(j,void 0,!1)}))},WhereClause.prototype.below=function(j){return null==j?fail(this,Lb):new this.Collection(this,(function(){return createRange(void 0,j,!1,!0)}))},WhereClause.prototype.belowOrEqual=function(j){return null==j?fail(this,Lb):new this.Collection(this,(function(){return createRange(void 0,j)}))},WhereClause.prototype.startsWith=function(j){return"string"!=typeof j?fail(this,Mb):this.between(j,j+Z_,!0,!0)},WhereClause.prototype.startsWithIgnoreCase=function(j){return""===j?this.startsWith(j):addIgnoreCaseAlgorithm(this,(function(j,_e){return 0===j.indexOf(_e[0])}),[j],Z_)},WhereClause.prototype.equalsIgnoreCase=function(j){return addIgnoreCaseAlgorithm(this,(function(j,_e){return j===_e[0]}),[j],"")},WhereClause.prototype.anyOfIgnoreCase=function(){var j=getArrayOf.apply(e_,arguments);return 0===j.length?emptyCollection(this):addIgnoreCaseAlgorithm(this,(function(j,_e){return-1!==_e.indexOf(j)}),j,"")},WhereClause.prototype.startsWithAnyOfIgnoreCase=function(){var j=getArrayOf.apply(e_,arguments);return 0===j.length?emptyCollection(this):addIgnoreCaseAlgorithm(this,(function(j,_e){return _e.some((function(_e){return 0===j.indexOf(_e)}))}),j,Z_)},WhereClause.prototype.anyOf=function(){var j=this,_e=getArrayOf.apply(e_,arguments),_t=this._cmp;try{_e.sort(_t)}catch(j){return fail(this,Lb)}if(0===_e.length)return emptyCollection(this);var St=new this.Collection(this,(function(){return createRange(_e[0],_e[_e.length-1])}));St._ondirectionchange=function(St){_t="next"===St?j._ascending:j._descending,_e.sort(_t)};var Tt=0;return St._addAlgorithm((function(j,St,Ut){for(var _r=j.key;_t(_r,_e[Tt])>0;)if(++Tt===_e.length)return St(Ut),!1;return 0===_t(_r,_e[Tt])||(St((function(){j.continue(_e[Tt])})),!1)})),St},WhereClause.prototype.notEqual=function(j){return this.inAnyRange([[$_,j],[j,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},WhereClause.prototype.noneOf=function(){var j=getArrayOf.apply(e_,arguments);if(0===j.length)return new this.Collection(this);try{j.sort(this._ascending)}catch(j){return fail(this,Lb)}var _e=j.reduce((function(j,_e){return j?j.concat([[j[j.length-1][1],_e]]):[[$_,_e]]}),null);return _e.push([j[j.length-1],this.db._maxKey]),this.inAnyRange(_e,{includeLowers:!1,includeUppers:!1})},WhereClause.prototype.inAnyRange=function(j,_e){var _t=this,St=this._cmp,Tt=this._ascending,Ut=this._descending,_r=this._min,_n=this._max;if(0===j.length)return emptyCollection(this);if(!j.every((function(j){return void 0!==j[0]&&void 0!==j[1]&&Tt(j[0],j[1])<=0})))return fail(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",d_.InvalidArgument);var _i=!_e||!1!==_e.includeLowers,Ei=_e&&!0===_e.includeUppers;var Ci,Di=Tt;function rangeSorter(j,_e){return Di(j[0],_e[0])}try{Ci=j.reduce((function addRange(j,_e){for(var _t=0,Tt=j.length;_t<Tt;++_t){var Ut=j[_t];if(St(_e[0],Ut[1])<0&&St(_e[1],Ut[0])>0){Ut[0]=_r(Ut[0],_e[0]),Ut[1]=_n(Ut[1],_e[1]);break}}return _t===Tt&&j.push(_e),j}),[]),Ci.sort(rangeSorter)}catch(j){return fail(this,Lb)}var Fi=0,_o=Ei?function(j){return Tt(j,Ci[Fi][1])>0}:function(j){return Tt(j,Ci[Fi][1])>=0},ga=_i?function(j){return Ut(j,Ci[Fi][0])>0}:function(j){return Ut(j,Ci[Fi][0])>=0};var _a=_o,_s=new this.Collection(this,(function(){return createRange(Ci[0][0],Ci[Ci.length-1][1],!_i,!Ei)}));return _s._ondirectionchange=function(j){"next"===j?(_a=_o,Di=Tt):(_a=ga,Di=Ut),Ci.sort(rangeSorter)},_s._addAlgorithm((function(j,_e,St){for(var Ut=j.key;_a(Ut);)if(++Fi===Ci.length)return _e(St),!1;return!!function keyWithinCurrentRange(j){return!_o(j)&&!ga(j)}(Ut)||(0===_t._cmp(Ut,Ci[Fi][1])||0===_t._cmp(Ut,Ci[Fi][0])||_e((function(){Di===Tt?j.continue(Ci[Fi][0]):j.continue(Ci[Fi][1])})),!1)})),_s},WhereClause.prototype.startsWithAnyOf=function(){var j=getArrayOf.apply(e_,arguments);return j.every((function(j){return"string"==typeof j}))?0===j.length?emptyCollection(this):this.inAnyRange(j.map((function(j){return[j,j+Z_]}))):fail(this,"startsWithAnyOf() only works with strings")},WhereClause}();function safariMultiStoreFix(j){return 1===j.length?j[0]:j}function getMaxKey(j){try{return j.only([[]]),[[]]}catch(j){return Z_}}function eventRejectHandler(j){return wrap((function(_e){return preventDefault(_e),j(_e.target.error),!1}))}function preventDefault(j){j.stopPropagation&&j.stopPropagation(),j.preventDefault&&j.preventDefault()}var hE=function(){function Transaction(){}return Transaction.prototype._lock=function(){return assert(!P_.global),++this._reculock,1!==this._reculock||P_.global||(P_.lockOwnerFor=this),this},Transaction.prototype._unlock=function(){if(assert(!P_.global),0==--this._reculock)for(P_.global||(P_.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var j=this._blockedFuncs.shift();try{usePSD(j[1],j[0])}catch(j){}}return this},Transaction.prototype._locked=function(){return this._reculock&&P_.lockOwnerFor!==this},Transaction.prototype.create=function(j){var _e=this;if(!this.mode)return this;var _t=this.db.idbdb,St=this.db._state.dbOpenError;if(assert(!this.idbtrans),!j&&!_t)switch(St&&St.name){case"DatabaseClosedError":throw new d_.DatabaseClosed(St);case"MissingAPIError":throw new d_.MissingAPI(St.message,St);default:throw new d_.OpenFailed(St)}if(!this.active)throw new d_.TransactionInactive;return assert(null===this._completion._state),(j=this.idbtrans=j||_t.transaction(safariMultiStoreFix(this.storeNames),this.mode)).onerror=wrap((function(_t){preventDefault(_t),_e._reject(j.error)})),j.onabort=wrap((function(_t){preventDefault(_t),_e.active&&_e._reject(new d_.Abort(j.error)),_e.active=!1,_e.on("abort").fire(_t)})),j.oncomplete=wrap((function(){_e.active=!1,_e._resolve()})),this},Transaction.prototype._promise=function(j,_e,_t){var St=this;if("readwrite"===j&&"readwrite"!==this.mode)return J_(new d_.ReadOnly("Transaction is readonly"));if(!this.active)return J_(new d_.TransactionInactive);if(this._locked())return new DexiePromise((function(Tt,Ut){St._blockedFuncs.push([function(){St._promise(j,_e,_t).then(Tt,Ut)},P_])}));if(_t)return newScope((function(){var j=new DexiePromise((function(j,_t){St._lock();var Tt=_e(j,_t,St);Tt&&Tt.then&&Tt.then(j,_t)}));return j.finally((function(){return St._unlock()})),j._lib=!0,j}));var Tt=new DexiePromise((function(j,_t){var Tt=_e(j,_t,St);Tt&&Tt.then&&Tt.then(j,_t)}));return Tt._lib=!0,Tt},Transaction.prototype._root=function(){return this.parent?this.parent._root():this},Transaction.prototype.waitFor=function(j){var _e=this._root(),_t=DexiePromise.resolve(j);if(_e._waitingFor)_e._waitingFor=_e._waitingFor.then((function(){return _t}));else{_e._waitingFor=_t,_e._waitingQueue=[];var St=_e.idbtrans.objectStore(_e.storeNames[0]);!function spin(){for(++_e._spinCount;_e._waitingQueue.length;)_e._waitingQueue.shift()();_e._waitingFor&&(St.get(-1/0).onsuccess=spin)}()}var Tt=_e._waitingFor;return new DexiePromise((function(j,St){_t.then((function(_t){return _e._waitingQueue.push(wrap(j.bind(null,_t)))}),(function(j){return _e._waitingQueue.push(wrap(St.bind(null,j)))})).finally((function(){_e._waitingFor===Tt&&(_e._waitingFor=null)}))}))},Transaction.prototype.abort=function(){this.active&&this._reject(new d_.Abort),this.active=!1},Transaction.prototype.table=function(j){var _e=this._memoizedTables||(this._memoizedTables={});if(hasOwn(_e,j))return _e[j];var _t=this.schema[j];if(!_t)throw new d_.NotFound("Table "+j+" not part of transaction");var St=new this.db.Table(j,_t,this);return St.core=this.db.core.table(j),_e[j]=St,St},Transaction}();function createIndexSpec(j,_e,_t,St,Tt,Ut,_r){return{name:j,keyPath:_e,unique:_t,multi:St,auto:Tt,compound:Ut,src:(_t&&!_r?"&":"")+(St?"*":"")+(Tt?"++":"")+nameFromKeyPath(_e)}}function nameFromKeyPath(j){return"string"==typeof j?j:j?"["+[].join.call(j,"+")+"]":""}function createTableSchema(j,_e,_t){return{name:j,primKey:_e,indexes:_t,mappedClass:null,idxByName:arrayToObject(_t,(function(j){return[j.name,j]}))}}function getKeyExtractor(j){return null==j?function(){}:"string"==typeof j?function getSinglePathKeyExtractor(j){var _e=j.split(".");return 1===_e.length?function(_e){return _e[j]}:function(_e){return getByKeyPath(_e,j)}}(j):function(_e){return getByKeyPath(_e,j)}}function getEffectiveKeys(j,_e){return"delete"===_e.type?_e.keys:_e.keys||_e.values.map(j.extractKey)}function arrayify(j){return[].slice.call(j)}var fE=0;function getKeyPathAlias(j){return null==j?":id":"string"==typeof j?j:"["+j.join("+")+"]"}function createDBCore(j,_e,_t,St){var Tt=_e.cmp.bind(_e);function makeIDBKeyRange(j){if(3===j.type)return null;if(4===j.type)throw new Error("Cannot convert never type to IDBKeyRange");var _e=j.lower,St=j.upper,Tt=j.lowerOpen,Ut=j.upperOpen;return void 0===_e?void 0===St?null:_t.upperBound(St,!!Ut):void 0===St?_t.lowerBound(_e,!!Tt):_t.bound(_e,St,!!Tt,!!Ut)}var Ut=function extractSchema(j,_e){var _t=arrayify(j.objectStoreNames);return{schema:{name:j.name,tables:_t.map((function(j){return _e.objectStore(j)})).map((function(j){var _e=j.keyPath,_t=j.autoIncrement,St=_c(_e),Tt=null==_e,Ut={},_r={name:j.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:Tt,compound:St,keyPath:_e,autoIncrement:_t,unique:!0,extractKey:getKeyExtractor(_e)},indexes:arrayify(j.indexNames).map((function(_e){return j.index(_e)})).map((function(j){var _e=j.name,_t=j.unique,St=j.multiEntry,Tt=j.keyPath,_r={name:_e,compound:_c(Tt),keyPath:Tt,unique:_t,multiEntry:St,extractKey:getKeyExtractor(Tt)};return Ut[getKeyPathAlias(Tt)]=_r,_r})),getIndexByKeyPath:function(j){return Ut[getKeyPathAlias(j)]}};return Ut[":id"]=_r.primaryKey,null!=_e&&(Ut[getKeyPathAlias(_e)]=_r.primaryKey),_r}))},hasGetAll:_t.length>0&&"getAll"in _e.objectStore(_t[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(j,St),_r=Ut.schema,_n=Ut.hasGetAll,_i=_r.tables.map((function(j){return function createDbCoreTable(j){var _e=j.name;return{name:_e,schema:j,mutate:function mutate(_t){var St=_t.trans,Tt=_t.type,Ut=_t.keys,_r=_t.values,_n=_t.range,_i=_t.wantResults;return new Promise((function(_t,Ei){_t=wrap(_t);var Ci=St.objectStore(_e),Di=null==Ci.keyPath,Fi="put"===Tt||"add"===Tt;if(!Fi&&"delete"!==Tt&&"deleteRange"!==Tt)throw new Error("Invalid operation type: "+Tt);var _o=(Ut||_r||{length:1}).length;if(Ut&&_r&&Ut.length!==_r.length)throw new Error("Given keys array must have same length as given values array.");if(0===_o)return _t({numFailures:0,failures:{},results:[],lastResult:void 0});var ga,_a=_i&&__spreadArrays(Ut||getEffectiveKeys(j.primaryKey,{type:Tt,keys:Ut,values:_r})),_s=[],_c=0,errorHandler=function(j){++_c,preventDefault(j),_a&&(_a[j.target._reqno]=void 0),_s[j.target._reqno]=j.target.error},setResult=function(j){var _e=j.target;_a[_e._reqno]=_e.result};if("deleteRange"===Tt){if(4===_n.type)return _t({numFailures:_c,failures:_s,results:_a,lastResult:void 0});ga=3===_n.type?Ci.clear():Ci.delete(makeIDBKeyRange(_n))}else{var kc=Fi?Di?[_r,Ut]:[_r,null]:[Ut,null],_u=kc[0],_l=kc[1];if(Fi)for(var _d=0;_d<_o;++_d)(ga=_l&&void 0!==_l[_d]?Ci[Tt](_u[_d],_l[_d]):Ci[Tt](_u[_d]))._reqno=_d,_a&&void 0===_a[_d]&&(ga.onsuccess=setResult),ga.onerror=errorHandler;else for(_d=0;_d<_o;++_d)(ga=Ci[Tt](_u[_d]))._reqno=_d,ga.onerror=errorHandler}var done=function(j){var _e=j.target.result;_a&&(_a[_o-1]=_e),_t({numFailures:_c,failures:_s,results:_a,lastResult:_e})};ga.onerror=function(j){errorHandler(j),done(j)},ga.onsuccess=done}))},getMany:function(j){var _t=j.trans,St=j.keys;return new Promise((function(j,Tt){j=wrap(j);for(var Ut,_r=_t.objectStore(_e),_n=St.length,_i=new Array(_n),Ei=0,Ci=0,successHandler=function(_e){var _t=_e.target;_i[_t._pos]=_t.result,++Ci===Ei&&j(_i)},Di=eventRejectHandler(Tt),Fi=0;Fi<_n;++Fi)null!=St[Fi]&&((Ut=_r.get(St[Fi]))._pos=Fi,Ut.onsuccess=successHandler,Ut.onerror=Di,++Ei);0===Ei&&j(_i)}))},get:function(j){var _t=j.trans,St=j.key;return new Promise((function(j,Tt){j=wrap(j);var Ut=_t.objectStore(_e).get(St);Ut.onsuccess=function(_e){return j(_e.target.result)},Ut.onerror=eventRejectHandler(Tt)}))},query:function query(j){return function(_t){return new Promise((function(St,Tt){St=wrap(St);var Ut=_t.trans,_r=_t.values,_n=_t.limit,_i=_t.query,Ei=_n===1/0?void 0:_n,Ci=_i.index,Di=_i.range,Fi=Ut.objectStore(_e),_o=Ci.isPrimaryKey?Fi:Fi.index(Ci.name),ga=makeIDBKeyRange(Di);if(0===_n)return St({result:[]});if(j){var _a=_r?_o.getAll(ga,Ei):_o.getAllKeys(ga,Ei);_a.onsuccess=function(j){return St({result:j.target.result})},_a.onerror=eventRejectHandler(Tt)}else{var _s=0,_c=_r||!("openKeyCursor"in _o)?_o.openCursor(ga):_o.openKeyCursor(ga),kc=[];_c.onsuccess=function(j){var _e=_c.result;return _e?(kc.push(_r?_e.value:_e.primaryKey),++_s===_n?St({result:kc}):void _e.continue()):St({result:kc})},_c.onerror=eventRejectHandler(Tt)}}))}}(_n),openCursor:function openCursor(j){var _t=j.trans,St=j.values,Tt=j.query,Ut=j.reverse,_r=j.unique;return new Promise((function(j,_n){j=wrap(j);var _i=Tt.index,Ei=Tt.range,Ci=_t.objectStore(_e),Di=_i.isPrimaryKey?Ci:Ci.index(_i.name),Fi=Ut?_r?"prevunique":"prev":_r?"nextunique":"next",_o=St||!("openKeyCursor"in Di)?Di.openCursor(makeIDBKeyRange(Ei),Fi):Di.openKeyCursor(makeIDBKeyRange(Ei),Fi);_o.onerror=eventRejectHandler(_n),_o.onsuccess=wrap((function(_e){var St=_o.result;if(St){St.___id=++fE,St.done=!1;var Tt=St.continue.bind(St),Ut=St.continuePrimaryKey;Ut&&(Ut=Ut.bind(St));var _r=St.advance.bind(St),doThrowCursorIsStopped=function(){throw new Error("Cursor not stopped")};St.trans=_t,St.stop=St.continue=St.continuePrimaryKey=St.advance=function(){throw new Error("Cursor not started")},St.fail=wrap(_n),St.next=function(){var j=this,_e=1;return this.start((function(){return _e--?j.continue():j.stop()})).then((function(){return j}))},St.start=function(j){var _e=new Promise((function(j,_e){j=wrap(j),_o.onerror=eventRejectHandler(_e),St.fail=_e,St.stop=function(_e){St.stop=St.continue=St.continuePrimaryKey=St.advance=doThrowCursorIsStopped,j(_e)}})),guardedCallback=function(){if(_o.result)try{j()}catch(j){St.fail(j)}else St.done=!0,St.start=function(){throw new Error("Cursor behind last entry")},St.stop()};return _o.onsuccess=wrap((function(j){_o.onsuccess=guardedCallback,guardedCallback()})),St.continue=Tt,St.continuePrimaryKey=Ut,St.advance=_r,guardedCallback(),_e},j(St)}else j(null)}),_n)}))},count:function(j){var _t=j.query,St=j.trans,Tt=_t.index,Ut=_t.range;return new Promise((function(j,_t){var _r=St.objectStore(_e),_n=Tt.isPrimaryKey?_r:_r.index(Tt.name),_i=makeIDBKeyRange(Ut),Ei=_i?_n.count(_i):_n.count();Ei.onsuccess=wrap((function(_e){return j(_e.target.result)})),Ei.onerror=eventRejectHandler(_t)}))}}}(j)})),Ei={};return _i.forEach((function(j){return Ei[j.name]=j})),{stack:"dbcore",transaction:j.transaction.bind(j),table:function(j){if(!Ei[j])throw new Error("Table '"+j+"' not found");return Ei[j]},cmp:Tt,MIN_KEY:-1/0,MAX_KEY:getMaxKey(_t),schema:_r}}function createMiddlewareStacks(j,_e,_t,St){var Tt=_t.IDBKeyRange,Ut=function createMiddlewareStack(j,_e){return _e.reduce((function(j,_e){var _t=_e.create;return __assign(__assign({},j),_t(j))}),j)}(createDBCore(_e,_t.indexedDB,Tt,St),j.dbcore);return{dbcore:Ut}}function generateMiddlewareStacks(j,_e){var _t=_e.db,St=createMiddlewareStacks(j._middlewares,_t,j._deps,_e);j.core=St.dbcore,j.tables.forEach((function(_e){var _t=_e.name;j.core.schema.tables.some((function(j){return j.name===_t}))&&(_e.core=j.core.table(_t),j[_t]instanceof j.Table&&(j[_t].core=_e.core))}))}function setApiOnPlace(j,_e,_t,St){_t.forEach((function(_t){var Tt=St[_t];_e.forEach((function(_e){var St=getPropertyDescriptor(_e,_t);(!St||"value"in St&&void 0===St.value)&&(_e===j.Transaction.prototype||_e instanceof j.Transaction?setProp(_e,_t,{get:function(){return this.table(_t)},set:function(j){_d(this,_t,{value:j,writable:!0,configurable:!0,enumerable:!0})}}):_e[_t]=new j.Table(_t,Tt))}))}))}function removeTablesApi(j,_e){_e.forEach((function(_e){for(var _t in _e)_e[_t]instanceof j.Table&&delete _e[_t]}))}function lowerVersionFirst(j,_e){return j._cfg.version-_e._cfg.version}function runUpgraders(j,_e,_t,St){var Tt=j._dbSchema,Ut=j._createTransaction("readwrite",j._storeNames,Tt);Ut.create(_t),Ut._completion.catch(St);var _r=Ut._reject.bind(Ut),_n=P_.transless||P_;newScope((function(){P_.trans=Ut,P_.transless=_n,0===_e?(_s(Tt).forEach((function(j){createTable(_t,j,Tt[j].primKey,Tt[j].indexes)})),generateMiddlewareStacks(j,_t),DexiePromise.follow((function(){return j.on.populate.fire(Ut)})).catch(_r)):function updateTablesAndIndexes(j,_e,_t,St){var Tt=[],Ut=j._versions,_r=j._dbSchema=buildGlobalSchema(j,j.idbdb,St),_n=!1,_i=Ut.filter((function(j){return j._cfg.version>=_e}));function runQueue(){return Tt.length?DexiePromise.resolve(Tt.shift()(_t.idbtrans)).then(runQueue):DexiePromise.resolve()}return _i.forEach((function(Ut){Tt.push((function(){var Tt=_r,_i=Ut._cfg.dbschema;adjustToExistingIndexNames(j,Tt,St),adjustToExistingIndexNames(j,_i,St),_r=j._dbSchema=_i;var Ei=getSchemaDiff(Tt,_i);Ei.add.forEach((function(j){createTable(St,j[0],j[1].primKey,j[1].indexes)})),Ei.change.forEach((function(j){if(j.recreate)throw new d_.Upgrade("Not yet support for changing primary key");var _e=St.objectStore(j.name);j.add.forEach((function(j){return addIndex(_e,j)})),j.change.forEach((function(j){_e.deleteIndex(j.name),addIndex(_e,j)})),j.del.forEach((function(j){return _e.deleteIndex(j)}))}));var Ci=Ut._cfg.contentUpgrade;if(Ci&&Ut._cfg.version>_e){generateMiddlewareStacks(j,St),_t._memoizedTables={},_n=!0;var Di=shallowClone(_i);Ei.del.forEach((function(j){Di[j]=Tt[j]})),removeTablesApi(j,[j.Transaction.prototype]),setApiOnPlace(j,[j.Transaction.prototype],_s(Di),Di),_t.schema=Di;var Fi,_o=t_(Ci);_o&&incrementExpectedAwaits();var ga=DexiePromise.follow((function(){if((Fi=Ci(_t))&&_o){var j=decrementExpectedAwaits.bind(null,null);Fi.then(j,j)}}));return Fi&&"function"==typeof Fi.then?DexiePromise.resolve(Fi):ga.then((function(){return Fi}))}})),Tt.push((function(_e){_n&&rE||function deleteRemovedTables(j,_e){for(var _t=0;_t<_e.db.objectStoreNames.length;++_t){var St=_e.db.objectStoreNames[_t];null==j[St]&&_e.db.deleteObjectStore(St)}}(Ut._cfg.dbschema,_e);removeTablesApi(j,[j.Transaction.prototype]),setApiOnPlace(j,[j.Transaction.prototype],j._storeNames,j._dbSchema),_t.schema=j._dbSchema}))})),runQueue().then((function(){!function createMissingTables(j,_e){_s(j).forEach((function(_t){_e.db.objectStoreNames.contains(_t)||createTable(_e,_t,j[_t].primKey,j[_t].indexes)}))}(_r,St)}))}(j,_e,Ut,_t).catch(_r)}))}function getSchemaDiff(j,_e){var _t,St={del:[],add:[],change:[]};for(_t in j)_e[_t]||St.del.push(_t);for(_t in _e){var Tt=j[_t],Ut=_e[_t];if(Tt){var _r={name:_t,def:Ut,recreate:!1,del:[],add:[],change:[]};if(""+(Tt.primKey.keyPath||"")!=""+(Ut.primKey.keyPath||"")||Tt.primKey.auto!==Ut.primKey.auto&&!tE)_r.recreate=!0,St.change.push(_r);else{var _n=Tt.idxByName,_i=Ut.idxByName,Ei=void 0;for(Ei in _n)_i[Ei]||_r.del.push(Ei);for(Ei in _i){var Ci=_n[Ei],Di=_i[Ei];Ci?Ci.src!==Di.src&&_r.change.push(Di):_r.add.push(Di)}(_r.del.length>0||_r.add.length>0||_r.change.length>0)&&St.change.push(_r)}}else St.add.push([_t,Ut])}return St}function createTable(j,_e,_t,St){var Tt=j.db.createObjectStore(_e,_t.keyPath?{keyPath:_t.keyPath,autoIncrement:_t.auto}:{autoIncrement:_t.auto});return St.forEach((function(j){return addIndex(Tt,j)})),Tt}function addIndex(j,_e){j.createIndex(_e.name,_e.keyPath,{unique:_e.unique,multiEntry:_e.multi})}function buildGlobalSchema(j,_e,_t){var St={};return slice(_e.objectStoreNames,0).forEach((function(j){for(var _e=_t.objectStore(j),Tt=_e.keyPath,Ut=createIndexSpec(nameFromKeyPath(Tt),Tt||"",!1,!1,!!_e.autoIncrement,Tt&&"string"!=typeof Tt,!0),_r=[],_n=0;_n<_e.indexNames.length;++_n){var _i=_e.index(_e.indexNames[_n]);Tt=_i.keyPath;var Ei=createIndexSpec(_i.name,Tt,!!_i.unique,!!_i.multiEntry,!1,Tt&&"string"!=typeof Tt,!1);_r.push(Ei)}St[j]=createTableSchema(j,Ut,_r)})),St}function adjustToExistingIndexNames(j,_e,_t){for(var St=_t.db.objectStoreNames,Tt=0;Tt<St.length;++Tt){var Ut=St[Tt],_r=_t.objectStore(Ut);j._hasGetAll="getAll"in _r;for(var _n=0;_n<_r.indexNames.length;++_n){var _i=_r.indexNames[_n],Ei=_r.index(_i).keyPath,Ci="string"==typeof Ei?Ei:"["+slice(Ei).join("+")+"]";if(_e[Ut]){var Di=_e[Ut].idxByName[Ci];Di&&(Di.name=_i,delete _e[Ut].idxByName[Ci],_e[Ut].idxByName[_i]=Di)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&kc.WorkerGlobalScope&&kc instanceof kc.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(j._hasGetAll=!1)}var pE,vE=function(){function Version(){}return Version.prototype._parseStoresSpec=function(j,_e){_s(j).forEach((function(_t){if(null!==j[_t]){var St=function parseIndexSyntax(j){return j.split(",").map((function(j,_e){var _t=(j=j.trim()).replace(/([&*]|\+\+)/g,""),St=/^\[/.test(_t)?_t.match(/^\[(.*)\]$/)[1].split("+"):_t;return createIndexSpec(_t,St||null,/\&/.test(j),/\*/.test(j),/\+\+/.test(j),_c(St),0===_e)}))}(j[_t]),Tt=St.shift();if(Tt.multi)throw new d_.Schema("Primary key cannot be multi-valued");St.forEach((function(j){if(j.auto)throw new d_.Schema("Only primary key can be marked as autoIncrement (++)");if(!j.keyPath)throw new d_.Schema("Index must have a name and cannot be an empty string")})),_e[_t]=createTableSchema(_t,Tt,St)}}))},Version.prototype.stores=function(j){var _e=this.db;this._cfg.storesSource=this._cfg.storesSource?extend(this._cfg.storesSource,j):j;var _t=_e._versions,St={},Tt={};return _t.forEach((function(j){extend(St,j._cfg.storesSource),Tt=j._cfg.dbschema={},j._parseStoresSpec(St,Tt)})),_e._dbSchema=Tt,removeTablesApi(_e,[_e._allTables,_e,_e.Transaction.prototype]),setApiOnPlace(_e,[_e._allTables,_e,_e.Transaction.prototype,this._cfg.tables],_s(Tt),Tt),_e._storeNames=_s(Tt),this},Version.prototype.upgrade=function(j){return this._cfg.contentUpgrade=j,this},Version}();function vip(j){return newScope((function(){return P_.letThrough=!0,j()}))}function dexieOpen(j){var _e=j._state,_t=j._deps.indexedDB;if(_e.isBeingOpened||j.idbdb)return _e.dbReadyPromise.then((function(){return _e.dbOpenError?J_(_e.dbOpenError):j}));r_&&(_e.openCanceller._stackHolder=getErrorWithStack()),_e.isBeingOpened=!0,_e.dbOpenError=null,_e.openComplete=!1;var St=_e.dbReadyResolve,Tt=null;return DexiePromise.race([_e.openCanceller,new DexiePromise((function(St,Ut){if(!_t)throw new d_.MissingAPI("indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using old Safari versions, make sure to include indexedDB polyfill.");var _r=j.name,_n=_e.autoSchema?_t.open(_r):_t.open(_r,Math.round(10*j.verno));if(!_n)throw new d_.MissingAPI("IndexedDB API not available");_n.onerror=eventRejectHandler(Ut),_n.onblocked=wrap(j._fireOnBlocked),_n.onupgradeneeded=wrap((function(St){if(Tt=_n.transaction,_e.autoSchema&&!j._options.allowEmptyDB){_n.onerror=preventDefault,Tt.abort(),_n.result.close();var _i=_t.deleteDatabase(_r);_i.onsuccess=_i.onerror=wrap((function(){Ut(new d_.NoSuchDatabase("Database "+_r+" doesnt exist"))}))}else{Tt.onerror=eventRejectHandler(Ut);var Ei=St.oldVersion>Math.pow(2,62)?0:St.oldVersion;j.idbdb=_n.result,runUpgraders(j,Ei/10,Tt,Ut)}}),Ut),_n.onsuccess=wrap((function(){Tt=null;var _t=j.idbdb=_n.result,Ut=slice(_t.objectStoreNames);if(Ut.length>0)try{var _i=_t.transaction(safariMultiStoreFix(Ut),"readonly");_e.autoSchema?function readGlobalSchema(j,_e,_t){j.verno=_e.version/10;var St=j._dbSchema=buildGlobalSchema(0,_e,_t);j._storeNames=slice(_e.objectStoreNames,0),setApiOnPlace(j,[j._allTables],_s(St),St)}(j,_t,_i):(adjustToExistingIndexNames(j,j._dbSchema,_i),function verifyInstalledSchema(j,_e){var _t=getSchemaDiff(buildGlobalSchema(0,j.idbdb,_e),j._dbSchema);return!(_t.add.length||_t.change.some((function(j){return j.add.length||j.change.length})))}(j,_i)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),generateMiddlewareStacks(j,_i)}catch(j){}eE.push(j),_t.onversionchange=wrap((function(_t){_e.vcFired=!0,j.on("versionchange").fire(_t)})),pE.add(_r),St()}),Ut)}))]).then((function(){return _e.onReadyBeingFired=[],DexiePromise.resolve(vip(j.on.ready.fire)).then((function fireRemainders(){if(_e.onReadyBeingFired.length>0){var j=_e.onReadyBeingFired.reduce(promisableChain,nop);return _e.onReadyBeingFired=[],DexiePromise.resolve(vip(j)).then(fireRemainders)}}))})).finally((function(){_e.onReadyBeingFired=null})).then((function(){return _e.isBeingOpened=!1,j})).catch((function(_t){try{Tt&&Tt.abort()}catch(j){}return _e.isBeingOpened=!1,j.close(),_e.dbOpenError=_t,J_(_e.dbOpenError)})).finally((function(){_e.openComplete=!0,St()}))}function awaitIterator(j){var callNext=function(_e){return j.next(_e)},_e=step(callNext),_t=step((function(_e){return j.throw(_e)}));function step(j){return function(St){var Tt=j(St),Ut=Tt.value;return Tt.done?Ut:Ut&&"function"==typeof Ut.then?Ut.then(_e,_t):_c(Ut)?Promise.all(Ut).then(_e,_t):_e(Ut)}}return step(callNext)()}function extractTransactionArgs(j,_e,_t){var St=arguments.length;if(St<2)throw new d_.InvalidArgument("Too few arguments");for(var Tt=new Array(St-1);--St;)Tt[St-1]=arguments[St];_t=Tt.pop();var Ut=flatten(Tt);return[j,Ut,_t]}function enterTransactionScope(j,_e,_t,St,Tt){return DexiePromise.resolve().then((function(){var Ut=P_.transless||P_,_r=j._createTransaction(_e,_t,j._dbSchema,St),_n={trans:_r,transless:Ut};St?_r.idbtrans=St.idbtrans:_r.create();var _i,Ei=t_(Tt);Ei&&incrementExpectedAwaits();var Ci=DexiePromise.follow((function(){if(_i=Tt.call(_r,_r))if(Ei){var j=decrementExpectedAwaits.bind(null,null);_i.then(j,j)}else"function"==typeof _i.next&&"function"==typeof _i.throw&&(_i=awaitIterator(_i))}),_n);return(_i&&"function"==typeof _i.then?DexiePromise.resolve(_i).then((function(j){return _r.active?j:J_(new d_.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):Ci.then((function(){return _i}))).then((function(j){return St&&_r._resolve(),_r._completion.then((function(){return j}))})).catch((function(j){return _r._reject(j),J_(j)}))}))}function pad(j,_e,_t){for(var St=_c(j)?j.slice():[j],Tt=0;Tt<_t;++Tt)St.push(_e);return St}var yE={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function createVirtualIndexMiddleware(j){return __assign(__assign({},j),{table:function(_e){var _t=j.table(_e),St=_t.schema,Tt={},Ut=[];function addVirtualIndexes(j,_e,_t){var St=getKeyPathAlias(j),_r=Tt[St]=Tt[St]||[],_n=null==j?0:"string"==typeof j?1:j.length,_i=_e>0,Ei=__assign(__assign({},_t),{isVirtual:_i,isPrimaryKey:!_i&&_t.isPrimaryKey,keyTail:_e,keyLength:_n,extractKey:getKeyExtractor(j),unique:!_i&&_t.unique});(_r.push(Ei),Ei.isPrimaryKey||Ut.push(Ei),_n>1)&&addVirtualIndexes(2===_n?j[0]:j.slice(0,_n-1),_e+1,_t);return _r.sort((function(j,_e){return j.keyTail-_e.keyTail})),Ei}var _r=addVirtualIndexes(St.primaryKey.keyPath,0,St.primaryKey);Tt[":id"]=[_r];for(var _n=0,_i=St.indexes;_n<_i.length;_n++){var Ei=_i[_n];addVirtualIndexes(Ei.keyPath,0,Ei)}function translateRequest(_e){var _t,St,Tt=_e.query.index;return Tt.isVirtual?__assign(__assign({},_e),{query:{index:Tt,range:(_t=_e.query.range,St=Tt.keyTail,{type:1===_t.type?2:_t.type,lower:pad(_t.lower,_t.lowerOpen?j.MAX_KEY:j.MIN_KEY,St),lowerOpen:!0,upper:pad(_t.upper,_t.upperOpen?j.MIN_KEY:j.MAX_KEY,St),upperOpen:!0})}}):_e}var Ci=__assign(__assign({},_t),{schema:__assign(__assign({},St),{primaryKey:_r,indexes:Ut,getIndexByKeyPath:function findBestIndex(j){var _e=Tt[getKeyPathAlias(j)];return _e&&_e[0]}}),count:function(j){return _t.count(translateRequest(j))},query:function(j){return _t.query(translateRequest(j))},openCursor:function(_e){var St=_e.query.index,Tt=St.keyTail,Ut=St.isVirtual,_r=St.keyLength;if(!Ut)return _t.openCursor(_e);return _t.openCursor(translateRequest(_e)).then((function(_t){return _t&&function createVirtualCursor(_t){var St=Object.create(_t,{continue:{value:function _continue(St){null!=St?_t.continue(pad(St,_e.reverse?j.MAX_KEY:j.MIN_KEY,Tt)):_e.unique?_t.continue(pad(_t.key,_e.reverse?j.MIN_KEY:j.MAX_KEY,Tt)):_t.continue()}},continuePrimaryKey:{value:function(_e,St){_t.continuePrimaryKey(pad(_e,j.MAX_KEY,Tt),St)}},key:{get:function(){var j=_t.key;return 1===_r?j[0]:j.slice(0,_r)}},value:{get:function(){return _t.value}}});return St}(_t)}))}});return Ci}})}},AE={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(j){return __assign(__assign({},j),{table:function(_e){var _t=j.table(_e),St=_t.schema.primaryKey,Tt=__assign(__assign({},_t),{mutate:function(j){var Tt=P_.trans,Ut=Tt.table(_e).hook,_r=Ut.deleting,_n=Ut.creating,_i=Ut.updating;switch(j.type){case"add":if(_n.fire===nop)break;return Tt._promise("readwrite",(function(){return addPutOrDelete(j)}),!0);case"put":if(_n.fire===nop&&_i.fire===nop)break;return Tt._promise("readwrite",(function(){return addPutOrDelete(j)}),!0);case"delete":if(_r.fire===nop)break;return Tt._promise("readwrite",(function(){return addPutOrDelete(j)}),!0);case"deleteRange":if(_r.fire===nop)break;return Tt._promise("readwrite",(function(){return function deleteRange(j){return deleteNextChunk(j.trans,j.range,1e4)}(j)}),!0)}return _t.mutate(j);function addPutOrDelete(j){var _e=P_.trans,Tt=j.keys||getEffectiveKeys(St,j);if(!Tt)throw new Error("Keys missing");return"delete"!==(j="add"===j.type||"put"===j.type?__assign(__assign({},j),{keys:Tt,wantResults:!0}):__assign({},j)).type&&(j.values=__spreadArrays(j.values)),j.keys&&(j.keys=__spreadArrays(j.keys)),function getExistingValues(j,_e,_t){return"add"===_e.type?Promise.resolve(new Array(_e.values.length)):j.getMany({trans:_e.trans,keys:_t})}(_t,j,Tt).then((function(Ut){var Ei=Tt.map((function(_t,Tt){var Ei=Ut[Tt],Ci={onerror:null,onsuccess:null};if("delete"===j.type)_r.fire.call(Ci,_t,Ei,_e);else if("add"===j.type||void 0===Ei){var Di=_n.fire.call(Ci,_t,j.values[Tt],_e);null==_t&&null!=Di&&(_t=Di,j.keys[Tt]=_t,St.outbound||setByKeyPath(j.values[Tt],St.keyPath,_t))}else{var Fi=getObjectDiff(Ei,j.values[Tt]),_o=_i.fire.call(Ci,Fi,_t,Ei,_e);if(_o){var ga=j.values[Tt];Object.keys(_o).forEach((function(j){hasOwn(ga,j)?ga[j]=_o[j]:setByKeyPath(ga,j,_o[j])}))}}return Ci}));return _t.mutate(j).then((function(_e){for(var _t=_e.failures,St=_e.results,_r=_e.numFailures,_n=_e.lastResult,_i=0;_i<Tt.length;++_i){var Ci=St?St[_i]:Tt[_i],Di=Ei[_i];null==Ci?Di.onerror&&Di.onerror(_t[_i]):Di.onsuccess&&Di.onsuccess("put"===j.type&&Ut[_i]?j.values[_i]:Ci)}return{failures:_t,results:St,numFailures:_r,lastResult:_n}})).catch((function(j){return Ei.forEach((function(_e){return _e.onerror&&_e.onerror(j)})),Promise.reject(j)}))}))}function deleteNextChunk(j,_e,Tt){return _t.query({trans:j,values:!1,query:{index:St,range:_e},limit:Tt}).then((function(_t){var St=_t.result;return addPutOrDelete({type:"delete",keys:St,trans:j}).then((function(_t){return _t.numFailures>0?Promise.reject(_t.failures[0]):St.length<Tt?{failures:[],numFailures:0,lastResult:void 0}:deleteNextChunk(j,__assign(__assign({},_e),{lower:St[St.length-1],lowerOpen:!0}),Tt)}))}))}}});return Tt}})}},_E=function(){function Dexie(j,_e){var _t=this;this._middlewares={},this.verno=0;var St=Dexie.dependencies;this._options=_e=__assign({addons:Dexie.addons,autoOpen:!0,indexedDB:St.indexedDB,IDBKeyRange:St.IDBKeyRange},_e),this._deps={indexedDB:_e.indexedDB,IDBKeyRange:_e.IDBKeyRange};var Tt=_e.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null;var Ut={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:nop,dbReadyPromise:null,cancelOpen:nop,openCanceller:null,autoSchema:!0};Ut.dbReadyPromise=new DexiePromise((function(j){Ut.dbReadyResolve=j})),Ut.openCanceller=new DexiePromise((function(j,_e){Ut.cancelOpen=_e})),this._state=Ut,this.name=j,this.on=Events(this,"populate","blocked","versionchange",{ready:[promisableChain,nop]}),this.on.ready.subscribe=override(this.on.ready.subscribe,(function(j){return function(_e,St){Dexie.vip((function(){var Tt=_t._state;if(Tt.openComplete)Tt.dbOpenError||DexiePromise.resolve().then(_e),St&&j(_e);else if(Tt.onReadyBeingFired)Tt.onReadyBeingFired.push(_e),St&&j(_e);else{j(_e);var Ut=_t;St||j((function unsubscribe(){Ut.on.ready.unsubscribe(_e),Ut.on.ready.unsubscribe(unsubscribe)}))}}))}})),this.Collection=function createCollectionConstructor(j){return makeClassConstructor(uE.prototype,(function Collection$$1(_e,_t){this.db=j;var St=sE,Tt=null;if(_t)try{St=_t()}catch(j){Tt=j}var Ut=_e._ctx,_r=Ut.table,_n=_r.hook.reading.fire;this._ctx={table:_r,index:Ut.index,isPrimKey:!Ut.index||_r.schema.primKey.keyPath&&Ut.index===_r.schema.primKey.name,range:St,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:Tt,or:Ut.or,valueMapper:_n!==mirror?_n:null}}))}(this),this.Table=function createTableConstructor(j){return makeClassConstructor(cE.prototype,(function Table$$1(_e,_t,St){this.db=j,this._tx=St,this.name=_e,this.schema=_t,this.hook=j._allTables[_e]?j._allTables[_e].hook:Events(null,{creating:[hookCreatingChain,nop],reading:[pureFunctionChain,mirror],updating:[hookUpdatingChain,nop],deleting:[hookDeletingChain,nop]})}))}(this),this.Transaction=function createTransactionConstructor(j){return makeClassConstructor(hE.prototype,(function Transaction$$1(_e,_t,St,Tt){var Ut=this;this.db=j,this.mode=_e,this.storeNames=_t,this.schema=St,this.idbtrans=null,this.on=Events(this,"complete","error","abort"),this.parent=Tt||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new DexiePromise((function(j,_e){Ut._resolve=j,Ut._reject=_e})),this._completion.then((function(){Ut.active=!1,Ut.on.complete.fire()}),(function(j){var _e=Ut.active;return Ut.active=!1,Ut.on.error.fire(j),Ut.parent?Ut.parent._reject(j):_e&&Ut.idbtrans&&Ut.idbtrans.abort(),J_(j)}))}))}(this),this.Version=function createVersionConstructor(j){return makeClassConstructor(vE.prototype,(function Version$$1(_e){this.db=j,this._cfg={version:_e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function createWhereClauseConstructor(j){return makeClassConstructor(lE.prototype,(function WhereClause$$1(_e,_t,St){this.db=j,this._ctx={table:_e,index:":id"===_t?null:_t,or:St};var Tt=j._deps.indexedDB;if(!Tt)throw new d_.MissingAPI("indexedDB API missing");this._cmp=this._ascending=Tt.cmp.bind(Tt),this._descending=function(j,_e){return Tt.cmp(_e,j)},this._max=function(j,_e){return Tt.cmp(j,_e)>0?j:_e},this._min=function(j,_e){return Tt.cmp(j,_e)<0?j:_e},this._IDBKeyRange=j._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(j){j.newVersion>0?console.warn("Another connection wants to upgrade database '"+_t.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+_t.name+"'. Closing db now to resume the delete request."),_t.close()})),this.on("blocked",(function(j){!j.newVersion||j.newVersion<j.oldVersion?console.warn("Dexie.delete('"+_t.name+"') was blocked"):console.warn("Upgrade '"+_t.name+"' blocked by other connection holding version "+j.oldVersion/10)})),this._maxKey=getMaxKey(_e.IDBKeyRange),this._createTransaction=function(j,_e,St,Tt){return new _t.Transaction(j,_e,St,Tt)},this._fireOnBlocked=function(j){_t.on("blocked").fire(j),eE.filter((function(j){return j.name===_t.name&&j!==_t&&!j._state.vcFired})).map((function(_e){return _e.on("versionchange").fire(j)}))},this.use(yE),this.use(AE),Tt.forEach((function(j){return j(_t)}))}return Dexie.prototype.version=function(j){if(isNaN(j)||j<.1)throw new d_.Type("Given version is not a positive number");if(j=Math.round(10*j)/10,this.idbdb||this._state.isBeingOpened)throw new d_.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,j);var _e=this._versions,_t=_e.filter((function(_e){return _e._cfg.version===j}))[0];return _t||(_t=new this.Version(j),_e.push(_t),_e.sort(lowerVersionFirst),_t.stores({}),this._state.autoSchema=!1,_t)},Dexie.prototype._whenReady=function(j){var _e=this;return this._state.openComplete||P_.letThrough?j():new DexiePromise((function(j,_t){if(!_e._state.isBeingOpened){if(!_e._options.autoOpen)return void _t(new d_.DatabaseClosed);_e.open().catch(nop)}_e._state.dbReadyPromise.then(j,_t)})).then(j)},Dexie.prototype.use=function(j){var _e=j.stack,_t=j.create,St=j.level,Tt=j.name;Tt&&this.unuse({stack:_e,name:Tt});var Ut=this._middlewares[_e]||(this._middlewares[_e]=[]);return Ut.push({stack:_e,create:_t,level:null==St?10:St,name:Tt}),Ut.sort((function(j,_e){return j.level-_e.level})),this},Dexie.prototype.unuse=function(j){var _e=j.stack,_t=j.name,St=j.create;return _e&&this._middlewares[_e]&&(this._middlewares[_e]=this._middlewares[_e].filter((function(j){return St?j.create!==St:!!_t&&j.name!==_t}))),this},Dexie.prototype.open=function(){return dexieOpen(this)},Dexie.prototype.close=function(){var j=eE.indexOf(this),_e=this._state;if(j>=0&&eE.splice(j,1),this.idbdb){try{this.idbdb.close()}catch(j){}this.idbdb=null}this._options.autoOpen=!1,_e.dbOpenError=new d_.DatabaseClosed,_e.isBeingOpened&&_e.cancelOpen(_e.dbOpenError),_e.dbReadyPromise=new DexiePromise((function(j){_e.dbReadyResolve=j})),_e.openCanceller=new DexiePromise((function(j,_t){_e.cancelOpen=_t}))},Dexie.prototype.delete=function(){var j=this,_e=arguments.length>0,_t=this._state;return new DexiePromise((function(St,Tt){var doDelete=function(){j.close();var _e=j._deps.indexedDB.deleteDatabase(j.name);_e.onsuccess=wrap((function(){pE.remove(j.name),St()})),_e.onerror=eventRejectHandler(Tt),_e.onblocked=j._fireOnBlocked};if(_e)throw new d_.InvalidArgument("Arguments not allowed in db.delete()");_t.isBeingOpened?_t.dbReadyPromise.then(doDelete):doDelete()}))},Dexie.prototype.backendDB=function(){return this.idbdb},Dexie.prototype.isOpen=function(){return null!==this.idbdb},Dexie.prototype.hasBeenClosed=function(){var j=this._state.dbOpenError;return j&&"DatabaseClosed"===j.name},Dexie.prototype.hasFailed=function(){return null!==this._state.dbOpenError},Dexie.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Dexie.prototype,"tables",{get:function(){var j=this;return _s(this._allTables).map((function(_e){return j._allTables[_e]}))},enumerable:!0,configurable:!0}),Dexie.prototype.transaction=function(){var j=extractTransactionArgs.apply(this,arguments);return this._transaction.apply(this,j)},Dexie.prototype._transaction=function(j,_e,_t){var St=this,Tt=P_.trans;Tt&&Tt.db===this&&-1===j.indexOf("!")||(Tt=null);var Ut,_r,_n=-1!==j.indexOf("?");j=j.replace("!","").replace("?","");try{if(_r=_e.map((function(j){var _e=j instanceof St.Table?j.name:j;if("string"!=typeof _e)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return _e})),"r"==j||j===oE)Ut=oE;else{if("rw"!=j&&j!=aE)throw new d_.InvalidArgument("Invalid transaction mode: "+j);Ut=aE}if(Tt){if(Tt.mode===oE&&Ut===aE){if(!_n)throw new d_.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");Tt=null}Tt&&_r.forEach((function(j){if(Tt&&-1===Tt.storeNames.indexOf(j)){if(!_n)throw new d_.SubTransaction("Table "+j+" not included in parent transaction.");Tt=null}})),_n&&Tt&&!Tt.active&&(Tt=null)}}catch(j){return Tt?Tt._promise(null,(function(_e,_t){_t(j)})):J_(j)}var _i=enterTransactionScope.bind(null,this,Ut,_r,Tt,_t);return Tt?Tt._promise(Ut,_i,"lock"):P_.trans?usePSD(P_.transless,(function(){return St._whenReady(_i)})):this._whenReady(_i)},Dexie.prototype.table=function(j){if(!hasOwn(this._allTables,j))throw new d_.InvalidTable("Table "+j+" does not exist");return this._allTables[j]},Dexie}(),bE=_E;props(bE,__assign(__assign({},f_),{delete:function(j){return new bE(j).delete()},exists:function(j){return new bE(j,{addons:[]}).open().then((function(j){return j.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(j){return pE?pE.getDatabaseNames().then(j):DexiePromise.resolve([])},defineClass:function(){return function Class(j){extend(this,j)}},ignoreTransaction:function(j){return P_.trans?usePSD(P_.transless,j):j()},vip,async:function(j){return function(){try{var _e=awaitIterator(j.apply(this,arguments));return _e&&"function"==typeof _e.then?_e:DexiePromise.resolve(_e)}catch(j){return J_(j)}}},spawn:function(j,_e,_t){try{var St=awaitIterator(j.apply(_t,_e||[]));return St&&"function"==typeof St.then?St:DexiePromise.resolve(St)}catch(j){return J_(j)}},currentTransaction:{get:function(){return P_.trans||null}},waitFor:function(j,_e){var _t=DexiePromise.resolve("function"==typeof j?bE.ignoreTransaction(j):j).timeout(_e||6e4);return P_.trans?P_.trans.waitFor(_t):_t},Promise:DexiePromise,debug:{get:function(){return r_},set:function(j){setDebug(j,"dexie"===j?function(){return!0}:dexieStackFrameFilter)}},derive,extend,props,override,Events,getByKeyPath,setByKeyPath,delByKeyPath,shallowClone,deepClone,getObjectDiff,asap,minKey:$_,addons:[],connections:eE,errnames:u_,dependencies:function(){try{return{indexedDB:kc.indexedDB||kc.mozIndexedDB||kc.webkitIndexedDB||kc.msIndexedDB,IDBKeyRange:kc.IDBKeyRange||kc.webkitIDBKeyRange}}catch(j){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:X_,version:X_.split(".").map((function(j){return parseInt(j)})).reduce((function(j,_e,_t){return j+_e/Math.pow(10,2*_t)})),default:bE,Dexie:bE})),bE.maxKey=getMaxKey(bE.dependencies.IDBKeyRange),function initDatabaseEnumerator(j){try{pE=function DatabaseEnumerator(j){var _e,_t=j&&"function"==typeof j.databases;if(!_t){var St=new _E(iE,{addons:[]});St.version(1).stores({dbnames:"name"}),_e=St.table("dbnames")}return{getDatabaseNames:function(){return _t?DexiePromise.resolve(j.databases()).then((function(j){return j.map((function(j){return j.name})).filter((function(j){return j!==iE}))})):_e.toCollection().primaryKeys()},add:function(j){return!_t&&j!==iE&&_e.put({name:j}).catch(nop)},remove:function(j){return!_t&&j!==iE&&_e.delete(j).catch(nop)}}}(j)}catch(j){}}(_E.dependencies.indexedDB),DexiePromise.rejectionMapper=function mapError(j,_e){if(!j||j instanceof DexieError||j instanceof TypeError||j instanceof SyntaxError||!j.name||!h_[j.name])return j;var _t=new h_[j.name](_e||j.message,j);return"stack"in j&&setProp(_t,"stack",{get:function(){return this.inner.stack}}),_t},setDebug(r_,dexieStackFrameFilter);function _createSuper(j){var _e=function db_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var SE,IE,TE,CE=new(function(j){_inherits(LoggerDB,j);var _e=_createSuper(LoggerDB);function LoggerDB(){var j;return _classCallCheck(this,LoggerDB),(j=_e.call(this,"AgoraLogger")).logs=void 0,j.openDatabase(),j.logs=j.table("logs"),j}return _createClass(LoggerDB,[{key:"openDatabase",value:function openDatabase(){this.version(1).stores({logs:"++id, content, label, created_at"})}}]),LoggerDB}(_E)),kE=__webpack_require__(1005),OE=__webpack_require__.n(kE);!function(j){j[j.ERROR=1]="ERROR",j[j.WARN=2]="WARN",j[j.INFO=3]="INFO",j[j.DEBUG=4]="DEBUG"}(SE||(SE={})),function(j){j[j.Idle=0]="Idle",j[j.Connecting=1]="Connecting",j[j.Connected=2]="Connected",j[j.Reconnecting=3]="Reconnecting",j[j.Error=4]="Error"}(IE||(IE={})),function(j){j[j.Communication=0]="Communication",j[j.LiveBroadcasting=1]="LiveBroadcasting"}(TE||(TE={}));var DE,xE=__webpack_require__(537),LE=__webpack_require__.n(xE);function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}var NE,PE=(_defineProperty(DE={},SE.ERROR,"error"),_defineProperty(DE,SE.WARN,"warn"),_defineProperty(DE,SE.INFO,"info"),_defineProperty(DE,SE.DEBUG,"debug"),_defineProperty(DE,"debug",SE.DEBUG),_defineProperty(DE,"info",SE.INFO),_defineProperty(DE,"warn",SE.WARN),_defineProperty(DE,"error",SE.ERROR),DE),ME=function(){function Logger(j,_e){_classCallCheck(this,Logger),this._label=j,this._dest=_e}var j,_e,_t,St;return _createClass(Logger,[{key:"debug",value:function debug(){for(var j=arguments.length,_e=new Array(j),_t=0;_t<j;_t++)_e[_t]=arguments[_t];this._log.apply(this,[SE.DEBUG].concat(_e))}},{key:"info",value:function info(){for(var j=arguments.length,_e=new Array(j),_t=0;_t<j;_t++)_e[_t]=arguments[_t];this._log.apply(this,[SE.INFO].concat(_e))}},{key:"warn",value:function warn(){for(var j=arguments.length,_e=new Array(j),_t=0;_t<j;_t++)_e[_t]=arguments[_t];this._log.apply(this,[SE.WARN].concat(_e))}},{key:"error",value:function error(){for(var j=arguments.length,_e=new Array(j),_t=0;_t<j;_t++)_e[_t]=arguments[_t];this._log.apply(this,[SE.ERROR].concat(_e))}},{key:"_log",value:function _log(j){var _e=$E.logLevel;if(!(j>_e)){for(var _t=arguments.length,St=new Array(_t>1?_t-1:0),Tt=1;Tt<_t;Tt++)St[Tt-1]=arguments[Tt];this._dest.database&&this._pipeToDatabase(St.join()),this._dest.console&&this._pipeToConsole(j,St)}}},{key:"_pipeToDatabase",value:function _pipeToDatabase(j){Logger.thread.postMessage({type:"log",data:{label:this._label,message:j}})}},{key:"_pipeToConsole",value:function _pipeToConsole(j,_e){var _t=Logger.originConsole;switch(j){case SE.DEBUG:_t.debug.apply(_t,_toConsumableArray(_e));break;case SE.INFO:_t.info.apply(_t,_toConsumableArray(_e));break;case SE.WARN:_t.warn.apply(_t,_toConsumableArray(_e));break;case SE.ERROR:_t.error.apply(_t,_toConsumableArray(_e))}}}],[{key:"warn",value:function warn(){var j;(j=Logger.logger).warn.apply(j,arguments)}},{key:"debug",value:function debug(){var j;(j=Logger.logger).debug.apply(j,arguments)}},{key:"info",value:function info(){var j;(j=Logger.logger).info.apply(j,arguments)}},{key:"error",value:function error(){var j;(j=Logger.logger).error.apply(j,arguments)}},{key:"setMaxRecords",value:function setMaxRecords(j){LE()(j)?(console.log("[logger] set maxRecords to ".concat(j)),Logger.thread.postMessage({type:"setting",data:{maxRecords:j}})):console.warn("[logger] cannot set maxRecords to an invalid number :".concat(j))}},{key:"setupConsoleHijack",value:function setupConsoleHijack(){var j=function _objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}({},Logger.originConsole);if(j.__hijackSetup)j.log("[logger] hijack already setup!");else{var _e=this.getLogger("console-hijack");j.log("[logger] setup hijack.."),Object.keys(j).filter((function(j){return["info","error","warn","debug"].indexOf(j)>=0})).forEach((function(_t){j[_t]=function proxy(j){return function(){switch(j){case"debug":_e.debug.apply(_e,arguments);break;case"info":_e.info.apply(_e,arguments);break;case"warn":_e.warn.apply(_e,arguments);break;case"error":_e.error.apply(_e,arguments)}}}(_t)})),j.__hijackSetup=!0,window.console=j}}},{key:"restoreConsoleHijack",value:function restoreConsoleHijack(){console.log("[logger] restore hijack.."),window.console=Logger.originConsole,console.__hijackSetup=!1}},{key:"collectConsoleLogs",value:(St=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var j,_e,_t;return _regeneratorRuntime().wrap((function _callee$(St){for(;;)switch(St.prev=St.next){case 0:return j="",St.next=3,CE.logs.each((function(_e){j+=_e.content+"\n",Logger._lastObjectIndex=_e.id}));case 3:return _e=+Date.now(),_t=new File([j],"".concat(_e)),St.abrupt("return",_t);case 6:case"end":return St.stop()}}),_callee)}))),function collectConsoleLogs(){return St.apply(this,arguments)})},{key:"cleanupConsoleLogs",value:(_t=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(){var j;return _regeneratorRuntime().wrap((function _callee2$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,CE.logs.where("id").belowOrEqual(Logger._lastObjectIndex).delete();case 2:j=_e.sent,console.log("[logger] delete ".concat(j," logs"));case 4:case"end":return _e.stop()}}),_callee2)}))),function cleanupConsoleLogs(){return _t.apply(this,arguments)})},{key:"_readFile",value:function _readFile(j){return new Promise((function(_e,_t){window.require("fs").readFile(j,(function(j,St){return j?_t(j):_e(St)}))}))}},{key:"_compressLogFile",value:(_e=_asyncToGenerator(_regeneratorRuntime().mark((function _callee3(j,_e){var _t,St,Tt;return _regeneratorRuntime().wrap((function _callee3$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return _t=window.require("adm-zip"),St=new _t,Ut.next=4,new Promise((function(_e,_t){St.addLocalFolderAsync(j,(function(j,St){if(St)return _t(St);_e()}))}));case 4:return St.writeZip(_e),Ut.next=7,this._readFile(_e);case 7:return Tt=Ut.sent,Ut.abrupt("return",Tt);case 9:case"end":return Ut.stop()}}),_callee3,this)}))),function _compressLogFile(j,_t){return _e.apply(this,arguments)})},{key:"collectElectronLogs",value:(j=_asyncToGenerator(_regeneratorRuntime().mark((function _callee4(j,_e){var _t,St,Tt,Ut;return _regeneratorRuntime().wrap((function _callee4$(_r){for(;;)switch(_r.prev=_r.next){case 0:return _t=+Date.now(),St=window.require("path"),Tt=St.resolve(j,"logs.zip"),_r.next=5,this._compressLogFile(_e,Tt);case 5:return Ut=_r.sent,_r.abrupt("return",new File([Ut],"".concat(_t)));case 7:case"end":return _r.stop()}}),_callee4,this)}))),function collectElectronLogs(_e,_t){return j.apply(this,arguments)})},{key:"getLogger",value:function getLogger(j){var _e=this._instancesByLabel.get(j);return _e||(this.logger.warn("no logger with label [".concat(j,"] is found, fallback to default logger")),_e=this.logger),_e}}]),Logger}();ME._lastObjectIndex=-1,ME._instancesByLabel=new Map(Object.entries({default:new ME("default",{console:!0,database:!0}),"channel-message":new ME("channel-message",{console:!1,database:!0}),"http-error":new ME("http-error",{console:!0,database:!0}),"console-hijack":new ME("console-hijack",{console:!0,database:!0})})),ME.logger=ME._instancesByLabel.get("default"),ME.thread=function Worker_fn(){return OE()('(()=>{var e={6831:(e,t,r)=>{var n=r(7772).Symbol;e.exports=n},1202:(e,t,r)=>{var n=r(6831),o=r(2107),i=r(7157),a=n?n.toStringTag:void 0;e.exports=function baseGetTag(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},1704:(e,t,r)=>{var n=r(2153),o=/^\\s+/;e.exports=function baseTrim(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},1242:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},2107:(e,t,r)=>{var n=r(6831),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=n?n.toStringTag:void 0;e.exports=function getRawTag(e){var t=i.call(e,u),r=e[u];try{e[u]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[u]=r:delete e[u]),o}},7157:e=>{var t=Object.prototype.toString;e.exports=function objectToString(e){return t.call(e)}},7772:(e,t,r)=>{var n=r(1242),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},2153:e=>{var t=/\\s/;e.exports=function trimmedEndIndex(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},4073:(e,t,r)=>{var n=r(9259),o=r(1100),i=r(7642),a=Math.max,u=Math.min;e.exports=function debounce(e,t,r){var s,l,f,p,h,d,y=0,v=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function invokeFunc(t){var r=s,n=l;return s=l=void 0,y=t,p=e.apply(n,r)}function leadingEdge(e){return y=e,h=setTimeout(timerExpired,t),v?invokeFunc(e):p}function shouldInvoke(e){var r=e-d;return void 0===d||r>=t||r<0||m&&e-y>=f}function timerExpired(){var e=o();if(shouldInvoke(e))return trailingEdge(e);h=setTimeout(timerExpired,function remainingWait(e){var r=t-(e-d);return m?u(r,f-(e-y)):r}(e))}function trailingEdge(e){return h=void 0,g&&s?invokeFunc(e):(s=l=void 0,p)}function debounced(){var e=o(),r=shouldInvoke(e);if(s=arguments,l=this,d=e,r){if(void 0===h)return leadingEdge(d);if(m)return clearTimeout(h),h=setTimeout(timerExpired,t),invokeFunc(d)}return void 0===h&&(h=setTimeout(timerExpired,t)),p}return t=i(t)||0,n(r)&&(v=!!r.leading,f=(m="maxWait"in r)?a(i(r.maxWait)||0,t):f,g="trailing"in r?!!r.trailing:g),debounced.cancel=function cancel(){void 0!==h&&clearTimeout(h),y=0,s=d=l=h=void 0},debounced.flush=function flush(){return void 0===h?p:trailingEdge(o())},debounced}},9259:e=>{e.exports=function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5125:e=>{e.exports=function isObjectLike(e){return null!=e&&"object"==typeof e}},4795:(e,t,r)=>{var n=r(1202),o=r(5125);e.exports=function isSymbol(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},1100:(e,t,r)=>{var n=r(7772);e.exports=function(){return n.Date.now()}},7642:(e,t,r)=>{var n=r(1704),o=r(9259),i=r(4795),a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;e.exports=function toNumber(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=u.test(e);return r||s.test(e)?l(e.slice(2),r?2:8):a.test(e)?NaN:+e}},9662:(e,t,r)=>{var n=r(7854),o=r(614),i=r(6330),a=n.TypeError;e.exports=function(e){if(o(e))return e;throw a(i(e)+" is not a function")}},9483:(e,t,r)=>{var n=r(7854),o=r(4411),i=r(6330),a=n.TypeError;e.exports=function(e){if(o(e))return e;throw a(i(e)+" is not a constructor")}},6077:(e,t,r)=>{var n=r(7854),o=r(614),i=n.String,a=n.TypeError;e.exports=function(e){if("object"==typeof e||o(e))return e;throw a("Can\'t set "+i(e)+" as a prototype")}},1223:(e,t,r)=>{var n=r(5112),o=r(30),i=r(3070),a=n("unscopables"),u=Array.prototype;null==u[a]&&i.f(u,a,{configurable:!0,value:o(null)}),e.exports=function(e){u[a][e]=!0}},5787:(e,t,r)=>{var n=r(7854),o=r(7976),i=n.TypeError;e.exports=function(e,t){if(o(t,e))return e;throw i("Incorrect invocation")}},9670:(e,t,r)=>{var n=r(7854),o=r(111),i=n.String,a=n.TypeError;e.exports=function(e){if(o(e))return e;throw a(i(e)+" is not an object")}},8533:(e,t,r)=>{"use strict";var n=r(2092).forEach,o=r(2133)("forEach");e.exports=o?[].forEach:function forEach(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},1318:(e,t,r)=>{var n=r(5656),o=r(1400),i=r(6244),createMethod=function(e){return function(t,r,a){var u,s=n(t),l=i(s),f=o(a,l);if(e&&r!=r){for(;l>f;)if((u=s[f++])!=u)return!0}else for(;l>f;f++)if((e||f in s)&&s[f]===r)return e||f||0;return!e&&-1}};e.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},2092:(e,t,r)=>{var n=r(9974),o=r(1702),i=r(8361),a=r(7908),u=r(6244),s=r(5417),l=o([].push),createMethod=function(e){var t=1==e,r=2==e,o=3==e,f=4==e,p=6==e,h=7==e,d=5==e||p;return function(y,v,m,g){for(var b,w,_=a(y),x=i(_),P=n(v,m),k=u(x),S=0,E=g||s,O=t?E(y,k):r||h?E(y,0):void 0;k>S;S++)if((d||S in x)&&(w=P(b=x[S],S,_),e))if(t)O[S]=w;else if(w)switch(e){case 3:return!0;case 5:return b;case 6:return S;case 2:l(O,b)}else switch(e){case 4:return!1;case 7:l(O,b)}return p?-1:o||f?f:O}};e.exports={forEach:createMethod(0),map:createMethod(1),filter:createMethod(2),some:createMethod(3),every:createMethod(4),find:createMethod(5),findIndex:createMethod(6),filterReject:createMethod(7)}},1194:(e,t,r)=>{var n=r(7293),o=r(5112),i=r(7392),a=o("species");e.exports=function(e){return i>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},2133:(e,t,r)=>{"use strict";var n=r(7293);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){throw 1},1)}))}},1589:(e,t,r)=>{var n=r(7854),o=r(1400),i=r(6244),a=r(6135),u=n.Array,s=Math.max;e.exports=function(e,t,r){for(var n=i(e),l=o(t,n),f=o(void 0===r?n:r,n),p=u(s(f-l,0)),h=0;l<f;l++,h++)a(p,h,e[l]);return p.length=h,p}},206:(e,t,r)=>{var n=r(1702);e.exports=n([].slice)},7475:(e,t,r)=>{var n=r(7854),o=r(3157),i=r(4411),a=r(111),u=r(5112)("species"),s=n.Array;e.exports=function(e){var t;return o(e)&&(t=e.constructor,(i(t)&&(t===s||o(t.prototype))||a(t)&&null===(t=t[u]))&&(t=void 0)),void 0===t?s:t}},5417:(e,t,r)=>{var n=r(7475);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},7072:(e,t,r)=>{var n=r(5112)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}},4326:(e,t,r)=>{var n=r(1702),o=n({}.toString),i=n("".slice);e.exports=function(e){return i(o(e),8,-1)}},648:(e,t,r)=>{var n=r(7854),o=r(1694),i=r(614),a=r(4326),u=r(5112)("toStringTag"),s=n.Object,l="Arguments"==a(function(){return arguments}());e.exports=o?a:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=s(e),u))?r:l?a(t):"Object"==(n=a(t))&&i(t.callee)?"Arguments":n}},9920:(e,t,r)=>{var n=r(2597),o=r(3887),i=r(1236),a=r(3070);e.exports=function(e,t,r){for(var u=o(t),s=a.f,l=i.f,f=0;f<u.length;f++){var p=u[f];n(e,p)||r&&n(r,p)||s(e,p,l(t,p))}}},8544:(e,t,r)=>{var n=r(7293);e.exports=!n((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype}))},4994:(e,t,r)=>{"use strict";var n=r(3383).IteratorPrototype,o=r(30),i=r(9114),a=r(8003),u=r(7497),returnThis=function(){return this};e.exports=function(e,t,r,s){var l=t+" Iterator";return e.prototype=o(n,{next:i(+!s,r)}),a(e,l,!1,!0),u[l]=returnThis,e}},8880:(e,t,r)=>{var n=r(9781),o=r(3070),i=r(9114);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},9114:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6135:(e,t,r)=>{"use strict";var n=r(4948),o=r(3070),i=r(9114);e.exports=function(e,t,r){var a=n(t);a in e?o.f(e,a,i(0,r)):e[a]=r}},654:(e,t,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(1913),a=r(6530),u=r(614),s=r(4994),l=r(9518),f=r(7674),p=r(8003),h=r(8880),d=r(1320),y=r(5112),v=r(7497),m=r(3383),g=a.PROPER,b=a.CONFIGURABLE,w=m.IteratorPrototype,_=m.BUGGY_SAFARI_ITERATORS,x=y("iterator"),P="keys",k="values",S="entries",returnThis=function(){return this};e.exports=function(e,t,r,a,y,m,E){s(r,t,a);var O,T,C,getIterationMethod=function(e){if(e===y&&R)return R;if(!_&&e in A)return A[e];switch(e){case P:return function keys(){return new r(this,e)};case k:return function values(){return new r(this,e)};case S:return function entries(){return new r(this,e)}}return function(){return new r(this)}},j=t+" Iterator",D=!1,A=e.prototype,I=A[x]||A["@@iterator"]||y&&A[y],R=!_&&I||getIterationMethod(y),K="Array"==t&&A.entries||I;if(K&&(O=l(K.call(new e)))!==Object.prototype&&O.next&&(i||l(O)===w||(f?f(O,w):u(O[x])||d(O,x,returnThis)),p(O,j,!0,!0),i&&(v[j]=returnThis)),g&&y==k&&I&&I.name!==k&&(!i&&b?h(A,"name",k):(D=!0,R=function values(){return o(I,this)})),y)if(T={values:getIterationMethod(k),keys:m?R:getIterationMethod(P),entries:getIterationMethod(S)},E)for(C in T)(_||D||!(C in A))&&d(A,C,T[C]);else n({target:t,proto:!0,forced:_||D},T);return i&&!E||A[x]===R||d(A,x,R,{name:y}),v[t]=R,T}},7235:(e,t,r)=>{var n=r(857),o=r(2597),i=r(6061),a=r(3070).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},9781:(e,t,r)=>{var n=r(7293);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(e,t,r)=>{var n=r(7854),o=r(111),i=n.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},8324:e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:(e,t,r)=>{var n=r(317)("span").classList,o=n&&n.constructor&&n.constructor.prototype;e.exports=o===Object.prototype?void 0:o},7871:e=>{e.exports="object"==typeof window},1528:(e,t,r)=>{var n=r(8113),o=r(7854);e.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==o.Pebble},6833:(e,t,r)=>{var n=r(8113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},5268:(e,t,r)=>{var n=r(4326),o=r(7854);e.exports="process"==n(o.process)},1036:(e,t,r)=>{var n=r(8113);e.exports=/web0s(?!.*chrome)/i.test(n)},8113:(e,t,r)=>{var n=r(5005);e.exports=n("navigator","userAgent")||""},7392:(e,t,r)=>{var n,o,i=r(7854),a=r(8113),u=i.process,s=i.Deno,l=u&&u.versions||s&&s.version,f=l&&l.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\\/(\\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\\/(\\d+)/))&&(o=+n[1]),e.exports=o},748:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(e,t,r)=>{var n=r(7854),o=r(1236).f,i=r(8880),a=r(1320),u=r(3505),s=r(9920),l=r(4705);e.exports=function(e,t){var r,f,p,h,d,y=e.target,v=e.global,m=e.stat;if(r=v?n:m?n[y]||u(y,{}):(n[y]||{}).prototype)for(f in t){if(h=t[f],p=e.noTargetGet?(d=o(r,f))&&d.value:r[f],!l(v?f:y+(m?".":"#")+f,e.forced)&&void 0!==p){if(typeof h==typeof p)continue;s(h,p)}(e.sham||p&&p.sham)&&i(h,"sham",!0),a(r,f,h,e)}}},7293:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},2104:e=>{var t=Function.prototype,r=t.apply,n=t.bind,o=t.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(r):function(){return o.apply(r,arguments)})},9974:(e,t,r)=>{var n=r(1702),o=r(9662),i=n(n.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?i(e,t):function(){return e.apply(t,arguments)}}},7065:(e,t,r)=>{"use strict";var n=r(7854),o=r(1702),i=r(9662),a=r(111),u=r(2597),s=r(206),l=n.Function,f=o([].concat),p=o([].join),h={},construct=function(e,t,r){if(!u(h,t)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";h[t]=l("C,a","return new C("+p(n,",")+")")}return h[t](e,r)};e.exports=l.bind||function bind(e){var t=i(this),r=t.prototype,n=s(arguments,1),o=function bound(){var r=f(n,s(arguments));return this instanceof o?construct(t,r.length,r):t.apply(e,r)};return a(r)&&(o.prototype=r),o}},6916:e=>{var t=Function.prototype.call;e.exports=t.bind?t.bind(t):function(){return t.apply(t,arguments)}},6530:(e,t,r)=>{var n=r(9781),o=r(2597),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,u=o(i,"name"),s=u&&"something"===function something(){}.name,l=u&&(!n||n&&a(i,"name").configurable);e.exports={EXISTS:u,PROPER:s,CONFIGURABLE:l}},1702:e=>{var t=Function.prototype,r=t.bind,n=t.call,o=r&&r.bind(n);e.exports=r?function(e){return e&&o(n,e)}:function(e){return e&&function(){return n.apply(e,arguments)}}},5005:(e,t,r)=>{var n=r(7854),o=r(614),aFunction=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?aFunction(n[e]):n[e]&&n[e][t]}},1246:(e,t,r)=>{var n=r(648),o=r(8173),i=r(7497),a=r(5112)("iterator");e.exports=function(e){if(null!=e)return o(e,a)||o(e,"@@iterator")||i[n(e)]}},8554:(e,t,r)=>{var n=r(7854),o=r(6916),i=r(9662),a=r(9670),u=r(6330),s=r(1246),l=n.TypeError;e.exports=function(e,t){var r=arguments.length<2?s(e):t;if(i(r))return a(o(r,e));throw l(u(e)+" is not iterable")}},8173:(e,t,r)=>{var n=r(9662);e.exports=function(e,t){var r=e[t];return null==r?void 0:n(r)}},7854:(e,t,r)=>{var check=function(e){return e&&e.Math==Math&&e};e.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2597:(e,t,r)=>{var n=r(1702),o=r(7908),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function hasOwn(e,t){return i(o(e),t)}},3501:e=>{e.exports={}},842:(e,t,r)=>{var n=r(7854);e.exports=function(e,t){var r=n.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))}},490:(e,t,r)=>{var n=r(5005);e.exports=n("document","documentElement")},4664:(e,t,r)=>{var n=r(9781),o=r(7293),i=r(317);e.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(e,t,r)=>{var n=r(7854),o=r(1702),i=r(7293),a=r(4326),u=n.Object,s=o("".split);e.exports=i((function(){return!u("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?s(e,""):u(e)}:u},2788:(e,t,r)=>{var n=r(1702),o=r(614),i=r(5465),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},9909:(e,t,r)=>{var n,o,i,a=r(8536),u=r(7854),s=r(1702),l=r(111),f=r(8880),p=r(2597),h=r(5465),d=r(6200),y=r(3501),v="Object already initialized",m=u.TypeError,g=u.WeakMap;if(a||h.state){var b=h.state||(h.state=new g),w=s(b.get),_=s(b.has),x=s(b.set);n=function(e,t){if(_(b,e))throw new m(v);return t.facade=e,x(b,e,t),t},o=function(e){return w(b,e)||{}},i=function(e){return _(b,e)}}else{var P=d("state");y[P]=!0,n=function(e,t){if(p(e,P))throw new m(v);return t.facade=e,f(e,P,t),t},o=function(e){return p(e,P)?e[P]:{}},i=function(e){return p(e,P)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=o(t)).type!==e)throw m("Incompatible receiver, "+e+" required");return r}}}},7659:(e,t,r)=>{var n=r(5112),o=r(7497),i=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},3157:(e,t,r)=>{var n=r(4326);e.exports=Array.isArray||function isArray(e){return"Array"==n(e)}},614:e=>{e.exports=function(e){return"function"==typeof e}},4411:(e,t,r)=>{var n=r(1702),o=r(7293),i=r(614),a=r(648),u=r(5005),s=r(2788),noop=function(){},l=[],f=u("Reflect","construct"),p=/^\\s*(?:class|function)\\b/,h=n(p.exec),d=!p.exec(noop),y=function isConstructor(e){if(!i(e))return!1;try{return f(noop,l,e),!0}catch(e){return!1}},v=function isConstructor(e){if(!i(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!h(p,s(e))}catch(e){return!0}};v.sham=!0,e.exports=!f||o((function(){var e;return y(y.call)||!y(Object)||!y((function(){e=!0}))||e}))?v:y},4705:(e,t,r)=>{var n=r(7293),o=r(614),i=/#|\\.prototype\\./,isForced=function(e,t){var r=u[a(e)];return r==l||r!=s&&(o(t)?n(t):!!t)},a=isForced.normalize=function(e){return String(e).replace(i,".").toLowerCase()},u=isForced.data={},s=isForced.NATIVE="N",l=isForced.POLYFILL="P";e.exports=isForced},111:(e,t,r)=>{var n=r(614);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},1913:e=>{e.exports=!1},2190:(e,t,r)=>{var n=r(7854),o=r(5005),i=r(614),a=r(7976),u=r(3307),s=n.Object;e.exports=u?function(e){return"symbol"==typeof e}:function(e){var t=o("Symbol");return i(t)&&a(t.prototype,s(e))}},612:(e,t,r)=>{var n=r(7854),o=r(9974),i=r(6916),a=r(9670),u=r(6330),s=r(7659),l=r(6244),f=r(7976),p=r(8554),h=r(1246),d=r(9212),y=n.TypeError,Result=function(e,t){this.stopped=e,this.result=t},v=Result.prototype;e.exports=function(e,t,r){var n,m,g,b,w,_,x,P=r&&r.that,k=!(!r||!r.AS_ENTRIES),S=!(!r||!r.IS_ITERATOR),E=!(!r||!r.INTERRUPTED),O=o(t,P),stop=function(e){return n&&d(n,"normal",e),new Result(!0,e)},callFn=function(e){return k?(a(e),E?O(e[0],e[1],stop):O(e[0],e[1])):E?O(e,stop):O(e)};if(S)n=e;else{if(!(m=h(e)))throw y(u(e)+" is not iterable");if(s(m)){for(g=0,b=l(e);b>g;g++)if((w=callFn(e[g]))&&f(v,w))return w;return new Result(!1)}n=p(e,m)}for(_=n.next;!(x=i(_,n)).done;){try{w=callFn(x.value)}catch(e){d(n,"throw",e)}if("object"==typeof w&&w&&f(v,w))return w}return new Result(!1)}},9212:(e,t,r)=>{var n=r(6916),o=r(9670),i=r(8173);e.exports=function(e,t,r){var a,u;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(e){u=!0,a=e}if("throw"===t)throw r;if(u)throw a;return o(a),r}},3383:(e,t,r)=>{"use strict";var n,o,i,a=r(7293),u=r(614),s=r(30),l=r(9518),f=r(1320),p=r(5112),h=r(1913),d=p("iterator"),y=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(n=o):y=!0),null==n||a((function(){var e={};return n[d].call(e)!==e}))?n={}:h&&(n=s(n)),u(n[d])||f(n,d,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:y}},7497:e=>{e.exports={}},6244:(e,t,r)=>{var n=r(7466);e.exports=function(e){return n(e.length)}},5948:(e,t,r)=>{var n,o,i,a,u,s,l,f,p=r(7854),h=r(9974),d=r(1236).f,y=r(261).set,v=r(6833),m=r(1528),g=r(1036),b=r(5268),w=p.MutationObserver||p.WebKitMutationObserver,_=p.document,x=p.process,P=p.Promise,k=d(p,"queueMicrotask"),S=k&&k.value;S||(n=function(){var e,t;for(b&&(e=x.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?a():i=void 0,e}}i=void 0,e&&e.enter()},v||b||g||!w||!_?!m&&P&&P.resolve?((l=P.resolve(void 0)).constructor=P,f=h(l.then,l),a=function(){f(n)}):b?a=function(){x.nextTick(n)}:(y=h(y,p),a=function(){y(n)}):(u=!0,s=_.createTextNode(""),new w(n).observe(s,{characterData:!0}),a=function(){s.data=u=!u})),e.exports=S||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,a()),i=t}},3366:(e,t,r)=>{var n=r(7854);e.exports=n.Promise},133:(e,t,r)=>{var n=r(7392),o=r(7293);e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8536:(e,t,r)=>{var n=r(7854),o=r(614),i=r(2788),a=n.WeakMap;e.exports=o(a)&&/native code/.test(i(a))},8523:(e,t,r)=>{"use strict";var n=r(9662),PromiseCapability=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new PromiseCapability(e)}},30:(e,t,r)=>{var n,o=r(9670),i=r(6048),a=r(748),u=r(3501),s=r(490),l=r(317),f=r(6200),p="prototype",h="script",d=f("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return"<"+h+">"+e+"</"+h+">"},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObject=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;NullProtoObject="undefined"!=typeof document?document.domain&&n?NullProtoObjectViaActiveX(n):(t=l("iframe"),r="java"+h+":",t.style.display="none",s.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F):NullProtoObjectViaActiveX(n);for(var o=a.length;o--;)delete NullProtoObject[p][a[o]];return NullProtoObject()};u[d]=!0,e.exports=Object.create||function create(e,t){var r;return null!==e?(EmptyConstructor[p]=o(e),r=new EmptyConstructor,EmptyConstructor[p]=null,r[d]=e):r=NullProtoObject(),void 0===t?r:i(r,t)}},6048:(e,t,r)=>{var n=r(9781),o=r(3070),i=r(9670),a=r(5656),u=r(1956);e.exports=n?Object.defineProperties:function defineProperties(e,t){i(e);for(var r,n=a(t),s=u(t),l=s.length,f=0;l>f;)o.f(e,r=s[f++],n[r]);return e}},3070:(e,t,r)=>{var n=r(7854),o=r(9781),i=r(4664),a=r(9670),u=r(4948),s=n.TypeError,l=Object.defineProperty;t.f=o?l:function defineProperty(e,t,r){if(a(e),t=u(t),a(r),i)try{return l(e,t,r)}catch(e){}if("get"in r||"set"in r)throw s("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},1236:(e,t,r)=>{var n=r(9781),o=r(6916),i=r(5296),a=r(9114),u=r(5656),s=r(4948),l=r(2597),f=r(4664),p=Object.getOwnPropertyDescriptor;t.f=n?p:function getOwnPropertyDescriptor(e,t){if(e=u(e),t=s(t),f)try{return p(e,t)}catch(e){}if(l(e,t))return a(!o(i.f,e,t),e[t])}},1156:(e,t,r)=>{var n=r(4326),o=r(5656),i=r(8006).f,a=r(1589),u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function getOwnPropertyNames(e){return u&&"Window"==n(e)?function(e){try{return i(e)}catch(e){return a(u)}}(e):i(o(e))}},8006:(e,t,r)=>{var n=r(6324),o=r(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return n(e,o)}},5181:(e,t)=>{t.f=Object.getOwnPropertySymbols},9518:(e,t,r)=>{var n=r(7854),o=r(2597),i=r(614),a=r(7908),u=r(6200),s=r(8544),l=u("IE_PROTO"),f=n.Object,p=f.prototype;e.exports=s?f.getPrototypeOf:function(e){var t=a(e);if(o(t,l))return t[l];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof f?p:null}},7976:(e,t,r)=>{var n=r(1702);e.exports=n({}.isPrototypeOf)},6324:(e,t,r)=>{var n=r(1702),o=r(2597),i=r(5656),a=r(1318).indexOf,u=r(3501),s=n([].push);e.exports=function(e,t){var r,n=i(e),l=0,f=[];for(r in n)!o(u,r)&&o(n,r)&&s(f,r);for(;t.length>l;)o(n,r=t[l++])&&(~a(f,r)||s(f,r));return f}},1956:(e,t,r)=>{var n=r(6324),o=r(748);e.exports=Object.keys||function keys(e){return n(e,o)}},5296:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);t.f=o?function propertyIsEnumerable(e){var t=n(this,e);return!!t&&t.enumerable}:r},7674:(e,t,r)=>{var n=r(1702),o=r(9670),i=r(6077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function setPrototypeOf(r,n){return o(r),i(n),t?e(r,n):r.__proto__=n,r}}():void 0)},288:(e,t,r)=>{"use strict";var n=r(1694),o=r(648);e.exports=n?{}.toString:function toString(){return"[object "+o(this)+"]"}},2140:(e,t,r)=>{var n=r(7854),o=r(6916),i=r(614),a=r(111),u=n.TypeError;e.exports=function(e,t){var r,n;if("string"===t&&i(r=e.toString)&&!a(n=o(r,e)))return n;if(i(r=e.valueOf)&&!a(n=o(r,e)))return n;if("string"!==t&&i(r=e.toString)&&!a(n=o(r,e)))return n;throw u("Can\'t convert object to primitive value")}},3887:(e,t,r)=>{var n=r(5005),o=r(1702),i=r(8006),a=r(5181),u=r(9670),s=o([].concat);e.exports=n("Reflect","ownKeys")||function ownKeys(e){var t=i.f(u(e)),r=a.f;return r?s(t,r(e)):t}},857:(e,t,r)=>{var n=r(7854);e.exports=n},2534:e=>{e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},9478:(e,t,r)=>{var n=r(9670),o=r(111),i=r(8523);e.exports=function(e,t){if(n(e),o(t)&&t.constructor===e)return t;var r=i.f(e);return(0,r.resolve)(t),r.promise}},8572:e=>{var Queue=function(){this.head=null,this.tail=null};Queue.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},e.exports=Queue},2248:(e,t,r)=>{var n=r(1320);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},1320:(e,t,r)=>{var n=r(7854),o=r(614),i=r(2597),a=r(8880),u=r(3505),s=r(2788),l=r(9909),f=r(6530).CONFIGURABLE,p=l.get,h=l.enforce,d=String(String).split("String");(e.exports=function(e,t,r,s){var l,p=!!s&&!!s.unsafe,y=!!s&&!!s.enumerable,v=!!s&&!!s.noTargetGet,m=s&&void 0!==s.name?s.name:t;o(r)&&("Symbol("===String(m).slice(0,7)&&(m="["+String(m).replace(/^Symbol\\(([^)]*)\\)/,"$1")+"]"),(!i(r,"name")||f&&r.name!==m)&&a(r,"name",m),(l=h(r)).source||(l.source=d.join("string"==typeof m?m:""))),e!==n?(p?!v&&e[t]&&(y=!0):delete e[t],y?e[t]=r:a(e,t,r)):y?e[t]=r:u(t,r)})(Function.prototype,"toString",(function toString(){return o(this)&&p(this).source||s(this)}))},4488:(e,t,r)=>{var n=r(7854).TypeError;e.exports=function(e){if(null==e)throw n("Can\'t call method on "+e);return e}},3505:(e,t,r)=>{var n=r(7854),o=Object.defineProperty;e.exports=function(e,t){try{o(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},6340:(e,t,r)=>{"use strict";var n=r(5005),o=r(3070),i=r(5112),a=r(9781),u=i("species");e.exports=function(e){var t=n(e),r=o.f;a&&t&&!t[u]&&r(t,u,{configurable:!0,get:function(){return this}})}},8003:(e,t,r)=>{var n=r(3070).f,o=r(2597),i=r(5112)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!o(e,i)&&n(e,i,{configurable:!0,value:t})}},6200:(e,t,r)=>{var n=r(2309),o=r(9711),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},5465:(e,t,r)=>{var n=r(7854),o=r(3505),i="__core-js_shared__",a=n[i]||o(i,{});e.exports=a},2309:(e,t,r)=>{var n=r(1913),o=r(5465);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.1",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},6707:(e,t,r)=>{var n=r(9670),o=r(9483),i=r(5112)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||null==(r=n(a)[i])?t:o(r)}},8710:(e,t,r)=>{var n=r(1702),o=r(9303),i=r(1340),a=r(4488),u=n("".charAt),s=n("".charCodeAt),l=n("".slice),createMethod=function(e){return function(t,r){var n,f,p=i(a(t)),h=o(r),d=p.length;return h<0||h>=d?e?"":void 0:(n=s(p,h))<55296||n>56319||h+1===d||(f=s(p,h+1))<56320||f>57343?e?u(p,h):n:e?l(p,h,h+2):f-56320+(n-55296<<10)+65536}};e.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},261:(e,t,r)=>{var n,o,i,a,u=r(7854),s=r(2104),l=r(9974),f=r(614),p=r(2597),h=r(7293),d=r(490),y=r(206),v=r(317),m=r(6833),g=r(5268),b=u.setImmediate,w=u.clearImmediate,_=u.process,x=u.Dispatch,P=u.Function,k=u.MessageChannel,S=u.String,E=0,O={},T="onreadystatechange";try{n=u.location}catch(e){}var run=function(e){if(p(O,e)){var t=O[e];delete O[e],t()}},runner=function(e){return function(){run(e)}},listener=function(e){run(e.data)},post=function(e){u.postMessage(S(e),n.protocol+"//"+n.host)};b&&w||(b=function setImmediate(e){var t=y(arguments,1);return O[++E]=function(){s(f(e)?e:P(e),void 0,t)},o(E),E},w=function clearImmediate(e){delete O[e]},g?o=function(e){_.nextTick(runner(e))}:x&&x.now?o=function(e){x.now(runner(e))}:k&&!m?(a=(i=new k).port2,i.port1.onmessage=listener,o=l(a.postMessage,a)):u.addEventListener&&f(u.postMessage)&&!u.importScripts&&n&&"file:"!==n.protocol&&!h(post)?(o=post,u.addEventListener("message",listener,!1)):o=T in v("script")?function(e){d.appendChild(v("script"))[T]=function(){d.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)}),e.exports={set:b,clear:w}},1400:(e,t,r)=>{var n=r(9303),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},5656:(e,t,r)=>{var n=r(8361),o=r(4488);e.exports=function(e){return n(o(e))}},9303:e=>{var t=Math.ceil,r=Math.floor;e.exports=function(e){var n=+e;return n!=n||0===n?0:(n>0?r:t)(n)}},7466:(e,t,r)=>{var n=r(9303),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},7908:(e,t,r)=>{var n=r(7854),o=r(4488),i=n.Object;e.exports=function(e){return i(o(e))}},7593:(e,t,r)=>{var n=r(7854),o=r(6916),i=r(111),a=r(2190),u=r(8173),s=r(2140),l=r(5112),f=n.TypeError,p=l("toPrimitive");e.exports=function(e,t){if(!i(e)||a(e))return e;var r,n=u(e,p);if(n){if(void 0===t&&(t="default"),r=o(n,e,t),!i(r)||a(r))return r;throw f("Can\'t convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},4948:(e,t,r)=>{var n=r(7593),o=r(2190);e.exports=function(e){var t=n(e,"string");return o(t)?t:t+""}},1694:(e,t,r)=>{var n={};n[r(5112)("toStringTag")]="z",e.exports="[object z]"===String(n)},1340:(e,t,r)=>{var n=r(7854),o=r(648),i=n.String;e.exports=function(e){if("Symbol"===o(e))throw TypeError("Cannot convert a Symbol value to a string");return i(e)}},6330:(e,t,r)=>{var n=r(7854).String;e.exports=function(e){try{return n(e)}catch(e){return"Object"}}},9711:(e,t,r)=>{var n=r(1702),o=0,i=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},3307:(e,t,r)=>{var n=r(133);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},6061:(e,t,r)=>{var n=r(5112);t.f=n},5112:(e,t,r)=>{var n=r(7854),o=r(2309),i=r(2597),a=r(9711),u=r(133),s=r(3307),l=o("wks"),f=n.Symbol,p=f&&f.for,h=s?f:f&&f.withoutSetter||a;e.exports=function(e){if(!i(l,e)||!u&&"string"!=typeof l[e]){var t="Symbol."+e;u&&i(f,e)?l[e]=f[e]:l[e]=s&&p?p(t):h(t)}return l[e]}},2222:(e,t,r)=>{"use strict";var n=r(2109),o=r(7854),i=r(7293),a=r(3157),u=r(111),s=r(7908),l=r(6244),f=r(6135),p=r(5417),h=r(1194),d=r(5112),y=r(7392),v=d("isConcatSpreadable"),m=9007199254740991,g="Maximum allowed index exceeded",b=o.TypeError,w=y>=51||!i((function(){var e=[];return e[v]=!1,e.concat()[0]!==e})),_=h("concat"),isConcatSpreadable=function(e){if(!u(e))return!1;var t=e[v];return void 0!==t?!!t:a(e)};n({target:"Array",proto:!0,forced:!w||!_},{concat:function concat(e){var t,r,n,o,i,a=s(this),u=p(a,0),h=0;for(t=-1,n=arguments.length;t<n;t++)if(isConcatSpreadable(i=-1===t?a:arguments[t])){if(h+(o=l(i))>m)throw b(g);for(r=0;r<o;r++,h++)r in i&&f(u,h,i[r])}else{if(h>=m)throw b(g);f(u,h++,i)}return u.length=h,u}})},9554:(e,t,r)=>{"use strict";var n=r(2109),o=r(8533);n({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},6992:(e,t,r)=>{"use strict";var n=r(5656),o=r(1223),i=r(7497),a=r(9909),u=r(3070).f,s=r(654),l=r(1913),f=r(9781),p="Array Iterator",h=a.set,d=a.getterFor(p);e.exports=s(Array,"Array",(function(e,t){h(this,{type:p,target:n(e),index:0,kind:t})}),(function(){var e=d(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");var y=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!l&&f&&"values"!==y.name)try{u(y,"name",{value:"values"})}catch(e){}},5069:(e,t,r)=>{"use strict";var n=r(2109),o=r(1702),i=r(3157),a=o([].reverse),u=[1,2];n({target:"Array",proto:!0,forced:String(u)===String(u.reverse())},{reverse:function reverse(){return i(this)&&(this.length=this.length),a(this)}})},7042:(e,t,r)=>{"use strict";var n=r(2109),o=r(7854),i=r(3157),a=r(4411),u=r(111),s=r(1400),l=r(6244),f=r(5656),p=r(6135),h=r(5112),d=r(1194),y=r(206),v=d("slice"),m=h("species"),g=o.Array,b=Math.max;n({target:"Array",proto:!0,forced:!v},{slice:function slice(e,t){var r,n,o,h=f(this),d=l(h),v=s(e,d),w=s(void 0===t?d:t,d);if(i(h)&&(r=h.constructor,(a(r)&&(r===g||i(r.prototype))||u(r)&&null===(r=r[m]))&&(r=void 0),r===g||void 0===r))return y(h,v,w);for(n=new(void 0===r?g:r)(b(w-v,0)),o=0;v<w;v++,o++)v in h&&p(n,o,h[v]);return n.length=o,n}})},3843:(e,t,r)=>{var n=r(2109),o=r(7854),i=r(1702),a=o.Date,u=i(a.prototype.getTime);n({target:"Date",stat:!0},{now:function now(){return u(new a)}})},3710:(e,t,r)=>{var n=r(1702),o=r(1320),i=Date.prototype,a="Invalid Date",u="toString",s=n(i[u]),l=n(i.getTime);String(new Date(NaN))!=a&&o(i,u,(function toString(){var e=l(this);return e==e?s(this):a}))},8309:(e,t,r)=>{var n=r(9781),o=r(6530).EXISTS,i=r(1702),a=r(3070).f,u=Function.prototype,s=i(u.toString),l=/function\\b(?:\\s|\\/\\*[\\S\\s]*?\\*\\/|\\/\\/[^\\n\\r]*[\\n\\r]+)*([^\\s(/]*)/,f=i(l.exec);n&&!o&&a(u,"name",{configurable:!0,get:function(){try{return f(l,s(this))[1]}catch(e){return""}}})},3706:(e,t,r)=>{var n=r(7854);r(8003)(n.JSON,"JSON",!0)},408:(e,t,r)=>{r(8003)(Math,"Math",!0)},8011:(e,t,r)=>{r(2109)({target:"Object",stat:!0,sham:!r(9781)},{create:r(30)})},9070:(e,t,r)=>{var n=r(2109),o=r(9781);n({target:"Object",stat:!0,forced:!o,sham:!o},{defineProperty:r(3070).f})},489:(e,t,r)=>{var n=r(2109),o=r(7293),i=r(7908),a=r(9518),u=r(8544);n({target:"Object",stat:!0,forced:o((function(){a(1)})),sham:!u},{getPrototypeOf:function getPrototypeOf(e){return a(i(e))}})},8304:(e,t,r)=>{r(2109)({target:"Object",stat:!0},{setPrototypeOf:r(7674)})},1539:(e,t,r)=>{var n=r(1694),o=r(1320),i=r(288);n||o(Object.prototype,"toString",i,{unsafe:!0})},8674:(e,t,r)=>{"use strict";var n,o,i,a,u=r(2109),s=r(1913),l=r(7854),f=r(5005),p=r(6916),h=r(3366),d=r(1320),y=r(2248),v=r(7674),m=r(8003),g=r(6340),b=r(9662),w=r(614),_=r(111),x=r(5787),P=r(2788),k=r(612),S=r(7072),E=r(6707),O=r(261).set,T=r(5948),C=r(9478),j=r(842),D=r(8523),A=r(2534),I=r(8572),R=r(9909),K=r(4705),M=r(5112),B=r(7871),L=r(5268),N=r(7392),q=M("species"),G="Promise",W=R.getterFor(G),V=R.set,U=R.getterFor(G),z=h&&h.prototype,H=h,Y=z,$=l.TypeError,Q=l.document,X=l.process,Z=D.f,J=Z,ee=!!(Q&&Q.createEvent&&l.dispatchEvent),te=w(l.PromiseRejectionEvent),re="unhandledrejection",ne=!1,oe=K(G,(function(){var e=P(H),t=e!==String(H);if(!t&&66===N)return!0;if(s&&!Y.finally)return!0;if(N>=51&&/native code/.test(e))return!1;var r=new H((function(e){e(1)})),FakePromise=function(e){e((function(){}),(function(){}))};return(r.constructor={})[q]=FakePromise,!(ne=r.then((function(){}))instanceof FakePromise)||!t&&B&&!te})),ie=oe||!S((function(e){H.all(e).catch((function(){}))})),isThenable=function(e){var t;return!(!_(e)||!w(t=e.then))&&t},callReaction=function(e,t){var r,n,o,i=t.value,a=1==t.state,u=a?e.ok:e.fail,s=e.resolve,l=e.reject,f=e.domain;try{u?(a||(2===t.rejection&&onHandleUnhandled(t),t.rejection=1),!0===u?r=i:(f&&f.enter(),r=u(i),f&&(f.exit(),o=!0)),r===e.promise?l($("Promise-chain cycle")):(n=isThenable(r))?p(n,r,s,l):s(r)):l(i)}catch(e){f&&!o&&f.exit(),l(e)}},notify=function(e,t){e.notified||(e.notified=!0,T((function(){for(var r,n=e.reactions;r=n.get();)callReaction(r,e);e.notified=!1,t&&!e.rejection&&onUnhandled(e)})))},dispatchEvent=function(e,t,r){var n,o;ee?((n=Q.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),l.dispatchEvent(n)):n={promise:t,reason:r},!te&&(o=l["on"+e])?o(n):e===re&&j("Unhandled promise rejection",r)},onUnhandled=function(e){p(O,l,(function(){var t,r=e.facade,n=e.value;if(isUnhandled(e)&&(t=A((function(){L?X.emit("unhandledRejection",n,r):dispatchEvent(re,r,n)})),e.rejection=L||isUnhandled(e)?2:1,t.error))throw t.value}))},isUnhandled=function(e){return 1!==e.rejection&&!e.parent},onHandleUnhandled=function(e){p(O,l,(function(){var t=e.facade;L?X.emit("rejectionHandled",t):dispatchEvent("rejectionhandled",t,e.value)}))},bind=function(e,t,r){return function(n){e(t,n,r)}},internalReject=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,notify(e,!0))},internalResolve=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw $("Promise can\'t be resolved itself");var n=isThenable(t);n?T((function(){var r={done:!1};try{p(n,t,bind(internalResolve,r,e),bind(internalReject,r,e))}catch(t){internalReject(r,t,e)}})):(e.value=t,e.state=1,notify(e,!1))}catch(t){internalReject({done:!1},t,e)}}};if(oe&&(Y=(H=function Promise(e){x(this,Y),b(e),p(n,this);var t=W(this);try{e(bind(internalResolve,t),bind(internalReject,t))}catch(e){internalReject(t,e)}}).prototype,(n=function Promise(e){V(this,{type:G,done:!1,notified:!1,parent:!1,reactions:new I,rejection:!1,state:0,value:void 0})}).prototype=y(Y,{then:function then(e,t){var r=U(this),n=Z(E(this,H));return r.parent=!0,n.ok=!w(e)||e,n.fail=w(t)&&t,n.domain=L?X.domain:void 0,0==r.state?r.reactions.add(n):T((function(){callReaction(n,r)})),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n,t=W(e);this.promise=e,this.resolve=bind(internalResolve,t),this.reject=bind(internalReject,t)},D.f=Z=function(e){return e===H||e===i?new o(e):J(e)},!s&&w(h)&&z!==Object.prototype)){a=z.then,ne||(d(z,"then",(function then(e,t){var r=this;return new H((function(e,t){p(a,r,e,t)})).then(e,t)}),{unsafe:!0}),d(z,"catch",Y.catch,{unsafe:!0}));try{delete z.constructor}catch(e){}v&&v(z,Y)}u({global:!0,wrap:!0,forced:oe},{Promise:H}),m(H,G,!1,!0),g(G),i=f(G),u({target:G,stat:!0,forced:oe},{reject:function reject(e){var t=Z(this);return p(t.reject,void 0,e),t.promise}}),u({target:G,stat:!0,forced:s||oe},{resolve:function resolve(e){return C(s&&this===i?H:this,e)}}),u({target:G,stat:!0,forced:ie},{all:function all(e){var t=this,r=Z(t),n=r.resolve,o=r.reject,i=A((function(){var r=b(t.resolve),i=[],a=0,u=1;k(e,(function(e){var s=a++,l=!1;u++,p(r,t,e).then((function(e){l||(l=!0,i[s]=e,--u||n(i))}),o)})),--u||n(i)}));return i.error&&o(i.value),r.promise},race:function race(e){var t=this,r=Z(t),n=r.reject,o=A((function(){var o=b(t.resolve);k(e,(function(e){p(o,t,e).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}})},2419:(e,t,r)=>{var n=r(2109),o=r(5005),i=r(2104),a=r(7065),u=r(9483),s=r(9670),l=r(111),f=r(30),p=r(7293),h=o("Reflect","construct"),d=Object.prototype,y=[].push,v=p((function(){function F(){}return!(h((function(){}),[],F)instanceof F)})),m=!p((function(){h((function(){}))})),g=v||m;n({target:"Reflect",stat:!0,forced:g,sham:g},{construct:function construct(e,t){u(e),s(t);var r=arguments.length<3?e:u(arguments[2]);if(m&&!v)return h(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return i(y,n,t),new(i(a,e,n))}var o=r.prototype,p=f(l(o)?o:d),g=i(e,p,t);return l(g)?g:p}})},8783:(e,t,r)=>{"use strict";var n=r(8710).charAt,o=r(1340),i=r(9909),a=r(654),u="String Iterator",s=i.set,l=i.getterFor(u);a(String,"String",(function(e){s(this,{type:u,string:o(e),index:0})}),(function next(){var e,t=l(this),r=t.string,o=t.index;return o>=r.length?{value:void 0,done:!0}:(e=n(r,o),t.index+=e.length,{value:e,done:!1})}))},2443:(e,t,r)=>{r(7235)("asyncIterator")},1817:(e,t,r)=>{"use strict";var n=r(2109),o=r(9781),i=r(7854),a=r(1702),u=r(2597),s=r(614),l=r(7976),f=r(1340),p=r(3070).f,h=r(9920),d=i.Symbol,y=d&&d.prototype;if(o&&s(d)&&(!("description"in y)||void 0!==d().description)){var v={},m=function Symbol(){var e=arguments.length<1||void 0===arguments[0]?void 0:f(arguments[0]),t=l(y,this)?new d(e):void 0===e?d():d(e);return""===e&&(v[t]=!0),t};h(m,d),m.prototype=y,y.constructor=m;var g="Symbol(test)"==String(d("test")),b=a(y.toString),w=a(y.valueOf),_=/^Symbol\\((.*)\\)[^)]+$/,x=a("".replace),P=a("".slice);p(y,"description",{configurable:!0,get:function description(){var e=w(this),t=b(e);if(u(v,e))return"";var r=g?P(t,7,-1):x(t,_,"$1");return""===r?void 0:r}}),n({global:!0,forced:!0},{Symbol:m})}},2165:(e,t,r)=>{r(7235)("iterator")},2526:(e,t,r)=>{"use strict";var n=r(2109),o=r(7854),i=r(5005),a=r(2104),u=r(6916),s=r(1702),l=r(1913),f=r(9781),p=r(133),h=r(7293),d=r(2597),y=r(3157),v=r(614),m=r(111),g=r(7976),b=r(2190),w=r(9670),_=r(7908),x=r(5656),P=r(4948),k=r(1340),S=r(9114),E=r(30),O=r(1956),T=r(8006),C=r(1156),j=r(5181),D=r(1236),A=r(3070),I=r(5296),R=r(206),K=r(1320),M=r(2309),B=r(6200),L=r(3501),N=r(9711),q=r(5112),G=r(6061),W=r(7235),V=r(8003),U=r(9909),z=r(2092).forEach,H=B("hidden"),Y="Symbol",$="prototype",Q=q("toPrimitive"),X=U.set,Z=U.getterFor(Y),J=Object[$],ee=o.Symbol,te=ee&&ee[$],re=o.TypeError,ne=o.QObject,oe=i("JSON","stringify"),ie=D.f,ae=A.f,ue=C.f,ce=I.f,se=s([].push),le=M("symbols"),fe=M("op-symbols"),pe=M("string-to-symbol-registry"),he=M("symbol-to-string-registry"),de=M("wks"),ye=!ne||!ne[$]||!ne[$].findChild,ve=f&&h((function(){return 7!=E(ae({},"a",{get:function(){return ae(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=ie(J,t);n&&delete J[t],ae(e,t,r),n&&e!==J&&ae(J,t,n)}:ae,wrap=function(e,t){var r=le[e]=E(te);return X(r,{type:Y,tag:e,description:t}),f||(r.description=t),r},me=function defineProperty(e,t,r){e===J&&me(fe,t,r),w(e);var n=P(t);return w(r),d(le,n)?(r.enumerable?(d(e,H)&&e[H][n]&&(e[H][n]=!1),r=E(r,{enumerable:S(0,!1)})):(d(e,H)||ae(e,H,S(1,{})),e[H][n]=!0),ve(e,n,r)):ae(e,n,r)},ge=function defineProperties(e,t){w(e);var r=x(t),n=O(r).concat(xe(r));return z(n,(function(t){f&&!u(be,r,t)||me(e,t,r[t])})),e},be=function propertyIsEnumerable(e){var t=P(e),r=u(ce,this,t);return!(this===J&&d(le,t)&&!d(fe,t))&&(!(r||!d(this,t)||!d(le,t)||d(this,H)&&this[H][t])||r)},we=function getOwnPropertyDescriptor(e,t){var r=x(e),n=P(t);if(r!==J||!d(le,n)||d(fe,n)){var o=ie(r,n);return!o||!d(le,n)||d(r,H)&&r[H][n]||(o.enumerable=!0),o}},_e=function getOwnPropertyNames(e){var t=ue(x(e)),r=[];return z(t,(function(e){d(le,e)||d(L,e)||se(r,e)})),r},xe=function getOwnPropertySymbols(e){var t=e===J,r=ue(t?fe:x(e)),n=[];return z(r,(function(e){!d(le,e)||t&&!d(J,e)||se(n,le[e])})),n};(p||(K(te=(ee=function Symbol(){if(g(te,this))throw re("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?k(arguments[0]):void 0,t=N(e),setter=function(e){this===J&&u(setter,fe,e),d(this,H)&&d(this[H],t)&&(this[H][t]=!1),ve(this,t,S(1,e))};return f&&ye&&ve(J,t,{configurable:!0,set:setter}),wrap(t,e)})[$],"toString",(function toString(){return Z(this).tag})),K(ee,"withoutSetter",(function(e){return wrap(N(e),e)})),I.f=be,A.f=me,D.f=we,T.f=C.f=_e,j.f=xe,G.f=function(e){return wrap(q(e),e)},f&&(ae(te,"description",{configurable:!0,get:function description(){return Z(this).description}}),l||K(J,"propertyIsEnumerable",be,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!p,sham:!p},{Symbol:ee}),z(O(de),(function(e){W(e)})),n({target:Y,stat:!0,forced:!p},{for:function(e){var t=k(e);if(d(pe,t))return pe[t];var r=ee(t);return pe[t]=r,he[r]=t,r},keyFor:function keyFor(e){if(!b(e))throw re(e+" is not a symbol");if(d(he,e))return he[e]},useSetter:function(){ye=!0},useSimple:function(){ye=!1}}),n({target:"Object",stat:!0,forced:!p,sham:!f},{create:function create(e,t){return void 0===t?E(e):ge(E(e),t)},defineProperty:me,defineProperties:ge,getOwnPropertyDescriptor:we}),n({target:"Object",stat:!0,forced:!p},{getOwnPropertyNames:_e,getOwnPropertySymbols:xe}),n({target:"Object",stat:!0,forced:h((function(){j.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(e){return j.f(_(e))}}),oe)&&n({target:"JSON",stat:!0,forced:!p||h((function(){var e=ee();return"[null]"!=oe([e])||"{}"!=oe({a:e})||"{}"!=oe(Object(e))}))},{stringify:function stringify(e,t,r){var n=R(arguments),o=t;if((m(t)||void 0!==e)&&!b(e))return y(t)||(t=function(e,t){if(v(o)&&(t=u(o,this,e,t)),!b(t))return t}),n[1]=t,a(oe,null,n)}});if(!te[Q]){var Pe=te.valueOf;K(te,Q,(function(e){return u(Pe,this)}))}V(ee,Y),L[H]=!0},9341:(e,t,r)=>{r(7235)("toStringTag")},4747:(e,t,r)=>{var n=r(7854),o=r(8324),i=r(8509),a=r(8533),u=r(8880),handlePrototype=function(e){if(e&&e.forEach!==a)try{u(e,"forEach",a)}catch(t){e.forEach=a}};for(var s in o)o[s]&&handlePrototype(n[s]&&n[s].prototype);handlePrototype(i)},3948:(e,t,r)=>{var n=r(7854),o=r(8324),i=r(8509),a=r(6992),u=r(8880),s=r(5112),l=s("iterator"),f=s("toStringTag"),p=a.values,handlePrototype=function(e,t){if(e){if(e[l]!==p)try{u(e,l,p)}catch(t){e[l]=p}if(e[f]||u(e,f,t),o[t])for(var r in a)if(e[r]!==a[r])try{u(e,r,a[r])}catch(t){e[r]=a[r]}}};for(var h in o)handlePrototype(n[h]&&n[h].prototype,h);handlePrototype(i,"DOMTokenList")}},t={};function __webpack_require__(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,__webpack_require__),o.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";__webpack_require__(9070),__webpack_require__(2526),__webpack_require__(1817),__webpack_require__(1539),__webpack_require__(2165),__webpack_require__(6992),__webpack_require__(8783),__webpack_require__(3948),__webpack_require__(2443),__webpack_require__(9341),__webpack_require__(3706),__webpack_require__(408),__webpack_require__(8011),__webpack_require__(489),__webpack_require__(9554),__webpack_require__(4747),__webpack_require__(8309),__webpack_require__(8304),__webpack_require__(8674),__webpack_require__(7042);function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function _next(e){asyncGeneratorStep(i,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}__webpack_require__(3710),__webpack_require__(5069),__webpack_require__(2222),__webpack_require__(3843);var e=__webpack_require__(4073),t=__webpack_require__.n(e);__webpack_require__(2419);function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _toPropertyKey(e){var t=function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return e}(e)}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}var __assign=function(){return __assign=Object.assign||function __assign(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__assign.apply(this,arguments)};function __spreadArrays(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var r=Object.keys,n=Array.isArray,o="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function extend(e,t){return"object"!=typeof t||r(t).forEach((function(r){e[r]=t[r]})),e}"undefined"==typeof Promise||o.Promise||(o.Promise=Promise);var i=Object.getPrototypeOf,a={}.hasOwnProperty;function hasOwn(e,t){return a.call(e,t)}function props(e,t){"function"==typeof t&&(t=t(i(e))),r(t).forEach((function(r){setProp(e,r,t[r])}))}var u=Object.defineProperty;function setProp(e,t,r,n){u(e,t,extend(r&&hasOwn(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function derive(e){return{from:function(t){return e.prototype=Object.create(t.prototype),setProp(e.prototype,"constructor",e),{extend:props.bind(null,e.prototype)}}}}var s=Object.getOwnPropertyDescriptor;function getPropertyDescriptor(e,t){var r;return s(e,t)||(r=i(e))&&getPropertyDescriptor(r,t)}var l=[].slice;function slice(e,t,r){return l.call(e,t,r)}function override(e,t){return t(e)}function assert(e){if(!e)throw new Error("Assertion Failed")}function asap(e){o.setImmediate?setImmediate(e):setTimeout(e,0)}function arrayToObject(e,t){return e.reduce((function(e,r,n){var o=t(r,n);return o&&(e[o[0]]=o[1]),e}),{})}function getByKeyPath(e,t){if(hasOwn(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,o=t.length;n<o;++n){var i=getByKeyPath(e,t[n]);r.push(i)}return r}var a=t.indexOf(".");if(-1!==a){var u=e[t.substr(0,a)];return void 0===u?void 0:getByKeyPath(u,t.substr(a+1))}}function setByKeyPath(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){assert("string"!=typeof r&&"length"in r);for(var o=0,i=t.length;o<i;++o)setByKeyPath(e,t[o],r[o])}else{var a=t.indexOf(".");if(-1!==a){var u=t.substr(0,a),s=t.substr(a+1);if(""===s)void 0===r?n(e)&&!isNaN(parseInt(u))?e.splice(u,1):delete e[u]:e[u]=r;else{var l=e[u];l||(l=e[u]={}),setByKeyPath(l,s,r)}}else void 0===r?n(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function delByKeyPath(e,t){"string"==typeof t?setByKeyPath(e,t,void 0):"length"in t&&[].map.call(t,(function(t){setByKeyPath(e,t,void 0)}))}function shallowClone(e){var t={};for(var r in e)hasOwn(e,r)&&(t[r]=e[r]);return t}var f=[].concat;function flatten(e){return f.apply([],e)}var p="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(flatten([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return o[e]})),h=p.map((function(e){return o[e]})),d=arrayToObject(p,(function(e){return[e,!0]}));function deepClone(e){if(!e||"object"!=typeof e)return e;var t;if(n(e)){t=[];for(var r=0,o=e.length;r<o;++r)t.push(deepClone(e[r]))}else if(h.indexOf(e.constructor)>=0)t=e;else for(var i in t=e.constructor?Object.create(e.constructor.prototype):{},e)hasOwn(e,i)&&(t[i]=deepClone(e[i]));return t}var y={}.toString;function toStringTag(e){return y.call(e).slice(8,-1)}var getValueOf=function(e,t){return"Array"===t?""+e.map((function(e){return getValueOf(e,toStringTag(e))})):"ArrayBuffer"===t?""+new Uint8Array(e):"Date"===t?e.getTime():ArrayBuffer.isView(e)?""+new Uint8Array(e.buffer):e};function getObjectDiff(e,t,n,o){return n=n||{},o=o||"",r(e).forEach((function(r){if(hasOwn(t,r)){var i=e[r],a=t[r];if("object"==typeof i&&"object"==typeof a&&i&&a){var u=toStringTag(i),s=toStringTag(a);u===s?d[u]?getValueOf(i,u)!==getValueOf(a,s)&&(n[o+r]=t[r]):getObjectDiff(i,a,n,o+r+"."):n[o+r]=t[r]}else i!==a&&(n[o+r]=t[r])}else n[o+r]=void 0})),r(t).forEach((function(r){hasOwn(e,r)||(n[o+r]=t[r])})),n}var v="undefined"!=typeof Symbol&&Symbol.iterator,m=v?function(e){var t;return null!=e&&(t=e[v])&&t.apply(e)}:function(){return null},g={};function getArrayOf(e){var t,r,o,i;if(1===arguments.length){if(n(e))return e.slice();if(this===g&&"string"==typeof e)return[e];if(i=m(e)){for(r=[];!(o=i.next()).done;)r.push(o.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=new Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=new Array(t);t--;)r[t]=arguments[t];return r}var b="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},w="undefined"!=typeof location&&/^(http|https):\\/\\/(localhost|127\\.0\\.0\\.1)/.test(location.href);function setDebug(e,t){w=e,libraryFilter=t}var libraryFilter=function(){return!0},_=!new Error("").stack;function getErrorWithStack(){if(_)try{throw new Error}catch(e){return e}return new Error}function prettyStack(e,t){var r=e.stack;return r?(t=t||0,0===r.indexOf(e.name)&&(t+=(e.name+e.message).split("\\n").length),r.split("\\n").slice(t).filter(libraryFilter).map((function(e){return"\\n"+e})).join("")):""}var x=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],P=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(x),k={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function DexieError(e,t){this._e=getErrorWithStack(),this.name=e,this.message=t}function getMultiErrorMessage(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,r){return r.indexOf(e)===t})).join("\\n")}function ModifyError(e,t,r,n){this._e=getErrorWithStack(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=getMultiErrorMessage(e,t)}function BulkError(e,t){this._e=getErrorWithStack(),this.name="BulkError",this.failures=t,this.message=getMultiErrorMessage(e,t)}derive(DexieError).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+prettyStack(this._e,2))}},toString:function(){return this.name+": "+this.message}}),derive(ModifyError).from(DexieError),derive(BulkError).from(DexieError);var S=P.reduce((function(e,t){return e[t]=t+"Error",e}),{}),E=DexieError,O=P.reduce((function(e,t){var r=t+"Error";function DexieError(e,n){this._e=getErrorWithStack(),this.name=r,e?"string"==typeof e?(this.message=e+(n?"\\n "+n:""),this.inner=n||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=k[t]||r,this.inner=null)}return derive(DexieError).from(E),e[t]=DexieError,e}),{});O.Syntax=SyntaxError,O.Type=TypeError,O.Range=RangeError;var T=x.reduce((function(e,t){return e[t+"Error"]=O[t],e}),{});var C=P.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=O[t]),e}),{});function nop(){}function mirror(e){return e}function pureFunctionChain(e,t){return null==e||e===mirror?t:function(r){return t(e(r))}}function callBoth(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function hookCreatingChain(e,t){return e===nop?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?callBoth(n,this.onsuccess):n),o&&(this.onerror=this.onerror?callBoth(o,this.onerror):o),void 0!==i?i:r}}function hookDeletingChain(e,t){return e===nop?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?callBoth(r,this.onsuccess):r),n&&(this.onerror=this.onerror?callBoth(n,this.onerror):n)}}function hookUpdatingChain(e,t){return e===nop?t:function(r){var n=e.apply(this,arguments);extend(r,n);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?callBoth(o,this.onsuccess):o),i&&(this.onerror=this.onerror?callBoth(i,this.onerror):i),void 0===n?void 0===a?void 0:a:extend(n,a)}}function reverseStoppableEventChain(e,t){return e===nop?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function promisableChain(e,t){return e===nop?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return r.then((function(){return t.apply(n,i)}))}return t.apply(this,arguments)}}C.ModifyError=ModifyError,C.DexieError=DexieError,C.BulkError=BulkError;var j={},D="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,e.__proto__,e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,t.__proto__,e]}(),A=D[0],I=D[1],R=D[2],K=I&&I.then,M=A&&A.constructor,B=!!R,L=!1,N=R?function(){R.then(physicalTick)}:o.setImmediate?setImmediate.bind(null,physicalTick):o.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){physicalTick(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(physicalTick,0)},asap$1=function(e,t){$.push([e,t]),G&&(N(),G=!1)},q=!0,G=!0,W=[],V=[],U=null,z=mirror,H={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:globalError,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{globalError(e[0],e[1])}catch(e){}}))}},Y=H,$=[],Q=0,X=[];function DexiePromise(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=nop,this._lib=!1;var t=this._PSD=Y;if(w&&(this._stackHolder=getErrorWithStack(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==j)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&handleRejection(this,this._value))}this._state=null,this._value=null,++t.ref,executePromiseTask(this,e)}var Z={get:function(){var e=Y,t=ne;function then(r,n){var o=this,i=!e.global&&(e!==Y||t!==ne),a=i&&!decrementExpectedAwaits(),u=new DexiePromise((function(t,u){propagateToListener(o,new Listener(nativeAwaitCompatibleWrap(r,e,i,a),nativeAwaitCompatibleWrap(n,e,i,a),t,u,e))}));return w&&linkToPreviousPromise(u,this),u}return then.prototype=j,then},set:function(e){setProp(this,"then",e&&e.prototype===j?Z:{get:function(){return e},set:Z.set})}};function Listener(e,t,r,n,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=o}function executePromiseTask(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var r=e._lib&&beginMicroTickScope();t&&"function"==typeof t.then?executePromiseTask(e,(function(e,r){t instanceof DexiePromise?t._then(e,r):t.then(e,r)})):(e._state=!0,e._value=t,propagateAllListeners(e)),r&&endMicroTickScope()}}),handleRejection.bind(null,e))}catch(t){handleRejection(e,t)}}function handleRejection(e,t){if(V.push(t),null===e._state){var r=e._lib&&beginMicroTickScope();t=z(t),e._state=!1,e._value=t,w&&null!==t&&"object"==typeof t&&!t._promise&&function tryCatch(e,t,r){try{e.apply(null,r)}catch(e){t&&t(e)}}((function(){var r=getPropertyDescriptor(t,"stack");t._promise=e,setProp(t,"stack",{get:function(){return L?r&&(r.get?r.get.apply(t):r.value):e.stack}})})),function addPossiblyUnhandledError(e){W.some((function(t){return t._value===e._value}))||W.push(e)}(e),propagateAllListeners(e),r&&endMicroTickScope()}}function propagateAllListeners(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)propagateToListener(e,t[r]);var o=e._PSD;--o.ref||o.finalize(),0===Q&&(++Q,asap$1((function(){0==--Q&&finalizePhysicalTick()}),[]))}function propagateToListener(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++Q,asap$1(callListener,[r,e,t])}else e._listeners.push(t)}function callListener(e,t,r){try{U=t;var n,o=t._value;t._state?n=e(o):(V.length&&(V=[]),n=e(o),-1===V.indexOf(o)&&function markErrorAsHandled(e){var t=W.length;for(;t;)if(W[--t]._value===e._value)return void W.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{U=null,0==--Q&&finalizePhysicalTick(),--r.psd.ref||r.psd.finalize()}}function getStack(e,t,r){if(t.length===r)return t;var n="";if(!1===e._state){var o,i,a=e._value;null!=a?(o=a.name||"Error",i=a.message||a,n=prettyStack(a,0)):(o=a,i=""),t.push(o+(i?": "+i:"")+n)}return w&&((n=prettyStack(e._stackHolder,2))&&-1===t.indexOf(n)&&t.push(n),e._prev&&getStack(e._prev,t,r)),t}function linkToPreviousPromise(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function physicalTick(){beginMicroTickScope()&&endMicroTickScope()}function beginMicroTickScope(){var e=q;return q=!1,G=!1,e}function endMicroTickScope(){var e,t,r;do{for(;$.length>0;)for(e=$,$=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}}while($.length>0);q=!0,G=!0}function finalizePhysicalTick(){var e=W;W=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=X.slice(0),r=t.length;r;)t[--r]()}function PromiseReject(e){return new DexiePromise(j,!1,e)}function wrap(e,t){var r=Y;return function(){var n=beginMicroTickScope(),o=Y;try{return switchToZone(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{switchToZone(o,!1),n&&endMicroTickScope()}}}props(DexiePromise.prototype,{then:Z,_then:function(e,t){propagateToListener(this,new Listener(null,null,e,t,Y))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,(function(e){return e instanceof t?r(e):PromiseReject(e)})):this.then(null,(function(e){return e&&e.name===t?r(e):PromiseReject(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),PromiseReject(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{L=!0;var e=getStack(this,[],20).join("\\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{L=!1}}},timeout:function(e,t){var r=this;return e<1/0?new DexiePromise((function(n,o){var i=setTimeout((function(){return o(new O.Timeout(t))}),e);r.then(n,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&setProp(DexiePromise.prototype,Symbol.toStringTag,"Dexie.Promise"),H.env=snapShot(),props(DexiePromise,{all:function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t,r){0===e.length&&t([]);var n=e.length;e.forEach((function(o,i){return DexiePromise.resolve(o).then((function(r){e[i]=r,--n||t(e)}),r)}))}))},resolve:function(e){if(e instanceof DexiePromise)return e;if(e&&"function"==typeof e.then)return new DexiePromise((function(t,r){e.then(t,r)}));var t=new DexiePromise(j,!0,e);return linkToPreviousPromise(t,U),t},reject:PromiseReject,race:function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t,r){e.map((function(e){return DexiePromise.resolve(e).then(t,r)}))}))},PSD:{get:function(){return Y},set:function(e){return Y=e}},totalEchoes:{get:function(){return ne}},newPSD:newScope,usePSD,scheduler:{get:function(){return asap$1},set:function(e){asap$1=e}},rejectionMapper:{get:function(){return z},set:function(e){z=e}},follow:function(e,t){return new DexiePromise((function(r,n){return newScope((function(t,r){var n=Y;n.unhandleds=[],n.onunhandled=r,n.finalize=callBoth((function(){var e=this;!function run_at_end_of_this_or_next_physical_tick(e){function finalizer(){e(),X.splice(X.indexOf(finalizer),1)}X.push(finalizer),++Q,asap$1((function(){0==--Q&&finalizePhysicalTick()}),[])}((function(){0===e.unhandleds.length?t():r(e.unhandleds[0])}))}),n.finalize),e()}),t,r,n)}))}}),M&&(M.allSettled&&setProp(DexiePromise,"allSettled",(function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t){0===e.length&&t([]);var r=e.length,n=new Array(r);e.forEach((function(e,o){return DexiePromise.resolve(e).then((function(e){return n[o]={status:"fulfilled",value:e}}),(function(e){return n[o]={status:"rejected",reason:e}})).then((function(){return--r||t(n)}))}))}))})),M.any&&"undefined"!=typeof AggregateError&&setProp(DexiePromise,"any",(function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t,r){0===e.length&&r(new AggregateError([]));var n=e.length,o=new Array(n);e.forEach((function(e,i){return DexiePromise.resolve(e).then((function(e){return t(e)}),(function(e){o[i]=e,--n||r(new AggregateError(o))}))}))}))})));var J={awaits:0,echoes:0,id:0},ee=0,te=[],re=0,ne=0,oe=0;function newScope(e,t,r,n){var o=Y,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++oe;var a=H.env;i.env=B?{Promise:DexiePromise,PromiseProp:{value:DexiePromise,configurable:!0,writable:!0},all:DexiePromise.all,race:DexiePromise.race,allSettled:DexiePromise.allSettled,any:DexiePromise.any,resolve:DexiePromise.resolve,reject:DexiePromise.reject,nthen:getPatchedPromiseThen(a.nthen,i),gthen:getPatchedPromiseThen(a.gthen,i)}:{},t&&extend(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=usePSD(i,e,r,n);return 0===i.ref&&i.finalize(),u}function incrementExpectedAwaits(){return J.id||(J.id=++ee),++J.awaits,J.echoes+=100,J.id}function decrementExpectedAwaits(){return!!J.awaits&&(0==--J.awaits&&(J.id=0),J.echoes=100*J.awaits,!0)}function onPossibleParallellAsync(e){return J.echoes&&e&&e.constructor===M?(incrementExpectedAwaits(),e.then((function(e){return decrementExpectedAwaits(),e}),(function(e){return decrementExpectedAwaits(),ae(e)}))):e}function zoneEnterEcho(e){++ne,J.echoes&&0!=--J.echoes||(J.echoes=J.id=0),te.push(Y),switchToZone(e,!0)}function zoneLeaveEcho(){var e=te[te.length-1];te.pop(),switchToZone(e,!1)}function switchToZone(e,t){var r=Y;if((t?!J.echoes||re++&&e===Y:!re||--re&&e===Y)||enqueueNativeMicroTask(t?zoneEnterEcho.bind(null,e):zoneLeaveEcho),e!==Y&&(Y=e,r===H&&(H.env=snapShot()),B)){var n=H.env.Promise,i=e.env;I.then=i.nthen,n.prototype.then=i.gthen,(r.global||e.global)&&(Object.defineProperty(o,"Promise",i.PromiseProp),n.all=i.all,n.race=i.race,n.resolve=i.resolve,n.reject=i.reject,i.allSettled&&(n.allSettled=i.allSettled),i.any&&(n.any=i.any))}}function snapShot(){var e=o.Promise;return B?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(o,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:I.then,gthen:e.prototype.then}:{}}function usePSD(e,t,r,n,o){var i=Y;try{return switchToZone(e,!0),t(r,n,o)}finally{switchToZone(i,!1)}}function enqueueNativeMicroTask(e){K.call(A,e)}function nativeAwaitCompatibleWrap(e,t,r,n){return"function"!=typeof e?e:function(){var o=Y;r&&incrementExpectedAwaits(),switchToZone(t,!0);try{return e.apply(this,arguments)}finally{switchToZone(o,!1),n&&enqueueNativeMicroTask(decrementExpectedAwaits)}}}function getPatchedPromiseThen(e,t){return function(r,n){return e.call(this,nativeAwaitCompatibleWrap(r,t),nativeAwaitCompatibleWrap(n,t))}}-1===(""+K).indexOf("[native code]")&&(incrementExpectedAwaits=decrementExpectedAwaits=nop);var ie="unhandledrejection";function globalError(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,i={promise:t,reason:e};if(o.document&&document.createEvent?((n=document.createEvent("Event")).initEvent(ie,!0,!0),extend(n,i)):o.CustomEvent&&extend(n=new CustomEvent(ie,{detail:i}),i),n&&o.dispatchEvent&&(dispatchEvent(n),!o.PromiseRejectionEvent&&o.onunhandledrejection))try{o.onunhandledrejection(n)}catch(e){}w&&n&&!n.defaultPrevented&&console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var ae=DexiePromise.reject;function tempTransaction(e,t,r,n){if(e._state.openComplete||Y.letThrough){var o=e._createTransaction(t,r,e._dbSchema);try{o.create()}catch(e){return ae(e)}return o._promise(t,(function(e,t){return newScope((function(){return Y.trans=o,n(e,t,o)}))})).then((function(e){return o._completion.then((function(){return e}))}))}if(!e._state.isBeingOpened){if(!e._options.autoOpen)return ae(new O.DatabaseClosed);e.open().catch(nop)}return e._state.dbReadyPromise.then((function(){return tempTransaction(e,t,r,n)}))}var ue="3.0.3",ce=String.fromCharCode(65535),se=-1/0,le="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",fe="String expected.",pe=[],he="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),de=he,ye=he,dexieStackFrameFilter=function(e){return!/(dexie\\.js|dexie\\.min\\.js)/.test(e)},ve="__dbnames",me="readonly",ge="readwrite";function combine(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var be={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function workaroundForUndefinedPrimKey(e){return function(t){return void 0===getByKeyPath(t,e)&&delByKeyPath(t=deepClone(t),e),t}}var we=function(){function Table(){}return Table.prototype._trans=function(e,t,r){var n=this._tx||Y.trans,o=this.name;function checkTableInTransaction(e,r,n){if(!n.schema[o])throw new O.NotFound("Table "+o+" not part of transaction");return t(n.idbtrans,n)}var i=beginMicroTickScope();try{return n&&n.db===this.db?n===Y.trans?n._promise(e,checkTableInTransaction,r):newScope((function(){return n._promise(e,checkTableInTransaction,r)}),{trans:n,transless:Y.transless||Y}):tempTransaction(this.db,e,[this.name],checkTableInTransaction)}finally{i&&endMicroTickScope()}},Table.prototype.get=function(e,t){var r=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(function(t){return r.core.get({trans:t,key:e}).then((function(e){return r.hook.reading.fire(e)}))})).then(t)},Table.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(n(e))return new this.db.WhereClause(this,"["+e.join("+")+"]");var t=r(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var o=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&t.every((function(t){return e.keyPath.indexOf(t)>=0}))&&e.keyPath.every((function(e){return t.indexOf(e)>=0}))}))[0];if(o&&this.db._maxKey!==ce)return this.where(o.name).equals(o.keyPath.map((function(t){return e[t]})));!o&&w&&console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var i=this.schema.idxByName,a=this.db._deps.indexedDB;function equals(e,t){try{return 0===a.cmp(e,t)}catch(e){return!1}}var u=t.reduce((function(t,r){var o=t[0],a=t[1],u=i[r],s=e[r];return[o||u,o||!u?combine(a,u&&u.multi?function(e){var t=getByKeyPath(e,r);return n(t)&&t.some((function(e){return equals(s,e)}))}:function(e){return equals(s,getByKeyPath(e,r))}):a]}),[null,null]),s=u[0],l=u[1];return s?this.where(s.name).equals(e[s.keyPath]).filter(l):o?this.filter(l):this.where(t).equals("")},Table.prototype.filter=function(e){return this.toCollection().and(e)},Table.prototype.count=function(e){return this.toCollection().count(e)},Table.prototype.offset=function(e){return this.toCollection().offset(e)},Table.prototype.limit=function(e){return this.toCollection().limit(e)},Table.prototype.each=function(e){return this.toCollection().each(e)},Table.prototype.toArray=function(e){return this.toCollection().toArray(e)},Table.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Table.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,n(e)?"["+e.join("+")+"]":e))},Table.prototype.reverse=function(){return this.toCollection().reverse()},Table.prototype.mapToClass=function(e){this.schema.mappedClass=e;var readHook=function(t){if(!t)return t;var r=Object.create(e.prototype);for(var n in t)if(hasOwn(t,n))try{r[n]=t[n]}catch(e){}return r};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=readHook,this.hook("reading",readHook),e},Table.prototype.defineClass=function(){return this.mapToClass((function Class(e){extend(this,e)}))},Table.prototype.add=function(e,t){var r=this,n=this.schema.primKey,o=n.auto,i=n.keyPath,a=e;return i&&o&&(a=workaroundForUndefinedPrimKey(i)(e)),this._trans("readwrite",(function(e){return r.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{setByKeyPath(e,i,t)}catch(e){}return t}))},Table.prototype.update=function(e,t){if("object"!=typeof t||n(t))throw new O.InvalidArgument("Modifications must be an object.");if("object"!=typeof e||n(e))return this.where(":id").equals(e).modify(t);r(t).forEach((function(r){setByKeyPath(e,r,t[r])}));var o=getByKeyPath(e,this.schema.primKey.keyPath);return void 0===o?ae(new O.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(o).modify(t)},Table.prototype.put=function(e,t){var r=this,n=this.schema.primKey,o=n.auto,i=n.keyPath,a=e;return i&&o&&(a=workaroundForUndefinedPrimKey(i)(e)),this._trans("readwrite",(function(e){return r.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{setByKeyPath(e,i,t)}catch(e){}return t}))},Table.prototype.delete=function(e){var t=this;return this._trans("readwrite",(function(r){return t.core.mutate({trans:r,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):void 0}))},Table.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:be})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):void 0}))},Table.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",(function(r){return t.core.getMany({keys:e,trans:r}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))},Table.prototype.bulkAdd=function(e,t,r){var n=this,o=Array.isArray(t)?t:void 0,i=(r=r||(o?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(function(t){var r=n.schema.primKey,a=r.auto,u=r.keyPath;if(u&&o)throw new O.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new O.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,l=u&&a?e.map(workaroundForUndefinedPrimKey(u)):e;return n.core.mutate({trans:t,type:"add",keys:o,values:l,wantResults:i}).then((function(e){var t=e.numFailures,r=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?r:o;throw new BulkError(n.name+".bulkAdd(): "+t+" of "+s+" operations failed",Object.keys(a).map((function(e){return a[e]})))}))}))},Table.prototype.bulkPut=function(e,t,r){var n=this,o=Array.isArray(t)?t:void 0,i=(r=r||(o?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(function(t){var r=n.schema.primKey,a=r.auto,u=r.keyPath;if(u&&o)throw new O.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new O.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,l=u&&a?e.map(workaroundForUndefinedPrimKey(u)):e;return n.core.mutate({trans:t,type:"put",keys:o,values:l,wantResults:i}).then((function(e){var t=e.numFailures,r=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?r:o;throw new BulkError(n.name+".bulkPut(): "+t+" of "+s+" operations failed",Object.keys(a).map((function(e){return a[e]})))}))}))},Table.prototype.bulkDelete=function(e){var t=this,r=e.length;return this._trans("readwrite",(function(r){return t.core.mutate({trans:r,type:"delete",keys:e})})).then((function(e){var n=e.numFailures,o=e.lastResult,i=e.failures;if(0===n)return o;throw new BulkError(t.name+".bulkDelete(): "+n+" of "+r+" operations failed",i)}))},Table}();function Events(e){var t={},rv=function(r,n){if(n){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return t[r].subscribe.apply(null,i),e}if("string"==typeof r)return t[r]};rv.addEventType=add;for(var o=1,i=arguments.length;o<i;++o)add(arguments[o]);return rv;function add(e,r,n){if("object"==typeof e)return addConfiguredEvents(e);r||(r=reverseStoppableEventChain),n||(n=nop);var o={subscribers:[],fire:n,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=r(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(r,n)}};return t[e]=rv[e]=o,o}function addConfiguredEvents(e){r(e).forEach((function(t){var r=e[t];if(n(r))add(t,e[t][0],e[t][1]);else{if("asap"!==r)throw new O.InvalidArgument("Invalid event config");var o=add(t,mirror,(function fire(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];o.subscribers.forEach((function(e){asap((function fireEvent(){e.apply(null,t)}))}))}))}}))}}function makeClassConstructor(e,t){return derive(t).from({prototype:e}),t}function isPlainKeyRange(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function addFilter(e,t){e.filter=combine(e.filter,t)}function addReplayFilter(e,t,r){var n=e.replayFilter;e.replayFilter=n?function(){return combine(n(),t())}:t,e.justLimit=r&&!n}function getIndexOrStore(e,t){if(e.isPrimKey)return t.primaryKey;var r=t.getIndexByKeyPath(e.index);if(!r)throw new O.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function openCursor(e,t,r){var n=getIndexOrStore(e,t.schema);return t.openCursor({trans:r,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:n,range:e.range}})}function iter(e,t,r,n){var o=e.replayFilter?combine(e.filter,e.replayFilter()):e.filter;if(e.or){var i={},union=function(e,r,n){if(!o||o(r,n,(function(e){return r.stop(e)}),(function(e){return r.fail(e)}))){var a=r.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),hasOwn(i,u)||(i[u]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(union,r),iterate(openCursor(e,n,r),e.algorithm,union,!e.keysOnly&&e.valueMapper)])}return iterate(openCursor(e,n,r),combine(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function iterate(e,t,r,n){var o=wrap(n?function(e,t,o){return r(n(e),t,o)}:r);return e.then((function(e){if(e)return e.start((function(){var c=function(){return e.continue()};t&&!t(e,(function(e){return c=e}),(function(t){e.stop(t),c=nop}),(function(t){e.fail(t),c=nop}))||o(e.value,e,(function(e){return c=e})),c()}))}))}var _e=function(){function Collection(){}return Collection.prototype._read=function(e,t){var r=this._ctx;return r.error?r.table._trans(null,ae.bind(null,r.error)):r.table._trans("readonly",e).then(t)},Collection.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,ae.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},Collection.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=combine(t.algorithm,e)},Collection.prototype._iterate=function(e,t){return iter(this._ctx,e,t,this._ctx.table.core)},Collection.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&extend(r,e),t._ctx=r,t},Collection.prototype.raw=function(){return this._ctx.valueMapper=null,this},Collection.prototype.each=function(e){var t=this._ctx;return this._read((function(r){return iter(t,e,r,t.table.core)}))},Collection.prototype.count=function(e){var t=this;return this._read((function(e){var r=t._ctx,n=r.table.core;if(isPlainKeyRange(r,!0))return n.count({trans:e,query:{index:getIndexOrStore(r,n.schema),range:r.range}}).then((function(e){return Math.min(e,r.limit)}));var o=0;return iter(r,(function(){return++o,!1}),e,n).then((function(){return o}))})).then(e)},Collection.prototype.sortBy=function(e,t){var r=e.split(".").reverse(),n=r[0],o=r.length-1;function getval(e,t){return t?getval(e[r[t]],t-1):e[n]}var i="next"===this._ctx.dir?1:-1;function sorter(e,t){var r=getval(e,o),n=getval(t,o);return r<n?-i:r>n?i:0}return this.toArray((function(e){return e.sort(sorter)})).then(t)},Collection.prototype.toArray=function(e){var t=this;return this._read((function(e){var r=t._ctx;if("next"===r.dir&&isPlainKeyRange(r,!0)&&r.limit>0){var n=r.valueMapper,o=getIndexOrStore(r,r.table.core.schema);return r.table.core.query({trans:e,limit:r.limit,values:!0,query:{index:o,range:r.range}}).then((function(e){var t=e.result;return n?t.map(n):t}))}var i=[];return iter(r,(function(e){return i.push(e)}),e,r.table.core).then((function(){return i}))}),e)},Collection.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,isPlainKeyRange(t)?addReplayFilter(t,(function(){var t=e;return function(e,r){return 0===t||(1===t?(--t,!1):(r((function(){e.advance(t),t=0})),!1))}})):addReplayFilter(t,(function(){var t=e;return function(){return--t<0}}))),this},Collection.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),addReplayFilter(this._ctx,(function(){var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}}),!0),this},Collection.prototype.until=function(e,t){return addFilter(this._ctx,(function(r,n,o){return!e(r.value)||(n(o),t)})),this},Collection.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},Collection.prototype.last=function(e){return this.reverse().first(e)},Collection.prototype.filter=function(e){return addFilter(this._ctx,(function(t){return e(t.value)})),function addMatchFilter(e,t){e.isMatch=combine(e.isMatch,t)}(this._ctx,e),this},Collection.prototype.and=function(e){return this.filter(e)},Collection.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},Collection.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Collection.prototype.desc=function(){return this.reverse()},Collection.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.key,r)}))},Collection.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},Collection.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.primaryKey,r)}))},Collection.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.key)})).then((function(){return r})).then(e)},Collection.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&isPlainKeyRange(t,!0)&&t.limit>0)return this._read((function(e){var r=getIndexOrStore(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:r,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.primaryKey)})).then((function(){return r})).then(e)},Collection.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},Collection.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},Collection.prototype.lastKey=function(e){return this.reverse().firstKey(e)},Collection.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var r={};return addFilter(this._ctx,(function(e){var t=e.primaryKey.toString(),n=hasOwn(r,t);return r[t]=!0,!n})),this},Collection.prototype.modify=function(e){var t=this,n=this._ctx;return this._write((function(o){var i;if("function"==typeof e)i=e;else{var a=r(e),u=a.length;i=function(t){for(var r=!1,n=0;n<u;++n){var o=a[n],i=e[o];getByKeyPath(t,o)!==i&&(setByKeyPath(t,o,i),r=!0)}return r}}var s=n.table.core,l=s.schema.primaryKey,f=l.outbound,p=l.extractKey,h="testmode"in Ce?1:2e3,d=t.db.core.cmp,y=[],v=0,m=[],applyMutateResult=function(e,t){var n=t.failures,o=t.numFailures;v+=e-o;for(var i=0,a=r(n);i<a.length;i++){var u=a[i];y.push(n[u])}};return t.clone().primaryKeys().then((function(e){var nextChunk=function(t){var r=Math.min(h,e.length-t);return s.getMany({trans:o,keys:e.slice(t,t+r)}).then((function(n){for(var a=[],u=[],l=f?[]:null,y=[],v=0;v<r;++v){var m=n[v],g={value:deepClone(m),primKey:e[t+v]};!1!==i.call(g,g.value,g)&&(null==g.value?y.push(e[t+v]):f||0===d(p(m),p(g.value))?(u.push(g.value),f&&l.push(e[t+v])):(y.push(e[t+v]),a.push(g.value)))}return Promise.resolve(a.length>0&&s.mutate({trans:o,type:"add",values:a}).then((function(e){for(var t in e.failures)y.splice(parseInt(t),1);applyMutateResult(a.length,e)}))).then((function(e){return u.length>0&&s.mutate({trans:o,type:"put",keys:l,values:u}).then((function(e){return applyMutateResult(u.length,e)}))})).then((function(){return y.length>0&&s.mutate({trans:o,type:"delete",keys:y}).then((function(e){return applyMutateResult(y.length,e)}))})).then((function(){return e.length>t+r&&nextChunk(t+h)}))}))};return nextChunk(0).then((function(){if(y.length>0)throw new ModifyError("Error modifying one or more objects",y,v,m);return e.length}))}))}))},Collection.prototype.delete=function(){var e=this._ctx,t=e.range;return isPlainKeyRange(e)&&(e.isPrimKey&&!ye||3===t.type)?this._write((function(r){var n=e.table.core.schema.primaryKey,o=t;return e.table.core.count({trans:r,query:{index:n,range:o}}).then((function(t){return e.table.core.mutate({trans:r,type:"deleteRange",range:o}).then((function(e){var r=e.failures,n=(e.lastResult,e.results,e.numFailures);if(n)throw new ModifyError("Could not delete some values",Object.keys(r).map((function(e){return r[e]})),t-n);return t-n}))}))})):this.modify((function(e,t){return t.value=null}))},Collection}();function simpleCompare(e,t){return e<t?-1:e===t?0:1}function simpleCompareReverse(e,t){return e>t?-1:e===t?0:1}function fail(e,t,r){var n=e instanceof xe?new e.Collection(e):e;return n._ctx.error=r?new r(t):new TypeError(t),n}function emptyCollection(e){return new e.Collection(e,(function(){return rangeEqual("")})).limit(0)}function nextCasing(e,t,r,n,o,i){for(var a=Math.min(e.length,n.length),u=-1,s=0;s<a;++s){var l=t[s];if(l!==n[s])return o(e[s],r[s])<0?e.substr(0,s)+r[s]+r.substr(s+1):o(e[s],n[s])<0?e.substr(0,s)+n[s]+r.substr(s+1):u>=0?e.substr(0,u)+t[u]+r.substr(u+1):null;o(e[s],l)<0&&(u=s)}return a<n.length&&"next"===i?e+r.substr(e.length):a<e.length&&"prev"===i?e.substr(0,r.length):u<0?null:e.substr(0,u)+n[u]+r.substr(u+1)}function addIgnoreCaseAlgorithm(e,t,r,n){var o,i,a,u,s,l,f,p=r.length;if(!r.every((function(e){return"string"==typeof e})))return fail(e,fe);function initDirection(e){o=function upperFactory(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),i=function lowerFactory(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),a="next"===e?simpleCompare:simpleCompareReverse;var t=r.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),s=t.map((function(e){return e.lower})),l=e,f="next"===e?"":n}initDirection("next");var h=new e.Collection(e,(function(){return createRange(u[0],s[p-1]+n)}));h._ondirectionchange=function(e){initDirection(e)};var d=0;return h._addAlgorithm((function(e,r,n){var o=e.key;if("string"!=typeof o)return!1;var h=i(o);if(t(h,s,d))return!0;for(var y=null,v=d;v<p;++v){var m=nextCasing(o,h,u[v],s[v],a,l);null===m&&null===y?d=v+1:(null===y||a(y,m)>0)&&(y=m)}return r(null!==y?function(){e.continue(y+f)}:n),!1})),h}function createRange(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function rangeEqual(e){return{type:1,lower:e,upper:e}}var xe=function(){function WhereClause(){}return Object.defineProperty(WhereClause.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),WhereClause.prototype.between=function(e,t,r,n){r=!1!==r,n=!0===n;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(r||n)&&(!r||!n)?emptyCollection(this):new this.Collection(this,(function(){return createRange(e,t,!r,!n)}))}catch(e){return fail(this,le)}},WhereClause.prototype.equals=function(e){return null==e?fail(this,le):new this.Collection(this,(function(){return rangeEqual(e)}))},WhereClause.prototype.above=function(e){return null==e?fail(this,le):new this.Collection(this,(function(){return createRange(e,void 0,!0)}))},WhereClause.prototype.aboveOrEqual=function(e){return null==e?fail(this,le):new this.Collection(this,(function(){return createRange(e,void 0,!1)}))},WhereClause.prototype.below=function(e){return null==e?fail(this,le):new this.Collection(this,(function(){return createRange(void 0,e,!1,!0)}))},WhereClause.prototype.belowOrEqual=function(e){return null==e?fail(this,le):new this.Collection(this,(function(){return createRange(void 0,e)}))},WhereClause.prototype.startsWith=function(e){return"string"!=typeof e?fail(this,fe):this.between(e,e+ce,!0,!0)},WhereClause.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):addIgnoreCaseAlgorithm(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],ce)},WhereClause.prototype.equalsIgnoreCase=function(e){return addIgnoreCaseAlgorithm(this,(function(e,t){return e===t[0]}),[e],"")},WhereClause.prototype.anyOfIgnoreCase=function(){var e=getArrayOf.apply(g,arguments);return 0===e.length?emptyCollection(this):addIgnoreCaseAlgorithm(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},WhereClause.prototype.startsWithAnyOfIgnoreCase=function(){var e=getArrayOf.apply(g,arguments);return 0===e.length?emptyCollection(this):addIgnoreCaseAlgorithm(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,ce)},WhereClause.prototype.anyOf=function(){var e=this,t=getArrayOf.apply(g,arguments),r=this._cmp;try{t.sort(r)}catch(e){return fail(this,le)}if(0===t.length)return emptyCollection(this);var n=new this.Collection(this,(function(){return createRange(t[0],t[t.length-1])}));n._ondirectionchange=function(n){r="next"===n?e._ascending:e._descending,t.sort(r)};var o=0;return n._addAlgorithm((function(e,n,i){for(var a=e.key;r(a,t[o])>0;)if(++o===t.length)return n(i),!1;return 0===r(a,t[o])||(n((function(){e.continue(t[o])})),!1)})),n},WhereClause.prototype.notEqual=function(e){return this.inAnyRange([[se,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},WhereClause.prototype.noneOf=function(){var e=getArrayOf.apply(g,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return fail(this,le)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[se,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},WhereClause.prototype.inAnyRange=function(e,t){var r=this,n=this._cmp,o=this._ascending,i=this._descending,a=this._min,u=this._max;if(0===e.length)return emptyCollection(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&o(e[0],e[1])<=0})))return fail(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",O.InvalidArgument);var s=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers;var f,p=o;function rangeSorter(e,t){return p(e[0],t[0])}try{f=e.reduce((function addRange(e,t){for(var r=0,o=e.length;r<o;++r){var i=e[r];if(n(t[0],i[1])<0&&n(t[1],i[0])>0){i[0]=a(i[0],t[0]),i[1]=u(i[1],t[1]);break}}return r===o&&e.push(t),e}),[]),f.sort(rangeSorter)}catch(e){return fail(this,le)}var h=0,d=l?function(e){return o(e,f[h][1])>0}:function(e){return o(e,f[h][1])>=0},y=s?function(e){return i(e,f[h][0])>0}:function(e){return i(e,f[h][0])>=0};var v=d,m=new this.Collection(this,(function(){return createRange(f[0][0],f[f.length-1][1],!s,!l)}));return m._ondirectionchange=function(e){"next"===e?(v=d,p=o):(v=y,p=i),f.sort(rangeSorter)},m._addAlgorithm((function(e,t,n){for(var i=e.key;v(i);)if(++h===f.length)return t(n),!1;return!!function keyWithinCurrentRange(e){return!d(e)&&!y(e)}(i)||(0===r._cmp(i,f[h][1])||0===r._cmp(i,f[h][0])||t((function(){p===o?e.continue(f[h][0]):e.continue(f[h][1])})),!1)})),m},WhereClause.prototype.startsWithAnyOf=function(){var e=getArrayOf.apply(g,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?emptyCollection(this):this.inAnyRange(e.map((function(e){return[e,e+ce]}))):fail(this,"startsWithAnyOf() only works with strings")},WhereClause}();function safariMultiStoreFix(e){return 1===e.length?e[0]:e}function getMaxKey(e){try{return e.only([[]]),[[]]}catch(e){return ce}}function eventRejectHandler(e){return wrap((function(t){return preventDefault(t),e(t.target.error),!1}))}function preventDefault(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Pe=function(){function Transaction(){}return Transaction.prototype._lock=function(){return assert(!Y.global),++this._reculock,1!==this._reculock||Y.global||(Y.lockOwnerFor=this),this},Transaction.prototype._unlock=function(){if(assert(!Y.global),0==--this._reculock)for(Y.global||(Y.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{usePSD(e[1],e[0])}catch(e){}}return this},Transaction.prototype._locked=function(){return this._reculock&&Y.lockOwnerFor!==this},Transaction.prototype.create=function(e){var t=this;if(!this.mode)return this;var r=this.db.idbdb,n=this.db._state.dbOpenError;if(assert(!this.idbtrans),!e&&!r)switch(n&&n.name){case"DatabaseClosedError":throw new O.DatabaseClosed(n);case"MissingAPIError":throw new O.MissingAPI(n.message,n);default:throw new O.OpenFailed(n)}if(!this.active)throw new O.TransactionInactive;return assert(null===this._completion._state),(e=this.idbtrans=e||r.transaction(safariMultiStoreFix(this.storeNames),this.mode)).onerror=wrap((function(r){preventDefault(r),t._reject(e.error)})),e.onabort=wrap((function(r){preventDefault(r),t.active&&t._reject(new O.Abort(e.error)),t.active=!1,t.on("abort").fire(r)})),e.oncomplete=wrap((function(){t.active=!1,t._resolve()})),this},Transaction.prototype._promise=function(e,t,r){var n=this;if("readwrite"===e&&"readwrite"!==this.mode)return ae(new O.ReadOnly("Transaction is readonly"));if(!this.active)return ae(new O.TransactionInactive);if(this._locked())return new DexiePromise((function(o,i){n._blockedFuncs.push([function(){n._promise(e,t,r).then(o,i)},Y])}));if(r)return newScope((function(){var e=new DexiePromise((function(e,r){n._lock();var o=t(e,r,n);o&&o.then&&o.then(e,r)}));return e.finally((function(){return n._unlock()})),e._lib=!0,e}));var o=new DexiePromise((function(e,r){var o=t(e,r,n);o&&o.then&&o.then(e,r)}));return o._lib=!0,o},Transaction.prototype._root=function(){return this.parent?this.parent._root():this},Transaction.prototype.waitFor=function(e){var t=this._root(),r=DexiePromise.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return r}));else{t._waitingFor=r,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function spin(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=spin)}()}var o=t._waitingFor;return new DexiePromise((function(e,n){r.then((function(r){return t._waitingQueue.push(wrap(e.bind(null,r)))}),(function(e){return t._waitingQueue.push(wrap(n.bind(null,e)))})).finally((function(){t._waitingFor===o&&(t._waitingFor=null)}))}))},Transaction.prototype.abort=function(){this.active&&this._reject(new O.Abort),this.active=!1},Transaction.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(hasOwn(t,e))return t[e];var r=this.schema[e];if(!r)throw new O.NotFound("Table "+e+" not part of transaction");var n=new this.db.Table(e,r,this);return n.core=this.db.core.table(e),t[e]=n,n},Transaction}();function createIndexSpec(e,t,r,n,o,i,a){return{name:e,keyPath:t,unique:r,multi:n,auto:o,compound:i,src:(r&&!a?"&":"")+(n?"*":"")+(o?"++":"")+nameFromKeyPath(t)}}function nameFromKeyPath(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function createTableSchema(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:arrayToObject(r,(function(e){return[e.name,e]}))}}function getKeyExtractor(e){return null==e?function(){}:"string"==typeof e?function getSinglePathKeyExtractor(e){var t=e.split(".");return 1===t.length?function(t){return t[e]}:function(t){return getByKeyPath(t,e)}}(e):function(t){return getByKeyPath(t,e)}}function getEffectiveKeys(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}function arrayify(e){return[].slice.call(e)}var ke=0;function getKeyPathAlias(e){return null==e?":id":"string"==typeof e?e:"["+e.join("+")+"]"}function createDBCore(e,t,r,o){var i=t.cmp.bind(t);function makeIDBKeyRange(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var t=e.lower,n=e.upper,o=e.lowerOpen,i=e.upperOpen;return void 0===t?void 0===n?null:r.upperBound(n,!!i):void 0===n?r.lowerBound(t,!!o):r.bound(t,n,!!o,!!i)}var a=function extractSchema(e,t){var r=arrayify(e.objectStoreNames);return{schema:{name:e.name,tables:r.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,r=e.autoIncrement,o=n(t),i=null==t,a={},u={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:o,keyPath:t,autoIncrement:r,unique:!0,extractKey:getKeyExtractor(t)},indexes:arrayify(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,r=e.unique,o=e.multiEntry,i=e.keyPath,u={name:t,compound:n(i),keyPath:i,unique:r,multiEntry:o,extractKey:getKeyExtractor(i)};return a[getKeyPathAlias(i)]=u,u})),getIndexByKeyPath:function(e){return a[getKeyPathAlias(e)]}};return a[":id"]=u.primaryKey,null!=t&&(a[getKeyPathAlias(t)]=u.primaryKey),u}))},hasGetAll:r.length>0&&"getAll"in t.objectStore(r[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\\/|Edge\\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\\/(\\d*)/))[1]<604)}}(e,o),u=a.schema,s=a.hasGetAll,l=u.tables.map((function(e){return function createDbCoreTable(e){var t=e.name;return{name:t,schema:e,mutate:function mutate(r){var n=r.trans,o=r.type,i=r.keys,a=r.values,u=r.range,s=r.wantResults;return new Promise((function(r,l){r=wrap(r);var f=n.objectStore(t),p=null==f.keyPath,h="put"===o||"add"===o;if(!h&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var d=(i||a||{length:1}).length;if(i&&a&&i.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return r({numFailures:0,failures:{},results:[],lastResult:void 0});var y,v=s&&__spreadArrays(i||getEffectiveKeys(e.primaryKey,{type:o,keys:i,values:a})),m=[],g=0,errorHandler=function(e){++g,preventDefault(e),v&&(v[e.target._reqno]=void 0),m[e.target._reqno]=e.target.error},setResult=function(e){var t=e.target;v[t._reqno]=t.result};if("deleteRange"===o){if(4===u.type)return r({numFailures:g,failures:m,results:v,lastResult:void 0});y=3===u.type?f.clear():f.delete(makeIDBKeyRange(u))}else{var b=h?p?[a,i]:[a,null]:[i,null],w=b[0],_=b[1];if(h)for(var x=0;x<d;++x)(y=_&&void 0!==_[x]?f[o](w[x],_[x]):f[o](w[x]))._reqno=x,v&&void 0===v[x]&&(y.onsuccess=setResult),y.onerror=errorHandler;else for(x=0;x<d;++x)(y=f[o](w[x]))._reqno=x,y.onerror=errorHandler}var done=function(e){var t=e.target.result;v&&(v[d-1]=t),r({numFailures:g,failures:m,results:v,lastResult:t})};y.onerror=function(e){errorHandler(e),done(e)},y.onsuccess=done}))},getMany:function(e){var r=e.trans,n=e.keys;return new Promise((function(e,o){e=wrap(e);for(var i,a=r.objectStore(t),u=n.length,s=new Array(u),l=0,f=0,successHandler=function(t){var r=t.target;s[r._pos]=r.result,++f===l&&e(s)},p=eventRejectHandler(o),h=0;h<u;++h)null!=n[h]&&((i=a.get(n[h]))._pos=h,i.onsuccess=successHandler,i.onerror=p,++l);0===l&&e(s)}))},get:function(e){var r=e.trans,n=e.key;return new Promise((function(e,o){e=wrap(e);var i=r.objectStore(t).get(n);i.onsuccess=function(t){return e(t.target.result)},i.onerror=eventRejectHandler(o)}))},query:function query(e){return function(r){return new Promise((function(n,o){n=wrap(n);var i=r.trans,a=r.values,u=r.limit,s=r.query,l=u===1/0?void 0:u,f=s.index,p=s.range,h=i.objectStore(t),d=f.isPrimaryKey?h:h.index(f.name),y=makeIDBKeyRange(p);if(0===u)return n({result:[]});if(e){var v=a?d.getAll(y,l):d.getAllKeys(y,l);v.onsuccess=function(e){return n({result:e.target.result})},v.onerror=eventRejectHandler(o)}else{var m=0,g=a||!("openKeyCursor"in d)?d.openCursor(y):d.openKeyCursor(y),b=[];g.onsuccess=function(e){var t=g.result;return t?(b.push(a?t.value:t.primaryKey),++m===u?n({result:b}):void t.continue()):n({result:b})},g.onerror=eventRejectHandler(o)}}))}}(s),openCursor:function openCursor(e){var r=e.trans,n=e.values,o=e.query,i=e.reverse,a=e.unique;return new Promise((function(e,u){e=wrap(e);var s=o.index,l=o.range,f=r.objectStore(t),p=s.isPrimaryKey?f:f.index(s.name),h=i?a?"prevunique":"prev":a?"nextunique":"next",d=n||!("openKeyCursor"in p)?p.openCursor(makeIDBKeyRange(l),h):p.openKeyCursor(makeIDBKeyRange(l),h);d.onerror=eventRejectHandler(u),d.onsuccess=wrap((function(t){var n=d.result;if(n){n.___id=++ke,n.done=!1;var o=n.continue.bind(n),i=n.continuePrimaryKey;i&&(i=i.bind(n));var a=n.advance.bind(n),doThrowCursorIsStopped=function(){throw new Error("Cursor not stopped")};n.trans=r,n.stop=n.continue=n.continuePrimaryKey=n.advance=function(){throw new Error("Cursor not started")},n.fail=wrap(u),n.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},n.start=function(e){var t=new Promise((function(e,t){e=wrap(e),d.onerror=eventRejectHandler(t),n.fail=t,n.stop=function(t){n.stop=n.continue=n.continuePrimaryKey=n.advance=doThrowCursorIsStopped,e(t)}})),guardedCallback=function(){if(d.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=function(){throw new Error("Cursor behind last entry")},n.stop()};return d.onsuccess=wrap((function(e){d.onsuccess=guardedCallback,guardedCallback()})),n.continue=o,n.continuePrimaryKey=i,n.advance=a,guardedCallback(),t},e(n)}else e(null)}),u)}))},count:function(e){var r=e.query,n=e.trans,o=r.index,i=r.range;return new Promise((function(e,r){var a=n.objectStore(t),u=o.isPrimaryKey?a:a.index(o.name),s=makeIDBKeyRange(i),l=s?u.count(s):u.count();l.onsuccess=wrap((function(t){return e(t.target.result)})),l.onerror=eventRejectHandler(r)}))}}}(e)})),f={};return l.forEach((function(e){return f[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!f[e])throw new Error("Table \'"+e+"\' not found");return f[e]},cmp:i,MIN_KEY:-1/0,MAX_KEY:getMaxKey(r),schema:u}}function createMiddlewareStacks(e,t,r,n){var o=r.IDBKeyRange,i=function createMiddlewareStack(e,t){return t.reduce((function(e,t){var r=t.create;return __assign(__assign({},e),r(e))}),e)}(createDBCore(t,r.indexedDB,o,n),e.dbcore);return{dbcore:i}}function generateMiddlewareStacks(e,t){var r=t.db,n=createMiddlewareStacks(e._middlewares,r,e._deps,t);e.core=n.dbcore,e.tables.forEach((function(t){var r=t.name;e.core.schema.tables.some((function(e){return e.name===r}))&&(t.core=e.core.table(r),e[r]instanceof e.Table&&(e[r].core=t.core))}))}function setApiOnPlace(e,t,r,n){r.forEach((function(r){var o=n[r];t.forEach((function(t){var n=getPropertyDescriptor(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?setProp(t,r,{get:function(){return this.table(r)},set:function(e){u(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,o))}))}))}function removeTablesApi(e,t){t.forEach((function(t){for(var r in t)t[r]instanceof e.Table&&delete t[r]}))}function lowerVersionFirst(e,t){return e._cfg.version-t._cfg.version}function runUpgraders(e,t,n,o){var i=e._dbSchema,a=e._createTransaction("readwrite",e._storeNames,i);a.create(n),a._completion.catch(o);var u=a._reject.bind(a),s=Y.transless||Y;newScope((function(){Y.trans=a,Y.transless=s,0===t?(r(i).forEach((function(e){createTable(n,e,i[e].primKey,i[e].indexes)})),generateMiddlewareStacks(e,n),DexiePromise.follow((function(){return e.on.populate.fire(a)})).catch(u)):function updateTablesAndIndexes(e,t,n,o){var i=[],a=e._versions,u=e._dbSchema=buildGlobalSchema(e,e.idbdb,o),s=!1,l=a.filter((function(e){return e._cfg.version>=t}));function runQueue(){return i.length?DexiePromise.resolve(i.shift()(n.idbtrans)).then(runQueue):DexiePromise.resolve()}return l.forEach((function(a){i.push((function(){var i=u,l=a._cfg.dbschema;adjustToExistingIndexNames(e,i,o),adjustToExistingIndexNames(e,l,o),u=e._dbSchema=l;var f=getSchemaDiff(i,l);f.add.forEach((function(e){createTable(o,e[0],e[1].primKey,e[1].indexes)})),f.change.forEach((function(e){if(e.recreate)throw new O.Upgrade("Not yet support for changing primary key");var t=o.objectStore(e.name);e.add.forEach((function(e){return addIndex(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),addIndex(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var p=a._cfg.contentUpgrade;if(p&&a._cfg.version>t){generateMiddlewareStacks(e,o),n._memoizedTables={},s=!0;var h=shallowClone(l);f.del.forEach((function(e){h[e]=i[e]})),removeTablesApi(e,[e.Transaction.prototype]),setApiOnPlace(e,[e.Transaction.prototype],r(h),h),n.schema=h;var d,y=b(p);y&&incrementExpectedAwaits();var v=DexiePromise.follow((function(){if((d=p(n))&&y){var e=decrementExpectedAwaits.bind(null,null);d.then(e,e)}}));return d&&"function"==typeof d.then?DexiePromise.resolve(d):v.then((function(){return d}))}})),i.push((function(t){s&&de||function deleteRemovedTables(e,t){for(var r=0;r<t.db.objectStoreNames.length;++r){var n=t.db.objectStoreNames[r];null==e[n]&&t.db.deleteObjectStore(n)}}(a._cfg.dbschema,t);removeTablesApi(e,[e.Transaction.prototype]),setApiOnPlace(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),runQueue().then((function(){!function createMissingTables(e,t){r(e).forEach((function(r){t.db.objectStoreNames.contains(r)||createTable(t,r,e[r].primKey,e[r].indexes)}))}(u,o)}))}(e,t,a,n).catch(u)}))}function getSchemaDiff(e,t){var r,n={del:[],add:[],change:[]};for(r in e)t[r]||n.del.push(r);for(r in t){var o=e[r],i=t[r];if(o){var a={name:r,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!he)a.recreate=!0,n.change.push(a);else{var u=o.idxByName,s=i.idxByName,l=void 0;for(l in u)s[l]||a.del.push(l);for(l in s){var f=u[l],p=s[l];f?f.src!==p.src&&a.change.push(p):a.add.push(p)}(a.del.length>0||a.add.length>0||a.change.length>0)&&n.change.push(a)}}else n.add.push([r,i])}return n}function createTable(e,t,r,n){var o=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach((function(e){return addIndex(o,e)})),o}function addIndex(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function buildGlobalSchema(e,t,r){var n={};return slice(t.objectStoreNames,0).forEach((function(e){for(var t=r.objectStore(e),o=t.keyPath,i=createIndexSpec(nameFromKeyPath(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<t.indexNames.length;++u){var s=t.index(t.indexNames[u]);o=s.keyPath;var l=createIndexSpec(s.name,o,!!s.unique,!!s.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(l)}n[e]=createTableSchema(e,i,a)})),n}function adjustToExistingIndexNames(e,t,r){for(var n=r.db.objectStoreNames,i=0;i<n.length;++i){var a=n[i],u=r.objectStore(a);e._hasGetAll="getAll"in u;for(var s=0;s<u.indexNames.length;++s){var l=u.indexNames[s],f=u.index(l).keyPath,p="string"==typeof f?f:"["+slice(f).join("+")+"]";if(t[a]){var h=t[a].idxByName[p];h&&(h.name=l,delete t[a].idxByName[p],t[a].idxByName[l]=h)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\\/|Edge\\/)/.test(navigator.userAgent)&&o.WorkerGlobalScope&&o instanceof o.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\\/(\\d*)/))[1]<604&&(e._hasGetAll=!1)}var Se,Ee=function(){function Version(){}return Version.prototype._parseStoresSpec=function(e,t){r(e).forEach((function(r){if(null!==e[r]){var o=function parseIndexSyntax(e){return e.split(",").map((function(e,t){var r=(e=e.trim()).replace(/([&*]|\\+\\+)/g,""),o=/^\\[/.test(r)?r.match(/^\\[(.*)\\]$/)[1].split("+"):r;return createIndexSpec(r,o||null,/\\&/.test(e),/\\*/.test(e),/\\+\\+/.test(e),n(o),0===t)}))}(e[r]),i=o.shift();if(i.multi)throw new O.Schema("Primary key cannot be multi-valued");o.forEach((function(e){if(e.auto)throw new O.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new O.Schema("Index must have a name and cannot be an empty string")})),t[r]=createTableSchema(r,i,o)}}))},Version.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?extend(this._cfg.storesSource,e):e;var n=t._versions,o={},i={};return n.forEach((function(e){extend(o,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(o,i)})),t._dbSchema=i,removeTablesApi(t,[t._allTables,t,t.Transaction.prototype]),setApiOnPlace(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],r(i),i),t._storeNames=r(i),this},Version.prototype.upgrade=function(e){return this._cfg.contentUpgrade=e,this},Version}();function vip(e){return newScope((function(){return Y.letThrough=!0,e()}))}function dexieOpen(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?ae(t.dbOpenError):e}));w&&(t.openCanceller._stackHolder=getErrorWithStack()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var o=t.dbReadyResolve,i=null;return DexiePromise.race([t.openCanceller,new DexiePromise((function(o,a){if(!n)throw new O.MissingAPI("indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using old Safari versions, make sure to include indexedDB polyfill.");var u=e.name,s=t.autoSchema?n.open(u):n.open(u,Math.round(10*e.verno));if(!s)throw new O.MissingAPI("IndexedDB API not available");s.onerror=eventRejectHandler(a),s.onblocked=wrap(e._fireOnBlocked),s.onupgradeneeded=wrap((function(r){if(i=s.transaction,t.autoSchema&&!e._options.allowEmptyDB){s.onerror=preventDefault,i.abort(),s.result.close();var o=n.deleteDatabase(u);o.onsuccess=o.onerror=wrap((function(){a(new O.NoSuchDatabase("Database "+u+" doesnt exist"))}))}else{i.onerror=eventRejectHandler(a);var l=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;e.idbdb=s.result,runUpgraders(e,l/10,i,a)}}),a),s.onsuccess=wrap((function(){i=null;var n=e.idbdb=s.result,a=slice(n.objectStoreNames);if(a.length>0)try{var l=n.transaction(safariMultiStoreFix(a),"readonly");t.autoSchema?function readGlobalSchema(e,t,n){e.verno=t.version/10;var o=e._dbSchema=buildGlobalSchema(0,t,n);e._storeNames=slice(t.objectStoreNames,0),setApiOnPlace(e,[e._allTables],r(o),o)}(e,n,l):(adjustToExistingIndexNames(e,e._dbSchema,l),function verifyInstalledSchema(e,t){var r=getSchemaDiff(buildGlobalSchema(0,e.idbdb,t),e._dbSchema);return!(r.add.length||r.change.some((function(e){return e.add.length||e.change.length})))}(e,l)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),generateMiddlewareStacks(e,l)}catch(e){}pe.push(e),n.onversionchange=wrap((function(r){t.vcFired=!0,e.on("versionchange").fire(r)})),Se.add(u),o()}),a)}))]).then((function(){return t.onReadyBeingFired=[],DexiePromise.resolve(vip(e.on.ready.fire)).then((function fireRemainders(){if(t.onReadyBeingFired.length>0){var e=t.onReadyBeingFired.reduce(promisableChain,nop);return t.onReadyBeingFired=[],DexiePromise.resolve(vip(e)).then(fireRemainders)}}))})).finally((function(){t.onReadyBeingFired=null})).then((function(){return t.isBeingOpened=!1,e})).catch((function(r){try{i&&i.abort()}catch(e){}return t.isBeingOpened=!1,e.close(),t.dbOpenError=r,ae(t.dbOpenError)})).finally((function(){t.openComplete=!0,o()}))}function awaitIterator(e){var callNext=function(t){return e.next(t)},t=step(callNext),r=step((function(t){return e.throw(t)}));function step(e){return function(o){var i=e(o),a=i.value;return i.done?a:a&&"function"==typeof a.then?a.then(t,r):n(a)?Promise.all(a).then(t,r):t(a)}}return step(callNext)()}function extractTransactionArgs(e,t,r){var n=arguments.length;if(n<2)throw new O.InvalidArgument("Too few arguments");for(var o=new Array(n-1);--n;)o[n-1]=arguments[n];r=o.pop();var i=flatten(o);return[e,i,r]}function enterTransactionScope(e,t,r,n,o){return DexiePromise.resolve().then((function(){var i=Y.transless||Y,a=e._createTransaction(t,r,e._dbSchema,n),u={trans:a,transless:i};n?a.idbtrans=n.idbtrans:a.create();var s,l=b(o);l&&incrementExpectedAwaits();var f=DexiePromise.follow((function(){if(s=o.call(a,a))if(l){var e=decrementExpectedAwaits.bind(null,null);s.then(e,e)}else"function"==typeof s.next&&"function"==typeof s.throw&&(s=awaitIterator(s))}),u);return(s&&"function"==typeof s.then?DexiePromise.resolve(s).then((function(e){return a.active?e:ae(new O.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):f.then((function(){return s}))).then((function(e){return n&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),ae(e)}))}))}function pad(e,t,r){for(var o=n(e)?e.slice():[e],i=0;i<r;++i)o.push(t);return o}var Oe={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function createVirtualIndexMiddleware(e){return __assign(__assign({},e),{table:function(t){var r=e.table(t),n=r.schema,o={},i=[];function addVirtualIndexes(e,t,r){var n=getKeyPathAlias(e),a=o[n]=o[n]||[],u=null==e?0:"string"==typeof e?1:e.length,s=t>0,l=__assign(__assign({},r),{isVirtual:s,isPrimaryKey:!s&&r.isPrimaryKey,keyTail:t,keyLength:u,extractKey:getKeyExtractor(e),unique:!s&&r.unique});(a.push(l),l.isPrimaryKey||i.push(l),u>1)&&addVirtualIndexes(2===u?e[0]:e.slice(0,u-1),t+1,r);return a.sort((function(e,t){return e.keyTail-t.keyTail})),l}var a=addVirtualIndexes(n.primaryKey.keyPath,0,n.primaryKey);o[":id"]=[a];for(var u=0,s=n.indexes;u<s.length;u++){var l=s[u];addVirtualIndexes(l.keyPath,0,l)}function translateRequest(t){var r,n,o=t.query.index;return o.isVirtual?__assign(__assign({},t),{query:{index:o,range:(r=t.query.range,n=o.keyTail,{type:1===r.type?2:r.type,lower:pad(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:pad(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0})}}):t}var f=__assign(__assign({},r),{schema:__assign(__assign({},n),{primaryKey:a,indexes:i,getIndexByKeyPath:function findBestIndex(e){var t=o[getKeyPathAlias(e)];return t&&t[0]}}),count:function(e){return r.count(translateRequest(e))},query:function(e){return r.query(translateRequest(e))},openCursor:function(t){var n=t.query.index,o=n.keyTail,i=n.isVirtual,a=n.keyLength;if(!i)return r.openCursor(t);return r.openCursor(translateRequest(t)).then((function(r){return r&&function createVirtualCursor(r){var n=Object.create(r,{continue:{value:function _continue(n){null!=n?r.continue(pad(n,t.reverse?e.MAX_KEY:e.MIN_KEY,o)):t.unique?r.continue(pad(r.key,t.reverse?e.MIN_KEY:e.MAX_KEY,o)):r.continue()}},continuePrimaryKey:{value:function(t,n){r.continuePrimaryKey(pad(t,e.MAX_KEY,o),n)}},key:{get:function(){var e=r.key;return 1===a?e[0]:e.slice(0,a)}},value:{get:function(){return r.value}}});return n}(r)}))}});return f}})}},Te={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return __assign(__assign({},e),{table:function(t){var r=e.table(t),n=r.schema.primaryKey,o=__assign(__assign({},r),{mutate:function(e){var o=Y.trans,i=o.table(t).hook,a=i.deleting,u=i.creating,s=i.updating;switch(e.type){case"add":if(u.fire===nop)break;return o._promise("readwrite",(function(){return addPutOrDelete(e)}),!0);case"put":if(u.fire===nop&&s.fire===nop)break;return o._promise("readwrite",(function(){return addPutOrDelete(e)}),!0);case"delete":if(a.fire===nop)break;return o._promise("readwrite",(function(){return addPutOrDelete(e)}),!0);case"deleteRange":if(a.fire===nop)break;return o._promise("readwrite",(function(){return function deleteRange(e){return deleteNextChunk(e.trans,e.range,1e4)}(e)}),!0)}return r.mutate(e);function addPutOrDelete(e){var t=Y.trans,o=e.keys||getEffectiveKeys(n,e);if(!o)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?__assign(__assign({},e),{keys:o,wantResults:!0}):__assign({},e)).type&&(e.values=__spreadArrays(e.values)),e.keys&&(e.keys=__spreadArrays(e.keys)),function getExistingValues(e,t,r){return"add"===t.type?Promise.resolve(new Array(t.values.length)):e.getMany({trans:t.trans,keys:r})}(r,e,o).then((function(i){var l=o.map((function(r,o){var l=i[o],f={onerror:null,onsuccess:null};if("delete"===e.type)a.fire.call(f,r,l,t);else if("add"===e.type||void 0===l){var p=u.fire.call(f,r,e.values[o],t);null==r&&null!=p&&(r=p,e.keys[o]=r,n.outbound||setByKeyPath(e.values[o],n.keyPath,r))}else{var h=getObjectDiff(l,e.values[o]),d=s.fire.call(f,h,r,l,t);if(d){var y=e.values[o];Object.keys(d).forEach((function(e){hasOwn(y,e)?y[e]=d[e]:setByKeyPath(y,e,d[e])}))}}return f}));return r.mutate(e).then((function(t){for(var r=t.failures,n=t.results,a=t.numFailures,u=t.lastResult,s=0;s<o.length;++s){var f=n?n[s]:o[s],p=l[s];null==f?p.onerror&&p.onerror(r[s]):p.onsuccess&&p.onsuccess("put"===e.type&&i[s]?e.values[s]:f)}return{failures:r,results:n,numFailures:a,lastResult:u}})).catch((function(e){return l.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}function deleteNextChunk(e,t,o){return r.query({trans:e,values:!1,query:{index:n,range:t},limit:o}).then((function(r){var n=r.result;return addPutOrDelete({type:"delete",keys:n,trans:e}).then((function(r){return r.numFailures>0?Promise.reject(r.failures[0]):n.length<o?{failures:[],numFailures:0,lastResult:void 0}:deleteNextChunk(e,__assign(__assign({},t),{lower:n[n.length-1],lowerOpen:!0}),o)}))}))}}});return o}})}},Ce=function(){function Dexie(e,t){var r=this;this._middlewares={},this.verno=0;var n=Dexie.dependencies;this._options=t=__assign({addons:Dexie.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},t),this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};var o=t.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null;var i={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:nop,dbReadyPromise:null,cancelOpen:nop,openCanceller:null,autoSchema:!0};i.dbReadyPromise=new DexiePromise((function(e){i.dbReadyResolve=e})),i.openCanceller=new DexiePromise((function(e,t){i.cancelOpen=t})),this._state=i,this.name=e,this.on=Events(this,"populate","blocked","versionchange",{ready:[promisableChain,nop]}),this.on.ready.subscribe=override(this.on.ready.subscribe,(function(e){return function(t,n){Dexie.vip((function(){var o=r._state;if(o.openComplete)o.dbOpenError||DexiePromise.resolve().then(t),n&&e(t);else if(o.onReadyBeingFired)o.onReadyBeingFired.push(t),n&&e(t);else{e(t);var i=r;n||e((function unsubscribe(){i.on.ready.unsubscribe(t),i.on.ready.unsubscribe(unsubscribe)}))}}))}})),this.Collection=function createCollectionConstructor(e){return makeClassConstructor(_e.prototype,(function Collection$$1(t,r){this.db=e;var n=be,o=null;if(r)try{n=r()}catch(e){o=e}var i=t._ctx,a=i.table,u=a.hook.reading.fire;this._ctx={table:a,index:i.index,isPrimKey:!i.index||a.schema.primKey.keyPath&&i.index===a.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:o,or:i.or,valueMapper:u!==mirror?u:null}}))}(this),this.Table=function createTableConstructor(e){return makeClassConstructor(we.prototype,(function Table$$1(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:Events(null,{creating:[hookCreatingChain,nop],reading:[pureFunctionChain,mirror],updating:[hookUpdatingChain,nop],deleting:[hookDeletingChain,nop]})}))}(this),this.Transaction=function createTransactionConstructor(e){return makeClassConstructor(Pe.prototype,(function Transaction$$1(t,r,n,o){var i=this;this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.idbtrans=null,this.on=Events(this,"complete","error","abort"),this.parent=o||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new DexiePromise((function(e,t){i._resolve=e,i._reject=t})),this._completion.then((function(){i.active=!1,i.on.complete.fire()}),(function(e){var t=i.active;return i.active=!1,i.on.error.fire(e),i.parent?i.parent._reject(e):t&&i.idbtrans&&i.idbtrans.abort(),ae(e)}))}))}(this),this.Version=function createVersionConstructor(e){return makeClassConstructor(Ee.prototype,(function Version$$1(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function createWhereClauseConstructor(e){return makeClassConstructor(xe.prototype,(function WhereClause$$1(t,r,n){this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n};var o=e._deps.indexedDB;if(!o)throw new O.MissingAPI("indexedDB API missing");this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(e,t){return o.cmp(t,e)},this._max=function(e,t){return o.cmp(e,t)>0?e:t},this._min=function(e,t){return o.cmp(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database \'"+r.name+"\'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database \'"+r.name+"\'. Closing db now to resume the delete request."),r.close()})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete(\'"+r.name+"\') was blocked"):console.warn("Upgrade \'"+r.name+"\' blocked by other connection holding version "+e.oldVersion/10)})),this._maxKey=getMaxKey(t.IDBKeyRange),this._createTransaction=function(e,t,n,o){return new r.Transaction(e,t,n,o)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),pe.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(Oe),this.use(Te),o.forEach((function(e){return e(r)}))}return Dexie.prototype.version=function(e){if(isNaN(e)||e<.1)throw new O.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new O.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,r=t.filter((function(t){return t._cfg.version===e}))[0];return r||(r=new this.Version(e),t.push(r),t.sort(lowerVersionFirst),r.stores({}),this._state.autoSchema=!1,r)},Dexie.prototype._whenReady=function(e){var t=this;return this._state.openComplete||Y.letThrough?e():new DexiePromise((function(e,r){if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void r(new O.DatabaseClosed);t.open().catch(nop)}t._state.dbReadyPromise.then(e,r)})).then(e)},Dexie.prototype.use=function(e){var t=e.stack,r=e.create,n=e.level,o=e.name;o&&this.unuse({stack:t,name:o});var i=this._middlewares[t]||(this._middlewares[t]=[]);return i.push({stack:t,create:r,level:null==n?10:n,name:o}),i.sort((function(e,t){return e.level-t.level})),this},Dexie.prototype.unuse=function(e){var t=e.stack,r=e.name,n=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return n?e.create!==n:!!r&&e.name!==r}))),this},Dexie.prototype.open=function(){return dexieOpen(this)},Dexie.prototype.close=function(){var e=pe.indexOf(this),t=this._state;if(e>=0&&pe.splice(e,1),this.idbdb){try{this.idbdb.close()}catch(e){}this.idbdb=null}this._options.autoOpen=!1,t.dbOpenError=new O.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError),t.dbReadyPromise=new DexiePromise((function(e){t.dbReadyResolve=e})),t.openCanceller=new DexiePromise((function(e,r){t.cancelOpen=r}))},Dexie.prototype.delete=function(){var e=this,t=arguments.length>0,r=this._state;return new DexiePromise((function(n,o){var doDelete=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=wrap((function(){Se.remove(e.name),n()})),t.onerror=eventRejectHandler(o),t.onblocked=e._fireOnBlocked};if(t)throw new O.InvalidArgument("Arguments not allowed in db.delete()");r.isBeingOpened?r.dbReadyPromise.then(doDelete):doDelete()}))},Dexie.prototype.backendDB=function(){return this.idbdb},Dexie.prototype.isOpen=function(){return null!==this.idbdb},Dexie.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},Dexie.prototype.hasFailed=function(){return null!==this._state.dbOpenError},Dexie.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Dexie.prototype,"tables",{get:function(){var e=this;return r(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!0,configurable:!0}),Dexie.prototype.transaction=function(){var e=extractTransactionArgs.apply(this,arguments);return this._transaction.apply(this,e)},Dexie.prototype._transaction=function(e,t,r){var n=this,o=Y.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);var i,a,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map((function(e){var t=e instanceof n.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||e===me)i=me;else{if("rw"!=e&&e!=ge)throw new O.InvalidArgument("Invalid transaction mode: "+e);i=ge}if(o){if(o.mode===me&&i===ge){if(!u)throw new O.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach((function(e){if(o&&-1===o.storeNames.indexOf(e)){if(!u)throw new O.SubTransaction("Table "+e+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(function(t,r){r(e)})):ae(e)}var s=enterTransactionScope.bind(null,this,i,a,o,r);return o?o._promise(i,s,"lock"):Y.trans?usePSD(Y.transless,(function(){return n._whenReady(s)})):this._whenReady(s)},Dexie.prototype.table=function(e){if(!hasOwn(this._allTables,e))throw new O.InvalidTable("Table "+e+" does not exist");return this._allTables[e]},Dexie}(),je=Ce;props(je,__assign(__assign({},C),{delete:function(e){return new je(e).delete()},exists:function(e){return new je(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){return Se?Se.getDatabaseNames().then(e):DexiePromise.resolve([])},defineClass:function(){return function Class(e){extend(this,e)}},ignoreTransaction:function(e){return Y.trans?usePSD(Y.transless,e):e()},vip,async:function(e){return function(){try{var t=awaitIterator(e.apply(this,arguments));return t&&"function"==typeof t.then?t:DexiePromise.resolve(t)}catch(e){return ae(e)}}},spawn:function(e,t,r){try{var n=awaitIterator(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:DexiePromise.resolve(n)}catch(e){return ae(e)}},currentTransaction:{get:function(){return Y.trans||null}},waitFor:function(e,t){var r=DexiePromise.resolve("function"==typeof e?je.ignoreTransaction(e):e).timeout(t||6e4);return Y.trans?Y.trans.waitFor(r):r},Promise:DexiePromise,debug:{get:function(){return w},set:function(e){setDebug(e,"dexie"===e?function(){return!0}:dexieStackFrameFilter)}},derive,extend,props,override,Events,getByKeyPath,setByKeyPath,delByKeyPath,shallowClone,deepClone,getObjectDiff,asap,minKey:se,addons:[],connections:pe,errnames:S,dependencies:function(){try{return{indexedDB:o.indexedDB||o.mozIndexedDB||o.webkitIndexedDB||o.msIndexedDB,IDBKeyRange:o.IDBKeyRange||o.webkitIDBKeyRange}}catch(e){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:ue,version:ue.split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,r){return e+t/Math.pow(10,2*r)})),default:je,Dexie:je})),je.maxKey=getMaxKey(je.dependencies.IDBKeyRange),function initDatabaseEnumerator(e){try{Se=function DatabaseEnumerator(e){var t,r=e&&"function"==typeof e.databases;if(!r){var n=new Ce(ve,{addons:[]});n.version(1).stores({dbnames:"name"}),t=n.table("dbnames")}return{getDatabaseNames:function(){return r?DexiePromise.resolve(e.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==ve}))})):t.toCollection().primaryKeys()},add:function(e){return!r&&e!==ve&&t.put({name:e}).catch(nop)},remove:function(e){return!r&&e!==ve&&t.delete(e).catch(nop)}}}(e)}catch(e){}}(Ce.dependencies.indexedDB),DexiePromise.rejectionMapper=function mapError(e,t){if(!e||e instanceof DexieError||e instanceof TypeError||e instanceof SyntaxError||!e.name||!T[e.name])return e;var r=new T[e.name](t||e.message,e);return"stack"in e&&setProp(r,"stack",{get:function(){return this.inner.stack}}),r},setDebug(w,dexieStackFrameFilter);function _createSuper(e){var t=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}var De=new(function(e){!function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}(LoggerDB,e);var t=_createSuper(LoggerDB);function LoggerDB(){var e;return _classCallCheck(this,LoggerDB),(e=t.call(this,"AgoraLogger")).logs=void 0,e.openDatabase(),e.logs=e.table("logs"),e}return _createClass(LoggerDB,[{key:"openDatabase",value:function openDatabase(){this.version(1).stores({logs:"++id, content, label, created_at"})}}]),LoggerDB}(Ce));function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function define(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{define({},"")}catch(e){define=function define(e,t,r){return e[t]=r}}function wrap(e,t,r,o){var i=t&&t.prototype instanceof Generator?t:Generator,a=Object.create(i.prototype),u=new Context(o||[]);return n(a,"_invoke",{value:makeInvokeMethod(e,r,u)}),a}function tryCatch(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=wrap;var s={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var l={};define(l,i,(function(){return this}));var f=Object.getPrototypeOf,p=f&&f(f(values([])));p&&p!==t&&r.call(p,i)&&(l=p);var h=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(l);function defineIteratorMethods(e){["next","throw","return"].forEach((function(t){define(e,t,(function(e){return this._invoke(t,e)}))}))}function AsyncIterator(e,t){function invoke(n,o,i,a){var u=tryCatch(e[n],e,o);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==_typeof(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){invoke("next",e,i,a)}),(function(e){invoke("throw",e,i,a)})):t.resolve(l).then((function(e){s.value=e,i(s)}),(function(e){return invoke("throw",e,i,a)}))}a(u.arg)}var o;n(this,"_invoke",{value:function value(e,r){function callInvokeWithMethodAndArg(){return new t((function(t,n){invoke(e,r,t,n)}))}return o=o?o.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return doneResult()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=maybeInvokeDelegate(a,r);if(u){if(u===s)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=tryCatch(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function maybeInvokeDelegate(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,maybeInvokeDelegate(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a \'"+r+"\' method")),s;var o=tryCatch(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,s;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function pushTryEntry(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function next(){for(;++n<e.length;)if(r.call(e,n))return next.value=e[n],next.done=!1,next;return next.value=void 0,next.done=!0,next};return o.next=o}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,n(h,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),n(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,define(e,u,"GeneratorFunction")),e.prototype=Object.create(h),e},e.awrap=function(e){return{__await:e}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,a,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},defineIteratorMethods(h),define(h,u,"Generator"),define(h,i,(function(){return this})),define(h,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function next(){for(;r.length;){var e=r.pop();if(e in t)return next.value=e,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function stop(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var t=this;function handle(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0);if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}}}},abrupt:function abrupt(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function complete(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function finish(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),s}},catch:function _catch(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(e,t,r){return this.delegate={iterator:values(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},e}var Ae=function(){function Mutex(){_classCallCheck(this,Mutex),this.mutex=Promise.resolve()}var e;return _createClass(Mutex,[{key:"lock",value:function lock(){var e=function begin(){};return this.mutex=this.mutex.then((function(){return new Promise(e)})),new Promise((function(t){e=t}))}},{key:"dispatch",value:(e=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(e){var t;return _regeneratorRuntime().wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.lock();case 2:return t=r.sent,r.prev=3,r.next=6,Promise.resolve(e());case 6:return r.abrupt("return",r.sent);case 7:return r.prev=7,t(),r.finish(7);case 10:case"end":return r.stop()}}),_callee,this,[[3,,7,10]])}))),function dispatch(t){return e.apply(this,arguments)})}]),Mutex}();function log_worker_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */log_worker_regeneratorRuntime=function _regeneratorRuntime(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function define(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{define({},"")}catch(e){define=function define(e,t,r){return e[t]=r}}function wrap(e,t,r,o){var i=t&&t.prototype instanceof Generator?t:Generator,a=Object.create(i.prototype),u=new Context(o||[]);return n(a,"_invoke",{value:makeInvokeMethod(e,r,u)}),a}function tryCatch(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=wrap;var s={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var l={};define(l,i,(function(){return this}));var f=Object.getPrototypeOf,p=f&&f(f(values([])));p&&p!==t&&r.call(p,i)&&(l=p);var h=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(l);function defineIteratorMethods(e){["next","throw","return"].forEach((function(t){define(e,t,(function(e){return this._invoke(t,e)}))}))}function AsyncIterator(e,t){function invoke(n,o,i,a){var u=tryCatch(e[n],e,o);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==_typeof(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){invoke("next",e,i,a)}),(function(e){invoke("throw",e,i,a)})):t.resolve(l).then((function(e){s.value=e,i(s)}),(function(e){return invoke("throw",e,i,a)}))}a(u.arg)}var o;n(this,"_invoke",{value:function value(e,r){function callInvokeWithMethodAndArg(){return new t((function(t,n){invoke(e,r,t,n)}))}return o=o?o.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return doneResult()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=maybeInvokeDelegate(a,r);if(u){if(u===s)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=tryCatch(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function maybeInvokeDelegate(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,maybeInvokeDelegate(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a \'"+r+"\' method")),s;var o=tryCatch(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,s;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function pushTryEntry(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function next(){for(;++n<e.length;)if(r.call(e,n))return next.value=e[n],next.done=!1,next;return next.value=void 0,next.done=!0,next};return o.next=o}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,n(h,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),n(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,define(e,u,"GeneratorFunction")),e.prototype=Object.create(h),e},e.awrap=function(e){return{__await:e}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,a,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},defineIteratorMethods(h),define(h,u,"Generator"),define(h,i,(function(){return this})),define(h,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function next(){for(;r.length;){var e=r.pop();if(e in t)return next.value=e,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function stop(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var t=this;function handle(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0);if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}}}},abrupt:function abrupt(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function complete(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function finish(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),s}},catch:function _catch(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(e,t,r){return this.delegate={iterator:values(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},e}console.log("[worker] log worker initialzied");var Ie=self,Re=new Ae,Ke=5e4,Fe=[],Me=function log(){var e;(e=console).debug.apply(e,arguments)},Be=t()((function(){Re.dispatch(_asyncToGenerator(log_worker_regeneratorRuntime().mark((function _callee(){var e,t,r,n,o;return log_worker_regeneratorRuntime().wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:return e=(new Date).getTime(),t=Fe,Fe=[],i.prev=3,i.next=6,De.logs.count();case 6:if(r=i.sent,!((n=t.length+r-Ke)>0)){i.next=12;break}return i.next=11,De.logs.orderBy(":id").reverse().limit(n).delete();case 11:console.debug("[worker] clear ".concat(n," records"));case 12:i.next=17;break;case 14:i.prev=14,i.t0=i.catch(3),console.error("[worker] clear db failed");case 17:return i.prev=17,i.next=20,De.logs.bulkPut(t);case 20:i.next=25;break;case 22:i.prev=22,i.t1=i.catch(17),console.error("[worker] bulkPut ".concat(t.length," failed"));case 25:o=(new Date).getTime(),Me("[worker] done writing ".concat(t.length," records in ").concat(o-e,"ms"));case 27:case"end":return i.stop()}}),_callee,null,[[3,14],[17,22]])}))))}),2e3,{maxWait:3e4});Ie.onmessage=function(){var e=_asyncToGenerator(log_worker_regeneratorRuntime().mark((function _callee2(e){var t,r,n,o;return log_worker_regeneratorRuntime().wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:e.data&&"log"===e.data.type?(t=new Date,r=e.data.data,n=r.label,o=r.message,Fe.push({label:n,content:o,created_at:+Date.now(),timestamp:"".concat(t)}),Be()):e.data&&"setting"===e.data.type&&(Ke=e.data.data.maxRecords||5e4);case 1:case"end":return i.stop()}}),_callee2)})));return function(t){return e.apply(this,arguments)}}()})()})();',"Worker",void 0,void 0)}(),ME.originConsole=window.console;var BE=new Uint8Array(16);function rng(){if(!NE&&!(NE="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return NE(BE)}const jE=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const UE=function validate(j){return"string"==typeof j&&jE.test(j)};for(var FE=[],GE=0;GE<256;++GE)FE.push((GE+256).toString(16).substr(1));const VE=function stringify(j){var _e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,_t=(FE[j[_e+0]]+FE[j[_e+1]]+FE[j[_e+2]]+FE[j[_e+3]]+"-"+FE[j[_e+4]]+FE[j[_e+5]]+"-"+FE[j[_e+6]]+FE[j[_e+7]]+"-"+FE[j[_e+8]]+FE[j[_e+9]]+"-"+FE[j[_e+10]]+FE[j[_e+11]]+FE[j[_e+12]]+FE[j[_e+13]]+FE[j[_e+14]]+FE[j[_e+15]]).toLowerCase();if(!UE(_t))throw TypeError("Stringified UUID is invalid");return _t};const qE=function v4(j,_e,_t){var St=(j=j||{}).random||(j.rng||rng)();if(St[6]=15&St[6]|64,St[8]=63&St[8]|128,_e){_t=_t||0;for(var Tt=0;Tt<16;++Tt)_e[_t+Tt]=St[Tt];return _e}return VE(St)};function error_createSuper(j){var _e=function error_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var QE,KE,WE,HE,zE,YE=function(j){_inherits(AbstractErrorCenter,j);var _e=error_createSuper(AbstractErrorCenter);function AbstractErrorCenter(){return _classCallCheck(this,AbstractErrorCenter),_e.apply(this,arguments)}return _createClass(AbstractErrorCenter)}(_a),JE=function(j){_inherits(AGError,j);var _e=error_createSuper(AGError);function AGError(j,_t,St){var Tt;return _classCallCheck(this,AGError),(Tt=_e.call(this))._extra=St,Tt.id=qE(),Tt.original=void 0,Tt.codeList=void 0,Tt.message=_t.message,Tt.original=_t,Tt.codeList=[j],Tt.stack=_t.stack,Tt}return _createClass(AGError,[{key:"servCode",get:function get(){var j;return null===(j=this._extra)||void 0===j?void 0:j.servCode}}],[{key:"isOf",value:function isOf(j){if(!(j instanceof AGError))return!1;for(var _e=arguments.length,_t=new Array(_e>1?_e-1:0),St=1;St<_e;St++)_t[St-1]=arguments[St];return _t.includes(j.servCode)}}]),AGError}(_wrapNativeSuper(Error)),XE=function AGErrorWrapper(j,_e){return _e instanceof JE?(_e.codeList.push(j),_e):new JE(j,_e)},ZE=function(j){_inherits(RteErrorCenter,j);var _e=error_createSuper(RteErrorCenter);function RteErrorCenter(){return _classCallCheck(this,RteErrorCenter),_e.apply(this,arguments)}return _createClass(RteErrorCenter,[{key:"_handleError",value:function _handleError(j,_e){var _t=(null==_e?void 0:_e.stack)||(null==_e?void 0:_e.message);ME.error("[RteErrorCenter] error ".concat(j,": ").concat(_t))}},{key:"handleThrowableError",value:function handleThrowableError(j,_e){var _t=XE(j,_e);throw this._handleError(j,_t),_t}},{key:"handleNonThrowableError",value:function handleNonThrowableError(j,_e){var _t=XE(j,_e);this._handleError(j,_t)}}]),RteErrorCenter}(YE);function configs_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function configs_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?configs_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):configs_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}ZE.shared=new ZE,function(j){j.RTE_ERR_MISSING_PARAMS="100000",j.RTE_ERR_SCENE_NOT_READY="100001",j.RTE_ERR_INVALID_DATA_STRUCT="100002",j.RTE_ERR_LOG_UPLOAD_FAIL="100003",j.RTE_ERR_RESTFUL_SERVICE_ERR="100004",j.RTE_ERR_RESTFUL_HTTP_CLIENT_ERR="100005",j.RTE_ERR_AGORA_FETCH_ERR="100006",j.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR="100007",j.RTE_ERR_WEB_LOG_UPLOAD_ERR="100008",j.RTE_ERR_JOIN_SCENE_FAILED="100009",j.RTE_ERR_LEAVE_SCENE_FAIL="100010",j.RTE_ERR_EVENT_CALLBACK_ERR="100011",j.RTE_ERR_SCENE_ALREADY_JOINED="100012",j.RTE_ERR_ENGINE_NOT_READY="100013",j.RTE_ERR_CONFIG_NOT_READY="100014",j.RTE_ERR_RESTFUL_NETWORK_ERR="100015",j.RTE_ERR_RESTFUL_NETWORK_TIMEOUT_ERR="100016",j.RTE_ERR_LOCAL_USER_NOT_EXIST="100017",j.RTM_ERR_LOGGED_IN_ALREADY="200000",j.RTM_ERR_JOIN_FAILED="200001",j.RTM_ERR_LEAVE_FAILED="200002",j.RTM_ERR_DESTROY_FAILED="200003",j.RTM_ERR_LOGIN_FAIL="200004",j.RTM_ERR_REGION_NOT_SPECIFIED="200005",j.RTC_ERR_CAM_ERR="300000",j.RTC_ERR_MIC_ERR="300001",j.RTC_ERR_TRACK_PUBLISH_FAIL="300002",j.RTC_ERR_TRACK_UNPUBLISH_FAIL="300003",j.RTC_ERR_TRACK_SUBSCRIBE_FAIL="300004",j.RTC_ERR_TRACK_UNSUBSCRIBE_FAIL="300005",j.RTC_ERR_NO_CHANNEL_EXISTS="300006",j.RTC_ERR_INVALID_CANVAS="300007",j.RTC_ERR_SCREEN_SHARE_ERR="300008",j.RTC_ERR_CLIENT_LEAVE_CHANNEL_FAIL="300009",j.RTC_ERR_LEAVE_MAIN_CHANNEL_FAIL="300010",j.RTC_ERR_LEAVE_SUB_CHANNEL_FAIL="300011",j.RTC_ERR_LEAVE_CHANNEL_FAIL="300012",j.RTC_ERR_VDM_GET_DEVICES_FAIL="300013",j.RTC_ERR_ADM_GET_RECORD_DEVICES_FAIL="300014",j.RTC_ERR_ADM_GET_PLAYBACK_DEVICES_FAIL="300015",j.RTC_ERR_REGION_NOT_SPECIFIED="300016",j.RTC_ERR_RTC_ENGINE_INITIALZIE_FAILED="300017",j.RTC_ERR_RTC_VDM_NOT_READY="300018",j.RTC_ERR_RTC_ADM_NOT_READY="300019"}(QE||(QE={})),function(j){j[j.Electron=0]="Electron",j[j.Web=1]="Web"}(KE||(KE={})),function(j){j.CN="CN",j.AP="AP",j.EU="EU",j.NA="NA"}(WE||(WE={})),function(j){j.AREA_GLOBAL="AREA_GLOBAL",j.AREA_CN="AREA_CN",j.AREA_AS="AREA_AS",j.AREA_EUR="AREA_EUR",j.AREA_NA="AREA_NA",j.AREA_JAPAN="AREA_JAPAN",j.AREA_INDIA="AREA_INDIA"}(HE||(HE={})),function(j){j[j.Low=1]="Low",j[j.UltraLow=2]="UltraLow"}(zE||(zE={}));var $E=function(){function AgoraRteEngineConfig(j,_e){_classCallCheck(this,AgoraRteEngineConfig),this.appId=void 0,this.service={},this.rtcConfigs={},this.logFilePath=void 0,this.rtcSDKParameters=[],this.rtcSDKExtensions=[],this.latencyLevel=zE.UltraLow,this.userId="",this.token="",this.ignoreUrlRegionPrefix=!1,this.region=WE.CN,this._rtcRegion=void 0,this._rtmRegion=void 0,this.SCENE_JOIN_RETRY_ATTEMPTS=3,this.appId=j,_e&&(_e.region&&(this.region=_e.region),_e.rtcConfigs&&(this.rtcConfigs=configs_objectSpread(configs_objectSpread({},this.rtcConfigs),_e.rtcConfigs)),_e.rtcSDKParameters&&(this.rtcSDKParameters=_e.rtcSDKParameters),_e.rtcSDKExtensions&&(this.rtcSDKExtensions=_e.rtcSDKExtensions),_e.latencyLevel&&(this.latencyLevel=_e.latencyLevel))}return _createClass(AgoraRteEngineConfig,[{key:"rtcRegion",get:function get(){var j;return null!==(j=this._rtcRegion)&&void 0!==j?j:HE.AREA_GLOBAL}},{key:"rtmRegion",get:function get(){var j;return null!==(j=this._rtmRegion)&&void 0!==j?j:HE.AREA_GLOBAL}},{key:"setRtcRegion",value:function setRtcRegion(j){this._rtcRegion=j}},{key:"setRtmRegion",value:function setRtmRegion(j){this._rtmRegion=j}}],[{key:"shared",get:function get(){return this._config?this._config:ZE.shared.handleThrowableError(QE.RTE_ERR_CONFIG_NOT_READY,new Error("classroom config not ready"))}},{key:"setConfig",value:function setConfig(j){this._config=j}},{key:"platform",get:function get(){return navigator.userAgent.toLowerCase().indexOf(" electron/")>-1?KE.Electron:KE.Web}},{key:"version",get:function get(){return"2.8.30"}}]),AgoraRteEngineConfig}();$E._config=void 0,$E.logLevel=SE.INFO,$E.consoleHijackEnabled=!1;var _w;__webpack_require__(4812),__webpack_require__(1249),__webpack_require__(9826),__webpack_require__(2707),__webpack_require__(2564),__webpack_require__(7727),__webpack_require__(6210);function proxy_createSuper(j){var _e=function proxy_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j[j.pre=0]="pre",j[j.post=1]="post"}(_w||(_w={}));var tS=function failQuitely(j,_e){try{return j.apply(void 0,_toConsumableArray(_e))}catch(j){}},rS=function invokeMethod(j,_e,_t,St,Tt,Ut){var _r={};tS(Ut,[{type:_w.pre,arguments:Tt,method:St,class:_t.constructor.__$$className||_t.constructor.name,context:_r}]);var _n,_i,Ei=_e.apply(j,Tt),Ci=function post(j,_e){tS(Ut,[{type:_w.post,arguments:Tt,return:j,method:St,class:_t.constructor.__$$className||_t.constructor.name,context:_r,error:_e}])};Ei&&!!Ei.then?Ei.then((function(j){_n=j})).catch((function(j){_i=j})).finally((function(){Ci(_n,_i)})):Ci(Ei);return Ei},iS=function proxyMethod(j,_e,_t,St){return function(){for(var Tt=arguments.length,Ut=new Array(Tt),_r=0;_r<Tt;_r++)Ut[_r]=arguments[_r];return rS(this,j,_e,_t,Ut,St)}},oS=function getMethods(j){for(var _e=[],_t=[],St=j;(St=Object.getPrototypeOf(St))&&St!==Object.prototype;){Object.getOwnPropertyNames(St).forEach((function(Tt){if(-1===_e.indexOf(Tt)){if(_e.push(Tt),"constructor"===Tt)return;try{"function"==typeof j[Tt]&&_t.push(Tt)}catch(j){var Ut=Object.getOwnPropertyDescriptor(St,Tt);"function"==typeof(null==Ut?void 0:Ut.value)&&_t.push(Tt)}}}))}return _t},cS=__webpack_require__(5760),uS=__webpack_require__.n(cS),lS=__webpack_require__(6635),dS=(__webpack_require__(4916),__webpack_require__(4723),__webpack_require__(8640)),hS=__webpack_require__.n(dS);function utils_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */utils_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function utils_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function utils_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?utils_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):utils_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}var fS,pS=function(){function Retry(j,_e,_t){_classCallCheck(this,Retry),this.fn=void 0,this.args=void 0,this.onRetryAttemptFail=void 0,this.onRetryAbort=void 0,this.opts=void 0,this.fn=j,this.args=_e,this.opts=_t}var j;return _createClass(Retry,[{key:"fail",value:function fail(j){return this.onRetryAttemptFail=j,this}},{key:"abort",value:function abort(j){return this.onRetryAbort=j,this}},{key:"exec",value:(j=_asyncToGenerator(utils_regeneratorRuntime().mark((function _callee(){return utils_regeneratorRuntime().wrap((function _callee$(j){for(;;)switch(j.prev=j.next){case 0:return j.prev=0,j.next=3,hS()(this.fn,this.args,utils_objectSpread(utils_objectSpread({retriesMax:3},this.opts),{},{onAttemptFail:this.onRetryAttemptFail}));case 3:j.next=12;break;case 5:if(j.prev=5,j.t0=j.catch(0),j.t1=this.onRetryAbort,!j.t1){j.next=11;break}return j.next=11,this.onRetryAbort(j.t0);case 11:throw j.t0;case 12:case"end":return j.stop()}}),_callee,this,[[0,5]])}))),function exec(){return j.apply(this,arguments)})}]),Retry}(),gS=function retryAttempt(j,_e,_t){return new pS(j,_e,_t)},vS=function jsonstring(j){try{return JSON.stringify(j)}catch(j){}return"invalid json"},AS=function sleep(j){return new Promise((function(_e){setTimeout(_e,j)}))},_S=function timeout(j,_e){var _t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Promise.race([j,new Promise((function(j,St){setTimeout(_t?St:j,_e)}))])},bS=[],ES={match:function match(j){return!0},serialize:function serialize(j){return vS(j)}},wS=function addSerializer(j){bS.push(j)},SS=function serialize(j){if("string"==typeof j)return j;var _e=bS.find((function(_e){return _e.match(j)}));return _e?_e.serialize(j):"".concat(j)},IS=function serializeArgs(j){return j.map(SS).join(" ")};wS({match:function match(j){return j instanceof File},serialize:function serialize(j){return vS({filename:j.name,size:j.size})}}),wS(ES),function(j){j[j.Break=0]="Break",j[j.Continue=1]="Continue"}(fS||(fS={}));var TS=function formatLog(j,_e,_t){return"".concat(uS()().format("YYYY-MM-DD HH:mm:ss")," ").concat((0,lS.upperCase)(PE[j]||"unknown")," [").concat(_t.className,".").concat(_t.methodName,"] [").concat(_t.traceId,"] ").concat(_e)},CS=function createLogHandler(j){var _e=SE.INFO;return function(_t){if(_t.type===_w.pre){var St;_t.context.start=(new Date).getTime(),_t.context.traceId="trace-".concat(_t.context.start).concat(Math.ceil(1e3*Math.random()));var Tt=[];(null===(St=_t.arguments)||void 0===St?void 0:St.length)&&Tt.push("args:",_t.arguments);var Ut=TS(_e,IS(Tt),{className:_t.class,methodName:_t.method,traceId:_t.context.traceId});j.info(Ut)}else{var _r=(new Date).getTime()-_t.context.start,_n=[];_t.return&&_n.push("return:",_t.return),_t.error&&_n.push("err:",_t.error),_n.push("Time elapsed: ".concat(_r,"ms"));var _i=TS(_e,IS(_n),{className:_t.class,methodName:_t.method,traceId:_t.context.traceId});j.info(_i)}return fS.Continue}},RS=(__webpack_require__(3371),function formatLog(j,_e,_t){return"".concat(uS()().format("YYYY-MM-DD HH:mm:ss")," ").concat((0,lS.upperCase)(PE[j]||"unknown")," [").concat(_t,"] [trace-0] ").concat(_e)}),kS={attach:function attach(j){var _e=!0,_t=(null==j?void 0:j.label)||"default",St=ME.getLogger(_t);return j&&(_e=!!j.proxyMethods),function(j){var _t=function chain(){for(var j=arguments.length,_e=new Array(j),_t=0;_t<j;_t++)_e[_t]=arguments[_t];return function(j){var _t=fS.Continue;for(var St in _e)if((_t=(0,_e[St])(j))===fS.Break)break;return _t}}(function createSilenceHandler(j){return function(_e){return function isIgnoredMethod(j,_e){var _t=j.__$$ignoreMethods;return _t&&_t.indexOf(_e)>-1}(j.prototype,_e.method)?fS.Break:fS.Continue}}(j),CS(St)),Tt=function createFormatLogger(j,_e){return Object.freeze({info:function info(){for(var _t=arguments.length,St=new Array(_t),Tt=0;Tt<_t;Tt++)St[Tt]=arguments[Tt];var Ut=RS(SE.INFO,IS(St),j.name);_e.info(Ut)},warn:function warn(){for(var _t=arguments.length,St=new Array(_t),Tt=0;Tt<_t;Tt++)St[Tt]=arguments[Tt];var Ut=RS(SE.WARN,IS(St),j.name);_e.warn(Ut)},error:function error(){for(var _t=arguments.length,St=new Array(_t),Tt=0;Tt<_t;Tt++)St[Tt]=arguments[Tt];var Ut=RS(SE.ERROR,IS(St),j.name);_e.error(Ut)},debug:function debug(){for(var _t=arguments.length,St=new Array(_t),Tt=0;Tt<_t;Tt++)St[Tt]=arguments[Tt];var Ut=RS(SE.DEBUG,IS(St),j.name);_e.debug(Ut)}})}(j,St);return function extendConstructor(j,_e,_t,St){var Tt;return Tt=function(j){_inherits(_class,j);var Tt=proxy_createSuper(_class);function _class(){var j;_classCallCheck(this,_class);for(var Ut=arguments.length,_r=new Array(Ut),_n=0;_n<Ut;_n++)_r[_n]=arguments[_n];(j=Tt.call.apply(Tt,[this].concat(_r)),St)&&oS(_assertThisInitialized(j)).forEach((function(_t){var St=j[_t];Object.defineProperty(_assertThisInitialized(j),_t,{writable:!0,configurable:!0,enumerable:!1,value:iS(St,_assertThisInitialized(j),_t,_e)})}));return Object.keys(_t).forEach((function(_e){Object.defineProperty(_assertThisInitialized(j),_e,{configurable:!0,enumerable:!1,writable:!1,value:_t[_e]})})),j}return _createClass(_class)}(j),Tt.__$$className=j.name,Tt}(j,_t,{logger:Tt},_e)}},trace:function trace(j,_e,_t){var St=CS(ME.logger),Tt=_t.value;"function"==typeof Tt&&(_t.value=iS(Tt,j,_e,St))},silence:function silence(j,_e){!function addIgnoredMethod(j,_e){j.__$$ignoreMethods||(j.__$$ignoreMethods=[]);var _t=j.__$$ignoreMethods;_t.includes(_e)||_t.push(_e)}(j,_e)}},OS=(__webpack_require__(189),__webpack_require__(8921),__webpack_require__(6248),__webpack_require__(3599),__webpack_require__(1477),__webpack_require__(3066),__webpack_require__(5389),__webpack_require__(401),__webpack_require__(5164),__webpack_require__(1238),__webpack_require__(4837),__webpack_require__(7485),__webpack_require__(465),__webpack_require__(6651),__webpack_require__(1437),__webpack_require__(5285),__webpack_require__(9865),__webpack_require__(4129),__webpack_require__(8206),new Set),xS=function bound(j,_e,_t){var St=_t.value;return{configurable:!0,enumerable:!1,get:function get(){var j=this.__cacheMap;return j||(j=new WeakMap,this.__cacheMap=j,OS.add(this)),j.has(St)||j.set(St,St.bind(this)),j.get(St)},set:function set(j){var _e=this.__cacheMap;_e||(_e=new WeakMap,this.__cacheMap=_e,OS.add(this)),_e.set(j,j.bind(this))}}},LS=new Set,NS={debounced:function debounced(j,_e){return function(_t,St,Tt){var Ut=Tt.value;"function"==typeof Ut&&(Tt.value=(0,lS.debounce)(Ut,j,_e))}},throttled:function throttled(j,_e){return function(_t,St,Tt){var Ut=Tt.value;"function"==typeof Ut&&(Tt.value=(0,lS.throttle)(Ut,j,_e))}}},PS=(__webpack_require__(3123),__webpack_require__(561),"delete"),MS=32,BS=31,jS={};function SetRef(j){j&&(j.value=!0)}function OwnerID(){}function ensureSize(j){return void 0===j.size&&(j.size=j.__iterate(returnTrue)),j.size}function wrapIndex(j,_e){if("number"!=typeof _e){var _t=_e>>>0;if(""+_t!==_e||4294967295===_t)return NaN;_e=_t}return _e<0?ensureSize(j)+_e:_e}function returnTrue(){return!0}function wholeSlice(j,_e,_t){return(0===j&&!isNeg(j)||void 0!==_t&&j<=-_t)&&(void 0===_e||void 0!==_t&&_e>=_t)}function resolveBegin(j,_e){return resolveIndex(j,_e,0)}function resolveEnd(j,_e){return resolveIndex(j,_e,_e)}function resolveIndex(j,_e,_t){return void 0===j?_t:isNeg(j)?_e===1/0?_e:0|Math.max(0,_e+j):void 0===_e||_e===j?j:0|Math.min(_e,j)}function isNeg(j){return j<0||0===j&&1/j==-1/0}var US="@@__IMMUTABLE_ITERABLE__@@";function isCollection(j){return Boolean(j&&j[US])}var FS="@@__IMMUTABLE_KEYED__@@";function isKeyed(j){return Boolean(j&&j[FS])}var GS="@@__IMMUTABLE_INDEXED__@@";function isIndexed(j){return Boolean(j&&j[GS])}function isAssociative(j){return isKeyed(j)||isIndexed(j)}var VS=function Collection(j){return isCollection(j)?j:eI(j)},qS=function(j){function KeyedCollection(j){return isKeyed(j)?j:tI(j)}return j&&(KeyedCollection.__proto__=j),KeyedCollection.prototype=Object.create(j&&j.prototype),KeyedCollection.prototype.constructor=KeyedCollection,KeyedCollection}(VS),QS=function(j){function IndexedCollection(j){return isIndexed(j)?j:rI(j)}return j&&(IndexedCollection.__proto__=j),IndexedCollection.prototype=Object.create(j&&j.prototype),IndexedCollection.prototype.constructor=IndexedCollection,IndexedCollection}(VS),KS=function(j){function SetCollection(j){return isCollection(j)&&!isAssociative(j)?j:nI(j)}return j&&(SetCollection.__proto__=j),SetCollection.prototype=Object.create(j&&j.prototype),SetCollection.prototype.constructor=SetCollection,SetCollection}(VS);VS.Keyed=qS,VS.Indexed=QS,VS.Set=KS;var WS="@@__IMMUTABLE_SEQ__@@";function isSeq(j){return Boolean(j&&j[WS])}var HS="@@__IMMUTABLE_RECORD__@@";function isRecord(j){return Boolean(j&&j[HS])}function isImmutable(j){return isCollection(j)||isRecord(j)}var zS="@@__IMMUTABLE_ORDERED__@@";function isOrdered(j){return Boolean(j&&j[zS])}var YS="function"==typeof Symbol&&Symbol.iterator,JS="@@iterator",XS=YS||JS,ZS=function Iterator(j){this.next=j};function iteratorValue(j,_e,_t,St){var Tt=0===j?_e:1===j?_t:[_e,_t];return St?St.value=Tt:St={value:Tt,done:!1},St}function iteratorDone(){return{value:void 0,done:!0}}function hasIterator(j){return!!Array.isArray(j)||!!getIteratorFn(j)}function isIterator(j){return j&&"function"==typeof j.next}function getIterator(j){var _e=getIteratorFn(j);return _e&&_e.call(j)}function getIteratorFn(j){var _e=j&&(YS&&j[YS]||j[JS]);if("function"==typeof _e)return _e}ZS.prototype.toString=function toString(){return"[Iterator]"},ZS.KEYS=0,ZS.VALUES=1,ZS.ENTRIES=2,ZS.prototype.inspect=ZS.prototype.toSource=function(){return this.toString()},ZS.prototype[XS]=function(){return this};var $S=Object.prototype.hasOwnProperty;function isArrayLike(j){return!(!Array.isArray(j)&&"string"!=typeof j)||j&&"object"==typeof j&&Number.isInteger(j.length)&&j.length>=0&&(0===j.length?1===Object.keys(j).length:j.hasOwnProperty(j.length-1))}var eI=function(j){function Seq(j){return null==j?emptySequence():isImmutable(j)?j.toSeq():function seqFromValue(j){var _e=maybeIndexedSeqFromValue(j);if(_e)return function isEntriesIterable(j){var _e=getIteratorFn(j);return _e&&_e===j.entries}(j)?_e.fromEntrySeq():function isKeysIterable(j){var _e=getIteratorFn(j);return _e&&_e===j.keys}(j)?_e.toSetSeq():_e;if("object"==typeof j)return new oI(j);throw new TypeError("Expected Array or collection object of values, or keyed object: "+j)}(j)}return j&&(Seq.__proto__=j),Seq.prototype=Object.create(j&&j.prototype),Seq.prototype.constructor=Seq,Seq.prototype.toSeq=function toSeq(){return this},Seq.prototype.toString=function toString(){return this.__toString("Seq {","}")},Seq.prototype.cacheResult=function cacheResult(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},Seq.prototype.__iterate=function __iterate(j,_e){var _t=this._cache;if(_t){for(var St=_t.length,Tt=0;Tt!==St;){var Ut=_t[_e?St-++Tt:Tt++];if(!1===j(Ut[1],Ut[0],this))break}return Tt}return this.__iterateUncached(j,_e)},Seq.prototype.__iterator=function __iterator(j,_e){var _t=this._cache;if(_t){var St=_t.length,Tt=0;return new ZS((function(){if(Tt===St)return{value:void 0,done:!0};var Ut=_t[_e?St-++Tt:Tt++];return iteratorValue(j,Ut[0],Ut[1])}))}return this.__iteratorUncached(j,_e)},Seq}(VS),tI=function(j){function KeyedSeq(j){return null==j?emptySequence().toKeyedSeq():isCollection(j)?isKeyed(j)?j.toSeq():j.fromEntrySeq():isRecord(j)?j.toSeq():keyedSeqFromValue(j)}return j&&(KeyedSeq.__proto__=j),KeyedSeq.prototype=Object.create(j&&j.prototype),KeyedSeq.prototype.constructor=KeyedSeq,KeyedSeq.prototype.toKeyedSeq=function toKeyedSeq(){return this},KeyedSeq}(eI),rI=function(j){function IndexedSeq(j){return null==j?emptySequence():isCollection(j)?isKeyed(j)?j.entrySeq():j.toIndexedSeq():isRecord(j)?j.toSeq().entrySeq():indexedSeqFromValue(j)}return j&&(IndexedSeq.__proto__=j),IndexedSeq.prototype=Object.create(j&&j.prototype),IndexedSeq.prototype.constructor=IndexedSeq,IndexedSeq.of=function of(){return IndexedSeq(arguments)},IndexedSeq.prototype.toIndexedSeq=function toIndexedSeq(){return this},IndexedSeq.prototype.toString=function toString(){return this.__toString("Seq [","]")},IndexedSeq}(eI),nI=function(j){function SetSeq(j){return(isCollection(j)&&!isAssociative(j)?j:rI(j)).toSetSeq()}return j&&(SetSeq.__proto__=j),SetSeq.prototype=Object.create(j&&j.prototype),SetSeq.prototype.constructor=SetSeq,SetSeq.of=function of(){return SetSeq(arguments)},SetSeq.prototype.toSetSeq=function toSetSeq(){return this},SetSeq}(eI);eI.isSeq=isSeq,eI.Keyed=tI,eI.Set=nI,eI.Indexed=rI,eI.prototype[WS]=!0;var iI=function(j){function ArraySeq(j){this._array=j,this.size=j.length}return j&&(ArraySeq.__proto__=j),ArraySeq.prototype=Object.create(j&&j.prototype),ArraySeq.prototype.constructor=ArraySeq,ArraySeq.prototype.get=function get(j,_e){return this.has(j)?this._array[wrapIndex(this,j)]:_e},ArraySeq.prototype.__iterate=function __iterate(j,_e){for(var _t=this._array,St=_t.length,Tt=0;Tt!==St;){var Ut=_e?St-++Tt:Tt++;if(!1===j(_t[Ut],Ut,this))break}return Tt},ArraySeq.prototype.__iterator=function __iterator(j,_e){var _t=this._array,St=_t.length,Tt=0;return new ZS((function(){if(Tt===St)return{value:void 0,done:!0};var Ut=_e?St-++Tt:Tt++;return iteratorValue(j,Ut,_t[Ut])}))},ArraySeq}(rI),oI=function(j){function ObjectSeq(j){var _e=Object.keys(j);this._object=j,this._keys=_e,this.size=_e.length}return j&&(ObjectSeq.__proto__=j),ObjectSeq.prototype=Object.create(j&&j.prototype),ObjectSeq.prototype.constructor=ObjectSeq,ObjectSeq.prototype.get=function get(j,_e){return void 0===_e||this.has(j)?this._object[j]:_e},ObjectSeq.prototype.has=function has(j){return $S.call(this._object,j)},ObjectSeq.prototype.__iterate=function __iterate(j,_e){for(var _t=this._object,St=this._keys,Tt=St.length,Ut=0;Ut!==Tt;){var _r=St[_e?Tt-++Ut:Ut++];if(!1===j(_t[_r],_r,this))break}return Ut},ObjectSeq.prototype.__iterator=function __iterator(j,_e){var _t=this._object,St=this._keys,Tt=St.length,Ut=0;return new ZS((function(){if(Ut===Tt)return{value:void 0,done:!0};var _r=St[_e?Tt-++Ut:Ut++];return iteratorValue(j,_r,_t[_r])}))},ObjectSeq}(tI);oI.prototype[zS]=!0;var sI,cI=function(j){function CollectionSeq(j){this._collection=j,this.size=j.length||j.size}return j&&(CollectionSeq.__proto__=j),CollectionSeq.prototype=Object.create(j&&j.prototype),CollectionSeq.prototype.constructor=CollectionSeq,CollectionSeq.prototype.__iterateUncached=function __iterateUncached(j,_e){if(_e)return this.cacheResult().__iterate(j,_e);var _t=getIterator(this._collection),St=0;if(isIterator(_t))for(var Tt;!(Tt=_t.next()).done&&!1!==j(Tt.value,St++,this););return St},CollectionSeq.prototype.__iteratorUncached=function __iteratorUncached(j,_e){if(_e)return this.cacheResult().__iterator(j,_e);var _t=getIterator(this._collection);if(!isIterator(_t))return new ZS(iteratorDone);var St=0;return new ZS((function(){var _e=_t.next();return _e.done?_e:iteratorValue(j,St++,_e.value)}))},CollectionSeq}(rI);function emptySequence(){return sI||(sI=new iI([]))}function keyedSeqFromValue(j){var _e=maybeIndexedSeqFromValue(j);if(_e)return _e.fromEntrySeq();if("object"==typeof j)return new oI(j);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+j)}function indexedSeqFromValue(j){var _e=maybeIndexedSeqFromValue(j);if(_e)return _e;throw new TypeError("Expected Array or collection object of values: "+j)}function maybeIndexedSeqFromValue(j){return isArrayLike(j)?new iI(j):hasIterator(j)?new cI(j):void 0}var uI="@@__IMMUTABLE_MAP__@@";function isMap(j){return Boolean(j&&j[uI])}function isOrderedMap(j){return isMap(j)&&isOrdered(j)}function isValueObject(j){return Boolean(j&&"function"==typeof j.equals&&"function"==typeof j.hashCode)}function is(j,_e){if(j===_e||j!=j&&_e!=_e)return!0;if(!j||!_e)return!1;if("function"==typeof j.valueOf&&"function"==typeof _e.valueOf){if((j=j.valueOf())===(_e=_e.valueOf())||j!=j&&_e!=_e)return!0;if(!j||!_e)return!1}return!!(isValueObject(j)&&isValueObject(_e)&&j.equals(_e))}var lI="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function imul(j,_e){var _t=65535&(j|=0),St=65535&(_e|=0);return _t*St+((j>>>16)*St+_t*(_e>>>16)<<16>>>0)|0};function smi(j){return j>>>1&1073741824|3221225471&j}var fI=Object.prototype.valueOf;function hash(j){if(null==j)return hashNullish(j);if("function"==typeof j.hashCode)return smi(j.hashCode(j));var _e=function immutable_es_valueOf(j){return j.valueOf!==fI&&"function"==typeof j.valueOf?j.valueOf(j):j}(j);if(null==_e)return hashNullish(_e);switch(typeof _e){case"boolean":return _e?1108378657:1108378656;case"number":return function hashNumber(j){if(j!=j||j===1/0)return 0;var _e=0|j;_e!==j&&(_e^=4294967295*j);for(;j>4294967295;)_e^=j/=4294967295;return smi(_e)}(_e);case"string":return _e.length>wI?function cachedHashString(j){var _e=RI[j];void 0===_e&&(_e=hashString(j),II===SI&&(II=0,RI={}),II++,RI[j]=_e);return _e}(_e):hashString(_e);case"object":case"function":return function hashJSObj(j){var _e;if(mI&&void 0!==(_e=vI.get(j)))return _e;if(void 0!==(_e=j[EI]))return _e;if(!gI){if(void 0!==(_e=j.propertyIsEnumerable&&j.propertyIsEnumerable[EI]))return _e;if(void 0!==(_e=function getIENodeHash(j){if(j&&j.nodeType>0)switch(j.nodeType){case 1:return j.uniqueID;case 9:return j.documentElement&&j.documentElement.uniqueID}}(j)))return _e}if(_e=nextHash(),mI)vI.set(j,_e);else{if(void 0!==pI&&!1===pI(j))throw new Error("Non-extensible objects are not allowed as keys.");if(gI)Object.defineProperty(j,EI,{enumerable:!1,configurable:!1,writable:!1,value:_e});else if(void 0!==j.propertyIsEnumerable&&j.propertyIsEnumerable===j.constructor.prototype.propertyIsEnumerable)j.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},j.propertyIsEnumerable[EI]=_e;else{if(void 0===j.nodeType)throw new Error("Unable to set a non-enumerable property on object.");j[EI]=_e}}return _e}(_e);case"symbol":return function hashSymbol(j){var _e=AI[j];if(void 0!==_e)return _e;return _e=nextHash(),AI[j]=_e,_e}(_e);default:if("function"==typeof _e.toString)return hashString(_e.toString());throw new Error("Value type "+typeof _e+" cannot be hashed.")}}function hashNullish(j){return null===j?1108378658:1108378659}function hashString(j){for(var _e=0,_t=0;_t<j.length;_t++)_e=31*_e+j.charCodeAt(_t)|0;return smi(_e)}var pI=Object.isExtensible,gI=function(){try{return Object.defineProperty({},"@",{}),!0}catch(j){return!1}}();function nextHash(){var j=++_I;return 1073741824&_I&&(_I=0),j}var vI,mI="function"==typeof WeakMap;mI&&(vI=new WeakMap);var AI=Object.create(null),_I=0,EI="__immutablehash__";"function"==typeof Symbol&&(EI=Symbol(EI));var wI=16,SI=255,II=0,RI={},kI=function(j){function ToKeyedSequence(j,_e){this._iter=j,this._useKeys=_e,this.size=j.size}return j&&(ToKeyedSequence.__proto__=j),ToKeyedSequence.prototype=Object.create(j&&j.prototype),ToKeyedSequence.prototype.constructor=ToKeyedSequence,ToKeyedSequence.prototype.get=function get(j,_e){return this._iter.get(j,_e)},ToKeyedSequence.prototype.has=function has(j){return this._iter.has(j)},ToKeyedSequence.prototype.valueSeq=function valueSeq(){return this._iter.valueSeq()},ToKeyedSequence.prototype.reverse=function reverse(){var j=this,_e=reverseFactory(this,!0);return this._useKeys||(_e.valueSeq=function(){return j._iter.toSeq().reverse()}),_e},ToKeyedSequence.prototype.map=function map(j,_e){var _t=this,St=mapFactory(this,j,_e);return this._useKeys||(St.valueSeq=function(){return _t._iter.toSeq().map(j,_e)}),St},ToKeyedSequence.prototype.__iterate=function __iterate(j,_e){var _t=this;return this._iter.__iterate((function(_e,St){return j(_e,St,_t)}),_e)},ToKeyedSequence.prototype.__iterator=function __iterator(j,_e){return this._iter.__iterator(j,_e)},ToKeyedSequence}(tI);kI.prototype[zS]=!0;var OI=function(j){function ToIndexedSequence(j){this._iter=j,this.size=j.size}return j&&(ToIndexedSequence.__proto__=j),ToIndexedSequence.prototype=Object.create(j&&j.prototype),ToIndexedSequence.prototype.constructor=ToIndexedSequence,ToIndexedSequence.prototype.includes=function includes(j){return this._iter.includes(j)},ToIndexedSequence.prototype.__iterate=function __iterate(j,_e){var _t=this,St=0;return _e&&ensureSize(this),this._iter.__iterate((function(Tt){return j(Tt,_e?_t.size-++St:St++,_t)}),_e)},ToIndexedSequence.prototype.__iterator=function __iterator(j,_e){var _t=this,St=this._iter.__iterator(1,_e),Tt=0;return _e&&ensureSize(this),new ZS((function(){var Ut=St.next();return Ut.done?Ut:iteratorValue(j,_e?_t.size-++Tt:Tt++,Ut.value,Ut)}))},ToIndexedSequence}(rI),DI=function(j){function ToSetSequence(j){this._iter=j,this.size=j.size}return j&&(ToSetSequence.__proto__=j),ToSetSequence.prototype=Object.create(j&&j.prototype),ToSetSequence.prototype.constructor=ToSetSequence,ToSetSequence.prototype.has=function has(j){return this._iter.includes(j)},ToSetSequence.prototype.__iterate=function __iterate(j,_e){var _t=this;return this._iter.__iterate((function(_e){return j(_e,_e,_t)}),_e)},ToSetSequence.prototype.__iterator=function __iterator(j,_e){var _t=this._iter.__iterator(1,_e);return new ZS((function(){var _e=_t.next();return _e.done?_e:iteratorValue(j,_e.value,_e.value,_e)}))},ToSetSequence}(nI),xI=function(j){function FromEntriesSequence(j){this._iter=j,this.size=j.size}return j&&(FromEntriesSequence.__proto__=j),FromEntriesSequence.prototype=Object.create(j&&j.prototype),FromEntriesSequence.prototype.constructor=FromEntriesSequence,FromEntriesSequence.prototype.entrySeq=function entrySeq(){return this._iter.toSeq()},FromEntriesSequence.prototype.__iterate=function __iterate(j,_e){var _t=this;return this._iter.__iterate((function(_e){if(_e){validateEntry(_e);var St=isCollection(_e);return j(St?_e.get(1):_e[1],St?_e.get(0):_e[0],_t)}}),_e)},FromEntriesSequence.prototype.__iterator=function __iterator(j,_e){var _t=this._iter.__iterator(1,_e);return new ZS((function(){for(;;){var _e=_t.next();if(_e.done)return _e;var St=_e.value;if(St){validateEntry(St);var Tt=isCollection(St);return iteratorValue(j,Tt?St.get(0):St[0],Tt?St.get(1):St[1],_e)}}}))},FromEntriesSequence}(tI);function flipFactory(j){var _e=makeSequence(j);return _e._iter=j,_e.size=j.size,_e.flip=function(){return j},_e.reverse=function(){var _e=j.reverse.apply(this);return _e.flip=function(){return j.reverse()},_e},_e.has=function(_e){return j.includes(_e)},_e.includes=function(_e){return j.has(_e)},_e.cacheResult=cacheResultThrough,_e.__iterateUncached=function(_e,_t){var St=this;return j.__iterate((function(j,_t){return!1!==_e(_t,j,St)}),_t)},_e.__iteratorUncached=function(_e,_t){if(2===_e){var St=j.__iterator(_e,_t);return new ZS((function(){var j=St.next();if(!j.done){var _e=j.value[0];j.value[0]=j.value[1],j.value[1]=_e}return j}))}return j.__iterator(1===_e?0:1,_t)},_e}function mapFactory(j,_e,_t){var St=makeSequence(j);return St.size=j.size,St.has=function(_e){return j.has(_e)},St.get=function(St,Tt){var Ut=j.get(St,jS);return Ut===jS?Tt:_e.call(_t,Ut,St,j)},St.__iterateUncached=function(St,Tt){var Ut=this;return j.__iterate((function(j,Tt,_r){return!1!==St(_e.call(_t,j,Tt,_r),Tt,Ut)}),Tt)},St.__iteratorUncached=function(St,Tt){var Ut=j.__iterator(2,Tt);return new ZS((function(){var Tt=Ut.next();if(Tt.done)return Tt;var _r=Tt.value,_n=_r[0];return iteratorValue(St,_n,_e.call(_t,_r[1],_n,j),Tt)}))},St}function reverseFactory(j,_e){var _t=this,St=makeSequence(j);return St._iter=j,St.size=j.size,St.reverse=function(){return j},j.flip&&(St.flip=function(){var _e=flipFactory(j);return _e.reverse=function(){return j.flip()},_e}),St.get=function(_t,St){return j.get(_e?_t:-1-_t,St)},St.has=function(_t){return j.has(_e?_t:-1-_t)},St.includes=function(_e){return j.includes(_e)},St.cacheResult=cacheResultThrough,St.__iterate=function(_t,St){var Tt=this,Ut=0;return St&&ensureSize(j),j.__iterate((function(j,_r){return _t(j,_e?_r:St?Tt.size-++Ut:Ut++,Tt)}),!St)},St.__iterator=function(St,Tt){var Ut=0;Tt&&ensureSize(j);var _r=j.__iterator(2,!Tt);return new ZS((function(){var j=_r.next();if(j.done)return j;var _n=j.value;return iteratorValue(St,_e?_n[0]:Tt?_t.size-++Ut:Ut++,_n[1],j)}))},St}function filterFactory(j,_e,_t,St){var Tt=makeSequence(j);return St&&(Tt.has=function(St){var Tt=j.get(St,jS);return Tt!==jS&&!!_e.call(_t,Tt,St,j)},Tt.get=function(St,Tt){var Ut=j.get(St,jS);return Ut!==jS&&_e.call(_t,Ut,St,j)?Ut:Tt}),Tt.__iterateUncached=function(Tt,Ut){var _r=this,_n=0;return j.__iterate((function(j,Ut,_i){if(_e.call(_t,j,Ut,_i))return _n++,Tt(j,St?Ut:_n-1,_r)}),Ut),_n},Tt.__iteratorUncached=function(Tt,Ut){var _r=j.__iterator(2,Ut),_n=0;return new ZS((function(){for(;;){var Ut=_r.next();if(Ut.done)return Ut;var _i=Ut.value,Ei=_i[0],Ci=_i[1];if(_e.call(_t,Ci,Ei,j))return iteratorValue(Tt,St?Ei:_n++,Ci,Ut)}}))},Tt}function sliceFactory(j,_e,_t,St){var Tt=j.size;if(wholeSlice(_e,_t,Tt))return j;var Ut=resolveBegin(_e,Tt),_r=resolveEnd(_t,Tt);if(Ut!=Ut||_r!=_r)return sliceFactory(j.toSeq().cacheResult(),_e,_t,St);var _n,_i=_r-Ut;_i==_i&&(_n=_i<0?0:_i);var Ei=makeSequence(j);return Ei.size=0===_n?_n:j.size&&_n||void 0,!St&&isSeq(j)&&_n>=0&&(Ei.get=function(_e,_t){return(_e=wrapIndex(this,_e))>=0&&_e<_n?j.get(_e+Ut,_t):_t}),Ei.__iterateUncached=function(_e,_t){var Tt=this;if(0===_n)return 0;if(_t)return this.cacheResult().__iterate(_e,_t);var _r=0,_i=!0,Ei=0;return j.__iterate((function(j,_t){if(!_i||!(_i=_r++<Ut))return Ei++,!1!==_e(j,St?_t:Ei-1,Tt)&&Ei!==_n})),Ei},Ei.__iteratorUncached=function(_e,_t){if(0!==_n&&_t)return this.cacheResult().__iterator(_e,_t);if(0===_n)return new ZS(iteratorDone);var Tt=j.__iterator(_e,_t),_r=0,_i=0;return new ZS((function(){for(;_r++<Ut;)Tt.next();if(++_i>_n)return{value:void 0,done:!0};var j=Tt.next();return St||1===_e||j.done?j:iteratorValue(_e,_i-1,0===_e?void 0:j.value[1],j)}))},Ei}function skipWhileFactory(j,_e,_t,St){var Tt=makeSequence(j);return Tt.__iterateUncached=function(Tt,Ut){var _r=this;if(Ut)return this.cacheResult().__iterate(Tt,Ut);var _n=!0,_i=0;return j.__iterate((function(j,Ut,Ei){if(!_n||!(_n=_e.call(_t,j,Ut,Ei)))return _i++,Tt(j,St?Ut:_i-1,_r)})),_i},Tt.__iteratorUncached=function(Tt,Ut){var _r=this;if(Ut)return this.cacheResult().__iterator(Tt,Ut);var _n=j.__iterator(2,Ut),_i=!0,Ei=0;return new ZS((function(){var j,Ut,Ci;do{if((j=_n.next()).done)return St||1===Tt?j:iteratorValue(Tt,Ei++,0===Tt?void 0:j.value[1],j);var Di=j.value;Ut=Di[0],Ci=Di[1],_i&&(_i=_e.call(_t,Ci,Ut,_r))}while(_i);return 2===Tt?j:iteratorValue(Tt,Ut,Ci,j)}))},Tt}function concatFactory(j,_e){var _t=isKeyed(j),St=[j].concat(_e).map((function(j){return isCollection(j)?_t&&(j=qS(j)):j=_t?keyedSeqFromValue(j):indexedSeqFromValue(Array.isArray(j)?j:[j]),j})).filter((function(j){return 0!==j.size}));if(0===St.length)return j;if(1===St.length){var Tt=St[0];if(Tt===j||_t&&isKeyed(Tt)||isIndexed(j)&&isIndexed(Tt))return Tt}var Ut=new iI(St);return _t?Ut=Ut.toKeyedSeq():isIndexed(j)||(Ut=Ut.toSetSeq()),(Ut=Ut.flatten(!0)).size=St.reduce((function(j,_e){if(void 0!==j){var _t=_e.size;if(void 0!==_t)return j+_t}}),0),Ut}function flattenFactory(j,_e,_t){var St=makeSequence(j);return St.__iterateUncached=function(Tt,Ut){if(Ut)return this.cacheResult().__iterate(Tt,Ut);var _r=0,_n=!1;return function flatDeep(j,_i){j.__iterate((function(j,Ut){return(!_e||_i<_e)&&isCollection(j)?flatDeep(j,_i+1):(_r++,!1===Tt(j,_t?Ut:_r-1,St)&&(_n=!0)),!_n}),Ut)}(j,0),_r},St.__iteratorUncached=function(St,Tt){if(Tt)return this.cacheResult().__iterator(St,Tt);var Ut=j.__iterator(St,Tt),_r=[],_n=0;return new ZS((function(){for(;Ut;){var j=Ut.next();if(!1===j.done){var _i=j.value;if(2===St&&(_i=_i[1]),_e&&!(_r.length<_e)||!isCollection(_i))return _t?j:iteratorValue(St,_n++,_i,j);_r.push(Ut),Ut=_i.__iterator(St,Tt)}else Ut=_r.pop()}return{value:void 0,done:!0}}))},St}function sortFactory(j,_e,_t){_e||(_e=defaultComparator);var St=isKeyed(j),Tt=0,Ut=j.toSeq().map((function(_e,St){return[St,_e,Tt++,_t?_t(_e,St,j):_e]})).valueSeq().toArray();return Ut.sort((function(j,_t){return _e(j[3],_t[3])||j[2]-_t[2]})).forEach(St?function(j,_e){Ut[_e].length=2}:function(j,_e){Ut[_e]=j[1]}),St?tI(Ut):isIndexed(j)?rI(Ut):nI(Ut)}function maxFactory(j,_e,_t){if(_e||(_e=defaultComparator),_t){var St=j.toSeq().map((function(_e,St){return[_e,_t(_e,St,j)]})).reduce((function(j,_t){return maxCompare(_e,j[1],_t[1])?_t:j}));return St&&St[0]}return j.reduce((function(j,_t){return maxCompare(_e,j,_t)?_t:j}))}function maxCompare(j,_e,_t){var St=j(_t,_e);return 0===St&&_t!==_e&&(null==_t||_t!=_t)||St>0}function zipWithFactory(j,_e,_t,St){var Tt=makeSequence(j),Ut=new iI(_t).map((function(j){return j.size}));return Tt.size=St?Ut.max():Ut.min(),Tt.__iterate=function(j,_e){for(var _t,St=this.__iterator(1,_e),Tt=0;!(_t=St.next()).done&&!1!==j(_t.value,Tt++,this););return Tt},Tt.__iteratorUncached=function(j,Tt){var Ut=_t.map((function(j){return j=VS(j),getIterator(Tt?j.reverse():j)})),_r=0,_n=!1;return new ZS((function(){var _t;return _n||(_t=Ut.map((function(j){return j.next()})),_n=St?_t.every((function(j){return j.done})):_t.some((function(j){return j.done}))),_n?{value:void 0,done:!0}:iteratorValue(j,_r++,_e.apply(null,_t.map((function(j){return j.value}))))}))},Tt}function reify(j,_e){return j===_e?j:isSeq(j)?_e:j.constructor(_e)}function validateEntry(j){if(j!==Object(j))throw new TypeError("Expected [K, V] tuple: "+j)}function collectionClass(j){return isKeyed(j)?qS:isIndexed(j)?QS:KS}function makeSequence(j){return Object.create((isKeyed(j)?tI:isIndexed(j)?rI:nI).prototype)}function cacheResultThrough(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):eI.prototype.cacheResult.call(this)}function defaultComparator(j,_e){return void 0===j&&void 0===_e?0:void 0===j?1:void 0===_e?-1:j>_e?1:j<_e?-1:0}function arrCopy(j,_e){_e=_e||0;for(var _t=Math.max(0,j.length-_e),St=new Array(_t),Tt=0;Tt<_t;Tt++)St[Tt]=j[Tt+_e];return St}function invariant(j,_e){if(!j)throw new Error(_e)}function assertNotInfinite(j){invariant(j!==1/0,"Cannot perform this action with an infinite size.")}function coerceKeyPath(j){if(isArrayLike(j)&&"string"!=typeof j)return j;if(isOrdered(j))return j.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+j)}OI.prototype.cacheResult=kI.prototype.cacheResult=DI.prototype.cacheResult=xI.prototype.cacheResult=cacheResultThrough;var LI=Object.prototype.toString;function isPlainObject(j){if(!j||"object"!=typeof j||"[object Object]"!==LI.call(j))return!1;var _e=Object.getPrototypeOf(j);if(null===_e)return!0;for(var _t=_e,St=Object.getPrototypeOf(_e);null!==St;)_t=St,St=Object.getPrototypeOf(_t);return _t===_e}function isDataStructure(j){return"object"==typeof j&&(isImmutable(j)||Array.isArray(j)||isPlainObject(j))}function quoteString(j){try{return"string"==typeof j?JSON.stringify(j):String(j)}catch(_e){return JSON.stringify(j)}}function has(j,_e){return isImmutable(j)?j.has(_e):isDataStructure(j)&&$S.call(j,_e)}function get(j,_e,_t){return isImmutable(j)?j.get(_e,_t):has(j,_e)?"function"==typeof j.get?j.get(_e):j[_e]:_t}function shallowCopy(j){if(Array.isArray(j))return arrCopy(j);var _e={};for(var _t in j)$S.call(j,_t)&&(_e[_t]=j[_t]);return _e}function remove(j,_e){if(!isDataStructure(j))throw new TypeError("Cannot update non-data-structure value: "+j);if(isImmutable(j)){if(!j.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+j);return j.remove(_e)}if(!$S.call(j,_e))return j;var _t=shallowCopy(j);return Array.isArray(_t)?_t.splice(_e,1):delete _t[_e],_t}function set(j,_e,_t){if(!isDataStructure(j))throw new TypeError("Cannot update non-data-structure value: "+j);if(isImmutable(j)){if(!j.set)throw new TypeError("Cannot update immutable value without .set() method: "+j);return j.set(_e,_t)}if($S.call(j,_e)&&_t===j[_e])return j;var St=shallowCopy(j);return St[_e]=_t,St}function updateIn$1(j,_e,_t,St){St||(St=_t,_t=void 0);var Tt=updateInDeeply(isImmutable(j),j,coerceKeyPath(_e),0,_t,St);return Tt===jS?_t:Tt}function updateInDeeply(j,_e,_t,St,Tt,Ut){var _r=_e===jS;if(St===_t.length){var _n=_r?Tt:_e,_i=Ut(_n);return _i===_n?_e:_i}if(!_r&&!isDataStructure(_e))throw new TypeError("Cannot update within non-data-structure value in path ["+_t.slice(0,St).map(quoteString)+"]: "+_e);var Ei=_t[St],Ci=_r?jS:get(_e,Ei,jS),Di=updateInDeeply(Ci===jS?j:isImmutable(Ci),Ci,_t,St+1,Tt,Ut);return Di===Ci?_e:Di===jS?remove(_e,Ei):set(_r?j?emptyMap():{}:_e,Ei,Di)}function setIn$1(j,_e,_t){return updateIn$1(j,_e,jS,(function(){return _t}))}function setIn(j,_e){return setIn$1(this,j,_e)}function removeIn(j,_e){return updateIn$1(j,_e,(function(){return jS}))}function deleteIn(j){return removeIn(this,j)}function update$1(j,_e,_t,St){return updateIn$1(j,[_e],_t,St)}function update(j,_e,_t){return 1===arguments.length?j(this):update$1(this,j,_e,_t)}function updateIn(j,_e,_t){return updateIn$1(this,j,_e,_t)}function merge$1(){for(var j=[],_e=arguments.length;_e--;)j[_e]=arguments[_e];return mergeIntoKeyedWith(this,j)}function mergeWith$1(j){for(var _e=[],_t=arguments.length-1;_t-- >0;)_e[_t]=arguments[_t+1];if("function"!=typeof j)throw new TypeError("Invalid merger function: "+j);return mergeIntoKeyedWith(this,_e,j)}function mergeIntoKeyedWith(j,_e,_t){for(var St=[],Tt=0;Tt<_e.length;Tt++){var Ut=qS(_e[Tt]);0!==Ut.size&&St.push(Ut)}return 0===St.length?j:0!==j.toSeq().size||j.__ownerID||1!==St.length?j.withMutations((function(j){for(var _e=_t?function(_e,St){update$1(j,St,jS,(function(j){return j===jS?_e:_t(j,_e,St)}))}:function(_e,_t){j.set(_t,_e)},Tt=0;Tt<St.length;Tt++)St[Tt].forEach(_e)})):j.constructor(St[0])}function mergeDeepWithSources(j,_e,_t){return mergeWithSources(j,_e,function deepMergerWith(j){function deepMerger(_e,_t,St){return isDataStructure(_e)&&isDataStructure(_t)&&function areMergeable(j,_e){var _t=eI(j),St=eI(_e);return isIndexed(_t)===isIndexed(St)&&isKeyed(_t)===isKeyed(St)}(_e,_t)?mergeWithSources(_e,[_t],deepMerger):j?j(_e,_t,St):_t}return deepMerger}(_t))}function mergeWithSources(j,_e,_t){if(!isDataStructure(j))throw new TypeError("Cannot merge into non-data-structure value: "+j);if(isImmutable(j))return"function"==typeof _t&&j.mergeWith?j.mergeWith.apply(j,[_t].concat(_e)):j.merge?j.merge.apply(j,_e):j.concat.apply(j,_e);for(var St=Array.isArray(j),Tt=j,Ut=St?QS:qS,_r=St?function(_e){Tt===j&&(Tt=shallowCopy(Tt)),Tt.push(_e)}:function(_e,St){var Ut=$S.call(Tt,St),_r=Ut&&_t?_t(Tt[St],_e,St):_e;Ut&&_r===Tt[St]||(Tt===j&&(Tt=shallowCopy(Tt)),Tt[St]=_r)},_n=0;_n<_e.length;_n++)Ut(_e[_n]).forEach(_r);return Tt}function mergeDeep(){for(var j=[],_e=arguments.length;_e--;)j[_e]=arguments[_e];return mergeDeepWithSources(this,j)}function mergeDeepWith(j){for(var _e=[],_t=arguments.length-1;_t-- >0;)_e[_t]=arguments[_t+1];return mergeDeepWithSources(this,_e,j)}function mergeIn(j){for(var _e=[],_t=arguments.length-1;_t-- >0;)_e[_t]=arguments[_t+1];return updateIn$1(this,j,emptyMap(),(function(j){return mergeWithSources(j,_e)}))}function mergeDeepIn(j){for(var _e=[],_t=arguments.length-1;_t-- >0;)_e[_t]=arguments[_t+1];return updateIn$1(this,j,emptyMap(),(function(j){return mergeDeepWithSources(j,_e)}))}function withMutations(j){var _e=this.asMutable();return j(_e),_e.wasAltered()?_e.__ensureOwner(this.__ownerID):this}function asMutable(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)}function asImmutable(){return this.__ensureOwner()}function wasAltered(){return this.__altered}var NI=function(j){function Map(_e){return null==_e?emptyMap():isMap(_e)&&!isOrdered(_e)?_e:emptyMap().withMutations((function(_t){var St=j(_e);assertNotInfinite(St.size),St.forEach((function(j,_e){return _t.set(_e,j)}))}))}return j&&(Map.__proto__=j),Map.prototype=Object.create(j&&j.prototype),Map.prototype.constructor=Map,Map.of=function of(){for(var j=[],_e=arguments.length;_e--;)j[_e]=arguments[_e];return emptyMap().withMutations((function(_e){for(var _t=0;_t<j.length;_t+=2){if(_t+1>=j.length)throw new Error("Missing value for key: "+j[_t]);_e.set(j[_t],j[_t+1])}}))},Map.prototype.toString=function toString(){return this.__toString("Map {","}")},Map.prototype.get=function get(j,_e){return this._root?this._root.get(0,void 0,j,_e):_e},Map.prototype.set=function set(j,_e){return updateMap(this,j,_e)},Map.prototype.remove=function remove(j){return updateMap(this,j,jS)},Map.prototype.deleteAll=function deleteAll(j){var _e=VS(j);return 0===_e.size?this:this.withMutations((function(j){_e.forEach((function(_e){return j.remove(_e)}))}))},Map.prototype.clear=function clear(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):emptyMap()},Map.prototype.sort=function sort(j){return eT(sortFactory(this,j))},Map.prototype.sortBy=function sortBy(j,_e){return eT(sortFactory(this,_e,j))},Map.prototype.map=function map(j,_e){var _t=this;return this.withMutations((function(St){St.forEach((function(Tt,Ut){St.set(Ut,j.call(_e,Tt,Ut,_t))}))}))},Map.prototype.__iterator=function __iterator(j,_e){return new qI(this,j,_e)},Map.prototype.__iterate=function __iterate(j,_e){var _t=this,St=0;return this._root&&this._root.iterate((function(_e){return St++,j(_e[1],_e[0],_t)}),_e),St},Map.prototype.__ensureOwner=function __ensureOwner(j){return j===this.__ownerID?this:j?makeMap(this.size,this._root,j,this.__hash):0===this.size?emptyMap():(this.__ownerID=j,this.__altered=!1,this)},Map}(qS);NI.isMap=isMap;var MI=NI.prototype;MI[uI]=!0,MI[PS]=MI.remove,MI.removeAll=MI.deleteAll,MI.setIn=setIn,MI.removeIn=MI.deleteIn=deleteIn,MI.update=update,MI.updateIn=updateIn,MI.merge=MI.concat=merge$1,MI.mergeWith=mergeWith$1,MI.mergeDeep=mergeDeep,MI.mergeDeepWith=mergeDeepWith,MI.mergeIn=mergeIn,MI.mergeDeepIn=mergeDeepIn,MI.withMutations=withMutations,MI.wasAltered=wasAltered,MI.asImmutable=asImmutable,MI["@@transducer/init"]=MI.asMutable=asMutable,MI["@@transducer/step"]=function(j,_e){return j.set(_e[0],_e[1])},MI["@@transducer/result"]=function(j){return j.asImmutable()};var BI=function ArrayMapNode(j,_e){this.ownerID=j,this.entries=_e};BI.prototype.get=function get(j,_e,_t,St){for(var Tt=this.entries,Ut=0,_r=Tt.length;Ut<_r;Ut++)if(is(_t,Tt[Ut][0]))return Tt[Ut][1];return St},BI.prototype.update=function update(j,_e,_t,St,Tt,Ut,_r){for(var _n=Tt===jS,_i=this.entries,Ei=0,Ci=_i.length;Ei<Ci&&!is(St,_i[Ei][0]);Ei++);var Di=Ei<Ci;if(Di?_i[Ei][1]===Tt:_n)return this;if(SetRef(_r),(_n||!Di)&&SetRef(Ut),!_n||1!==_i.length){if(!Di&&!_n&&_i.length>=QI)return function createNodes(j,_e,_t,St){j||(j=new OwnerID);for(var Tt=new GI(j,hash(_t),[_t,St]),Ut=0;Ut<_e.length;Ut++){var _r=_e[Ut];Tt=Tt.update(j,0,void 0,_r[0],_r[1])}return Tt}(j,_i,St,Tt);var Fi=j&&j===this.ownerID,_o=Fi?_i:arrCopy(_i);return Di?_n?Ei===Ci-1?_o.pop():_o[Ei]=_o.pop():_o[Ei]=[St,Tt]:_o.push([St,Tt]),Fi?(this.entries=_o,this):new BI(j,_o)}};var jI=function BitmapIndexedNode(j,_e,_t){this.ownerID=j,this.bitmap=_e,this.nodes=_t};jI.prototype.get=function get(j,_e,_t,St){void 0===_e&&(_e=hash(_t));var Tt=1<<((0===j?_e:_e>>>j)&BS),Ut=this.bitmap;return 0==(Ut&Tt)?St:this.nodes[popCount(Ut&Tt-1)].get(j+5,_e,_t,St)},jI.prototype.update=function update(j,_e,_t,St,Tt,Ut,_r){void 0===_t&&(_t=hash(St));var _n=(0===_e?_t:_t>>>_e)&BS,_i=1<<_n,Ei=this.bitmap,Ci=0!=(Ei&_i);if(!Ci&&Tt===jS)return this;var Di=popCount(Ei&_i-1),Fi=this.nodes,_o=Ci?Fi[Di]:void 0,ga=updateNode(_o,j,_e+5,_t,St,Tt,Ut,_r);if(ga===_o)return this;if(!Ci&&ga&&Fi.length>=KI)return function expandNodes(j,_e,_t,St,Tt){for(var Ut=0,_r=new Array(MS),_n=0;0!==_t;_n++,_t>>>=1)_r[_n]=1&_t?_e[Ut++]:void 0;return _r[St]=Tt,new UI(j,Ut+1,_r)}(j,Fi,Ei,_n,ga);if(Ci&&!ga&&2===Fi.length&&isLeafNode(Fi[1^Di]))return Fi[1^Di];if(Ci&&ga&&1===Fi.length&&isLeafNode(ga))return ga;var _a=j&&j===this.ownerID,_s=Ci?ga?Ei:Ei^_i:Ei|_i,_c=Ci?ga?setAt(Fi,Di,ga,_a):function spliceOut(j,_e,_t){var St=j.length-1;if(_t&&_e===St)return j.pop(),j;for(var Tt=new Array(St),Ut=0,_r=0;_r<St;_r++)_r===_e&&(Ut=1),Tt[_r]=j[_r+Ut];return Tt}(Fi,Di,_a):function spliceIn(j,_e,_t,St){var Tt=j.length+1;if(St&&_e+1===Tt)return j[_e]=_t,j;for(var Ut=new Array(Tt),_r=0,_n=0;_n<Tt;_n++)_n===_e?(Ut[_n]=_t,_r=-1):Ut[_n]=j[_n+_r];return Ut}(Fi,Di,ga,_a);return _a?(this.bitmap=_s,this.nodes=_c,this):new jI(j,_s,_c)};var UI=function HashArrayMapNode(j,_e,_t){this.ownerID=j,this.count=_e,this.nodes=_t};UI.prototype.get=function get(j,_e,_t,St){void 0===_e&&(_e=hash(_t));var Tt=(0===j?_e:_e>>>j)&BS,Ut=this.nodes[Tt];return Ut?Ut.get(j+5,_e,_t,St):St},UI.prototype.update=function update(j,_e,_t,St,Tt,Ut,_r){void 0===_t&&(_t=hash(St));var _n=(0===_e?_t:_t>>>_e)&BS,_i=Tt===jS,Ei=this.nodes,Ci=Ei[_n];if(_i&&!Ci)return this;var Di=updateNode(Ci,j,_e+5,_t,St,Tt,Ut,_r);if(Di===Ci)return this;var Fi=this.count;if(Ci){if(!Di&&--Fi<WI)return function packNodes(j,_e,_t,St){for(var Tt=0,Ut=0,_r=new Array(_t),_n=0,_i=1,Ei=_e.length;_n<Ei;_n++,_i<<=1){var Ci=_e[_n];void 0!==Ci&&_n!==St&&(Tt|=_i,_r[Ut++]=Ci)}return new jI(j,Tt,_r)}(j,Ei,Fi,_n)}else Fi++;var _o=j&&j===this.ownerID,ga=setAt(Ei,_n,Di,_o);return _o?(this.count=Fi,this.nodes=ga,this):new UI(j,Fi,ga)};var FI=function HashCollisionNode(j,_e,_t){this.ownerID=j,this.keyHash=_e,this.entries=_t};FI.prototype.get=function get(j,_e,_t,St){for(var Tt=this.entries,Ut=0,_r=Tt.length;Ut<_r;Ut++)if(is(_t,Tt[Ut][0]))return Tt[Ut][1];return St},FI.prototype.update=function update(j,_e,_t,St,Tt,Ut,_r){void 0===_t&&(_t=hash(St));var _n=Tt===jS;if(_t!==this.keyHash)return _n?this:(SetRef(_r),SetRef(Ut),mergeIntoNode(this,j,_e,_t,[St,Tt]));for(var _i=this.entries,Ei=0,Ci=_i.length;Ei<Ci&&!is(St,_i[Ei][0]);Ei++);var Di=Ei<Ci;if(Di?_i[Ei][1]===Tt:_n)return this;if(SetRef(_r),(_n||!Di)&&SetRef(Ut),_n&&2===Ci)return new GI(j,this.keyHash,_i[1^Ei]);var Fi=j&&j===this.ownerID,_o=Fi?_i:arrCopy(_i);return Di?_n?Ei===Ci-1?_o.pop():_o[Ei]=_o.pop():_o[Ei]=[St,Tt]:_o.push([St,Tt]),Fi?(this.entries=_o,this):new FI(j,this.keyHash,_o)};var GI=function ValueNode(j,_e,_t){this.ownerID=j,this.keyHash=_e,this.entry=_t};GI.prototype.get=function get(j,_e,_t,St){return is(_t,this.entry[0])?this.entry[1]:St},GI.prototype.update=function update(j,_e,_t,St,Tt,Ut,_r){var _n=Tt===jS,_i=is(St,this.entry[0]);return(_i?Tt===this.entry[1]:_n)?this:(SetRef(_r),_n?void SetRef(Ut):_i?j&&j===this.ownerID?(this.entry[1]=Tt,this):new GI(j,this.keyHash,[St,Tt]):(SetRef(Ut),mergeIntoNode(this,j,_e,hash(St),[St,Tt])))},BI.prototype.iterate=FI.prototype.iterate=function(j,_e){for(var _t=this.entries,St=0,Tt=_t.length-1;St<=Tt;St++)if(!1===j(_t[_e?Tt-St:St]))return!1},jI.prototype.iterate=UI.prototype.iterate=function(j,_e){for(var _t=this.nodes,St=0,Tt=_t.length-1;St<=Tt;St++){var Ut=_t[_e?Tt-St:St];if(Ut&&!1===Ut.iterate(j,_e))return!1}},GI.prototype.iterate=function(j,_e){return j(this.entry)};var VI,qI=function(j){function MapIterator(j,_e,_t){this._type=_e,this._reverse=_t,this._stack=j._root&&mapIteratorFrame(j._root)}return j&&(MapIterator.__proto__=j),MapIterator.prototype=Object.create(j&&j.prototype),MapIterator.prototype.constructor=MapIterator,MapIterator.prototype.next=function next(){for(var j=this._type,_e=this._stack;_e;){var _t=_e.node,St=_e.index++,Tt=void 0;if(_t.entry){if(0===St)return mapIteratorValue(j,_t.entry)}else if(_t.entries){if(St<=(Tt=_t.entries.length-1))return mapIteratorValue(j,_t.entries[this._reverse?Tt-St:St])}else if(St<=(Tt=_t.nodes.length-1)){var Ut=_t.nodes[this._reverse?Tt-St:St];if(Ut){if(Ut.entry)return mapIteratorValue(j,Ut.entry);_e=this._stack=mapIteratorFrame(Ut,_e)}continue}_e=this._stack=this._stack.__prev}return{value:void 0,done:!0}},MapIterator}(ZS);function mapIteratorValue(j,_e){return iteratorValue(j,_e[0],_e[1])}function mapIteratorFrame(j,_e){return{node:j,index:0,__prev:_e}}function makeMap(j,_e,_t,St){var Tt=Object.create(MI);return Tt.size=j,Tt._root=_e,Tt.__ownerID=_t,Tt.__hash=St,Tt.__altered=!1,Tt}function emptyMap(){return VI||(VI=makeMap(0))}function updateMap(j,_e,_t){var St,Tt;if(j._root){var Ut={value:!1},_r={value:!1};if(St=updateNode(j._root,j.__ownerID,0,void 0,_e,_t,Ut,_r),!_r.value)return j;Tt=j.size+(Ut.value?_t===jS?-1:1:0)}else{if(_t===jS)return j;Tt=1,St=new BI(j.__ownerID,[[_e,_t]])}return j.__ownerID?(j.size=Tt,j._root=St,j.__hash=void 0,j.__altered=!0,j):St?makeMap(Tt,St):emptyMap()}function updateNode(j,_e,_t,St,Tt,Ut,_r,_n){return j?j.update(_e,_t,St,Tt,Ut,_r,_n):Ut===jS?j:(SetRef(_n),SetRef(_r),new GI(_e,St,[Tt,Ut]))}function isLeafNode(j){return j.constructor===GI||j.constructor===FI}function mergeIntoNode(j,_e,_t,St,Tt){if(j.keyHash===St)return new FI(_e,St,[j.entry,Tt]);var Ut,_r=(0===_t?j.keyHash:j.keyHash>>>_t)&BS,_n=(0===_t?St:St>>>_t)&BS,_i=_r===_n?[mergeIntoNode(j,_e,_t+5,St,Tt)]:(Ut=new GI(_e,St,Tt),_r<_n?[j,Ut]:[Ut,j]);return new jI(_e,1<<_r|1<<_n,_i)}function popCount(j){return j=(j=(858993459&(j-=j>>1&1431655765))+(j>>2&858993459))+(j>>4)&252645135,j+=j>>8,127&(j+=j>>16)}function setAt(j,_e,_t,St){var Tt=St?j:arrCopy(j);return Tt[_e]=_t,Tt}var QI=8,KI=16,WI=8,HI="@@__IMMUTABLE_LIST__@@";function isList(j){return Boolean(j&&j[HI])}var zI=function(j){function List(_e){var _t=emptyList();if(null==_e)return _t;if(isList(_e))return _e;var St=j(_e),Tt=St.size;return 0===Tt?_t:(assertNotInfinite(Tt),Tt>0&&Tt<MS?makeList(0,Tt,5,null,new JI(St.toArray())):_t.withMutations((function(j){j.setSize(Tt),St.forEach((function(_e,_t){return j.set(_t,_e)}))})))}return j&&(List.__proto__=j),List.prototype=Object.create(j&&j.prototype),List.prototype.constructor=List,List.of=function of(){return this(arguments)},List.prototype.toString=function toString(){return this.__toString("List [","]")},List.prototype.get=function get(j,_e){if((j=wrapIndex(this,j))>=0&&j<this.size){var _t=listNodeFor(this,j+=this._origin);return _t&&_t.array[j&BS]}return _e},List.prototype.set=function set(j,_e){return function updateList(j,_e,_t){if(_e=wrapIndex(j,_e),_e!=_e)return j;if(_e>=j.size||_e<0)return j.withMutations((function(j){_e<0?setListBounds(j,_e).set(0,_t):setListBounds(j,0,_e+1).set(_e,_t)}));_e+=j._origin;var St=j._tail,Tt=j._root,Ut={value:!1};_e>=getTailOffset(j._capacity)?St=updateVNode(St,j.__ownerID,0,_e,_t,Ut):Tt=updateVNode(Tt,j.__ownerID,j._level,_e,_t,Ut);if(!Ut.value)return j;if(j.__ownerID)return j._root=Tt,j._tail=St,j.__hash=void 0,j.__altered=!0,j;return makeList(j._origin,j._capacity,j._level,Tt,St)}(this,j,_e)},List.prototype.remove=function remove(j){return this.has(j)?0===j?this.shift():j===this.size-1?this.pop():this.splice(j,1):this},List.prototype.insert=function insert(j,_e){return this.splice(j,0,_e)},List.prototype.clear=function clear(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):emptyList()},List.prototype.push=function push(){var j=arguments,_e=this.size;return this.withMutations((function(_t){setListBounds(_t,0,_e+j.length);for(var St=0;St<j.length;St++)_t.set(_e+St,j[St])}))},List.prototype.pop=function pop(){return setListBounds(this,0,-1)},List.prototype.unshift=function unshift(){var j=arguments;return this.withMutations((function(_e){setListBounds(_e,-j.length);for(var _t=0;_t<j.length;_t++)_e.set(_t,j[_t])}))},List.prototype.shift=function shift(){return setListBounds(this,1)},List.prototype.concat=function concat(){for(var _e=arguments,_t=[],St=0;St<arguments.length;St++){var Tt=_e[St],Ut=j("string"!=typeof Tt&&hasIterator(Tt)?Tt:[Tt]);0!==Ut.size&&_t.push(Ut)}return 0===_t.length?this:0!==this.size||this.__ownerID||1!==_t.length?this.withMutations((function(j){_t.forEach((function(_e){return _e.forEach((function(_e){return j.push(_e)}))}))})):this.constructor(_t[0])},List.prototype.setSize=function setSize(j){return setListBounds(this,0,j)},List.prototype.map=function map(j,_e){var _t=this;return this.withMutations((function(St){for(var Tt=0;Tt<_t.size;Tt++)St.set(Tt,j.call(_e,St.get(Tt),Tt,_t))}))},List.prototype.slice=function slice(j,_e){var _t=this.size;return wholeSlice(j,_e,_t)?this:setListBounds(this,resolveBegin(j,_t),resolveEnd(_e,_t))},List.prototype.__iterator=function __iterator(j,_e){var _t=_e?this.size:0,St=iterateList(this,_e);return new ZS((function(){var Tt=St();return Tt===ZI?{value:void 0,done:!0}:iteratorValue(j,_e?--_t:_t++,Tt)}))},List.prototype.__iterate=function __iterate(j,_e){for(var _t,St=_e?this.size:0,Tt=iterateList(this,_e);(_t=Tt())!==ZI&&!1!==j(_t,_e?--St:St++,this););return St},List.prototype.__ensureOwner=function __ensureOwner(j){return j===this.__ownerID?this:j?makeList(this._origin,this._capacity,this._level,this._root,this._tail,j,this.__hash):0===this.size?emptyList():(this.__ownerID=j,this.__altered=!1,this)},List}(QS);zI.isList=isList;var YI=zI.prototype;YI[HI]=!0,YI[PS]=YI.remove,YI.merge=YI.concat,YI.setIn=setIn,YI.deleteIn=YI.removeIn=deleteIn,YI.update=update,YI.updateIn=updateIn,YI.mergeIn=mergeIn,YI.mergeDeepIn=mergeDeepIn,YI.withMutations=withMutations,YI.wasAltered=wasAltered,YI.asImmutable=asImmutable,YI["@@transducer/init"]=YI.asMutable=asMutable,YI["@@transducer/step"]=function(j,_e){return j.push(_e)},YI["@@transducer/result"]=function(j){return j.asImmutable()};var JI=function VNode(j,_e){this.array=j,this.ownerID=_e};JI.prototype.removeBefore=function removeBefore(j,_e,_t){if(_t===_e?1<<_e:0===this.array.length)return this;var St=_t>>>_e&BS;if(St>=this.array.length)return new JI([],j);var Tt,Ut=0===St;if(_e>0){var _r=this.array[St];if((Tt=_r&&_r.removeBefore(j,_e-5,_t))===_r&&Ut)return this}if(Ut&&!Tt)return this;var _n=editableVNode(this,j);if(!Ut)for(var _i=0;_i<St;_i++)_n.array[_i]=void 0;return Tt&&(_n.array[St]=Tt),_n},JI.prototype.removeAfter=function removeAfter(j,_e,_t){if(_t===(_e?1<<_e:0)||0===this.array.length)return this;var St,Tt=_t-1>>>_e&BS;if(Tt>=this.array.length)return this;if(_e>0){var Ut=this.array[Tt];if((St=Ut&&Ut.removeAfter(j,_e-5,_t))===Ut&&Tt===this.array.length-1)return this}var _r=editableVNode(this,j);return _r.array.splice(Tt+1),St&&(_r.array[Tt]=St),_r};var XI,ZI={};function iterateList(j,_e){var _t=j._origin,St=j._capacity,Tt=getTailOffset(St),Ut=j._tail;return iterateNodeOrLeaf(j._root,j._level,0);function iterateNodeOrLeaf(j,_r,_n){return 0===_r?function iterateLeaf(j,_r){var _n=_r===Tt?Ut&&Ut.array:j&&j.array,_i=_r>_t?0:_t-_r,Ei=St-_r;Ei>MS&&(Ei=MS);return function(){if(_i===Ei)return ZI;var j=_e?--Ei:_i++;return _n&&_n[j]}}(j,_n):function iterateNode(j,Tt,Ut){var _r,_n=j&&j.array,_i=Ut>_t?0:_t-Ut>>Tt,Ei=1+(St-Ut>>Tt);Ei>MS&&(Ei=MS);return function(){for(;;){if(_r){var j=_r();if(j!==ZI)return j;_r=null}if(_i===Ei)return ZI;var _t=_e?--Ei:_i++;_r=iterateNodeOrLeaf(_n&&_n[_t],Tt-5,Ut+(_t<<Tt))}}}(j,_r,_n)}}function makeList(j,_e,_t,St,Tt,Ut,_r){var _n=Object.create(YI);return _n.size=_e-j,_n._origin=j,_n._capacity=_e,_n._level=_t,_n._root=St,_n._tail=Tt,_n.__ownerID=Ut,_n.__hash=_r,_n.__altered=!1,_n}function emptyList(){return XI||(XI=makeList(0,0,5))}function updateVNode(j,_e,_t,St,Tt,Ut){var _r,_n=St>>>_t&BS,_i=j&&_n<j.array.length;if(!_i&&void 0===Tt)return j;if(_t>0){var Ei=j&&j.array[_n],Ci=updateVNode(Ei,_e,_t-5,St,Tt,Ut);return Ci===Ei?j:((_r=editableVNode(j,_e)).array[_n]=Ci,_r)}return _i&&j.array[_n]===Tt?j:(Ut&&SetRef(Ut),_r=editableVNode(j,_e),void 0===Tt&&_n===_r.array.length-1?_r.array.pop():_r.array[_n]=Tt,_r)}function editableVNode(j,_e){return _e&&j&&_e===j.ownerID?j:new JI(j?j.array.slice():[],_e)}function listNodeFor(j,_e){if(_e>=getTailOffset(j._capacity))return j._tail;if(_e<1<<j._level+5){for(var _t=j._root,St=j._level;_t&&St>0;)_t=_t.array[_e>>>St&BS],St-=5;return _t}}function setListBounds(j,_e,_t){void 0!==_e&&(_e|=0),void 0!==_t&&(_t|=0);var St=j.__ownerID||new OwnerID,Tt=j._origin,Ut=j._capacity,_r=Tt+_e,_n=void 0===_t?Ut:_t<0?Ut+_t:Tt+_t;if(_r===Tt&&_n===Ut)return j;if(_r>=_n)return j.clear();for(var _i=j._level,Ei=j._root,Ci=0;_r+Ci<0;)Ei=new JI(Ei&&Ei.array.length?[void 0,Ei]:[],St),Ci+=1<<(_i+=5);Ci&&(_r+=Ci,Tt+=Ci,_n+=Ci,Ut+=Ci);for(var Di=getTailOffset(Ut),Fi=getTailOffset(_n);Fi>=1<<_i+5;)Ei=new JI(Ei&&Ei.array.length?[Ei]:[],St),_i+=5;var _o=j._tail,ga=Fi<Di?listNodeFor(j,_n-1):Fi>Di?new JI([],St):_o;if(_o&&Fi>Di&&_r<Ut&&_o.array.length){for(var _a=Ei=editableVNode(Ei,St),_s=_i;_s>5;_s-=5){var _c=Di>>>_s&BS;_a=_a.array[_c]=editableVNode(_a.array[_c],St)}_a.array[Di>>>5&BS]=_o}if(_n<Ut&&(ga=ga&&ga.removeAfter(St,0,_n)),_r>=Fi)_r-=Fi,_n-=Fi,_i=5,Ei=null,ga=ga&&ga.removeBefore(St,0,_r);else if(_r>Tt||Fi<Di){for(Ci=0;Ei;){var kc=_r>>>_i&BS;if(kc!==Fi>>>_i&BS)break;kc&&(Ci+=(1<<_i)*kc),_i-=5,Ei=Ei.array[kc]}Ei&&_r>Tt&&(Ei=Ei.removeBefore(St,_i,_r-Ci)),Ei&&Fi<Di&&(Ei=Ei.removeAfter(St,_i,Fi-Ci)),Ci&&(_r-=Ci,_n-=Ci)}return j.__ownerID?(j.size=_n-_r,j._origin=_r,j._capacity=_n,j._level=_i,j._root=Ei,j._tail=ga,j.__hash=void 0,j.__altered=!0,j):makeList(_r,_n,_i,Ei,ga)}function getTailOffset(j){return j<MS?0:j-1>>>5<<5}var $I,eT=function(j){function OrderedMap(j){return null==j?emptyOrderedMap():isOrderedMap(j)?j:emptyOrderedMap().withMutations((function(_e){var _t=qS(j);assertNotInfinite(_t.size),_t.forEach((function(j,_t){return _e.set(_t,j)}))}))}return j&&(OrderedMap.__proto__=j),OrderedMap.prototype=Object.create(j&&j.prototype),OrderedMap.prototype.constructor=OrderedMap,OrderedMap.of=function of(){return this(arguments)},OrderedMap.prototype.toString=function toString(){return this.__toString("OrderedMap {","}")},OrderedMap.prototype.get=function get(j,_e){var _t=this._map.get(j);return void 0!==_t?this._list.get(_t)[1]:_e},OrderedMap.prototype.clear=function clear(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):emptyOrderedMap()},OrderedMap.prototype.set=function set(j,_e){return updateOrderedMap(this,j,_e)},OrderedMap.prototype.remove=function remove(j){return updateOrderedMap(this,j,jS)},OrderedMap.prototype.__iterate=function __iterate(j,_e){var _t=this;return this._list.__iterate((function(_e){return _e&&j(_e[1],_e[0],_t)}),_e)},OrderedMap.prototype.__iterator=function __iterator(j,_e){return this._list.fromEntrySeq().__iterator(j,_e)},OrderedMap.prototype.__ensureOwner=function __ensureOwner(j){if(j===this.__ownerID)return this;var _e=this._map.__ensureOwner(j),_t=this._list.__ensureOwner(j);return j?makeOrderedMap(_e,_t,j,this.__hash):0===this.size?emptyOrderedMap():(this.__ownerID=j,this.__altered=!1,this._map=_e,this._list=_t,this)},OrderedMap}(NI);function makeOrderedMap(j,_e,_t,St){var Tt=Object.create(eT.prototype);return Tt.size=j?j.size:0,Tt._map=j,Tt._list=_e,Tt.__ownerID=_t,Tt.__hash=St,Tt.__altered=!1,Tt}function emptyOrderedMap(){return $I||($I=makeOrderedMap(emptyMap(),emptyList()))}function updateOrderedMap(j,_e,_t){var St,Tt,Ut=j._map,_r=j._list,_n=Ut.get(_e),_i=void 0!==_n;if(_t===jS){if(!_i)return j;_r.size>=MS&&_r.size>=2*Ut.size?(St=(Tt=_r.filter((function(j,_e){return void 0!==j&&_n!==_e}))).toKeyedSeq().map((function(j){return j[0]})).flip().toMap(),j.__ownerID&&(St.__ownerID=Tt.__ownerID=j.__ownerID)):(St=Ut.remove(_e),Tt=_n===_r.size-1?_r.pop():_r.set(_n,void 0))}else if(_i){if(_t===_r.get(_n)[1])return j;St=Ut,Tt=_r.set(_n,[_e,_t])}else St=Ut.set(_e,_r.size),Tt=_r.set(_r.size,[_e,_t]);return j.__ownerID?(j.size=St.size,j._map=St,j._list=Tt,j.__hash=void 0,j.__altered=!0,j):makeOrderedMap(St,Tt)}eT.isOrderedMap=isOrderedMap,eT.prototype[zS]=!0,eT.prototype[PS]=eT.prototype.remove;var tT="@@__IMMUTABLE_STACK__@@";function isStack(j){return Boolean(j&&j[tT])}var rT=function(j){function Stack(j){return null==j?emptyStack():isStack(j)?j:emptyStack().pushAll(j)}return j&&(Stack.__proto__=j),Stack.prototype=Object.create(j&&j.prototype),Stack.prototype.constructor=Stack,Stack.of=function of(){return this(arguments)},Stack.prototype.toString=function toString(){return this.__toString("Stack [","]")},Stack.prototype.get=function get(j,_e){var _t=this._head;for(j=wrapIndex(this,j);_t&&j--;)_t=_t.next;return _t?_t.value:_e},Stack.prototype.peek=function peek(){return this._head&&this._head.value},Stack.prototype.push=function push(){var j=arguments;if(0===arguments.length)return this;for(var _e=this.size+arguments.length,_t=this._head,St=arguments.length-1;St>=0;St--)_t={value:j[St],next:_t};return this.__ownerID?(this.size=_e,this._head=_t,this.__hash=void 0,this.__altered=!0,this):makeStack(_e,_t)},Stack.prototype.pushAll=function pushAll(_e){if(0===(_e=j(_e)).size)return this;if(0===this.size&&isStack(_e))return _e;assertNotInfinite(_e.size);var _t=this.size,St=this._head;return _e.__iterate((function(j){_t++,St={value:j,next:St}}),!0),this.__ownerID?(this.size=_t,this._head=St,this.__hash=void 0,this.__altered=!0,this):makeStack(_t,St)},Stack.prototype.pop=function pop(){return this.slice(1)},Stack.prototype.clear=function clear(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):emptyStack()},Stack.prototype.slice=function slice(_e,_t){if(wholeSlice(_e,_t,this.size))return this;var St=resolveBegin(_e,this.size);if(resolveEnd(_t,this.size)!==this.size)return j.prototype.slice.call(this,_e,_t);for(var Tt=this.size-St,Ut=this._head;St--;)Ut=Ut.next;return this.__ownerID?(this.size=Tt,this._head=Ut,this.__hash=void 0,this.__altered=!0,this):makeStack(Tt,Ut)},Stack.prototype.__ensureOwner=function __ensureOwner(j){return j===this.__ownerID?this:j?makeStack(this.size,this._head,j,this.__hash):0===this.size?emptyStack():(this.__ownerID=j,this.__altered=!1,this)},Stack.prototype.__iterate=function __iterate(j,_e){var _t=this;if(_e)return new iI(this.toArray()).__iterate((function(_e,St){return j(_e,St,_t)}),_e);for(var St=0,Tt=this._head;Tt&&!1!==j(Tt.value,St++,this);)Tt=Tt.next;return St},Stack.prototype.__iterator=function __iterator(j,_e){if(_e)return new iI(this.toArray()).__iterator(j,_e);var _t=0,St=this._head;return new ZS((function(){if(St){var _e=St.value;return St=St.next,iteratorValue(j,_t++,_e)}return{value:void 0,done:!0}}))},Stack}(QS);rT.isStack=isStack;var nT,iT=rT.prototype;function makeStack(j,_e,_t,St){var Tt=Object.create(iT);return Tt.size=j,Tt._head=_e,Tt.__ownerID=_t,Tt.__hash=St,Tt.__altered=!1,Tt}function emptyStack(){return nT||(nT=makeStack(0))}iT[tT]=!0,iT.shift=iT.pop,iT.unshift=iT.push,iT.unshiftAll=iT.pushAll,iT.withMutations=withMutations,iT.wasAltered=wasAltered,iT.asImmutable=asImmutable,iT["@@transducer/init"]=iT.asMutable=asMutable,iT["@@transducer/step"]=function(j,_e){return j.unshift(_e)},iT["@@transducer/result"]=function(j){return j.asImmutable()};var oT="@@__IMMUTABLE_SET__@@";function isSet(j){return Boolean(j&&j[oT])}function isOrderedSet(j){return isSet(j)&&isOrdered(j)}function deepEqual(j,_e){if(j===_e)return!0;if(!isCollection(_e)||void 0!==j.size&&void 0!==_e.size&&j.size!==_e.size||void 0!==j.__hash&&void 0!==_e.__hash&&j.__hash!==_e.__hash||isKeyed(j)!==isKeyed(_e)||isIndexed(j)!==isIndexed(_e)||isOrdered(j)!==isOrdered(_e))return!1;if(0===j.size&&0===_e.size)return!0;var _t=!isAssociative(j);if(isOrdered(j)){var St=j.entries();return _e.every((function(j,_e){var Tt=St.next().value;return Tt&&is(Tt[1],j)&&(_t||is(Tt[0],_e))}))&&St.next().done}var Tt=!1;if(void 0===j.size)if(void 0===_e.size)"function"==typeof j.cacheResult&&j.cacheResult();else{Tt=!0;var Ut=j;j=_e,_e=Ut}var _r=!0,_n=_e.__iterate((function(_e,St){if(_t?!j.has(_e):Tt?!is(_e,j.get(St,jS)):!is(j.get(St,jS),_e))return _r=!1,!1}));return _r&&j.size===_n}function mixin(j,_e){var keyCopier=function(_t){j.prototype[_t]=_e[_t]};return Object.keys(_e).forEach(keyCopier),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(_e).forEach(keyCopier),j}function toJS(j){if(!j||"object"!=typeof j)return j;if(!isCollection(j)){if(!isDataStructure(j))return j;j=eI(j)}if(isKeyed(j)){var _e={};return j.__iterate((function(j,_t){_e[_t]=toJS(j)})),_e}var _t=[];return j.__iterate((function(j){_t.push(toJS(j))})),_t}var aT=function(j){function Set(_e){return null==_e?emptySet():isSet(_e)&&!isOrdered(_e)?_e:emptySet().withMutations((function(_t){var St=j(_e);assertNotInfinite(St.size),St.forEach((function(j){return _t.add(j)}))}))}return j&&(Set.__proto__=j),Set.prototype=Object.create(j&&j.prototype),Set.prototype.constructor=Set,Set.of=function of(){return this(arguments)},Set.fromKeys=function fromKeys(j){return this(qS(j).keySeq())},Set.intersect=function intersect(j){return(j=VS(j).toArray()).length?cT.intersect.apply(Set(j.pop()),j):emptySet()},Set.union=function union(j){return(j=VS(j).toArray()).length?cT.union.apply(Set(j.pop()),j):emptySet()},Set.prototype.toString=function toString(){return this.__toString("Set {","}")},Set.prototype.has=function has(j){return this._map.has(j)},Set.prototype.add=function add(j){return updateSet(this,this._map.set(j,j))},Set.prototype.remove=function remove(j){return updateSet(this,this._map.remove(j))},Set.prototype.clear=function clear(){return updateSet(this,this._map.clear())},Set.prototype.map=function map(j,_e){var _t=this,St=!1,Tt=updateSet(this,this._map.mapEntries((function(Tt){var Ut=Tt[1],_r=j.call(_e,Ut,Ut,_t);return _r!==Ut&&(St=!0),[_r,_r]}),_e));return St?Tt:this},Set.prototype.union=function union(){for(var _e=[],_t=arguments.length;_t--;)_e[_t]=arguments[_t];return 0===(_e=_e.filter((function(j){return 0!==j.size}))).length?this:0!==this.size||this.__ownerID||1!==_e.length?this.withMutations((function(_t){for(var St=0;St<_e.length;St++)j(_e[St]).forEach((function(j){return _t.add(j)}))})):this.constructor(_e[0])},Set.prototype.intersect=function intersect(){for(var _e=[],_t=arguments.length;_t--;)_e[_t]=arguments[_t];if(0===_e.length)return this;_e=_e.map((function(_e){return j(_e)}));var St=[];return this.forEach((function(j){_e.every((function(_e){return _e.includes(j)}))||St.push(j)})),this.withMutations((function(j){St.forEach((function(_e){j.remove(_e)}))}))},Set.prototype.subtract=function subtract(){for(var _e=[],_t=arguments.length;_t--;)_e[_t]=arguments[_t];if(0===_e.length)return this;_e=_e.map((function(_e){return j(_e)}));var St=[];return this.forEach((function(j){_e.some((function(_e){return _e.includes(j)}))&&St.push(j)})),this.withMutations((function(j){St.forEach((function(_e){j.remove(_e)}))}))},Set.prototype.sort=function sort(j){return vT(sortFactory(this,j))},Set.prototype.sortBy=function sortBy(j,_e){return vT(sortFactory(this,_e,j))},Set.prototype.wasAltered=function wasAltered(){return this._map.wasAltered()},Set.prototype.__iterate=function __iterate(j,_e){var _t=this;return this._map.__iterate((function(_e){return j(_e,_e,_t)}),_e)},Set.prototype.__iterator=function __iterator(j,_e){return this._map.__iterator(j,_e)},Set.prototype.__ensureOwner=function __ensureOwner(j){if(j===this.__ownerID)return this;var _e=this._map.__ensureOwner(j);return j?this.__make(_e,j):0===this.size?this.__empty():(this.__ownerID=j,this._map=_e,this)},Set}(KS);aT.isSet=isSet;var sT,cT=aT.prototype;function updateSet(j,_e){return j.__ownerID?(j.size=_e.size,j._map=_e,j):_e===j._map?j:0===_e.size?j.__empty():j.__make(_e)}function makeSet(j,_e){var _t=Object.create(cT);return _t.size=j?j.size:0,_t._map=j,_t.__ownerID=_e,_t}function emptySet(){return sT||(sT=makeSet(emptyMap()))}cT[oT]=!0,cT[PS]=cT.remove,cT.merge=cT.concat=cT.union,cT.withMutations=withMutations,cT.asImmutable=asImmutable,cT["@@transducer/init"]=cT.asMutable=asMutable,cT["@@transducer/step"]=function(j,_e){return j.add(_e)},cT["@@transducer/result"]=function(j){return j.asImmutable()},cT.__empty=emptySet,cT.__make=makeSet;var uT,lT=function(j){function Range(j,_e,_t){if(!(this instanceof Range))return new Range(j,_e,_t);if(invariant(0!==_t,"Cannot step a Range by 0"),j=j||0,void 0===_e&&(_e=1/0),_t=void 0===_t?1:Math.abs(_t),_e<j&&(_t=-_t),this._start=j,this._end=_e,this._step=_t,this.size=Math.max(0,Math.ceil((_e-j)/_t-1)+1),0===this.size){if(uT)return uT;uT=this}}return j&&(Range.__proto__=j),Range.prototype=Object.create(j&&j.prototype),Range.prototype.constructor=Range,Range.prototype.toString=function toString(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},Range.prototype.get=function get(j,_e){return this.has(j)?this._start+wrapIndex(this,j)*this._step:_e},Range.prototype.includes=function includes(j){var _e=(j-this._start)/this._step;return _e>=0&&_e<this.size&&_e===Math.floor(_e)},Range.prototype.slice=function slice(j,_e){return wholeSlice(j,_e,this.size)?this:(j=resolveBegin(j,this.size),(_e=resolveEnd(_e,this.size))<=j?new Range(0,0):new Range(this.get(j,this._end),this.get(_e,this._end),this._step))},Range.prototype.indexOf=function indexOf(j){var _e=j-this._start;if(_e%this._step==0){var _t=_e/this._step;if(_t>=0&&_t<this.size)return _t}return-1},Range.prototype.lastIndexOf=function lastIndexOf(j){return this.indexOf(j)},Range.prototype.__iterate=function __iterate(j,_e){for(var _t=this.size,St=this._step,Tt=_e?this._start+(_t-1)*St:this._start,Ut=0;Ut!==_t&&!1!==j(Tt,_e?_t-++Ut:Ut++,this);)Tt+=_e?-St:St;return Ut},Range.prototype.__iterator=function __iterator(j,_e){var _t=this.size,St=this._step,Tt=_e?this._start+(_t-1)*St:this._start,Ut=0;return new ZS((function(){if(Ut===_t)return{value:void 0,done:!0};var _r=Tt;return Tt+=_e?-St:St,iteratorValue(j,_e?_t-++Ut:Ut++,_r)}))},Range.prototype.equals=function equals(j){return j instanceof Range?this._start===j._start&&this._end===j._end&&this._step===j._step:deepEqual(this,j)},Range}(rI);function getIn$1(j,_e,_t){for(var St=coerceKeyPath(_e),Tt=0;Tt!==St.length;)if((j=get(j,St[Tt++],jS))===jS)return _t;return j}function getIn(j,_e){return getIn$1(this,j,_e)}function hasIn$1(j,_e){return getIn$1(j,_e,jS)!==jS}function toObject(){assertNotInfinite(this.size);var j={};return this.__iterate((function(_e,_t){j[_t]=_e})),j}VS.isIterable=isCollection,VS.isKeyed=isKeyed,VS.isIndexed=isIndexed,VS.isAssociative=isAssociative,VS.isOrdered=isOrdered,VS.Iterator=ZS,mixin(VS,{toArray:function toArray(){assertNotInfinite(this.size);var j=new Array(this.size||0),_e=isKeyed(this),_t=0;return this.__iterate((function(St,Tt){j[_t++]=_e?[Tt,St]:St})),j},toIndexedSeq:function toIndexedSeq(){return new OI(this)},toJS:function toJS$1(){return toJS(this)},toKeyedSeq:function toKeyedSeq(){return new kI(this,!0)},toMap:function toMap(){return NI(this.toKeyedSeq())},toObject,toOrderedMap:function toOrderedMap(){return eT(this.toKeyedSeq())},toOrderedSet:function toOrderedSet(){return vT(isKeyed(this)?this.valueSeq():this)},toSet:function toSet(){return aT(isKeyed(this)?this.valueSeq():this)},toSetSeq:function toSetSeq(){return new DI(this)},toSeq:function toSeq(){return isIndexed(this)?this.toIndexedSeq():isKeyed(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function toStack(){return rT(isKeyed(this)?this.valueSeq():this)},toList:function toList(){return zI(isKeyed(this)?this.valueSeq():this)},toString:function toString(){return"[Collection]"},__toString:function __toString(j,_e){return 0===this.size?j+_e:j+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+_e},concat:function concat(){for(var j=[],_e=arguments.length;_e--;)j[_e]=arguments[_e];return reify(this,concatFactory(this,j))},includes:function includes(j){return this.some((function(_e){return is(_e,j)}))},entries:function entries(){return this.__iterator(2)},every:function every(j,_e){assertNotInfinite(this.size);var _t=!0;return this.__iterate((function(St,Tt,Ut){if(!j.call(_e,St,Tt,Ut))return _t=!1,!1})),_t},filter:function filter(j,_e){return reify(this,filterFactory(this,j,_e,!0))},find:function find(j,_e,_t){var St=this.findEntry(j,_e);return St?St[1]:_t},forEach:function forEach(j,_e){return assertNotInfinite(this.size),this.__iterate(_e?j.bind(_e):j)},join:function join(j){assertNotInfinite(this.size),j=void 0!==j?""+j:",";var _e="",_t=!0;return this.__iterate((function(St){_t?_t=!1:_e+=j,_e+=null!=St?St.toString():""})),_e},keys:function keys(){return this.__iterator(0)},map:function map(j,_e){return reify(this,mapFactory(this,j,_e))},reduce:function reduce$1(j,_e,_t){return reduce(this,j,_e,_t,arguments.length<2,!1)},reduceRight:function reduceRight(j,_e,_t){return reduce(this,j,_e,_t,arguments.length<2,!0)},reverse:function reverse(){return reify(this,reverseFactory(this,!0))},slice:function slice(j,_e){return reify(this,sliceFactory(this,j,_e,!0))},some:function some(j,_e){return!this.every(not(j),_e)},sort:function sort(j){return reify(this,sortFactory(this,j))},values:function values(){return this.__iterator(1)},butLast:function butLast(){return this.slice(0,-1)},isEmpty:function isEmpty(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function count(j,_e){return ensureSize(j?this.toSeq().filter(j,_e):this)},countBy:function countBy(j,_e){return function countByFactory(j,_e,_t){var St=NI().asMutable();return j.__iterate((function(Tt,Ut){St.update(_e.call(_t,Tt,Ut,j),0,(function(j){return j+1}))})),St.asImmutable()}(this,j,_e)},equals:function equals(j){return deepEqual(this,j)},entrySeq:function entrySeq(){var j=this;if(j._cache)return new iI(j._cache);var _e=j.toSeq().map(entryMapper).toIndexedSeq();return _e.fromEntrySeq=function(){return j.toSeq()},_e},filterNot:function filterNot(j,_e){return this.filter(not(j),_e)},findEntry:function findEntry(j,_e,_t){var St=_t;return this.__iterate((function(_t,Tt,Ut){if(j.call(_e,_t,Tt,Ut))return St=[Tt,_t],!1})),St},findKey:function findKey(j,_e){var _t=this.findEntry(j,_e);return _t&&_t[0]},findLast:function findLast(j,_e,_t){return this.toKeyedSeq().reverse().find(j,_e,_t)},findLastEntry:function findLastEntry(j,_e,_t){return this.toKeyedSeq().reverse().findEntry(j,_e,_t)},findLastKey:function findLastKey(j,_e){return this.toKeyedSeq().reverse().findKey(j,_e)},first:function first(j){return this.find(returnTrue,null,j)},flatMap:function flatMap(j,_e){return reify(this,function flatMapFactory(j,_e,_t){var St=collectionClass(j);return j.toSeq().map((function(Tt,Ut){return St(_e.call(_t,Tt,Ut,j))})).flatten(!0)}(this,j,_e))},flatten:function flatten(j){return reify(this,flattenFactory(this,j,!0))},fromEntrySeq:function fromEntrySeq(){return new xI(this)},get:function get(j,_e){return this.find((function(_e,_t){return is(_t,j)}),void 0,_e)},getIn,groupBy:function groupBy(j,_e){return function groupByFactory(j,_e,_t){var St=isKeyed(j),Tt=(isOrdered(j)?eT():NI()).asMutable();j.__iterate((function(Ut,_r){Tt.update(_e.call(_t,Ut,_r,j),(function(j){return(j=j||[]).push(St?[_r,Ut]:Ut),j}))}));var Ut=collectionClass(j);return Tt.map((function(_e){return reify(j,Ut(_e))})).asImmutable()}(this,j,_e)},has:function has(j){return this.get(j,jS)!==jS},hasIn:function hasIn(j){return hasIn$1(this,j)},isSubset:function isSubset(j){return j="function"==typeof j.includes?j:VS(j),this.every((function(_e){return j.includes(_e)}))},isSuperset:function isSuperset(j){return(j="function"==typeof j.isSubset?j:VS(j)).isSubset(this)},keyOf:function keyOf(j){return this.findKey((function(_e){return is(_e,j)}))},keySeq:function keySeq(){return this.toSeq().map(keyMapper).toIndexedSeq()},last:function last(j){return this.toSeq().reverse().first(j)},lastKeyOf:function lastKeyOf(j){return this.toKeyedSeq().reverse().keyOf(j)},max:function max(j){return maxFactory(this,j)},maxBy:function maxBy(j,_e){return maxFactory(this,_e,j)},min:function min(j){return maxFactory(this,j?neg(j):defaultNegComparator)},minBy:function minBy(j,_e){return maxFactory(this,_e?neg(_e):defaultNegComparator,j)},rest:function rest(){return this.slice(1)},skip:function skip(j){return 0===j?this:this.slice(Math.max(0,j))},skipLast:function skipLast(j){return 0===j?this:this.slice(0,-Math.max(0,j))},skipWhile:function skipWhile(j,_e){return reify(this,skipWhileFactory(this,j,_e,!0))},skipUntil:function skipUntil(j,_e){return this.skipWhile(not(j),_e)},sortBy:function sortBy(j,_e){return reify(this,sortFactory(this,_e,j))},take:function take(j){return this.slice(0,Math.max(0,j))},takeLast:function takeLast(j){return this.slice(-Math.max(0,j))},takeWhile:function takeWhile(j,_e){return reify(this,function takeWhileFactory(j,_e,_t){var St=makeSequence(j);return St.__iterateUncached=function(St,Tt){var Ut=this;if(Tt)return this.cacheResult().__iterate(St,Tt);var _r=0;return j.__iterate((function(j,Tt,_n){return _e.call(_t,j,Tt,_n)&&++_r&&St(j,Tt,Ut)})),_r},St.__iteratorUncached=function(St,Tt){var Ut=this;if(Tt)return this.cacheResult().__iterator(St,Tt);var _r=j.__iterator(2,Tt),_n=!0;return new ZS((function(){if(!_n)return{value:void 0,done:!0};var j=_r.next();if(j.done)return j;var Tt=j.value,_i=Tt[0],Ei=Tt[1];return _e.call(_t,Ei,_i,Ut)?2===St?j:iteratorValue(St,_i,Ei,j):(_n=!1,{value:void 0,done:!0})}))},St}(this,j,_e))},takeUntil:function takeUntil(j,_e){return this.takeWhile(not(j),_e)},update:function update(j){return j(this)},valueSeq:function valueSeq(){return this.toIndexedSeq()},hashCode:function hashCode(){return this.__hash||(this.__hash=function hashCollection(j){if(j.size===1/0)return 0;var _e=isOrdered(j),_t=isKeyed(j),St=_e?1:0;return function murmurHashOfSize(j,_e){return _e=lI(_e,3432918353),_e=lI(_e<<15|_e>>>-15,461845907),_e=lI(_e<<13|_e>>>-13,5),_e=(_e+3864292196|0)^j,_e=lI(_e^_e>>>16,2246822507),_e=lI(_e^_e>>>13,3266489909),_e=smi(_e^_e>>>16),_e}(j.__iterate(_t?_e?function(j,_e){St=31*St+hashMerge(hash(j),hash(_e))|0}:function(j,_e){St=St+hashMerge(hash(j),hash(_e))|0}:_e?function(j){St=31*St+hash(j)|0}:function(j){St=St+hash(j)|0}),St)}(this))}});var dT=VS.prototype;dT[US]=!0,dT[XS]=dT.values,dT.toJSON=dT.toArray,dT.__toStringMapper=quoteString,dT.inspect=dT.toSource=function(){return this.toString()},dT.chain=dT.flatMap,dT.contains=dT.includes,mixin(qS,{flip:function flip(){return reify(this,flipFactory(this))},mapEntries:function mapEntries(j,_e){var _t=this,St=0;return reify(this,this.toSeq().map((function(Tt,Ut){return j.call(_e,[Ut,Tt],St++,_t)})).fromEntrySeq())},mapKeys:function mapKeys(j,_e){var _t=this;return reify(this,this.toSeq().flip().map((function(St,Tt){return j.call(_e,St,Tt,_t)})).flip())}});var hT=qS.prototype;hT[FS]=!0,hT[XS]=dT.entries,hT.toJSON=toObject,hT.__toStringMapper=function(j,_e){return quoteString(_e)+": "+quoteString(j)},mixin(QS,{toKeyedSeq:function toKeyedSeq(){return new kI(this,!1)},filter:function filter(j,_e){return reify(this,filterFactory(this,j,_e,!1))},findIndex:function findIndex(j,_e){var _t=this.findEntry(j,_e);return _t?_t[0]:-1},indexOf:function indexOf(j){var _e=this.keyOf(j);return void 0===_e?-1:_e},lastIndexOf:function lastIndexOf(j){var _e=this.lastKeyOf(j);return void 0===_e?-1:_e},reverse:function reverse(){return reify(this,reverseFactory(this,!1))},slice:function slice(j,_e){return reify(this,sliceFactory(this,j,_e,!1))},splice:function splice(j,_e){var _t=arguments.length;if(_e=Math.max(_e||0,0),0===_t||2===_t&&!_e)return this;j=resolveBegin(j,j<0?this.count():this.size);var St=this.slice(0,j);return reify(this,1===_t?St:St.concat(arrCopy(arguments,2),this.slice(j+_e)))},findLastIndex:function findLastIndex(j,_e){var _t=this.findLastEntry(j,_e);return _t?_t[0]:-1},first:function first(j){return this.get(0,j)},flatten:function flatten(j){return reify(this,flattenFactory(this,j,!1))},get:function get(j,_e){return(j=wrapIndex(this,j))<0||this.size===1/0||void 0!==this.size&&j>this.size?_e:this.find((function(_e,_t){return _t===j}),void 0,_e)},has:function has(j){return(j=wrapIndex(this,j))>=0&&(void 0!==this.size?this.size===1/0||j<this.size:-1!==this.indexOf(j))},interpose:function interpose(j){return reify(this,function interposeFactory(j,_e){var _t=makeSequence(j);return _t.size=j.size&&2*j.size-1,_t.__iterateUncached=function(_t,St){var Tt=this,Ut=0;return j.__iterate((function(j){return(!Ut||!1!==_t(_e,Ut++,Tt))&&!1!==_t(j,Ut++,Tt)}),St),Ut},_t.__iteratorUncached=function(_t,St){var Tt,Ut=j.__iterator(1,St),_r=0;return new ZS((function(){return(!Tt||_r%2)&&(Tt=Ut.next()).done?Tt:_r%2?iteratorValue(_t,_r++,_e):iteratorValue(_t,_r++,Tt.value,Tt)}))},_t}(this,j))},interleave:function interleave(){var j=[this].concat(arrCopy(arguments)),_e=zipWithFactory(this.toSeq(),rI.of,j),_t=_e.flatten(!0);return _e.size&&(_t.size=_e.size*j.length),reify(this,_t)},keySeq:function keySeq(){return lT(0,this.size)},last:function last(j){return this.get(-1,j)},skipWhile:function skipWhile(j,_e){return reify(this,skipWhileFactory(this,j,_e,!1))},zip:function zip(){var j=[this].concat(arrCopy(arguments));return reify(this,zipWithFactory(this,defaultZipper,j))},zipAll:function zipAll(){var j=[this].concat(arrCopy(arguments));return reify(this,zipWithFactory(this,defaultZipper,j,!0))},zipWith:function zipWith(j){var _e=arrCopy(arguments);return _e[0]=this,reify(this,zipWithFactory(this,j,_e))}});var fT=QS.prototype;fT[GS]=!0,fT[zS]=!0,mixin(KS,{get:function get(j,_e){return this.has(j)?j:_e},includes:function includes(j){return this.has(j)},keySeq:function keySeq(){return this.valueSeq()}});var gT=KS.prototype;function reduce(j,_e,_t,St,Tt,Ut){return assertNotInfinite(j.size),j.__iterate((function(j,Ut,_r){Tt?(Tt=!1,_t=j):_t=_e.call(St,_t,j,Ut,_r)}),Ut),_t}function keyMapper(j,_e){return _e}function entryMapper(j,_e){return[_e,j]}function not(j){return function(){return!j.apply(this,arguments)}}function neg(j){return function(){return-j.apply(this,arguments)}}function defaultZipper(){return arrCopy(arguments)}function defaultNegComparator(j,_e){return j<_e?1:j>_e?-1:0}function hashMerge(j,_e){return j^_e+2654435769+(j<<6)+(j>>2)|0}gT.has=dT.includes,gT.contains=gT.includes,gT.keys=gT.values,mixin(tI,hT),mixin(rI,fT),mixin(nI,gT);var vT=function(j){function OrderedSet(j){return null==j?emptyOrderedSet():isOrderedSet(j)?j:emptyOrderedSet().withMutations((function(_e){var _t=KS(j);assertNotInfinite(_t.size),_t.forEach((function(j){return _e.add(j)}))}))}return j&&(OrderedSet.__proto__=j),OrderedSet.prototype=Object.create(j&&j.prototype),OrderedSet.prototype.constructor=OrderedSet,OrderedSet.of=function of(){return this(arguments)},OrderedSet.fromKeys=function fromKeys(j){return this(qS(j).keySeq())},OrderedSet.prototype.toString=function toString(){return this.__toString("OrderedSet {","}")},OrderedSet}(aT);vT.isOrderedSet=isOrderedSet;var mT,yT=vT.prototype;function makeOrderedSet(j,_e){var _t=Object.create(yT);return _t.size=j?j.size:0,_t._map=j,_t.__ownerID=_e,_t}function emptyOrderedSet(){return mT||(mT=makeOrderedSet(emptyOrderedMap()))}yT[zS]=!0,yT.zip=fT.zip,yT.zipWith=fT.zipWith,yT.zipAll=fT.zipAll,yT.__empty=emptyOrderedSet,yT.__make=makeOrderedSet;var AT=function Record(j,_e){var _t;!function throwOnInvalidDefaultValues(j){if(isRecord(j))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(isImmutable(j))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===j||"object"!=typeof j)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(j);var St=function Record(Ut){var _r=this;if(Ut instanceof St)return Ut;if(!(this instanceof St))return new St(Ut);if(!_t){_t=!0;var _n=Object.keys(j),_i=Tt._indices={};Tt._name=_e,Tt._keys=_n,Tt._defaultValues=j;for(var Ei=0;Ei<_n.length;Ei++){var Ci=_n[Ei];_i[Ci]=Ei,Tt[Ci]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+recordName(this)+' with property "'+Ci+'" since that property name is part of the Record API.'):immutable_es_setProp(Tt,Ci)}}return this.__ownerID=void 0,this._values=zI().withMutations((function(j){j.setSize(_r._keys.length),qS(Ut).forEach((function(_e,_t){j.set(_r._indices[_t],_e===_r._defaultValues[_t]?void 0:_e)}))})),this},Tt=St.prototype=Object.create(_T);return Tt.constructor=St,_e&&(St.displayName=_e),St};AT.prototype.toString=function toString(){for(var j,_e=recordName(this)+" { ",_t=this._keys,St=0,Tt=_t.length;St!==Tt;St++)_e+=(St?", ":"")+(j=_t[St])+": "+quoteString(this.get(j));return _e+" }"},AT.prototype.equals=function equals(j){return this===j||j&&recordSeq(this).equals(recordSeq(j))},AT.prototype.hashCode=function hashCode(){return recordSeq(this).hashCode()},AT.prototype.has=function has(j){return this._indices.hasOwnProperty(j)},AT.prototype.get=function get(j,_e){if(!this.has(j))return _e;var _t=this._indices[j],St=this._values.get(_t);return void 0===St?this._defaultValues[j]:St},AT.prototype.set=function set(j,_e){if(this.has(j)){var _t=this._values.set(this._indices[j],_e===this._defaultValues[j]?void 0:_e);if(_t!==this._values&&!this.__ownerID)return makeRecord(this,_t)}return this},AT.prototype.remove=function remove(j){return this.set(j)},AT.prototype.clear=function clear(){var j=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:makeRecord(this,j)},AT.prototype.wasAltered=function wasAltered(){return this._values.wasAltered()},AT.prototype.toSeq=function toSeq(){return recordSeq(this)},AT.prototype.toJS=function toJS$1(){return toJS(this)},AT.prototype.entries=function entries(){return this.__iterator(2)},AT.prototype.__iterator=function __iterator(j,_e){return recordSeq(this).__iterator(j,_e)},AT.prototype.__iterate=function __iterate(j,_e){return recordSeq(this).__iterate(j,_e)},AT.prototype.__ensureOwner=function __ensureOwner(j){if(j===this.__ownerID)return this;var _e=this._values.__ensureOwner(j);return j?makeRecord(this,_e,j):(this.__ownerID=j,this._values=_e,this)},AT.isRecord=isRecord,AT.getDescriptiveName=recordName;var _T=AT.prototype;function makeRecord(j,_e,_t){var St=Object.create(Object.getPrototypeOf(j));return St._values=_e,St.__ownerID=_t,St}function recordName(j){return j.constructor.displayName||j.constructor.name||"Record"}function recordSeq(j){return keyedSeqFromValue(j._keys.map((function(_e){return[_e,j.get(_e)]})))}function immutable_es_setProp(j,_e){try{Object.defineProperty(j,_e,{get:function(){return this.get(_e)},set:function(j){invariant(this.__ownerID,"Cannot set on an immutable record."),this.set(_e,j)}})}catch(j){}}_T[HS]=!0,_T[PS]=_T.remove,_T.deleteIn=_T.removeIn=deleteIn,_T.getIn=getIn,_T.hasIn=dT.hasIn,_T.merge=merge$1,_T.mergeWith=mergeWith$1,_T.mergeIn=mergeIn,_T.mergeDeep=mergeDeep,_T.mergeDeepWith=mergeDeepWith,_T.mergeDeepIn=mergeDeepIn,_T.setIn=setIn,_T.update=update,_T.updateIn=updateIn,_T.withMutations=withMutations,_T.asMutable=asMutable,_T.asImmutable=asImmutable,_T[XS]=_T.entries,_T.toJSON=_T.toObject=dT.toObject,_T.inspect=_T.toSource=function(){return this.toString()};var bT,ET=function(j){function Repeat(j,_e){if(!(this instanceof Repeat))return new Repeat(j,_e);if(this._value=j,this.size=void 0===_e?1/0:Math.max(0,_e),0===this.size){if(bT)return bT;bT=this}}return j&&(Repeat.__proto__=j),Repeat.prototype=Object.create(j&&j.prototype),Repeat.prototype.constructor=Repeat,Repeat.prototype.toString=function toString(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Repeat.prototype.get=function get(j,_e){return this.has(j)?this._value:_e},Repeat.prototype.includes=function includes(j){return is(this._value,j)},Repeat.prototype.slice=function slice(j,_e){var _t=this.size;return wholeSlice(j,_e,_t)?this:new Repeat(this._value,resolveEnd(_e,_t)-resolveBegin(j,_t))},Repeat.prototype.reverse=function reverse(){return this},Repeat.prototype.indexOf=function indexOf(j){return is(this._value,j)?0:-1},Repeat.prototype.lastIndexOf=function lastIndexOf(j){return is(this._value,j)?this.size:-1},Repeat.prototype.__iterate=function __iterate(j,_e){for(var _t=this.size,St=0;St!==_t&&!1!==j(this._value,_e?_t-++St:St++,this););return St},Repeat.prototype.__iterator=function __iterator(j,_e){var _t=this,St=this.size,Tt=0;return new ZS((function(){return Tt===St?{value:void 0,done:!0}:iteratorValue(j,_e?St-++Tt:Tt++,_t._value)}))},Repeat.prototype.equals=function equals(j){return j instanceof Repeat?is(this._value,j._value):deepEqual(j)},Repeat}(rI);function fromJSWith(j,_e,_t,St,Tt,Ut){if("string"!=typeof _t&&!isImmutable(_t)&&(isArrayLike(_t)||hasIterator(_t)||isPlainObject(_t))){if(~j.indexOf(_t))throw new TypeError("Cannot convert circular structure to Immutable");j.push(_t),Tt&&""!==St&&Tt.push(St);var _r=_e.call(Ut,St,eI(_t).map((function(St,Ut){return fromJSWith(j,_e,St,Ut,Tt,_t)})),Tt&&Tt.slice());return j.pop(),Tt&&Tt.pop(),_r}return _t}function defaultConverter(j,_e){return isIndexed(_e)?_e.toList():isKeyed(_e)?_e.toMap():_e.toSet()}var wT={version:"4.0.0",Collection:VS,Iterable:VS,Seq:eI,Map:NI,OrderedMap:eT,List:zI,Stack:rT,Set:aT,OrderedSet:vT,Record:AT,Range:lT,Repeat:ET,is,fromJS:function fromJS(j,_e){return fromJSWith([],_e||defaultConverter,j,"",_e&&_e.length>2?[]:void 0,{"":j})},hash,isImmutable,isCollection,isKeyed,isIndexed,isAssociative,isOrdered,isValueObject,isPlainObject,isSeq,isList,isMap,isOrderedMap,isStack,isSet,isOrderedSet,isRecord,get,getIn:getIn$1,has,hasIn:hasIn$1,merge:function merge(j){for(var _e=[],_t=arguments.length-1;_t-- >0;)_e[_t]=arguments[_t+1];return mergeWithSources(j,_e)},mergeDeep:function mergeDeep$1(j){for(var _e=[],_t=arguments.length-1;_t-- >0;)_e[_t]=arguments[_t+1];return mergeDeepWithSources(j,_e)},mergeWith:function mergeWith(j,_e){for(var _t=[],St=arguments.length-2;St-- >0;)_t[St]=arguments[St+2];return mergeWithSources(_e,_t,j)},mergeDeepWith:function mergeDeepWith$1(j,_e){for(var _t=[],St=arguments.length-2;St-- >0;)_t[St]=arguments[St+2];return mergeDeepWithSources(_e,_t,j)},remove,removeIn,set,setIn:setIn$1,update:update$1,updateIn:updateIn$1};const ST=wT;function struct_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function struct_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?struct_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):struct_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}var IT,TT,CT,RT,kT=function(){function AgoraRteSyncSnapshotData(j){var _e=this;_classCallCheck(this,AgoraRteSyncSnapshotData),this.sequence=void 0,this.users=new Map,this.streams=new Map,this.roomProperties=ST.Map(),this.room=void 0,this.roomState=void 0;var _t=j.seq,St=j.users,Tt=j.roomProperties,Ut=j.roomInfo,_r=j.roomState;this.sequence=_t,St.forEach((function(j){var _t=OT.fromData(j),St=j.streams;(void 0===St?[]:St).forEach((function(j){_e.streams.set(j.streamUuid,DT.fromData(struct_objectSpread(struct_objectSpread({},j),{},{fromUser:{userName:_t.userName,role:_t.userRole,userUuid:_t.userUuid}})))})),_e.users.set(j.userUuid,_t)})),this.roomProperties=ST.Map(Tt),this.room=xT.fromData(Ut),this.roomState=LT.fromData(_r)}return _createClass(AgoraRteSyncSnapshotData,null,[{key:"fromData",value:function fromData(j){return new AgoraRteSyncSnapshotData(j)}}]),AgoraRteSyncSnapshotData}(),OT=function(){function AgoraUser(j){_classCallCheck(this,AgoraUser),this.userUuid=void 0,this.userName=void 0,this.userRole=void 0,this.userProperties=void 0,this.userName=j.userName,this.userRole=j.role,this.userUuid=j.userUuid,this.userProperties=ST.Map(j.userProperties)}return _createClass(AgoraUser,[{key:"setUserProperties",value:function setUserProperties(j){this.userProperties=ST.Map(j)}},{key:"toString",value:function toString(){return this.userUuid}}],[{key:"fromData",value:function fromData(j){return new AgoraUser(j)}}]),AgoraUser}(),DT=function(){function AgoraStream(j){_classCallCheck(this,AgoraStream),this.streamUuid=void 0,this.streamName=void 0,this.fromUser=void 0,this.videoSourceType=void 0,this.audioSourceType=void 0,this.videoState=void 0,this.audioState=void 0,this.videoSourceState=void 0,this.audioSourceState=void 0,this.playUrl=void 0,this.flvPlayUrl=void 0,this.rtmpPlayUrl=void 0,this.previous=void 0,this.streamUuid=j.streamUuid,this.streamName=j.streamName,this.fromUser=j.fromUser,this.videoSourceType=j.videoSourceType,this.audioSourceType=j.audioSourceType,this.videoState=j.videoState,this.audioState=j.audioState,this.videoSourceState=j.videoSourceState,this.audioSourceState=j.audioSourceState,this.playUrl=j.playUrl,this.flvPlayUrl=j.flvPlayUrl,this.rtmpPlayUrl=j.rtmpPlayUrl,["streamUuid","fromUser","videoSourceType","audioSourceType","videoState","audioState","videoSourceState","audioSourceState"].forEach((function(_e){void 0===j[_e]&&ME.warn("stream key ".concat(_e," is unexpectedly undefined"))})),this.fromUser||(ME.error("[stream-data-struct] stream must have owner info"),ZE.shared.handleThrowableError(QE.RTE_ERR_INVALID_DATA_STRUCT,new Error("invalid stream data")))}return _createClass(AgoraStream,[{key:"toString",value:function toString(){return this.streamUuid}}],[{key:"fromData",value:function fromData(j){return new AgoraStream(j)}}]),AgoraStream}(),xT=function(){function AgoraRoom(j){_classCallCheck(this,AgoraRoom),this.roomName=void 0,this.roomUuid=void 0,this.roomScenario=void 0,this.roomName=j.roomName,this.roomUuid=j.roomUuid,this.roomScenario=j.roomScenario}return _createClass(AgoraRoom,null,[{key:"fromData",value:function fromData(j){return new AgoraRoom(j)}}]),AgoraRoom}(),LT=function(){function AgoraRoomState(j){_classCallCheck(this,AgoraRoomState),this.total=void 0,this.total=j.total}return _createClass(AgoraRoomState,null,[{key:"fromData",value:function fromData(j){return new AgoraRoomState(j)}}]),AgoraRoomState}(),NT=function(){function AgoraChatMessage(j){_classCallCheck(this,AgoraChatMessage),this.fromUser=void 0,this.message=void 0,this.type=void 0,this.sendTime=void 0,this.sensitiveWords=void 0,this.messageId=void 0,this.ext=void 0,this.fromUser=j.fromUser,this.message=j.message,this.type=j.type,this.sendTime=j.sendTime,this.sensitiveWords=j.sensitiveWords,this.messageId=j.messageId||j.peerMessageId,this.ext=j.ext}return _createClass(AgoraChatMessage,[{key:"toString",value:function toString(){return"".concat(this.fromUser.userName,": ").concat(this.message)}}],[{key:"fromData",value:function fromData(j){return new AgoraChatMessage(j)}}]),AgoraChatMessage}(),PT=__webpack_require__(9850),MT=__webpack_require__.n(PT),BT=__webpack_require__(2579),jT=__webpack_require__.n(BT);function handler_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function handler_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?handler_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):handler_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}function handler_createForOfIteratorHelper(j,_e){var _t="undefined"!=typeof Symbol&&j[Symbol.iterator]||j["@@iterator"];if(!_t){if(Array.isArray(j)||(_t=function handler_unsupportedIterableToArray(j,_e){if(!j)return;if("string"==typeof j)return handler_arrayLikeToArray(j,_e);var _t=Object.prototype.toString.call(j).slice(8,-1);"Object"===_t&&j.constructor&&(_t=j.constructor.name);if("Map"===_t||"Set"===_t)return Array.from(j);if("Arguments"===_t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_t))return handler_arrayLikeToArray(j,_e)}(j))||_e&&j&&"number"==typeof j.length){_t&&(j=_t);var St=0,Tt=function F(){};return{s:Tt,n:function n(){return St>=j.length?{done:!0}:{done:!1,value:j[St++]}},e:function e(j){throw j},f:Tt}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Ut,_r=!0,_n=!1;return{s:function s(){_t=_t.call(j)},n:function n(){var j=_t.next();return _r=j.done,j},e:function e(j){_n=!0,Ut=j},f:function f(){try{_r||null==_t.return||_t.return()}finally{if(_n)throw Ut}}}}function handler_arrayLikeToArray(j,_e){(null==_e||_e>j.length)&&(_e=j.length);for(var _t=0,St=new Array(_e);_t<_e;_t++)St[_t]=j[_t];return St}function handler_createSuper(j){var _e=function handler_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j[j.Chat=3]="Chat",j[j.RoomProperty=4]="RoomProperty",j[j.RoomProperties=5]="RoomProperties",j[j.UserInOut=20]="UserInOut",j[j.UserInfo=21]="UserInfo",j[j.UserProperty=22]="UserProperty",j[j.UserProperties=23]="UserProperties",j[j.UserSubscribeInOut=24]="UserSubscribeInOut",j[j.StreamInOut=40]="StreamInOut",j[j.StreamsInOut=41]="StreamsInOut",j[j.MessageExtension=99]="MessageExtension"}(TT||(TT={})),function(j){j[j.PeerChat=1]="PeerChat"}(CT||(CT={})),function(j){j.SnapshotUpdated="snapshot-updated",j.ChatReceived="chat-received",j.UserAdded="user-added",j.UserUpdated="user-updated",j.UserRemoved="user-removed",j.UserCountUpdated="user-count-updated",j.RoomPropertyUpdated="room-property-updated",j.UserPropertyUpdated="user-property-updated",j.LocalStreamAdded="local-stream-added",j.LocalStreamUpdate="local-stream-update",j.LocalStreamRemove="local-stream-removed",j.RemoteStreamAdded="remote-stream-added",j.RemoteStreamUpdate="remote-stream-update",j.RemoteStreamRemove="remote-stream-removed",j.ChatUserMessage="user-chat-message",j.ChatRoomMessage="room-chat-message",j.NetworkStats="network-stats",j.LocalAudioVolume="local-audio-volume",j.AudioVolumes="audio-volumes",j.LocalVideoCameraListChanged="local-video-camera-list-changed",j.LocalAudioRecordingListChanged="local-audio-recording-list-changed",j.LocalAudioPlaybackListChanged="local-audio-playback-list-changed",j.LocalVideoTrackStateChanged="local-video-track-state-changed",j.LocalAudioTrackStateChanged="local-audio-track-state-changed",j.RtcConnectionStateChanged="rtc-connection-state-changed",j.RtmConnectionStateChanged="rtm-connection-state-changed",j.RteConnectionStateChanged="rte-connection-state-changed",j.TimeStampGapUpdate="timestamp-gap-update",j.UserPropertyListUpdated="user-property-list-updated"}(RT||(RT={}));var UT,GT=kS.attach({proxyMethods:!1,label:"channel-message"})(IT=function(j){_inherits(AgoraRteChannelMessageHandle,j);var _e=handler_createSuper(AgoraRteChannelMessageHandle);function AgoraRteChannelMessageHandle(j,_t){var St,Tt=_t.sceneId,Ut=_t.userUuid,_r=_t.streamUuid;return _classCallCheck(this,AgoraRteChannelMessageHandle),(St=_e.call(this)).logger=void 0,St._dataStore=void 0,St._timestampGap=0,St.sceneId=void 0,St.userUuid=void 0,St.streamUuid=void 0,St.sceneId=Tt,St.userUuid=Ut,St.streamUuid=_r,St._dataStore=j,St}return _createClass(AgoraRteChannelMessageHandle,[{key:"handleSnapshot",value:function handleSnapshot(j){this.logger.info("snapshot loaded:",j),this._dataStore.setUsers(j.users),this._dataStore.setStreams(j.streams),this._dataStore.setRoomProperties(j.roomProperties),this._dataStore.setRoomInfo(j.room),this.emit(RT.SnapshotUpdated,j)}},{key:"handleMessage",value:function handleMessage(j){var _e=j.sequence,_t=_e.batch,St=_e.cmd;_t?this._handleBatchMessage(j,St):this._handleSimpleMessage(j,St),this._syncTsGapWithServerAndLocal(j)}},{key:"_handleSimpleMessage",value:function _handleSimpleMessage(j,_e){switch(_e){case TT.Chat:this._handleChat(j);break;case TT.RoomProperty:case TT.RoomProperties:this._handleRoomProperties(j);break;case TT.UserInOut:this._handleUserInOut(j);break;case TT.UserInfo:this._handleUserInfo(j);break;case TT.UserProperty:this._handleUserProperty(j);break;case TT.UserProperties:this._handleUserProperties(j);break;case TT.UserSubscribeInOut:this._handleUserSubscribe(j);break;case TT.StreamInOut:this._handleStreamInOut(j);break;case TT.StreamsInOut:this._handleStreamsInOut(j);break;case TT.MessageExtension:this._handleMessageExtension(j)}}},{key:"_handleBatchMessage",value:function _handleBatchMessage(j,_e){if(_e===TT.UserProperties)this._handleUserPropertyList(j)}},{key:"_handleUserPropertyList",value:function _handleUserPropertyList(j){var _e,_t,St=this,Tt=j.sequence,Ut=Tt.batch,_r=Tt.list,_n=void 0===_r?[]:_r,_i=null===(_e=_n[0])||void 0===_e?void 0:_e.operator,Ei=null===(_t=_n[0])||void 0===_t?void 0:_t.cause,Ci=[];_n.forEach((function(j){var _e=j,_t=_e.changeProperties,Tt=_e.fromUser.userUuid,Ut=St._dataStore.findUser(Tt);if(!Ut)return St.logger.warn("user ".concat(Tt," not exists, update property failed"));Ut.setUserProperties(St._mergeProperties(Ut.userProperties.toJS(),_t)),Ci.push({userUuid:Tt,userProperties:Ut.userProperties.toObject()})}));var Di={id:null==Ut?void 0:Ut.id,total:null==Ut?void 0:Ut.total,index:null==Ut?void 0:Ut.progress};this.emit(RT.UserPropertyListUpdated,Ci,Di,_i,Ei)}},{key:"handlePeerMessage",value:function handlePeerMessage(j){if(j.cmd===CT.PeerChat)this._handlePeerChat(j)}},{key:"_handlePeerChat",value:function _handlePeerChat(j){var _e=j.data,_t=NT.fromData(_e);this._dataStore.addMessage(_t),this.emit(RT.ChatUserMessage,_t)}},{key:"_handleChat",value:function _handleChat(j){var _e=j.sequence.data,_t=NT.fromData(_e);this._dataStore.addMessage(_t),this.emit(RT.ChatReceived,_t)}},{key:"_mergeProperties",value:function _mergeProperties(j,_e){for(var _t=0,St=Object.keys(_e);_t<St.length;_t++){var Tt=St[_t],Ut=Tt.split(".");if(0!==Ut.length){var _r,_n=Ut.filter((function(j){return j})),_i=j,Ei=handler_createForOfIteratorHelper(_n);try{for(Ei.s();!(_r=Ei.n()).done;){var Ci=_r.value;_i[Ci]=_i[Ci]||{},_i=_i[Ci]}}catch(j){Ei.e(j)}finally{Ei.f()}var Di=1===_n.length?j:jT()(j,_toConsumableArray(_n).splice(0,_n.length-1).join("."),{}),Fi=MT()(_e[Tt]);"deleted"===Fi?delete Di[_toConsumableArray(_n).pop()]:Di[_toConsumableArray(_n).pop()]=Fi}else this.logger.error("invalid key when batch set room properties ".concat(Tt))}return j}},{key:"_handleRoomProperties",value:function _handleRoomProperties(j){var _e=j.sequence.data,_t=_e.changeProperties,St=_e.cause,Tt=_e.operator;this._dataStore.setRoomProperties(this._mergeProperties(this._dataStore.roomProperties.toJS(),_t));var Ut=Array.from(new Set(Object.keys(_t).map((function(j){return j.split(".")[0]}))));this.emit(RT.RoomPropertyUpdated,Ut,this._dataStore.roomProperties,Tt,St)}},{key:"_handleUserSubscribe",value:function _handleUserSubscribe(j){var _e=this,_t=j.sequence.data.users,St=[],Tt=[];_t.forEach((function(j){var _t=OT.fromData(j);if(1===j.subscribe){_e._dataStore.setUser(_t.userUuid,_t);var Ut=j.streams;(void 0===Ut?[]:Ut).forEach((function(j){var St=DT.fromData(handler_objectSpread(handler_objectSpread({},j),{},{fromUser:{userUuid:_t.userUuid,role:_t.userRole,userName:_t.userName}}));_e._dataStore.setStream(St.streamUuid,St)})),St.push(_t)}else 0===j.subscribe&&(_e._dataStore.deleteStream(j.streamUuid),_e._dataStore.deleteUser(j.userUuid),Tt.push(_t))})),St.length>0&&this.emit(RT.UserAdded,St),Tt.length>0&&this.emit(RT.UserRemoved,Tt)}},{key:"_handleUserInOut",value:function _handleUserInOut(j){var _e=this,_t=j.sequence.data,St=_t.offlineUsers,Tt=_t.onlineUsers,Ut=_t.total,_r=St.map((function(j){var _t=OT.fromData(j);return _e._dataStore.deleteStream(j.streamUuid),_e._dataStore.deleteUser(j.userUuid),_t})),_n=Tt.map((function(j){var _t=OT.fromData(j);_e._dataStore.setUser(_t.userUuid,_t);var St=j.streams;return(void 0===St?[]:St).forEach((function(j){var St=DT.fromData(handler_objectSpread(handler_objectSpread({},j),{},{fromUser:{userUuid:_t.userUuid,role:_t.userRole,userName:_t.userName}}));_e._dataStore.setStream(St.streamUuid,St)})),_t}));if(_n.length>0&&this.emit(RT.UserAdded,_n),_r.length>0){var _i=St.length?St[0].type:void 0;this.emit(RT.UserRemoved,_r,_i)}void 0!==Ut&&this.emit(RT.UserCountUpdated,Ut)}},{key:"_handleUserInfo",value:function _handleUserInfo(j){var _e=j.sequence.data,_t=_e.userUuid,St=_e.userName,Tt=_e.role,Ut=this._dataStore.findUser(_t);if(!Ut)return this.logger.warn("user ".concat(_t," not exists, update info failed"));Ut.userName=St,Ut.userRole=Tt,this.emit(RT.UserUpdated,Ut)}},{key:"_handleUserProperty",value:function _handleUserProperty(j){throw"not_implemented"}},{key:"_handleUserProperties",value:function _handleUserProperties(j){var _e=j.sequence.data,_t=_e.changeProperties,St=_e.cause,Tt=_e.fromUser,Ut=_e.operator,_r=Tt.userUuid,_n=this._dataStore.findUser(_r);if(!_n)return this.logger.warn("user ".concat(_r," not exists, update property failed"));_n.setUserProperties(this._mergeProperties(_n.userProperties.toJS(),_t)),this.emit(RT.UserPropertyUpdated,_r,_n.userProperties.toObject(),Ut,St)}},{key:"_processStreamEvent",value:function _processStreamEvent(j,_e){var _t=_e.fromUser.userUuid===this.userUuid;if(3===j){var St=this._dataStore.findStream(_e.streamUuid);return this._dataStore.deleteStream(_e.streamUuid),_e.previous=St,_t?RT.LocalStreamRemove:RT.RemoteStreamRemove}if(2===j){var Tt=this._dataStore.findStream(_e.streamUuid);return this._dataStore.setStream(_e.streamUuid,_e),_e.previous=Tt,_t?RT.LocalStreamUpdate:RT.RemoteStreamUpdate}return _e.previous=void 0,this._dataStore.setStream(_e.streamUuid,_e),_t?RT.LocalStreamAdded:RT.RemoteStreamAdded}},{key:"_handleStreamInOut",value:function _handleStreamInOut(j){var _e=j.sequence.data,_t=_e.action,St=_e.fromUser,Tt=_e.streamUuid,Ut=_e.streamName,_r=_e.videoSourceType,_n=_e.audioSourceType,_i=_e.videoSourceState,Ei=_e.audioSourceState,Ci=_e.videoState,Di=_e.audioState,Fi=_e.operator,_o=_e.playUrl,ga=_e.flvPlayUrl,_a=_e.rtmpPlayUrl,_s=DT.fromData({streamName:Ut,streamUuid:Tt,fromUser:St,videoSourceType:_r,audioSourceType:_n,videoState:Ci,audioState:Di,videoSourceState:_i,audioSourceState:Ei,playUrl:_o,flvPlayUrl:ga,rtmpPlayUrl:_a}),_c=this._processStreamEvent(_t,_s);this.emit(_c,[_s],Fi)}},{key:"_handleStreamsInOut",value:function _handleStreamsInOut(j){var _e=this,_t=j.sequence.data,St=_t.streams,Tt=_t.operator,Ut=(_t.cause,new Map);St.forEach((function(j){var _t=j.action,St=DT.fromData(j),Tt=_e._processStreamEvent(_t,St);Ut.has(Tt)?Ut.set(Tt,Ut.get(Tt).concat([St])):Ut.set(Tt,[St])})),Ut.forEach((function(j,_t){_e.emit(_t,j,Tt)}))}},{key:"_handleMessageExtension",value:function _handleMessageExtension(j){}},{key:"_syncTsGapWithServerAndLocal",value:function _syncTsGapWithServerAndLocal(j){var _e=j.sequence.timestamp-Date.now();this._timestampGap!==_e&&Math.abs(this._timestampGap-_e)>800&&(this._timestampGap=_e,this.emit(RT.TimeStampGapUpdate,this._timestampGap))}}]),AgoraRteChannelMessageHandle}(_a))||IT;function synchronizer_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */synchronizer_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}var VT=kS.attach({proxyMethods:!1,label:"channel-message"})(UT=function(){function AgoraRteSynchronizer(j,_e){var _t=this,St=_e.scene,Tt=_e.userUuid,Ut=_e.streamUuid,_r=_e.channelObserver,_n=_e.rtm;_classCallCheck(this,AgoraRteSynchronizer),this.logger=void 0,this.userUuid=void 0,this.streamUuid=void 0,this._scene=void 0,this._channelObserver=void 0,this._snapshot=void 0,this._queueTasks=[],this._currentTask=void 0,this._lastSeq=-1,this._requestingGap=!1,this._handleChannelMessage=void 0,this._handlePeerMessage=void 0,this.handle=void 0,this.runNextTask=function(){if(_t._currentTask)_t.logger.info("task Running");else{var j=_t.dequeueTask();j?(_t._currentTask=j,_t.processTask(_t._currentTask).then((function(){_t._currentTask=void 0,_t.notifyTaskQueueUpdate()})).catch((function(j){_t.logger.error("message handle failed: ".concat(j)),_t._currentTask=void 0,_t.notifyTaskQueueUpdate()}))):_t.logger.info("message handle queue clear")}},this._scene=St,this.streamUuid=Ut,this.userUuid=Tt,this._handleChannelMessage=this.handleChannelMessage.bind(this),this._handlePeerMessage=this.handlePeerMessage.bind(this),this._channelObserver=_r,this._channelObserver.on("ChannelMessage",this._handleChannelMessage),_n.on("MessageFromPeer",this._handlePeerMessage),this.handle=new GT(j,{sceneId:St.sceneId,userUuid:Tt,streamUuid:Ut})}var j,_e;return _createClass(AgoraRteSynchronizer,[{key:"handlePeerMessage",value:function handlePeerMessage(j){var _e=j.message,_t=j.peerId;if(this.logger.info("peer message from [".concat(this._scene.sceneId,"]: ").concat(_e,", peerId: ").concat(_t)),"server"===_t)try{var St=JSON.parse(_e);this.handle.handlePeerMessage(St)}catch(j){this.logger.error("".concat(j.message," original: ").concat(_e))}}},{key:"handleChannelMessage",value:function handleChannelMessage(j){var _e=j.message,_t=j.memberId;if(this.logger.info("channel message from [".concat(this._scene.sceneId,"]: ").concat(_e.text,", memberId: ").concat(_t)),"server"===_t)try{var St=JSON.parse(_e.text);this.addTask({sequence:St})}catch(j){this.logger.error("".concat(j.message," original: ").concat(_e.text))}}},{key:"syncSnapshot",value:function syncSnapshot(j){this._snapshot=j,this.handle.handleSnapshot(j),this._lastSeq=j.sequence,this.notifyTaskQueueUpdate()}},{key:"findSequenceGap",value:function findSequenceGap(){if(0===this._queueTasks.length)return null;var j=this._queueTasks[0].sequence.sequence;return j-this._lastSeq>1?{seq:this._lastSeq+1,count:j-this._lastSeq-1,queueHeadSeq:j}:null}},{key:"sortTasks",value:function sortTasks(){this._queueTasks=this._queueTasks.sort((function(j,_e){return j.sequence.sequence-_e.sequence.sequence}))}},{key:"addTask",value:function addTask(j){this._queueTasks.push(j),this.sortTasks(),this.notifyTaskQueueUpdate()}},{key:"prependTasks",value:function prependTasks(j){this._queueTasks=j.concat(this._queueTasks),this.sortTasks()}},{key:"notifyTaskQueueUpdate",value:function notifyTaskQueueUpdate(){if(this._snapshot){var j=this.findSequenceGap();if(j){var _e=j.seq,_t=j.count,St=j.queueHeadSeq;return this.logger.warn("gap ".concat(this._lastSeq," - ").concat(St," exists, need fill ").concat(_e," ").concat(_t,". stop task processing before gap is resolved")),void this.syncSequenceUntilSuccess(_e,_t)}this.runNextTask()}else this.logger.warn("snapshot not ready yet..wait")}},{key:"dequeueTask",value:function dequeueTask(){return 0===this._queueTasks.length?null:this._queueTasks.shift()}},{key:"processTask",value:(_e=_asyncToGenerator(synchronizer_regeneratorRuntime().mark((function _callee(j){return synchronizer_regeneratorRuntime().wrap((function _callee$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(this._snapshot){_e.next=2;break}return _e.abrupt("return");case 2:if(!(j.sequence.sequence<=this._lastSeq)){_e.next=5;break}return this.logger.info("skip sequence ".concat(j.sequence.sequence,", snapshot ").concat(this._snapshot.sequence)),_e.abrupt("return");case 5:return this.logger.info("process sequence ".concat(j.sequence.sequence,", snapshot ").concat(this._snapshot.sequence,", last ").concat(this._lastSeq)),this.handle.handleMessage(j),this._lastSeq=j.sequence.sequence,_e.next=10,new Promise((function(j){return setTimeout(j,0)}));case 10:case"end":return _e.stop()}}),_callee,this)}))),function processTask(j){return _e.apply(this,arguments)})},{key:"syncSequenceUntilSuccess",value:(j=_asyncToGenerator(synchronizer_regeneratorRuntime().mark((function _callee2(j,_e){var _t,St,Tt,Ut,_r;return synchronizer_regeneratorRuntime().wrap((function _callee2$(_n){for(;;)switch(_n.prev=_n.next){case 0:if(!this._requestingGap){_n.next=2;break}return _n.abrupt("return");case 2:this._requestingGap=!0,_t=!1,this.logger.info("begin resolve gap ".concat(j," - ").concat(_e));case 5:return _n.prev=5,_n.next=8,this._scene.getApiService().syncSequence(this._scene.sceneId,j,_e);case 8:St=_n.sent,Tt=St.list,Ut=Math.min(_e,Tt.length),_r=Tt.slice(0,Ut).map((function(j){return{sequence:j}})),this.prependTasks(_r),_t=!0,this.logger.info("gap resolved, new ".concat(_r.length," tasks prepended ")),this.notifyTaskQueueUpdate(),_n.next=23;break;case 18:return _n.prev=18,_n.t0=_n.catch(5),this.logger.error("syncSequence failed: ".concat(_n.t0)),_n.next=23,new Promise((function(j){return setTimeout(j,3e3)}));case 23:if(!_t){_n.next=5;break}case 24:this._requestingGap=!1;case 25:case"end":return _n.stop()}}),_callee2,this,[[5,18]])}))),function syncSequenceUntilSuccess(_e,_t){return j.apply(this,arguments)})},{key:"reset",value:function reset(){this._channelObserver.off("ChannelMessage",this._handleChannelMessage)}}]),AgoraRteSynchronizer}())||UT,qT=__webpack_require__(2699),QT=__webpack_require__(3136),KT=__webpack_require__.n(QT),WT=__webpack_require__(2775),HT=__webpack_require__.n(WT);__webpack_require__(9601);function http_client_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */http_client_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function http_client_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function http_client_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?http_client_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):http_client_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}var zT,YT=function(){var j=_asyncToGenerator(http_client_regeneratorRuntime().mark((function _callee(j,_e){return http_client_regeneratorRuntime().wrap((function _callee$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.abrupt("return",new Promise((function(_t,St){var Tt=new AbortController,Ut=setTimeout((function(){return Tt.abort()}),1e4);fetch(j,http_client_objectSpread(http_client_objectSpread({},_e),{},{signal:Tt.signal})).then((function(j){return _t(j)})).catch((function(j){St(j)})).finally((function(){clearTimeout(Ut)}))})));case 1:case"end":return _t.stop()}}),_callee)})));return function HttpClient(_e,_t){return j.apply(this,arguments)}}();function base_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */base_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}var JT=kS.attach({proxyMethods:!1,label:"http-error"})(zT=function(){function ApiBase(){_classCallCheck(this,ApiBase),this.logger=void 0,this.host=void 0,this.pathPrefix=void 0,this.headers=void 0}var j;return _createClass(ApiBase,[{key:"fetch",value:(j=_asyncToGenerator(base_regeneratorRuntime().mark((function _callee(j){var _e,_t,St,Tt,Ut,_r,_n,_i,Ei,Ci,Di,Fi,_o,ga,_a,_s;return base_regeneratorRuntime().wrap((function _callee$(_c){for(;;)switch(_c.prev=_c.next){case 0:if(_e=j.method,_t=j.data,St=j.full_url,Tt=j.path,Ut=j.query,_r=void 0===Ut?{}:Ut,_n=$E.shared.service,_i=_n.host,Ei=_n.pathPrefix,Ci={method:_e,headers:Object.assign({},$E.shared.service.headers,this.headers,j.headers)},Di=Object.entries(_r).filter((function(j){return!!_slicedToArray(j,2)[1]})).map((function(j){var _e=_slicedToArray(j,2),_t=_e[0],St=_e[1];return"".concat(_t,"=").concat(St)})),Fi=Di.length>0?"?".concat(Di.join("&")):"",_t&&(Ci.body=JSON.stringify(_t)),_c.prev=6,!St){_c.next=13;break}return _c.next=10,YT("".concat(St),Ci);case 10:_o=_c.sent,_c.next=16;break;case 13:return _c.next=15,YT("".concat(j.host||this.host||_i).concat(j.pathPrefix||this.pathPrefix||Ei||"").concat(Tt).concat(Fi),Ci);case 15:_o=_c.sent;case 16:_c.next=25;break;case 18:if(_c.prev=18,_c.t0=_c.catch(6),ga=_c.t0,this.logger.error(ga),20!==ga.code){_c.next=24;break}return _c.abrupt("return",ZE.shared.handleThrowableError(QE.RTE_ERR_RESTFUL_NETWORK_TIMEOUT_ERR,ga));case 24:return _c.abrupt("return",ZE.shared.handleThrowableError(QE.RTE_ERR_RESTFUL_NETWORK_ERR,ga));case 25:return _c.next=27,_o.json();case 27:if(_a=_c.sent,0==(_s=+_a.code)){_c.next=35;break}if(!isNaN(_s)){_c.next=34;break}return _c.abrupt("return",ZE.shared.handleThrowableError(QE.RTE_ERR_RESTFUL_SERVICE_ERR,new JE(QE.RTE_ERR_RESTFUL_SERVICE_ERR,new Error(_a.msg),{servCode:-1})));case 34:return _c.abrupt("return",ZE.shared.handleThrowableError(QE.RTE_ERR_RESTFUL_SERVICE_ERR,new JE(QE.RTE_ERR_RESTFUL_SERVICE_ERR,new Error(_a.msg),{servCode:_s})));case 35:return _c.abrupt("return",_a);case 36:case"end":return _c.stop()}}),_callee,this,[[6,18]])}))),function fetch(_e){return j.apply(this,arguments)})}]),ApiBase}())||zT;function report_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */report_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function report_createSuper(j){var _e=function report_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var XT,ZT=function(j){_inherits(ReportService,j);var _e,_t,St,Tt,Ut,_r=report_createSuper(ReportService);function ReportService(){var j;_classCallCheck(this,ReportService);for(var _e=arguments.length,_t=new Array(_e),St=0;St<_e;St++)_t[St]=arguments[St];return(j=_r.call.apply(_r,[this].concat(_t))).tickerMap=new Map,j.timer=void 0,j}return _createClass(ReportService,[{key:"guardParams",value:function guardParams(){var j=$E.shared.appId,_e=$E.shared.userId;if(j&&_e)return!0;ZE.shared.handleThrowableError(QE.RTE_ERR_MISSING_PARAMS,new Error("invalid params"))}},{key:"platform",get:function get(){return $E.platform===KE.Electron?"electron":"web"}},{key:"buildBaseParams",value:function buildBaseParams(j,_e,_t,St,Tt,Ut,_r){var _n=(new Date).getTime(),_i=HT()("src=".concat(_e,"&ts=").concat(_n)),Ei=Tt.result,Ci=Tt.errCode,Di=Tt.httpCode,Fi=Tt.api;return{pts:[{m:_t,ls:{ctype:j,platform:this.platform,version:YP.getVersion(),appId:$E.shared.appId,event:Ut,category:_r,result:void 0===Ei?void 0:"".concat(+Ei),errCode:Ci,httpCode:Di,api:Fi},vs:St}],sign:_i,src:_e,ts:_n}}},{key:"buildEventParams",value:function buildEventParams(j,_e,_t,St){return this.buildBaseParams("flexibleClass","rte","event",_t,St,j,_e)}},{key:"buildHBParams",value:function buildHBParams(){return this.buildBaseParams("flexibleClass","rte","online_user",{count:1},{})}},{key:"reportHB",value:(Ut=_asyncToGenerator(report_regeneratorRuntime().mark((function _callee(){var j;return report_regeneratorRuntime().wrap((function _callee$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(this.guardParams()){_e.next=2;break}return _e.abrupt("return");case 2:return _e.next=4,this.fetch({path:"/v1/report",method:"POST",data:this.buildHBParams()});case 4:return j=_e.sent,_e.abrupt("return",j.data);case 6:case"end":return _e.stop()}}),_callee,this)}))),function reportHB(){return Ut.apply(this,arguments)})},{key:"report",value:(Tt=_asyncToGenerator(report_regeneratorRuntime().mark((function _callee2(j,_e,_t,St){var Tt;return report_regeneratorRuntime().wrap((function _callee2$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(this.guardParams()){Ut.next=2;break}return Ut.abrupt("return");case 2:return Ut.next=4,this.fetch({path:"/v1/report",method:"POST",data:this.buildEventParams(j,_e,_t,St||{})});case 4:return Tt=Ut.sent,Ut.abrupt("return",Tt.data);case 6:case"end":return Ut.stop()}}),_callee2,this)}))),function report(j,_e,_t,St){return Tt.apply(this,arguments)})},{key:"tickerKey",value:function tickerKey(j,_e,_t){return"".concat(j,"/").concat(_e,"/").concat(_t||"")}},{key:"startTick",value:function startTick(j,_e,_t){this.tickerMap.set(this.tickerKey(j,_e,_t),(new Date).getTime())}},{key:"getElapse",value:function getElapse(j,_e,_t){var St=this.tickerKey(j,_e,_t);return this.tickerMap.has(St)?(new Date).getTime()-this.tickerMap.get(St):0}},{key:"reportEC",value:(St=_asyncToGenerator(report_regeneratorRuntime().mark((function _callee3(j,_e,_t){return report_regeneratorRuntime().wrap((function _callee3$(St){for(;;)switch(St.prev=St.next){case 0:return St.abrupt("return",this.report(j,_e,{count:1},_t));case 1:case"end":return St.stop()}}),_callee3,this)}))),function reportEC(j,_e,_t){return St.apply(this,arguments)})},{key:"reportElapse",value:(_t=_asyncToGenerator(report_regeneratorRuntime().mark((function _callee4(j,_e,_t){return report_regeneratorRuntime().wrap((function _callee4$(St){for(;;)switch(St.prev=St.next){case 0:return St.abrupt("return",this.report(j,_e,{elapse:this.getElapse(j,_e,null==_t?void 0:_t.api)},_t));case 1:case"end":return St.stop()}}),_callee4,this)}))),function reportElapse(j,_e,St){return _t.apply(this,arguments)})},{key:"reportHttp",value:(_e=_asyncToGenerator(report_regeneratorRuntime().mark((function _callee5(j,_e,_t,St,Tt,Ut){return report_regeneratorRuntime().wrap((function _callee5$(_r){for(;;)switch(_r.prev=_r.next){case 0:return _r.abrupt("return",this.report(j,_e,{elapse:this.getElapse(j,_e,_t)},{api:_t,httpCode:St,result:Tt,errCode:Ut}));case 1:case"end":return _r.stop()}}),_callee5,this)}))),function reportHttp(j,_t,St,Tt,Ut,_r){return _e.apply(this,arguments)})}]),ReportService}(JT);function rtm_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */rtm_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function rtm_createSuper(j){var _e=function rtm_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}ZT.shared=new ZT,function(j){j.DISCONNECTED="DISCONNECTED",j.CONNECTING="CONNECTING",j.CONNECTED="CONNECTED",j.RECONNECTING="RECONNECTING",j.ABORTED="ABORTED"}(XT||(XT={}));var $T=function isTextMessage(j){return void 0!==j.text},_C=function(j){_inherits(AGRtmManager,j);var _e,_t,St,Tt,Ut,_r=rtm_createSuper(AGRtmManager);function AGRtmManager(){var j;return _classCallCheck(this,AGRtmManager),(j=_r.call(this)).connectionState=XT.DISCONNECTED,j.prevConnectionState=XT.DISCONNECTED,j.channels={},j._client=void 0,j.connectionState=XT.DISCONNECTED,j.prevConnectionState=XT.DISCONNECTED,j.channels={},j._client=void 0,j}return _createClass(AGRtmManager,[{key:"client",get:function get(){return this._client}},{key:"sessionId",get:function get(){return this.client.context.sid}},{key:"logFilter",get:function get(){var j=KT().LOG_FILTER_INFO;switch($E.logLevel){case SE.WARN:j=KT().LOG_FILTER_WARNING;break;case SE.ERROR:j=KT().LOG_FILTER_ERROR}return j}},{key:"_region",get:function get(){switch($E.shared.rtmRegion){case HE.AREA_GLOBAL:return"GLOBAL";case HE.AREA_CN:return"CHINA";case HE.AREA_AS:return"ASIA";case HE.AREA_EUR:return"EUROPE";case HE.AREA_NA:return"NORTH_AMERICA";case HE.AREA_JAPAN:return"JAPAN";case HE.AREA_INDIA:return"INDIA"}}},{key:"login",value:(Ut=_asyncToGenerator(rtm_regeneratorRuntime().mark((function _callee(j,_e,_t){var St,Tt=this;return rtm_regeneratorRuntime().wrap((function _callee$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.prev=0,KT().setArea({areaCodes:[this._region]}),St=KT().createInstance($E.shared.appId,{enableLogUpload:_t.uploadLog,logFilter:this.logFilter}),ME.info("[AGRtmManager] wrapper init"),St.on("ConnectionStateChanged",(function(j,_e){ME.info("[AGRtmManager] ConnectionStateChanged",j,_e),Tt.prevConnectionState=Tt.connectionState,Tt.connectionState=j,Tt.emit(RT.RtmConnectionStateChanged,{newState:j,reason:_e})})),St.on("MessageFromPeer",(function(j,_e,_t){$T(j)&&Tt.emit("MessageFromPeer",{message:j.text,peerId:_e,props:_t})})),Ut.next=8,St.login({uid:_e,token:j});case 8:this._client=St,Ut.next=15;break;case 11:Ut.prev=11,Ut.t0=Ut.catch(0),this._destroyRtm(St),ZE.shared.handleThrowableError(QE.RTM_ERR_LOGIN_FAIL,Ut.t0);case 15:case"end":return Ut.stop()}}),_callee,this,[[0,11]])}))),function login(j,_e,_t){return Ut.apply(this,arguments)})},{key:"createObserverChannel",value:function createObserverChannel(j){return[this.client.createChannel(j),new qT.EventEmitter]}},{key:"join",value:(Tt=_asyncToGenerator(rtm_regeneratorRuntime().mark((function _callee2(j,_e,_t){return rtm_regeneratorRuntime().wrap((function _callee2$(St){for(;;)switch(St.prev=St.next){case 0:if(St.prev=0,ZT.shared.startTick("joinRoom","rtm","joinChannel"),this.channels[_t]!==j){St.next=4;break}return St.abrupt("return",ME.warn("[AGRtmManager] skip channel ".concat(_t," join as the channel is already joined")));case 4:return j.on("ChannelMessage",(function(j,St,Tt){_e.emit("ChannelMessage",{channelName:_t,message:j,memberId:St,messagePros:Tt})})),j.on("MemberJoined",(function(j){_e.emit("MemberJoined",{channelName:_t,memberId:j})})),j.on("MemberLeft",(function(j){_e.emit("MemberLeft",{channelName:_t,memberId:j})})),j.on("MemberCountUpdated",(function(j){_e.emit("MemberCountUpdated",{channelName:_t,memberCount:j})})),St.next=10,j.join();case 10:this.channels[_t]=j,ZT.shared.reportElapse("joinRoom","rtm",{api:"joinChannel",result:!0}),St.next=18;break;case 14:St.prev=14,St.t0=St.catch(0),ZT.shared.reportElapse("joinRoom","rtm",{api:"joinChannel",result:!1,errCode:"".concat(St.t0.message)}),ZE.shared.handleThrowableError(QE.RTM_ERR_JOIN_FAILED,St.t0);case 18:case"end":return St.stop()}}),_callee2,this,[[0,14]])}))),function join(j,_e,_t){return Tt.apply(this,arguments)})},{key:"leave",value:(St=_asyncToGenerator(rtm_regeneratorRuntime().mark((function _callee3(j){var _e;return rtm_regeneratorRuntime().wrap((function _callee3$(_t){for(;;)switch(_t.prev=_t.next){case 0:if(_t.prev=0,!(_e=this.channels[j])){_t.next=7;break}return _t.next=5,_e.leave();case 5:_e.removeAllListeners(),delete this.channels[j];case 7:_t.next=12;break;case 9:_t.prev=9,_t.t0=_t.catch(0),ZE.shared.handleNonThrowableError(QE.RTM_ERR_LEAVE_FAILED,_t.t0);case 12:case"end":return _t.stop()}}),_callee3,this,[[0,9]])}))),function leave(j){return St.apply(this,arguments)})},{key:"releaseChannels",value:function releaseChannels(){for(var j=0,_e=Object.keys(this.channels);j<_e.length;j++){var _t=_e[j];this.channels[_t]&&this.release(this.channels[_t]),this.channels[_t]=void 0}}},{key:"releaseClient",value:function releaseClient(){this._client&&this.release(this._client)}},{key:"release",value:function release(j){j.removeAllListeners(),ME.info("[AGRtmManager] eventClient removeAllListeners ")}},{key:"reset",value:function reset(){this.connectionState=XT.DISCONNECTED,this.prevConnectionState=XT.DISCONNECTED,this.releaseClient(),this.releaseChannels(),this.channels={},this.client&&(this.client.removeAllListeners(),ME.info("[AGRtmManager] removeAllListeners")),this._client=void 0,this.removeAllListeners(),ME.info("[AGRtmManager] self removeAllListeners")}},{key:"_destroyRtm",value:function _destroyRtm(j){try{null==j||j.logout()}catch(j){ZE.shared.handleNonThrowableError(QE.RTM_ERR_DESTROY_FAILED,j)}}},{key:"destroyRtm",value:function destroyRtm(){this._destroyRtm(this._client),this._client=void 0}},{key:"sendChannelMessage",value:(_t=_asyncToGenerator(rtm_regeneratorRuntime().mark((function _callee4(j,_e,_t){var St;return rtm_regeneratorRuntime().wrap((function _callee4$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return St=this.channels[j],Tt.next=3,St.sendMessage(_e,{enableHistoricalMessaging:_t.enableHistoricalMessaging});case 3:case"end":return Tt.stop()}}),_callee4,this)}))),function sendChannelMessage(j,_e,St){return _t.apply(this,arguments)})},{key:"sendPeerMessage",value:(_e=_asyncToGenerator(rtm_regeneratorRuntime().mark((function _callee5(j,_e,_t){var St;return rtm_regeneratorRuntime().wrap((function _callee5$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,this.client.sendMessageToPeer(_e,j,{enableHistoricalMessaging:_t.enableHistoricalMessaging});case 2:return St=Tt.sent,Tt.abrupt("return",St.hasPeerReceived);case 4:case"end":return Tt.stop()}}),_callee5,this)}))),function sendPeerMessage(j,_t,St){return _e.apply(this,arguments)})}]),AGRtmManager}(qT.EventEmitter);function _applyDecoratedDescriptor(j,_e,_t,St,Tt){var Ut={};return Object.keys(St).forEach((function(j){Ut[j]=St[j]})),Ut.enumerable=!!Ut.enumerable,Ut.configurable=!!Ut.configurable,("value"in Ut||Ut.initializer)&&(Ut.writable=!0),Ut=_t.slice().reverse().reduce((function(_t,St){return St(j,_e,_t)||_t}),Ut),Tt&&void 0!==Ut.initializer&&(Ut.value=Ut.initializer?Ut.initializer.call(Tt):void 0,Ut.initializer=void 0),void 0===Ut.initializer&&(Object.defineProperty(j,_e,Ut),Ut=null),Ut}__webpack_require__(86);var eR=__webpack_require__(4073),tR=__webpack_require__.n(eR);function _superPropBase(j,_e){for(;!Object.prototype.hasOwnProperty.call(j,_e)&&null!==(j=_getPrototypeOf(j)););return j}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(j,_e,_t){var St=_superPropBase(j,_e);if(St){var Tt=Object.getOwnPropertyDescriptor(St,_e);return Tt.get?Tt.get.call(arguments.length<3?j:_t):Tt.value}},_get.apply(this,arguments)}__webpack_require__(5827);var rR,nR=__webpack_require__(8711),iR=__webpack_require__.n(nR);__webpack_require__(8478),__webpack_require__(3561),__webpack_require__(2049);function task_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */task_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}!function(j){j[j.continue=0]="continue",j[j.exit=1]="exit"}(rR||(rR={}));var oR=function promisify(j){return new Promise(function(){var _e=_asyncToGenerator(task_regeneratorRuntime().mark((function _callee(_e,_t){var St;return task_regeneratorRuntime().wrap((function _callee$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.prev=0,Tt.next=3,j();case 3:St=Tt.sent,_e(St),Tt.next=10;break;case 7:Tt.prev=7,Tt.t0=Tt.catch(0),_t(Tt.t0);case 10:case"end":return Tt.stop()}}),_callee,null,[[0,7]])})));return function(j,_t){return _e.apply(this,arguments)}}())},aR=function(){function PollingTask(j){_classCallCheck(this,PollingTask),this.__arguments=j,this.__timer=void 0,this.__running=!1}return _createClass(PollingTask,[{key:"start",value:function start(){var j=this;if(this.__running)throw new Error("Task is already running");this.__running=!0,this.__arguments.immediate?oR(this.__arguments.runnable).then((function(){j.poll()})):this.poll()}},{key:"poll",value:function poll(){var j=this;if(!this.__running)return this.stop();this.__timer=setTimeout(_asyncToGenerator(task_regeneratorRuntime().mark((function _callee2(){return task_regeneratorRuntime().wrap((function _callee2$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,oR(j.__arguments.runnable).catch((function(_e){j.__arguments.onFail(_e)===rR.exit&&(j.__running=!1)}));case 2:!j.__arguments.once&&j.poll();case 3:case"end":return _e.stop()}}),_callee2)}))),this.__arguments.interval)}},{key:"stop",value:function stop(){clearTimeout(this.__timer),this.__running=!1}},{key:"isStopped",get:function get(){return!this.__running}}]),PollingTask}(),sR=function(){function IntervalTask(j){_classCallCheck(this,IntervalTask),this.__arguments=j,this.__timer=void 0,this.__running=!1}return _createClass(IntervalTask,[{key:"start",value:function start(){var j=this;if(this.__running)throw new Error("Task is already running");this.__running=!0;var _e=this.__arguments,_t=_e.immediate,St=_e.interval;_t&&this.poll(),this.__timer=setInterval((function(){j.poll()}),St)}},{key:"poll",value:function poll(){var j=this;if(!this.__running)return this.stop();var _e=this.__arguments.runnable;oR(_e).catch((function(_e){j.__arguments.onFail(_e)===rR.exit&&(j.__running=!1)}))}},{key:"stop",value:function stop(){clearInterval(this.__timer),this.__running=!1}},{key:"isStopped",get:function get(){return!this.__running}}]),IntervalTask}(),cR=function(){function Duration(){_classCallCheck(this,Duration)}return _createClass(Duration,null,[{key:"second",value:function second(j){return this._factors.second*j}},{key:"minute",value:function minute(j){return this._factors.minute*j}},{key:"hour",value:function hour(j){return this._factors.hour*j}}]),Duration}();cR._factors={hour:36e5,minute:6e4,second:1e3};var uR,lR,dR=function(){function Scheduler(){_classCallCheck(this,Scheduler),this._tasks=new WeakSet}return _createClass(Scheduler,[{key:"addPollingTask",value:function addPollingTask(j,_e){var _t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],St=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return rR.continue},Tt=new aR({runnable:j,interval:_e,immediate:_t,onFail:St});return Tt.start(),this._tasks.add(Tt),Tt}},{key:"addDelayTask",value:function addDelayTask(j,_e){var _t=this,St=new aR({runnable:j,interval:_e,once:!0,onFail:function onFail(){return rR.exit},onComplete:function onComplete(){_t._tasks.delete(St)}});return St.start(),this._tasks.add(St),St}},{key:"addIntervalTask",value:function addIntervalTask(j,_e){var _t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],St=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return rR.continue},Tt=new sR({runnable:j,interval:_e,immediate:_t,onFail:St});return Tt.start(),this._tasks.add(Tt),Tt}}]),Scheduler}(),hR=function createScheduler(){return new dR},fR=hR();function stream_media_player_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */stream_media_player_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function stream_media_player_createSuper(j){var _e=function stream_media_player_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j.ReadyToPlay="ready-to-play",j.InteractiveNeeded="interactive-needed",j.CdnDelayUpdated="cdn-delay-updated"}(uR||(uR={}));var pR,vR,mR,yR=kS.attach({proxyMethods:!1})(lR=function(j){_inherits(StreamMediaPlayer,j);var _e=stream_media_player_createSuper(StreamMediaPlayer);function StreamMediaPlayer(j){var _t;return _classCallCheck(this,StreamMediaPlayer),(_t=_e.call(this))._streamUrl=j,_t.logger=void 0,_t._view=void 0,_t._mediaElement=void 0,_t._containerElement=void 0,_t._hls=void 0,_t._task=void 0,_t._delayTask=void 0,iR().isSupported()&&!_t.browserHlsSupported()&&_t._createHls(),_t}return _createClass(StreamMediaPlayer,[{key:"mediaElement",get:function get(){return this._mediaElement}},{key:"_createHls",value:function _createHls(){var j=this;this._hls=new(iR())({lowLatencyMode:!0,progressive:!0,liveSyncDuration:1});var _e=this._hls;_e.on(iR().Events.MEDIA_ATTACHED,(function(){_e.loadSource(j._streamUrl)})),_e.on(iR().Events.ERROR,(function(_t,St){if(j.logger.error("HLS ->","ERROR:",_t,St),St.fatal)switch(St.type){case iR().ErrorTypes.NETWORK_ERROR:j.logger.error("fatal network error encountered, try to recover"),_e.loadSource(j._streamUrl);break;case iR().ErrorTypes.MEDIA_ERROR:j.logger.error("fatal media error encountered, try to recover"),_e.recoverMediaError();break;default:_e.destroy()}})),_e.on(iR().Events.MANIFEST_PARSED,(function(_e,_t){j.logger.info("HLS ->","manifest loaded, found "+_t.levels.length+" quality level")})),_e.on(iR().Events.FRAG_PARSING_METADATA,(function(_e,_t){j.logger.info("HLS ->","FRAG_PARSING_METADATA:",_e,_t)})),_e.on(iR().Events.FRAG_PARSING_USERDATA,(function(_e,_t){var St=_t.samples.reduce((function(j,_e){var _t=JSON.parse(_e.userData).ts;return j>_t?_t:j}),Date.now()),Tt=Date.now()-St;j.logger.info("HLS ->","FRAG_PARSING_USERDATA:",_e,_t,Tt),j.emit(uR.CdnDelayUpdated,Tt+3e3)}))}},{key:"_attachMediaTag",value:function _attachMediaTag(j,_e){var _t,St=this;if(j!==(null===(_t=this._mediaElement)||void 0===_t?void 0:_t.tagName)&&this._detachMediaTag(),this._view){var Tt,Ut=document.createElement(j);Ut.style.width="100%",Ut.style.height="100%",Ut.style.objectFit="cover",Ut.autoplay=!0,Ut.muted=!_e,Ut.setAttribute("playsinline","");var _r=document.createElement("div");_r.style.width="100%",_r.style.height="100%",_r.style.position="relative",_r.style.overflow="hidden",_r.style.backgroundColor="black",_r.className="agora_stream_media_player",_r.appendChild(Ut),this._view.appendChild(_r),this._mediaElement=Ut,this._containerElement=_r,null===(Tt=this._mediaElement)||void 0===Tt||Tt.addEventListener("canplay",(function(){St.emit(uR.ReadyToPlay)}),{once:!0})}if(this._mediaElement&&this._hls)this._hls.attachMedia(this._mediaElement),"audio"===j&&(this._delayTask=fR.addPollingTask((function(){St.emit(uR.CdnDelayUpdated,7e3)}),cR.second(1)));else{if(!this._mediaElement||!this.browserHlsSupported())throw new Error("can not play hls on this device");this._mediaElement.src=this._streamUrl,this.emit(uR.CdnDelayUpdated,7e3)}}},{key:"_detachMediaTag",value:function _detachMediaTag(){this._mediaElement&&(this._view&&this._containerElement&&(this._view.removeChild(this._containerElement),this._containerElement=void 0),this._mediaElement=void 0),this._hls&&this._hls.detachMedia()}},{key:"takeSnapshot",value:function takeSnapshot(){return new Blob}},{key:"setView",value:function setView(j){this._view&&j&&this._view!==j&&this._detachMediaTag(),this._view=j}},{key:"play",value:function play(j,_e){var _t=this;j&&this._attachMediaTag("video",j),_e&&!j&&this._attachMediaTag("audio",_e),this._mediaElement&&(this._mediaElement.play().then((function(){_t.emit(uR.InteractiveNeeded,!1)})).catch((function(j){"NotAllowedError"===j.name&&_t.emit(uR.InteractiveNeeded,!0)})),this.playAttempt())}},{key:"stop",value:function stop(){this._mediaElement&&this._mediaElement.pause(),this._detachMediaTag()}},{key:"playAttempt",value:function playAttempt(){var j=this;this._task||(this._task=fR.addPollingTask(_asyncToGenerator(stream_media_player_regeneratorRuntime().mark((function _callee(){return stream_media_player_regeneratorRuntime().wrap((function _callee$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(j._mediaElement){_e.next=2;break}return _e.abrupt("return");case 2:return _e.prev=2,_e.next=5,j._mediaElement.play();case 5:j.emit(uR.InteractiveNeeded,!1),j._task&&j._task.stop(),_e.next=12;break;case 9:_e.prev=9,_e.t0=_e.catch(2),j.emit(uR.InteractiveNeeded,!0);case 12:case"end":return _e.stop()}}),_callee,null,[[2,9]])}))),1e3))}},{key:"on",value:function on(j,_e){return _get(_getPrototypeOf(StreamMediaPlayer.prototype),"on",this).call(this,j,_e)}},{key:"once",value:function once(j,_e){return _get(_getPrototypeOf(StreamMediaPlayer.prototype),"once",this).call(this,j,_e)}},{key:"off",value:function off(j,_e){return _get(_getPrototypeOf(StreamMediaPlayer.prototype),"off",this).call(this,j,_e)}},{key:"dispose",value:function dispose(){this._detachMediaTag(),this._hls&&this._hls.destroy(),this._task&&this._task.stop()}},{key:"clearDelayTask",value:function clearDelayTask(){this._delayTask&&(this._delayTask.stop(),this._delayTask=void 0)}},{key:"browserHlsSupported",value:function browserHlsSupported(){return!!document.createElement("video").canPlayType("application/vnd.apple.mpegURL")}}]),StreamMediaPlayer}(_a))||lR;function track_createSuper(j){var _e=function track_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j[j.None=0]="None",j[j.Camera=1]="Camera",j[j.ScreenShare=2]="ScreenShare",j[j.MediaPlayer=3]="MediaPlayer"}(pR||(pR={})),function(j){j[j.None=0]="None",j[j.Mic=1]="Mic",j[j.ScreenShare=2]="ScreenShare",j[j.MediaPlayer=3]="MediaPlayer"}(vR||(vR={})),function(j){j[j.Unpublished=0]="Unpublished",j[j.Published=1]="Published"}(mR||(mR={}));var AR,_R,bR=_createClass((function AgoraRteMediaTrack(j,_e){var _t=_e.videoSourceType,St=_e.audioSourceType;_classCallCheck(this,AgoraRteMediaTrack),this.videoSourceType=pR.None,this.audioSourceType=vR.None,this.rtc=void 0,this.rtc=j,_t&&(this.videoSourceType=_t),St&&(this.audioSourceType=St)})),ER=function(j){_inherits(AgoraRteStreamMediaTrack,j);var _e=track_createSuper(AgoraRteStreamMediaTrack);function AgoraRteStreamMediaTrack(j,_t){var St,Tt,Ut;return _classCallCheck(this,AgoraRteStreamMediaTrack),(Ut=_e.call(this,j,{videoSourceType:pR.MediaPlayer,audioSourceType:vR.MediaPlayer})).playVideo=void 0,Ut.playAudio=void 0,Ut.streamUrl=void 0,Ut.player=void 0,Ut.playVideo=null===(St=null==_t?void 0:_t.playVideo)||void 0===St||St,Ut.playAudio=null===(Tt=null==_t?void 0:_t.playAudio)||void 0===Tt||Tt,Ut}return _createClass(AgoraRteStreamMediaTrack,[{key:"setPlayVideo",value:function setPlayVideo(j){this.playVideo=j}},{key:"setPlayAudio",value:function setPlayAudio(j){this.playAudio=j}},{key:"setView",value:function setView(j){this.player&&this.player.dispose(),this.player=new yR(j.streamUrl),this.player.setView(j.view)}},{key:"start",value:function start(){return this.player&&(this.playVideo||this.playAudio)&&this.player.play(this.playVideo,this.playAudio),0}},{key:"stop",value:function stop(){return this.player&&this.player.stop(),0}}]),AgoraRteStreamMediaTrack}(bR),wR=function(j){_inherits(AgoraRteCameraVideoTrack,j);var _e=track_createSuper(AgoraRteCameraVideoTrack);function AgoraRteCameraVideoTrack(j){var _t;return _classCallCheck(this,AgoraRteCameraVideoTrack),(_t=_e.call(this,j,{videoSourceType:pR.Camera})).state=RR.stopped,j.onLocalVideoTrackStateChanged((function(j,_e){_e===pR.Camera&&(_t.state=j)})),_t}return _createClass(AgoraRteCameraVideoTrack,[{key:"addProcessors",value:function addProcessors(j){this.rtc.addCameraProcessors(j)}},{key:"removeProcessors",value:function removeProcessors(){this.rtc.removeCameraProcessors()}},{key:"setView",value:function setView(j){this.rtc.setupLocalVideo(j,pR.Camera)}},{key:"setDeviceId",value:function setDeviceId(j){this.rtc.setVideoCameraDevice(j)}},{key:"setVideoEncoderConfiguration",value:function setVideoEncoderConfiguration(){}},{key:"start",value:function start(){return this.rtc.enableLocalVideo(!0)}},{key:"stop",value:function stop(){return this.rtc.enableLocalVideo(!1)}}]),AgoraRteCameraVideoTrack}(bR),SR=function(j){_inherits(AgoraRteMicrophoneAudioTrack,j);var _e=track_createSuper(AgoraRteMicrophoneAudioTrack);function AgoraRteMicrophoneAudioTrack(j){var _t;return _classCallCheck(this,AgoraRteMicrophoneAudioTrack),(_t=_e.call(this,j,{audioSourceType:vR.Mic})).state=RR.stopped,j.onLocalAudioTrackStateChanged((function(j,_e){_e===vR.Mic&&(_t.state=j)})),_t}return _createClass(AgoraRteMicrophoneAudioTrack,[{key:"addProcessors",value:function addProcessors(j){return this.rtc.addMicrophoneProcessors(j)}},{key:"removeProcessors",value:function removeProcessors(){return this.rtc.removeMicrophoneProcessors()}},{key:"setRecordingDevice",value:function setRecordingDevice(j){return this.rtc.setAudioRecordingDevice(j)}},{key:"setPlaybackDevice",value:function setPlaybackDevice(j){return this.rtc.setAudioPlaybackDevice(j)}},{key:"setAudioRawDataConfig",value:function setAudioRawDataConfig(j){this.rtc.setAudioRawDataConfig(j,XR.record)}},{key:"addAudioRawDataObserver",value:function addAudioRawDataObserver(j){this.rtc.addAudioRawDataObserver(j,XR.record)}},{key:"removeAudioRawDataObserver",value:function removeAudioRawDataObserver(j){this.rtc.removeAudioRawDataObserver(j,XR.record)}},{key:"start",value:function start(){return this.rtc.enableLocalAudio(!0)}},{key:"stop",value:function stop(){return this.rtc.enableLocalAudio(!1)}}]),AgoraRteMicrophoneAudioTrack}(bR),IR=function(j){_inherits(AgoraRteScreenShareTrack,j);var _e=track_createSuper(AgoraRteScreenShareTrack);function AgoraRteScreenShareTrack(j){return _classCallCheck(this,AgoraRteScreenShareTrack),_e.call(this,j,{videoSourceType:pR.ScreenShare,audioSourceType:vR.ScreenShare})}return _createClass(AgoraRteScreenShareTrack,[{key:"setView",value:function setView(j){this.rtc.setupLocalVideo(j,pR.ScreenShare)}},{key:"start",value:function start(){return this.rtc.startScreenCapture()}},{key:"startWithParams",value:function startWithParams(j){return this.rtc.startScreenCapture(j)}},{key:"stop",value:function stop(){return this.rtc.stopScreenCapture()}}]),AgoraRteScreenShareTrack}(bR);!function(j){j[j.main=0]="main",j[j.sub=1]="sub"}(_R||(_R={}));var TR,CR,RR,kR,OR,DR,xR,LR,NR,PR,MR,BR=kS.attach()(AR=function(){function AGRtcChannel(j,_e){_classCallCheck(this,AGRtcChannel),this.channelName=void 0,this._adapter=void 0,this._adapter=_e,this.channelName=j}return _createClass(AGRtcChannel,[{key:"connectionType",value:function connectionType(j){return void 0===j?_R.main:j}},{key:"enableDualStream",value:function enableDualStream(j,_e){return this._adapter.enableDualStream(j,this.connectionType(_e))}},{key:"setLowStreamParameter",value:function setLowStreamParameter(j,_e){return this._adapter.setLowStreamParameter(j,this.connectionType(_e))}},{key:"setRemoteVideoStreamType",value:function setRemoteVideoStreamType(j,_e,_t){return this._adapter.setRemoteVideoStreamType(j,_e,this.connectionType(_t))}},{key:"getRtcSid",value:function getRtcSid(){return this._adapter.getSessionId()}},{key:"join",value:function join(j,_e,_t){return this._adapter.join(j,_e,this.connectionType(_t))}},{key:"leave",value:function leave(j){return this._adapter.leave(j)}},{key:"muteLocalVideoStream",value:function muteLocalVideoStream(j,_e){return this._adapter.muteLocalVideo(j,this.connectionType(_e))}},{key:"muteLocalAudioStream",value:function muteLocalAudioStream(j,_e){return this._adapter.muteLocalAudio(j,this.connectionType(_e))}},{key:"muteLocalScreenStream",value:function muteLocalScreenStream(j,_e){return this._adapter.muteLocalScreenShare(j,this.connectionType(_e))}},{key:"muteRemoteVideoStream",value:function muteRemoteVideoStream(j,_e){return this._adapter.muteRemoteVideo(j,_e)}},{key:"muteRemoteAudioStream",value:function muteRemoteAudioStream(j,_e){return this._adapter.muteRemoteAudio(j,_e)}},{key:"onNetworkStats",value:function onNetworkStats(j){return this._adapter.onNetworkStats(j)}},{key:"onAudioVolumeIndication",value:function onAudioVolumeIndication(j){return this._adapter.onAudioVolumeIndication(j)}},{key:"onConnectionStageChanged",value:function onConnectionStageChanged(j){return this._adapter.onConnectionStateChanged(j)}},{key:"setLatencyLevel",value:function setLatencyLevel(j){this._adapter.setLatencyLevel(j)}},{key:"muteRemoteVideoStreamMass",value:function muteRemoteVideoStreamMass(j,_e){return this._adapter.muteRemoteVideoMass(j,_e)}}]),AGRtcChannel}())||AR;__webpack_require__(3290);function user_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */user_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}!function(j){j[j.unknown=99]="unknown",j[j.bad=1]="bad",j[j.poor=2]="poor",j[j.good=3]="good",j[j.great=4]="great",j[j.down=5]="down"}(TR||(TR={})),function(j){j[j.Unknown=0]="Unknown",j[j.PermissionDenied=1]="PermissionDenied"}(CR||(CR={})),function(j){j[j.stopped=0]="stopped",j[j.starting=2]="starting",j[j.started=1]="started",j[j.error=-1]="error"}(RR||(RR={})),function(j){j[j.Idle=0]="Idle",j[j.Connecting=1]="Connecting",j[j.Connected=2]="Connected",j[j.Reconnecting=3]="Reconnecting"}(kR||(kR={})),function(j){j[j.AES_128_XTS=1]="AES_128_XTS",j[j.AES_128_ECB=2]="AES_128_ECB",j[j.AES_256_XTS=3]="AES_256_XTS",j[j.SM4_128_ECB=4]="SM4_128_ECB",j[j.AES_128_GCM=5]="AES_128_GCM",j[j.AES_256_GCM=6]="AES_256_GCM"}(OR||(OR={})),function(j){j[j.Window=0]="Window",j[j.Screen=1]="Screen"}(DR||(DR={})),function(j){j[j.fit=0]="fit",j[j.fill=1]="fill"}(xR||(xR={})),function(j){j[j.low=0]="low",j[j.normal=1]="normal",j[j.height=2]="height"}(LR||(LR={})),function(j){j[j.HIGH_STREAM=0]="HIGH_STREAM",j[j.LOW_STREAM=1]="LOW_STREAM"}(NR||(NR={}));var UR=kS.attach({proxyMethods:!1})((MR=function(){function AgoraRteLocalUser(j,_e){var _t,St,Tt=_e.userUuid,Ut=_e.userName,_r=_e.userRole,_n=_e.streamUuid,_i=_e.sceneId,Ei=_e.rtcToken,Ci=_e.rtc,Di=_e.userProperties;_classCallCheck(this,AgoraRteLocalUser),this.logger=void 0,this.userUuid=void 0,this.userName=void 0,this.userRole=void 0,this.userProperties=void 0,this.streamUuid=void 0,this.sceneId=void 0,this.rtcToken=void 0,this._rtc=void 0,this._scene=void 0,this._debouncedSyncVideo=tR()(this._syncVideoSourceState,500),this._debouncedSyncAudio=tR()(this._syncAudioSourceState,500),this._cameraState=void 0,this._micState=void 0,this.subStream=void 0,this.userUuid=Tt,this.userName=Ut,this.userRole=_r,this.userProperties=Di,this.streamUuid=_n,this.sceneId=_i,this.rtcToken=Ei,this._rtc=Ci,this._scene=j,this._cameraState=null===(_t=j.engine.getAgoraMediaControl().camera)||void 0===_t?void 0:_t.state,this._micState=null===(St=j.engine.getAgoraMediaControl().microphone)||void 0===St?void 0:St.state,this._addEventHandler()}var j,_e,_t,St,Tt,Ut,_r,_n,_i,Ei,Ci;return _createClass(AgoraRteLocalUser,[{key:"toData",value:function toData(){var j=this.userName,_e=this.userUuid,_t=this.userRole,St=this.userProperties;return OT.fromData({userName:j,userUuid:_e,role:_t,userProperties:St})}},{key:"destroy",value:function destroy(){var j=this._scene.engine;j.getAgoraMediaControl().off($R.localVideoTrackChanged,this._handleVideoTrackStateChange),j.getAgoraMediaControl().off($R.localAudioTrackChanged,this._handleAudioTrackStateChange),this._scene.off(RT.LocalStreamAdded,this._checkMediaStateStayInSync),this._scene.off(RT.LocalStreamUpdate,this._checkMediaStateStayInSync)}},{key:"_addEventHandler",value:function _addEventHandler(){var j=this._scene.engine;j.getAgoraMediaControl().on($R.localVideoTrackChanged,this._handleVideoTrackStateChange),j.getAgoraMediaControl().on($R.localAudioTrackChanged,this._handleAudioTrackStateChange),this._scene.on(RT.LocalStreamAdded,this._checkMediaStateStayInSync),this._scene.on(RT.LocalStreamUpdate,this._checkMediaStateStayInSync)}},{key:"_checkMediaStateStayInSync",value:function _checkMediaStateStayInSync(j){var _e=this;j.forEach((function(j){(0,lS.isUndefined)(_e._cameraState)||j.videoSourceType!==pR.Camera||_e._cameraState===j.videoSourceState||(_e.logger.info("camera state is not synced with stream's state, attempt to rectify.. videoSourceState => ".concat(_e._cameraState)),_e._debouncedSyncVideo(_e._cameraState)),(0,lS.isUndefined)(_e._micState)||j.audioSourceType!==vR.Mic||_e._micState===j.audioSourceState||(_e.logger.info("mic state is not synced with stream's state, attempt to rectify.. audioSourceState => ".concat(_e._micState)),_e._debouncedSyncAudio(_e._micState))}))}},{key:"_handleVideoTrackStateChange",value:function _handleVideoTrackStateChange(j,_e){_e===pR.Camera&&j!==RR.starting&&(this._cameraState=j,this.logger.info("camera state changed, syncing video source state => ".concat(j)),this._debouncedSyncVideo(j))}},{key:"_handleAudioTrackStateChange",value:function _handleAudioTrackStateChange(j,_e){_e===vR.Mic&&j!==RR.starting&&(this._micState=j,this.logger.info("mic state changed, syncing audio source state => ".concat(j)),this._debouncedSyncAudio(j))}},{key:"_syncVideoSourceState",value:function _syncVideoSourceState(j){this.updateLocalMediaState({videoSourceState:j})}},{key:"_syncAudioSourceState",value:function _syncAudioSourceState(j){this.updateLocalMediaState({audioSourceState:j})}},{key:"setSceneProperties",value:(Ci=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee(j,_e){return user_regeneratorRuntime().wrap((function _callee$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.next=2,this._scene.getApiService().updateRoomProperties({roomUuid:this.sceneId,properties:j,cause:_e});case 2:return _t.abrupt("return",_t.sent);case 3:case"end":return _t.stop()}}),_callee,this)}))),function setSceneProperties(j,_e){return Ci.apply(this,arguments)})},{key:"deleteSceneProperties",value:(Ei=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee2(j,_e){return user_regeneratorRuntime().wrap((function _callee2$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.next=2,this._scene.getApiService().deleteRoomProperties({roomUuid:this.sceneId,properties:j,cause:_e});case 2:return _t.abrupt("return",_t.sent);case 3:case"end":return _t.stop()}}),_callee2,this)}))),function deleteSceneProperties(j,_e){return Ei.apply(this,arguments)})},{key:"setUserProperties",value:(_i=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee3(j,_e){return user_regeneratorRuntime().wrap((function _callee3$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.next=2,this._scene.getApiService().updateUserProperties({userUuid:this.userUuid,roomUuid:this.sceneId,properties:j,cause:_e});case 2:return _t.abrupt("return",_t.sent);case 3:case"end":return _t.stop()}}),_callee3,this)}))),function setUserProperties(j,_e){return _i.apply(this,arguments)})},{key:"deleteUserProperties",value:(_n=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee4(j,_e){return user_regeneratorRuntime().wrap((function _callee4$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.next=2,this._scene.getApiService().deleteUserProperties({userUuid:this.userUuid,roomUuid:this.sceneId,properties:j,cause:_e});case 2:return _t.abrupt("return",_t.sent);case 3:case"end":return _t.stop()}}),_callee4,this)}))),function deleteUserProperties(j,_e){return _n.apply(this,arguments)})},{key:"updateLocalMediaState",value:(_r=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee5(j,_e){var _t,St,Tt;return user_regeneratorRuntime().wrap((function _callee5$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return St=j.videoSourceState,Tt=j.audioSourceState,Ut.next=3,this._scene.getApiService().updateDeviceState(this.sceneId,this.userUuid,_e&&_e===_R.sub?(null===(_t=this.subStream)||void 0===_t?void 0:_t.streamUuid)||"0":this.streamUuid,{videoSourceState:St,audioSourceState:Tt});case 3:return Ut.abrupt("return",Ut.sent);case 4:case"end":return Ut.stop()}}),_callee5,this)}))),function updateLocalMediaState(j,_e){return _r.apply(this,arguments)})},{key:"updateLocalMediaStream",value:(Ut=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee6(j,_e){var _t,St,Tt,Ut,_r;return user_regeneratorRuntime().wrap((function _callee6$(_n){for(;;)switch(_n.prev=_n.next){case 0:return St=j.publishVideo,Tt=j.publishAudio,Ut=j.videoSourceType,_r=j.audioSourceType,_n.next=3,this._scene.getApiService().upsertStream(this.sceneId,this.userUuid,_e&&_e===_R.sub?(null===(_t=this.subStream)||void 0===_t?void 0:_t.streamUuid)||"0":this.streamUuid,{publishVideo:St,publishAudio:Tt,videoSourceType:Ut,audioSourceType:_r});case 3:return _n.abrupt("return",_n.sent);case 4:case"end":return _n.stop()}}),_callee6,this)}))),function updateLocalMediaStream(j,_e){return Ut.apply(this,arguments)})},{key:"updateRemoteMediaStream",value:(Tt=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee7(j,_e,_t,St){var Tt,Ut;return user_regeneratorRuntime().wrap((function _callee7$(St){for(;;)switch(St.prev=St.next){case 0:return Tt=_t.publishVideo,Ut=_t.publishAudio,St.next=3,this._scene.getApiService().upsertStream(this.sceneId,j,_e,{publishVideo:Tt,publishAudio:Ut});case 3:return St.abrupt("return",St.sent);case 4:case"end":return St.stop()}}),_callee7,this)}))),function updateRemoteMediaStream(j,_e,_t,St){return Tt.apply(this,arguments)})},{key:"deleteLocalMediaStream",value:(St=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee8(){return user_regeneratorRuntime().wrap((function _callee8$(j){for(;;)switch(j.prev=j.next){case 0:return j.next=2,this._scene.getApiService().deleteStream(this.sceneId,this.userUuid,this.streamUuid);case 2:return j.abrupt("return",j.sent);case 3:case"end":return j.stop()}}),_callee8,this)}))),function deleteLocalMediaStream(){return St.apply(this,arguments)})},{key:"deleteLocalScreenStream",value:(_t=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee9(){return user_regeneratorRuntime().wrap((function _callee9$(j){for(;;)switch(j.prev=j.next){case 0:if(!this.subStream){j.next=4;break}return j.next=3,this._scene.getApiService().deleteStream(this.sceneId,this.userUuid,this.subStream.streamUuid);case 3:return j.abrupt("return",j.sent);case 4:case"end":return j.stop()}}),_callee9,this)}))),function deleteLocalScreenStream(){return _t.apply(this,arguments)})},{key:"sendRoomMessage",value:(_e=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee10(j){return user_regeneratorRuntime().wrap((function _callee10$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this._scene.getApiService().sendRoomChatMessage(j,this.sceneId);case 2:return _e.abrupt("return",_e.sent);case 3:case"end":return _e.stop()}}),_callee10,this)}))),function sendRoomMessage(j){return _e.apply(this,arguments)})},{key:"publishStreamToCdn",value:(j=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee11(j){var _e,_t,St,Tt,Ut,_r,_n,_i;return user_regeneratorRuntime().wrap((function _callee11$(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return _e=$E.shared.rtcConfigs.defaultCameraEncoderConfigurations,St=(_t=j||_e||{}).height,Tt=void 0===St?0:St,Ut=_t.width,_r=void 0===Ut?0:Ut,_n=_t.bitrate,_i=void 0===_n?0:_n,Ei.next=4,this._scene.getApiService().publishStreamToCdn(this.sceneId,this.userUuid,this.streamUuid,{converterOptions:{height:Tt,width:_r,bitrate:_i,seiOptions:{source:{metadata:!0,datastream:!1},sink:{type:5}}}});case 4:return Ei.abrupt("return",Ei.sent);case 5:case"end":return Ei.stop()}}),_callee11,this)}))),function publishStreamToCdn(_e){return j.apply(this,arguments)})},{key:"setupRemoteVideo",value:function setupRemoteVideo(j){this._rtc.setupRemoteVideo(j)}}]),AgoraRteLocalUser}(),_applyDecoratedDescriptor(MR.prototype,"_checkMediaStateStayInSync",[xS],Object.getOwnPropertyDescriptor(MR.prototype,"_checkMediaStateStayInSync"),MR.prototype),_applyDecoratedDescriptor(MR.prototype,"_handleVideoTrackStateChange",[xS],Object.getOwnPropertyDescriptor(MR.prototype,"_handleVideoTrackStateChange"),MR.prototype),_applyDecoratedDescriptor(MR.prototype,"_handleAudioTrackStateChange",[xS],Object.getOwnPropertyDescriptor(MR.prototype,"_handleAudioTrackStateChange"),MR.prototype),_applyDecoratedDescriptor(MR.prototype,"_syncVideoSourceState",[xS],Object.getOwnPropertyDescriptor(MR.prototype,"_syncVideoSourceState"),MR.prototype),_applyDecoratedDescriptor(MR.prototype,"_syncAudioSourceState",[xS],Object.getOwnPropertyDescriptor(MR.prototype,"_syncAudioSourceState"),MR.prototype),PR=MR))||PR,FR=function(){function AgoraRteSyncDataStore(){_classCallCheck(this,AgoraRteSyncDataStore),this._users=ST.Map(),this._roomProperties=ST.Map({}),this._streams=ST.Map(),this._roomInfo=ST.Map(),this._messages=ST.List([])}return _createClass(AgoraRteSyncDataStore,[{key:"users",get:function get(){return this._users}},{key:"setUsers",value:function setUsers(j){this._users=ST.Map(j)}},{key:"setUser",value:function setUser(j,_e){this._users=this._users.set(j,_e)}},{key:"deleteUser",value:function deleteUser(j){this._users=this._users.delete(j)}},{key:"findUser",value:function findUser(j){return this._users.get(j)}},{key:"roomProperties",get:function get(){return this._roomProperties}},{key:"setRoomProperties",value:function setRoomProperties(j){this._roomProperties=ST.Map(j)}},{key:"streams",get:function get(){return this._streams}},{key:"setStreams",value:function setStreams(j){this._streams=ST.Map(j)}},{key:"findUserStreams",value:function findUserStreams(j){return Array.from(this._streams.values()).filter((function(_e){return _e.fromUser.userUuid===j}))}},{key:"setStream",value:function setStream(j,_e){this._streams=this._streams.set(j,_e)}},{key:"deleteStream",value:function deleteStream(j){this._streams=this._streams.delete(j)}},{key:"findStream",value:function findStream(j){return this._streams.get(j)}},{key:"roomInfo",get:function get(){return this._roomInfo}},{key:"setRoomInfo",value:function setRoomInfo(j){this._roomInfo=ST.Map(j)}},{key:"messages",get:function get(){return this._messages}},{key:"addMessage",value:function addMessage(j){this._messages.push(j)}}]),AgoraRteSyncDataStore}();function to(j,_e){return j.then((function(j){return[null,j]})).catch((function(j){return _e&&Object.assign(j,_e),[j,void 0]}))}const GR=to;var qR;function api_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */api_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function api_createSuper(j){var _e=function api_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var QR,WR,zR=kS.attach()(qR=function(j){_inherits(AgoraRteService,j);var _e,_t,St,Tt,Ut,_r,_n,_i,Ei,Ci,Di,Fi,_o,ga,_a,_s,_c=api_createSuper(AgoraRteService);function AgoraRteService(){return _classCallCheck(this,AgoraRteService),_c.call(this)}return _createClass(AgoraRteService,[{key:"checkIn",value:(_s=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee(j,_e,_t,St,Tt){var Ut,_r;return api_regeneratorRuntime().wrap((function _callee$(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.next=2,this.fetch({path:"/v2/rooms/".concat(j,"/users/").concat(_e),pathPrefix:"/edu/apps/".concat($E.shared.appId),method:"PUT",data:{boardRegion:"cn-hz",duration:18e3,role:Tt,roomName:_t,roomType:4,userName:St,userProperties:{}}});case 2:return Ut=_n.sent,_r=Ut.data,_n.abrupt("return",_r);case 5:case"end":return _n.stop()}}),_callee,this)}))),function checkIn(j,_e,_t,St,Tt){return _s.apply(this,arguments)})},{key:"entryRoom",value:(_a=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee2(j){var _e,_t,St;return api_regeneratorRuntime().wrap((function _callee2$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return ZT.shared.startTick("joinRoom","http","entry"),Tt.next=3,this.fetch({path:"/v1/rooms/".concat(j.roomUuid,"/users/").concat(j.userUuid,"/entry"),method:"POST",data:j});case 3:return _e=Tt.sent,_t=_e.__status,St=_e.code,ZT.shared.reportHttp("joinRoom","http","entry",_t,200===_t,St),Tt.abrupt("return",_e.data);case 8:case"end":return Tt.stop()}}),_callee2,this)}))),function entryRoom(j){return _a.apply(this,arguments)})},{key:"syncSnapShot",value:(ga=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee3(j){var _e,_t,St,Tt,Ut,_r,_n,_i;return api_regeneratorRuntime().wrap((function _callee3$(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return Ei.next=2,this.fetch({path:"/v1/rooms/".concat(j,"/snapshot"),method:"GET"});case 2:return _t=Ei.sent,St=_t.data,Tt=null!==(_e=St.sequence)&&void 0!==_e?_e:0,Ut=jT()(St,"snapshot.room.roomInfo",null),_r=jT()(St,"snapshot.room.roomProperties",null),_n=jT()(St,"snapshot.room.roomState"),_i=jT()(St,"snapshot.users",[]),Ei.abrupt("return",{seq:Tt,roomInfo:Ut,roomState:_n,roomProperties:_r,users:_i});case 10:case"end":return Ei.stop()}}),_callee3,this)}))),function syncSnapShot(j){return ga.apply(this,arguments)})},{key:"syncSequence",value:(_o=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee4(j,_e,_t){var St;return api_regeneratorRuntime().wrap((function _callee4$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,this.fetch({path:"/v1/rooms/".concat(j,"/sequences?nextId=").concat(_e,"&count=").concat(_t),method:"GET"});case 2:return St=Tt.sent,Tt.abrupt("return",St.data);case 4:case"end":return Tt.stop()}}),_callee4,this)}))),function syncSequence(j,_e,_t){return _o.apply(this,arguments)})},{key:"updateRoomProperties",value:(Fi=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee5(j){var _e,_t,St,Tt,Ut;return api_regeneratorRuntime().wrap((function _callee5$(_r){for(;;)switch(_r.prev=_r.next){case 0:return _e=j.roomUuid,_t=j.properties,St=j.cause,Tt={properties:_t},St&&(Tt.cause=St),_r.next=5,this.fetch({path:"/v1/rooms/".concat(_e,"/properties"),method:"PUT",data:Tt});case 5:return Ut=_r.sent,_r.abrupt("return",Ut.data);case 7:case"end":return _r.stop()}}),_callee5,this)}))),function updateRoomProperties(j){return Fi.apply(this,arguments)})},{key:"deleteRoomProperties",value:(Di=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee6(j){var _e,_t,St,Tt,Ut;return api_regeneratorRuntime().wrap((function _callee6$(_r){for(;;)switch(_r.prev=_r.next){case 0:return _e=j.roomUuid,_t=j.properties,St=j.cause,Tt={properties:_t},St&&(Tt.cause=St),_r.next=5,this.fetch({path:"/v1/rooms/".concat(_e,"/properties"),method:"DELETE",data:Tt});case 5:return Ut=_r.sent,_r.abrupt("return",Ut.data);case 7:case"end":return _r.stop()}}),_callee6,this)}))),function deleteRoomProperties(j){return Di.apply(this,arguments)})},{key:"updateUserProperties",value:(Ci=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee7(j){var _e,_t,St,Tt,Ut,_r;return api_regeneratorRuntime().wrap((function _callee7$(_n){for(;;)switch(_n.prev=_n.next){case 0:return _e=j.roomUuid,_t=j.userUuid,St=j.properties,Tt=j.cause,Ut={properties:St,cause:void 0===Tt?void 0:Tt},_n.next=4,this.fetch({path:"/v1/rooms/".concat(_e,"/users/").concat(_t,"/properties"),method:"PUT",data:Ut});case 4:return _r=_n.sent,_n.abrupt("return",_r.data);case 6:case"end":return _n.stop()}}),_callee7,this)}))),function updateUserProperties(j){return Ci.apply(this,arguments)})},{key:"updateBatchUserProperties",value:(Ei=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee8(j){var _e,_t,St;return api_regeneratorRuntime().wrap((function _callee8$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return _e=j.roomUuid,_t=j.data,Tt.next=3,this.fetch({path:"/v1/rooms/".concat(_e,"/users/properties"),method:"PUT",data:{users:_t}});case 3:return St=Tt.sent,Tt.abrupt("return",St.data);case 5:case"end":return Tt.stop()}}),_callee8,this)}))),function updateBatchUserProperties(j){return Ei.apply(this,arguments)})},{key:"deleteUserProperties",value:(_i=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee9(j){var _e,_t,St,Tt,Ut,_r,_n;return api_regeneratorRuntime().wrap((function _callee9$(_i){for(;;)switch(_i.prev=_i.next){case 0:return _e=j.roomUuid,_t=j.userUuid,St=j.properties,Tt=j.cause,_r={properties:St},(Ut=void 0===Tt?void 0:Tt)&&(_r.cause=Ut),_i.next=5,this.fetch({path:"/v1/rooms/".concat(_e,"/users/").concat(_t,"/properties"),method:"DELETE",data:{users:_r}});case 5:return _n=_i.sent,_i.abrupt("return",_n.data);case 7:case"end":return _i.stop()}}),_callee9,this)}))),function deleteUserProperties(j){return _i.apply(this,arguments)})},{key:"deleteBatchUserProperties",value:(_n=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee10(j){var _e,_t,St;return api_regeneratorRuntime().wrap((function _callee10$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return _e=j.roomUuid,_t=j.data,Tt.next=3,this.fetch({path:"/v1/rooms/".concat(_e,"/users/properties"),method:"DELETE",data:{users:_t}});case 3:return St=Tt.sent,Tt.abrupt("return",St.data);case 5:case"end":return Tt.stop()}}),_callee10,this)}))),function deleteBatchUserProperties(j){return _n.apply(this,arguments)})},{key:"upsertStream",value:(_r=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee11(j,_e,_t,St){var Tt,Ut,_r,_n;return api_regeneratorRuntime().wrap((function _callee11$(_i){for(;;)switch(_i.prev=_i.next){case 0:return Tt=St.publishVideo,Ut=St.publishAudio,_r=St.videoSourceType,_n=St.audioSourceType,_i.next=3,this.fetch({path:"/v1/rooms/".concat(j,"/users/").concat(_e,"/streams/").concat(_t),method:"PUT",data:{videoState:Tt,audioState:Ut,videoSourceType:_r,audioSourceType:_n}});case 3:return _i.abrupt("return",_i.sent);case 4:case"end":return _i.stop()}}),_callee11,this)}))),function upsertStream(j,_e,_t,St){return _r.apply(this,arguments)})},{key:"deleteStream",value:(Ut=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee12(j,_e,_t){return api_regeneratorRuntime().wrap((function _callee12$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,this.fetch({path:"/v1/rooms/".concat(j,"/users/").concat(_e,"/streams/").concat(_t),method:"DELETE"});case 2:return St.abrupt("return",St.sent);case 3:case"end":return St.stop()}}),_callee12,this)}))),function deleteStream(j,_e,_t){return Ut.apply(this,arguments)})},{key:"updateDeviceState",value:(Tt=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee13(j,_e,_t,St){var Tt,Ut;return api_regeneratorRuntime().wrap((function _callee13$(_r){for(;;)switch(_r.prev=_r.next){case 0:return Tt=St.videoSourceState,Ut=St.audioSourceState,_r.next=3,this.fetch({path:"/v1/rooms/".concat(j,"/users/").concat(_e,"/streams/").concat(_t),method:"PATCH",data:{videoSourceState:Tt,audioSourceState:Ut}});case 3:return _r.abrupt("return",_r.sent);case 4:case"end":return _r.stop()}}),_callee13,this)}))),function updateDeviceState(j,_e,_t,St){return Tt.apply(this,arguments)})},{key:"sendRoomChatMessage",value:(St=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee14(j,_e){var _t;return api_regeneratorRuntime().wrap((function _callee14$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,this.fetch({path:"/v1/rooms/".concat(_e,"/chat/channel"),method:"POST",data:{message:j,type:1}});case 2:return _t=St.sent,St.abrupt("return",_t.data);case 4:case"end":return St.stop()}}),_callee14,this)}))),function sendRoomChatMessage(j,_e){return St.apply(this,arguments)})},{key:"publishStreamToCdn",value:(_t=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee15(j,_e,_t,St){return api_regeneratorRuntime().wrap((function _callee15$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,this.fetch({path:"/v1/rooms/".concat(j,"/users/").concat(_e,"/streams/").concat(_t),method:"PUT",data:St});case 2:return Tt.abrupt("return",Tt.sent);case 3:case"end":return Tt.stop()}}),_callee15,this)}))),function publishStreamToCdn(j,_e,St,Tt){return _t.apply(this,arguments)})},{key:"updateOnlineState",value:(_e=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee16(j){var _e,_t;return api_regeneratorRuntime().wrap((function _callee16$(St){for(;;)switch(St.prev=St.next){case 0:return _e=j.userUuid,_t=j.roomUuid,St.next=3,this.fetch({path:"/v1/rooms/".concat(_t,"/users/").concat(_e,"/states/1"),method:"PUT"});case 3:return St.abrupt("return",St.sent);case 4:case"end":return St.stop()}}),_callee16,this)}))),function updateOnlineState(j){return _e.apply(this,arguments)})}]),AgoraRteService}(JT))||qR;__webpack_require__(5212);function state_sync_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */state_sync_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}var YR,JR=kS.attach({proxyMethods:!1})((WR=function(){function AGOnlineStateSynchronizer(j,_e){_classCallCheck(this,AGOnlineStateSynchronizer),this.logger=void 0,this._task=void 0,this._api=void 0,this._sceneId=void 0,this._delay=0,this._connState=IE.Idle,this._isOnline=!1,this._api=j,this._sceneId=_e}var j;return _createClass(AGOnlineStateSynchronizer,[{key:"setSyncDelay",value:function setSyncDelay(j){this._delay=j}},{key:"addMessageEventListeners",value:function addMessageEventListeners(j){var _e=this,_t=$E.shared.userId;j.on(RT.SnapshotUpdated,(function(j){j.users.has(_t)?_e._isOnline=!0:_e._isOnline=!1,_e._isOnline||_e.start()})),j.on(RT.UserAdded,(function(j){var St=j.some((function(j){return j.userUuid===_t}));_e._isOnline=St,_e._isOnline||_e.start()})),j.on(RT.UserRemoved,(function(j){var St=j.some((function(j){return j.userUuid===_t}));_e._isOnline=!St,_e._isOnline||_e.start()}))}},{key:"addConnectionStateListeners",value:function addConnectionStateListeners(j){var _e=this;j.on(RT.RteConnectionStateChanged,(function(j){_e._connState=j}))}},{key:"start",value:function start(){this._task||(this.logger.info("state syncing will occur in ".concat(this._delay,"ms")),this._task=fR.addDelayTask(this._notifyServerStateOnline,this._delay))}},{key:"stop",value:function stop(){var j;null===(j=this._task)||void 0===j||j.stop(),this._task=void 0}},{key:"isStateNotInSync",get:function get(){return!this._isOnline&&this._connState===IE.Connected}},{key:"_notifyServerStateOnline",value:(j=_asyncToGenerator(state_sync_regeneratorRuntime().mark((function _callee(){var j;return state_sync_regeneratorRuntime().wrap((function _callee$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(!this.isStateNotInSync){_e.next=10;break}return j=$E.shared.userId,_e.prev=2,_e.next=5,this._api.updateOnlineState({userUuid:j,roomUuid:this._sceneId});case 5:_e.next=10;break;case 7:_e.prev=7,_e.t0=_e.catch(2),this.logger.error("failed to sync online state with server",_e.t0);case 10:this._task=void 0;case 11:case"end":return _e.stop()}}),_callee,this,[[2,7]])}))),function _notifyServerStateOnline(){return j.apply(this,arguments)})}]),AGOnlineStateSynchronizer}(),_applyDecoratedDescriptor(WR.prototype,"_notifyServerStateOnline",[xS],Object.getOwnPropertyDescriptor(WR.prototype,"_notifyServerStateOnline"),WR.prototype),QR=WR))||QR;function scene_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */scene_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function scene_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function scene_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?scene_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):scene_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}function scene_createSuper(j){var _e=function scene_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var XR,ZR=kS.attach({proxyMethods:!1})(YR=function(j){_inherits(AgoraRteScene,j);var _e,_t,St,Tt,Ut=scene_createSuper(AgoraRteScene);function AgoraRteScene(j,_e){var _t;_classCallCheck(this,AgoraRteScene),(_t=Ut.call(this)).logger=void 0,_t.sceneId=void 0,_t._localUser=void 0,_t._sceneState=IE.Idle,_t._initialSync=!1,_t._apiService=void 0,_t._engine=void 0,_t.dataStore=void 0,_t._rtmManager=void 0,_t._rtcManager=void 0,_t._rtmChannel=void 0,_t._rtcChannel=void 0,_t._stateSynchronizer=void 0,_t._rtmChannelObserver=void 0,_t._synchronizer=void 0,_t._timestampGap=0,_t.createTs=void 0,_t.sceneId=j,_t._engine=_e.engine,_t._rtmManager=_e.rtm,_t._rtcManager=_e.rtc,_t._rtmChannel=_e.rtmChannel,_t._rtmChannelObserver=_e.rtmChannelObserver,_t._rtcChannel=_e.rtcChannel,_t._apiService=new zR,_t._stateSynchronizer=new JR(_t._apiService,j),_t._apiService.pathPrefix=_e.engine.apiServicePathPrefix,_t.dataStore=new FR;var St=_t._rtcChannel,Tt=_t._rtmManager;return St.onNetworkStats((function(j){_t.emit(RT.NetworkStats,j)})),St.onAudioVolumeIndication((function(j){_t.emit(RT.AudioVolumes,j)})),St.onConnectionStageChanged((function(j,_e){_t.emit(RT.RtcConnectionStateChanged,j,_e)})),Tt.on(RT.RtmConnectionStateChanged,_t._handleRtmStateChange=_t._handleRtmStateChange.bind(_assertThisInitialized(_t))),_t}return _createClass(AgoraRteScene,[{key:"getApiService",value:function getApiService(){return this._apiService}},{key:"localUser",get:function get(){return this._localUser}},{key:"engine",get:function get(){return this._engine}},{key:"rtcSid",get:function get(){return this._rtcChannel.getRtcSid()}},{key:"rtmSid",get:function get(){return this._rtmManager.sessionId}},{key:"rtcChannel",get:function get(){return this._rtcChannel}},{key:"timestampServerLocalGap",get:function get(){return this._timestampGap}},{key:"enableDualStream",value:function enableDualStream(j,_e){return this._rtcChannel.enableDualStream(j,_e)}},{key:"setLowStreamParameter",value:function setLowStreamParameter(j,_e){return this._rtcChannel.setLowStreamParameter(j,_e)}},{key:"setRemoteVideoStreamType",value:function setRemoteVideoStreamType(j,_e){return this._rtcChannel.setRemoteVideoStreamType(j,_e)}},{key:"joinScene",value:(Tt=_asyncToGenerator(scene_regeneratorRuntime().mark((function _callee(j){var _e,_t,St,Tt,Ut,_r,_n,_i,Ei,Ci,Di,Fi,_o,ga,_a,_s;return scene_regeneratorRuntime().wrap((function _callee$(_c){for(;;)switch(_c.prev=_c.next){case 0:if(this._sceneState===IE.Idle){_c.next=3;break}return this.logger.warn("scene not idle"),_c.abrupt("return");case 3:return _c.prev=3,this._setRteConnectionState(IE.Connecting),_e=this._engine.getAgoraMediaControl(),_c.next=8,this.getApiService().entryRoom({userUuid:$E.shared.userId,roomUuid:this.sceneId,userName:j.userName,streamUuid:j.streamId,role:j.userRole,stream:{videoSourceState:_e.createCameraVideoTrack().state,audioSourceState:_e.createMicrophoneAudioTrack().state}});case 8:return _t=_c.sent,St=_t.user,Tt=_t.room,Ut=_t.sysConfig,1===St.subscribe&&this._stateSynchronizer.setSyncDelay(Ut.onlineStateEnsureDelay||5e3),this._stateSynchronizer.addConnectionStateListeners(this),this.createTs=Tt.roomState.createTime,this._apiService.headers=scene_objectSpread(scene_objectSpread({},$E.shared.service.headers),{},{token:St.userToken}),_c.next=18,this._rtmManager.join(this._rtmChannel,this._rtmChannelObserver,this.sceneId);case 18:return _r=St.streamUuid,_n=St.userName,_i=St.userUuid,Ei=St.role,Ci=St.rtcToken,Di=St.streams,Fi=void 0===Di?[]:Di,_o=St.userProperties,ga=Fi.map((function(j){return DT.fromData({streamUuid:j.streamUuid,streamName:j.streamName,fromUser:{userName:_n,userUuid:_i,role:Ei},videoSourceState:j.videoSourceState,audioSourceState:j.audioSourceState,videoSourceType:j.videoSourceType,audioSourceType:j.audioSourceType,videoState:j.videoState,audioState:j.audioState,playUrl:j.playUrl,flvPlayUrl:j.flvPlayUrl,rtmpPlayUrl:j.rtmpPlayUrl})})),this.dataStore.setStreams(ga),this._localUser=new UR(this,{userUuid:$E.shared.userId,userName:_n,userRole:Ei,streamUuid:_r,sceneId:this.sceneId,rtcToken:Ci,rtc:this._rtcManager,userProperties:_o}),2===Fi.length&&(_a=Fi.find((function(j){return j.streamUuid!==_r})),this._localUser.subStream=_a),this._synchronizer=new VT(this.dataStore,{scene:this,userUuid:$E.shared.userId,streamUuid:_r,channelObserver:this._rtmChannelObserver,rtm:this._rtmManager}),this._addEventListeners(this._synchronizer.handle),this._stateSynchronizer.addMessageEventListeners(this._synchronizer.handle),_c.next=28,this.getApiService().syncSnapShot(this.sceneId);case 28:_s=_c.sent,this._synchronizer.syncSnapshot(kT.fromData(_s)),_c.next=36;break;case 32:return _c.prev=32,_c.t0=_c.catch(3),this._cleanup(),_c.abrupt("return",ZE.shared.handleThrowableError(QE.RTE_ERR_JOIN_SCENE_FAILED,_c.t0));case 36:case"end":return _c.stop()}}),_callee,this,[[3,32]])}))),function joinScene(j){return Tt.apply(this,arguments)})},{key:"leaveScene",value:(St=_asyncToGenerator(scene_regeneratorRuntime().mark((function _callee2(){var j,_e,_t;return scene_regeneratorRuntime().wrap((function _callee2$(St){for(;;)switch(St.prev=St.next){case 0:return this._stateSynchronizer.stop(),St.next=3,GR(this._rtmManager.leave(this.sceneId));case 3:j=St.sent,_e=_slicedToArray(j,1),(_t=_e[0])&&ZE.shared.handleNonThrowableError(QE.RTE_ERR_LEAVE_SCENE_FAIL,_t),this._rtmManager.off(RT.RtmConnectionStateChanged,this._handleRtmStateChange),this._cleanup();case 9:case"end":return St.stop()}}),_callee2,this)}))),function leaveScene(){return St.apply(this,arguments)})},{key:"joinRTC",value:(_t=_asyncToGenerator(scene_regeneratorRuntime().mark((function _callee3(j){var _e;return scene_regeneratorRuntime().wrap((function _callee3$(_t){for(;;)switch(_t.prev=_t.next){case 0:if(this._initialSync&&this.localUser){_t.next=2;break}return _t.abrupt("return",ZE.shared.handleThrowableError(QE.RTE_ERR_SCENE_NOT_READY,new Error("try to join rtc before scene is ready ".concat(!!this._initialSync," ").concat(!!this.localUser))));case 2:if(!j){_t.next=8;break}return _t.next=5,this._rtcChannel.join(j.token,j.streamUuid,j.connectionType);case 5:case 10:return _t.abrupt("return",_t.sent);case 8:return _t.next=10,this._rtcChannel.join(this.localUser.rtcToken,null===(_e=this.localUser)||void 0===_e?void 0:_e.streamUuid);case 11:case"end":return _t.stop()}}),_callee3,this)}))),function joinRTC(j){return _t.apply(this,arguments)})},{key:"leaveRTC",value:(_e=_asyncToGenerator(scene_regeneratorRuntime().mark((function _callee4(j){var _e,_t,St;return scene_regeneratorRuntime().wrap((function _callee4$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,GR(this._rtcChannel.leave(j));case 2:_e=Tt.sent,_t=_slicedToArray(_e,1),(St=_t[0])&&ZE.shared.handleNonThrowableError(QE.RTC_ERR_LEAVE_CHANNEL_FAIL,St);case 6:case"end":return Tt.stop()}}),_callee4,this)}))),function leaveRTC(j){return _e.apply(this,arguments)})},{key:"muteRemoteAudioStream",value:function muteRemoteAudioStream(j,_e){return this._rtcChannel.muteRemoteAudioStream(j,_e)}},{key:"muteRemoteVideoStream",value:function muteRemoteVideoStream(j,_e){return this._rtcChannel.muteRemoteVideoStream(j,_e)}},{key:"muteRemoteVideoStreamMass",value:function muteRemoteVideoStreamMass(j,_e){return this._rtcChannel.muteRemoteVideoStreamMass(j,_e)}},{key:"_cleanup",value:function _cleanup(){var j;null===(j=this._localUser)||void 0===j||j.destroy(),this._localUser=void 0,this._synchronizer=void 0,this._initialSync=!1}},{key:"_setRteConnectionState",value:function _setRteConnectionState(j,_e){var _t=this._sceneState;this._sceneState=j,this._sceneState!==_t&&this.emit(RT.RteConnectionStateChanged,j,_e)}},{key:"_setInitialSnapshotSync",value:function _setInitialSnapshotSync(j){this._initialSync=j,this._recalculateRteState()}},{key:"_recalculateRteState",value:function _recalculateRteState(j){var _e=this._rtmManager.connectionState,_t=this._initialSync;return _e===XT.DISCONNECTED?this._setRteConnectionState(IE.Idle):_e===XT.CONNECTING?this._setRteConnectionState(IE.Connecting):_e===XT.CONNECTED?_t?this._setRteConnectionState(IE.Connected):this._setRteConnectionState(IE.Connecting):_e===XT.RECONNECTING?_t?this._setRteConnectionState(IE.Reconnecting):this._setRteConnectionState(IE.Connecting):_e===XT.ABORTED?this._setRteConnectionState(IE.Error,j):void this.logger.warn("unhandled rte connection state: rtm: ".concat(_e,", snapshot: ").concat(_t))}},{key:"_handleUserAdded",value:function _handleUserAdded(j){var _e=this,_t=[],St=[];j.forEach((function(j){var Tt;if(_e.logger.info("check streams with user",j),(null===(Tt=_e.localUser)||void 0===Tt?void 0:Tt.userUuid)===j.userUuid){var Ut=_e.dataStore.findUserStreams(j.userUuid);Ut.length?(_e.logger.info("local streams come with user",Ut),_t=_t.concat(Ut)):_e.logger.info("no local streams come with user",Ut)}else{var _r=_e.dataStore.findUserStreams(j.userUuid);_r.length?(_e.logger.info("remote streams come with user",_r),St=St.concat(_r)):_e.logger.info("no remote streams come with user",_r)}})),this.emit(RT.LocalStreamAdded,_t),this.emit(RT.RemoteStreamAdded,St),this.emit(RT.UserAdded,j)}},{key:"_handleUserRemoved",value:function _handleUserRemoved(j,_e){var _t=this,St=[],Tt=[];j.forEach((function(j){var _e;if((null===(_e=_t.localUser)||void 0===_e?void 0:_e.userUuid)===j.userUuid){var Ut=_t.dataStore.findUserStreams(j.userUuid);Ut.length&&(St=St.concat(Ut))}else{var _r=_t.dataStore.findUserStreams(j.userUuid);_r.length&&(Tt=Tt.concat(_r))}})),this._handleLocalStreamRemoved(St),this._handleRemoteStreamsRemoved(Tt),this.emit(RT.UserRemoved,j,_e)}},{key:"_handleLocalStreamRemoved",value:function _handleLocalStreamRemoved(j,_e){0!==j.length&&this.emit(RT.LocalStreamRemove,j,_e)}},{key:"_handleRemoteStreamsRemoved",value:function _handleRemoteStreamsRemoved(j,_e){0!==j.length&&this.emit(RT.RemoteStreamRemove,j,_e)}},{key:"_addEventListeners",value:function _addEventListeners(j){var _e=this;j.on(RT.SnapshotUpdated,(function(j){if(_e.logger.info("sceneId:".concat(_e.sceneId," snapshot updated")),_e._setInitialSnapshotSync(!0),!_e.localUser)return ZE.shared.handleThrowableError(QE.RTE_ERR_LOCAL_USER_NOT_EXIST,new Error("local user not exist"));var _t=_e.localUser.toData();_e.dataStore.setUser(_e.localUser.userUuid,OT.fromData(_t));var St=Array.from(_e.dataStore.users.values()).filter((function(j){return j.userUuid!==_e.localUser.userUuid}));St.push(_t),St.length>0&&_e._handleUserAdded(St),_e._handleRoomPropertyChange(Array.from(_e.dataStore.roomProperties.keys()),_e.dataStore.roomProperties,{},{}),void 0!==j.roomState.total&&_e.emit(RT.UserCountUpdated,j.roomState.total)})),j.on(RT.ChatReceived,(function(j){_e.emit(RT.ChatReceived,j)})),j.on(RT.UserCountUpdated,(function(j){_e.emit(RT.UserCountUpdated,j)})),j.on(RT.UserAdded,(function(j){_e.logger.info("sceneId:".concat(_e.sceneId," user-added [").concat(j.join(","),"]")),_e._handleUserAdded(j)})),j.on(RT.UserUpdated,(function(j){_e.logger.info("sceneId:".concat(_e.sceneId," user-updated ").concat(j))})),j.on(RT.UserRemoved,(function(j,_t){_e.logger.info("sceneId:".concat(_e.sceneId," user-removed [").concat(j.join(","),"]")),_e._handleUserRemoved(j,_t)})),j.on(RT.RoomPropertyUpdated,(function(j,_t,St,Tt){_e.logger.info("sceneId:".concat(_e.sceneId," room-property-updated ").concat(vS(_t)," ").concat(vS(St)," ").concat(vS(Tt))),_e._handleRoomPropertyChange(j,_t,St,Tt)})),j.on(RT.UserPropertyUpdated,(function(j,_t,St,Tt){_e.logger.info("sceneId:".concat(_e.sceneId," user-property-updated ").concat(j," ").concat(vS(_t)," ").concat(vS(St)," ").concat(vS(Tt))),_e.emit(RT.UserPropertyUpdated,j,_t,St,Tt)})),j.on(RT.UserPropertyListUpdated,(function(j,_t,St,Tt){_e.logger.info("user-property-list-updated ".concat(vS(j)," ").concat(vS(_t)," ").concat(vS(St)," ").concat(vS(Tt))),_e.emit(RT.UserPropertyListUpdated,j,_t,St,Tt)})),j.on(RT.LocalStreamAdded,(function(j,_t){_e.logger.info("sceneId:".concat(_e.sceneId," local-stream-added [").concat(j.join(","),"]")),0!==j.length&&_e.emit(RT.LocalStreamAdded,j,_t)})),j.on(RT.LocalStreamUpdate,(function(j,_t){_e.logger.info("sceneId:".concat(_e.sceneId," local-stream-upsert [").concat(j.join(","),"]")),0!==j.length&&_e.emit(RT.LocalStreamUpdate,j,_t)})),j.on(RT.LocalStreamRemove,(function(j,_t){_e.logger.info("sceneId:".concat(_e.sceneId," local-stream-removed [").concat(j.join(","),"]")),0!==j.length&&_e.emit(RT.LocalStreamRemove,j,_t)})),j.on(RT.RemoteStreamAdded,(function(j,_t){_e.logger.info("sceneId:".concat(_e.sceneId," remote-stream-added [").concat(j.join(","),"]")),0!==j.length&&_e.emit(RT.RemoteStreamAdded,j,_t)})),j.on(RT.RemoteStreamUpdate,(function(j,_t){_e.logger.info("sceneId:".concat(_e.sceneId," remote-stream-upsert [").concat(j.join(","),"]")),0!==j.length&&_e.emit(RT.RemoteStreamUpdate,j,_t)})),j.on(RT.RemoteStreamRemove,(function(j,_t){_e.logger.info("sceneId:".concat(_e.sceneId," remote-stream-removed [").concat(j.join(","),"]")),0!==j.length&&_e.emit(RT.RemoteStreamRemove,j,_t)})),j.on(RT.ChatUserMessage,(function(j){_e.emit(RT.ChatUserMessage,j)})),j.on(RT.TimeStampGapUpdate,(function(j){_e._timestampGap=j,_e.emit(RT.TimeStampGapUpdate,j)}))}},{key:"_handleRoomPropertyChange",value:function _handleRoomPropertyChange(j,_e,_t,St){this.emit(RT.RoomPropertyUpdated,j,_e.toObject(),_t,St)}},{key:"_handleRtmStateChange",value:function _handleRtmStateChange(j){this._recalculateRteState(j.reason)}}]),AgoraRteScene}(qT.EventEmitter))||YR;!function(j){j[j.record=2]="record",j[j.beforeMixed=8]="beforeMixed"}(XR||(XR={}));var $R,eO=function(){function AgoraRteStreamPlayer(j){_classCallCheck(this,AgoraRteStreamPlayer),this._rtc=void 0,this._rtc=j}return _createClass(AgoraRteStreamPlayer,[{key:"setAudioRawDataConfig",value:function setAudioRawDataConfig(j){this._rtc.setAudioRawDataConfig(j,XR.beforeMixed)}},{key:"addAudioRawDataObserver",value:function addAudioRawDataObserver(j){this._rtc.addAudioRawDataObserver(j,XR.beforeMixed)}},{key:"removeAudioRawDataObserver",value:function removeAudioRawDataObserver(j){this._rtc.removeAudioRawDataObserver(j,XR.beforeMixed)}}]),AgoraRteStreamPlayer}();function control_createSuper(j){var _e=function control_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j.cameraListChanged="camera-list-changed",j.localAudioVolume="local-audio-volume",j.localAudioRecordingListChanged="local-audio-recording-list-changed",j.localVideoTrackChanged="local-video-track-changed",j.localAudioTrackChanged="local-audio-track-changed",j.trackStateChanged="track-state-changed",j.playbackDeviceListChanged="playback-device-list-changed",j.recordingDeviceListChanged="recording-device-list-changed",j.localAudioPlaybackVolumeIndicator="start-test-audio-playback-volume-indicator",j.audioPlaybackStateChanged="audio-playback-state-changed",j.localTrackBeforeDestroy="local-track-before-destroy",j.videoAutoPlayFailed="video-auto-play-failed"}($R||($R={}));var tO=function(j){_inherits(AgoraMediaControl,j);var _e=control_createSuper(AgoraMediaControl);function AgoraMediaControl(j){var _t;return _classCallCheck(this,AgoraMediaControl),(_t=_e.call(this))._camera=void 0,_t._microphone=void 0,_t._screen=void 0,_t._player=void 0,_t._rtc=void 0,_t._rtc=j,_t._addEventListener(j),_t}return _createClass(AgoraMediaControl,[{key:"camera",get:function get(){return this._camera}},{key:"microphone",get:function get(){return this._microphone}},{key:"screen",get:function get(){return this._screen}},{key:"player",get:function get(){return this._player}},{key:"_addEventListener",value:function _addEventListener(j){var _e=this;j.onAutoPlayFailed((function(){_e.emit($R.videoAutoPlayFailed)})),j.getVideoDeviceManager().onLocalCameraListChanged((function(){for(var j=arguments.length,_t=new Array(j),St=0;St<j;St++)_t[St]=arguments[St];_e.emit.apply(_e,[$R.cameraListChanged].concat(_t))})),j.getAudioDeviceManager().onLocalRecordingDeviceListChanged((function(){for(var j=arguments.length,_t=new Array(j),St=0;St<j;St++)_t[St]=arguments[St];_e.emit.apply(_e,[$R.recordingDeviceListChanged].concat(_t))})),j.getAudioDeviceManager().onLocalPlaybackDeviceListChanged((function(){for(var j=arguments.length,_t=new Array(j),St=0;St<j;St++)_t[St]=arguments[St];_e.emit.apply(_e,[$R.playbackDeviceListChanged].concat(_t))})),j.getVideoDeviceManager().onLocalVideoTrackStateChanged((function(){for(var j=arguments.length,_t=new Array(j),St=0;St<j;St++)_t[St]=arguments[St];_e.emit.apply(_e,[$R.localVideoTrackChanged].concat(_t))})),j.getAudioDeviceManager().onLocalAudioTrackStateChanged((function(){for(var j=arguments.length,_t=new Array(j),St=0;St<j;St++)_t[St]=arguments[St];_e.emit.apply(_e,[$R.localAudioTrackChanged].concat(_t))})),j.getAudioDeviceManager().onLocalAudioVolume((function(j){_e.emit($R.localAudioVolume,j)})),j.getAudioDeviceManager().onLocalAudioPlaybackTestVolumeChanged((function(j){_e.emit($R.localAudioPlaybackVolumeIndicator,j)})),j.onLocalScreenShareTrackStateChanged((function(){for(var j=arguments.length,_t=new Array(j),St=0;St<j;St++)_t[St]=arguments[St];_e.emit.apply(_e,[$R.localVideoTrackChanged].concat(_t)),_e.emit.apply(_e,[$R.localAudioTrackChanged].concat(_t))}))}},{key:"createCameraVideoTrack",value:function createCameraVideoTrack(){return this._camera||(this._camera=new wR(this._rtc)),this._camera}},{key:"createMicrophoneAudioTrack",value:function createMicrophoneAudioTrack(){return this._microphone||(this._microphone=new SR(this._rtc)),this._microphone}},{key:"createScreenShareTrack",value:function createScreenShareTrack(){return this._screen||(this._screen=new IR(this._rtc)),this._screen}},{key:"createStreamPlayer",value:function createStreamPlayer(){return this._player||(this._player=new eO(this._rtc)),this._player}},{key:"getVideoCameraList",value:function getVideoCameraList(){return this._rtc.getVideoDeviceManager().getVideoCameraDevices()}},{key:"getAudioRecordingList",value:function getAudioRecordingList(){return this._rtc.getAudioDeviceManager().getAudioRecordingDevices()}},{key:"getAudioPlaybackList",value:function getAudioPlaybackList(){return this._rtc.getAudioDeviceManager().getAudioPlaybackDevices()}},{key:"isScreenDeviceEnumerateSupported",value:function isScreenDeviceEnumerateSupported(){return this._rtc.isScreenDeviceEnumerateSupported()}},{key:"hasScreenSharePermission",value:function hasScreenSharePermission(){return this._rtc.hasScreenSharePermission()}},{key:"getWindowDevices",value:function getWindowDevices(){return this._rtc.getWindowDevices()}},{key:"getDisplayDevices",value:function getDisplayDevices(){return this._rtc.getDisplayDevices()}},{key:"startAudioRecordingDeviceTest",value:function startAudioRecordingDeviceTest(j){return this._rtc.startAudioRecordingDeviceTest(j)}},{key:"stopAudioRecordingDeviceTest",value:function stopAudioRecordingDeviceTest(){return this._rtc.stopAudioRecordingDeviceTest()}},{key:"startAudioPlaybackDeviceTest",value:function startAudioPlaybackDeviceTest(j){return this._rtc.startAudioPlaybackDeviceTest(j)}},{key:"stopAudioPlaybackDeviceTest",value:function stopAudioPlaybackDeviceTest(){return this._rtc.stopAudioPlaybackDeviceTest()}},{key:"setBeautyEffectOptions",value:function setBeautyEffectOptions(j,_e){return this._rtc.setBeautyEffectOptions(j,_e)}},{key:"createStreamMediaTrack",value:function createStreamMediaTrack(){return new ER(this._rtc)}},{key:"takeSnapshot",value:function takeSnapshot(j,_e,_t){return this._rtc.takeSnapshot(j,_e,_t)}},{key:"getCurrentFrameData",value:function getCurrentFrameData(j,_e,_t){return this._rtc.getCurrentFrameData(j,_e,_t)}}]),AgoraMediaControl}(_a);__webpack_require__(1058);function base_createSuper(j){var _e=function base_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var rO=function(j){_inherits(RtcVideoDeviceManagerBase,j);var _e=base_createSuper(RtcVideoDeviceManagerBase);function RtcVideoDeviceManagerBase(){return _classCallCheck(this,RtcVideoDeviceManagerBase),_e.apply(this,arguments)}return _createClass(RtcVideoDeviceManagerBase)}(_a),nO=function(j){_inherits(RtcAudioDeviceManagerBase,j);var _e=base_createSuper(RtcAudioDeviceManagerBase);function RtcAudioDeviceManagerBase(){return _classCallCheck(this,RtcAudioDeviceManagerBase),_e.apply(this,arguments)}return _createClass(RtcAudioDeviceManagerBase)}(_a),iO=function(j){_inherits(RtcChannelAdapterBase,j);var _e=base_createSuper(RtcChannelAdapterBase);function RtcChannelAdapterBase(){return _classCallCheck(this,RtcChannelAdapterBase),_e.apply(this,arguments)}return _createClass(RtcChannelAdapterBase)}(_a),bO=function(j){_inherits(RtcAdapterBase,j);var _e=base_createSuper(RtcAdapterBase);function RtcAdapterBase(){return _classCallCheck(this,RtcAdapterBase),_e.apply(this,arguments)}return _createClass(RtcAdapterBase,null,[{key:"getRtcVersion",value:function getRtcVersion(){return""}}]),RtcAdapterBase}(_a);function device_createSuper(j){var _e=function device_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var wO,OO=function(j){_inherits(RtcVideoDeviceManagerElectron,j);var _e=device_createSuper(RtcVideoDeviceManagerElectron);function RtcVideoDeviceManagerElectron(j){var _t;return _classCallCheck(this,RtcVideoDeviceManagerElectron),(_t=_e.call(this)).adapter=j,_t._deviceInfo=new Map,_t._deviceIds=new Set,_t._initializeDeviceList(),_t}return _createClass(RtcVideoDeviceManagerElectron,[{key:"onLocalVideoTrackStateChanged",value:function onLocalVideoTrackStateChanged(j){return this.adapter.onLocalVideoTrackStateChanged(j),0}},{key:"onLocalCameraListChanged",value:function onLocalCameraListChanged(j){return this.on($R.cameraListChanged,j),0}},{key:"getVideoCameraDevices",value:function getVideoCameraDevices(){return this.cameraList}},{key:"cameraList",get:function get(){var j=this,_e=[];return this._deviceIds.forEach((function(_t){var St=j._deviceInfo.get(_t);St&&_e.push({deviceid:St.deviceid,devicename:St.devicename})})),_e}},{key:"_emitCameraListChanged",value:function _emitCameraListChanged(j,_e,_t){this.emit($R.cameraListChanged,j,_e,_t)}},{key:"_initializeDeviceList",value:function _initializeDeviceList(){var j=this;this.fetchDeviceList(),this.adapter.rtcEngine.on("videoDeviceStateChanged",(function(){j.fetchDeviceList()}))}},{key:"fetchDeviceList",value:function fetchDeviceList(){var j=this,_e=this.adapter.rtcEngine.getVideoDevices(),_t=[];this._deviceIds.clear(),this._deviceInfo.clear(),_e.forEach((function(_e){j._deviceInfo.set(_e.deviceid,_e),j._deviceIds.add(_e.deviceid),_t.push(_e)})),this._emitCameraListChanged(!0,_t,this.cameraList)}}]),RtcVideoDeviceManagerElectron}(rO),DO=function(j){_inherits(RtcAudioDeviceManagerElectron,j);var _e=device_createSuper(RtcAudioDeviceManagerElectron);function RtcAudioDeviceManagerElectron(j){var _t;return _classCallCheck(this,RtcAudioDeviceManagerElectron),(_t=_e.call(this)).adapter=j,_t._recordingDeviceInfo=new Map,_t._recordingDeviceIds=new Set,_t._playbackDeviceInfo=new Map,_t._playbackDeviceIds=new Set,_t._initializeDeviceList(),_t}return _createClass(RtcAudioDeviceManagerElectron,[{key:"_initializeDeviceList",value:function _initializeDeviceList(){var j=this;this._fetchRecordingDeviceList(),this._fetchPlaybackDeviceList(),this.adapter.rtcEngine.on("audioDeviceStateChanged",(function(){j._fetchRecordingDeviceList(),j._fetchPlaybackDeviceList()}))}},{key:"onLocalAudioPlaybackTestVolumeChanged",value:function onLocalAudioPlaybackTestVolumeChanged(j){return this.adapter.onLocalAudioPlaybackTestVolumeChanged(j)}},{key:"onLocalAudioTrackStateChanged",value:function onLocalAudioTrackStateChanged(j){return this.adapter.onLocalAudioTrackStateChanged(j)}},{key:"onLocalAudioVolume",value:function onLocalAudioVolume(j){return this.adapter.onLocalAudioVolume(j)}},{key:"onLocalRecordingDeviceListChanged",value:function onLocalRecordingDeviceListChanged(j){return this.on($R.recordingDeviceListChanged,j),0}},{key:"onLocalPlaybackDeviceListChanged",value:function onLocalPlaybackDeviceListChanged(j){return this.on($R.playbackDeviceListChanged,j),0}},{key:"getAudioPlaybackDevices",value:function getAudioPlaybackDevices(){return this.speakerList}},{key:"getAudioRecordingDevices",value:function getAudioRecordingDevices(){return this.microphoneList}},{key:"microphoneList",get:function get(){var j=this,_e=[];return this._recordingDeviceIds.forEach((function(_t){var St=j._recordingDeviceInfo.get(_t);St&&_e.push({deviceid:St.deviceid,devicename:St.devicename})})),_e}},{key:"speakerList",get:function get(){var j=this,_e=[];return this._playbackDeviceIds.forEach((function(_t){var St=j._playbackDeviceInfo.get(_t);St&&_e.push({deviceid:St.deviceid,devicename:St.devicename})})),_e}},{key:"_emitPlaybackListChanged",value:function _emitPlaybackListChanged(j,_e,_t){this.emit($R.playbackDeviceListChanged,j,_e,_t)}},{key:"_emitRecordingListChanged",value:function _emitRecordingListChanged(j,_e,_t){this.emit($R.recordingDeviceListChanged,j,_e,_t)}},{key:"_fetchPlaybackDeviceList",value:function _fetchPlaybackDeviceList(){var j=this,_e=this.adapter.rtcEngine.getAudioPlaybackDevices(),_t=[];this._playbackDeviceInfo.clear(),this._playbackDeviceIds.clear(),_e.forEach((function(_e){j._playbackDeviceInfo.set(_e.deviceid,_e),j._playbackDeviceIds.add(_e.deviceid),_t.push(_e)})),this._emitPlaybackListChanged(!0,_t,this.speakerList)}},{key:"_fetchRecordingDeviceList",value:function _fetchRecordingDeviceList(){var j=this,_e=this.adapter.rtcEngine.getAudioRecordingDevices(),_t=[];this._recordingDeviceInfo.clear(),this._recordingDeviceIds.clear(),_e.forEach((function(_e){j._recordingDeviceInfo.set(_e.deviceid,_e),j._recordingDeviceIds.add(_e.deviceid),_t.push(_e)})),this._emitRecordingListChanged(!0,_t,this.microphoneList)}}]),RtcAudioDeviceManagerElectron}(nO),LO=function(){function QualityCalc(){_classCallCheck(this,QualityCalc),this.quality=TR.good,this.qualities=[]}return _createClass(QualityCalc,[{key:"_updateQualities",value:function _updateQualities(j){this.qualities.push(j),this.qualities.length>QualityCalc.MAX_QUALITY_NUMBER&&this.qualities.shift()}},{key:"_resetQualities",value:function _resetQualities(){this.qualities=[]}},{key:"toAGQuality",value:function toAGQuality(j){return void 0===j?this.quality:0===j||8===j||7===j?(this._resetQualities(),this.quality):6===j?(this._resetQualities(),this.quality=TR.down,this.quality):(this._updateQualities(j),this.qualities.length<QualityCalc.MAX_QUALITY_NUMBER||(this.qualities.reduce((function(j,_e){return j+_e}))>=QualityCalc.QUALITY_THRESHOLD?this.quality=TR.bad:this.quality=TR.good),this.quality)}}]),QualityCalc}();LO.MAX_QUALITY_NUMBER=3,LO.QUALITY_THRESHOLD=10;var NO=kS.attach({proxyMethods:!1})(wO=function(){function RtcNetworkQualityElectron(){_classCallCheck(this,RtcNetworkQualityElectron),this.logger=void 0,this.rtt=void 0,this.downlinkNetworkQuality=0,this.uplinkNetworkQuality=0,this.end2EndDelay=0,this.txVideoPacketLoss=0,this.rxVideoPacketLoss=0,this.cpu=-1,this.cpuTotal=-1,this._downlinkNetworkQualityClacInstance=new LO,this._uplinkNetworkQualityClacInstance=new LO}return _createClass(RtcNetworkQualityElectron,[{key:"networkStats",value:function networkStats(){var networkStats={packetLoss:Math.max(this.txVideoPacketLoss,this.rxVideoPacketLoss),cpu:this.cpu,cpuTotal:this.cpuTotal,delay:this.end2EndDelay,downlinkNetworkQuality:this._downlinkNetworkQualityClacInstance.toAGQuality(this.downlinkNetworkQuality),uplinkNetworkQuality:this._uplinkNetworkQualityClacInstance.toAGQuality(this.downlinkNetworkQuality)};return networkStats}}]),RtcNetworkQualityElectron}())||wO;function thread_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */thread_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function thread_createSuper(j){var _e=function thread_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var PO,BO=function(j){_inherits(AgoraRteThread,j);var _e,_t=thread_createSuper(AgoraRteThread);function AgoraRteThread(){var j;_classCallCheck(this,AgoraRteThread);for(var _e=arguments.length,St=new Array(_e),Tt=0;Tt<_e;Tt++)St[Tt]=arguments[Tt];return(j=_t.call.apply(_t,[this].concat(St)))._dirty=!1,j._dirtyTimer=void 0,j.logger=void 0,j.running=!1,j.runnable=!0,j}return _createClass(AgoraRteThread,[{key:"run",value:function run(){var j=this;!this.running&&this.runnable?(this.running=!0,this._dirtyTimer=setTimeout(_asyncToGenerator(thread_regeneratorRuntime().mark((function _callee(){return thread_regeneratorRuntime().wrap((function _callee$(_e){for(;;)switch(_e.prev=_e.next){case 0:return j._dirty=!1,j._dirtyTimer&&clearTimeout(j._dirtyTimer),_e.next=4,j.onExecution();case 4:j.running=!1,j._dirty&&(j.logger.info("thread state is dirty, rerun"),j.run());case 6:case"end":return _e.stop()}}),_callee)}))),0)):this._dirty=!0}},{key:"onExecution",value:(_e=_asyncToGenerator(thread_regeneratorRuntime().mark((function _callee2(){return thread_regeneratorRuntime().wrap((function _callee2$(j){for(;;)switch(j.prev=j.next){case 0:case"end":return j.stop()}}),_callee2)}))),function onExecution(){return _e.apply(this,arguments)})},{key:"stop",value:function stop(){this.running=!1}}]),AgoraRteThread}(_a);function electron_thread_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */electron_thread_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function electron_thread_createSuper(j){var _e=function electron_thread_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var UO,QO,KO,HO=kS.attach({proxyMethods:!1})(PO=function(j){_inherits(AgoraRteElectronCameraThread,j);var _e,_t=electron_thread_createSuper(AgoraRteElectronCameraThread);function AgoraRteElectronCameraThread(j){var _e;return _classCallCheck(this,AgoraRteElectronCameraThread),(_e=_t.call(this)).logger=void 0,_e.canvas=void 0,_e.trackState=RR.stopped,_e.cameraEnable=!1,_e._rtcEngine=void 0,_e.currentCanvas=void 0,_e.videoStreamState=0,_e._rtcEngine=j.rtcEngine,_e}return _createClass(AgoraRteElectronCameraThread,[{key:"setCameraTrackState",value:function setCameraTrackState(j,_e){this.trackState!==j&&(this.trackState=j,this.emit($R.trackStateChanged,j,pR.Camera,_e))}},{key:"onExecution",value:(_e=_asyncToGenerator(electron_thread_regeneratorRuntime().mark((function _callee2(){var j,_e=this;return electron_thread_regeneratorRuntime().wrap((function _callee2$(_t){for(;;)switch(_t.prev=_t.next){case 0:if(this.logger.debug("thread notify start..."),!this.cameraEnable){_t.next=17;break}if(0!==(j=this.videoStreamState)&&3!==j){_t.next=10;break}return _t.delegateYield(electron_thread_regeneratorRuntime().mark((function _callee(){var _t,St,Tt;return electron_thread_regeneratorRuntime().wrap((function _callee$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(_e.logger.info("starting camera..."),_e.setCameraTrackState(RR.starting),_t=void 0,St=void 0,Ut.prev=4,0!==j){Ut.next=14;break}return Ut.next=8,new Promise((function(j){_t=function cameraStateChangeCallback(_e){1!==_e&&2!==_e||j(1)},St=function roleChangeCallback(_e,_t){2===_t&&j(0)},_e._rtcEngine.on("localVideoStateChanged",_t),_e._rtcEngine.on("clientRoleChanged",St),_e._rtcEngine.enableLocalVideo(!0);var Tt=$E.shared.rtcConfigs.defaultCameraEncoderConfigurations,Ut=Tt?{width:Tt.width,height:Tt.height,frameRate:Tt.frameRate,bitrate:Tt.bitrate,minFrameRate:0,orientationMode:0,minBitrate:0,mirrorMode:0,degradationPreference:1}:void 0;Ut&&(_e._rtcEngine.setVideoEncoderConfiguration(Ut),_e._rtcEngine.setVideoRenderFPS(Ut.frameRate))}));case 8:if(Tt=Ut.sent,_t&&_e._rtcEngine.off("localVideoStateChanged",_t),St&&_e._rtcEngine.off("clientRoleChanged",St),Tt){Ut.next=14;break}return _e.logger.info("camera not started."),Ut.abrupt("return","break");case 14:_e.setCameraTrackState(RR.started),_e.logger.info("camera started."),Ut.next=24;break;case 18:return Ut.prev=18,Ut.t0=Ut.catch(4),_e.setCameraTrackState(RR.error),_t&&_e._rtcEngine.off("localVideoStateChanged",_t),St&&_e._rtcEngine.off("clientRoleChanged",St),Ut.abrupt("return","break");case 24:case"end":return Ut.stop()}}),_callee,null,[[4,18]])}))(),"t0",5);case 5:if("break"!==_t.t0){_t.next=8;break}return _t.abrupt("break",23);case 8:_t.next=11;break;case 10:this.trackState!==RR.started&&this.setCameraTrackState(RR.started);case 11:if(this.trackState!==RR.started){_t.next=15;break}return(!this.currentCanvas&&this.canvas||this.currentCanvas&&this.canvas&&this.canvas.view!==this.currentCanvas.view)&&(this._rtcEngine.setupLocalVideo(this.canvas.view),this.currentCanvas=this.canvas),this.currentCanvas&&this.currentCanvas.view,_t.abrupt("break",23);case 15:_t.next=20;break;case 17:if(this.trackState!==RR.stopped&&(this.logger.info("stopping camera..."),this._rtcEngine.enableLocalVideo(!1),this.currentCanvas&&this.currentCanvas.view,this.setCameraTrackState(RR.stopped),this.logger.info("camera stopped")),this.trackState!==RR.stopped){_t.next=20;break}return _t.abrupt("break",23);case 20:return _t.next=22,new Promise((function(j){return setTimeout(j,500)}));case 22:if(this.running){_t.next=0;break}case 23:this.logger.debug("thread sleep...");case 24:case"end":return _t.stop()}}),_callee2,this)}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRteElectronCameraThread}(BO))||PO;function electron_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */electron_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function electron_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function electron_createSuper(j){var _e=function electron_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var zO=_createClass((function A(){_classCallCheck(this,A)}));try{zO=__webpack_require__(5455).default}catch(j){$E.platform===KE.Electron&&ME.warn("load electron sdk failed: ".concat(j))}var JO=kS.attach({proxyMethods:!1})((QO=function(j){_inherits(RtcAdapterElectron,j);var _e=electron_createSuper(RtcAdapterElectron);function RtcAdapterElectron(){var j;_classCallCheck(this,RtcAdapterElectron),(j=_e.call(this)).logger=void 0,j._vdm=void 0,j._adm=void 0,j._engine=void 0,j._channels=new Map,j._configs={},j._screenEventBus=new _a,j.cameraThread=void 0,j._localVideoEnabled=!1,j._localAudioEnabled=!1,j.screenShareId=void 0,j.screenShareType=void 0,j.screenShareWithAudio=void 0,j.screenShareAudioDeviceName=void 0,RtcAdapterElectron.rtcEngine||(RtcAdapterElectron.rtcEngine=new zO),j._engine=RtcAdapterElectron.rtcEngine;var _t=RtcAdapterElectron.logPath,St=0;return _t?(ME.info("sdk log path: ".concat(_t)),St=j.rtcEngine.initialize($E.shared.appId,j._region,{filePath:_t,fileSize:1024,level:RtcAdapterElectron.getLogLevel()})):(ME.warn("no log path found, sdk logs will be put in default folder"),St=j.rtcEngine.initialize($E.shared.appId,j._region)),j.rtcEngine.registerMediaMetadataObserver(),0!==St&&ZE.shared.handleThrowableError(QE.RTC_ERR_RTC_ENGINE_INITIALZIE_FAILED,new Error("rtc engine initialize failed ".concat(St))),$E.shared.rtcSDKParameters&&$E.shared.rtcSDKParameters.forEach((function(_e){j.rtcEngine.setParameters(JSON.stringify(_e))})),j._adm=new DO(_assertThisInitialized(j)),j._vdm=new OO(_assertThisInitialized(j)),j.cameraThread=new HO(_assertThisInitialized(j)),j._addEventListeners(),j}return _createClass(RtcAdapterElectron,[{key:"configs",get:function get(){return function electron_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?electron_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):electron_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}({},this._configs)}},{key:"rtcEngine",get:function get(){return this._engine}},{key:"channelProfile",get:function get(){var j;return null!==(j=$E.shared.rtcConfigs.channelProfile)&&void 0!==j?j:TE.LiveBroadcasting}},{key:"latencyLevel",get:function get(){var j;return(j={},_defineProperty(j,zE.Low,1),_defineProperty(j,zE.UltraLow,2),j)[$E.shared.latencyLevel]}},{key:"createRtcChannel",value:function createRtcChannel(j,_e){var _t=this._channels.get(j);return _t||(_t=new XO(j,this.configs,_e),this._channels.set(j,_t)),_t}},{key:"getVideoDeviceManager",value:function getVideoDeviceManager(){return this._vdm}},{key:"getAudioDeviceManager",value:function getAudioDeviceManager(){return this._adm}},{key:"getWindowDevices",value:function getWindowDevices(){var j=this;return new Promise((function(_e){j.rtcEngine.getScreenWindowsInfo((function(j){_e(j.map((function(j){return{id:j.windowId,type:DR.Window,title:j.name||j.ownerName,image:j.image,isCurrent:"".concat(j.processId)===window.main_pid}})))}))}))}},{key:"getDiaplayDevices",value:function getDiaplayDevices(){var j=this;return new Promise((function(_e){j.rtcEngine.getScreenDisplaysInfo((function(j){_e(j.map((function(j){return{id:j.displayId.id,type:DR.Screen,title:"Display",image:j.image}})))}))}))}},{key:"isScreenDeviceEnumerateSupported",value:function isScreenDeviceEnumerateSupported(){return!0}},{key:"setVideoCameraDevice",value:function setVideoCameraDevice(j){return this.rtcEngine.setVideoDevice(j)}},{key:"setAudioRecordingDevice",value:function setAudioRecordingDevice(j){return this.rtcEngine.setAudioRecordingDevice(j)}},{key:"setAudioPlaybackDevice",value:function setAudioPlaybackDevice(j){return this.rtcEngine.setAudioPlaybackDevice(j)}},{key:"enableLocalVideo",value:function enableLocalVideo(j){return this._localVideoEnabled=j,this.cameraThread.cameraEnable=j,this.cameraThread.run(),0}},{key:"enableLocalAudio",value:function enableLocalAudio(j){return this._localAudioEnabled=j,this.rtcEngine.enableLocalAudio(j)}},{key:"restoreAVState",value:function restoreAVState(){this._localVideoEnabled&&(this.logger.info("rtc role changed to audience, re-enabling local camera..."),this.enableLocalVideo(!0),this.logger.info("re-enabled local camera")),this._localAudioEnabled&&(this.logger.info("rtc role changed to audience, re-enabling local microphone..."),this.enableLocalAudio(!0),this.logger.info("re-enabled local microphone"))}},{key:"setupLocalVideo",value:function setupLocalVideo(j,_e){return _e===pR.Camera?(this.cameraThread.canvas=j,this.cameraThread.run()):_e===pR.ScreenShare&&this.rtcEngine.videoSourceSetupLocalVideo(j.view),0}},{key:"setupRemoteVideo",value:function setupRemoteVideo(j){return this.rtcEngine.setupRemoteVideo(+j.streamUuid,j.view),this.rtcEngine.setupViewContentMode(+j.streamUuid,j.renderMode===xR.fill?0:1,void 0),0}},{key:"startAudioRecordingDeviceTest",value:function startAudioRecordingDeviceTest(j){return this.rtcEngine.startAudioRecordingDeviceTest(j)}},{key:"stopAudioRecordingDeviceTest",value:function stopAudioRecordingDeviceTest(){return this.rtcEngine.stopAudioRecordingDeviceTest()}},{key:"startAudioPlaybackDeviceTest",value:function startAudioPlaybackDeviceTest(j){return this.rtcEngine.startAudioPlaybackDeviceTest(j)}},{key:"stopAudioPlaybackDeviceTest",value:function stopAudioPlaybackDeviceTest(){return this.rtcEngine.stopAudioPlaybackDeviceTest()}},{key:"startScreenCapture",value:function startScreenCapture(j){if(this.rtcEngine.videoSourceInitialize($E.shared.appId),void 0!==(null==j?void 0:j.id)){var _e=j.id,_t=j.type,St=j.withAudio,Tt=j.audioDeviceName;this.screenShareId=_e,this.screenShareType=_t,this.screenShareWithAudio=St,this.screenShareAudioDeviceName=Tt,this._screenEventBus.emit($R.trackStateChanged,RR.started,pR.ScreenShare,void 0,St)}return 0}},{key:"stopScreenCapture",value:function stopScreenCapture(){return this.screenShareWithAudio&&this.rtcEngine.enableLoopbackRecording(!1,this.screenShareAudioDeviceName),this.rtcEngine.videoSourceStopScreenCapture(),this.screenShareId=void 0,this.screenShareType=void 0,this.screenShareWithAudio=void 0,this.screenShareAudioDeviceName=void 0,this._screenEventBus.emit($R.trackStateChanged,RR.stopped,pR.ScreenShare),0}},{key:"onAutoplayFailed",value:function onAutoplayFailed(){return this.logger.warn("electron platform does not support onAutoplayFailed"),0}},{key:"onLocalAudioPlaybackTestVolumeChanged",value:function onLocalAudioPlaybackTestVolumeChanged(j){return this.on($R.localAudioPlaybackVolumeIndicator,j),0}},{key:"onLocalVideoTrackStateChanged",value:function onLocalVideoTrackStateChanged(j){return this.cameraThread.on($R.trackStateChanged,j),0}},{key:"onLocalAudioTrackStateChanged",value:function onLocalAudioTrackStateChanged(j){return this.on($R.localAudioTrackChanged,j),0}},{key:"onLocalAudioVolume",value:function onLocalAudioVolume(j){return this.on($R.localAudioVolume,j),0}},{key:"onLocalScreenShareTrackStateChanged",value:function onLocalScreenShareTrackStateChanged(j){return this._screenEventBus.on($R.trackStateChanged,j),0}},{key:"setBeautyEffectOptions",value:function setBeautyEffectOptions(j,_e){return this.rtcEngine.setBeautyEffectOptions(j,_e)}},{key:"hasScreenSharePermission",value:function hasScreenSharePermission(){return!RtcAdapterElectron.remote||"denied"!==RtcAdapterElectron.remote.systemPreferences.getMediaAccessStatus("screen")}},{key:"setAudioRawDataConfig",value:function setAudioRawDataConfig(j,_e){return this.logger.warn("electron platform does not support setAudioRawDataConfig for now"),1}},{key:"addAudioRawDataObserver",value:function addAudioRawDataObserver(j){return this.logger.warn("electron platform does not support addAudioRawDataObserver for now"),1}},{key:"removeAudioRawDataObserver",value:function removeAudioRawDataObserver(j){return this.logger.warn("electron platform does not support removeAudioRawDataObserver for now"),1}},{key:"takeSnapshot",value:function takeSnapshot(j,_e,_t){var St=this;return new Promise((function(Tt,Ut){St.rtcEngine.once("snapshotTaken",(function(j,_e,_t,St,Ut,_r){Tt({channel:j,uid:_e,filePath:_t,width:St,height:Ut,errCode:_r})})),0!==St.rtcEngine.takeSnapshot(j,_e,_t)&&Ut()}))}},{key:"getCurrentFrameData",value:function getCurrentFrameData(j,_e,_t){return this.logger.warn("electron platform does not support this"),new ImageData(1,1)}},{key:"addCameraProcessors",value:function addCameraProcessors(j){return this.logger.warn("electron platform does not support add camera processors"),0}},{key:"removeCameraProcessors",value:function removeCameraProcessors(){return this.logger.warn("electron platform does not support remove camera processors"),0}},{key:"addMicrophoneProcessors",value:function addMicrophoneProcessors(j){return this.logger.warn("electron platform does not support add microphone processors"),0}},{key:"removeMicrophoneProcessors",value:function removeMicrophoneProcessors(){return this.logger.warn("electron platform does not support remove microphone processors"),0}},{key:"destroy",value:function destroy(){this._channels.forEach((function(j){j.leave()})),this._channels.clear();var j=this.rtcEngine.release();return RtcAdapterElectron.rtcEngine=void 0,j}},{key:"_region",get:function get(){switch($E.shared.rtcRegion){case HE.AREA_GLOBAL:return 4294967295;case HE.AREA_CN:return 1;case HE.AREA_NA:return 2;case HE.AREA_EUR:return 4;case HE.AREA_AS:return 8;case HE.AREA_JAPAN:return 16;case HE.AREA_INDIA:return 32}}},{key:"_addEventListeners",value:function _addEventListeners(){var j=this;this.rtcEngine.on("clientRoleChanged",(function(_e,_t){2===_t&&j.restoreAVState()})),this.rtcEngine.on("localVideoStateChanged",(function(_e,_t){j.logger.info("[rtc] video state changed ".concat(_e," ").concat(_t)),j.cameraThread.videoStreamState=_e})),this.rtcEngine.on("localAudioStateChanged",(function(_e){0===_e&&j.emit($R.localAudioTrackChanged,RR.stopped,vR.Mic),2!==_e&&1!==_e||j.emit($R.localAudioTrackChanged,RR.started,vR.Mic)})),this.rtcEngine.on("groupAudioVolumeIndication",(function(_e){var _t=_e.find((function(j){return 0===j.uid})),St=_e.find((function(j){return 1===j.uid}));_t&&j.emit($R.localAudioVolume,_t.volume/255),St&&j.emit($R.localAudioPlaybackVolumeIndicator,St.volume/255)}))}}],[{key:"remote",get:function get(){var j=window.require("electron").remote;if(j)return j;ME.warn("enableRemoteModule is not set, we will not be able to tell you screenshare access status in this case. You can still use screenshare feature though")}},{key:"getLogLevel",value:function getLogLevel(){switch($E.logLevel){case SE.DEBUG:case SE.INFO:return 1;case SE.WARN:return 2;case SE.ERROR:return 4;default:return 0}}},{key:"getRtcVersion",value:function getRtcVersion(){if(!this.version){var j=this.rtcEngine;j||(j=new zO),this.version=j.getVersion(),this.rtcEngine||j.release()}var _e=this.version,_t=_e.version,St=_e.build;return"".concat(_t,".").concat(St)}},{key:"logBasePath",get:function get(){if(RtcAdapterElectron.remote)return RtcAdapterElectron.remote.app.getPath("logs")}},{key:"logFolderPath",get:function get(){if(this.logBasePath)return window.require("path").resolve(this.logBasePath,"logs")}},{key:"logPath",get:function get(){var j=this.logFolderPath;if(j)return window.require("path").resolve(j,"sdk.log")}}]),RtcAdapterElectron}(bO),QO.rtcEngine=void 0,QO.version=void 0,UO=QO))||UO,XO=kS.attach({proxyMethods:!1})(KO=function(j){_inherits(RtcChannelAdapterElectron,j);var _e=electron_createSuper(RtcChannelAdapterElectron);function RtcChannelAdapterElectron(j,_t,St){var Tt;return _classCallCheck(this,RtcChannelAdapterElectron),(Tt=_e.call(this)).logger=void 0,Tt.channelName=void 0,Tt.uid=void 0,Tt.base=void 0,Tt._muteLocalVideo=!0,Tt._muteLocalAudio=!0,Tt._metaTask=void 0,Tt._networkStats=new NO,Tt.channelName=j,Tt.base=St,fR.addPollingTask((function(){Tt.emit(RT.NetworkStats,Tt._networkStats.networkStats())}),cR.second(2)),Tt._addEventListeners(),Tt}return _createClass(RtcChannelAdapterElectron,[{key:"getSessionId",value:function getSessionId(){return this.base.rtcEngine.getCallId()}},{key:"setLatencyLevel",value:function setLatencyLevel(j){this.logger.info("set client role to audience and audience level to",j),this.base.rtcEngine.setClientRoleWithOptions(2,{audienceLatencyLevel:j})}},{key:"muteRemoteVideoMass",value:function muteRemoteVideoMass(j,_e){return Promise.resolve(j)}},{key:"enableDualStream",value:function enableDualStream(j){return 0===this.base.rtcEngine.enableDualStreamMode(j)?Promise.resolve():Promise.reject()}},{key:"setLowStreamParameter",value:function setLowStreamParameter(j){var _e={"che.video.lowBitRateStreamParameter":{width:j.width,height:j.height,frameRate:j.frameRate,bitRate:j.bitrate}};return this.base.rtcEngine.setParameters(JSON.stringify(_e))}},{key:"getCurrentFrameData",value:function getCurrentFrameData(j){return this.logger.warn("electron platform does not support this"),new ImageData(1,1)}},{key:"setRemoteVideoStreamType",value:function setRemoteVideoStreamType(j,_e){return 0===this.base.rtcEngine.setRemoteVideoStreamType(+j,_e)?Promise.resolve():Promise.reject()}},{key:"onConnectionStateChanged",value:function onConnectionStateChanged(j){return this.on(RT.RtcConnectionStateChanged,j),0}},{key:"leave",value:function leave(j){return(null!=j?j:_R.main)===_R.main?this.base.rtcEngine.leaveChannel():this.base.rtcEngine.videoSourceLeave(),Promise.resolve()}},{key:"onNetworkStats",value:function onNetworkStats(j){return this.on(RT.NetworkStats,j),0}},{key:"onAudioVolumeIndication",value:function onAudioVolumeIndication(j){return this.on(RT.AudioVolumes,j),0}},{key:"muteRemoteVideo",value:function muteRemoteVideo(j,_e){return this.base.rtcEngine.muteRemoteVideoStream(+j,_e)}},{key:"muteRemoteAudio",value:function muteRemoteAudio(j,_e){return this.base.rtcEngine.muteRemoteAudioStream(+j,_e)}},{key:"_startScreenCapture",value:function _startScreenCapture(){var j,_e,_t,St,Tt=this.base.screenShareType,Ut=this.base.screenShareId,_r=this.base.screenShareWithAudio,_n=this.base.screenShareAudioDeviceName;if(void 0!==Ut&&void 0!==Tt){var _i=$E.shared.rtcConfigs.defaultScreenEncoderConfigurations,Ei={width:null!==(j=null==_i?void 0:_i.width)&&void 0!==j?j:0,height:null!==(_e=null==_i?void 0:_i.height)&&void 0!==_e?_e:0,frameRate:null!==(_t=null==_i?void 0:_i.frameRate)&&void 0!==_t?_t:10,bitrate:null!==(St=null==_i?void 0:_i.bitrate)&&void 0!==St?St:0,captureMouseCursor:!0,windowFocus:!0,excludeWindowCount:0,excludeWindowList:[],highLightWidth:0,highLightColor:0,enableHighLight:!1},Ci={width:0,height:0,x:0,y:0};if(Tt===DR.Screen){var Di="darwin"===process.platform?{id:parseInt(Ut),width:0,height:0,x:0,y:0}:{width:0,height:0,x:0,y:0};this.base.rtcEngine.videoSourceStartScreenCaptureByScreen(Di,Ci,Ei)}else Tt===DR.Window&&this.base.rtcEngine.videoSourceStartScreenCaptureByWindow(Ut,Ci,Ei);_r&&this.base.rtcEngine.enableLoopbackRecording(!0,_n)}}},{key:"join",value:function join(j,_e,_t){var St=this;return new Promise((function(Tt,Ut){var _r=St.base.rtcEngine;if(_t===_R.main)_r.once("joinedChannel",(function(){Tt()})),_r.setChannelProfile(St.base.channelProfile),_r.enableAudioVolumeIndication(500,3),_r.joinChannel(j,St.channelName,"",+_e,{autoSubscribeAudio:!1,autoSubscribeVideo:!1,publishLocalAudio:!1,publishLocalVideo:!1}),St.uid=+_e;else if(_t===_R.sub){_r.once("videoSourceJoinedSuccess",(function(){St._startScreenCapture(),Tt()})),_r.videoSourceSetChannelProfile(St.base.channelProfile);var _n=_r.videoSourceJoin(j,St.channelName,"",+_e,{autoSubscribeAudio:!1,autoSubscribeVideo:!1,publishLocalAudio:!0,publishLocalVideo:!0});St.logger.info("[rtc] videosource join ".concat(_n))}}))}},{key:"muteLocalVideo",value:function muteLocalVideo(j,_e){var _t=this.base.rtcEngine;this._updateRole({video:j,audio:this._muteLocalAudio});var St=_t.muteLocalVideoStream(j);return 0===St&&(this._muteLocalVideo=j),St}},{key:"muteLocalAudio",value:function muteLocalAudio(j,_e){var _t=this.base.rtcEngine;this._updateRole({video:this._muteLocalVideo,audio:j});var St=_t.muteLocalAudioStream(j);return 0===St&&(this._muteLocalAudio=j),St}},{key:"muteLocalScreenShare",value:function muteLocalScreenShare(j,_e){return this.base.rtcEngine.videoSourceMuteLocalVideoStream(j)}},{key:"_updateRole",value:function _updateRole(j){var _e;(null!==(_e=$E.shared.rtcConfigs.channelProfile)&&void 0!==_e?_e:TE.LiveBroadcasting)===TE.LiveBroadcasting&&(j.video&&j.audio?(this.logger.info("update rtc role to audience, latency level: ".concat(this.base.latencyLevel)),this.base.rtcEngine.setClientRoleWithOptions(2,{audienceLatencyLevel:this.base.latencyLevel}),this.base.restoreAVState()):(this.logger.info("update rtc role to host"),this.base.rtcEngine.setClientRole(1)))}},{key:"_getRtcState",value:function _getRtcState(j){switch(j){case 1:case 5:return kR.Idle;case 2:return kR.Connecting;case 3:return kR.Connected;case 4:return kR.Reconnecting}}},{key:"_addEventListeners",value:function _addEventListeners(){var j=this,_e=this.base.rtcEngine;_e.on("networkQuality",(function(_e,_t,St){0===_e&&(j._networkStats.downlinkNetworkQuality=St,j._networkStats.uplinkNetworkQuality=_t)})),_e.on("rtcStats",(function(_e){var _t=_e.txPacketLossRate,St=_e.rxPacketLossRate,Tt=_e.cpuAppUsage,Ut=_e.cpuTotalUsage,_r=_e.lastmileDelay,_n=_e.gatewayRtt;j._networkStats.txVideoPacketLoss=_t/100,j._networkStats.rxVideoPacketLoss=St/100,j._networkStats.rtt=_n,j._networkStats.end2EndDelay=_r,j._networkStats.cpu=Tt/100,j._networkStats.cpuTotal=Ut/100})),_e.on("groupAudioVolumeIndication",(function(_e){var _t=new Map;_e.forEach((function(j){return _t.set(""+j.uid,j.volume)})),j.emit(RT.AudioVolumes,_t)})),_e.on("connectionStateChanged",(function(_e){j.emit(RT.RtcConnectionStateChanged,j._getRtcState(_e))})),_e.on("videoSourceJoinedSuccess",(function(){j.emit(RT.RtcConnectionStateChanged,kR.Connected,_R.sub)})),_e.on("videoSourceLeaveChannel",(function(){j.emit(RT.RtcConnectionStateChanged,kR.Idle,_R.sub)}))}},{key:"_emitMetadata",value:function _emitMetadata(){var j=this;this._metaTask||(this._metaTask=fR.addPollingTask(_asyncToGenerator(electron_regeneratorRuntime().mark((function _callee(){var _e;return electron_regeneratorRuntime().wrap((function _callee$(_t){for(;;)switch(_t.prev=_t.next){case 0:_e="".concat(JSON.stringify({uid:j.uid,ts:Date.now()})),j.base.rtcEngine.sendMetadata({uid:j.uid,timeStampMs:Date.now(),size:_e.length,buffer:_e});case 2:case"end":return _t.stop()}}),_callee)}))),500))}},{key:"_stopEmitMetadata",value:function _stopEmitMetadata(){this._metaTask&&(this._metaTask.stop(),this._metaTask=void 0)}}]),RtcChannelAdapterElectron}(iO))||KO,$O=__webpack_require__(5904),rD=__webpack_require__.n($O);__webpack_require__(9575),__webpack_require__(2472),__webpack_require__(2990),__webpack_require__(8927),__webpack_require__(3105),__webpack_require__(5035),__webpack_require__(4345),__webpack_require__(7174),__webpack_require__(2846),__webpack_require__(4731),__webpack_require__(7209),__webpack_require__(6319),__webpack_require__(8867),__webpack_require__(7789),__webpack_require__(3739),__webpack_require__(9368),__webpack_require__(4483),__webpack_require__(2056),__webpack_require__(3462),__webpack_require__(678),__webpack_require__(7462),__webpack_require__(3824),__webpack_require__(5021),__webpack_require__(2974),__webpack_require__(5016),__webpack_require__(6541);function canvas_createSuper(j){var _e=function canvas_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var sD=_createClass((function AgoraStreamCanvas(j,_e,_t,St){var Tt;_classCallCheck(this,AgoraStreamCanvas),this.streamUuid=void 0,this.channelName=void 0,this.view=void 0,this.mirror=void 0,this.streamUuid=j,this.channelName=_e,this.view=_t,this.mirror=null!==(Tt=null==St?void 0:St.mirror)&&void 0!==Tt&&Tt})),uD=function(j){_inherits(AgoraRtcVideoCanvas,j);var _e=canvas_createSuper(AgoraRtcVideoCanvas);function AgoraRtcVideoCanvas(j,_t,St,Tt){var Ut;return _classCallCheck(this,AgoraRtcVideoCanvas),(Ut=_e.call(this,j,_t,St,Tt)).renderMode=xR.fill,void 0!==(null==Tt?void 0:Tt.renderMode)&&(Ut.renderMode=Tt.renderMode),Ut}return _createClass(AgoraRtcVideoCanvas,null,[{key:"key",value:function key(j,_e){return"".concat(j,"-").concat(_e)}}]),AgoraRtcVideoCanvas}(sD),pD=function(j){_inherits(AgoraRtcLocalVideoCanvas,j);var _e=canvas_createSuper(AgoraRtcLocalVideoCanvas);function AgoraRtcLocalVideoCanvas(j,_t){return _classCallCheck(this,AgoraRtcLocalVideoCanvas),_e.call(this,"0","",j,{mirror:_t})}return _createClass(AgoraRtcLocalVideoCanvas)}(uD),AD=function(j){_inherits(AgoraMediaPlayerCanvas,j);var _e=canvas_createSuper(AgoraMediaPlayerCanvas);function AgoraMediaPlayerCanvas(j,_t,St){var Tt,Ut,_r;return _classCallCheck(this,AgoraMediaPlayerCanvas),(_r=_e.call(this,"","",_t,St)).streamUrl=void 0,_r.playVideo=void 0,_r.playAudio=void 0,_r.streamUrl=j,_r.playVideo=null===(Tt=null==St?void 0:St.playVideo)||void 0===Tt||Tt,_r.playAudio=null===(Ut=null==St?void 0:St.playAudio)||void 0===Ut||Ut,_r}return _createClass(AgoraMediaPlayerCanvas)}(sD);function concat_concat(j,_e){_e||(_e=j.reduce(((j,_e)=>j+_e.length),0));const _t=new Uint8Array(_e);let St=0;for(const _e of j)_t.set(_e,St),St+=_e.length;return _t}var ED=function base(j,_e){if(j.length>=255)throw new TypeError("Alphabet too long");for(var _t=new Uint8Array(256),St=0;St<_t.length;St++)_t[St]=255;for(var Tt=0;Tt<j.length;Tt++){var Ut=j.charAt(Tt),_r=Ut.charCodeAt(0);if(255!==_t[_r])throw new TypeError(Ut+" is ambiguous");_t[_r]=Tt}var _n=j.length,_i=j.charAt(0),Ei=Math.log(_n)/Math.log(256),Ci=Math.log(256)/Math.log(_n);function decodeUnsafe(j){if("string"!=typeof j)throw new TypeError("Expected String");if(0===j.length)return new Uint8Array;var _e=0;if(" "!==j[_e]){for(var St=0,Tt=0;j[_e]===_i;)St++,_e++;for(var Ut=(j.length-_e)*Ei+1>>>0,_r=new Uint8Array(Ut);j[_e];){var Ci=_t[j.charCodeAt(_e)];if(255===Ci)return;for(var Di=0,Fi=Ut-1;(0!==Ci||Di<Tt)&&-1!==Fi;Fi--,Di++)Ci+=_n*_r[Fi]>>>0,_r[Fi]=Ci%256>>>0,Ci=Ci/256>>>0;if(0!==Ci)throw new Error("Non-zero carry");Tt=Di,_e++}if(" "!==j[_e]){for(var _o=Ut-Tt;_o!==Ut&&0===_r[_o];)_o++;for(var ga=new Uint8Array(St+(Ut-_o)),_a=St;_o!==Ut;)ga[_a++]=_r[_o++];return ga}}}return{encode:function encode(_e){if(_e instanceof Uint8Array||(ArrayBuffer.isView(_e)?_e=new Uint8Array(_e.buffer,_e.byteOffset,_e.byteLength):Array.isArray(_e)&&(_e=Uint8Array.from(_e))),!(_e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===_e.length)return"";for(var _t=0,St=0,Tt=0,Ut=_e.length;Tt!==Ut&&0===_e[Tt];)Tt++,_t++;for(var _r=(Ut-Tt)*Ci+1>>>0,Ei=new Uint8Array(_r);Tt!==Ut;){for(var Di=_e[Tt],Fi=0,_o=_r-1;(0!==Di||Fi<St)&&-1!==_o;_o--,Fi++)Di+=256*Ei[_o]>>>0,Ei[_o]=Di%_n>>>0,Di=Di/_n>>>0;if(0!==Di)throw new Error("Non-zero carry");St=Fi,Tt++}for(var ga=_r-St;ga!==_r&&0===Ei[ga];)ga++;for(var _a=_i.repeat(_t);ga<_r;++ga)_a+=j.charAt(Ei[ga]);return _a},decodeUnsafe,decode:function decode(j){var _t=decodeUnsafe(j);if(_t)return _t;throw new Error(`Non-${_e} character`)}}};const xD=ED,MD=(new Uint8Array(0),j=>{if(j instanceof Uint8Array&&"Uint8Array"===j.constructor.name)return j;if(j instanceof ArrayBuffer)return new Uint8Array(j);if(ArrayBuffer.isView(j))return new Uint8Array(j.buffer,j.byteOffset,j.byteLength);throw new Error("Unknown type, must be binary type")});class Encoder{constructor(j,_e,_t){this.name=j,this.prefix=_e,this.baseEncode=_t}encode(j){if(j instanceof Uint8Array)return`${this.prefix}${this.baseEncode(j)}`;throw Error("Unknown type, must be binary type")}}class Decoder{constructor(j,_e,_t){if(this.name=j,this.prefix=_e,void 0===_e.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=_e.codePointAt(0),this.baseDecode=_t}decode(j){if("string"==typeof j){if(j.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(j)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(j.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(j){return or(this,j)}}class ComposedDecoder{constructor(j){this.decoders=j}or(j){return or(this,j)}decode(j){const _e=j[0],_t=this.decoders[_e];if(_t)return _t.decode(j);throw RangeError(`Unable to decode multibase string ${JSON.stringify(j)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const or=(j,_e)=>new ComposedDecoder({...j.decoders||{[j.prefix]:j},..._e.decoders||{[_e.prefix]:_e}});class Codec{constructor(j,_e,_t,St){this.name=j,this.prefix=_e,this.baseEncode=_t,this.baseDecode=St,this.encoder=new Encoder(j,_e,_t),this.decoder=new Decoder(j,_e,St)}encode(j){return this.encoder.encode(j)}decode(j){return this.decoder.decode(j)}}const from=({name:j,prefix:_e,encode:_t,decode:St})=>new Codec(j,_e,_t,St),baseX=({prefix:j,name:_e,alphabet:_t})=>{const{encode:St,decode:Tt}=xD(_t,_e);return from({prefix:j,name:_e,encode:St,decode:j=>MD(Tt(j))})},rfc4648=({name:j,prefix:_e,bitsPerChar:_t,alphabet:St})=>from({prefix:_e,name:j,encode:j=>((j,_e,_t)=>{const St="="===_e[_e.length-1],Tt=(1<<_t)-1;let Ut="",_r=0,_n=0;for(let St=0;St<j.length;++St)for(_n=_n<<8|j[St],_r+=8;_r>_t;)_r-=_t,Ut+=_e[Tt&_n>>_r];if(_r&&(Ut+=_e[Tt&_n<<_t-_r]),St)for(;Ut.length*_t&7;)Ut+="=";return Ut})(j,St,_t),decode:_e=>((j,_e,_t,St)=>{const Tt={};for(let j=0;j<_e.length;++j)Tt[_e[j]]=j;let Ut=j.length;for(;"="===j[Ut-1];)--Ut;const _r=new Uint8Array(Ut*_t/8|0);let _n=0,_i=0,Ei=0;for(let _e=0;_e<Ut;++_e){const Ut=Tt[j[_e]];if(void 0===Ut)throw new SyntaxError(`Non-${St} character`);_i=_i<<_t|Ut,_n+=_t,_n>=8&&(_n-=8,_r[Ei++]=255&_i>>_n)}if(_n>=_t||255&_i<<8-_n)throw new SyntaxError("Unexpected end of data");return _r})(_e,St,_t,j)}),BD=from({prefix:"\0",name:"identity",encode:j=>{return _e=j,(new TextDecoder).decode(_e);var _e},decode:j=>(j=>(new TextEncoder).encode(j))(j)}),UD=rfc4648({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),FD=rfc4648({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),VD=baseX({prefix:"9",name:"base10",alphabet:"0123456789"}),qD=rfc4648({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),QD=rfc4648({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),HD=rfc4648({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),XD=rfc4648({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),_x=rfc4648({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),tL=rfc4648({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),rL=rfc4648({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),nL=rfc4648({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),iL=rfc4648({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),oL=rfc4648({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),sL=rfc4648({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),cL=baseX({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),uL=baseX({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),dL=baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),hL=baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),pL=rfc4648({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),gL=rfc4648({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),vL=rfc4648({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),mL=rfc4648({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),yL=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),AL=yL.reduce(((j,_e,_t)=>(j[_t]=_e,j)),[]),_L=yL.reduce(((j,_e,_t)=>(j[_e.codePointAt(0)]=_t,j)),[]);const bL=from({prefix:"🚀",name:"base256emoji",encode:function base256emoji_encode(j){return j.reduce(((j,_e)=>j+=AL[_e]),"")},decode:function base256emoji_decode(j){const _e=[];for(const _t of j){const j=_L[_t.codePointAt(0)];if(void 0===j)throw new Error(`Non-base256emoji character: ${_t}`);_e.push(j)}return new Uint8Array(_e)}});var wL=function varint_encode(j,_e,_t){_e=_e||[];var St=_t=_t||0;for(;j>=SL;)_e[_t++]=255&j|128,j/=128;for(;-128&j;)_e[_t++]=255&j|128,j>>>=7;return _e[_t]=0|j,varint_encode.bytes=_t-St+1,_e},SL=Math.pow(2,31);var TL=function read(j,_e){var _t,St=0,Tt=0,Ut=_e=_e||0,_r=j.length;do{if(Ut>=_r)throw read.bytes=0,new RangeError("Could not decode varint");_t=j[Ut++],St+=Tt<28?(127&_t)<<Tt:(127&_t)*Math.pow(2,Tt),Tt+=7}while(_t>=128);return read.bytes=Ut-_e,St};var CL=Math.pow(2,7),RL=Math.pow(2,14),kL=Math.pow(2,21),OL=Math.pow(2,28),DL=Math.pow(2,35),xL=Math.pow(2,42),LL=Math.pow(2,49),NL=Math.pow(2,56),PL=Math.pow(2,63);const ML={encode:wL,decode:TL,encodingLength:function(j){return j<CL?1:j<RL?2:j<kL?3:j<OL?4:j<DL?5:j<xL?6:j<LL?7:j<NL?8:j<PL?9:10}},encodeTo=(j,_e,_t=0)=>(ML.encode(j,_e,_t),_e),encodingLength=j=>ML.encodingLength(j),create=(j,_e)=>{const _t=_e.byteLength,St=encodingLength(j),Tt=St+encodingLength(_t),Ut=new Uint8Array(Tt+_t);return encodeTo(j,Ut,0),encodeTo(_t,Ut,St),Ut.set(_e,Tt),new digest_Digest(j,_t,_e,Ut)};class digest_Digest{constructor(j,_e,_t,St){this.code=j,this.size=_e,this.digest=_t,this.bytes=St}}const hasher_from=({name:j,code:_e,encode:_t})=>new Hasher(j,_e,_t);class Hasher{constructor(j,_e,_t){this.name=j,this.code=_e,this.encode=_t}digest(j){if(j instanceof Uint8Array){const _e=this.encode(j);return _e instanceof Uint8Array?create(this.code,_e):_e.then((j=>create(this.code,j)))}throw Error("Unknown type, must be binary type")}}const sha=j=>async _e=>new Uint8Array(await crypto.subtle.digest(j,_e)),BL=hasher_from({name:"sha2-256",code:18,encode:sha("SHA-256")}),jL=hasher_from({name:"sha2-512",code:19,encode:sha("SHA-512")}),UL=MD,FL={code:0,name:"identity",encode:UL,digest:j=>create(0,UL(j))},GL="raw",VL=85,raw_encode=j=>MD(j),raw_decode=j=>MD(j),QL=new TextEncoder,KL=new TextDecoder,WL="json",HL=512,json_encode=j=>QL.encode(JSON.stringify(j)),json_decode=j=>JSON.parse(KL.decode(j));class CID{constructor(j,_e,_t,St){this.code=_e,this.version=j,this.multihash=_t,this.bytes=St,this.byteOffset=St.byteOffset,this.byteLength=St.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:cid_hidden,byteLength:cid_hidden,code:readonly,version:readonly,multihash:readonly,bytes:readonly,_baseCache:cid_hidden,asCID:cid_hidden})}toV0(){if(0===this.version)return this;{const{code:j,multihash:_e}=this;if(j!==DAG_PB_CODE)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(_e.code!==SHA_256_CODE)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return CID.createV0(_e)}}toV1(){switch(this.version){case 0:{const{code:j,digest:_e}=this.multihash,_t=Digest.create(j,_e);return CID.createV1(this.code,_t)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(j){return j&&this.code===j.code&&this.version===j.version&&Digest.equals(this.multihash,j.multihash)}toString(j){const{bytes:_e,version:_t,_baseCache:St}=this;return 0===_t?toStringV0(_e,St,j||base58btc.encoder):toStringV1(_e,St,j||base32.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(j){return deprecate(/^0\.0/,IS_CID_DEPRECATION),!(!j||!j[cidSymbol]&&j.asCID!==j)}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(j){if(j instanceof CID)return j;if(null!=j&&j.asCID===j){const{version:_e,code:_t,multihash:St,bytes:Tt}=j;return new CID(_e,_t,St,Tt||encodeCID(_e,_t,St.bytes))}if(null!=j&&!0===j[cidSymbol]){const{version:_e,multihash:_t,code:St}=j,Tt=Digest.decode(_t);return CID.create(_e,St,Tt)}return null}static create(j,_e,_t){if("number"!=typeof _e)throw new Error("String codecs are no longer supported");switch(j){case 0:if(_e!==DAG_PB_CODE)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`);return new CID(j,_e,_t,_t.bytes);case 1:{const St=encodeCID(j,_e,_t.bytes);return new CID(j,_e,_t,St)}default:throw new Error("Invalid version")}}static createV0(j){return CID.create(0,DAG_PB_CODE,j)}static createV1(j,_e){return CID.create(1,j,_e)}static decode(j){const[_e,_t]=CID.decodeFirst(j);if(_t.length)throw new Error("Incorrect length");return _e}static decodeFirst(j){const _e=CID.inspectBytes(j),_t=_e.size-_e.multihashSize,St=coerce(j.subarray(_t,_t+_e.multihashSize));if(St.byteLength!==_e.multihashSize)throw new Error("Incorrect length");const Tt=St.subarray(_e.multihashSize-_e.digestSize),Ut=new Digest.Digest(_e.multihashCode,_e.digestSize,Tt,St);return[0===_e.version?CID.createV0(Ut):CID.createV1(_e.codec,Ut),j.subarray(_e.size)]}static inspectBytes(j){let _e=0;const next=()=>{const[_t,St]=varint.decode(j.subarray(_e));return St,_t};let _t=next(),St=DAG_PB_CODE;if(18===_t?(0,0):1===_t&&next(),0!==_t&&1!==_t)throw new RangeError(`Invalid CID version ${_t}`);const Tt=_e,Ut=next(),_r=next(),_n=_e+_r;return{version:_t,codec:St,multihashCode:Ut,digestSize:_r,multihashSize:_n-Tt,size:_n}}static parse(j,_e){const[_t,St]=parseCIDtoBytes(j,_e),Tt=CID.decode(St);return Tt._baseCache.set(_t,j),Tt}}Symbol.for("@ipld/js-cid/CID");const YL={..._e,..._t,...St,...Tt,...Ut,..._r,..._n,..._i,...Ei,...Ci};function createCodec(j,_e,_t,St){return{name:j,prefix:_e,encoder:{name:j,prefix:_e,encode:_t},decoder:{decode:St}}}const JL=createCodec("utf8","u",(j=>"u"+new TextDecoder("utf8").decode(j)),(j=>(new TextEncoder).encode(j.substring(1)))),rN=createCodec("ascii","a",(j=>{let _e="a";for(let _t=0;_t<j.length;_t++)_e+=String.fromCharCode(j[_t]);return _e}),(j=>{j=j.substring(1);const _e=new Uint8Array(j.length);for(let _t=0;_t<j.length;_t++)_e[_t]=j.charCodeAt(_t);return _e}));var nN,iN,oN,aN,sN,cN,lN,dN;function web_thread_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */web_thread_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function web_thread_createSuper(j){var _e=function web_thread_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var pN,vN,yN,AN=function(j){_inherits(AgoraRteMediaTrackThread,j);var _e=web_thread_createSuper(AgoraRteMediaTrackThread);function AgoraRteMediaTrackThread(){var j;_classCallCheck(this,AgoraRteMediaTrackThread);for(var _t=arguments.length,St=new Array(_t),Tt=0;Tt<_t;Tt++)St[Tt]=arguments[Tt];return(j=_e.call.apply(_e,[this].concat(St))).track=void 0,j.processors=[],j.isPipedProcessors=!1,j}return _createClass(AgoraRteMediaTrackThread,[{key:"pipeProcessors",value:function pipeProcessors(){if(!this.isPipedProcessors&&this.processors.length>0){var j=this.track;if(j){j.unpipe();var _e=this.processors.reduce((function(_e,_t){return _e?_e.pipe(_t):j.pipe(_t)}),null);_e&&_e.pipe(j.processorDestination),this.isPipedProcessors=!0}}}},{key:"addProcessors",value:function addProcessors(j){var _e=this;j.forEach((function(j){_e.processors.find((function(_e){return j.name===_e.name}))||_e.processors.push(j)})),this.isPipedProcessors=!1,this.pipeProcessors()}},{key:"removeProcessors",value:function removeProcessors(){var j;null===(j=this.track)||void 0===j||j.unpipe(),this.processors=[],this.isPipedProcessors=!1}}]),AgoraRteMediaTrackThread}(BO),_N=kS.attach({proxyMethods:!1})(nN=function(j){_inherits(AgoraRteCameraThread,j);var _e,_t=web_thread_createSuper(AgoraRteCameraThread);function AgoraRteCameraThread(){var j;_classCallCheck(this,AgoraRteCameraThread);for(var _e=arguments.length,St=new Array(_e),Tt=0;Tt<_e;Tt++)St[Tt]=arguments[Tt];return(j=_t.call.apply(_t,[this].concat(St))).canvas=void 0,j.trackState=RR.stopped,j.cameraEnable=!1,j._deviceId=void 0,j._deviceChanged=!1,j}return _createClass(AgoraRteCameraThread,[{key:"setCameraTrackState",value:function setCameraTrackState(j,_e){this.trackState!==j&&(this.trackState=j,this.emit($R.trackStateChanged,j,pR.Camera,_e))}},{key:"setDevice",value:function setDevice(j){this._deviceId=j,this._deviceChanged=!0}},{key:"onExecution",value:(_e=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee2(){var j=this;return web_thread_regeneratorRuntime().wrap((function _callee2$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(!this.cameraEnable){_e.next=35;break}if(!this._deviceChanged){_e.next=16;break}if(!this.track){_e.next=15;break}if(_e.prev=3,!this._deviceId){_e.next=9;break}return this.logger.info("setting camera device [".concat(this._deviceId,"] for local track...")),_e.next=8,this.track.setDevice(this._deviceId);case 8:this.logger.info("local camera track's device is set to [".concat(this._deviceId,"]"));case 9:_e.next=15;break;case 11:return _e.prev=11,_e.t0=_e.catch(3),ZE.shared.handleNonThrowableError(QE.RTC_ERR_CAM_ERR,_e.t0),_e.abrupt("break",42);case 15:this._deviceChanged=!1;case 16:if(this.track){_e.next=28;break}return this.logger.info("starting camera..."),this.setCameraTrackState(RR.starting),_e.prev=19,_e.delegateYield(web_thread_regeneratorRuntime().mark((function _callee(){var _e,_t,St,Tt;return web_thread_regeneratorRuntime().wrap((function _callee$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return _e=$E.shared.rtcConfigs,_t=_e.defaultCameraEncoderConfigurations,St=_t?{width:_t.width,height:_t.height,frameRate:_t.frameRate,bitrateMax:_t.bitrate}:void 0,j.logger.info("creating camera track..."),Ut.next=6,rD().createCameraVideoTrack({cameraId:j._deviceId,encoderConfig:St});case 6:j.track=Ut.sent,j.logger.info("camera track created"),(Tt=j.track).on("track-ended",(function(){j.logger.warn("camera track ended"),Tt.stop(),j.emit($R.localTrackBeforeDestroy,Tt),Tt.close(),j.track=void 0,j.isPipedProcessors=!1,j.setCameraTrackState(RR.stopped)})),j.setCameraTrackState(RR.started),j.logger.info("camera started");case 12:case"end":return Ut.stop()}}),_callee)}))(),"t1",21);case 21:_e.next=28;break;case 23:return _e.prev=23,_e.t2=_e.catch(19),ZE.shared.handleNonThrowableError(QE.RTC_ERR_CAM_ERR,_e.t2),this.setCameraTrackState(RR.error),_e.abrupt("break",42);case 28:if(this.track&&this.canvas&&this.canvas.view&&this.track.play(this.canvas.view),this.pipeProcessors(),!this.track||!(this.canvas&&this.canvas.view&&this.track.isPlaying)&&this.canvas&&this.canvas.view){_e.next=33;break}return this.logger.info("complete thread run"),_e.abrupt("break",42);case 33:_e.next=39;break;case 35:if(this.track&&(this.logger.info("stopping camera..."),this.track.stop(),this.emit($R.localTrackBeforeDestroy,this.track),this.track.close(),this.track=void 0,this.setCameraTrackState(RR.stopped),this.isPipedProcessors=!1,this.logger.info("camera stopped")),this.track){_e.next=39;break}return this.logger.info("complete thread run"),_e.abrupt("break",42);case 39:return _e.next=41,new Promise((function(j){return setTimeout(j,500)}));case 41:if(this.running){_e.next=0;break}case 42:case"end":return _e.stop()}}),_callee2,this,[[3,11],[19,23]])}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRteCameraThread}(AN))||nN,EN=kS.attach({proxyMethods:!1})(iN=function(j){_inherits(AgoraRteMicrophoneThread,j);var _e,_t,St=web_thread_createSuper(AgoraRteMicrophoneThread);function AgoraRteMicrophoneThread(j){var _e;return _classCallCheck(this,AgoraRteMicrophoneThread),(_e=St.call(this)).micEnable=!1,_e.trackState=RR.stopped,_e._recordingDeviceId=void 0,_e._recordingDeviceChanged=!1,_e._volumePollingTask=void 0,_e._rawDataDispatcher=void 0,_e._pcmTrack=void 0,_e._rawDataDispatcher=j,j.register("ObserverChanged",(function(){_e.preparePcmCallback()})),j.register("MicrophoneTrackCreated",(function(){_e.preparePcmCallback()})),j.register("MicrophoneTrackDestroyed",(function(){_e.stopAudioFrameCallback()})),j.register("Start",(function(){j.hasMicrophoneRawDataObservers&&_e.setAudioFrameCallback()})),j.register("Stop",(function(){_e.stopAudioFrameCallback()})),_e}return _createClass(AgoraRteMicrophoneThread,[{key:"setMicTrackState",value:function setMicTrackState(j,_e){var _t,St=this;this.trackState!==j&&(this.trackState=j,this.emit($R.trackStateChanged,j,vR.Mic,_e),j===RR.started?this._volumePollingTask||(this._volumePollingTask=fR.addPollingTask((function(){if(St.track){var j=St.track.getVolumeLevel();j=Math.min(3*j,1),St.emit($R.localAudioVolume,j)}}),cR.second(.5))):(null===(_t=this._volumePollingTask)||void 0===_t||_t.stop(),this._volumePollingTask=void 0))}},{key:"setRecordingDevice",value:function setRecordingDevice(j){this._recordingDeviceId=j,this._recordingDeviceChanged=!0}},{key:"preparePcmCallback",value:function preparePcmCallback(){this._rawDataDispatcher.hasMicrophoneRawDataObservers?this.setAudioFrameCallback():this.stopAudioFrameCallback()}},{key:"setAudioFrameCallback",value:(_t=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee3(){var j,_e,_t,St,Tt,Ut,_r=this;return web_thread_regeneratorRuntime().wrap((function _callee3$(_n){for(;;)switch(_n.prev=_n.next){case 0:if(this.track){_n.next=3;break}return this.logger.warn("Cannot set PCM callback as there's no microphone track subscribed"),_n.abrupt("return");case 3:j=this._rawDataDispatcher.microphoneTrackRawDataConfig,_e=j.sampleRate,_t=j.frameSize,St=j.stereo,this._pcmTrack||(Tt={stereo:St,sampleRate:_e},Ut=this.track.getMediaStreamTrack().clone(),this._pcmTrack=rD().createCustomAudioTrack({mediaStreamTrack:Ut,encoderConfig:Tt})),this.logger.info("attach PCM listener on microphone track"),this._pcmTrack.setAudioFrameCallback((function(j){_r._rawDataDispatcher.dispatch("AudioRawDataRecored",{buffer:j})}),_t);case 7:case"end":return _n.stop()}}),_callee3,this)}))),function setAudioFrameCallback(){return _t.apply(this,arguments)})},{key:"stopAudioFrameCallback",value:function stopAudioFrameCallback(){this._pcmTrack&&(this.logger.info("detach PCM listener"),this._pcmTrack.setAudioFrameCallback(null),this._pcmTrack.close()),this._pcmTrack=void 0}},{key:"onExecution",value:(_e=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee5(){var j=this;return web_thread_regeneratorRuntime().wrap((function _callee5$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(!this.micEnable){_e.next=35;break}if(!this._recordingDeviceChanged){_e.next=17;break}if(!this.track){_e.next=16;break}if(_e.prev=3,!this._recordingDeviceId){_e.next=9;break}return this.logger.info("setting microphone device [".concat(this._recordingDeviceId,"] for local track...")),_e.next=8,this.track.setDevice(this._recordingDeviceId);case 8:this.logger.info("local microphone track's device is set to [".concat(this._recordingDeviceId,"]"));case 9:_e.next=16;break;case 11:return _e.prev=11,_e.t0=_e.catch(3),ZE.shared.handleNonThrowableError(QE.RTC_ERR_MIC_ERR,_e.t0),this.setMicTrackState(RR.error),_e.abrupt("break",42);case 16:this._recordingDeviceChanged=!1;case 17:if(this.track){_e.next=29;break}return this.logger.info("starting mic..."),this.setMicTrackState(RR.starting),_e.prev=20,_e.delegateYield(web_thread_regeneratorRuntime().mark((function _callee4(){var _e,_t,St,Tt;return web_thread_regeneratorRuntime().wrap((function _callee4$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return _e=$E.shared.rtcConfigs,_t=_e.defaultMicrophoneEncoderConfigurations,St=_t?{sampleRate:_t.sampleRate,sampleSize:_t.sampleSize,stereo:_t.stereo,bitrate:_t.bitrate}:void 0,j.logger.info("creating microphone track..."),Ut.next=6,rD().createMicrophoneAudioTrack({microphoneId:j._recordingDeviceId,encoderConfig:St});case 6:Tt=Ut.sent,j.track=Tt,j.logger.info("microphone track created"),j.track.on("track-ended",(function(){j.logger.warn("mic track ended"),Tt.stop(),j.emit($R.localTrackBeforeDestroy,Tt),Tt.close(),j.track=void 0,j.isPipedProcessors=!1,j.setMicTrackState(RR.stopped)})),j.setMicTrackState(RR.started),j._rawDataDispatcher.dispatch("MicrophoneTrackCreated",Tt),j.logger.info("mic started");case 13:case"end":return Ut.stop()}}),_callee4)}))(),"t1",22);case 22:_e.next=29;break;case 24:return _e.prev=24,_e.t2=_e.catch(20),ZE.shared.handleNonThrowableError(QE.RTC_ERR_MIC_ERR,_e.t2),this.setMicTrackState(RR.error),_e.abrupt("break",42);case 29:if(this.pipeProcessors(),!this.track){_e.next=33;break}return this.logger.info("complete thread run"),_e.abrupt("break",42);case 33:_e.next=39;break;case 35:if(this.track&&(this.logger.info("stopping microphone..."),this.track.stop(),this.emit($R.localTrackBeforeDestroy,this.track),this.track.close(),this.track=void 0,this.isPipedProcessors=!1,this.setMicTrackState(RR.stopped),this._rawDataDispatcher.dispatch("MicrophoneTrackDestroyed"),this.logger.info("microphone stopped")),this.track){_e.next=39;break}return this.logger.info("complete thread run"),_e.abrupt("break",42);case 39:return _e.next=41,new Promise((function(j){return setTimeout(j,500)}));case 41:if(this.running){_e.next=0;break}case 42:case"end":return _e.stop()}}),_callee5,this,[[3,11],[20,24]])}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRteMicrophoneThread}(AN))||iN,SN=kS.attach({proxyMethods:!1})(oN=function(j){_inherits(AgoraRteScreenShareThread,j);var _e,_t=web_thread_createSuper(AgoraRteScreenShareThread);function AgoraRteScreenShareThread(){var j;_classCallCheck(this,AgoraRteScreenShareThread);for(var _e=arguments.length,St=new Array(_e),Tt=0;Tt<_e;Tt++)St[Tt]=arguments[Tt];return(j=_t.call.apply(_t,[this].concat(St))).canvas=void 0,j.audioTrack=void 0,j.withAudio=!1,j.screenEnable=!1,j.trackState=RR.stopped,j}return _createClass(AgoraRteScreenShareThread,[{key:"playing",get:function get(){return this.track&&this.track.isPlaying&&(!this.audioTrack||this.audioTrack&&this.audioTrack.isPlaying)}},{key:"setScreenShareTrackState",value:function setScreenShareTrackState(j,_e,_t){this.trackState!==j&&(this.trackState=j,this.emit($R.trackStateChanged,j,pR.ScreenShare,_t,_e))}},{key:"onExecution",value:(_e=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee7(){var j=this;return web_thread_regeneratorRuntime().wrap((function _callee7$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(!this.screenEnable){_e.next=22;break}if(this.track){_e.next=16;break}return this.logger.info("starting screenshare..."),this.setScreenShareTrackState(RR.starting),_e.prev=4,_e.delegateYield(web_thread_regeneratorRuntime().mark((function _callee6(){var _e,_t,St,Tt,Ut;return web_thread_regeneratorRuntime().wrap((function _callee6$(_r){for(;;)switch(_r.prev=_r.next){case 0:if(_e=$E.shared.rtcConfigs,_t=_e.defaultScreenEncoderConfigurations,St=_t?{width:_t.width,height:_t.height,frameRate:_t.frameRate,bitrateMax:_t.bitrate}:void 0,!j.withAudio){_r.next=12;break}return j.logger.info("creating screenshare track..."),_r.next=7,rD().createScreenVideoTrack({encoderConfig:St},"auto");case 7:Tt=_r.sent,j.logger.info("screenshare track created"),Tt instanceof Array?(j.track=Tt[0],j.audioTrack=Tt[1]):j.track=Tt,_r.next=17;break;case 12:return j.logger.info("creating screenshare track..."),_r.next=15,rD().createScreenVideoTrack({encoderConfig:St},"disable");case 15:j.track=_r.sent,j.logger.info("screenshare track created");case 17:Ut=j.track,j.track.on("track-ended",(function(){j.logger.warn("camera track ended"),Ut.stop(),j.emit($R.localTrackBeforeDestroy,Ut),Ut.close(),j.track=void 0,j.setScreenShareTrackState(RR.stopped)})),j.setScreenShareTrackState(RR.started,!!j.audioTrack);case 20:case"end":return _r.stop()}}),_callee6)}))(),"t0",6);case 6:_e.next=15;break;case 8:if(_e.prev=8,_e.t1=_e.catch(4),"PERMISSION_DENIED"!==_e.t1.code||/system/.test(_e.t1.message)){_e.next=12;break}return _e.abrupt("break",30);case 12:return this.setScreenShareTrackState(RR.error,void 0,"PERMISSION_DENIED"===_e.t1.code?CR.PermissionDenied:CR.Unknown),ZE.shared.handleNonThrowableError(QE.RTC_ERR_SCREEN_SHARE_ERR,_e.t1),_e.abrupt("break",30);case 15:this.logger.info("screenshare started");case 16:if(this.track&&this.canvas&&this.canvas.view&&this.track.play(this.canvas.view),!(!this.canvas||this.canvas&&this.playing)){_e.next=20;break}return this.logger.info("complete thread run"),_e.abrupt("break",30);case 20:_e.next=27;break;case 22:if(this.track&&(this.logger.info("stopping screenshare..."),this.track.stop(),this.emit($R.localTrackBeforeDestroy,this.track),this.track.close(),this.track=void 0,this.logger.info("screenshare stopped"),this.setScreenShareTrackState(RR.stopped)),this.audioTrack&&(this.logger.info("stopping screenshare audio..."),this.audioTrack.stop(),this.audioTrack.close(),this.audioTrack=void 0,this.logger.info("screenshare audio stopped")),this.track||this.audioTrack){_e.next=27;break}return this.logger.info("complete thread run"),_e.abrupt("break",30);case 27:return _e.next=29,new Promise((function(j){return setTimeout(j,500)}));case 29:if(this.running){_e.next=0;break}case 30:case"end":return _e.stop()}}),_callee7,this,[[4,8]])}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRteScreenShareThread}(AN))||oN,IN=kS.attach({proxyMethods:!1})((sN=function(j){_inherits(AgoraRtePublishThreadMain,j);var _e,_t,St,Tt,Ut,_r,_n=web_thread_createSuper(AgoraRtePublishThreadMain);function AgoraRtePublishThreadMain(j,_e){var _t;return _classCallCheck(this,AgoraRtePublishThreadMain),(_t=_n.call(this))._config=_e,_t._client=void 0,_t.muteLocalVideo=!0,_t.muteLocalAudio=!0,_t._localVideoTrackThread=void 0,_t._localAudioTrackThread=void 0,_t._metaTask=void 0,_t._client=j,_t}return _createClass(AgoraRtePublishThreadMain,[{key:"localVideoTrack",get:function get(){var j;return null===(j=this._localVideoTrackThread)||void 0===j?void 0:j.track}},{key:"localAudioTrack",get:function get(){var j;return null===(j=this._localAudioTrackThread)||void 0===j?void 0:j.track}},{key:"latencyLevel",get:function get(){return this._config.latencyLevel}},{key:"setTrackThread",value:function setTrackThread(j,_e){var _t,St;switch(j){case"audio":null===(_t=this._localAudioTrackThread)||void 0===_t||_t.off($R.trackStateChanged,this.handleTrackStateChanged),_e.off($R.localTrackBeforeDestroy,this.handleTrackDestroy),this._localAudioTrackThread=_e,_e.on($R.trackStateChanged,this.handleTrackStateChanged),_e.on($R.localTrackBeforeDestroy,this.handleTrackDestroy);break;case"video":null===(St=this._localVideoTrackThread)||void 0===St||St.off($R.trackStateChanged,this.handleTrackStateChanged),_e.off($R.localTrackBeforeDestroy,this.handleTrackDestroy),this._localVideoTrackThread=_e,_e.on($R.trackStateChanged,this.handleTrackStateChanged),_e.on($R.localTrackBeforeDestroy,this.handleTrackDestroy)}}},{key:"handleTrackStateChanged",value:function handleTrackStateChanged(j){j===RR.started&&this.run()}},{key:"handleTrackDestroy",value:(_r=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee8(j){return web_thread_regeneratorRuntime().wrap((function _callee8$(_e){for(;;)switch(_e.prev=_e.next){case 0:return this.logger.info("unpublishing..."),_e.prev=1,_e.next=4,this._client.unpublish(j);case 4:_e.next=9;break;case 6:_e.prev=6,_e.t0=_e.catch(1),ZE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_UNPUBLISH_FAIL,_e.t0);case 9:this.logger.info("unpublished.");case 10:case"end":return _e.stop()}}),_callee8,this,[[1,6]])}))),function handleTrackDestroy(j){return _r.apply(this,arguments)})},{key:"isTrackPublished",value:function isTrackPublished(j){return void 0!==this._client.localTracks.find((function(_e){return _e===j}))}},{key:"_emitMetadata",value:function _emitMetadata(){var j=this;this._metaTask||(this._metaTask=fR.addPollingTask(_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee9(){var _e,_t,St;return web_thread_regeneratorRuntime().wrap((function _callee9$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return _e=new Uint8Array([0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]),_t=(new TextEncoder).encode("".concat(JSON.stringify({uid:j._client.uid,ts:Date.now()}))),St=concat_concat([_e,_t]),Tt.next=5,j._client.sendMetadata(St);case 5:case"end":return Tt.stop()}}),_callee9)}))),500))}},{key:"_stopEmitMetadata",value:function _stopEmitMetadata(){this._metaTask&&(this._metaTask.stop(),this._metaTask=void 0)}},{key:"_setClientRole",value:(Ut=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee10(j){return web_thread_regeneratorRuntime().wrap((function _callee10$(_e){for(;;)switch(_e.prev=_e.next){case 0:if("live"!==this._config.mode){_e.next=10;break}if("host"!==j){_e.next=7;break}return this.logger.info("update rtc role to host"),_e.next=5,this._client.setClientRole(j);case 5:_e.next=10;break;case 7:return this.logger.info("update rtc role to audience, latency level: ".concat(this.latencyLevel)),_e.next=10,this._client.setClientRole(j,{level:this.latencyLevel});case 10:case"end":return _e.stop()}}),_callee10,this)}))),function _setClientRole(j){return Ut.apply(this,arguments)})},{key:"unpublishTracks",value:(Tt=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee11(j){return web_thread_regeneratorRuntime().wrap((function _callee11$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this._client.unpublish(j);case 2:case"end":return _e.stop()}}),_callee11,this)}))),function unpublishTracks(j){return Tt.apply(this,arguments)})},{key:"publishTracks",value:(St=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee12(j){return web_thread_regeneratorRuntime().wrap((function _callee12$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this._client.publish(j);case 2:case"end":return _e.stop()}}),_callee12,this)}))),function publishTracks(j){return St.apply(this,arguments)})},{key:"checkDuplicateTypeTracks",value:(_t=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee13(j){var _e;return web_thread_regeneratorRuntime().wrap((function _callee13$(_t){for(;;)switch(_t.prev=_t.next){case 0:if(!((_e=this._client.localTracks.filter((function(_e){return!!j.find((function(j){return _e.trackMediaType===j.trackMediaType}))}))).length>0)){_t.next=5;break}return this.logger.warn("unpublishing old [".concat(_e.map((function(j){return j.trackMediaType})).join(","),"] track...")),_t.next=5,this.unpublishTracks(_e);case 5:case"end":return _t.stop()}}),_callee13,this)}))),function checkDuplicateTypeTracks(j){return _t.apply(this,arguments)})},{key:"supportedEmitTsMetadata",value:function supportedEmitTsMetadata(j){var _e=this;return!!j.find((function(j){return"video"===j.trackMediaType&&"h264"===_e._config.codec}))}},{key:"checkAllTracksPublishState",value:function checkAllTracksPublishState(){var j=!this.localVideoTrack||(this.muteLocalVideo?!this.isTrackPublished(this.localVideoTrack):this.isTrackPublished(this.localVideoTrack)),_e=!this.localAudioTrack||(this.muteLocalAudio?!this.isTrackPublished(this.localAudioTrack):this.isTrackPublished(this.localAudioTrack));return j&&_e}},{key:"onExecution",value:(_e=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee14(){var j,_e;return web_thread_regeneratorRuntime().wrap((function _callee14$(_t){for(;;)switch(_t.prev=_t.next){case 0:case 1:if(this.muteLocalAudio&&this.muteLocalVideo){_t.next=20;break}return _t.next=4,this._setClientRole("host");case 4:if(j=[],this.muteLocalAudio||this.localAudioTrack&&!this.isTrackPublished(this.localAudioTrack)&&j.push(this.localAudioTrack),this.muteLocalVideo||this.localVideoTrack&&!this.isTrackPublished(this.localVideoTrack)&&j.push(this.localVideoTrack),!(j.length>0)){_t.next=20;break}return _t.next=10,this.checkDuplicateTypeTracks(j);case 10:return _t.prev=10,this.logger.info("publishing..."),_t.next=14,this.publishTracks(j);case 14:this.logger.info("published."),_t.next=20;break;case 17:_t.prev=17,_t.t0=_t.catch(10),ZE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_PUBLISH_FAIL,_t.t0);case 20:if(_e=[],!this.muteLocalAudio&&!this.muteLocalVideo){_t.next=35;break}if(this.muteLocalAudio&&this.localAudioTrack&&this.isTrackPublished(this.localAudioTrack)&&_e.push(this.localAudioTrack),this.muteLocalVideo&&this.localVideoTrack&&this.isTrackPublished(this.localVideoTrack)&&_e.push(this.localVideoTrack),!(_e.length>0)){_t.next=35;break}return this.logger.info("unpublishing..."),_t.prev=26,_t.next=29,this.unpublishTracks(_e);case 29:_t.next=35;break;case 31:return _t.prev=31,_t.t1=_t.catch(26),ZE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_UNPUBLISH_FAIL,_t.t1),_t.abrupt("break",46);case 35:if(!this.muteLocalAudio||!this.muteLocalVideo){_t.next=40;break}if(0!==this._client.localTracks.length){_t.next=40;break}return _t.next=39,this._setClientRole("audience");case 39:return _t.abrupt("break",46);case 40:if(!this.checkAllTracksPublishState()){_t.next=42;break}return _t.abrupt("break",46);case 42:return _t.next=44,new Promise((function(j){return setTimeout(j,500)}));case 44:case 45:if(this.running){_t.next=1;break}case 46:case"end":return _t.stop()}}),_callee14,this,[[10,17],[26,31]])}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRtePublishThreadMain}(BO),_applyDecoratedDescriptor(sN.prototype,"handleTrackStateChanged",[xS],Object.getOwnPropertyDescriptor(sN.prototype,"handleTrackStateChanged"),sN.prototype),_applyDecoratedDescriptor(sN.prototype,"handleTrackDestroy",[xS],Object.getOwnPropertyDescriptor(sN.prototype,"handleTrackDestroy"),sN.prototype),_applyDecoratedDescriptor(sN.prototype,"isTrackPublished",[xS],Object.getOwnPropertyDescriptor(sN.prototype,"isTrackPublished"),sN.prototype),aN=sN))||aN,TN=kS.attach({proxyMethods:!1})((lN=function(j){_inherits(AgoraRtePublishThreadSub,j);var _e,_t,St,Tt,Ut,_r,_n,_i=web_thread_createSuper(AgoraRtePublishThreadSub);function AgoraRtePublishThreadSub(j,_e){var _t;return _classCallCheck(this,AgoraRtePublishThreadSub),(_t=_i.call(this))._config=_e,_t._client=void 0,_t.mute=!0,_t._trackThread=void 0,_t._clientRole=void 0,_t._client=j,_t}return _createClass(AgoraRtePublishThreadSub,[{key:"videoTrack",get:function get(){var j;return null===(j=this._trackThread)||void 0===j?void 0:j.track}},{key:"audioTrack",get:function get(){var j;return null===(j=this._trackThread)||void 0===j?void 0:j.audioTrack}},{key:"latencyLevel",get:function get(){return this._config.latencyLevel}},{key:"setTrackThread",value:function setTrackThread(j){var _e;null===(_e=this._trackThread)||void 0===_e||_e.off($R.trackStateChanged,this.handleTrackStateChanged),j.off($R.localTrackBeforeDestroy,this.unpublish),this._trackThread=j,j.on($R.trackStateChanged,this.handleTrackStateChanged),j.on($R.localTrackBeforeDestroy,this.unpublish)}},{key:"handleTrackStateChanged",value:function handleTrackStateChanged(j){j===RR.started&&this.run()}},{key:"isTrackPublished",value:function isTrackPublished(j){return void 0!==this._client.localTracks.find((function(_e){return _e===j}))}},{key:"isTrackUnpublished",value:function isTrackUnpublished(j){return void 0===this._client.localTracks.find((function(_e){return _e===j}))}},{key:"unpublishTracks",value:(_n=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee15(j){return web_thread_regeneratorRuntime().wrap((function _callee15$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this._client.unpublish(j);case 2:case"end":return _e.stop()}}),_callee15,this)}))),function unpublishTracks(j){return _n.apply(this,arguments)})},{key:"checkDuplicateTypeTracks",value:(_r=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee16(j){var _e;return web_thread_regeneratorRuntime().wrap((function _callee16$(_t){for(;;)switch(_t.prev=_t.next){case 0:if(!((_e=this._client.localTracks.filter((function(_e){return!!j.find((function(j){return _e.trackMediaType===j.trackMediaType}))}))).length>0)){_t.next=5;break}return this.logger.warn("unpublishing old [".concat(_e.map((function(j){return j.trackMediaType})).join(","),"] track...")),_t.next=5,this.unpublishTracks(_e);case 5:case"end":return _t.stop()}}),_callee16,this)}))),function checkDuplicateTypeTracks(j){return _r.apply(this,arguments)})},{key:"_setClientRole",value:(Ut=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee17(j){return web_thread_regeneratorRuntime().wrap((function _callee17$(_e){for(;;)switch(_e.prev=_e.next){case 0:if("live"!==this._config.mode){_e.next=12;break}if("host"!==j){_e.next=8;break}return this.logger.info("update rtc role to host"),_e.next=5,this._client.setClientRole(j);case 5:this._clientRole="host",_e.next=12;break;case 8:return this.logger.info("update rtc role to audience, latency level: ".concat(this.latencyLevel)),_e.next=11,this._client.setClientRole(j,{level:this.latencyLevel});case 11:this._clientRole="audience";case 12:case"end":return _e.stop()}}),_callee17,this)}))),function _setClientRole(j){return Ut.apply(this,arguments)})},{key:"publishTracks",value:(Tt=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee18(j){return web_thread_regeneratorRuntime().wrap((function _callee18$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this._client.publish(j);case 2:case"end":return _e.stop()}}),_callee18,this)}))),function publishTracks(j){return Tt.apply(this,arguments)})},{key:"checkAllTracksPublishState",value:function checkAllTracksPublishState(){if(!this.videoTrack)return this.logger.error("screen share video track dose not found"),!0;var j=[this.videoTrack];return this.audioTrack&&j.push(this.audioTrack),this.mute?j.every(this.isTrackUnpublished):j.every(this.isTrackPublished)}},{key:"unpublish",value:(St=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee19(){var j;return web_thread_regeneratorRuntime().wrap((function _callee19$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(j=[],this.videoTrack&&this.isTrackPublished(this.videoTrack)&&j.push(this.videoTrack),this.audioTrack&&this.isTrackPublished(this.audioTrack)&&j.push(this.audioTrack),!(j.length>0)){_e.next=7;break}return this.logger.info("unpublishing..."),_e.next=7,this.unpublishTracks(j);case 7:case"end":return _e.stop()}}),_callee19,this)}))),function unpublish(){return St.apply(this,arguments)})},{key:"publish",value:(_t=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee20(){var j;return web_thread_regeneratorRuntime().wrap((function _callee20$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this._setClientRole("host");case 2:if(j=[],this.videoTrack&&this.isTrackUnpublished(this.videoTrack)&&j.push(this.videoTrack),this.audioTrack&&this.isTrackUnpublished(this.audioTrack)&&j.push(this.audioTrack),!(j.length>0)){_e.next=12;break}return _e.next=8,this.checkDuplicateTypeTracks(j);case 8:return this.logger.info("publishing..."),_e.next=11,this.publishTracks(j);case 11:this.logger.info("published.");case 12:case"end":return _e.stop()}}),_callee20,this)}))),function publish(){return _t.apply(this,arguments)})},{key:"onExecution",value:(_e=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee21(){return web_thread_regeneratorRuntime().wrap((function _callee21$(j){for(;;)switch(j.prev=j.next){case 0:case 1:if(this.mute){j.next=10;break}return j.prev=2,j.next=5,this.publish();case 5:j.next=10;break;case 7:j.prev=7,j.t0=j.catch(2),ZE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_PUBLISH_FAIL,j.t0);case 10:if(!this.mute){j.next=24;break}return j.prev=11,j.next=14,this.unpublish();case 14:if(0!==this._client.localTracks.length){j.next=18;break}return j.next=17,this._setClientRole("audience");case 17:return j.abrupt("break",30);case 18:j.next=24;break;case 20:return j.prev=20,j.t1=j.catch(11),ZE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_UNPUBLISH_FAIL,j.t1),j.abrupt("break",30);case 24:if(!this.checkAllTracksPublishState()){j.next=26;break}return j.abrupt("break",30);case 26:return j.next=28,new Promise((function(j){return setTimeout(j,500)}));case 28:case 29:if(this.running){j.next=1;break}case 30:case"end":return j.stop()}}),_callee21,this,[[2,7],[11,20]])}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRtePublishThreadSub}(BO),_applyDecoratedDescriptor(lN.prototype,"handleTrackStateChanged",[xS],Object.getOwnPropertyDescriptor(lN.prototype,"handleTrackStateChanged"),lN.prototype),_applyDecoratedDescriptor(lN.prototype,"isTrackPublished",[xS],Object.getOwnPropertyDescriptor(lN.prototype,"isTrackPublished"),lN.prototype),_applyDecoratedDescriptor(lN.prototype,"isTrackUnpublished",[xS],Object.getOwnPropertyDescriptor(lN.prototype,"isTrackUnpublished"),lN.prototype),_applyDecoratedDescriptor(lN.prototype,"unpublish",[xS],Object.getOwnPropertyDescriptor(lN.prototype,"unpublish"),lN.prototype),cN=lN))||cN,CN=kS.attach({proxyMethods:!1})(dN=function(j){_inherits(AgoraRteSubscribeThread,j);var _e,_t,St=web_thread_createSuper(AgoraRteSubscribeThread);function AgoraRteSubscribeThread(j,_e,_t,Tt){var Ut,_r=_t.channelName,_n=_t.muteMap,_i=_t.canvasMap,Ei=_t.mediaType;return _classCallCheck(this,AgoraRteSubscribeThread),(Ut=St.call(this))._client=void 0,Ut._user=void 0,Ut._channelName=void 0,Ut._muteMap=void 0,Ut._canvasMap=void 0,Ut._mediaType=void 0,Ut._volumePollingTask=void 0,Ut._prevCanvasView=void 0,Ut._prevRenderMode=void 0,Ut._pcmTrack=void 0,Ut._rawDataDispatcher=void 0,Ut._client=j,Ut._user=_e,Ut._muteMap=_n,Ut._mediaType=Ei,Ut._canvasMap=_i,Ut._channelName=_r,Ut._rawDataDispatcher=Tt,"audio"===Ut._mediaType&&(Tt.register("ObserverChanged",(function(){Ut.preparePcmCallback()})),Tt.register("AudioTrackSubscribed",(function(j,_e){_e===Ut.streamUuid&&Ut.preparePcmCallback()})),Tt.register("AudioTrackUnsubscribed",(function(j){j===Ut.streamUuid&&Ut.stopAudioFrameCallback()})),Tt.register("Start",(function(){Ut._rawDataDispatcher.hasAudioTrackRawDataObservers&&Ut.setAudioFrameCallback()})),Tt.register("Stop",(function(){Ut.stopAudioFrameCallback()}))),Ut}return _createClass(AgoraRteSubscribeThread,[{key:"mute",get:function get(){return!this._muteMap.has(this.streamUuid)||this._muteMap.get(this.streamUuid)}},{key:"streamUuid",get:function get(){return"".concat(this._user.uid)}},{key:"canvas",get:function get(){if("audio"!==this._mediaType&&this._canvasMap){var j=uD.key(this.streamUuid,this._channelName);return this._canvasMap.get(j)}}},{key:"isTrackSubscribed",value:function isTrackSubscribed(){return"video"===this._mediaType?!!this._user.videoTrack:!!this._user.audioTrack}},{key:"track",get:function get(){return"video"===this._mediaType?this._user.videoTrack:this._user.audioTrack}},{key:"play",value:function play(){if(this.track&&this.canvas&&this.canvas.view){if(this.canvas.view===this._prevCanvasView&&this.canvas.renderMode===this._prevRenderMode)return;this._prevCanvasView=this.canvas.view,this._prevRenderMode=this.canvas.renderMode,this.track.play(this.canvas.view,{fit:this.canvas.renderMode===xR.fill?"cover":"contain"})}}},{key:"preparePcmCallback",value:function preparePcmCallback(){this._rawDataDispatcher.hasAudioTrackRawDataObservers?this.setAudioFrameCallback():this.stopAudioFrameCallback()}},{key:"setAudioFrameCallback",value:(_t=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee22(){var j,_e,_t,St,Tt,Ut,_r=this;return web_thread_regeneratorRuntime().wrap((function _callee22$(_n){for(;;)switch(_n.prev=_n.next){case 0:if(this.track){_n.next=3;break}return this.logger.warn("Cannot set PCM callback as there's no remote audio track subscribed"),_n.abrupt("return");case 3:j=this._rawDataDispatcher.audioTrackRawDataConfig,_e=j.sampleRate,_t=j.frameSize,St=j.stereo,this._pcmTrack||(Tt=this.track.getMediaStreamTrack().clone(),Ut={stereo:St,sampleRate:_e},this._pcmTrack=rD().createCustomAudioTrack({mediaStreamTrack:Tt,encoderConfig:Ut})),this.logger.info("attach PCM listener on remote audio track:",this._channelName,this.streamUuid),this._pcmTrack.setAudioFrameCallback((function(j){_r._rawDataDispatcher.dispatch("AudioRawDataBeforeMixed",{buffer:j},_r.streamUuid,_r._channelName)}),_t);case 7:case"end":return _n.stop()}}),_callee22,this)}))),function setAudioFrameCallback(){return _t.apply(this,arguments)})},{key:"stopAudioFrameCallback",value:function stopAudioFrameCallback(){this._pcmTrack&&(this.logger.info("detach PCM listener on remote audio track:",this._channelName,this.streamUuid),this._pcmTrack.setAudioFrameCallback(null),this._pcmTrack.close()),this._pcmTrack=void 0}},{key:"onExecution",value:(_e=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee23(){var j,_e,_t=this;return web_thread_regeneratorRuntime().wrap((function _callee23$(St){for(;;)switch(St.prev=St.next){case 0:j=0;case 1:if(this.mute){St.next=20;break}if(this.isTrackSubscribed()){St.next=15;break}return this.logger.info("[".concat(this._user.uid,"] subscribing ").concat(this._mediaType,"...")),St.prev=4,St.next=7,this._client.subscribe(this._user,this._mediaType);case 7:_e=St.sent,"audio"===this._mediaType&&this._rawDataDispatcher.dispatch("AudioTrackSubscribed",_e,this.streamUuid,this._channelName),St.next=14;break;case 11:St.prev=11,St.t0=St.catch(4),ZE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_SUBSCRIBE_FAIL,St.t0);case 14:this.logger.info("[".concat(this._user.uid,"] subscribed."));case 15:if("video"===this._mediaType?this.play():this.track&&(this._volumePollingTask||(this._volumePollingTask=fR.addPollingTask((function(){var j=_t.track.getVolumeLevel();j=Math.min(3*j,1),_t.emit("audio-volume-indication",j)}),cR.second(.5))),this.track.play()),!this.isTrackSubscribed()){St.next=18;break}return St.abrupt("break",41);case 18:St.next=36;break;case 20:if(!this.isTrackSubscribed()){St.next=33;break}return this.logger.info("[".concat(this._user.uid,"] unpublishing...")),St.prev=22,St.next=25,this._client.unsubscribe(this._user,this._mediaType);case 25:"audio"===this._mediaType&&this._rawDataDispatcher.dispatch("AudioTrackUnsubscribed",this.streamUuid,this._channelName),St.next=32;break;case 28:return St.prev=28,St.t1=St.catch(22),ZE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_UNSUBSCRIBE_FAIL,St.t1),St.abrupt("break",41);case 32:this.logger.info("[".concat(this._user.uid,"] unpublished."));case 33:if(this.track&&(this.logger.info("[".concat(this._user.uid,"] stopping track...")),this.track.stop(),this._volumePollingTask&&this._volumePollingTask.stop(),this.logger.info("[".concat(this._user.uid,"] track stopped"))),this.isTrackSubscribed()){St.next=36;break}return St.abrupt("break",41);case 36:return St.next=38,new Promise((function(j){return setTimeout(j,500)}));case 38:++j%10==0&&this.logger.info("thread running...");case 40:if(this.running){St.next=1;break}case 41:case"end":return St.stop()}}),_callee23,this,[[4,11],[22,28]])}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRteSubscribeThread}(BO))||dN,kN=(__webpack_require__(2479),__webpack_require__(5306),kS.attach({proxyMethods:!1})(pN=function(){function RtcNetworkQualityWeb(){_classCallCheck(this,RtcNetworkQualityWeb),this.logger=void 0,this.rtt=void 0,this.downlinkNetworkQuality=0,this.uplinkNetworkQuality=0,this.end2EndDelay=0,this.txVideoPacketLoss=0,this.rxVideoPacketLoss=0,this._downlinkNetworkQualityClacInstance=new LO,this._uplinkNetworkQualityClacInstance=new LO}return _createClass(RtcNetworkQualityWeb,[{key:"networkStats",value:function networkStats(){var networkStats={packetLoss:Math.max(this.txVideoPacketLoss,this.rxVideoPacketLoss),cpu:-1,delay:this.end2EndDelay,downlinkNetworkQuality:this._downlinkNetworkQualityClacInstance.toAGQuality(this.downlinkNetworkQuality),uplinkNetworkQuality:this._uplinkNetworkQualityClacInstance.toAGQuality(this.downlinkNetworkQuality)};return networkStats}}]),RtcNetworkQualityWeb}())||pN);function client_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */client_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function client_createSuper(j){var _e=function client_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var xN=kS.attach({proxyMethods:!1})(vN=function(j){_inherits(AgoraRteWebClientBase,j);var _e,_t,St=client_createSuper(AgoraRteWebClientBase);function AgoraRteWebClientBase(j,_e,_t,Tt,Ut){var _r,_n;_classCallCheck(this,AgoraRteWebClientBase),(_n=St.call(this)).logger=void 0,_n._client=void 0,_n._base=void 0,_n.configs=void 0,_n.channelName=void 0,_n.connectionType=void 0,_n._audioRawDataDispatcher=void 0,_n._connectionState=kR.Idle,_n._networkStats=new kN,_n._recentLocalPacketStats=[],_n._recentRemotePacketStats=[],_n.channelName=j,_n.configs=_e,_n._base=_t,_n.connectionType=Tt,_n._audioRawDataDispatcher=Ut,rD().setArea({areaCode:[_n._rtcRegion()]}),$E.shared.rtcSDKParameters&&$E.shared.rtcSDKParameters.forEach((function(j){_n._setPrivateParameter(j)})),_n._client=rD().createClient({codec:_n.configs.codec,mode:_n.configs.mode});var _i=null!==(_r=$E.shared.rtcConfigs.defaultRemoteVideoStreamType)&&void 0!==_r?_r:$O.RemoteStreamType.HIGH_STREAM;_n._client.setRemoteDefaultVideoStreamType(_i);var Ei=$E.shared.rtcConfigs.encryption;return Ei&&_n._client.setEncryptionConfig(_n._getEncryptionMode(Ei.mode),Ei.key),_n._client.on("connection-state-change",(function(j){_n.setConnectionState(_n._getRtcState(j))})),_n._client.on("network-quality",(function(j){_n._networkStats.uplinkNetworkQuality=j.uplinkNetworkQuality,_n._networkStats.downlinkNetworkQuality=j.downlinkNetworkQuality;var _e=_n._client.getLocalVideoStats(),_t=_n._client.getRemoteVideoStats(),St=_n._client.getRTCStats();_n._networkStats.rtt=St.RTT;var Tt={lossPackets:_e.sendPacketsLost,totalPackets:_e.sendPackets};_n._recentLocalPacketStats.unshift(Tt),_n._recentLocalPacketStats=_n._recentLocalPacketStats.slice(0,10);for(var Ut=0,_r=0,_i=0,Ei=Object.values(_t),Ci=0,Di=Ei;Ci<Di.length;Ci++){var Fi=Di[Ci];Ut+=Fi.receivePacketsLost,_r+=Fi.receivePackets,_i+=Fi.end2EndDelay}var _o={lossPackets:Ut,totalPackets:_r};_n._recentRemotePacketStats.unshift(_o),_n._recentRemotePacketStats=_n._recentRemotePacketStats.slice(0,10),Ei.length>0&&(_n._networkStats.end2EndDelay=0===Ei.length?0:_i/Ei.length);var ga=_n._getRecentPacketLoss(),_a=ga.rx,_s=ga.tx;_n._networkStats.rxVideoPacketLoss=_a,_n._networkStats.txVideoPacketLoss=_s,_n.emit("network-stats-changed",_n._networkStats.networkStats(),_n.connectionType)})),_n}return _createClass(AgoraRteWebClientBase,[{key:"base",get:function get(){return this._base}},{key:"_setPrivateParameter",value:function _setPrivateParameter(j){Object.keys(j).forEach((function(_e){var _t=j[_e];_e=_e.replace("rtc.","").toUpperCase(),"string"!=typeof _t&&(_t=JSON.stringify(_t)),rD().setParameter(_e,_t)}))}},{key:"_getRecentPacketLoss",value:function _getRecentPacketLoss(){var j=this._recentLocalPacketStats[0],_e=this._recentLocalPacketStats[this._recentLocalPacketStats.length-1],_t=j.lossPackets-_e.lossPackets,St=j.totalPackets-_e.totalPackets,Tt=this._recentRemotePacketStats[0],Ut=this._recentRemotePacketStats[this._recentRemotePacketStats.length-1],_r=Tt.lossPackets-Ut.lossPackets,_n=Tt.totalPackets-Ut.totalPackets;return{rx:Math.abs(St>0?_t/St:0),tx:Math.abs(_n>0?_r/_n:0)}}},{key:"ready",get:function get(){return this._connectionState===kR.Connected}},{key:"setConnectionState",value:function setConnectionState(j){this._connectionState=j,this.emit("rtc-connection-state-changed",j,this.connectionType)}},{key:"getClientSessionId",value:function getClientSessionId(){return this._client._sessionId}},{key:"join",value:(_t=_asyncToGenerator(client_regeneratorRuntime().mark((function _callee(j,_e,_t){return client_regeneratorRuntime().wrap((function _callee$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,this._client.join(j,this.channelName,_e,+_t);case 2:case"end":return St.stop()}}),_callee,this)}))),function join(j,_e,St){return _t.apply(this,arguments)})},{key:"leave",value:(_e=_asyncToGenerator(client_regeneratorRuntime().mark((function _callee2(){var j,_e,_t;return client_regeneratorRuntime().wrap((function _callee2$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,GR(this._client.leave());case 2:j=St.sent,_e=_slicedToArray(j,1),(_t=_e[0])&&ZE.shared.handleNonThrowableError(QE.RTC_ERR_CLIENT_LEAVE_CHANNEL_FAIL,_t);case 6:case"end":return St.stop()}}),_callee2,this)}))),function leave(){return _e.apply(this,arguments)})},{key:"setLatencyLevel",value:function setLatencyLevel(j){this.logger.info("set client role to audience and audience level to",j),this._client.setClientRole("audience",{level:j})}},{key:"_rtcRegion",value:function _rtcRegion(){switch($E.shared.rtcRegion){case HE.AREA_GLOBAL:return"GLOBAL";case HE.AREA_CN:return"CHINA";case HE.AREA_AS:return"ASIA";case HE.AREA_EUR:return"EUROPE";case HE.AREA_NA:return"NORTH_AMERICA";case HE.AREA_JAPAN:return"JAPAN";case HE.AREA_INDIA:return"INDIA"}}},{key:"_getRtcState",value:function _getRtcState(j){switch(j){case"CONNECTED":return kR.Connected;case"CONNECTING":return kR.Connecting;case"DISCONNECTING":case"DISCONNECTED":return kR.Idle;case"RECONNECTING":return kR.Reconnecting}}},{key:"_getEncryptionMode",value:function _getEncryptionMode(j){switch(j){case OR.AES_128_ECB:return"aes-128-ecb";case OR.AES_128_GCM:return"aes-128-gcm";case OR.AES_128_XTS:return"aes-128-xts";case OR.AES_256_XTS:return"aes-256-xts";case OR.AES_256_GCM:return"aes-256-gcm";case OR.AES_256_XTS:return"aes-256-xts"}return"none"}}]),AgoraRteWebClientBase}(_a))||vN,LN=(yN=function(j){_inherits(AgoraRteWebClientMain,j);var _e,_t,St=client_createSuper(AgoraRteWebClientMain);function AgoraRteWebClientMain(j,_e,_t,Tt,Ut){var _r;_classCallCheck(this,AgoraRteWebClientMain),(_r=St.call(this,j,_e,_t,Tt,Ut))._remoteRtcUsers=new Map,_r._muteRemoteVideo=new Map,_r._muteRemoteAudio=new Map,_r._audioVolumes=new Map,_r._publishThread=void 0,_r._subscribeVideoThreads=new Map,_r._subscribeAudioThreads=new Map,_r._publishThread=new IN(_r._client,_e),_r._publishThread.runnable=!1;var _n=(0,lS.throttle)(_r._notifyStreamVolumes,500);return _r._client.on("user-published",(function(j,_e){var _t="".concat(j.uid);if(_r._remoteRtcUsers.set(_t,j),"video"===_e){var St=new CN(_r._client,j,{channelName:_r.channelName,muteMap:_r._muteRemoteVideo,mediaType:"video",canvasMap:_r.base.remoteCanvas},Ut);_r._subscribeVideoThreads.set(_t,St),St.runnable=_r.ready}else{var Tt=new CN(_r._client,j,{channelName:_r.channelName,muteMap:_r._muteRemoteAudio,mediaType:"audio"},Ut);Tt.on("audio-volume-indication",(function(j){_r._audioVolumes.set(_t,j),_n()})),_r._subscribeAudioThreads.set(_t,Tt),Tt.runnable=_r.ready}_r._notifySubscribeThreads(_t,_e)})),_r._client.on("user-unpublished",(function(_e){if(!_e.hasAudio&&!_e.hasVideo){var _t="".concat(_e.uid);_r._remoteRtcUsers.delete(_t);var St=_r._subscribeVideoThreads.get(_t),Tt=_r._subscribeAudioThreads.get(_t);St&&(St.stop(),_r._subscribeVideoThreads.delete(_t)),Tt&&(Ut.dispatch("AudioTrackUnsubscribed",Tt.streamUuid,j),Tt.stop(),_r._audioVolumes.delete(_t),_r._subscribeAudioThreads.delete(_t))}})),_r._client.on("user-left",(function(_e){var _t="".concat(_e.uid);_r._remoteRtcUsers.delete(_t);var St=_r._subscribeVideoThreads.get(_t),Tt=_r._subscribeAudioThreads.get(_t);St&&(St.stop(),_r._subscribeVideoThreads.delete(_t)),Tt&&(Ut.dispatch("AudioTrackUnsubscribed",_t,j),Tt.stop(),_r._audioVolumes.delete(_t),_r._subscribeAudioThreads.delete(_t))})),_r}return _createClass(AgoraRteWebClientMain,[{key:"videoSubscribeThread",value:function videoSubscribeThread(j){return this._subscribeVideoThreads.get(j)}},{key:"remoteRtcUsers",get:function get(){return this._remoteRtcUsers}},{key:"_notifyStreamVolumes",value:function _notifyStreamVolumes(){this.emit("audio-volume-indication",this._audioVolumes)}},{key:"_notifySubscribeThreads",value:function _notifySubscribeThreads(j,_e){var _t="video"===_e?this._subscribeVideoThreads.get(j):this._subscribeAudioThreads.get(j);_t&&_t.run()}},{key:"setConnectionState",value:function setConnectionState(j){j===kR.Connected&&(this._publishThread.runnable=!0,this._publishThread.run(),this._subscribeVideoThreads.forEach((function(j){j.runnable=!0,j.run()})),this._subscribeAudioThreads.forEach((function(j){j.runnable=!0,j.run()}))),j===kR.Idle&&(this._publishThread.runnable=!1,this._subscribeVideoThreads.forEach((function(j){j.runnable=!1})),this._subscribeAudioThreads.forEach((function(j){j.runnable=!1,j.run()}))),_get(_getPrototypeOf(AgoraRteWebClientMain.prototype),"setConnectionState",this).call(this,j)}},{key:"muteLocalVideo",value:function muteLocalVideo(j){return this.logger.info("muteLocalVideo ".concat(j)),this.base.cameraThread?(this._publishThread.muteLocalVideo=j,this._publishThread.setTrackThread("video",this.base.cameraThread),this._publishThread.run(),0):-1}},{key:"muteLocalAudio",value:function muteLocalAudio(j){return this.logger.info("muteLocalAudio ".concat(j)),this.base.micThread?(this._publishThread.muteLocalAudio=j,this._publishThread.setTrackThread("audio",this.base.micThread),this._publishThread.run(),0):-1}},{key:"muteLocalScreenShare",value:function muteLocalScreenShare(j){return this.logger.warn("muteLocalScreenShare dose not supported in main client, please use sub client"),-1}},{key:"muteRemoteVideo",value:function muteRemoteVideo(j,_e){return this.logger.info("muteRemoteVideo ".concat(j," ").concat(_e)),this._muteRemoteVideo.set(j,_e),this._notifySubscribeThreads(j,"video"),0}},{key:"muteRemoteAudio",value:function muteRemoteAudio(j,_e){return this.logger.info("muteRemoteAudio ".concat(j," ").concat(_e)),this._muteRemoteAudio.set(j,_e),this._notifySubscribeThreads(j,"audio"),0}},{key:"muteRemoteVideoMass",value:(_t=_asyncToGenerator(client_regeneratorRuntime().mark((function _callee3(j,_e){var _t,St,Tt=this;return client_regeneratorRuntime().wrap((function _callee3$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(this.logger.info("muteRemoteVideoMass ".concat(_e)),_t=j.map((function(j){return Tt.remoteRtcUsers.get(j)})).filter((function(j){return!!j})).map((function(j){return{user:j,mediaType:"video"}})),!_e){Ut.next=9;break}return Ut.next=5,this._client.massUnsubscribe(_t);case 5:return j.forEach((function(j){Tt._muteRemoteVideo.set(j,_e)})),Ut.abrupt("return",j);case 9:return Ut.next=11,this._client.massSubscribe(_t);case 11:return(St=Ut.sent.map((function(j){var _e=j.user;return"".concat(_e.uid)}))).forEach((function(j){Tt._muteRemoteVideo.set(j,_e)})),Ut.abrupt("return",St);case 14:case"end":return Ut.stop()}}),_callee3,this)}))),function muteRemoteVideoMass(j,_e){return _t.apply(this,arguments)})},{key:"enableDualStream",value:function enableDualStream(j){return j?this._client.enableDualStream():this._client.disableDualStream()}},{key:"setLowStreamParameter",value:function setLowStreamParameter(j){return this._client.setLowStreamParameter({width:j.width,height:j.height,framerate:j.frameRate,bitrate:j.bitrate}),0}},{key:"setRemoteVideoStreamType",value:function setRemoteVideoStreamType(j,_e){return this._client.setRemoteVideoStreamType(+j,_e)}},{key:"leave",value:(_e=_asyncToGenerator(client_regeneratorRuntime().mark((function _callee4(){var j=this;return client_regeneratorRuntime().wrap((function _callee4$(_e){for(;;)switch(_e.prev=_e.next){case 0:return this._publishThread.stop(),_e.next=3,_get(_getPrototypeOf(AgoraRteWebClientMain.prototype),"leave",this).call(this);case 3:this._remoteRtcUsers.clear(),this._subscribeVideoThreads.forEach((function(j){j.stop()})),this._subscribeVideoThreads.clear(),this._subscribeAudioThreads.forEach((function(_e){j._audioRawDataDispatcher.dispatch("AudioTrackUnsubscribed",_e.streamUuid,j.channelName),_e.stop()})),this._subscribeAudioThreads.clear(),this._remoteRtcUsers.clear();case 9:case"end":return _e.stop()}}),_callee4,this)}))),function leave(){return _e.apply(this,arguments)})}]),AgoraRteWebClientMain}(xN),_applyDecoratedDescriptor(yN.prototype,"_notifyStreamVolumes",[xS],Object.getOwnPropertyDescriptor(yN.prototype,"_notifyStreamVolumes"),yN.prototype),yN),NN=function(j){_inherits(AgoraRteWebClientSub,j);var _e,_t=client_createSuper(AgoraRteWebClientSub);function AgoraRteWebClientSub(j,_e,St,Tt,Ut){var _r;return _classCallCheck(this,AgoraRteWebClientSub),(_r=_t.call(this,j,_e,St,Tt,Ut))._publishThread=void 0,_r._publishThread=new TN(_r._client,_e),_r._publishThread.runnable=!1,_r}return _createClass(AgoraRteWebClientSub,[{key:"muteLocalVideo",value:function muteLocalVideo(j){return this.logger.warn("muteLocalVideo dose not supported in sub client, please use main client"),-1}},{key:"muteLocalAudio",value:function muteLocalAudio(j){return this.logger.warn("muteLocalAudio dose not supported in sub client, please use main client"),-1}},{key:"muteLocalScreenShare",value:function muteLocalScreenShare(j){return this.logger.info("muteLocalScreenShare ".concat(j)),this.base.screenThread?(this._publishThread.mute=j,this._publishThread.setTrackThread(this.base.screenThread),this._publishThread.run(),0):-1}},{key:"setLowStreamParameter",value:function setLowStreamParameter(j){return this._client.setLowStreamParameter({width:j.width,height:j.height,framerate:j.frameRate,bitrate:j.bitrate}),0}},{key:"setRemoteVideoStreamType",value:function setRemoteVideoStreamType(j,_e){return this._client.setRemoteVideoStreamType(+j,_e)}},{key:"enableDualStream",value:function enableDualStream(j){return j?this._client.enableDualStream():this._client.disableDualStream()}},{key:"setConnectionState",value:function setConnectionState(j){j===kR.Connected&&(this._publishThread.runnable=!0,this._publishThread.run()),j===kR.Idle&&(this._publishThread.runnable=!1),_get(_getPrototypeOf(AgoraRteWebClientSub.prototype),"setConnectionState",this).call(this,j)}},{key:"leave",value:(_e=_asyncToGenerator(client_regeneratorRuntime().mark((function _callee5(){return client_regeneratorRuntime().wrap((function _callee5$(j){for(;;)switch(j.prev=j.next){case 0:return this._publishThread.stop(),j.next=3,_get(_getPrototypeOf(AgoraRteWebClientSub.prototype),"leave",this).call(this);case 3:case"end":return j.stop()}}),_callee5,this)}))),function leave(){return _e.apply(this,arguments)})}]),AgoraRteWebClientSub}(xN);function device_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */device_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function web_device_createSuper(j){var _e=function web_device_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var PN=function(j){_inherits(RtcVideoDeviceManagerWeb,j);var _e,_t=web_device_createSuper(RtcVideoDeviceManagerWeb);function RtcVideoDeviceManagerWeb(j,_e){var St;return _classCallCheck(this,RtcVideoDeviceManagerWeb),(St=_t.call(this)).adapter=j,St._deviceInfo=new Map,St._deviceIds=new Set,St._initializeDeviceList(_e),St}return _createClass(RtcVideoDeviceManagerWeb,[{key:"onLocalVideoTrackStateChanged",value:function onLocalVideoTrackStateChanged(j){return this.adapter.onLocalVideoTrackStateChanged(j),0}},{key:"onLocalCameraListChanged",value:function onLocalCameraListChanged(j){return this.on($R.cameraListChanged,j),0}},{key:"getVideoCameraDevices",value:function getVideoCameraDevices(){return this.cameraList}},{key:"cameraList",get:function get(){var j=this,_e=[];return this._deviceIds.forEach((function(_t){var St=j._deviceInfo.get(_t);St&&_e.push({deviceid:St.deviceid,devicename:St.devicename})})),_e}},{key:"_emitCameraListChanged",value:function _emitCameraListChanged(j,_e,_t){this.emit($R.cameraListChanged,j,_e,_t)}},{key:"_initializeDeviceList",value:(_e=_asyncToGenerator(device_regeneratorRuntime().mark((function _callee(j){var _e,_t,St,Tt,Ut,_r=this;return device_regeneratorRuntime().wrap((function _callee$(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.next=2,GR(rD().getCameras(j));case 2:_e=_n.sent,_t=_slicedToArray(_e,2),St=_t[0],Tt=_t[1],St&&ZE.shared.handleThrowableError(QE.RTC_ERR_VDM_GET_DEVICES_FAIL,St),Tt&&(Ut=[],Tt.forEach((function(j){if("default"!==j.deviceId){var _e={deviceid:j.deviceId,devicename:j.label};_r._deviceInfo.set(j.deviceId,_e),_r._deviceIds.add(j.deviceId),Ut.push(_e)}})),this._emitCameraListChanged(!0,Ut,this.cameraList)),rD().onCameraChanged=function(j){var _e={deviceid:j.device.deviceId,devicename:j.device.label};"ACTIVE"===j.state?(_r._deviceInfo.set(j.device.deviceId,_e),_r._deviceIds.add(j.device.deviceId),_r._emitCameraListChanged(!0,[_e],_r.cameraList)):"INACTIVE"===j.state&&(_r._deviceInfo.delete(j.device.deviceId),_r._deviceIds.delete(j.device.deviceId),_r._emitCameraListChanged(!1,[_e],_r.cameraList))};case 9:case"end":return _n.stop()}}),_callee,this)}))),function _initializeDeviceList(j){return _e.apply(this,arguments)})}]),RtcVideoDeviceManagerWeb}(rO),MN=function(j){_inherits(RtcAudioDeviceManagerWeb,j);var _e,_t,St=web_device_createSuper(RtcAudioDeviceManagerWeb);function RtcAudioDeviceManagerWeb(j,_e){var _t;return _classCallCheck(this,RtcAudioDeviceManagerWeb),(_t=St.call(this)).adapter=j,_t._recordingDeviceInfo=new Map,_t._recordingDeviceIds=new Set,_t._playbackDeviceInfo=new Map,_t._playbackDeviceIds=new Set,_t._initializeDeviceList(_e),_t._initializePlaybackDeviceList(_e),_t}return _createClass(RtcAudioDeviceManagerWeb,[{key:"onLocalAudioPlaybackTestVolumeChanged",value:function onLocalAudioPlaybackTestVolumeChanged(j){return this.adapter.onLocalAudioPlaybackTestVolumeChanged(j)}},{key:"onLocalAudioTrackStateChanged",value:function onLocalAudioTrackStateChanged(j){return this.adapter.onLocalAudioTrackStateChanged(j)}},{key:"onLocalAudioVolume",value:function onLocalAudioVolume(j){return this.adapter.onLocalAudioVolume(j)}},{key:"onLocalRecordingDeviceListChanged",value:function onLocalRecordingDeviceListChanged(j){return this.on($R.recordingDeviceListChanged,j),0}},{key:"onLocalPlaybackDeviceListChanged",value:function onLocalPlaybackDeviceListChanged(j){return this.on($R.playbackDeviceListChanged,j),0}},{key:"microphoneList",get:function get(){var j=this,_e=[];return this._recordingDeviceIds.forEach((function(_t){var St=j._recordingDeviceInfo.get(_t);St&&_e.push({deviceid:St.deviceid,devicename:St.devicename})})),_e}},{key:"speakerList",get:function get(){var j=this,_e=[];return this._playbackDeviceIds.forEach((function(_t){var St=j._playbackDeviceInfo.get(_t);St&&_e.push({deviceid:St.deviceid,devicename:St.devicename})})),_e}},{key:"_emitPlaybackListChanged",value:function _emitPlaybackListChanged(j,_e,_t){this.emit($R.playbackDeviceListChanged,j,_e,_t)}},{key:"_emitRecordingListChanged",value:function _emitRecordingListChanged(j,_e,_t){this.emit($R.recordingDeviceListChanged,j,_e,_t)}},{key:"_initializePlaybackDeviceList",value:(_t=_asyncToGenerator(device_regeneratorRuntime().mark((function _callee2(j){var _e,_t,St,Tt,Ut,_r=this;return device_regeneratorRuntime().wrap((function _callee2$(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.next=2,GR(rD().getPlaybackDevices(j));case 2:_e=_n.sent,_t=_slicedToArray(_e,2),St=_t[0],Tt=_t[1],St&&ZE.shared.handleThrowableError(QE.RTC_ERR_ADM_GET_PLAYBACK_DEVICES_FAIL,St),Tt&&(Ut=[],Tt.forEach((function(j){if("default"!==j.deviceId){var _e={deviceid:j.deviceId,devicename:j.label};_r._playbackDeviceInfo.set(j.deviceId,_e),_r._playbackDeviceIds.add(j.deviceId),Ut.push(_e)}})),this._emitPlaybackListChanged(!0,Ut,this.speakerList)),rD().onPlaybackDeviceChanged=function(j){var _e={deviceid:j.device.deviceId,devicename:j.device.label};"ACTIVE"===j.state?(_r._playbackDeviceInfo.set(j.device.deviceId,_e),_r._playbackDeviceIds.add(j.device.deviceId),_r._emitPlaybackListChanged(!0,[_e],_r.speakerList)):"INACTIVE"===j.state&&(_r._playbackDeviceInfo.delete(j.device.deviceId),_r._playbackDeviceIds.delete(j.device.deviceId),_r._emitPlaybackListChanged(!1,[_e],_r.speakerList))};case 9:case"end":return _n.stop()}}),_callee2,this)}))),function _initializePlaybackDeviceList(j){return _t.apply(this,arguments)})},{key:"_initializeDeviceList",value:(_e=_asyncToGenerator(device_regeneratorRuntime().mark((function _callee3(j){var _e,_t,St,Tt,Ut,_r=this;return device_regeneratorRuntime().wrap((function _callee3$(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.next=2,GR(rD().getMicrophones(j));case 2:_e=_n.sent,_t=_slicedToArray(_e,2),St=_t[0],Tt=_t[1],St&&ZE.shared.handleThrowableError(QE.RTC_ERR_ADM_GET_RECORD_DEVICES_FAIL,St),Tt&&(Ut=[],Tt.forEach((function(j){if("default"!==j.deviceId){var _e={deviceid:j.deviceId,devicename:j.label};_r._recordingDeviceInfo.set(j.deviceId,_e),_r._recordingDeviceIds.add(j.deviceId),Ut.push(_e)}})),this._emitRecordingListChanged(!0,Ut,this.microphoneList)),rD().onMicrophoneChanged=function(j){var _e={deviceid:j.device.deviceId,devicename:j.device.label};"ACTIVE"===j.state?(_r._recordingDeviceInfo.set(j.device.deviceId,_e),_r._recordingDeviceIds.add(j.device.deviceId),_r._emitRecordingListChanged(!0,[_e],_r.microphoneList)):"INACTIVE"===j.state&&(_r._recordingDeviceInfo.delete(j.device.deviceId),_r._recordingDeviceIds.delete(j.device.deviceId),_r._emitRecordingListChanged(!1,[_e],_r.microphoneList))};case 9:case"end":return _n.stop()}}),_callee3,this)}))),function _initializeDeviceList(j){return _e.apply(this,arguments)})},{key:"getAudioPlaybackDevices",value:function getAudioPlaybackDevices(){return this.speakerList}},{key:"getAudioRecordingDevices",value:function getAudioRecordingDevices(){return this.microphoneList}}]),RtcAudioDeviceManagerWeb}(nO);__webpack_require__(4197);function player_createForOfIteratorHelper(j,_e){var _t="undefined"!=typeof Symbol&&j[Symbol.iterator]||j["@@iterator"];if(!_t){if(Array.isArray(j)||(_t=function player_unsupportedIterableToArray(j,_e){if(!j)return;if("string"==typeof j)return player_arrayLikeToArray(j,_e);var _t=Object.prototype.toString.call(j).slice(8,-1);"Object"===_t&&j.constructor&&(_t=j.constructor.name);if("Map"===_t||"Set"===_t)return Array.from(j);if("Arguments"===_t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_t))return player_arrayLikeToArray(j,_e)}(j))||_e&&j&&"number"==typeof j.length){_t&&(j=_t);var St=0,Tt=function F(){};return{s:Tt,n:function n(){return St>=j.length?{done:!0}:{done:!1,value:j[St++]}},e:function e(j){throw j},f:Tt}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Ut,_r=!0,_n=!1;return{s:function s(){_t=_t.call(j)},n:function n(){var j=_t.next();return _r=j.done,j},e:function e(j){_n=!0,Ut=j},f:function f(){try{_r||null==_t.return||_t.return()}finally{if(_n)throw Ut}}}}function player_arrayLikeToArray(j,_e){(null==_e||_e>j.length)&&(_e=j.length);for(var _t=0,St=new Array(_e);_t<_e;_t++)St[_t]=j[_t];return St}function player_createSuper(j){var _e=function player_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var FN,GN,VN,qN,KN,WN,HN,YN,XN,$N,cP=function(j){_inherits(AGWebAudioPlayer,j);var _e=player_createSuper(AGWebAudioPlayer);function AGWebAudioPlayer(){var j;return _classCallCheck(this,AGWebAudioPlayer),(j=_e.call(this))._audioContext=void 0,j._audioTagId=qE(),j._playingSourceNode=void 0,j._analyserNode=void 0,j._volumePollingTask=void 0,j._initialized=!1,j._initialize(),j}return _createClass(AGWebAudioPlayer,[{key:"_initialize",value:function _initialize(){try{window.AudioContext=window.AudioContext||window.webkitAudioContext,this._audioContext=new AudioContext,this._analyserNode=this._audioContext.createAnalyser(),this._analyserNode.smoothingTimeConstant=.3,this._analyserNode.fftSize=1024,"running"===this._audioContext.state&&(this._initialized=!0)}catch(j){ME.error("[audio player] initialize audio context failed ".concat(j,"."))}}},{key:"_getAudioVirtualDom",value:function _getAudioVirtualDom(){if(document){var j=document.getElementById(this._audioTagId);if(!j){var _e=document.createElement("audio");_e.id=this._audioTagId,_e.hidden=!0,document.body.appendChild(_e),j=_e}return j}ME.error("[audio player] audio element creation failed.")}},{key:"play",value:function play(j){var _e=this;this._initialized||this._initialize(),this.stop();var _t=this._audioContext,St=this._getAudioVirtualDom();if(St&&_t){var Tt=_t.createMediaElementSource(St);if(Tt.connect(_t.destination),St.src=j,this._analyserNode){var Ut=this._analyserNode;Tt.connect(Ut);var _r=new Float32Array(Ut.fftSize);this._volumePollingTask=fR.addPollingTask((function(){Ut.getFloatTimeDomainData(_r);var j,_t=0,St=player_createForOfIteratorHelper(_r);try{for(St.s();!(j=St.n()).done;){var Tt=j.value;_t+=Tt*Tt}}catch(j){St.e(j)}finally{St.f()}var _n=Math.sqrt(_t/_r.length);_e.emit($R.localAudioPlaybackVolumeIndicator,Math.min(_n,1))}),cR.second(.2))}St.addEventListener("ended",(function(){_e.stop()})),this._playingSourceNode=Tt,St.play()}else ME.error("[audio player] start audio playback test failed.")}},{key:"stop",value:function stop(){var j=this._audioContext,_e=this._getAudioVirtualDom();if(_e&&j){var _t;if(_e.pause(),_e.currentTime=0,this._analyserNode)try{var St;null===(St=this._playingSourceNode)||void 0===St||St.disconnect(this._analyserNode)}catch(j){ME.warn("[audio player] failed to detach analyser node")}if(this._audioContext)try{var Tt;null===(Tt=this._playingSourceNode)||void 0===Tt||Tt.disconnect(j.destination)}catch(j){ME.warn("[audio player] failed to detach audio context")}null===(_t=this._volumePollingTask)||void 0===_t||_t.stop(),this._volumePollingTask=void 0,_e.remove(),this.emit($R.localAudioPlaybackVolumeIndicator,0)}}}]),AGWebAudioPlayer}(_a),uP=(FN=kS.attach({proxyMethods:!1}),GN=kS.trace,VN=kS.trace,qN=kS.trace,FN((HN=function(){function AGAudioRawDataDispatcher(){_classCallCheck(this,AGAudioRawDataDispatcher),this.logger=void 0,this._microphoneTrackRawDataObservers=new Set,this._audioTrackRawDataObservers=new Set,this._eventBus=new _a,this._configs={},this._state=0}return _createClass(AGAudioRawDataDispatcher,[{key:"setConfig",value:function setConfig(j,_e){this._configs[_e]=j}},{key:"isStarted",get:function get(){return 1===this._state}},{key:"microphoneTrackRawDataConfig",get:function get(){var j;return null!==(j=this._configs[XR.record])&&void 0!==j?j:{frameSize:AGAudioRawDataDispatcher.DEFAULT_FRAME_SIZE}}},{key:"audioTrackRawDataConfig",get:function get(){var j;return null!==(j=this._configs[XR.beforeMixed])&&void 0!==j?j:{frameSize:AGAudioRawDataDispatcher.DEFAULT_FRAME_SIZE}}},{key:"hasMicrophoneRawDataObservers",get:function get(){return!!this._microphoneTrackRawDataObservers.size}},{key:"hasAudioTrackRawDataObservers",get:function get(){return!!this._audioTrackRawDataObservers.size}},{key:"_callbackAudioRawRecorded",value:function _callbackAudioRawRecorded(j){this._microphoneTrackRawDataObservers.forEach((function(_e){_e(j)}))}},{key:"_callbackAudioRawBeforeMixed",value:function _callbackAudioRawBeforeMixed(j,_e,_t){this._audioTrackRawDataObservers.forEach((function(St){St(j,_e,_t)}))}},{key:"start",value:function start(){this._state=1,this.register("AudioRawDataBeforeMixed",this._callbackAudioRawBeforeMixed),this.register("AudioRawDataRecored",this._callbackAudioRawRecorded),this.dispatch("Start")}},{key:"stop",value:function stop(){this._state=0,this.unregister("AudioRawDataBeforeMixed",this._callbackAudioRawBeforeMixed),this.unregister("AudioRawDataRecored",this._callbackAudioRawRecorded),this.dispatch("Stop")}},{key:"dispatch",value:function dispatch(j){if(this.isStarted){for(var _e,_t=arguments.length,St=new Array(_t>1?_t-1:0),Tt=1;Tt<_t;Tt++)St[Tt-1]=arguments[Tt];this.logger.debug("event: ".concat(j,", params:"),St),(_e=this._eventBus).emit.apply(_e,[j].concat(St))}}},{key:"register",value:function register(j,_e){this._eventBus.on(j,_e)}},{key:"unregister",value:function unregister(j,_e){this._eventBus.off(j,_e)}},{key:"addAudioRawDataObserver",value:function addAudioRawDataObserver(j,_e){_e===XR.record&&this._microphoneTrackRawDataObservers.add(j.onAudioRawDataRecored),_e===XR.beforeMixed&&this._audioTrackRawDataObservers.add(j.onAudioRawDataBeforeMixed),this.dispatch("ObserverChanged",_e)}},{key:"removeAudioRawDataObserver",value:function removeAudioRawDataObserver(j,_e){_e===XR.record&&this._microphoneTrackRawDataObservers.delete(j.onAudioRawDataRecored),_e===XR.beforeMixed&&this._audioTrackRawDataObservers.delete(j.onAudioRawDataBeforeMixed),this.dispatch("ObserverChanged",_e)}}]),AGAudioRawDataDispatcher}(),HN.DEFAULT_FRAME_SIZE=1024,_applyDecoratedDescriptor((WN=HN).prototype,"setConfig",[GN],Object.getOwnPropertyDescriptor(WN.prototype,"setConfig"),WN.prototype),_applyDecoratedDescriptor(WN.prototype,"_callbackAudioRawRecorded",[xS],Object.getOwnPropertyDescriptor(WN.prototype,"_callbackAudioRawRecorded"),WN.prototype),_applyDecoratedDescriptor(WN.prototype,"_callbackAudioRawBeforeMixed",[xS],Object.getOwnPropertyDescriptor(WN.prototype,"_callbackAudioRawBeforeMixed"),WN.prototype),_applyDecoratedDescriptor(WN.prototype,"start",[VN],Object.getOwnPropertyDescriptor(WN.prototype,"start"),WN.prototype),_applyDecoratedDescriptor(WN.prototype,"stop",[qN],Object.getOwnPropertyDescriptor(WN.prototype,"stop"),WN.prototype),KN=WN))||KN);function web_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */web_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function web_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function web_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?web_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):web_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}function web_createSuper(j){var _e=function web_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var lP,dP,fP,pP,gP,vP,mP,yP,AP,_P,bP,EP,wP,SP,IP=kS.attach({proxyMethods:!1})((XN=function(j){_inherits(RtcAdapterWeb,j);var _e=web_createSuper(RtcAdapterWeb);function RtcAdapterWeb(j){var _t;return _classCallCheck(this,RtcAdapterWeb),(_t=_e.call(this)).logger=void 0,_t._channels=new Map,_t._vdm=new PN(_assertThisInitialized(_t),$E.shared.rtcConfigs.noDevicePermission),_t._adm=new MN(_assertThisInitialized(_t),$E.shared.rtcConfigs.noDevicePermission),_t._audioRawDataDispatcher=new uP,_t._audioPlayer=new cP,_t.cameraThread=new _N,_t.micThread=new EN(_t._audioRawDataDispatcher),_t.screenThread=new SN,_t.remoteCanvas=new Map,_t._configs=void 0,_t._configs=j,SE.DEBUG===$E.logLevel?rD().enableLogUpload():rD().disableLogUpload(),rD().setLogLevel(RtcAdapterWeb.getLogLevel()),$E.shared.rtcSDKExtensions.length>0&&(ME.info("register extensions for WebRTC SDK",$E.shared.rtcSDKExtensions),rD().registerExtensions($E.shared.rtcSDKExtensions.map((function(j){return j.instance})))),_t._audioRawDataDispatcher.start(),_t}return _createClass(RtcAdapterWeb,[{key:"configs",get:function get(){var j,_e,_t=(j={},_defineProperty(j,TE.LiveBroadcasting,"live"),_defineProperty(j,TE.Communication,"rtc"),j)[this.channelProfile]||"live",St=(_e={},_defineProperty(_e,zE.Low,1),_defineProperty(_e,zE.UltraLow,2),_e)[$E.shared.latencyLevel];return web_objectSpread(web_objectSpread(web_objectSpread({},RtcAdapterWeb.defaultConfigs),this._configs),{},{mode:_t,latencyLevel:St})}},{key:"channelProfile",get:function get(){var j;return null!==(j=$E.shared.rtcConfigs.channelProfile)&&void 0!==j?j:TE.LiveBroadcasting}},{key:"createRtcChannel",value:function createRtcChannel(j,_e){var _t=this._channels.get(j);return _t||(_t=new TP(j,this.configs,_e,this._audioRawDataDispatcher),this._channels.set(j,_t)),_t}},{key:"getVideoDeviceManager",value:function getVideoDeviceManager(){return this._vdm}},{key:"setVideoCameraDevice",value:function setVideoCameraDevice(j){return this.cameraThread.setDevice(j),this.cameraThread.run(),0}},{key:"setAudioRecordingDevice",value:function setAudioRecordingDevice(j){return this.micThread.setRecordingDevice(j),this.micThread.run(),0}},{key:"setAudioPlaybackDevice",value:function setAudioPlaybackDevice(j){throw new Error("Method not implemented.")}},{key:"getAudioDeviceManager",value:function getAudioDeviceManager(){return this._adm}},{key:"getWindowDevices",value:function getWindowDevices(){throw new Error("Method not supported.")}},{key:"getDiaplayDevices",value:function getDiaplayDevices(){throw new Error("Method not supported.")}},{key:"isScreenDeviceEnumerateSupported",value:function isScreenDeviceEnumerateSupported(){return!1}},{key:"enableLocalVideo",value:function enableLocalVideo(j){return this.cameraThread.cameraEnable=j,this.cameraThread.run(),0}},{key:"enableLocalAudio",value:function enableLocalAudio(j){return this.micThread.micEnable=j,this.micThread.run(),0}},{key:"setupLocalVideo",value:function setupLocalVideo(j,_e){return _e===pR.Camera?(this.cameraThread.canvas=j,this.cameraThread.run()):(this.screenThread.canvas=j,this.screenThread.run()),0}},{key:"setupRemoteVideo",value:function setupRemoteVideo(j){if(!j.channelName)return ZE.shared.handleThrowableError(QE.RTC_ERR_NO_CHANNEL_EXISTS,new Error("invalid canvas w/o canvas name")),-1;this.remoteCanvas.set("".concat(j.streamUuid,"-").concat(j.channelName),j);var _e=this._channels.get(j.channelName),_t=null==_e?void 0:_e.main.videoSubscribeThread(j.streamUuid);return _t&&_t.play(),0}},{key:"startAudioRecordingDeviceTest",value:function startAudioRecordingDeviceTest(j){return this.logger.warn("web platform does not support this, it silence the error as recording device can be started testing w/o this api"),0}},{key:"stopAudioRecordingDeviceTest",value:function stopAudioRecordingDeviceTest(){return this.logger.warn("web platform does not support this, it silence the error as recording device can be started testing w/o this api"),0}},{key:"startAudioPlaybackDeviceTest",value:function startAudioPlaybackDeviceTest(j){return this._audioPlayer.play(j),0}},{key:"stopAudioPlaybackDeviceTest",value:function stopAudioPlaybackDeviceTest(){return this._audioPlayer.stop(),0}},{key:"startScreenCapture",value:function startScreenCapture(j){return this.screenThread.screenEnable=!0,this.screenThread.withAudio=!(null==j||!j.withAudio),this.screenThread.run(),0}},{key:"stopScreenCapture",value:function stopScreenCapture(){return this.screenThread.screenEnable=!1,this.screenThread.run(),0}},{key:"onAutoplayFailed",value:function onAutoplayFailed(j){return rD().onAutoplayFailed=j,0}},{key:"onLocalAudioPlaybackTestVolumeChanged",value:function onLocalAudioPlaybackTestVolumeChanged(j){return this._audioPlayer.on($R.localAudioPlaybackVolumeIndicator,j),0}},{key:"onLocalVideoTrackStateChanged",value:function onLocalVideoTrackStateChanged(j){return this.cameraThread.on($R.trackStateChanged,j),0}},{key:"onLocalAudioTrackStateChanged",value:function onLocalAudioTrackStateChanged(j){return this.micThread.on($R.trackStateChanged,j),0}},{key:"onLocalScreenShareTrackStateChanged",value:function onLocalScreenShareTrackStateChanged(j){return this.screenThread.on($R.trackStateChanged,j),0}},{key:"onLocalAudioVolume",value:function onLocalAudioVolume(j){return this.micThread.on($R.localAudioVolume,j),0}},{key:"setBeautyEffectOptions",value:function setBeautyEffectOptions(j,_e){return this.logger.warn("web platform does not support this"),0}},{key:"setAudioFrameCallback",value:function setAudioFrameCallback(){return this._audioRawDataDispatcher.start(),0}},{key:"stopAudioFrameCallback",value:function stopAudioFrameCallback(){return this._audioRawDataDispatcher.stop(),0}},{key:"addAudioRawDataObserver",value:function addAudioRawDataObserver(j,_e){return this._audioRawDataDispatcher.addAudioRawDataObserver(j,_e),0}},{key:"removeAudioRawDataObserver",value:function removeAudioRawDataObserver(j,_e){return this._audioRawDataDispatcher.removeAudioRawDataObserver(j,_e),0}},{key:"setAudioRawDataConfig",value:function setAudioRawDataConfig(j,_e){return this._audioRawDataDispatcher.setConfig(j,_e),0}},{key:"hasScreenSharePermission",value:function hasScreenSharePermission(){return!0}},{key:"takeSnapshot",value:function takeSnapshot(j,_e,_t){return this.logger.warn("web platform does not support this"),Promise.reject()}},{key:"getCurrentFrameData",value:function getCurrentFrameData(j,_e,_t){if(_t)return this.cameraThread.track.getCurrentFrameData();try{return this._channels.get(j).getCurrentFrameData(_e)}catch(_t){return this.logger.error("getCurrentFrameData from channel: ".concat(j," stream: ").concat(_e," failed")),new ImageData(1,1)}}},{key:"addCameraProcessors",value:function addCameraProcessors(j){return this.cameraThread.addProcessors(j),0}},{key:"removeCameraProcessors",value:function removeCameraProcessors(){return this.cameraThread.removeProcessors(),0}},{key:"addMicrophoneProcessors",value:function addMicrophoneProcessors(j){return this.micThread.addProcessors(j),0}},{key:"removeMicrophoneProcessors",value:function removeMicrophoneProcessors(){return this.micThread.removeProcessors(),0}},{key:"destroy",value:function destroy(){return this._channels.forEach((function(j){return j.leave()})),this._channels.clear(),this.enableLocalVideo(!1),this.enableLocalAudio(!1),this.stopScreenCapture(),0}}],[{key:"getLogLevel",value:function getLogLevel(){switch($E.logLevel){case SE.DEBUG:return 0;case SE.INFO:return 1;case SE.WARN:return 2;case SE.ERROR:return 3;default:return 4}}},{key:"getRtcVersion",value:function getRtcVersion(){return rD().VERSION}}]),RtcAdapterWeb}(bO),XN.defaultConfigs={codec:"vp8",mode:"live",latencyLevel:2},YN=XN))||YN,TP=kS.attach({proxyMethods:!1})($N=function(j){_inherits(RtcChannelAdapterWeb,j);var _e,_t,St=web_createSuper(RtcChannelAdapterWeb);function RtcChannelAdapterWeb(j,_e,_t,Tt){var Ut;return _classCallCheck(this,RtcChannelAdapterWeb),(Ut=St.call(this)).logger=void 0,Ut.main=void 0,Ut.sub=void 0,Ut.channelName=void 0,Ut.channelName=j,Ut.main=new LN(j,_e,_t,_R.main,Tt),Ut.sub=new NN(j,_e,_t,_R.sub,Tt),Ut}return _createClass(RtcChannelAdapterWeb,[{key:"getSessionId",value:function getSessionId(){return this.main.getClientSessionId()}},{key:"client",value:function client(j){return j===_R.main?this.main:this.sub}},{key:"setLatencyLevel",value:function setLatencyLevel(j){this.main.setLatencyLevel(j),this.sub.setLatencyLevel(j)}},{key:"muteRemoteVideoMass",value:function muteRemoteVideoMass(j,_e){return this.main.muteRemoteVideoMass(j,_e)}},{key:"join",value:(_t=_asyncToGenerator(web_regeneratorRuntime().mark((function _callee(j,_e,_t){return web_regeneratorRuntime().wrap((function _callee$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,this.client(_t).join($E.shared.appId,j,_e);case 2:_t===_R.sub&&(this.main.muteRemoteVideo(_e,!0),this.main.muteRemoteAudio(_e,!0));case 3:case"end":return St.stop()}}),_callee,this)}))),function join(j,_e,St){return _t.apply(this,arguments)})},{key:"leave",value:(_e=_asyncToGenerator(web_regeneratorRuntime().mark((function _callee2(j){var _e,_t,St,Tt,Ut;return web_regeneratorRuntime().wrap((function _callee2$(_r){for(;;)switch(_r.prev=_r.next){case 0:if(!this.sub.ready){_r.next=7;break}return _r.next=3,GR(this.sub.leave());case 3:_t=_r.sent,St=_slicedToArray(_t,1),(_e=St[0])&&ZE.shared.handleNonThrowableError(QE.RTC_ERR_LEAVE_SUB_CHANNEL_FAIL,_e);case 7:if(j===_R.sub){_r.next=14;break}return _r.next=10,GR(this.main.leave());case 10:Tt=_r.sent,Ut=_slicedToArray(Tt,1),(_e=Ut[0])&&ZE.shared.handleNonThrowableError(QE.RTC_ERR_LEAVE_MAIN_CHANNEL_FAIL,_e);case 14:case"end":return _r.stop()}}),_callee2,this)}))),function leave(j){return _e.apply(this,arguments)})},{key:"enableDualStream",value:function enableDualStream(j,_e){return this.client(_e).enableDualStream(j)}},{key:"setLowStreamParameter",value:function setLowStreamParameter(j,_e){return this.client(_e).setLowStreamParameter(j),0}},{key:"setRemoteVideoStreamType",value:function setRemoteVideoStreamType(j,_e,_t){return this.client(_t).setRemoteVideoStreamType(j,_e)}},{key:"muteLocalVideo",value:function muteLocalVideo(j,_e){return this.logger.info("muteLocalVideo ".concat(j)),this.client(_e).muteLocalVideo(j)}},{key:"muteLocalAudio",value:function muteLocalAudio(j,_e){return this.logger.info("muteLocalAudio ".concat(j)),this.client(_e).muteLocalAudio(j)}},{key:"muteLocalScreenShare",value:function muteLocalScreenShare(j,_e){return this.logger.info("muteLocalScreenShare ".concat(j)),this.client(_e).muteLocalScreenShare(j)}},{key:"muteRemoteVideo",value:function muteRemoteVideo(j,_e){return this.logger.info("muteRemoteVideo ".concat(j," ").concat(_e)),this.main.muteRemoteVideo(j,_e)}},{key:"muteRemoteAudio",value:function muteRemoteAudio(j,_e){return this.logger.info("muteRemoteAudio ".concat(j," ").concat(_e)),this.main.muteRemoteAudio(j,_e)}},{key:"getCurrentFrameData",value:function getCurrentFrameData(j){try{return this.main.videoSubscribeThread(j).track.getCurrentFrameData()}catch(_e){return this.logger.error("getCurrentFrameData from stream: ".concat(j," failed")),new ImageData(1,1)}}},{key:"onNetworkStats",value:function onNetworkStats(j){return this.main.on("network-stats-changed",j),0}},{key:"onAudioVolumeIndication",value:function onAudioVolumeIndication(j){return this.main.on("audio-volume-indication",j),0}},{key:"onConnectionStateChanged",value:function onConnectionStateChanged(j){return this.main.on("rtc-connection-state-changed",j),this.sub.on("rtc-connection-state-changed",j),0}}]),RtcChannelAdapterWeb}(iO))||$N,CP=function(){function RtcAdapterFactory(){_classCallCheck(this,RtcAdapterFactory)}return _createClass(RtcAdapterFactory,null,[{key:"getAdapter",value:function getAdapter(j,_e){switch(j){case KE.Electron:return new JO;case KE.Web:return new IP(null==_e?void 0:_e.web)}}}]),RtcAdapterFactory}(),RP=(lP=kS.attach(),dP=kS.silence,fP=kS.silence,pP=kS.silence,gP=kS.silence,vP=kS.silence,mP=kS.silence,yP=kS.silence,AP=kS.silence,_P=kS.silence,bP=kS.silence,EP=kS.silence,lP((SP=function(){function AGRtcManager(j){_classCallCheck(this,AGRtcManager),this._adapter=void 0,this._channels=new Map,this._adapter=CP.getAdapter($E.platform,j)}return _createClass(AGRtcManager,[{key:"getRtcChannel",value:function getRtcChannel(j){var _e=this._channels.get(j);if(!_e){var _t=this._adapter.createRtcChannel(j,this._adapter);_e=new BR(j,_t),this._channels.set(j,_e)}return _e}},{key:"getVideoDeviceManager",value:function getVideoDeviceManager(){return this._adapter.getVideoDeviceManager()}},{key:"getAudioDeviceManager",value:function getAudioDeviceManager(){return this._adapter.getAudioDeviceManager()}},{key:"getWindowDevices",value:function getWindowDevices(){return this._adapter.getWindowDevices()}},{key:"getDisplayDevices",value:function getDisplayDevices(){return this._adapter.getDiaplayDevices()}},{key:"isScreenDeviceEnumerateSupported",value:function isScreenDeviceEnumerateSupported(){return this._adapter.isScreenDeviceEnumerateSupported()}},{key:"setVideoCameraDevice",value:function setVideoCameraDevice(j){return this._adapter.setVideoCameraDevice(j)}},{key:"setAudioRecordingDevice",value:function setAudioRecordingDevice(j){return this._adapter.setAudioRecordingDevice(j)}},{key:"setAudioPlaybackDevice",value:function setAudioPlaybackDevice(j){return this._adapter.setAudioPlaybackDevice(j)}},{key:"enableLocalVideo",value:function enableLocalVideo(j){return this._adapter.enableLocalVideo(j)}},{key:"setupLocalVideo",value:function setupLocalVideo(j,_e){return j.view.style.setProperty("transform",j.mirror?"rotateY(180deg)":""),this._adapter.setupLocalVideo(j,_e)}},{key:"setupRemoteVideo",value:function setupRemoteVideo(j){return j.view.style.setProperty("transform",j.mirror?"rotateY(180deg)":""),this._adapter.setupRemoteVideo(j)}},{key:"enableLocalAudio",value:function enableLocalAudio(j){return this._adapter.enableLocalAudio(j)}},{key:"startScreenCapture",value:function startScreenCapture(j){return this._adapter.startScreenCapture(j)}},{key:"stopScreenCapture",value:function stopScreenCapture(){return this._adapter.stopScreenCapture()}},{key:"onLocalScreenShareTrackStateChanged",value:function onLocalScreenShareTrackStateChanged(j){return this._adapter.onLocalScreenShareTrackStateChanged(j)}},{key:"startAudioRecordingDeviceTest",value:function startAudioRecordingDeviceTest(j){return this._adapter.startAudioRecordingDeviceTest(j)}},{key:"stopAudioRecordingDeviceTest",value:function stopAudioRecordingDeviceTest(){return this._adapter.stopAudioRecordingDeviceTest()}},{key:"startAudioPlaybackDeviceTest",value:function startAudioPlaybackDeviceTest(j){return this._adapter.startAudioPlaybackDeviceTest(j)}},{key:"stopAudioPlaybackDeviceTest",value:function stopAudioPlaybackDeviceTest(){return this._adapter.stopAudioPlaybackDeviceTest()}},{key:"onAutoPlayFailed",value:function onAutoPlayFailed(j){return this._adapter.onAutoplayFailed(j)}},{key:"onLocalCameraListChanged",value:function onLocalCameraListChanged(j){return this._adapter.getVideoDeviceManager().onLocalCameraListChanged(j)}},{key:"onLocalRecordingDeviceListChanged",value:function onLocalRecordingDeviceListChanged(j){return this._adapter.getAudioDeviceManager().onLocalRecordingDeviceListChanged(j)}},{key:"onLocalPlaybackListChanged",value:function onLocalPlaybackListChanged(j){return this._adapter.getAudioDeviceManager().onLocalPlaybackDeviceListChanged(j)}},{key:"onLocalVideoTrackStateChanged",value:function onLocalVideoTrackStateChanged(j){return this._adapter.getVideoDeviceManager().onLocalVideoTrackStateChanged(j)}},{key:"onLocalAudioTrackStateChanged",value:function onLocalAudioTrackStateChanged(j){return this._adapter.getAudioDeviceManager().onLocalAudioTrackStateChanged(j)}},{key:"onLocalAudioVolume",value:function onLocalAudioVolume(j){return this._adapter.getAudioDeviceManager().onLocalAudioVolume(j)}},{key:"setBeautyEffectOptions",value:function setBeautyEffectOptions(j,_e){return this._adapter.setBeautyEffectOptions(j,_e)}},{key:"setAudioRawDataConfig",value:function setAudioRawDataConfig(j,_e){return this._adapter.setAudioRawDataConfig(j,_e)}},{key:"addAudioRawDataObserver",value:function addAudioRawDataObserver(j,_e){return this._adapter.addAudioRawDataObserver(j,_e)}},{key:"removeAudioRawDataObserver",value:function removeAudioRawDataObserver(j,_e){return this._adapter.removeAudioRawDataObserver(j,_e)}},{key:"hasScreenSharePermission",value:function hasScreenSharePermission(){return this._adapter.hasScreenSharePermission()}},{key:"takeSnapshot",value:function takeSnapshot(j,_e,_t){return this._adapter.takeSnapshot(j,_e,_t)}},{key:"getCurrentFrameData",value:function getCurrentFrameData(j,_e,_t){return this._adapter.getCurrentFrameData(j,_e,_t)}},{key:"addCameraProcessors",value:function addCameraProcessors(j){return this._adapter.addCameraProcessors(j)}},{key:"removeCameraProcessors",value:function removeCameraProcessors(){return this._adapter.removeCameraProcessors()}},{key:"addMicrophoneProcessors",value:function addMicrophoneProcessors(j){return this._adapter.addMicrophoneProcessors(j)}},{key:"removeMicrophoneProcessors",value:function removeMicrophoneProcessors(){return this._adapter.removeMicrophoneProcessors()}},{key:"destroy",value:function destroy(){return this._adapter.destroy()}}]),AGRtcManager}(),_applyDecoratedDescriptor(SP.prototype,"getRtcChannel",[dP],Object.getOwnPropertyDescriptor(SP.prototype,"getRtcChannel"),SP.prototype),_applyDecoratedDescriptor(SP.prototype,"getVideoDeviceManager",[fP],Object.getOwnPropertyDescriptor(SP.prototype,"getVideoDeviceManager"),SP.prototype),_applyDecoratedDescriptor(SP.prototype,"getAudioDeviceManager",[pP],Object.getOwnPropertyDescriptor(SP.prototype,"getAudioDeviceManager"),SP.prototype),_applyDecoratedDescriptor(SP.prototype,"onLocalScreenShareTrackStateChanged",[gP],Object.getOwnPropertyDescriptor(SP.prototype,"onLocalScreenShareTrackStateChanged"),SP.prototype),_applyDecoratedDescriptor(SP.prototype,"onAutoPlayFailed",[vP],Object.getOwnPropertyDescriptor(SP.prototype,"onAutoPlayFailed"),SP.prototype),_applyDecoratedDescriptor(SP.prototype,"onLocalCameraListChanged",[mP],Object.getOwnPropertyDescriptor(SP.prototype,"onLocalCameraListChanged"),SP.prototype),_applyDecoratedDescriptor(SP.prototype,"onLocalRecordingDeviceListChanged",[yP],Object.getOwnPropertyDescriptor(SP.prototype,"onLocalRecordingDeviceListChanged"),SP.prototype),_applyDecoratedDescriptor(SP.prototype,"onLocalPlaybackListChanged",[AP],Object.getOwnPropertyDescriptor(SP.prototype,"onLocalPlaybackListChanged"),SP.prototype),_applyDecoratedDescriptor(SP.prototype,"onLocalVideoTrackStateChanged",[_P],Object.getOwnPropertyDescriptor(SP.prototype,"onLocalVideoTrackStateChanged"),SP.prototype),_applyDecoratedDescriptor(SP.prototype,"onLocalAudioTrackStateChanged",[bP],Object.getOwnPropertyDescriptor(SP.prototype,"onLocalAudioTrackStateChanged"),SP.prototype),_applyDecoratedDescriptor(SP.prototype,"onLocalAudioVolume",[EP],Object.getOwnPropertyDescriptor(SP.prototype,"onLocalAudioVolume"),SP.prototype),wP=SP))||wP),kP=__webpack_require__(3977),OP=__webpack_require__.n(kP),DP=__webpack_require__(9644),LP=__webpack_require__.n(DP);function oss_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */oss_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}var NP=(new(__webpack_require__(6353).UAParser)).getResult(),PP=function(){function OSSFileUploader(j,_e){_classCallCheck(this,OSSFileUploader),this._appId=j,this._tagInfo=_e,this._adapter=void 0,this._adapter=new MP(this._appId,this._tagInfo)}var j;return _createClass(OSSFileUploader,[{key:"upload",value:(j=_asyncToGenerator(oss_regeneratorRuntime().mark((function _callee(j,_e){return oss_regeneratorRuntime().wrap((function _callee$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.next=2,this._adapter.upload(j,_e);case 2:case"end":return _t.stop()}}),_callee,this)}))),function upload(_e,_t){return j.apply(this,arguments)})}]),OSSFileUploader}(),MP=function(){function OSSUploader(j,_e){_classCallCheck(this,OSSUploader),this._appId=j,this._tagInfo=_e,this._apiService=new JT,this._checkpoints=new Map}var j,_e,_t,St;return _createClass(OSSUploader,[{key:"_uploadByAli",value:(St=_asyncToGenerator(oss_regeneratorRuntime().mark((function _callee2(j,_e,_t,St){var Tt,Ut,_r,_n,_i,Ei,Ci,Di,Fi,_o,ga,_a,_s,_c,kc=this;return oss_regeneratorRuntime().wrap((function _callee2$(_u){for(;;)switch(_u.prev=_u.next){case 0:return Tt=_t.ossKey,Ut=_t.accessKeyId,_r=_t.accessKeySecret,_n=_t.bucketName,_i=_t.ossEndpoint,Ei=_t.securityToken,Ci=St.callbackHost,Di=St.callbackBody,Fi=St.callbackContentType,_o=new(OP())({accessKeyId:Ut,accessKeySecret:_r,bucket:_n,endpoint:_i,secure:!0,stsToken:Ei}),ga=this._checkpoints.get(_e),_a="".concat(Ci,"/monitor/apps/").concat(this._appId,"/v1/log/oss/callback"),_u.next=7,_o.multipartUpload(Tt,j,{progress:function progress(j,_t){kc._checkpoints.set(_e,_t)},callback:{url:_a,body:Di,contentType:Fi},checkpoint:ga});case 7:if(_s=_u.sent,200===(_c=_s.res).status){_u.next=11;break}throw new Error("upload to ali oss error, status is ".concat(_c.status));case 11:this._checkpoints.delete(_e),_o.generateObjectUrl(Tt);case 13:case"end":return _u.stop()}}),_callee2,this)}))),function _uploadByAli(j,_e,_t,Tt){return St.apply(this,arguments)})},{key:"_uploadByAws",value:(_t=_asyncToGenerator(oss_regeneratorRuntime().mark((function _callee3(j,_e,_t,St){var Tt,Ut,_r,_n,_i,Ei;return oss_regeneratorRuntime().wrap((function _callee3$(Ci){for(;;)switch(Ci.prev=Ci.next){case 0:return Tt=_t.preSignedUrl,Ut=St.callbackHost,_r=St.callbackBody,_n=St.callbackContentType,_i="".concat(Ut,"/monitor/apps/").concat(this._appId,"/v1/log/oss/callback"),Ci.next=5,LP().put(Tt,j,{headers:{"Content-Type":j.type}});case 5:return Ci.next=7,LP().post(_i,JSON.parse(_r),{headers:_defineProperty({},"content-type",_n)});case 7:if(200===(Ei=Ci.sent).status){Ci.next=10;break}throw new Error("upload to aws oss error, status is ".concat(Ei.status));case 10:this._checkpoints.delete(_e);case 11:case"end":return Ci.stop()}}),_callee3,this)}))),function _uploadByAws(j,_e,St,Tt){return _t.apply(this,arguments)})},{key:"_fetchStsToken",value:(_e=_asyncToGenerator(oss_regeneratorRuntime().mark((function _callee4(j,_e){var _t,St,Tt,Ut,_r,_n,_i;return oss_regeneratorRuntime().wrap((function _callee4$(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return _t=(new Date).getTime(),St={appId:$E.shared.appId,appVersion:$E.version,deviceName:NP.os.name,deviceVersion:NP.os.version,fileExt:_e,platform:"web",tag:j},Tt=JSON.stringify(St),Ut="7AIsPeMJgQAppO0Z"+Tt+_t,_r=HT()(Ut),Ei.next=8,this._apiService.fetch({host:"https://api.sd-rtn.com",path:"/monitor/v1/log/oss/policy",data:St,method:"POST",headers:{sign:_r,timestamp:_t}});case 8:return _n=Ei.sent,_i=_n.data,Ei.abrupt("return",{bucketName:_i.bucketName,callbackBody:_i.callbackBody,callbackContentType:_i.callbackContentType,accessKeyId:_i.accessKeyId,accessKeySecret:_i.accessKeySecret,securityToken:_i.securityToken,ossKey:_i.ossKey,callbackHost:_i.callbackHost,preSignedUrl:_i.preSignedUrl,vendor:_i.vendor,ossEndpoint:_i.ossEndpoint});case 11:case"end":return Ei.stop()}}),_callee4,this)}))),function _fetchStsToken(j,_t){return _e.apply(this,arguments)})},{key:"upload",value:(j=_asyncToGenerator(oss_regeneratorRuntime().mark((function _callee5(j,_e){var _t,St,Tt,Ut,_r,_n,_i,Ei,Ci,Di,Fi,_o,ga,_a,_s,_c,kc;return oss_regeneratorRuntime().wrap((function _callee5$(_u){for(;;)switch(_u.prev=_u.next){case 0:return _u.next=2,this._fetchStsToken(this._tagInfo,_e);case 2:if(_t=_u.sent,St=_t.vendor,1!==(Tt=void 0===St?-1:St)){_u.next=10;break}return Ut=_t.ossKey,_r=_t.callbackBody,_n=_t.callbackContentType,_i=_t.callbackHost,Ei=_t.preSignedUrl,_u.next=8,this._uploadByAws(j,Ut,{preSignedUrl:Ei},{callbackBody:_r,callbackContentType:_n,callbackHost:_i});case 8:case 14:_u.next=17;break;case 10:if(2!==Tt){_u.next=16;break}return Ci=_t.accessKeyId,Di=_t.accessKeySecret,Fi=_t.bucketName,_o=_t.ossEndpoint,ga=_t.securityToken,_a=_t.ossKey,_s=_t.callbackBody,_c=_t.callbackContentType,kc=_t.callbackHost,_u.next=14,this._uploadByAli(j,_a,{accessKeyId:Ci,accessKeySecret:Di,bucketName:Fi,ossEndpoint:_o,securityToken:ga,ossKey:_a},{callbackBody:_s,callbackContentType:_c,callbackHost:kc});case 16:throw new Error("vendor ".concat(Tt," is not supported"));case 17:case"end":return _u.stop()}}),_callee5,this)}))),function upload(_e,_t){return j.apply(this,arguments)})}]),OSSUploader}();function log_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */log_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function log_createSuper(j){var _e=function log_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var BP,UP,GP,qP,KP,WP=function(j){_inherits(AgoraLogService,j);var _e,_t,St,Tt,Ut=log_createSuper(AgoraLogService);function AgoraLogService(){return _classCallCheck(this,AgoraLogService),Ut.apply(this,arguments)}return _createClass(AgoraLogService,[{key:"uploadZipLogFile",value:(Tt=_asyncToGenerator(log_regeneratorRuntime().mark((function _callee(j,_e){var _t;return log_regeneratorRuntime().wrap((function _callee$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,this.uploadToOss(j,_e,"zip");case 2:return _t=St.sent,St.abrupt("return",_t);case 4:case"end":return St.stop()}}),_callee,this)}))),function uploadZipLogFile(j,_e){return Tt.apply(this,arguments)})},{key:"uploadLogFile",value:(St=_asyncToGenerator(log_regeneratorRuntime().mark((function _callee2(j,_e){var _t;return log_regeneratorRuntime().wrap((function _callee2$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,this.uploadToOss(j,_e,"log");case 2:return _t=St.sent,St.abrupt("return",_t);case 4:case"end":return St.stop()}}),_callee2,this)}))),function uploadLogFile(j,_e){return St.apply(this,arguments)})},{key:"uploadToOss",value:(_t=_asyncToGenerator(log_regeneratorRuntime().mark((function _callee3(j,_e,_t){var St;return log_regeneratorRuntime().wrap((function _callee3$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.prev=0,St=new PP($E.shared.appId,j),Tt.next=4,St.upload(_e,_t);case 4:Tt.next=9;break;case 6:Tt.prev=6,Tt.t0=Tt.catch(0),ZE.shared.handleThrowableError(QE.RTE_ERR_LOG_UPLOAD_FAIL,Tt.t0);case 9:case"end":return Tt.stop()}}),_callee3,null,[[0,6]])}))),function uploadToOss(j,_e,St){return _t.apply(this,arguments)})},{key:"uploadElectronLog",value:(_e=_asyncToGenerator(log_regeneratorRuntime().mark((function _callee4(j){var _e,_t;return log_regeneratorRuntime().wrap((function _callee4$(St){for(;;)switch(St.prev=St.next){case 0:if(!window.doGzip){St.next=8;break}return St.next=3,window.doGzip();case 3:return _e=St.sent,St.next=6,this.uploadZipLogFile(j,_e);case 6:return _t=St.sent,St.abrupt("return",_t);case 8:case"end":return St.stop()}}),_callee4,this)}))),function uploadElectronLog(j){return _e.apply(this,arguments)})}]),AgoraLogService}(JT);function rc_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */rc_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function rc_createSuper(j){var _e=function rc_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j[j.Host=1]="Host",j[j.Controlled=2]="Controlled"}(BP||(BP={})),function(j){j.RequestControl="request-control",j.QuitControl="quit-control",j.RequestAuthorized="request-authorized",j.RequestUnauthorized="request-unauthorized"}(UP||(UP={}));try{var HP=__webpack_require__(1709).AgoraRemoteDesktopControl;KP=HP}catch(j){$E.platform===KE.Electron&&ME.warn("load electron rc sdk failed: ".concat(j))}var zP=kS.attach({proxyMethods:!1})((qP=function(j){_inherits(AgoraRemoteControlContext,j);var _e,_t,St,Tt,Ut,_r,_n,_i,Ei=rc_createSuper(AgoraRemoteControlContext);function AgoraRemoteControlContext(j,_e){var _t;return _classCallCheck(this,AgoraRemoteControlContext),(_t=Ei.call(this))._rtcChannel=j,_t._role=_e,_t.logger=void 0,_t._rdcEngine=void 0,_t._displays=[],_t._streamId=void 0,_t.handleRDCStateChange=function(j,_e){var St;(St=_t.logger).info.apply(St,["RDC state changed to",j].concat(_toConsumableArray(_e?["with message",_e]:[])))},_t.handleRDCRequestControl=function(j){_t.logger.info("RequestControl fired with args",j),_t.emit(UP.RequestControl,j)},_t.handleRDCQuitControl=function(j){_t.logger.info("QuitControl fired with args",j),_t.emit(UP.QuitControl,j)},_t.handleRDCRequestControlAuthorized=function(j){_t.logger.info("RequestAuthorized fired with args",j),_t.emit(UP.RequestAuthorized,j)},_t.handleRDCRequestControlUnauthorized=function(j){_t.logger.info("RequestUnauthorized fired with args",j),_t.emit(UP.RequestUnauthorized,j)},_t._checkPlatform(),_t._initialize(),_t._addListeners(),_t}return _createClass(AgoraRemoteControlContext,[{key:"_checkPlatform",value:function _checkPlatform(){if(!($E.platform===KE.Electron))throw new Error("Remote Control currently not supported in web browser")}},{key:"rdcEngine",get:function get(){if(!this._rdcEngine)throw new Error("RCEngine not ready");return this._rdcEngine}},{key:"_initialize",value:function _initialize(){this._rdcEngine=new KP(JO.rtcEngine,{appId:$E.shared.appId,role:this._role})}},{key:"_addListeners",value:function _addListeners(){this.rdcEngine.on("rdc-state",this.handleRDCStateChange),this.rdcEngine.on("rdc-request-control",this.handleRDCRequestControl),this.rdcEngine.on("rdc-quit-control",this.handleRDCQuitControl),this.rdcEngine.on("rdc-request-control-authorized",this.handleRDCRequestControlAuthorized),this.rdcEngine.on("rdc-request-control-unauthorized",this.handleRDCRequestControlUnauthorized)}},{key:"_removeListeners",value:function _removeListeners(){this.rdcEngine.off("rdc-state",this.handleRDCStateChange),this.rdcEngine.off("rdc-request-control",this.handleRDCRequestControl),this.rdcEngine.off("rdc-quit-control",this.handleRDCQuitControl),this.rdcEngine.off("rdc-request-control-authorized",this.handleRDCRequestControlAuthorized),this.rdcEngine.off("rdc-request-control-unauthorized",this.handleRDCRequestControlUnauthorized)}},{key:"join",value:(_i=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee2(j){var _e=this;return rc_regeneratorRuntime().wrap((function _callee2$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.abrupt("return",new Promise(function(){var _t=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee(_t,St){var Tt,Ut,_r,_n;return rc_regeneratorRuntime().wrap((function _callee$(_i){for(;;)switch(_i.prev=_i.next){case 0:return Tt=j.userId,Ut=j.userToken,_r=j.streamId,_n=j.streamToken,_e.logger.info("join rc channel [".concat(_e._rtcChannel.channelName,"] with params"),j),_e._streamId=_r,_e.rdcEngine.once("rdc-join-error",(function(j,Tt){0===j?(_t(null),_e.logger.info("rc channel joined")):(St(),_e.logger.info("rc channel join failed, message: ".concat(Tt)))})),_i.next=6,_e.rdcEngine.join(Tt,Ut,_e._rtcChannel.channelName,parseInt(_r),_n);case 6:case"end":return _i.stop()}}),_callee)})));return function(j,_e){return _t.apply(this,arguments)}}()));case 1:case"end":return _t.stop()}}),_callee2)}))),function join(j){return _i.apply(this,arguments)})},{key:"_waitForUserJoin",value:(_n=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee4(j){var _e,_t,St=this,Tt=arguments;return rc_regeneratorRuntime().wrap((function _callee4$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(_e=Tt.length>1&&void 0!==Tt[1]?Tt[1]:1e4,(_t=function isUserJoined(){return AgoraRemoteControlContext._channelUsers.has(j)})()){Ut.next=7;break}return Ut.next=5,_S(new Promise(function(){var Tt=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee3(Tt){var Ut;return rc_regeneratorRuntime().wrap((function _callee3$(_r){for(;;)switch(_r.prev=_r.next){case 0:Ut=Date.now()+_e;case 1:if(!(Date.now()<Ut)){_r.next=11;break}if(St.logger.info("wait for user joining rc channel"),!_t()){_r.next=7;break}return St.logger.info("user [".concat(j,"] joined the rc channel!")),Tt(),_r.abrupt("break",11);case 7:return _r.next=9,AS(100);case 9:_r.next=1;break;case 11:case"end":return _r.stop()}}),_callee3)})));return function(j){return Tt.apply(this,arguments)}}()),_e,!1);case 5:Ut.next=8;break;case 7:this.logger.info("user [".concat(j,"] has already joined the rc channel!"));case 8:case"end":return Ut.stop()}}),_callee4,this)}))),function _waitForUserJoin(j){return _n.apply(this,arguments)})},{key:"requestControl",value:(_r=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee5(j,_e){return rc_regeneratorRuntime().wrap((function _callee5$(_t){for(;;)switch(_t.prev=_t.next){case 0:return this.logger.info("request user ".concat(j," for remote controlling")),_t.next=3,this._waitForUserJoin(_e.streamId,_e.timeout);case 3:this.rdcEngine.requestControl(j);case 4:case"end":return _t.stop()}}),_callee5,this)}))),function requestControl(j,_e){return _r.apply(this,arguments)})},{key:"takeControl",value:(Ut=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee6(j,_e,_t,St){return rc_regeneratorRuntime().wrap((function _callee6$(St){for(;;)switch(St.prev=St.next){case 0:this.logger.info("take control of the remote device of user ".concat(j)),this.rdcEngine.takeControl(j,parseInt(_e),_t);case 2:case"end":return St.stop()}}),_callee6,this)}))),function takeControl(j,_e,_t,St){return Ut.apply(this,arguments)})},{key:"unauthorizeControl",value:(Tt=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee7(j,_e){return rc_regeneratorRuntime().wrap((function _callee7$(_e){for(;;)switch(_e.prev=_e.next){case 0:this.logger.info("unauthorize user ".concat(j," for remote controlling")),this.rdcEngine.unauthorizeControl(j);case 2:case"end":return _e.stop()}}),_callee7,this)}))),function unauthorizeControl(j,_e){return Tt.apply(this,arguments)})},{key:"authorizeControl",value:(St=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee8(j,_e,_t){var St,Tt,Ut,_r,_n,_i,Ei,Ci;return rc_regeneratorRuntime().wrap((function _callee8$(_t){for(;;)switch(_t.prev=_t.next){case 0:if(this.logger.info("authorize user ".concat(j," for remote controlling")),_n=this._displays.find((function(j){return j.id===_e.id}))){_t.next=4;break}throw new Error("Invalid display obj, display with id ".concat(JSON.stringify(_e.id)," not exist"));case 4:this.logger.info("display with id ".concat(_e.id," is going to be controled")),_i=$E.shared.rtcConfigs,Ei=_i.defaultScreenEncoderConfigurations,Ci={width:null!==(St=null==Ei?void 0:Ei.width)&&void 0!==St?St:0,height:null!==(Tt=null==Ei?void 0:Ei.height)&&void 0!==Tt?Tt:0,frameRate:null!==(Ut=null==Ei?void 0:Ei.frameRate)&&void 0!==Ut?Ut:10,bitrate:null!==(_r=null==Ei?void 0:Ei.bitrate)&&void 0!==_r?_r:0,captureMouseCursor:!0,windowFocus:!0,excludeWindowCount:0,excludeWindowList:[],highLightWidth:0,highLightColor:0,enableHighLight:!1},this.rdcEngine.authorizeControl(j,_n,Ci);case 9:case"end":return _t.stop()}}),_callee8,this)}))),function authorizeControl(j,_e,_t){return St.apply(this,arguments)})},{key:"quitControl",value:function quitControl(j,_e,_t){this.logger.info("role ".concat(_e," is quit control from ").concat(j," and streamId ").concat(_t)),_t?this.rdcEngine.quitControl(j,_e,_t):this.rdcEngine.quitControl(j,_e)}},{key:"leave",value:(_t=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee10(){var j,_e,_t=this;return rc_regeneratorRuntime().wrap((function _callee10$(St){for(;;)switch(St.prev=St.next){case 0:if(this.logger.info("leave rc channel [".concat(this._rtcChannel.channelName,"],streamId is [").concat(this._streamId,"]")),JO.rtcEngine.stopScreenCapture2(),JO.rtcEngine.videoSourceLeave(),j=1e4,_e=this._streamId){St.next=8;break}return this.logger.info("user not joined yet, no op"),St.abrupt("return");case 8:return St.next=10,_S(new Promise(function(){var St=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee9(St){var Tt;return rc_regeneratorRuntime().wrap((function _callee9$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:Tt=Date.now()+j;case 1:if(!(Date.now()<Tt)){Ut.next=10;break}if(AgoraRemoteControlContext._channelUsers.has(_e)){Ut.next=6;break}return _t.logger.info("user not in rc channel, stop loop"),St(),Ut.abrupt("break",10);case 6:return Ut.next=8,AS(100);case 8:Ut.next=1;break;case 10:case"end":return Ut.stop()}}),_callee9)})));return function(j){return St.apply(this,arguments)}}()),j);case 10:case"end":return St.stop()}}),_callee10,this)}))),function leave(){return _t.apply(this,arguments)})},{key:"dispose",value:function dispose(){this.logger.info("RCEngine start disposing"),this.logger.info("remove rc listeners"),this._removeListeners(),this.rdcEngine.dispose(),this.logger.info("RCEngine start disposed")}},{key:"getDisplays",value:(_e=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee11(){var j;return rc_regeneratorRuntime().wrap((function _callee11$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this.rdcEngine.getDisplays();case 2:return this._displays=_e.sent,j=this._displays.map((function(j){return{id:j.id,size:{width:j.width,height:j.height},thumbnail:j.thumbnail}})),this.logger.info("get rc displays",j),_e.abrupt("return",j);case 6:case"end":return _e.stop()}}),_callee11,this)}))),function getDisplays(){return _e.apply(this,arguments)})}],[{key:"initialize",value:function initialize(){JO.rtcEngine.on("userJoined",AgoraRemoteControlContext.handleRTCUserJoined),JO.rtcEngine.on("removeStream",AgoraRemoteControlContext.handleRTCUserLeft)}},{key:"cleanup",value:function cleanup(){AgoraRemoteControlContext._channelUsers.clear(),JO.rtcEngine.off("userJoined",AgoraRemoteControlContext.handleRTCUserJoined),JO.rtcEngine.off("removeStream",AgoraRemoteControlContext.handleRTCUserLeft)}}]),AgoraRemoteControlContext}(_a),qP._channelUsers=new Set,qP.handleRTCUserJoined=function(j){ME.info("RC user joined channel",j),qP._channelUsers.add("".concat(j))},qP.handleRTCUserLeft=function(j){ME.info("RC user left channel",j),qP._channelUsers.delete("".concat(j))},GP=qP))||GP;function engine_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */engine_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function engine_createSuper(j){var _e=function engine_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var YP=function(j){_inherits(AgoraRteEngine,j);var _e,_t,St=engine_createSuper(AgoraRteEngine);function AgoraRteEngine(j){var _e;return _classCallCheck(this,AgoraRteEngine),(_e=St.call(this))._mediaControl=void 0,_e._logService=void 0,_e._rtmManager=void 0,_e._rtcManager=void 0,_e._apiServicePathPrefix="",$E.setConfig(j),$E.consoleHijackEnabled&&ME.setupConsoleHijack(),_e._logService=new WP,_e._rtmManager=new _C,_e._rtcManager=new RP(j.rtcConfigs),_e._mediaControl=new tO(_e._rtcManager),$E.platform===KE.Electron&&zP.initialize(),_e}return _createClass(AgoraRteEngine,[{key:"apiServicePathPrefix",get:function get(){return this._apiServicePathPrefix}},{key:"destroy",value:function destroy(){ME.info("RTE engine destroy"),this.getAgoraMediaControl().createCameraVideoTrack().stop(),this.getAgoraMediaControl().createMicrophoneAudioTrack().stop(),this.getAgoraMediaControl().createScreenShareTrack().stop(),$E.platform===KE.Electron&&zP.cleanup(),this.logout(),$E.consoleHijackEnabled&&ME.restoreConsoleHijack(),function cleanup(){OS.forEach((function(j){delete j.__cacheMap})),OS=new Set}(),function cleanup(){LS.forEach((function(j){delete j.__cacheMap})),LS=new Set}()}},{key:"login",value:(_t=_asyncToGenerator(engine_regeneratorRuntime().mark((function _callee(j,_e){var _t;return engine_regeneratorRuntime().wrap((function _callee$(St){for(;;)switch(St.prev=St.next){case 0:return ZT.shared.host="https://api.sd-rtn.com",ZT.shared.pathPrefix="/cn/v1.0/projects/".concat($E.shared.appId,"/app-dev-report"),_t=$E.shared.ignoreUrlRegionPrefix,this._apiServicePathPrefix="".concat(_t?"":"/"+$E.shared.region.toLowerCase(),"/scene/apps/").concat($E.shared.appId),$E.shared.token=j,$E.shared.userId=_e,$E.shared.service.headers={"Content-Type":"application/json","x-agora-token":j,"x-agora-uid":_e,Authorization:'agora token="'.concat(j,'"')},St.next=9,this._rtmManager.login(j,_e,{uploadLog:!1});case 9:return St.abrupt("return",St.sent);case 10:case"end":return St.stop()}}),_callee,this)}))),function login(j,_e){return _t.apply(this,arguments)})},{key:"logout",value:function logout(){this._rtcManager.destroy(),this._rtmManager.destroyRtm()}},{key:"createAgoraRteScene",value:function createAgoraRteScene(j){var _e=_slicedToArray(this._rtmManager.createObserverChannel(j),2),_t=_e[0],St=_e[1],Tt=this._rtcManager.getRtcChannel(j);return new ZR(j,{engine:this,rtc:this._rtcManager,rtcChannel:Tt,rtm:this._rtmManager,rtmChannel:_t,rtmChannelObserver:St})}},{key:"createRemoteControlContext",value:function createRemoteControlContext(j,_e){return new zP(j.rtcChannel,_e)}},{key:"getAgoraMediaControl",value:function getAgoraMediaControl(){return this._mediaControl}},{key:"uploadSDKLogToAgoraService",value:(_e=_asyncToGenerator(engine_regeneratorRuntime().mark((function _callee2(j){var _e,_t,St,Tt,Ut,_r,_n,_i,Ei,Ci,Di;return engine_regeneratorRuntime().wrap((function _callee2$(Fi){for(;;)switch(Fi.prev=Fi.next){case 0:return _t=null,St=null,Fi.next=4,to(ME.collectConsoleLogs());case 4:if(Tt=Fi.sent,Ut=_slicedToArray(Tt,2),_e=Ut[0],_t=Ut[1],_e){Fi.next=22;break}return Fi.next=11,to(this._logService.uploadLogFile(j,_t));case 11:if(_r=Fi.sent,_n=_slicedToArray(_r,1),!(_e=_n[0])){Fi.next=18;break}ZE.shared.handleNonThrowableError(QE.RTE_ERR_WEB_LOG_UPLOAD_ERR,_e),Fi.next=20;break;case 18:return Fi.next=20,to(ME.cleanupConsoleLogs());case 20:Fi.next=23;break;case 22:ZE.shared.handleNonThrowableError(QE.RTE_ERR_WEB_LOG_UPLOAD_ERR,_e);case 23:if($E.platform!==KE.Electron){Fi.next=40;break}return Fi.next=26,to(ME.collectElectronLogs(JO.logBasePath,JO.logFolderPath));case 26:if(_i=Fi.sent,Ei=_slicedToArray(_i,2),_e=Ei[0],St=Ei[1],_e){Fi.next=39;break}return Fi.next=33,to(this._logService.uploadZipLogFile(j,St));case 33:Ci=Fi.sent,Di=_slicedToArray(Ci,1),(_e=Di[0])&&ZE.shared.handleNonThrowableError(QE.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR,_e),Fi.next=40;break;case 39:ZE.shared.handleNonThrowableError(QE.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR,_e);case 40:case"end":return Fi.stop()}}),_callee2,this)}))),function uploadSDKLogToAgoraService(j){return _e.apply(this,arguments)})}],[{key:"createWithConfig",value:function createWithConfig(j){return new AgoraRteEngine(j)}},{key:"getVersion",value:function getVersion(){return $E.version}},{key:"getRtcVersion",value:function getRtcVersion(){return $E.platform===KE.Electron?JO.getRtcVersion():IP.getRtcVersion()}}]),AgoraRteEngine}(_a)})(),__webpack_exports__})()}));
|
|
455
|
+
*/!function(Tt,Ut){"use strict";var _r="function",_n="undefined",_i="object",Ei="model",Ci="name",Di="type",Fi="vendor",_o="version",ga="architecture",_a="console",_s="mobile",_c="tablet",kc="smarttv",_u="wearable",_l={extend:function(j,_e){var _t={};for(var St in j)_e[St]&&_e[St].length%2==0?_t[St]=_e[St].concat(j[St]):_t[St]=j[St];return _t},has:function(j,_e){return"string"==typeof j&&-1!==_e.toLowerCase().indexOf(j.toLowerCase())},lowerize:function(j){return j.toLowerCase()},major:function(j){return"string"==typeof j?j.replace(/[^\d\.]/g,"").split(".")[0]:Ut},trim:function(j){return j.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},_d={rgx:function(j,_e){for(var _t,St,Tt,_n,Ei,Ci,Di=0;Di<_e.length&&!Ei;){var Fi=_e[Di],_o=_e[Di+1];for(_t=St=0;_t<Fi.length&&!Ei;)if(Ei=Fi[_t++].exec(j))for(Tt=0;Tt<_o.length;Tt++)Ci=Ei[++St],typeof(_n=_o[Tt])===_i&&_n.length>0?2==_n.length?typeof _n[1]==_r?this[_n[0]]=_n[1].call(this,Ci):this[_n[0]]=_n[1]:3==_n.length?typeof _n[1]!==_r||_n[1].exec&&_n[1].test?this[_n[0]]=Ci?Ci.replace(_n[1],_n[2]):Ut:this[_n[0]]=Ci?_n[1].call(this,Ci,_n[2]):Ut:4==_n.length&&(this[_n[0]]=Ci?_n[3].call(this,Ci.replace(_n[1],_n[2])):Ut):this[_n]=Ci||Ut;Di+=2}},str:function(j,_e){for(var _t in _e)if(typeof _e[_t]===_i&&_e[_t].length>0){for(var St=0;St<_e[_t].length;St++)if(_l.has(_e[_t][St],j))return"?"===_t?Ut:_t}else if(_l.has(_e[_t],j))return"?"===_t?Ut:_t;return j}},_h={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},_f={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6}).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[Ci,_o],[/(opios)[\/\s]+([\w\.]+)/i],[[Ci,"Opera Mini"],_o],[/\s(opr)\/([\w\.]+)/i],[[Ci,"Opera"],_o],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[Ci,_o],[/(konqueror)\/([\w\.]+)/i],[[Ci,"Konqueror"],_o],[/(trident).+rv[:\s]([\w\.]{1,9}).+like\sgecko/i],[[Ci,"IE"],_o],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[Ci,"Edge"],_o],[/(yabrowser)\/([\w\.]+)/i],[[Ci,"Yandex"],_o],[/(Avast)\/([\w\.]+)/i],[[Ci,"Avast Secure Browser"],_o],[/(AVG)\/([\w\.]+)/i],[[Ci,"AVG Secure Browser"],_o],[/(puffin)\/([\w\.]+)/i],[[Ci,"Puffin"],_o],[/(focus)\/([\w\.]+)/i],[[Ci,"Firefox Focus"],_o],[/(opt)\/([\w\.]+)/i],[[Ci,"Opera Touch"],_o],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[Ci,"UCBrowser"],_o],[/(comodo_dragon)\/([\w\.]+)/i],[[Ci,/_/g," "],_o],[/(windowswechat qbcore)\/([\w\.]+)/i],[[Ci,"WeChat(Win) Desktop"],_o],[/(micromessenger)\/([\w\.]+)/i],[[Ci,"WeChat"],_o],[/(brave)\/([\w\.]+)/i],[[Ci,"Brave"],_o],[/(whale)\/([\w\.]+)/i],[[Ci,"Whale"],_o],[/(qqbrowserlite)\/([\w\.]+)/i],[Ci,_o],[/(QQ)\/([\d\.]+)/i],[Ci,_o],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[Ci,_o],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[Ci,_o],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[Ci,_o],[/(MetaSr)[\/\s]?([\w\.]+)/i],[Ci],[/(LBBROWSER)/i],[Ci],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[_o,[Ci,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[_o,[Ci,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[Ci,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[Ci,_o],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[_o,[Ci,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[Ci,/(.+)/,"$1 WebView"],_o],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[Ci,/(.+(?:g|us))(.+)/,"$1 $2"],_o],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[_o,[Ci,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[Ci,"Sailfish Browser"],_o],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[Ci,_o],[/(dolfin)\/([\w\.]+)/i],[[Ci,"Dolphin"],_o],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[Ci,"360 Browser"]],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[Ci,"Chrome"],_o],[/(coast)\/([\w\.]+)/i],[[Ci,"Opera Coast"],_o],[/fxios\/([\w\.-]+)/i],[_o,[Ci,"Firefox"]],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[_o,[Ci,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[_o,Ci],[/webkit.+?(gsa)\/([\w\.]+)\s.*(mobile\s?safari|safari)(\/[\w\.]+)/i],[[Ci,"GSA"],_o],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[Ci,[_o,_d.str,_h.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[Ci,_o],[/(navigator|netscape)\/([\w\.-]+)/i],[[Ci,"Netscape"],_o],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[Ci,_o]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[ga,"amd64"]],[/(ia32(?=;))/i],[[ga,_l.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[ga,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[ga,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[ga,/ower/,"",_l.lowerize]],[/(sun4\w)[;\)]/i],[[ga,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[ga,_l.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[Ei,Fi,[Di,_c]],[/applecoremedia\/[\w\.]+ \((ipad)/],[Ei,[Fi,"Apple"],[Di,_c]],[/(apple\s{0,1}tv)/i],[[Ei,"Apple TV"],[Fi,"Apple"],[Di,kc]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[Fi,Ei,[Di,_c]],[/(kf[A-z]+)(\sbuild\/|\)).+silk\//i],[Ei,[Fi,"Amazon"],[Di,_c]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[Ei,_d.str,_h.device.amazon.model],[Fi,"Amazon"],[Di,_s]],[/android.+aft([bms])\sbuild/i],[Ei,[Fi,"Amazon"],[Di,kc]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[Ei,Fi,[Di,_s]],[/\((ip[honed|\s\w*]+);/i],[Ei,[Fi,"Apple"],[Di,_s]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[Fi,Ei,[Di,_s]],[/\(bb10;\s(\w+)/i],[Ei,[Fi,"BlackBerry"],[Di,_s]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[Ei,[Fi,"Asus"],[Di,_c]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[Fi,"Sony"],[Ei,"Xperia Tablet"],[Di,_c]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[Ei,[Fi,"Sony"],[Di,_s]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[Fi,Ei,[Di,_a]],[/android.+;\s(shield)\sbuild/i],[Ei,[Fi,"Nvidia"],[Di,_a]],[/(playstation\s[34portablevi]+)/i],[Ei,[Fi,"Sony"],[Di,_a]],[/(sprint\s(\w+))/i],[[Fi,_d.str,_h.device.sprint.vendor],[Ei,_d.str,_h.device.sprint.model],[Di,_s]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[Fi,[Ei,/_/g," "],[Di,_s]],[/(nexus\s9)/i],[Ei,[Fi,"HTC"],[Di,_c]],[/d\/huawei([\w\s-]+)[;\)]/i,/android.+\s(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?)/i],[Ei,[Fi,"Huawei"],[Di,_s]],[/android.+(bah2?-a?[lw]\d{2})/i],[Ei,[Fi,"Huawei"],[Di,_c]],[/(microsoft);\s(lumia[\s\w]+)/i],[Fi,Ei,[Di,_s]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[Ei,[Fi,"Microsoft"],[Di,_a]],[/(kin\.[onetw]{3})/i],[[Ei,/\./g," "],[Fi,"Microsoft"],[Di,_s]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[Ei,[Fi,"Motorola"],[Di,_s]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[Ei,[Fi,"Motorola"],[Di,_c]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[Fi,_l.trim],[Ei,_l.trim],[Di,kc]],[/hbbtv.+maple;(\d+)/i],[[Ei,/^/,"SmartTV"],[Fi,"Samsung"],[Di,kc]],[/\(dtv[\);].+(aquos)/i],[Ei,[Fi,"Sharp"],[Di,kc]],[/android.+((sch-i[89]0\d|shw-m380s|SM-P605|SM-P610|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[Fi,"Samsung"],Ei,[Di,_c]],[/smart-tv.+(samsung)/i],[Fi,[Di,kc],Ei],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[Fi,"Samsung"],Ei,[Di,_s]],[/sie-(\w*)/i],[Ei,[Fi,"Siemens"],[Di,_s]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[Fi,"Nokia"],Ei,[Di,_s]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[Ei,[Fi,"Acer"],[Di,_c]],[/android.+([vl]k\-?\d{3})\s+build/i],[Ei,[Fi,"LG"],[Di,_c]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[Fi,"LG"],Ei,[Di,_c]],[/linux;\snetcast.+smarttv/i,/lg\snetcast\.tv-201\d/i],[[Fi,"LG"],Ei,[Di,kc]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[Ei,[Fi,"LG"],[Di,_s]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[Fi,Ei,[Di,_c]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[Ei,[Fi,"Lenovo"],[Di,_c]],[/(lenovo)[_\s-]?([\w-]+)/i],[Fi,Ei,[Di,_s]],[/linux;.+((jolla));/i],[Fi,Ei,[Di,_s]],[/((pebble))app\/[\d\.]+\s/i],[Fi,Ei,[Di,_u]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[Fi,Ei,[Di,_s]],[/crkey/i],[[Ei,"Chromecast"],[Fi,"Google"],[Di,kc]],[/android.+;\s(glass)\s\d/i],[Ei,[Fi,"Google"],[Di,_u]],[/android.+;\s(pixel c)[\s)]/i],[Ei,[Fi,"Google"],[Di,_c]],[/android.+;\s(pixel( [2-9]a?)?( xl)?)[\s)]/i],[Ei,[Fi,"Google"],[Di,_s]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/android.+(redmi[\s\-_]?(?:note|k)?(?:[\s_]?[\w\s]+))(?:\sbuild|\))/i,/android.+(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[Ei,/_/g," "],[Fi,"Xiaomi"],[Di,_s]],[/android.+(mi[\s\-_]?(?:pad)(?:[\s_]?[\w\s]+))(?:\sbuild|\))/i],[[Ei,/_/g," "],[Fi,"Xiaomi"],[Di,_c]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[Ei,[Fi,"Meizu"],[Di,_s]],[/(mz)-([\w-]{2,})/i],[[Fi,"Meizu"],Ei,[Di,_s]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[Ei,[Fi,"OnePlus"],[Di,_s]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[Ei,[Fi,"RCA"],[Di,_c]],[/android.+[;\/\s](Venue[\d\s]{2,7})\s+build/i],[Ei,[Fi,"Dell"],[Di,_c]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[Ei,[Fi,"Verizon"],[Di,_c]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[Fi,"Barnes & Noble"],Ei,[Di,_c]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[Ei,[Fi,"NuVision"],[Di,_c]],[/android.+;\s(k88)\sbuild/i],[Ei,[Fi,"ZTE"],[Di,_c]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[Ei,[Fi,"Swiss"],[Di,_s]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[Ei,[Fi,"Swiss"],[Di,_c]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[Ei,[Fi,"Zeki"],[Di,_c]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[Fi,"Dragon Touch"],Ei,[Di,_c]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[Ei,[Fi,"Insignia"],[Di,_c]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[Ei,[Fi,"NextBook"],[Di,_c]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[Fi,"Voice"],Ei,[Di,_s]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[Fi,"LvTel"],Ei,[Di,_s]],[/android.+;\s(PH-1)\s/i],[Ei,[Fi,"Essential"],[Di,_s]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[Ei,[Fi,"Envizen"],[Di,_c]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[Fi,Ei,[Di,_c]],[/android.+[;\/]\s*(Trio[\s\w\-\.]+)\s+build/i],[Ei,[Fi,"MachSpeed"],[Di,_c]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[Fi,Ei,[Di,_c]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[Ei,[Fi,"Rotor"],[Di,_c]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[Fi,Ei,[Di,_c]],[/android .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[Ei,[Di,_s]],[/android .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[Ei,[Di,_c]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[Di,_l.lowerize],Fi,Ei],[/[\s\/\(](smart-?tv)[;\)]/i],[[Di,kc]],[/(android[\w\.\s\-]{0,9});.+build/i],[Ei,[Fi,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[_o,[Ci,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[_o,[Ci,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[Ci,_o],[/rv\:([\w\.]{1,9}).+(gecko)/i],[_o,Ci]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[Ci,_o],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[Ci,[_o,_d.str,_h.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[Ci,"Windows"],[_o,_d.str,_h.os.windows.version]],[/\((bb)(10);/i],[[Ci,"BlackBerry"],_o],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[Ci,_o],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[Ci,"Symbian"],_o],[/\((series40);/i],[Ci],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[Ci,"Firefox OS"],_o],[/crkey\/([\d\.]+)/i],[_o,[Ci,"Chromecast"]],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[Ci,_o],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[Ci,"Chromium OS"],_o],[/(sunos)\s?([\w\.\d]*)/i],[[Ci,"Solaris"],_o],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[Ci,_o],[/(haiku)\s(\w+)/i],[Ci,_o],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[_o,/_/g,"."],[Ci,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[Ci,"Mac OS"],[_o,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[Ci,_o]]},UAParser=function(j,_e){if("object"==typeof j&&(_e=j,j=Ut),!(this instanceof UAParser))return new UAParser(j,_e).getResult();var _t=j||(Tt&&Tt.navigator&&Tt.navigator.userAgent?Tt.navigator.userAgent:""),St=_e?_l.extend(_f,_e):_f;return this.getBrowser=function(){var j={name:Ut,version:Ut};return _d.rgx.call(j,_t,St.browser),j.major=_l.major(j.version),j},this.getCPU=function(){var j={architecture:Ut};return _d.rgx.call(j,_t,St.cpu),j},this.getDevice=function(){var j={vendor:Ut,model:Ut,type:Ut};return _d.rgx.call(j,_t,St.device),j},this.getEngine=function(){var j={name:Ut,version:Ut};return _d.rgx.call(j,_t,St.engine),j},this.getOS=function(){var j={name:Ut,version:Ut};return _d.rgx.call(j,_t,St.os),j},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return _t},this.setUA=function(j){return _t=j,this},this};UAParser.VERSION="0.7.23",UAParser.BROWSER={NAME:Ci,MAJOR:"major",VERSION:_o},UAParser.CPU={ARCHITECTURE:ga},UAParser.DEVICE={MODEL:Ei,VENDOR:Fi,TYPE:Di,CONSOLE:_a,MOBILE:_s,SMARTTV:kc,TABLET:_c,WEARABLE:_u,EMBEDDED:"embedded"},UAParser.ENGINE={NAME:Ci,VERSION:_o},UAParser.OS={NAME:Ci,VERSION:_o},typeof _e!==_n?(j.exports&&(_e=j.exports=UAParser),_e.UAParser=UAParser):(St=function(){return UAParser}.call(_e,_t,_e,j))===Ut||(j.exports=St);var _p=Tt&&(Tt.jQuery||Tt.Zepto);if(_p&&!_p.ua){var Eg=new UAParser;_p.ua=Eg.getResult(),_p.ua.get=function(){return Eg.getUA()},_p.ua.set=function(j){Eg.setUA(j);var _e=Eg.getResult();for(var _t in _e)_p.ua[_t]=_e[_t]}}}("object"==typeof window?window:this)},1005:j=>{"use strict";j.exports=function(j,_e,_t,St){var Tt=self||window;try{try{var Ut;try{Ut=new Tt.Blob([j])}catch(_e){(Ut=new(Tt.BlobBuilder||Tt.WebKitBlobBuilder||Tt.MozBlobBuilder||Tt.MSBlobBuilder)).append(j),Ut=Ut.getBlob()}var _r=Tt.URL||Tt.webkitURL,_n=_r.createObjectURL(Ut),_i=new Tt[_e](_n,_t);return _r.revokeObjectURL(_n),_i}catch(St){return new Tt[_e]("data:application/javascript,".concat(encodeURIComponent(j)),_t)}}catch(j){if(!St)throw Error("Inline worker is not supported");return new Tt[_e](St,_t)}}},9662:(j,_e,_t)=>{var St=_t(7854),Tt=_t(614),Ut=_t(6330),_r=St.TypeError;j.exports=function(j){if(Tt(j))return j;throw _r(Ut(j)+" is not a function")}},9483:(j,_e,_t)=>{var St=_t(7854),Tt=_t(4411),Ut=_t(6330),_r=St.TypeError;j.exports=function(j){if(Tt(j))return j;throw _r(Ut(j)+" is not a constructor")}},6077:(j,_e,_t)=>{var St=_t(7854),Tt=_t(614),Ut=St.String,_r=St.TypeError;j.exports=function(j){if("object"==typeof j||Tt(j))return j;throw _r("Can't set "+Ut(j)+" as a prototype")}},1223:(j,_e,_t)=>{var St=_t(5112),Tt=_t(30),Ut=_t(3070),_r=St("unscopables"),_n=Array.prototype;null==_n[_r]&&Ut.f(_n,_r,{configurable:!0,value:Tt(null)}),j.exports=function(j){_n[_r][j]=!0}},1530:(j,_e,_t)=>{"use strict";var St=_t(8710).charAt;j.exports=function(j,_e,_t){return _e+(_t?St(j,_e).length:1)}},5787:(j,_e,_t)=>{var St=_t(7854),Tt=_t(7976),Ut=St.TypeError;j.exports=function(j,_e){if(Tt(_e,j))return j;throw Ut("Incorrect invocation")}},9670:(j,_e,_t)=>{var St=_t(7854),Tt=_t(111),Ut=St.String,_r=St.TypeError;j.exports=function(j){if(Tt(j))return j;throw _r(Ut(j)+" is not an object")}},5381:j=>{j.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7556:(j,_e,_t)=>{var St=_t(7293);j.exports=St((function(){if("function"==typeof ArrayBuffer){var j=new ArrayBuffer(8);Object.isExtensible(j)&&Object.defineProperty(j,"a",{value:8})}}))},260:(j,_e,_t)=>{"use strict";var St,Tt,Ut,_r=_t(5381),_n=_t(9781),_i=_t(7854),Ei=_t(614),Ci=_t(111),Di=_t(2597),Fi=_t(648),_o=_t(6330),ga=_t(8880),_a=_t(1320),_s=_t(3070).f,_c=_t(7976),kc=_t(9518),_u=_t(7674),_l=_t(5112),_d=_t(9711),_h=_i.Int8Array,_f=_h&&_h.prototype,_p=_i.Uint8ClampedArray,Eg=_p&&_p.prototype,_v=_h&&kc(_h),_m=_f&&kc(_f),Pm=Object.prototype,_y=_i.TypeError,_A=_l("toStringTag"),e_=_d("TYPED_ARRAY_TAG"),t_=_d("TYPED_ARRAY_CONSTRUCTOR"),r_=_r&&!!_u&&"Opera"!==Fi(_i.opera),i_=!1,a_={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},s_={BigInt64Array:8,BigUint64Array:8},isTypedArray=function(j){if(!Ci(j))return!1;var _e=Fi(j);return Di(a_,_e)||Di(s_,_e)};for(St in a_)(Ut=(Tt=_i[St])&&Tt.prototype)?ga(Ut,t_,Tt):r_=!1;for(St in s_)(Ut=(Tt=_i[St])&&Tt.prototype)&&ga(Ut,t_,Tt);if((!r_||!Ei(_v)||_v===Function.prototype)&&(_v=function TypedArray(){throw _y("Incorrect invocation")},r_))for(St in a_)_i[St]&&_u(_i[St],_v);if((!r_||!_m||_m===Pm)&&(_m=_v.prototype,r_))for(St in a_)_i[St]&&_u(_i[St].prototype,_m);if(r_&&kc(Eg)!==_m&&_u(Eg,_m),_n&&!Di(_m,_A))for(St in i_=!0,_s(_m,_A,{get:function(){return Ci(this)?this[e_]:void 0}}),a_)_i[St]&&ga(_i[St],e_,St);j.exports={NATIVE_ARRAY_BUFFER_VIEWS:r_,TYPED_ARRAY_CONSTRUCTOR:t_,TYPED_ARRAY_TAG:i_&&e_,aTypedArray:function(j){if(isTypedArray(j))return j;throw _y("Target is not a typed array")},aTypedArrayConstructor:function(j){if(Ei(j)&&(!_u||_c(_v,j)))return j;throw _y(_o(j)+" is not a typed array constructor")},exportTypedArrayMethod:function(j,_e,_t,St){if(_n){if(_t)for(var Tt in a_){var Ut=_i[Tt];if(Ut&&Di(Ut.prototype,j))try{delete Ut.prototype[j]}catch(j){}}_m[j]&&!_t||_a(_m,j,_t?_e:r_&&_f[j]||_e,St)}},exportTypedArrayStaticMethod:function(j,_e,_t){var St,Tt;if(_n){if(_u){if(_t)for(St in a_)if((Tt=_i[St])&&Di(Tt,j))try{delete Tt[j]}catch(j){}if(_v[j]&&!_t)return;try{return _a(_v,j,_t?_e:r_&&_v[j]||_e)}catch(j){}}for(St in a_)!(Tt=_i[St])||Tt[j]&&!_t||_a(Tt,j,_e)}},isView:function isView(j){if(!Ci(j))return!1;var _e=Fi(j);return"DataView"===_e||Di(a_,_e)||Di(s_,_e)},isTypedArray,TypedArray:_v,TypedArrayPrototype:_m}},3331:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(1702),Ut=_t(9781),_r=_t(5381),_n=_t(6530),_i=_t(8880),Ei=_t(2248),Ci=_t(7293),Di=_t(5787),Fi=_t(9303),_o=_t(7466),ga=_t(7067),_a=_t(1179),_s=_t(9518),_c=_t(7674),kc=_t(8006).f,_u=_t(3070).f,_l=_t(1285),_d=_t(1589),_h=_t(8003),_f=_t(9909),_p=_n.PROPER,Eg=_n.CONFIGURABLE,_v=_f.get,_m=_f.set,Pm="ArrayBuffer",_y="DataView",_A="prototype",e_="Wrong index",t_=St[Pm],r_=t_,i_=r_&&r_[_A],a_=St[_y],s_=a_&&a_[_A],c_=Object.prototype,u_=St.Array,l_=St.RangeError,d_=Tt(_l),h_=Tt([].reverse),f_=_a.pack,p_=_a.unpack,packInt8=function(j){return[255&j]},packInt16=function(j){return[255&j,j>>8&255]},packInt32=function(j){return[255&j,j>>8&255,j>>16&255,j>>24&255]},unpackInt32=function(j){return j[3]<<24|j[2]<<16|j[1]<<8|j[0]},packFloat32=function(j){return f_(j,23,4)},packFloat64=function(j){return f_(j,52,8)},addGetter=function(j,_e){_u(j[_A],_e,{get:function(){return _v(this)[_e]}})},get=function(j,_e,_t,St){var Tt=ga(_t),Ut=_v(j);if(Tt+_e>Ut.byteLength)throw l_(e_);var _r=_v(Ut.buffer).bytes,_n=Tt+Ut.byteOffset,_i=_d(_r,_n,_n+_e);return St?_i:h_(_i)},set=function(j,_e,_t,St,Tt,Ut){var _r=ga(_t),_n=_v(j);if(_r+_e>_n.byteLength)throw l_(e_);for(var _i=_v(_n.buffer).bytes,Ei=_r+_n.byteOffset,Ci=St(+Tt),Di=0;Di<_e;Di++)_i[Ei+Di]=Ci[Ut?Di:_e-Di-1]};if(_r){var v_=_p&&t_.name!==Pm;if(Ci((function(){t_(1)}))&&Ci((function(){new t_(-1)}))&&!Ci((function(){return new t_,new t_(1.5),new t_(NaN),v_&&!Eg})))v_&&Eg&&_i(t_,"name",Pm);else{(r_=function ArrayBuffer(j){return Di(this,i_),new t_(ga(j))})[_A]=i_;for(var m_,y_=kc(t_),A_=0;y_.length>A_;)(m_=y_[A_++])in r_||_i(r_,m_,t_[m_]);i_.constructor=r_}_c&&_s(s_)!==c_&&_c(s_,c_);var __=new a_(new r_(2)),b_=Tt(s_.setInt8);__.setInt8(0,2147483648),__.setInt8(1,2147483649),!__.getInt8(0)&&__.getInt8(1)||Ei(s_,{setInt8:function setInt8(j,_e){b_(this,j,_e<<24>>24)},setUint8:function setUint8(j,_e){b_(this,j,_e<<24>>24)}},{unsafe:!0})}else i_=(r_=function ArrayBuffer(j){Di(this,i_);var _e=ga(j);_m(this,{bytes:d_(u_(_e),0),byteLength:_e}),Ut||(this.byteLength=_e)})[_A],s_=(a_=function DataView(j,_e,_t){Di(this,s_),Di(j,i_);var St=_v(j).byteLength,Tt=Fi(_e);if(Tt<0||Tt>St)throw l_("Wrong offset");if(Tt+(_t=void 0===_t?St-Tt:_o(_t))>St)throw l_("Wrong length");_m(this,{buffer:j,byteLength:_t,byteOffset:Tt}),Ut||(this.buffer=j,this.byteLength=_t,this.byteOffset=Tt)})[_A],Ut&&(addGetter(r_,"byteLength"),addGetter(a_,"buffer"),addGetter(a_,"byteLength"),addGetter(a_,"byteOffset")),Ei(s_,{getInt8:function getInt8(j){return get(this,1,j)[0]<<24>>24},getUint8:function getUint8(j){return get(this,1,j)[0]},getInt16:function getInt16(j){var _e=get(this,2,j,arguments.length>1?arguments[1]:void 0);return(_e[1]<<8|_e[0])<<16>>16},getUint16:function getUint16(j){var _e=get(this,2,j,arguments.length>1?arguments[1]:void 0);return _e[1]<<8|_e[0]},getInt32:function getInt32(j){return unpackInt32(get(this,4,j,arguments.length>1?arguments[1]:void 0))},getUint32:function getUint32(j){return unpackInt32(get(this,4,j,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function getFloat32(j){return p_(get(this,4,j,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function getFloat64(j){return p_(get(this,8,j,arguments.length>1?arguments[1]:void 0),52)},setInt8:function setInt8(j,_e){set(this,1,j,packInt8,_e)},setUint8:function setUint8(j,_e){set(this,1,j,packInt8,_e)},setInt16:function setInt16(j,_e){set(this,2,j,packInt16,_e,arguments.length>2?arguments[2]:void 0)},setUint16:function setUint16(j,_e){set(this,2,j,packInt16,_e,arguments.length>2?arguments[2]:void 0)},setInt32:function setInt32(j,_e){set(this,4,j,packInt32,_e,arguments.length>2?arguments[2]:void 0)},setUint32:function setUint32(j,_e){set(this,4,j,packInt32,_e,arguments.length>2?arguments[2]:void 0)},setFloat32:function setFloat32(j,_e){set(this,4,j,packFloat32,_e,arguments.length>2?arguments[2]:void 0)},setFloat64:function setFloat64(j,_e){set(this,8,j,packFloat64,_e,arguments.length>2?arguments[2]:void 0)}});_h(r_,Pm),_h(a_,_y),j.exports={ArrayBuffer:r_,DataView:a_}},1048:(j,_e,_t)=>{"use strict";var St=_t(7908),Tt=_t(1400),Ut=_t(6244),_r=Math.min;j.exports=[].copyWithin||function copyWithin(j,_e){var _t=St(this),_n=Ut(_t),_i=Tt(j,_n),Ei=Tt(_e,_n),Ci=arguments.length>2?arguments[2]:void 0,Di=_r((void 0===Ci?_n:Tt(Ci,_n))-Ei,_n-_i),Fi=1;for(Ei<_i&&_i<Ei+Di&&(Fi=-1,Ei+=Di-1,_i+=Di-1);Di-- >0;)Ei in _t?_t[_i]=_t[Ei]:delete _t[_i],_i+=Fi,Ei+=Fi;return _t}},1285:(j,_e,_t)=>{"use strict";var St=_t(7908),Tt=_t(1400),Ut=_t(6244);j.exports=function fill(j){for(var _e=St(this),_t=Ut(_e),_r=arguments.length,_n=Tt(_r>1?arguments[1]:void 0,_t),_i=_r>2?arguments[2]:void 0,Ei=void 0===_i?_t:Tt(_i,_t);Ei>_n;)_e[_n++]=j;return _e}},8533:(j,_e,_t)=>{"use strict";var St=_t(2092).forEach,Tt=_t(2133)("forEach");j.exports=Tt?[].forEach:function forEach(j){return St(this,j,arguments.length>1?arguments[1]:void 0)}},7745:(j,_e,_t)=>{var St=_t(6244);j.exports=function(j,_e){for(var _t=0,Tt=St(_e),Ut=new j(Tt);Tt>_t;)Ut[_t]=_e[_t++];return Ut}},8457:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(9974),Ut=_t(6916),_r=_t(7908),_n=_t(3411),_i=_t(7659),Ei=_t(4411),Ci=_t(6244),Di=_t(6135),Fi=_t(8554),_o=_t(1246),ga=St.Array;j.exports=function from(j){var _e=_r(j),_t=Ei(this),St=arguments.length,_a=St>1?arguments[1]:void 0,_s=void 0!==_a;_s&&(_a=Tt(_a,St>2?arguments[2]:void 0));var _c,kc,_u,_l,_d,_h,_f=_o(_e),_p=0;if(!_f||this==ga&&_i(_f))for(_c=Ci(_e),kc=_t?new this(_c):ga(_c);_c>_p;_p++)_h=_s?_a(_e[_p],_p):_e[_p],Di(kc,_p,_h);else for(_d=(_l=Fi(_e,_f)).next,kc=_t?new this:[];!(_u=Ut(_d,_l)).done;_p++)_h=_s?_n(_l,_a,[_u.value,_p],!0):_u.value,Di(kc,_p,_h);return kc.length=_p,kc}},1318:(j,_e,_t)=>{var St=_t(5656),Tt=_t(1400),Ut=_t(6244),createMethod=function(j){return function(_e,_t,_r){var _n,_i=St(_e),Ei=Ut(_i),Ci=Tt(_r,Ei);if(j&&_t!=_t){for(;Ei>Ci;)if((_n=_i[Ci++])!=_n)return!0}else for(;Ei>Ci;Ci++)if((j||Ci in _i)&&_i[Ci]===_t)return j||Ci||0;return!j&&-1}};j.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},2092:(j,_e,_t)=>{var St=_t(9974),Tt=_t(1702),Ut=_t(8361),_r=_t(7908),_n=_t(6244),_i=_t(5417),Ei=Tt([].push),createMethod=function(j){var _e=1==j,_t=2==j,Tt=3==j,Ci=4==j,Di=6==j,Fi=7==j,_o=5==j||Di;return function(ga,_a,_s,_c){for(var kc,_u,_l=_r(ga),_d=Ut(_l),_h=St(_a,_s),_f=_n(_d),_p=0,Eg=_c||_i,_v=_e?Eg(ga,_f):_t||Fi?Eg(ga,0):void 0;_f>_p;_p++)if((_o||_p in _d)&&(_u=_h(kc=_d[_p],_p,_l),j))if(_e)_v[_p]=_u;else if(_u)switch(j){case 3:return!0;case 5:return kc;case 6:return _p;case 2:Ei(_v,kc)}else switch(j){case 4:return!1;case 7:Ei(_v,kc)}return Di?-1:Tt||Ci?Ci:_v}};j.exports={forEach:createMethod(0),map:createMethod(1),filter:createMethod(2),some:createMethod(3),every:createMethod(4),find:createMethod(5),findIndex:createMethod(6),filterReject:createMethod(7)}},6583:(j,_e,_t)=>{"use strict";var St=_t(2104),Tt=_t(5656),Ut=_t(9303),_r=_t(6244),_n=_t(2133),_i=Math.min,Ei=[].lastIndexOf,Ci=!!Ei&&1/[1].lastIndexOf(1,-0)<0,Di=_n("lastIndexOf"),Fi=Ci||!Di;j.exports=Fi?function lastIndexOf(j){if(Ci)return St(Ei,this,arguments)||0;var _e=Tt(this),_t=_r(_e),_n=_t-1;for(arguments.length>1&&(_n=_i(_n,Ut(arguments[1]))),_n<0&&(_n=_t+_n);_n>=0;_n--)if(_n in _e&&_e[_n]===j)return _n||0;return-1}:Ei},1194:(j,_e,_t)=>{var St=_t(7293),Tt=_t(5112),Ut=_t(7392),_r=Tt("species");j.exports=function(j){return Ut>=51||!St((function(){var _e=[];return(_e.constructor={})[_r]=function(){return{foo:1}},1!==_e[j](Boolean).foo}))}},2133:(j,_e,_t)=>{"use strict";var St=_t(7293);j.exports=function(j,_e){var _t=[][j];return!!_t&&St((function(){_t.call(null,_e||function(){throw 1},1)}))}},3671:(j,_e,_t)=>{var St=_t(7854),Tt=_t(9662),Ut=_t(7908),_r=_t(8361),_n=_t(6244),_i=St.TypeError,createMethod=function(j){return function(_e,_t,St,Ei){Tt(_t);var Ci=Ut(_e),Di=_r(Ci),Fi=_n(Ci),_o=j?Fi-1:0,ga=j?-1:1;if(St<2)for(;;){if(_o in Di){Ei=Di[_o],_o+=ga;break}if(_o+=ga,j?_o<0:Fi<=_o)throw _i("Reduce of empty array with no initial value")}for(;j?_o>=0:Fi>_o;_o+=ga)_o in Di&&(Ei=_t(Ei,Di[_o],_o,Ci));return Ei}};j.exports={left:createMethod(!1),right:createMethod(!0)}},1589:(j,_e,_t)=>{var St=_t(7854),Tt=_t(1400),Ut=_t(6244),_r=_t(6135),_n=St.Array,_i=Math.max;j.exports=function(j,_e,_t){for(var St=Ut(j),Ei=Tt(_e,St),Ci=Tt(void 0===_t?St:_t,St),Di=_n(_i(Ci-Ei,0)),Fi=0;Ei<Ci;Ei++,Fi++)_r(Di,Fi,j[Ei]);return Di.length=Fi,Di}},206:(j,_e,_t)=>{var St=_t(1702);j.exports=St([].slice)},6329:(j,_e,_t)=>{var St=_t(1589),Tt=Math.floor,mergeSort=function(j,_e){var _t=j.length,Ut=Tt(_t/2);return _t<8?insertionSort(j,_e):merge(j,mergeSort(St(j,0,Ut),_e),mergeSort(St(j,Ut),_e),_e)},insertionSort=function(j,_e){for(var _t,St,Tt=j.length,Ut=1;Ut<Tt;){for(St=Ut,_t=j[Ut];St&&_e(j[St-1],_t)>0;)j[St]=j[--St];St!==Ut++&&(j[St]=_t)}return j},merge=function(j,_e,_t,St){for(var Tt=_e.length,Ut=_t.length,_r=0,_n=0;_r<Tt||_n<Ut;)j[_r+_n]=_r<Tt&&_n<Ut?St(_e[_r],_t[_n])<=0?_e[_r++]:_t[_n++]:_r<Tt?_e[_r++]:_t[_n++];return j};j.exports=mergeSort},7475:(j,_e,_t)=>{var St=_t(7854),Tt=_t(3157),Ut=_t(4411),_r=_t(111),_n=_t(5112)("species"),_i=St.Array;j.exports=function(j){var _e;return Tt(j)&&(_e=j.constructor,(Ut(_e)&&(_e===_i||Tt(_e.prototype))||_r(_e)&&null===(_e=_e[_n]))&&(_e=void 0)),void 0===_e?_i:_e}},5417:(j,_e,_t)=>{var St=_t(7475);j.exports=function(j,_e){return new(St(j))(0===_e?0:_e)}},3411:(j,_e,_t)=>{var St=_t(9670),Tt=_t(9212);j.exports=function(j,_e,_t,Ut){try{return Ut?_e(St(_t)[0],_t[1]):_e(_t)}catch(_e){Tt(j,"throw",_e)}}},7072:(j,_e,_t)=>{var St=_t(5112)("iterator"),Tt=!1;try{var Ut=0,_r={next:function(){return{done:!!Ut++}},return:function(){Tt=!0}};_r[St]=function(){return this},Array.from(_r,(function(){throw 2}))}catch(j){}j.exports=function(j,_e){if(!_e&&!Tt)return!1;var _t=!1;try{var Ut={};Ut[St]=function(){return{next:function(){return{done:_t=!0}}}},j(Ut)}catch(j){}return _t}},4326:(j,_e,_t)=>{var St=_t(1702),Tt=St({}.toString),Ut=St("".slice);j.exports=function(j){return Ut(Tt(j),8,-1)}},648:(j,_e,_t)=>{var St=_t(7854),Tt=_t(1694),Ut=_t(614),_r=_t(4326),_n=_t(5112)("toStringTag"),_i=St.Object,Ei="Arguments"==_r(function(){return arguments}());j.exports=Tt?_r:function(j){var _e,_t,St;return void 0===j?"Undefined":null===j?"Null":"string"==typeof(_t=function(j,_e){try{return j[_e]}catch(j){}}(_e=_i(j),_n))?_t:Ei?_r(_e):"Object"==(St=_r(_e))&&Ut(_e.callee)?"Arguments":St}},1501:(j,_e,_t)=>{"use strict";var St=_t(6916),Tt=_t(9662),Ut=_t(9670);j.exports=function addAll(){for(var j=Ut(this),_e=Tt(j.add),_t=0,_r=arguments.length;_t<_r;_t++)St(_e,j,arguments[_t]);return j}},4092:(j,_e,_t)=>{"use strict";var St=_t(6916),Tt=_t(9662),Ut=_t(9670);j.exports=function deleteAll(){for(var j,_e=Ut(this),_t=Tt(_e.delete),_r=!0,_n=0,_i=arguments.length;_n<_i;_n++)j=St(_t,_e,arguments[_n]),_r=_r&&j;return!!_r}},5631:(j,_e,_t)=>{"use strict";var St=_t(3070).f,Tt=_t(30),Ut=_t(2248),_r=_t(9974),_n=_t(5787),_i=_t(612),Ei=_t(654),Ci=_t(6340),Di=_t(9781),Fi=_t(2423).fastKey,_o=_t(9909),ga=_o.set,_a=_o.getterFor;j.exports={getConstructor:function(j,_e,_t,Ei){var Ci=j((function(j,St){_n(j,_o),ga(j,{type:_e,index:Tt(null),first:void 0,last:void 0,size:0}),Di||(j.size=0),null!=St&&_i(St,j[Ei],{that:j,AS_ENTRIES:_t})})),_o=Ci.prototype,_s=_a(_e),define=function(j,_e,_t){var St,Tt,Ut=_s(j),_r=getEntry(j,_e);return _r?_r.value=_t:(Ut.last=_r={index:Tt=Fi(_e,!0),key:_e,value:_t,previous:St=Ut.last,next:void 0,removed:!1},Ut.first||(Ut.first=_r),St&&(St.next=_r),Di?Ut.size++:j.size++,"F"!==Tt&&(Ut.index[Tt]=_r)),j},getEntry=function(j,_e){var _t,St=_s(j),Tt=Fi(_e);if("F"!==Tt)return St.index[Tt];for(_t=St.first;_t;_t=_t.next)if(_t.key==_e)return _t};return Ut(_o,{clear:function clear(){for(var j=_s(this),_e=j.index,_t=j.first;_t;)_t.removed=!0,_t.previous&&(_t.previous=_t.previous.next=void 0),delete _e[_t.index],_t=_t.next;j.first=j.last=void 0,Di?j.size=0:this.size=0},delete:function(j){var _e=this,_t=_s(_e),St=getEntry(_e,j);if(St){var Tt=St.next,Ut=St.previous;delete _t.index[St.index],St.removed=!0,Ut&&(Ut.next=Tt),Tt&&(Tt.previous=Ut),_t.first==St&&(_t.first=Tt),_t.last==St&&(_t.last=Ut),Di?_t.size--:_e.size--}return!!St},forEach:function forEach(j){for(var _e,_t=_s(this),St=_r(j,arguments.length>1?arguments[1]:void 0);_e=_e?_e.next:_t.first;)for(St(_e.value,_e.key,this);_e&&_e.removed;)_e=_e.previous},has:function has(j){return!!getEntry(this,j)}}),Ut(_o,_t?{get:function get(j){var _e=getEntry(this,j);return _e&&_e.value},set:function set(j,_e){return define(this,0===j?0:j,_e)}}:{add:function add(j){return define(this,j=0===j?0:j,j)}}),Di&&St(_o,"size",{get:function(){return _s(this).size}}),Ci},setStrong:function(j,_e,_t){var St=_e+" Iterator",Tt=_a(_e),Ut=_a(St);Ei(j,_e,(function(j,_e){ga(this,{type:St,target:j,state:Tt(j),kind:_e,last:void 0})}),(function(){for(var j=Ut(this),_e=j.kind,_t=j.last;_t&&_t.removed;)_t=_t.previous;return j.target&&(j.last=_t=_t?_t.next:j.state.first)?"keys"==_e?{value:_t.key,done:!1}:"values"==_e?{value:_t.value,done:!1}:{value:[_t.key,_t.value],done:!1}:(j.target=void 0,{value:void 0,done:!0})}),_t?"entries":"values",!_t,!0),Ci(_e)}}},9320:(j,_e,_t)=>{"use strict";var St=_t(1702),Tt=_t(2248),Ut=_t(2423).getWeakData,_r=_t(9670),_n=_t(111),_i=_t(5787),Ei=_t(612),Ci=_t(2092),Di=_t(2597),Fi=_t(9909),_o=Fi.set,ga=Fi.getterFor,_a=Ci.find,_s=Ci.findIndex,_c=St([].splice),kc=0,uncaughtFrozenStore=function(j){return j.frozen||(j.frozen=new UncaughtFrozenStore)},UncaughtFrozenStore=function(){this.entries=[]},findUncaughtFrozen=function(j,_e){return _a(j.entries,(function(j){return j[0]===_e}))};UncaughtFrozenStore.prototype={get:function(j){var _e=findUncaughtFrozen(this,j);if(_e)return _e[1]},has:function(j){return!!findUncaughtFrozen(this,j)},set:function(j,_e){var _t=findUncaughtFrozen(this,j);_t?_t[1]=_e:this.entries.push([j,_e])},delete:function(j){var _e=_s(this.entries,(function(_e){return _e[0]===j}));return~_e&&_c(this.entries,_e,1),!!~_e}},j.exports={getConstructor:function(j,_e,_t,St){var Ci=j((function(j,Tt){_i(j,Fi),_o(j,{type:_e,id:kc++,frozen:void 0}),null!=Tt&&Ei(Tt,j[St],{that:j,AS_ENTRIES:_t})})),Fi=Ci.prototype,_a=ga(_e),define=function(j,_e,_t){var St=_a(j),Tt=Ut(_r(_e),!0);return!0===Tt?uncaughtFrozenStore(St).set(_e,_t):Tt[St.id]=_t,j};return Tt(Fi,{delete:function(j){var _e=_a(this);if(!_n(j))return!1;var _t=Ut(j);return!0===_t?uncaughtFrozenStore(_e).delete(j):_t&&Di(_t,_e.id)&&delete _t[_e.id]},has:function has(j){var _e=_a(this);if(!_n(j))return!1;var _t=Ut(j);return!0===_t?uncaughtFrozenStore(_e).has(j):_t&&Di(_t,_e.id)}}),Tt(Fi,_t?{get:function get(j){var _e=_a(this);if(_n(j)){var _t=Ut(j);return!0===_t?uncaughtFrozenStore(_e).get(j):_t?_t[_e.id]:void 0}},set:function set(j,_e){return define(this,j,_e)}}:{add:function add(j){return define(this,j,!0)}}),Ci}}},7710:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(1702),_r=_t(4705),_n=_t(1320),_i=_t(2423),Ei=_t(612),Ci=_t(5787),Di=_t(614),Fi=_t(111),_o=_t(7293),ga=_t(7072),_a=_t(8003),_s=_t(9587);j.exports=function(j,_e,_t){var _c=-1!==j.indexOf("Map"),kc=-1!==j.indexOf("Weak"),_u=_c?"set":"add",_l=Tt[j],_d=_l&&_l.prototype,_h=_l,_f={},fixMethod=function(j){var _e=Ut(_d[j]);_n(_d,j,"add"==j?function add(j){return _e(this,0===j?0:j),this}:"delete"==j?function(j){return!(kc&&!Fi(j))&&_e(this,0===j?0:j)}:"get"==j?function get(j){return kc&&!Fi(j)?void 0:_e(this,0===j?0:j)}:"has"==j?function has(j){return!(kc&&!Fi(j))&&_e(this,0===j?0:j)}:function set(j,_t){return _e(this,0===j?0:j,_t),this})};if(_r(j,!Di(_l)||!(kc||_d.forEach&&!_o((function(){(new _l).entries().next()})))))_h=_t.getConstructor(_e,j,_c,_u),_i.enable();else if(_r(j,!0)){var _p=new _h,Eg=_p[_u](kc?{}:-0,1)!=_p,_v=_o((function(){_p.has(1)})),_m=ga((function(j){new _l(j)})),Pm=!kc&&_o((function(){for(var j=new _l,_e=5;_e--;)j[_u](_e,_e);return!j.has(-0)}));_m||((_h=_e((function(j,_e){Ci(j,_d);var _t=_s(new _l,j,_h);return null!=_e&&Ei(_e,_t[_u],{that:_t,AS_ENTRIES:_c}),_t}))).prototype=_d,_d.constructor=_h),(_v||Pm)&&(fixMethod("delete"),fixMethod("has"),_c&&fixMethod("get")),(Pm||Eg)&&fixMethod(_u),kc&&_d.clear&&delete _d.clear}return _f[j]=_h,St({global:!0,forced:_h!=_l},_f),_a(_h,j),kc||_t.setStrong(_h,j,_c),_h}},9920:(j,_e,_t)=>{var St=_t(2597),Tt=_t(3887),Ut=_t(1236),_r=_t(3070);j.exports=function(j,_e,_t){for(var _n=Tt(_e),_i=_r.f,Ei=Ut.f,Ci=0;Ci<_n.length;Ci++){var Di=_n[Ci];St(j,Di)||_t&&St(_t,Di)||_i(j,Di,Ei(_e,Di))}}},4964:(j,_e,_t)=>{var St=_t(5112)("match");j.exports=function(j){var _e=/./;try{"/./"[j](_e)}catch(_t){try{return _e[St]=!1,"/./"[j](_e)}catch(j){}}return!1}},8544:(j,_e,_t)=>{var St=_t(7293);j.exports=!St((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype}))},4230:(j,_e,_t)=>{var St=_t(1702),Tt=_t(4488),Ut=_t(1340),_r=/"/g,_n=St("".replace);j.exports=function(j,_e,_t,St){var _i=Ut(Tt(j)),Ei="<"+_e;return""!==_t&&(Ei+=" "+_t+'="'+_n(Ut(St),_r,""")+'"'),Ei+">"+_i+"</"+_e+">"}},4994:(j,_e,_t)=>{"use strict";var St=_t(3383).IteratorPrototype,Tt=_t(30),Ut=_t(9114),_r=_t(8003),_n=_t(7497),returnThis=function(){return this};j.exports=function(j,_e,_t,_i){var Ei=_e+" Iterator";return j.prototype=Tt(St,{next:Ut(+!_i,_t)}),_r(j,Ei,!1,!0),_n[Ei]=returnThis,j}},8880:(j,_e,_t)=>{var St=_t(9781),Tt=_t(3070),Ut=_t(9114);j.exports=St?function(j,_e,_t){return Tt.f(j,_e,Ut(1,_t))}:function(j,_e,_t){return j[_e]=_t,j}},9114:j=>{j.exports=function(j,_e){return{enumerable:!(1&j),configurable:!(2&j),writable:!(4&j),value:_e}}},6135:(j,_e,_t)=>{"use strict";var St=_t(4948),Tt=_t(3070),Ut=_t(9114);j.exports=function(j,_e,_t){var _r=St(_e);_r in j?Tt.f(j,_r,Ut(0,_t)):j[_r]=_t}},654:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(6916),Ut=_t(1913),_r=_t(6530),_n=_t(614),_i=_t(4994),Ei=_t(9518),Ci=_t(7674),Di=_t(8003),Fi=_t(8880),_o=_t(1320),ga=_t(5112),_a=_t(7497),_s=_t(3383),_c=_r.PROPER,kc=_r.CONFIGURABLE,_u=_s.IteratorPrototype,_l=_s.BUGGY_SAFARI_ITERATORS,_d=ga("iterator"),_h="keys",_f="values",_p="entries",returnThis=function(){return this};j.exports=function(j,_e,_t,_r,ga,_s,Eg){_i(_t,_e,_r);var _v,_m,Pm,getIterationMethod=function(j){if(j===ga&&r_)return r_;if(!_l&&j in e_)return e_[j];switch(j){case _h:return function keys(){return new _t(this,j)};case _f:return function values(){return new _t(this,j)};case _p:return function entries(){return new _t(this,j)}}return function(){return new _t(this)}},_y=_e+" Iterator",_A=!1,e_=j.prototype,t_=e_[_d]||e_["@@iterator"]||ga&&e_[ga],r_=!_l&&t_||getIterationMethod(ga),i_="Array"==_e&&e_.entries||t_;if(i_&&(_v=Ei(i_.call(new j)))!==Object.prototype&&_v.next&&(Ut||Ei(_v)===_u||(Ci?Ci(_v,_u):_n(_v[_d])||_o(_v,_d,returnThis)),Di(_v,_y,!0,!0),Ut&&(_a[_y]=returnThis)),_c&&ga==_f&&t_&&t_.name!==_f&&(!Ut&&kc?Fi(e_,"name",_f):(_A=!0,r_=function values(){return Tt(t_,this)})),ga)if(_m={values:getIterationMethod(_f),keys:_s?r_:getIterationMethod(_h),entries:getIterationMethod(_p)},Eg)for(Pm in _m)(_l||_A||!(Pm in e_))&&_o(e_,Pm,_m[Pm]);else St({target:_e,proto:!0,forced:_l||_A},_m);return Ut&&!Eg||e_[_d]===r_||_o(e_,_d,r_,{name:ga}),_a[_e]=r_,_m}},7235:(j,_e,_t)=>{var St=_t(857),Tt=_t(2597),Ut=_t(6061),_r=_t(3070).f;j.exports=function(j){var _e=St.Symbol||(St.Symbol={});Tt(_e,j)||_r(_e,j,{value:Ut.f(j)})}},9781:(j,_e,_t)=>{var St=_t(7293);j.exports=!St((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(j,_e,_t)=>{var St=_t(7854),Tt=_t(111),Ut=St.document,_r=Tt(Ut)&&Tt(Ut.createElement);j.exports=function(j){return _r?Ut.createElement(j):{}}},8324:j=>{j.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:(j,_e,_t)=>{var St=_t(317)("span").classList,Tt=St&&St.constructor&&St.constructor.prototype;j.exports=Tt===Object.prototype?void 0:Tt},8886:(j,_e,_t)=>{var St=_t(8113).match(/firefox\/(\d+)/i);j.exports=!!St&&+St[1]},7871:j=>{j.exports="object"==typeof window},256:(j,_e,_t)=>{var St=_t(8113);j.exports=/MSIE|Trident/.test(St)},1528:(j,_e,_t)=>{var St=_t(8113),Tt=_t(7854);j.exports=/ipad|iphone|ipod/i.test(St)&&void 0!==Tt.Pebble},6833:(j,_e,_t)=>{var St=_t(8113);j.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(St)},5268:(j,_e,_t)=>{var St=_t(4326),Tt=_t(7854);j.exports="process"==St(Tt.process)},1036:(j,_e,_t)=>{var St=_t(8113);j.exports=/web0s(?!.*chrome)/i.test(St)},8113:(j,_e,_t)=>{var St=_t(5005);j.exports=St("navigator","userAgent")||""},7392:(j,_e,_t)=>{var St,Tt,Ut=_t(7854),_r=_t(8113),_n=Ut.process,_i=Ut.Deno,Ei=_n&&_n.versions||_i&&_i.version,Ci=Ei&&Ei.v8;Ci&&(Tt=(St=Ci.split("."))[0]>0&&St[0]<4?1:+(St[0]+St[1])),!Tt&&_r&&(!(St=_r.match(/Edge\/(\d+)/))||St[1]>=74)&&(St=_r.match(/Chrome\/(\d+)/))&&(Tt=+St[1]),j.exports=Tt},8008:(j,_e,_t)=>{var St=_t(8113).match(/AppleWebKit\/(\d+)\./);j.exports=!!St&&+St[1]},748:j=>{j.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(j,_e,_t)=>{var St=_t(7854),Tt=_t(1236).f,Ut=_t(8880),_r=_t(1320),_n=_t(3505),_i=_t(9920),Ei=_t(4705);j.exports=function(j,_e){var _t,Ci,Di,Fi,_o,ga=j.target,_a=j.global,_s=j.stat;if(_t=_a?St:_s?St[ga]||_n(ga,{}):(St[ga]||{}).prototype)for(Ci in _e){if(Fi=_e[Ci],Di=j.noTargetGet?(_o=Tt(_t,Ci))&&_o.value:_t[Ci],!Ei(_a?Ci:ga+(_s?".":"#")+Ci,j.forced)&&void 0!==Di){if(typeof Fi==typeof Di)continue;_i(Fi,Di)}(j.sham||Di&&Di.sham)&&Ut(Fi,"sham",!0),_r(_t,Ci,Fi,j)}}},7293:j=>{j.exports=function(j){try{return!!j()}catch(j){return!0}}},7007:(j,_e,_t)=>{"use strict";_t(4916);var St=_t(1702),Tt=_t(1320),Ut=_t(2261),_r=_t(7293),_n=_t(5112),_i=_t(8880),Ei=_n("species"),Ci=RegExp.prototype;j.exports=function(j,_e,_t,Di){var Fi=_n(j),_o=!_r((function(){var _e={};return _e[Fi]=function(){return 7},7!=""[j](_e)})),ga=_o&&!_r((function(){var _e=!1,_t=/a/;return"split"===j&&((_t={}).constructor={},_t.constructor[Ei]=function(){return _t},_t.flags="",_t[Fi]=/./[Fi]),_t.exec=function(){return _e=!0,null},_t[Fi](""),!_e}));if(!_o||!ga||_t){var _a=St(/./[Fi]),_s=_e(Fi,""[j],(function(j,_e,_t,Tt,_r){var _n=St(j),_i=_e.exec;return _i===Ut||_i===Ci.exec?_o&&!_r?{done:!0,value:_a(_e,_t,Tt)}:{done:!0,value:_n(_t,_e,Tt)}:{done:!1}}));Tt(String.prototype,j,_s[0]),Tt(Ci,Fi,_s[1])}Di&&_i(Ci[Fi],"sham",!0)}},6677:(j,_e,_t)=>{var St=_t(7293);j.exports=!St((function(){return Object.isExtensible(Object.preventExtensions({}))}))},2104:j=>{var _e=Function.prototype,_t=_e.apply,St=_e.bind,Tt=_e.call;j.exports="object"==typeof Reflect&&Reflect.apply||(St?Tt.bind(_t):function(){return Tt.apply(_t,arguments)})},9974:(j,_e,_t)=>{var St=_t(1702),Tt=_t(9662),Ut=St(St.bind);j.exports=function(j,_e){return Tt(j),void 0===_e?j:Ut?Ut(j,_e):function(){return j.apply(_e,arguments)}}},7065:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(1702),Ut=_t(9662),_r=_t(111),_n=_t(2597),_i=_t(206),Ei=St.Function,Ci=Tt([].concat),Di=Tt([].join),Fi={},construct=function(j,_e,_t){if(!_n(Fi,_e)){for(var St=[],Tt=0;Tt<_e;Tt++)St[Tt]="a["+Tt+"]";Fi[_e]=Ei("C,a","return new C("+Di(St,",")+")")}return Fi[_e](j,_t)};j.exports=Ei.bind||function bind(j){var _e=Ut(this),_t=_e.prototype,St=_i(arguments,1),Tt=function bound(){var _t=Ci(St,_i(arguments));return this instanceof Tt?construct(_e,_t.length,_t):_e.apply(j,_t)};return _r(_t)&&(Tt.prototype=_t),Tt}},6916:j=>{var _e=Function.prototype.call;j.exports=_e.bind?_e.bind(_e):function(){return _e.apply(_e,arguments)}},6530:(j,_e,_t)=>{var St=_t(9781),Tt=_t(2597),Ut=Function.prototype,_r=St&&Object.getOwnPropertyDescriptor,_n=Tt(Ut,"name"),_i=_n&&"something"===function something(){}.name,Ei=_n&&(!St||St&&_r(Ut,"name").configurable);j.exports={EXISTS:_n,PROPER:_i,CONFIGURABLE:Ei}},1702:j=>{var _e=Function.prototype,_t=_e.bind,St=_e.call,Tt=_t&&_t.bind(St);j.exports=_t?function(j){return j&&Tt(St,j)}:function(j){return j&&function(){return St.apply(j,arguments)}}},5005:(j,_e,_t)=>{var St=_t(7854),Tt=_t(614),aFunction=function(j){return Tt(j)?j:void 0};j.exports=function(j,_e){return arguments.length<2?aFunction(St[j]):St[j]&&St[j][_e]}},1246:(j,_e,_t)=>{var St=_t(648),Tt=_t(8173),Ut=_t(7497),_r=_t(5112)("iterator");j.exports=function(j){if(null!=j)return Tt(j,_r)||Tt(j,"@@iterator")||Ut[St(j)]}},8554:(j,_e,_t)=>{var St=_t(7854),Tt=_t(6916),Ut=_t(9662),_r=_t(9670),_n=_t(6330),_i=_t(1246),Ei=St.TypeError;j.exports=function(j,_e){var _t=arguments.length<2?_i(j):_e;if(Ut(_t))return _r(Tt(_t,j));throw Ei(_n(j)+" is not iterable")}},4647:(j,_e,_t)=>{var St=_t(6916);j.exports=function(j){return St(Map.prototype.entries,j)}},8173:(j,_e,_t)=>{var St=_t(9662);j.exports=function(j,_e){var _t=j[_e];return null==_t?void 0:St(_t)}},6767:(j,_e,_t)=>{var St=_t(6916);j.exports=function(j){return St(Set.prototype.values,j)}},647:(j,_e,_t)=>{var St=_t(1702),Tt=_t(7908),Ut=Math.floor,_r=St("".charAt),_n=St("".replace),_i=St("".slice),Ei=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Ci=/\$([$&'`]|\d{1,2})/g;j.exports=function(j,_e,_t,St,Di,Fi){var _o=_t+j.length,ga=St.length,_a=Ci;return void 0!==Di&&(Di=Tt(Di),_a=Ei),_n(Fi,_a,(function(Tt,_n){var Ei;switch(_r(_n,0)){case"$":return"$";case"&":return j;case"`":return _i(_e,0,_t);case"'":return _i(_e,_o);case"<":Ei=Di[_i(_n,1,-1)];break;default:var Ci=+_n;if(0===Ci)return Tt;if(Ci>ga){var Fi=Ut(Ci/10);return 0===Fi?Tt:Fi<=ga?void 0===St[Fi-1]?_r(_n,1):St[Fi-1]+_r(_n,1):Tt}Ei=St[Ci-1]}return void 0===Ei?"":Ei}))}},7854:(j,_e,_t)=>{var check=function(j){return j&&j.Math==Math&&j};j.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof _t.g&&_t.g)||function(){return this}()||Function("return this")()},2597:(j,_e,_t)=>{var St=_t(1702),Tt=_t(7908),Ut=St({}.hasOwnProperty);j.exports=Object.hasOwn||function hasOwn(j,_e){return Ut(Tt(j),_e)}},3501:j=>{j.exports={}},842:(j,_e,_t)=>{var St=_t(7854);j.exports=function(j,_e){var _t=St.console;_t&&_t.error&&(1==arguments.length?_t.error(j):_t.error(j,_e))}},490:(j,_e,_t)=>{var St=_t(5005);j.exports=St("document","documentElement")},4664:(j,_e,_t)=>{var St=_t(9781),Tt=_t(7293),Ut=_t(317);j.exports=!St&&!Tt((function(){return 7!=Object.defineProperty(Ut("div"),"a",{get:function(){return 7}}).a}))},1179:(j,_e,_t)=>{var St=_t(7854).Array,Tt=Math.abs,Ut=Math.pow,_r=Math.floor,_n=Math.log,_i=Math.LN2;j.exports={pack:function(j,_e,_t){var Ei,Ci,Di,Fi=St(_t),_o=8*_t-_e-1,ga=(1<<_o)-1,_a=ga>>1,_s=23===_e?Ut(2,-24)-Ut(2,-77):0,_c=j<0||0===j&&1/j<0?1:0,kc=0;for((j=Tt(j))!=j||j===1/0?(Ci=j!=j?1:0,Ei=ga):(Ei=_r(_n(j)/_i),j*(Di=Ut(2,-Ei))<1&&(Ei--,Di*=2),(j+=Ei+_a>=1?_s/Di:_s*Ut(2,1-_a))*Di>=2&&(Ei++,Di/=2),Ei+_a>=ga?(Ci=0,Ei=ga):Ei+_a>=1?(Ci=(j*Di-1)*Ut(2,_e),Ei+=_a):(Ci=j*Ut(2,_a-1)*Ut(2,_e),Ei=0));_e>=8;)Fi[kc++]=255&Ci,Ci/=256,_e-=8;for(Ei=Ei<<_e|Ci,_o+=_e;_o>0;)Fi[kc++]=255&Ei,Ei/=256,_o-=8;return Fi[--kc]|=128*_c,Fi},unpack:function(j,_e){var _t,St=j.length,Tt=8*St-_e-1,_r=(1<<Tt)-1,_n=_r>>1,_i=Tt-7,Ei=St-1,Ci=j[Ei--],Di=127&Ci;for(Ci>>=7;_i>0;)Di=256*Di+j[Ei--],_i-=8;for(_t=Di&(1<<-_i)-1,Di>>=-_i,_i+=_e;_i>0;)_t=256*_t+j[Ei--],_i-=8;if(0===Di)Di=1-_n;else{if(Di===_r)return _t?NaN:Ci?-1/0:1/0;_t+=Ut(2,_e),Di-=_n}return(Ci?-1:1)*_t*Ut(2,Di-_e)}}},8361:(j,_e,_t)=>{var St=_t(7854),Tt=_t(1702),Ut=_t(7293),_r=_t(4326),_n=St.Object,_i=Tt("".split);j.exports=Ut((function(){return!_n("z").propertyIsEnumerable(0)}))?function(j){return"String"==_r(j)?_i(j,""):_n(j)}:_n},9587:(j,_e,_t)=>{var St=_t(614),Tt=_t(111),Ut=_t(7674);j.exports=function(j,_e,_t){var _r,_n;return Ut&&St(_r=_e.constructor)&&_r!==_t&&Tt(_n=_r.prototype)&&_n!==_t.prototype&&Ut(j,_n),j}},2788:(j,_e,_t)=>{var St=_t(1702),Tt=_t(614),Ut=_t(5465),_r=St(Function.toString);Tt(Ut.inspectSource)||(Ut.inspectSource=function(j){return _r(j)}),j.exports=Ut.inspectSource},2423:(j,_e,_t)=>{var St=_t(2109),Tt=_t(1702),Ut=_t(3501),_r=_t(111),_n=_t(2597),_i=_t(3070).f,Ei=_t(8006),Ci=_t(1156),Di=_t(2050),Fi=_t(9711),_o=_t(6677),ga=!1,_a=Fi("meta"),_s=0,setMetadata=function(j){_i(j,_a,{value:{objectID:"O"+_s++,weakData:{}}})},_c=j.exports={enable:function(){_c.enable=function(){},ga=!0;var j=Ei.f,_e=Tt([].splice),_t={};_t[_a]=1,j(_t).length&&(Ei.f=function(_t){for(var St=j(_t),Tt=0,Ut=St.length;Tt<Ut;Tt++)if(St[Tt]===_a){_e(St,Tt,1);break}return St},St({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Ci.f}))},fastKey:function(j,_e){if(!_r(j))return"symbol"==typeof j?j:("string"==typeof j?"S":"P")+j;if(!_n(j,_a)){if(!Di(j))return"F";if(!_e)return"E";setMetadata(j)}return j[_a].objectID},getWeakData:function(j,_e){if(!_n(j,_a)){if(!Di(j))return!0;if(!_e)return!1;setMetadata(j)}return j[_a].weakData},onFreeze:function(j){return _o&&ga&&Di(j)&&!_n(j,_a)&&setMetadata(j),j}};Ut[_a]=!0},9909:(j,_e,_t)=>{var St,Tt,Ut,_r=_t(8536),_n=_t(7854),_i=_t(1702),Ei=_t(111),Ci=_t(8880),Di=_t(2597),Fi=_t(5465),_o=_t(6200),ga=_t(3501),_a="Object already initialized",_s=_n.TypeError,_c=_n.WeakMap;if(_r||Fi.state){var kc=Fi.state||(Fi.state=new _c),_u=_i(kc.get),_l=_i(kc.has),_d=_i(kc.set);St=function(j,_e){if(_l(kc,j))throw new _s(_a);return _e.facade=j,_d(kc,j,_e),_e},Tt=function(j){return _u(kc,j)||{}},Ut=function(j){return _l(kc,j)}}else{var _h=_o("state");ga[_h]=!0,St=function(j,_e){if(Di(j,_h))throw new _s(_a);return _e.facade=j,Ci(j,_h,_e),_e},Tt=function(j){return Di(j,_h)?j[_h]:{}},Ut=function(j){return Di(j,_h)}}j.exports={set:St,get:Tt,has:Ut,enforce:function(j){return Ut(j)?Tt(j):St(j,{})},getterFor:function(j){return function(_e){var _t;if(!Ei(_e)||(_t=Tt(_e)).type!==j)throw _s("Incompatible receiver, "+j+" required");return _t}}}},7659:(j,_e,_t)=>{var St=_t(5112),Tt=_t(7497),Ut=St("iterator"),_r=Array.prototype;j.exports=function(j){return void 0!==j&&(Tt.Array===j||_r[Ut]===j)}},3157:(j,_e,_t)=>{var St=_t(4326);j.exports=Array.isArray||function isArray(j){return"Array"==St(j)}},614:j=>{j.exports=function(j){return"function"==typeof j}},4411:(j,_e,_t)=>{var St=_t(1702),Tt=_t(7293),Ut=_t(614),_r=_t(648),_n=_t(5005),_i=_t(2788),noop=function(){},Ei=[],Ci=_n("Reflect","construct"),Di=/^\s*(?:class|function)\b/,Fi=St(Di.exec),_o=!Di.exec(noop),ga=function isConstructor(j){if(!Ut(j))return!1;try{return Ci(noop,Ei,j),!0}catch(j){return!1}},_a=function isConstructor(j){if(!Ut(j))return!1;switch(_r(j)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _o||!!Fi(Di,_i(j))}catch(j){return!0}};_a.sham=!0,j.exports=!Ci||Tt((function(){var j;return ga(ga.call)||!ga(Object)||!ga((function(){j=!0}))||j}))?_a:ga},4705:(j,_e,_t)=>{var St=_t(7293),Tt=_t(614),Ut=/#|\.prototype\./,isForced=function(j,_e){var _t=_n[_r(j)];return _t==Ei||_t!=_i&&(Tt(_e)?St(_e):!!_e)},_r=isForced.normalize=function(j){return String(j).replace(Ut,".").toLowerCase()},_n=isForced.data={},_i=isForced.NATIVE="N",Ei=isForced.POLYFILL="P";j.exports=isForced},5988:(j,_e,_t)=>{var St=_t(111),Tt=Math.floor;j.exports=Number.isInteger||function isInteger(j){return!St(j)&&isFinite(j)&&Tt(j)===j}},111:(j,_e,_t)=>{var St=_t(614);j.exports=function(j){return"object"==typeof j?null!==j:St(j)}},1913:j=>{j.exports=!1},7850:(j,_e,_t)=>{var St=_t(111),Tt=_t(4326),Ut=_t(5112)("match");j.exports=function(j){var _e;return St(j)&&(void 0!==(_e=j[Ut])?!!_e:"RegExp"==Tt(j))}},2190:(j,_e,_t)=>{var St=_t(7854),Tt=_t(5005),Ut=_t(614),_r=_t(7976),_n=_t(3307),_i=St.Object;j.exports=_n?function(j){return"symbol"==typeof j}:function(j){var _e=Tt("Symbol");return Ut(_e)&&_r(_e.prototype,_i(j))}},612:(j,_e,_t)=>{var St=_t(7854),Tt=_t(9974),Ut=_t(6916),_r=_t(9670),_n=_t(6330),_i=_t(7659),Ei=_t(6244),Ci=_t(7976),Di=_t(8554),Fi=_t(1246),_o=_t(9212),ga=St.TypeError,Result=function(j,_e){this.stopped=j,this.result=_e},_a=Result.prototype;j.exports=function(j,_e,_t){var St,_s,_c,kc,_u,_l,_d,_h=_t&&_t.that,_f=!(!_t||!_t.AS_ENTRIES),_p=!(!_t||!_t.IS_ITERATOR),Eg=!(!_t||!_t.INTERRUPTED),_v=Tt(_e,_h),stop=function(j){return St&&_o(St,"normal",j),new Result(!0,j)},callFn=function(j){return _f?(_r(j),Eg?_v(j[0],j[1],stop):_v(j[0],j[1])):Eg?_v(j,stop):_v(j)};if(_p)St=j;else{if(!(_s=Fi(j)))throw ga(_n(j)+" is not iterable");if(_i(_s)){for(_c=0,kc=Ei(j);kc>_c;_c++)if((_u=callFn(j[_c]))&&Ci(_a,_u))return _u;return new Result(!1)}St=Di(j,_s)}for(_l=St.next;!(_d=Ut(_l,St)).done;){try{_u=callFn(_d.value)}catch(j){_o(St,"throw",j)}if("object"==typeof _u&&_u&&Ci(_a,_u))return _u}return new Result(!1)}},9212:(j,_e,_t)=>{var St=_t(6916),Tt=_t(9670),Ut=_t(8173);j.exports=function(j,_e,_t){var _r,_n;Tt(j);try{if(!(_r=Ut(j,"return"))){if("throw"===_e)throw _t;return _t}_r=St(_r,j)}catch(j){_n=!0,_r=j}if("throw"===_e)throw _t;if(_n)throw _r;return Tt(_r),_t}},3383:(j,_e,_t)=>{"use strict";var St,Tt,Ut,_r=_t(7293),_n=_t(614),_i=_t(30),Ei=_t(9518),Ci=_t(1320),Di=_t(5112),Fi=_t(1913),_o=Di("iterator"),ga=!1;[].keys&&("next"in(Ut=[].keys())?(Tt=Ei(Ei(Ut)))!==Object.prototype&&(St=Tt):ga=!0),null==St||_r((function(){var j={};return St[_o].call(j)!==j}))?St={}:Fi&&(St=_i(St)),_n(St[_o])||Ci(St,_o,(function(){return this})),j.exports={IteratorPrototype:St,BUGGY_SAFARI_ITERATORS:ga}},7497:j=>{j.exports={}},6244:(j,_e,_t)=>{var St=_t(7466);j.exports=function(j){return St(j.length)}},5948:(j,_e,_t)=>{var St,Tt,Ut,_r,_n,_i,Ei,Ci,Di=_t(7854),Fi=_t(9974),_o=_t(1236).f,ga=_t(261).set,_a=_t(6833),_s=_t(1528),_c=_t(1036),kc=_t(5268),_u=Di.MutationObserver||Di.WebKitMutationObserver,_l=Di.document,_d=Di.process,_h=Di.Promise,_f=_o(Di,"queueMicrotask"),_p=_f&&_f.value;_p||(St=function(){var j,_e;for(kc&&(j=_d.domain)&&j.exit();Tt;){_e=Tt.fn,Tt=Tt.next;try{_e()}catch(j){throw Tt?_r():Ut=void 0,j}}Ut=void 0,j&&j.enter()},_a||kc||_c||!_u||!_l?!_s&&_h&&_h.resolve?((Ei=_h.resolve(void 0)).constructor=_h,Ci=Fi(Ei.then,Ei),_r=function(){Ci(St)}):kc?_r=function(){_d.nextTick(St)}:(ga=Fi(ga,Di),_r=function(){ga(St)}):(_n=!0,_i=_l.createTextNode(""),new _u(St).observe(_i,{characterData:!0}),_r=function(){_i.data=_n=!_n})),j.exports=_p||function(j){var _e={fn:j,next:void 0};Ut&&(Ut.next=_e),Tt||(Tt=_e,_r()),Ut=_e}},3366:(j,_e,_t)=>{var St=_t(7854);j.exports=St.Promise},133:(j,_e,_t)=>{var St=_t(7392),Tt=_t(7293);j.exports=!!Object.getOwnPropertySymbols&&!Tt((function(){var j=Symbol();return!String(j)||!(Object(j)instanceof Symbol)||!Symbol.sham&&St&&St<41}))},8536:(j,_e,_t)=>{var St=_t(7854),Tt=_t(614),Ut=_t(2788),_r=St.WeakMap;j.exports=Tt(_r)&&/native code/.test(Ut(_r))},8523:(j,_e,_t)=>{"use strict";var St=_t(9662),PromiseCapability=function(j){var _e,_t;this.promise=new j((function(j,St){if(void 0!==_e||void 0!==_t)throw TypeError("Bad Promise constructor");_e=j,_t=St})),this.resolve=St(_e),this.reject=St(_t)};j.exports.f=function(j){return new PromiseCapability(j)}},3929:(j,_e,_t)=>{var St=_t(7854),Tt=_t(7850),Ut=St.TypeError;j.exports=function(j){if(Tt(j))throw Ut("The method doesn't accept regular expressions");return j}},3009:(j,_e,_t)=>{var St=_t(7854),Tt=_t(7293),Ut=_t(1702),_r=_t(1340),_n=_t(3111).trim,_i=_t(1361),Ei=St.parseInt,Ci=St.Symbol,Di=Ci&&Ci.iterator,Fi=/^[+-]?0x/i,_o=Ut(Fi.exec),ga=8!==Ei(_i+"08")||22!==Ei(_i+"0x16")||Di&&!Tt((function(){Ei(Object(Di))}));j.exports=ga?function parseInt(j,_e){var _t=_n(_r(j));return Ei(_t,_e>>>0||(_o(Fi,_t)?16:10))}:Ei},1574:(j,_e,_t)=>{"use strict";var St=_t(9781),Tt=_t(1702),Ut=_t(6916),_r=_t(7293),_n=_t(1956),_i=_t(5181),Ei=_t(5296),Ci=_t(7908),Di=_t(8361),Fi=Object.assign,_o=Object.defineProperty,ga=Tt([].concat);j.exports=!Fi||_r((function(){if(St&&1!==Fi({b:1},Fi(_o({},"a",{enumerable:!0,get:function(){_o(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var j={},_e={},_t=Symbol(),Tt="abcdefghijklmnopqrst";return j[_t]=7,Tt.split("").forEach((function(j){_e[j]=j})),7!=Fi({},j)[_t]||_n(Fi({},_e)).join("")!=Tt}))?function assign(j,_e){for(var _t=Ci(j),Tt=arguments.length,_r=1,Fi=_i.f,_o=Ei.f;Tt>_r;)for(var _a,_s=Di(arguments[_r++]),_c=Fi?ga(_n(_s),Fi(_s)):_n(_s),kc=_c.length,_u=0;kc>_u;)_a=_c[_u++],St&&!Ut(_o,_s,_a)||(_t[_a]=_s[_a]);return _t}:Fi},30:(j,_e,_t)=>{var St,Tt=_t(9670),Ut=_t(6048),_r=_t(748),_n=_t(3501),_i=_t(490),Ei=_t(317),Ci=_t(6200),Di="prototype",Fi="script",_o=Ci("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(j){return"<"+Fi+">"+j+"</"+Fi+">"},NullProtoObjectViaActiveX=function(j){j.write(scriptTag("")),j.close();var _e=j.parentWindow.Object;return j=null,_e},NullProtoObject=function(){try{St=new ActiveXObject("htmlfile")}catch(j){}var j,_e,_t;NullProtoObject="undefined"!=typeof document?document.domain&&St?NullProtoObjectViaActiveX(St):(_e=Ei("iframe"),_t="java"+Fi+":",_e.style.display="none",_i.appendChild(_e),_e.src=String(_t),(j=_e.contentWindow.document).open(),j.write(scriptTag("document.F=Object")),j.close(),j.F):NullProtoObjectViaActiveX(St);for(var Tt=_r.length;Tt--;)delete NullProtoObject[Di][_r[Tt]];return NullProtoObject()};_n[_o]=!0,j.exports=Object.create||function create(j,_e){var _t;return null!==j?(EmptyConstructor[Di]=Tt(j),_t=new EmptyConstructor,EmptyConstructor[Di]=null,_t[_o]=j):_t=NullProtoObject(),void 0===_e?_t:Ut(_t,_e)}},6048:(j,_e,_t)=>{var St=_t(9781),Tt=_t(3070),Ut=_t(9670),_r=_t(5656),_n=_t(1956);j.exports=St?Object.defineProperties:function defineProperties(j,_e){Ut(j);for(var _t,St=_r(_e),_i=_n(_e),Ei=_i.length,Ci=0;Ei>Ci;)Tt.f(j,_t=_i[Ci++],St[_t]);return j}},3070:(j,_e,_t)=>{var St=_t(7854),Tt=_t(9781),Ut=_t(4664),_r=_t(9670),_n=_t(4948),_i=St.TypeError,Ei=Object.defineProperty;_e.f=Tt?Ei:function defineProperty(j,_e,_t){if(_r(j),_e=_n(_e),_r(_t),Ut)try{return Ei(j,_e,_t)}catch(j){}if("get"in _t||"set"in _t)throw _i("Accessors not supported");return"value"in _t&&(j[_e]=_t.value),j}},1236:(j,_e,_t)=>{var St=_t(9781),Tt=_t(6916),Ut=_t(5296),_r=_t(9114),_n=_t(5656),_i=_t(4948),Ei=_t(2597),Ci=_t(4664),Di=Object.getOwnPropertyDescriptor;_e.f=St?Di:function getOwnPropertyDescriptor(j,_e){if(j=_n(j),_e=_i(_e),Ci)try{return Di(j,_e)}catch(j){}if(Ei(j,_e))return _r(!Tt(Ut.f,j,_e),j[_e])}},1156:(j,_e,_t)=>{var St=_t(4326),Tt=_t(5656),Ut=_t(8006).f,_r=_t(1589),_n="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];j.exports.f=function getOwnPropertyNames(j){return _n&&"Window"==St(j)?function(j){try{return Ut(j)}catch(j){return _r(_n)}}(j):Ut(Tt(j))}},8006:(j,_e,_t)=>{var St=_t(6324),Tt=_t(748).concat("length","prototype");_e.f=Object.getOwnPropertyNames||function getOwnPropertyNames(j){return St(j,Tt)}},5181:(j,_e)=>{_e.f=Object.getOwnPropertySymbols},9518:(j,_e,_t)=>{var St=_t(7854),Tt=_t(2597),Ut=_t(614),_r=_t(7908),_n=_t(6200),_i=_t(8544),Ei=_n("IE_PROTO"),Ci=St.Object,Di=Ci.prototype;j.exports=_i?Ci.getPrototypeOf:function(j){var _e=_r(j);if(Tt(_e,Ei))return _e[Ei];var _t=_e.constructor;return Ut(_t)&&_e instanceof _t?_t.prototype:_e instanceof Ci?Di:null}},2050:(j,_e,_t)=>{var St=_t(7293),Tt=_t(111),Ut=_t(4326),_r=_t(7556),_n=Object.isExtensible,_i=St((function(){_n(1)}));j.exports=_i||_r?function isExtensible(j){return!!Tt(j)&&((!_r||"ArrayBuffer"!=Ut(j))&&(!_n||_n(j)))}:_n},7976:(j,_e,_t)=>{var St=_t(1702);j.exports=St({}.isPrototypeOf)},6324:(j,_e,_t)=>{var St=_t(1702),Tt=_t(2597),Ut=_t(5656),_r=_t(1318).indexOf,_n=_t(3501),_i=St([].push);j.exports=function(j,_e){var _t,St=Ut(j),Ei=0,Ci=[];for(_t in St)!Tt(_n,_t)&&Tt(St,_t)&&_i(Ci,_t);for(;_e.length>Ei;)Tt(St,_t=_e[Ei++])&&(~_r(Ci,_t)||_i(Ci,_t));return Ci}},1956:(j,_e,_t)=>{var St=_t(6324),Tt=_t(748);j.exports=Object.keys||function keys(j){return St(j,Tt)}},5296:(j,_e)=>{"use strict";var _t={}.propertyIsEnumerable,St=Object.getOwnPropertyDescriptor,Tt=St&&!_t.call({1:2},1);_e.f=Tt?function propertyIsEnumerable(j){var _e=St(this,j);return!!_e&&_e.enumerable}:_t},7674:(j,_e,_t)=>{var St=_t(1702),Tt=_t(9670),Ut=_t(6077);j.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var j,_e=!1,_t={};try{(j=St(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(_t,[]),_e=_t instanceof Array}catch(j){}return function setPrototypeOf(_t,St){return Tt(_t),Ut(St),_e?j(_t,St):_t.__proto__=St,_t}}():void 0)},4699:(j,_e,_t)=>{var St=_t(9781),Tt=_t(1702),Ut=_t(1956),_r=_t(5656),_n=Tt(_t(5296).f),_i=Tt([].push),createMethod=function(j){return function(_e){for(var _t,Tt=_r(_e),Ei=Ut(Tt),Ci=Ei.length,Di=0,Fi=[];Ci>Di;)_t=Ei[Di++],St&&!_n(Tt,_t)||_i(Fi,j?[_t,Tt[_t]]:Tt[_t]);return Fi}};j.exports={entries:createMethod(!0),values:createMethod(!1)}},288:(j,_e,_t)=>{"use strict";var St=_t(1694),Tt=_t(648);j.exports=St?{}.toString:function toString(){return"[object "+Tt(this)+"]"}},2140:(j,_e,_t)=>{var St=_t(7854),Tt=_t(6916),Ut=_t(614),_r=_t(111),_n=St.TypeError;j.exports=function(j,_e){var _t,St;if("string"===_e&&Ut(_t=j.toString)&&!_r(St=Tt(_t,j)))return St;if(Ut(_t=j.valueOf)&&!_r(St=Tt(_t,j)))return St;if("string"!==_e&&Ut(_t=j.toString)&&!_r(St=Tt(_t,j)))return St;throw _n("Can't convert object to primitive value")}},3887:(j,_e,_t)=>{var St=_t(5005),Tt=_t(1702),Ut=_t(8006),_r=_t(5181),_n=_t(9670),_i=Tt([].concat);j.exports=St("Reflect","ownKeys")||function ownKeys(j){var _e=Ut.f(_n(j)),_t=_r.f;return _t?_i(_e,_t(j)):_e}},857:(j,_e,_t)=>{var St=_t(7854);j.exports=St},2534:j=>{j.exports=function(j){try{return{error:!1,value:j()}}catch(j){return{error:!0,value:j}}}},9478:(j,_e,_t)=>{var St=_t(9670),Tt=_t(111),Ut=_t(8523);j.exports=function(j,_e){if(St(j),Tt(_e)&&_e.constructor===j)return _e;var _t=Ut.f(j);return(0,_t.resolve)(_e),_t.promise}},8572:j=>{var Queue=function(){this.head=null,this.tail=null};Queue.prototype={add:function(j){var _e={item:j,next:null};this.head?this.tail.next=_e:this.head=_e,this.tail=_e},get:function(){var j=this.head;if(j)return this.head=j.next,this.tail===j&&(this.tail=null),j.item}},j.exports=Queue},2248:(j,_e,_t)=>{var St=_t(1320);j.exports=function(j,_e,_t){for(var Tt in _e)St(j,Tt,_e[Tt],_t);return j}},1320:(j,_e,_t)=>{var St=_t(7854),Tt=_t(614),Ut=_t(2597),_r=_t(8880),_n=_t(3505),_i=_t(2788),Ei=_t(9909),Ci=_t(6530).CONFIGURABLE,Di=Ei.get,Fi=Ei.enforce,_o=String(String).split("String");(j.exports=function(j,_e,_t,_i){var Ei,Di=!!_i&&!!_i.unsafe,ga=!!_i&&!!_i.enumerable,_a=!!_i&&!!_i.noTargetGet,_s=_i&&void 0!==_i.name?_i.name:_e;Tt(_t)&&("Symbol("===String(_s).slice(0,7)&&(_s="["+String(_s).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Ut(_t,"name")||Ci&&_t.name!==_s)&&_r(_t,"name",_s),(Ei=Fi(_t)).source||(Ei.source=_o.join("string"==typeof _s?_s:""))),j!==St?(Di?!_a&&j[_e]&&(ga=!0):delete j[_e],ga?j[_e]=_t:_r(j,_e,_t)):ga?j[_e]=_t:_n(_e,_t)})(Function.prototype,"toString",(function toString(){return Tt(this)&&Di(this).source||_i(this)}))},7651:(j,_e,_t)=>{var St=_t(7854),Tt=_t(6916),Ut=_t(9670),_r=_t(614),_n=_t(4326),_i=_t(2261),Ei=St.TypeError;j.exports=function(j,_e){var _t=j.exec;if(_r(_t)){var St=Tt(_t,j,_e);return null!==St&&Ut(St),St}if("RegExp"===_n(j))return Tt(_i,j,_e);throw Ei("RegExp#exec called on incompatible receiver")}},2261:(j,_e,_t)=>{"use strict";var St,Tt,Ut=_t(6916),_r=_t(1702),_n=_t(1340),_i=_t(7066),Ei=_t(2999),Ci=_t(2309),Di=_t(30),Fi=_t(9909).get,_o=_t(9441),ga=_t(7168),_a=Ci("native-string-replace",String.prototype.replace),_s=RegExp.prototype.exec,_c=_s,kc=_r("".charAt),_u=_r("".indexOf),_l=_r("".replace),_d=_r("".slice),_h=(Tt=/b*/g,Ut(_s,St=/a/,"a"),Ut(_s,Tt,"a"),0!==St.lastIndex||0!==Tt.lastIndex),_f=Ei.BROKEN_CARET,_p=void 0!==/()??/.exec("")[1];(_h||_p||_f||_o||ga)&&(_c=function exec(j){var _e,_t,St,Tt,_r,Ei,Ci,_o=this,ga=Fi(_o),Eg=_n(j),_v=ga.raw;if(_v)return _v.lastIndex=_o.lastIndex,_e=Ut(_c,_v,Eg),_o.lastIndex=_v.lastIndex,_e;var _m=ga.groups,Pm=_f&&_o.sticky,_y=Ut(_i,_o),_A=_o.source,e_=0,t_=Eg;if(Pm&&(_y=_l(_y,"y",""),-1===_u(_y,"g")&&(_y+="g"),t_=_d(Eg,_o.lastIndex),_o.lastIndex>0&&(!_o.multiline||_o.multiline&&"\n"!==kc(Eg,_o.lastIndex-1))&&(_A="(?: "+_A+")",t_=" "+t_,e_++),_t=new RegExp("^(?:"+_A+")",_y)),_p&&(_t=new RegExp("^"+_A+"$(?!\\s)",_y)),_h&&(St=_o.lastIndex),Tt=Ut(_s,Pm?_t:_o,t_),Pm?Tt?(Tt.input=_d(Tt.input,e_),Tt[0]=_d(Tt[0],e_),Tt.index=_o.lastIndex,_o.lastIndex+=Tt[0].length):_o.lastIndex=0:_h&&Tt&&(_o.lastIndex=_o.global?Tt.index+Tt[0].length:St),_p&&Tt&&Tt.length>1&&Ut(_a,Tt[0],_t,(function(){for(_r=1;_r<arguments.length-2;_r++)void 0===arguments[_r]&&(Tt[_r]=void 0)})),Tt&&_m)for(Tt.groups=Ei=Di(null),_r=0;_r<_m.length;_r++)Ei[(Ci=_m[_r])[0]]=Tt[Ci[1]];return Tt}),j.exports=_c},7066:(j,_e,_t)=>{"use strict";var St=_t(9670);j.exports=function(){var j=St(this),_e="";return j.global&&(_e+="g"),j.ignoreCase&&(_e+="i"),j.multiline&&(_e+="m"),j.dotAll&&(_e+="s"),j.unicode&&(_e+="u"),j.sticky&&(_e+="y"),_e}},2999:(j,_e,_t)=>{var St=_t(7293),Tt=_t(7854).RegExp,Ut=St((function(){var j=Tt("a","y");return j.lastIndex=2,null!=j.exec("abcd")})),_r=Ut||St((function(){return!Tt("a","y").sticky})),_n=Ut||St((function(){var j=Tt("^r","gy");return j.lastIndex=2,null!=j.exec("str")}));j.exports={BROKEN_CARET:_n,MISSED_STICKY:_r,UNSUPPORTED_Y:Ut}},9441:(j,_e,_t)=>{var St=_t(7293),Tt=_t(7854).RegExp;j.exports=St((function(){var j=Tt(".","s");return!(j.dotAll&&j.exec("\n")&&"s"===j.flags)}))},7168:(j,_e,_t)=>{var St=_t(7293),Tt=_t(7854).RegExp;j.exports=St((function(){var j=Tt("(?<a>b)","g");return"b"!==j.exec("b").groups.a||"bc"!=="b".replace(j,"$<a>c")}))},4488:(j,_e,_t)=>{var St=_t(7854).TypeError;j.exports=function(j){if(null==j)throw St("Can't call method on "+j);return j}},6465:j=>{j.exports=function(j,_e){return j===_e||j!=j&&_e!=_e}},3505:(j,_e,_t)=>{var St=_t(7854),Tt=Object.defineProperty;j.exports=function(j,_e){try{Tt(St,j,{value:_e,configurable:!0,writable:!0})}catch(_t){St[j]=_e}return _e}},6340:(j,_e,_t)=>{"use strict";var St=_t(5005),Tt=_t(3070),Ut=_t(5112),_r=_t(9781),_n=Ut("species");j.exports=function(j){var _e=St(j),_t=Tt.f;_r&&_e&&!_e[_n]&&_t(_e,_n,{configurable:!0,get:function(){return this}})}},8003:(j,_e,_t)=>{var St=_t(3070).f,Tt=_t(2597),Ut=_t(5112)("toStringTag");j.exports=function(j,_e,_t){j&&!_t&&(j=j.prototype),j&&!Tt(j,Ut)&&St(j,Ut,{configurable:!0,value:_e})}},6200:(j,_e,_t)=>{var St=_t(2309),Tt=_t(9711),Ut=St("keys");j.exports=function(j){return Ut[j]||(Ut[j]=Tt(j))}},5465:(j,_e,_t)=>{var St=_t(7854),Tt=_t(3505),Ut="__core-js_shared__",_r=St[Ut]||Tt(Ut,{});j.exports=_r},2309:(j,_e,_t)=>{var St=_t(1913),Tt=_t(5465);(j.exports=function(j,_e){return Tt[j]||(Tt[j]=void 0!==_e?_e:{})})("versions",[]).push({version:"3.20.1",mode:St?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},6707:(j,_e,_t)=>{var St=_t(9670),Tt=_t(9483),Ut=_t(5112)("species");j.exports=function(j,_e){var _t,_r=St(j).constructor;return void 0===_r||null==(_t=St(_r)[Ut])?_e:Tt(_t)}},3429:(j,_e,_t)=>{var St=_t(7293);j.exports=function(j){return St((function(){var _e=""[j]('"');return _e!==_e.toLowerCase()||_e.split('"').length>3}))}},8710:(j,_e,_t)=>{var St=_t(1702),Tt=_t(9303),Ut=_t(1340),_r=_t(4488),_n=St("".charAt),_i=St("".charCodeAt),Ei=St("".slice),createMethod=function(j){return function(_e,_t){var St,Ci,Di=Ut(_r(_e)),Fi=Tt(_t),_o=Di.length;return Fi<0||Fi>=_o?j?"":void 0:(St=_i(Di,Fi))<55296||St>56319||Fi+1===_o||(Ci=_i(Di,Fi+1))<56320||Ci>57343?j?_n(Di,Fi):St:j?Ei(Di,Fi,Fi+2):Ci-56320+(St-55296<<10)+65536}};j.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},3111:(j,_e,_t)=>{var St=_t(1702),Tt=_t(4488),Ut=_t(1340),_r=_t(1361),_n=St("".replace),_i="["+_r+"]",Ei=RegExp("^"+_i+_i+"*"),Ci=RegExp(_i+_i+"*$"),createMethod=function(j){return function(_e){var _t=Ut(Tt(_e));return 1&j&&(_t=_n(_t,Ei,"")),2&j&&(_t=_n(_t,Ci,"")),_t}};j.exports={start:createMethod(1),end:createMethod(2),trim:createMethod(3)}},261:(j,_e,_t)=>{var St,Tt,Ut,_r,_n=_t(7854),_i=_t(2104),Ei=_t(9974),Ci=_t(614),Di=_t(2597),Fi=_t(7293),_o=_t(490),ga=_t(206),_a=_t(317),_s=_t(6833),_c=_t(5268),kc=_n.setImmediate,_u=_n.clearImmediate,_l=_n.process,_d=_n.Dispatch,_h=_n.Function,_f=_n.MessageChannel,_p=_n.String,Eg=0,_v={},_m="onreadystatechange";try{St=_n.location}catch(j){}var run=function(j){if(Di(_v,j)){var _e=_v[j];delete _v[j],_e()}},runner=function(j){return function(){run(j)}},listener=function(j){run(j.data)},post=function(j){_n.postMessage(_p(j),St.protocol+"//"+St.host)};kc&&_u||(kc=function setImmediate(j){var _e=ga(arguments,1);return _v[++Eg]=function(){_i(Ci(j)?j:_h(j),void 0,_e)},Tt(Eg),Eg},_u=function clearImmediate(j){delete _v[j]},_c?Tt=function(j){_l.nextTick(runner(j))}:_d&&_d.now?Tt=function(j){_d.now(runner(j))}:_f&&!_s?(_r=(Ut=new _f).port2,Ut.port1.onmessage=listener,Tt=Ei(_r.postMessage,_r)):_n.addEventListener&&Ci(_n.postMessage)&&!_n.importScripts&&St&&"file:"!==St.protocol&&!Fi(post)?(Tt=post,_n.addEventListener("message",listener,!1)):Tt=_m in _a("script")?function(j){_o.appendChild(_a("script"))[_m]=function(){_o.removeChild(this),run(j)}}:function(j){setTimeout(runner(j),0)}),j.exports={set:kc,clear:_u}},1400:(j,_e,_t)=>{var St=_t(9303),Tt=Math.max,Ut=Math.min;j.exports=function(j,_e){var _t=St(j);return _t<0?Tt(_t+_e,0):Ut(_t,_e)}},7067:(j,_e,_t)=>{var St=_t(7854),Tt=_t(9303),Ut=_t(7466),_r=St.RangeError;j.exports=function(j){if(void 0===j)return 0;var _e=Tt(j),_t=Ut(_e);if(_e!==_t)throw _r("Wrong length or index");return _t}},5656:(j,_e,_t)=>{var St=_t(8361),Tt=_t(4488);j.exports=function(j){return St(Tt(j))}},9303:j=>{var _e=Math.ceil,_t=Math.floor;j.exports=function(j){var St=+j;return St!=St||0===St?0:(St>0?_t:_e)(St)}},7466:(j,_e,_t)=>{var St=_t(9303),Tt=Math.min;j.exports=function(j){return j>0?Tt(St(j),9007199254740991):0}},7908:(j,_e,_t)=>{var St=_t(7854),Tt=_t(4488),Ut=St.Object;j.exports=function(j){return Ut(Tt(j))}},4590:(j,_e,_t)=>{var St=_t(7854),Tt=_t(3002),Ut=St.RangeError;j.exports=function(j,_e){var _t=Tt(j);if(_t%_e)throw Ut("Wrong offset");return _t}},3002:(j,_e,_t)=>{var St=_t(7854),Tt=_t(9303),Ut=St.RangeError;j.exports=function(j){var _e=Tt(j);if(_e<0)throw Ut("The argument can't be less than 0");return _e}},7593:(j,_e,_t)=>{var St=_t(7854),Tt=_t(6916),Ut=_t(111),_r=_t(2190),_n=_t(8173),_i=_t(2140),Ei=_t(5112),Ci=St.TypeError,Di=Ei("toPrimitive");j.exports=function(j,_e){if(!Ut(j)||_r(j))return j;var _t,St=_n(j,Di);if(St){if(void 0===_e&&(_e="default"),_t=Tt(St,j,_e),!Ut(_t)||_r(_t))return _t;throw Ci("Can't convert object to primitive value")}return void 0===_e&&(_e="number"),_i(j,_e)}},4948:(j,_e,_t)=>{var St=_t(7593),Tt=_t(2190);j.exports=function(j){var _e=St(j,"string");return Tt(_e)?_e:_e+""}},1694:(j,_e,_t)=>{var St={};St[_t(5112)("toStringTag")]="z",j.exports="[object z]"===String(St)},1340:(j,_e,_t)=>{var St=_t(7854),Tt=_t(648),Ut=St.String;j.exports=function(j){if("Symbol"===Tt(j))throw TypeError("Cannot convert a Symbol value to a string");return Ut(j)}},6330:(j,_e,_t)=>{var St=_t(7854).String;j.exports=function(j){try{return St(j)}catch(j){return"Object"}}},9843:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(6916),_r=_t(9781),_n=_t(3832),_i=_t(260),Ei=_t(3331),Ci=_t(5787),Di=_t(9114),Fi=_t(8880),_o=_t(5988),ga=_t(7466),_a=_t(7067),_s=_t(4590),_c=_t(4948),kc=_t(2597),_u=_t(648),_l=_t(111),_d=_t(2190),_h=_t(30),_f=_t(7976),_p=_t(7674),Eg=_t(8006).f,_v=_t(7321),_m=_t(2092).forEach,Pm=_t(6340),_y=_t(3070),_A=_t(1236),e_=_t(9909),t_=_t(9587),r_=e_.get,i_=e_.set,a_=_y.f,s_=_A.f,c_=Math.round,u_=Tt.RangeError,l_=Ei.ArrayBuffer,d_=l_.prototype,h_=Ei.DataView,f_=_i.NATIVE_ARRAY_BUFFER_VIEWS,p_=_i.TYPED_ARRAY_CONSTRUCTOR,v_=_i.TYPED_ARRAY_TAG,m_=_i.TypedArray,y_=_i.TypedArrayPrototype,A_=_i.aTypedArrayConstructor,__=_i.isTypedArray,b_="BYTES_PER_ELEMENT",E_="Wrong length",fromList=function(j,_e){A_(j);for(var _t=0,St=_e.length,Tt=new j(St);St>_t;)Tt[_t]=_e[_t++];return Tt},addGetter=function(j,_e){a_(j,_e,{get:function(){return r_(this)[_e]}})},isArrayBuffer=function(j){var _e;return _f(d_,j)||"ArrayBuffer"==(_e=_u(j))||"SharedArrayBuffer"==_e},isTypedArrayIndex=function(j,_e){return __(j)&&!_d(_e)&&_e in j&&_o(+_e)&&_e>=0},w_=function getOwnPropertyDescriptor(j,_e){return _e=_c(_e),isTypedArrayIndex(j,_e)?Di(2,j[_e]):s_(j,_e)},I_=function defineProperty(j,_e,_t){return _e=_c(_e),!(isTypedArrayIndex(j,_e)&&_l(_t)&&kc(_t,"value"))||kc(_t,"get")||kc(_t,"set")||_t.configurable||kc(_t,"writable")&&!_t.writable||kc(_t,"enumerable")&&!_t.enumerable?a_(j,_e,_t):(j[_e]=_t.value,j)};_r?(f_||(_A.f=w_,_y.f=I_,addGetter(y_,"buffer"),addGetter(y_,"byteOffset"),addGetter(y_,"byteLength"),addGetter(y_,"length")),St({target:"Object",stat:!0,forced:!f_},{getOwnPropertyDescriptor:w_,defineProperty:I_}),j.exports=function(j,_e,_t){var _r=j.match(/\d+$/)[0]/8,_i=j+(_t?"Clamped":"")+"Array",Ei="get"+j,Di="set"+j,_o=Tt[_i],_c=_o,kc=_c&&_c.prototype,_u={},addElement=function(j,_e){a_(j,_e,{get:function(){return function(j,_e){var _t=r_(j);return _t.view[Ei](_e*_r+_t.byteOffset,!0)}(this,_e)},set:function(j){return function(j,_e,St){var Tt=r_(j);_t&&(St=(St=c_(St))<0?0:St>255?255:255&St),Tt.view[Di](_e*_r+Tt.byteOffset,St,!0)}(this,_e,j)},enumerable:!0})};f_?_n&&(_c=_e((function(j,_e,_t,St){return Ci(j,kc),t_(_l(_e)?isArrayBuffer(_e)?void 0!==St?new _o(_e,_s(_t,_r),St):void 0!==_t?new _o(_e,_s(_t,_r)):new _o(_e):__(_e)?fromList(_c,_e):Ut(_v,_c,_e):new _o(_a(_e)),j,_c)})),_p&&_p(_c,m_),_m(Eg(_o),(function(j){j in _c||Fi(_c,j,_o[j])})),_c.prototype=kc):(_c=_e((function(j,_e,_t,St){Ci(j,kc);var Tt,_n,_i,Ei=0,Di=0;if(_l(_e)){if(!isArrayBuffer(_e))return __(_e)?fromList(_c,_e):Ut(_v,_c,_e);Tt=_e,Di=_s(_t,_r);var Fi=_e.byteLength;if(void 0===St){if(Fi%_r)throw u_(E_);if((_n=Fi-Di)<0)throw u_(E_)}else if((_n=ga(St)*_r)+Di>Fi)throw u_(E_);_i=_n/_r}else _i=_a(_e),Tt=new l_(_n=_i*_r);for(i_(j,{buffer:Tt,byteOffset:Di,byteLength:_n,length:_i,view:new h_(Tt)});Ei<_i;)addElement(j,Ei++)})),_p&&_p(_c,m_),kc=_c.prototype=_h(y_)),kc.constructor!==_c&&Fi(kc,"constructor",_c),Fi(kc,p_,_c),v_&&Fi(kc,v_,_i),_u[_i]=_c,St({global:!0,forced:_c!=_o,sham:!f_},_u),b_ in _c||Fi(_c,b_,_r),b_ in kc||Fi(kc,b_,_r),Pm(_i)}):j.exports=function(){}},3832:(j,_e,_t)=>{var St=_t(7854),Tt=_t(7293),Ut=_t(7072),_r=_t(260).NATIVE_ARRAY_BUFFER_VIEWS,_n=St.ArrayBuffer,_i=St.Int8Array;j.exports=!_r||!Tt((function(){_i(1)}))||!Tt((function(){new _i(-1)}))||!Ut((function(j){new _i,new _i(null),new _i(1.5),new _i(j)}),!0)||Tt((function(){return 1!==new _i(new _n(2),1,void 0).length}))},3074:(j,_e,_t)=>{var St=_t(7745),Tt=_t(6304);j.exports=function(j,_e){return St(Tt(j),_e)}},7321:(j,_e,_t)=>{var St=_t(9974),Tt=_t(6916),Ut=_t(9483),_r=_t(7908),_n=_t(6244),_i=_t(8554),Ei=_t(1246),Ci=_t(7659),Di=_t(260).aTypedArrayConstructor;j.exports=function from(j){var _e,_t,Fi,_o,ga,_a,_s=Ut(this),_c=_r(j),kc=arguments.length,_u=kc>1?arguments[1]:void 0,_l=void 0!==_u,_d=Ei(_c);if(_d&&!Ci(_d))for(_a=(ga=_i(_c,_d)).next,_c=[];!(_o=Tt(_a,ga)).done;)_c.push(_o.value);for(_l&&kc>2&&(_u=St(_u,arguments[2])),_t=_n(_c),Fi=new(Di(_s))(_t),_e=0;_t>_e;_e++)Fi[_e]=_l?_u(_c[_e],_e):_c[_e];return Fi}},6304:(j,_e,_t)=>{var St=_t(260),Tt=_t(6707),Ut=St.TYPED_ARRAY_CONSTRUCTOR,_r=St.aTypedArrayConstructor;j.exports=function(j){return _r(Tt(j,j[Ut]))}},9711:(j,_e,_t)=>{var St=_t(1702),Tt=0,Ut=Math.random(),_r=St(1..toString);j.exports=function(j){return"Symbol("+(void 0===j?"":j)+")_"+_r(++Tt+Ut,36)}},3307:(j,_e,_t)=>{var St=_t(133);j.exports=St&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},6061:(j,_e,_t)=>{var St=_t(5112);_e.f=St},5112:(j,_e,_t)=>{var St=_t(7854),Tt=_t(2309),Ut=_t(2597),_r=_t(9711),_n=_t(133),_i=_t(3307),Ei=Tt("wks"),Ci=St.Symbol,Di=Ci&&Ci.for,Fi=_i?Ci:Ci&&Ci.withoutSetter||_r;j.exports=function(j){if(!Ut(Ei,j)||!_n&&"string"!=typeof Ei[j]){var _e="Symbol."+j;_n&&Ut(Ci,j)?Ei[j]=Ci[j]:Ei[j]=_i&&Di?Di(_e):Fi(_e)}return Ei[j]}},1361:j=>{j.exports="\t\n\v\f\r \u2028\u2029\ufeff"},9575:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1702),Ut=_t(7293),_r=_t(3331),_n=_t(9670),_i=_t(1400),Ei=_t(7466),Ci=_t(6707),Di=_r.ArrayBuffer,Fi=_r.DataView,_o=Fi.prototype,ga=Tt(Di.prototype.slice),_a=Tt(_o.getUint8),_s=Tt(_o.setUint8);St({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Ut((function(){return!new Di(2).slice(1,void 0).byteLength}))},{slice:function slice(j,_e){if(ga&&void 0===_e)return ga(_n(this),j);for(var _t=_n(this).byteLength,St=_i(j,_t),Tt=_i(void 0===_e?_t:_e,_t),Ut=new(Ci(this,Di))(Ei(Tt-St)),_r=new Fi(this),_o=new Fi(Ut),_c=0;St<Tt;)_s(_o,_c++,_a(_r,St++));return Ut}})},2222:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(7293),_r=_t(3157),_n=_t(111),_i=_t(7908),Ei=_t(6244),Ci=_t(6135),Di=_t(5417),Fi=_t(1194),_o=_t(5112),ga=_t(7392),_a=_o("isConcatSpreadable"),_s=9007199254740991,_c="Maximum allowed index exceeded",kc=Tt.TypeError,_u=ga>=51||!Ut((function(){var j=[];return j[_a]=!1,j.concat()[0]!==j})),_l=Fi("concat"),isConcatSpreadable=function(j){if(!_n(j))return!1;var _e=j[_a];return void 0!==_e?!!_e:_r(j)};St({target:"Array",proto:!0,forced:!_u||!_l},{concat:function concat(j){var _e,_t,St,Tt,Ut,_r=_i(this),_n=Di(_r,0),Fi=0;for(_e=-1,St=arguments.length;_e<St;_e++)if(isConcatSpreadable(Ut=-1===_e?_r:arguments[_e])){if(Fi+(Tt=Ei(Ut))>_s)throw kc(_c);for(_t=0;_t<Tt;_t++,Fi++)_t in Ut&&Ci(_n,Fi,Ut[_t])}else{if(Fi>=_s)throw kc(_c);Ci(_n,Fi++,Ut)}return _n.length=Fi,_n}})},6541:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(2092).every;St({target:"Array",proto:!0,forced:!_t(2133)("every")},{every:function every(j){return Tt(this,j,arguments.length>1?arguments[1]:void 0)}})},3290:(j,_e,_t)=>{var St=_t(2109),Tt=_t(1285),Ut=_t(1223);St({target:"Array",proto:!0},{fill:Tt}),Ut("fill")},7327:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(2092).filter;St({target:"Array",proto:!0,forced:!_t(1194)("filter")},{filter:function filter(j){return Tt(this,j,arguments.length>1?arguments[1]:void 0)}})},9826:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(2092).find,Ut=_t(1223),_r="find",_n=!0;_r in[]&&Array(1)[_r]((function(){_n=!1})),St({target:"Array",proto:!0,forced:_n},{find:function find(j){return Tt(this,j,arguments.length>1?arguments[1]:void 0)}}),Ut(_r)},9554:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(8533);St({target:"Array",proto:!0,forced:[].forEach!=Tt},{forEach:Tt})},1038:(j,_e,_t)=>{var St=_t(2109),Tt=_t(8457);St({target:"Array",stat:!0,forced:!_t(7072)((function(j){Array.from(j)}))},{from:Tt})},6699:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1318).includes,Ut=_t(1223);St({target:"Array",proto:!0},{includes:function includes(j){return Tt(this,j,arguments.length>1?arguments[1]:void 0)}}),Ut("includes")},2772:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1702),Ut=_t(1318).indexOf,_r=_t(2133),_n=Tt([].indexOf),_i=!!_n&&1/_n([1],1,-0)<0,Ei=_r("indexOf");St({target:"Array",proto:!0,forced:_i||!Ei},{indexOf:function indexOf(j){var _e=arguments.length>1?arguments[1]:void 0;return _i?_n(this,j,_e)||0:Ut(this,j,_e)}})},9753:(j,_e,_t)=>{_t(2109)({target:"Array",stat:!0},{isArray:_t(3157)})},6992:(j,_e,_t)=>{"use strict";var St=_t(5656),Tt=_t(1223),Ut=_t(7497),_r=_t(9909),_n=_t(3070).f,_i=_t(654),Ei=_t(1913),Ci=_t(9781),Di="Array Iterator",Fi=_r.set,_o=_r.getterFor(Di);j.exports=_i(Array,"Array",(function(j,_e){Fi(this,{type:Di,target:St(j),index:0,kind:_e})}),(function(){var j=_o(this),_e=j.target,_t=j.kind,St=j.index++;return!_e||St>=_e.length?(j.target=void 0,{value:void 0,done:!0}):"keys"==_t?{value:St,done:!1}:"values"==_t?{value:_e[St],done:!1}:{value:[St,_e[St]],done:!1}}),"values");var ga=Ut.Arguments=Ut.Array;if(Tt("keys"),Tt("values"),Tt("entries"),!Ei&&Ci&&"values"!==ga.name)try{_n(ga,"name",{value:"values"})}catch(j){}},9600:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1702),Ut=_t(8361),_r=_t(5656),_n=_t(2133),_i=Tt([].join),Ei=Ut!=Object,Ci=_n("join",",");St({target:"Array",proto:!0,forced:Ei||!Ci},{join:function join(j){return _i(_r(this),void 0===j?",":j)}})},1249:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(2092).map;St({target:"Array",proto:!0,forced:!_t(1194)("map")},{map:function map(j){return Tt(this,j,arguments.length>1?arguments[1]:void 0)}})},5827:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(3671).left,Ut=_t(2133),_r=_t(7392),_n=_t(5268);St({target:"Array",proto:!0,forced:!Ut("reduce")||!_n&&_r>79&&_r<83},{reduce:function reduce(j){var _e=arguments.length;return Tt(this,j,_e,_e>1?arguments[1]:void 0)}})},5069:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1702),Ut=_t(3157),_r=Tt([].reverse),_n=[1,2];St({target:"Array",proto:!0,forced:String(_n)===String(_n.reverse())},{reverse:function reverse(){return Ut(this)&&(this.length=this.length),_r(this)}})},7042:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(3157),_r=_t(4411),_n=_t(111),_i=_t(1400),Ei=_t(6244),Ci=_t(5656),Di=_t(6135),Fi=_t(5112),_o=_t(1194),ga=_t(206),_a=_o("slice"),_s=Fi("species"),_c=Tt.Array,kc=Math.max;St({target:"Array",proto:!0,forced:!_a},{slice:function slice(j,_e){var _t,St,Tt,Fi=Ci(this),_o=Ei(Fi),_a=_i(j,_o),_u=_i(void 0===_e?_o:_e,_o);if(Ut(Fi)&&(_t=Fi.constructor,(_r(_t)&&(_t===_c||Ut(_t.prototype))||_n(_t)&&null===(_t=_t[_s]))&&(_t=void 0),_t===_c||void 0===_t))return ga(Fi,_a,_u);for(St=new(void 0===_t?_c:_t)(kc(_u-_a,0)),Tt=0;_a<_u;_a++,Tt++)_a in Fi&&Di(St,Tt,Fi[_a]);return St.length=Tt,St}})},5212:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(2092).some;St({target:"Array",proto:!0,forced:!_t(2133)("some")},{some:function some(j){return Tt(this,j,arguments.length>1?arguments[1]:void 0)}})},2707:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1702),Ut=_t(9662),_r=_t(7908),_n=_t(6244),_i=_t(1340),Ei=_t(7293),Ci=_t(6329),Di=_t(2133),Fi=_t(8886),_o=_t(256),ga=_t(7392),_a=_t(8008),_s=[],_c=Tt(_s.sort),kc=Tt(_s.push),_u=Ei((function(){_s.sort(void 0)})),_l=Ei((function(){_s.sort(null)})),_d=Di("sort"),_h=!Ei((function(){if(ga)return ga<70;if(!(Fi&&Fi>3)){if(_o)return!0;if(_a)return _a<603;var j,_e,_t,St,Tt="";for(j=65;j<76;j++){switch(_e=String.fromCharCode(j),j){case 66:case 69:case 70:case 72:_t=3;break;case 68:case 71:_t=4;break;default:_t=2}for(St=0;St<47;St++)_s.push({k:_e+St,v:_t})}for(_s.sort((function(j,_e){return _e.v-j.v})),St=0;St<_s.length;St++)_e=_s[St].k.charAt(0),Tt.charAt(Tt.length-1)!==_e&&(Tt+=_e);return"DGBEFHACIJK"!==Tt}}));St({target:"Array",proto:!0,forced:_u||!_l||!_d||!_h},{sort:function sort(j){void 0!==j&&Ut(j);var _e=_r(this);if(_h)return void 0===j?_c(_e):_c(_e,j);var _t,St,Tt=[],Ei=_n(_e);for(St=0;St<Ei;St++)St in _e&&kc(Tt,_e[St]);for(Ci(Tt,function(j){return function(_e,_t){return void 0===_t?-1:void 0===_e?1:void 0!==j?+j(_e,_t)||0:_i(_e)>_i(_t)?1:-1}}(j)),_t=Tt.length,St=0;St<_t;)_e[St]=Tt[St++];for(;St<Ei;)delete _e[St++];return _e}})},561:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(1400),_r=_t(9303),_n=_t(6244),_i=_t(7908),Ei=_t(5417),Ci=_t(6135),Di=_t(1194)("splice"),Fi=Tt.TypeError,_o=Math.max,ga=Math.min,_a=9007199254740991,_s="Maximum allowed length exceeded";St({target:"Array",proto:!0,forced:!Di},{splice:function splice(j,_e){var _t,St,Tt,Di,_c,kc,_u=_i(this),_l=_n(_u),_d=Ut(j,_l),_h=arguments.length;if(0===_h?_t=St=0:1===_h?(_t=0,St=_l-_d):(_t=_h-2,St=ga(_o(_r(_e),0),_l-_d)),_l+_t-St>_a)throw Fi(_s);for(Tt=Ei(_u,St),Di=0;Di<St;Di++)(_c=_d+Di)in _u&&Ci(Tt,Di,_u[_c]);if(Tt.length=St,_t<St){for(Di=_d;Di<_l-St;Di++)kc=Di+_t,(_c=Di+St)in _u?_u[kc]=_u[_c]:delete _u[kc];for(Di=_l;Di>_l-St+_t;Di--)delete _u[Di-1]}else if(_t>St)for(Di=_l-St;Di>_d;Di--)kc=Di+_t-1,(_c=Di+St-1)in _u?_u[kc]=_u[_c]:delete _u[kc];for(Di=0;Di<_t;Di++)_u[Di+_d]=arguments[Di+2];return _u.length=_l-St+_t,Tt}})},3843:(j,_e,_t)=>{var St=_t(2109),Tt=_t(7854),Ut=_t(1702),_r=Tt.Date,_n=Ut(_r.prototype.getTime);St({target:"Date",stat:!0},{now:function now(){return _n(new _r)}})},3710:(j,_e,_t)=>{var St=_t(1702),Tt=_t(1320),Ut=Date.prototype,_r="Invalid Date",_n="toString",_i=St(Ut[_n]),Ei=St(Ut.getTime);String(new Date(NaN))!=_r&&Tt(Ut,_n,(function toString(){var j=Ei(this);return j==j?_i(this):_r}))},4812:(j,_e,_t)=>{_t(2109)({target:"Function",proto:!0},{bind:_t(7065)})},8309:(j,_e,_t)=>{var St=_t(9781),Tt=_t(6530).EXISTS,Ut=_t(1702),_r=_t(3070).f,_n=Function.prototype,_i=Ut(_n.toString),Ei=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Ci=Ut(Ei.exec);St&&!Tt&&_r(_n,"name",{configurable:!0,get:function(){try{return Ci(Ei,_i(this))[1]}catch(j){return""}}})},3706:(j,_e,_t)=>{var St=_t(7854);_t(8003)(St.JSON,"JSON",!0)},1532:(j,_e,_t)=>{"use strict";_t(7710)("Map",(function(j){return function Map(){return j(this,arguments.length?arguments[0]:void 0)}}),_t(5631))},408:(j,_e,_t)=>{_t(8003)(Math,"Math",!0)},9601:(j,_e,_t)=>{var St=_t(2109),Tt=_t(1574);St({target:"Object",stat:!0,forced:Object.assign!==Tt},{assign:Tt})},8011:(j,_e,_t)=>{_t(2109)({target:"Object",stat:!0,sham:!_t(9781)},{create:_t(30)})},3321:(j,_e,_t)=>{var St=_t(2109),Tt=_t(9781);St({target:"Object",stat:!0,forced:!Tt,sham:!Tt},{defineProperties:_t(6048)})},9070:(j,_e,_t)=>{var St=_t(2109),Tt=_t(9781);St({target:"Object",stat:!0,forced:!Tt,sham:!Tt},{defineProperty:_t(3070).f})},9720:(j,_e,_t)=>{var St=_t(2109),Tt=_t(4699).entries;St({target:"Object",stat:!0},{entries:function entries(j){return Tt(j)}})},3371:(j,_e,_t)=>{var St=_t(2109),Tt=_t(6677),Ut=_t(7293),_r=_t(111),_n=_t(2423).onFreeze,_i=Object.freeze;St({target:"Object",stat:!0,forced:Ut((function(){_i(1)})),sham:!Tt},{freeze:function freeze(j){return _i&&_r(j)?_i(_n(j)):j}})},5003:(j,_e,_t)=>{var St=_t(2109),Tt=_t(7293),Ut=_t(5656),_r=_t(1236).f,_n=_t(9781),_i=Tt((function(){_r(1)}));St({target:"Object",stat:!0,forced:!_n||_i,sham:!_n},{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(j,_e){return _r(Ut(j),_e)}})},9337:(j,_e,_t)=>{var St=_t(2109),Tt=_t(9781),Ut=_t(3887),_r=_t(5656),_n=_t(1236),_i=_t(6135);St({target:"Object",stat:!0,sham:!Tt},{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(j){for(var _e,_t,St=_r(j),Tt=_n.f,Ei=Ut(St),Ci={},Di=0;Ei.length>Di;)void 0!==(_t=Tt(St,_e=Ei[Di++]))&&_i(Ci,_e,_t);return Ci}})},6210:(j,_e,_t)=>{var St=_t(2109),Tt=_t(7293),Ut=_t(1156).f;St({target:"Object",stat:!0,forced:Tt((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:Ut})},489:(j,_e,_t)=>{var St=_t(2109),Tt=_t(7293),Ut=_t(7908),_r=_t(9518),_n=_t(8544);St({target:"Object",stat:!0,forced:Tt((function(){_r(1)})),sham:!_n},{getPrototypeOf:function getPrototypeOf(j){return _r(Ut(j))}})},7941:(j,_e,_t)=>{var St=_t(2109),Tt=_t(7908),Ut=_t(1956);St({target:"Object",stat:!0,forced:_t(7293)((function(){Ut(1)}))},{keys:function keys(j){return Ut(Tt(j))}})},8304:(j,_e,_t)=>{_t(2109)({target:"Object",stat:!0},{setPrototypeOf:_t(7674)})},1539:(j,_e,_t)=>{var St=_t(1694),Tt=_t(1320),Ut=_t(288);St||Tt(Object.prototype,"toString",Ut,{unsafe:!0})},2479:(j,_e,_t)=>{var St=_t(2109),Tt=_t(4699).values;St({target:"Object",stat:!0},{values:function values(j){return Tt(j)}})},1058:(j,_e,_t)=>{var St=_t(2109),Tt=_t(3009);St({global:!0,forced:parseInt!=Tt},{parseInt:Tt})},7727:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(3366),_r=_t(7293),_n=_t(5005),_i=_t(614),Ei=_t(6707),Ci=_t(9478),Di=_t(1320);if(St({target:"Promise",proto:!0,real:!0,forced:!!Ut&&_r((function(){Ut.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(j){var _e=Ei(this,_n("Promise")),_t=_i(j);return this.then(_t?function(_t){return Ci(_e,j()).then((function(){return _t}))}:j,_t?function(_t){return Ci(_e,j()).then((function(){throw _t}))}:j)}}),!Tt&&_i(Ut)){var Fi=_n("Promise").prototype.finally;Ut.prototype.finally!==Fi&&Di(Ut.prototype,"finally",Fi,{unsafe:!0})}},8674:(j,_e,_t)=>{"use strict";var St,Tt,Ut,_r,_n=_t(2109),_i=_t(1913),Ei=_t(7854),Ci=_t(5005),Di=_t(6916),Fi=_t(3366),_o=_t(1320),ga=_t(2248),_a=_t(7674),_s=_t(8003),_c=_t(6340),kc=_t(9662),_u=_t(614),_l=_t(111),_d=_t(5787),_h=_t(2788),_f=_t(612),_p=_t(7072),Eg=_t(6707),_v=_t(261).set,_m=_t(5948),Pm=_t(9478),_y=_t(842),_A=_t(8523),e_=_t(2534),t_=_t(8572),r_=_t(9909),i_=_t(4705),a_=_t(5112),s_=_t(7871),c_=_t(5268),u_=_t(7392),l_=a_("species"),d_="Promise",h_=r_.getterFor(d_),f_=r_.set,p_=r_.getterFor(d_),v_=Fi&&Fi.prototype,m_=Fi,y_=v_,A_=Ei.TypeError,__=Ei.document,b_=Ei.process,E_=_A.f,w_=E_,I_=!!(__&&__.createEvent&&Ei.dispatchEvent),T_=_u(Ei.PromiseRejectionEvent),C_="unhandledrejection",R_=!1,k_=i_(d_,(function(){var j=_h(m_),_e=j!==String(m_);if(!_e&&66===u_)return!0;if(_i&&!y_.finally)return!0;if(u_>=51&&/native code/.test(j))return!1;var _t=new m_((function(j){j(1)})),FakePromise=function(j){j((function(){}),(function(){}))};return(_t.constructor={})[l_]=FakePromise,!(R_=_t.then((function(){}))instanceof FakePromise)||!_e&&s_&&!T_})),O_=k_||!_p((function(j){m_.all(j).catch((function(){}))})),isThenable=function(j){var _e;return!(!_l(j)||!_u(_e=j.then))&&_e},callReaction=function(j,_e){var _t,St,Tt,Ut=_e.value,_r=1==_e.state,_n=_r?j.ok:j.fail,_i=j.resolve,Ei=j.reject,Ci=j.domain;try{_n?(_r||(2===_e.rejection&&onHandleUnhandled(_e),_e.rejection=1),!0===_n?_t=Ut:(Ci&&Ci.enter(),_t=_n(Ut),Ci&&(Ci.exit(),Tt=!0)),_t===j.promise?Ei(A_("Promise-chain cycle")):(St=isThenable(_t))?Di(St,_t,_i,Ei):_i(_t)):Ei(Ut)}catch(j){Ci&&!Tt&&Ci.exit(),Ei(j)}},notify=function(j,_e){j.notified||(j.notified=!0,_m((function(){for(var _t,St=j.reactions;_t=St.get();)callReaction(_t,j);j.notified=!1,_e&&!j.rejection&&onUnhandled(j)})))},dispatchEvent=function(j,_e,_t){var St,Tt;I_?((St=__.createEvent("Event")).promise=_e,St.reason=_t,St.initEvent(j,!1,!0),Ei.dispatchEvent(St)):St={promise:_e,reason:_t},!T_&&(Tt=Ei["on"+j])?Tt(St):j===C_&&_y("Unhandled promise rejection",_t)},onUnhandled=function(j){Di(_v,Ei,(function(){var _e,_t=j.facade,St=j.value;if(isUnhandled(j)&&(_e=e_((function(){c_?b_.emit("unhandledRejection",St,_t):dispatchEvent(C_,_t,St)})),j.rejection=c_||isUnhandled(j)?2:1,_e.error))throw _e.value}))},isUnhandled=function(j){return 1!==j.rejection&&!j.parent},onHandleUnhandled=function(j){Di(_v,Ei,(function(){var _e=j.facade;c_?b_.emit("rejectionHandled",_e):dispatchEvent("rejectionhandled",_e,j.value)}))},bind=function(j,_e,_t){return function(St){j(_e,St,_t)}},internalReject=function(j,_e,_t){j.done||(j.done=!0,_t&&(j=_t),j.value=_e,j.state=2,notify(j,!0))},internalResolve=function(j,_e,_t){if(!j.done){j.done=!0,_t&&(j=_t);try{if(j.facade===_e)throw A_("Promise can't be resolved itself");var St=isThenable(_e);St?_m((function(){var _t={done:!1};try{Di(St,_e,bind(internalResolve,_t,j),bind(internalReject,_t,j))}catch(_e){internalReject(_t,_e,j)}})):(j.value=_e,j.state=1,notify(j,!1))}catch(_e){internalReject({done:!1},_e,j)}}};if(k_&&(y_=(m_=function Promise(j){_d(this,y_),kc(j),Di(St,this);var _e=h_(this);try{j(bind(internalResolve,_e),bind(internalReject,_e))}catch(j){internalReject(_e,j)}}).prototype,(St=function Promise(j){f_(this,{type:d_,done:!1,notified:!1,parent:!1,reactions:new t_,rejection:!1,state:0,value:void 0})}).prototype=ga(y_,{then:function then(j,_e){var _t=p_(this),St=E_(Eg(this,m_));return _t.parent=!0,St.ok=!_u(j)||j,St.fail=_u(_e)&&_e,St.domain=c_?b_.domain:void 0,0==_t.state?_t.reactions.add(St):_m((function(){callReaction(St,_t)})),St.promise},catch:function(j){return this.then(void 0,j)}}),Tt=function(){var j=new St,_e=h_(j);this.promise=j,this.resolve=bind(internalResolve,_e),this.reject=bind(internalReject,_e)},_A.f=E_=function(j){return j===m_||j===Ut?new Tt(j):w_(j)},!_i&&_u(Fi)&&v_!==Object.prototype)){_r=v_.then,R_||(_o(v_,"then",(function then(j,_e){var _t=this;return new m_((function(j,_e){Di(_r,_t,j,_e)})).then(j,_e)}),{unsafe:!0}),_o(v_,"catch",y_.catch,{unsafe:!0}));try{delete v_.constructor}catch(j){}_a&&_a(v_,y_)}_n({global:!0,wrap:!0,forced:k_},{Promise:m_}),_s(m_,d_,!1,!0),_c(d_),Ut=Ci(d_),_n({target:d_,stat:!0,forced:k_},{reject:function reject(j){var _e=E_(this);return Di(_e.reject,void 0,j),_e.promise}}),_n({target:d_,stat:!0,forced:_i||k_},{resolve:function resolve(j){return Pm(_i&&this===Ut?m_:this,j)}}),_n({target:d_,stat:!0,forced:O_},{all:function all(j){var _e=this,_t=E_(_e),St=_t.resolve,Tt=_t.reject,Ut=e_((function(){var _t=kc(_e.resolve),Ut=[],_r=0,_n=1;_f(j,(function(j){var _i=_r++,Ei=!1;_n++,Di(_t,_e,j).then((function(j){Ei||(Ei=!0,Ut[_i]=j,--_n||St(Ut))}),Tt)})),--_n||St(Ut)}));return Ut.error&&Tt(Ut.value),_t.promise},race:function race(j){var _e=this,_t=E_(_e),St=_t.reject,Tt=e_((function(){var Tt=kc(_e.resolve);_f(j,(function(j){Di(Tt,_e,j).then(_t.resolve,St)}))}));return Tt.error&&St(Tt.value),_t.promise}})},2419:(j,_e,_t)=>{var St=_t(2109),Tt=_t(5005),Ut=_t(2104),_r=_t(7065),_n=_t(9483),_i=_t(9670),Ei=_t(111),Ci=_t(30),Di=_t(7293),Fi=Tt("Reflect","construct"),_o=Object.prototype,ga=[].push,_a=Di((function(){function F(){}return!(Fi((function(){}),[],F)instanceof F)})),_s=!Di((function(){Fi((function(){}))})),_c=_a||_s;St({target:"Reflect",stat:!0,forced:_c,sham:_c},{construct:function construct(j,_e){_n(j),_i(_e);var _t=arguments.length<3?j:_n(arguments[2]);if(_s&&!_a)return Fi(j,_e,_t);if(j==_t){switch(_e.length){case 0:return new j;case 1:return new j(_e[0]);case 2:return new j(_e[0],_e[1]);case 3:return new j(_e[0],_e[1],_e[2]);case 4:return new j(_e[0],_e[1],_e[2],_e[3])}var St=[null];return Ut(ga,St,_e),new(Ut(_r,j,St))}var Tt=_t.prototype,Di=Ci(Ei(Tt)?Tt:_o),_c=Ut(j,Di,_e);return Ei(_c)?_c:Di}})},4916:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(2261);St({target:"RegExp",proto:!0,forced:/./.exec!==Tt},{exec:Tt})},189:(j,_e,_t)=>{"use strict";_t(7710)("Set",(function(j){return function Set(){return j(this,arguments.length?arguments[0]:void 0)}}),_t(5631))},2023:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1702),Ut=_t(3929),_r=_t(4488),_n=_t(1340),_i=_t(4964),Ei=Tt("".indexOf);St({target:"String",proto:!0,forced:!_i("includes")},{includes:function includes(j){return!!~Ei(_n(_r(this)),_n(Ut(j)),arguments.length>1?arguments[1]:void 0)}})},8783:(j,_e,_t)=>{"use strict";var St=_t(8710).charAt,Tt=_t(1340),Ut=_t(9909),_r=_t(654),_n="String Iterator",_i=Ut.set,Ei=Ut.getterFor(_n);_r(String,"String",(function(j){_i(this,{type:_n,string:Tt(j),index:0})}),(function next(){var j,_e=Ei(this),_t=_e.string,Tt=_e.index;return Tt>=_t.length?{value:void 0,done:!0}:(j=St(_t,Tt),_e.index+=j.length,{value:j,done:!1})}))},4723:(j,_e,_t)=>{"use strict";var St=_t(6916),Tt=_t(7007),Ut=_t(9670),_r=_t(7466),_n=_t(1340),_i=_t(4488),Ei=_t(8173),Ci=_t(1530),Di=_t(7651);Tt("match",(function(j,_e,_t){return[function match(_e){var _t=_i(this),Tt=null==_e?void 0:Ei(_e,j);return Tt?St(Tt,_e,_t):new RegExp(_e)[j](_n(_t))},function(j){var St=Ut(this),Tt=_n(j),_i=_t(_e,St,Tt);if(_i.done)return _i.value;if(!St.global)return Di(St,Tt);var Ei=St.unicode;St.lastIndex=0;for(var Fi,_o=[],ga=0;null!==(Fi=Di(St,Tt));){var _a=_n(Fi[0]);_o[ga]=_a,""===_a&&(St.lastIndex=Ci(Tt,_r(St.lastIndex),Ei)),ga++}return 0===ga?null:_o}]}))},5306:(j,_e,_t)=>{"use strict";var St=_t(2104),Tt=_t(6916),Ut=_t(1702),_r=_t(7007),_n=_t(7293),_i=_t(9670),Ei=_t(614),Ci=_t(9303),Di=_t(7466),Fi=_t(1340),_o=_t(4488),ga=_t(1530),_a=_t(8173),_s=_t(647),_c=_t(7651),kc=_t(5112)("replace"),_u=Math.max,_l=Math.min,_d=Ut([].concat),_h=Ut([].push),_f=Ut("".indexOf),_p=Ut("".slice),Eg="$0"==="a".replace(/./,"$0"),_v=!!/./[kc]&&""===/./[kc]("a","$0");_r("replace",(function(j,_e,_t){var Ut=_v?"$":"$0";return[function replace(j,_t){var St=_o(this),Ut=null==j?void 0:_a(j,kc);return Ut?Tt(Ut,j,St,_t):Tt(_e,Fi(St),j,_t)},function(j,Tt){var _r=_i(this),_n=Fi(j);if("string"==typeof Tt&&-1===_f(Tt,Ut)&&-1===_f(Tt,"$<")){var _o=_t(_e,_r,_n,Tt);if(_o.done)return _o.value}var _a=Ei(Tt);_a||(Tt=Fi(Tt));var kc=_r.global;if(kc){var Eg=_r.unicode;_r.lastIndex=0}for(var _v=[];;){var _m=_c(_r,_n);if(null===_m)break;if(_h(_v,_m),!kc)break;""===Fi(_m[0])&&(_r.lastIndex=ga(_n,Di(_r.lastIndex),Eg))}for(var Pm,_y="",_A=0,e_=0;e_<_v.length;e_++){for(var t_=Fi((_m=_v[e_])[0]),r_=_u(_l(Ci(_m.index),_n.length),0),i_=[],a_=1;a_<_m.length;a_++)_h(i_,void 0===(Pm=_m[a_])?Pm:String(Pm));var s_=_m.groups;if(_a){var c_=_d([t_],i_,r_,_n);void 0!==s_&&_h(c_,s_);var u_=Fi(St(Tt,void 0,c_))}else u_=_s(t_,_n,r_,i_,s_,Tt);r_>=_A&&(_y+=_p(_n,_A,r_)+u_,_A=r_+t_.length)}return _y+_p(_n,_A)}]}),!!_n((function(){var j=/./;return j.exec=function(){var j=[];return j.groups={a:"7"},j},"7"!=="".replace(j,"$<a>")}))||!Eg||_v)},3123:(j,_e,_t)=>{"use strict";var St=_t(2104),Tt=_t(6916),Ut=_t(1702),_r=_t(7007),_n=_t(7850),_i=_t(9670),Ei=_t(4488),Ci=_t(6707),Di=_t(1530),Fi=_t(7466),_o=_t(1340),ga=_t(8173),_a=_t(1589),_s=_t(7651),_c=_t(2261),kc=_t(2999),_u=_t(7293),_l=kc.UNSUPPORTED_Y,_d=4294967295,_h=Math.min,_f=[].push,_p=Ut(/./.exec),Eg=Ut(_f),_v=Ut("".slice),_m=!_u((function(){var j=/(?:)/,_e=j.exec;j.exec=function(){return _e.apply(this,arguments)};var _t="ab".split(j);return 2!==_t.length||"a"!==_t[0]||"b"!==_t[1]}));_r("split",(function(j,_e,_t){var Ut;return Ut="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(j,_t){var Ut=_o(Ei(this)),_r=void 0===_t?_d:_t>>>0;if(0===_r)return[];if(void 0===j)return[Ut];if(!_n(j))return Tt(_e,Ut,j,_r);for(var _i,Ci,Di,Fi=[],ga=(j.ignoreCase?"i":"")+(j.multiline?"m":"")+(j.unicode?"u":"")+(j.sticky?"y":""),_s=0,kc=new RegExp(j.source,ga+"g");(_i=Tt(_c,kc,Ut))&&!((Ci=kc.lastIndex)>_s&&(Eg(Fi,_v(Ut,_s,_i.index)),_i.length>1&&_i.index<Ut.length&&St(_f,Fi,_a(_i,1)),Di=_i[0].length,_s=Ci,Fi.length>=_r));)kc.lastIndex===_i.index&&kc.lastIndex++;return _s===Ut.length?!Di&&_p(kc,"")||Eg(Fi,""):Eg(Fi,_v(Ut,_s)),Fi.length>_r?_a(Fi,0,_r):Fi}:"0".split(void 0,0).length?function(j,_t){return void 0===j&&0===_t?[]:Tt(_e,this,j,_t)}:_e,[function split(_e,_t){var St=Ei(this),_r=null==_e?void 0:ga(_e,j);return _r?Tt(_r,_e,St,_t):Tt(Ut,_o(St),_e,_t)},function(j,St){var Tt=_i(this),_r=_o(j),_n=_t(Ut,Tt,_r,St,Ut!==_e);if(_n.done)return _n.value;var Ei=Ci(Tt,RegExp),ga=Tt.unicode,_a=(Tt.ignoreCase?"i":"")+(Tt.multiline?"m":"")+(Tt.unicode?"u":"")+(_l?"g":"y"),_c=new Ei(_l?"^(?:"+Tt.source+")":Tt,_a),kc=void 0===St?_d:St>>>0;if(0===kc)return[];if(0===_r.length)return null===_s(_c,_r)?[_r]:[];for(var _u=0,_f=0,_p=[];_f<_r.length;){_c.lastIndex=_l?0:_f;var _m,Pm=_s(_c,_l?_v(_r,_f):_r);if(null===Pm||(_m=_h(Fi(_c.lastIndex+(_l?_f:0)),_r.length))===_u)_f=Di(_r,_f,ga);else{if(Eg(_p,_v(_r,_u,_f)),_p.length===kc)return _p;for(var _y=1;_y<=Pm.length-1;_y++)if(Eg(_p,Pm[_y]),_p.length===kc)return _p;_f=_u=_m}}return Eg(_p,_v(_r,_u)),_p}]}),!_m,_l)},86:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(4230);St({target:"String",proto:!0,forced:_t(3429)("sub")},{sub:function sub(){return Tt(this,"sub","","")}})},2443:(j,_e,_t)=>{_t(7235)("asyncIterator")},1817:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(9781),Ut=_t(7854),_r=_t(1702),_n=_t(2597),_i=_t(614),Ei=_t(7976),Ci=_t(1340),Di=_t(3070).f,Fi=_t(9920),_o=Ut.Symbol,ga=_o&&_o.prototype;if(Tt&&_i(_o)&&(!("description"in ga)||void 0!==_o().description)){var _a={},_s=function Symbol(){var j=arguments.length<1||void 0===arguments[0]?void 0:Ci(arguments[0]),_e=Ei(ga,this)?new _o(j):void 0===j?_o():_o(j);return""===j&&(_a[_e]=!0),_e};Fi(_s,_o),_s.prototype=ga,ga.constructor=_s;var _c="Symbol(test)"==String(_o("test")),kc=_r(ga.toString),_u=_r(ga.valueOf),_l=/^Symbol\((.*)\)[^)]+$/,_d=_r("".replace),_h=_r("".slice);Di(ga,"description",{configurable:!0,get:function description(){var j=_u(this),_e=kc(j);if(_n(_a,j))return"";var _t=_c?_h(_e,7,-1):_d(_e,_l,"$1");return""===_t?void 0:_t}}),St({global:!0,forced:!0},{Symbol:_s})}},2165:(j,_e,_t)=>{_t(7235)("iterator")},2526:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(5005),_r=_t(2104),_n=_t(6916),_i=_t(1702),Ei=_t(1913),Ci=_t(9781),Di=_t(133),Fi=_t(7293),_o=_t(2597),ga=_t(3157),_a=_t(614),_s=_t(111),_c=_t(7976),kc=_t(2190),_u=_t(9670),_l=_t(7908),_d=_t(5656),_h=_t(4948),_f=_t(1340),_p=_t(9114),Eg=_t(30),_v=_t(1956),_m=_t(8006),Pm=_t(1156),_y=_t(5181),_A=_t(1236),e_=_t(3070),t_=_t(5296),r_=_t(206),i_=_t(1320),a_=_t(2309),s_=_t(6200),c_=_t(3501),u_=_t(9711),l_=_t(5112),d_=_t(6061),h_=_t(7235),f_=_t(8003),p_=_t(9909),v_=_t(2092).forEach,m_=s_("hidden"),y_="Symbol",A_="prototype",__=l_("toPrimitive"),b_=p_.set,E_=p_.getterFor(y_),w_=Object[A_],I_=Tt.Symbol,T_=I_&&I_[A_],C_=Tt.TypeError,R_=Tt.QObject,k_=Ut("JSON","stringify"),O_=_A.f,D_=e_.f,N_=Pm.f,P_=t_.f,M_=_i([].push),B_=a_("symbols"),j_=a_("op-symbols"),U_=a_("string-to-symbol-registry"),F_=a_("symbol-to-string-registry"),G_=a_("wks"),V_=!R_||!R_[A_]||!R_[A_].findChild,K_=Ci&&Fi((function(){return 7!=Eg(D_({},"a",{get:function(){return D_(this,"a",{value:7}).a}})).a}))?function(j,_e,_t){var St=O_(w_,_e);St&&delete w_[_e],D_(j,_e,_t),St&&j!==w_&&D_(w_,_e,St)}:D_,wrap=function(j,_e){var _t=B_[j]=Eg(T_);return b_(_t,{type:y_,tag:j,description:_e}),Ci||(_t.description=_e),_t},W_=function defineProperty(j,_e,_t){j===w_&&W_(j_,_e,_t),_u(j);var St=_h(_e);return _u(_t),_o(B_,St)?(_t.enumerable?(_o(j,m_)&&j[m_][St]&&(j[m_][St]=!1),_t=Eg(_t,{enumerable:_p(0,!1)})):(_o(j,m_)||D_(j,m_,_p(1,{})),j[m_][St]=!0),K_(j,St,_t)):D_(j,St,_t)},H_=function defineProperties(j,_e){_u(j);var _t=_d(_e),St=_v(_t).concat(Z_(_t));return v_(St,(function(_e){Ci&&!_n(Y_,_t,_e)||W_(j,_e,_t[_e])})),j},Y_=function propertyIsEnumerable(j){var _e=_h(j),_t=_n(P_,this,_e);return!(this===w_&&_o(B_,_e)&&!_o(j_,_e))&&(!(_t||!_o(this,_e)||!_o(B_,_e)||_o(this,m_)&&this[m_][_e])||_t)},J_=function getOwnPropertyDescriptor(j,_e){var _t=_d(j),St=_h(_e);if(_t!==w_||!_o(B_,St)||_o(j_,St)){var Tt=O_(_t,St);return!Tt||!_o(B_,St)||_o(_t,m_)&&_t[m_][St]||(Tt.enumerable=!0),Tt}},X_=function getOwnPropertyNames(j){var _e=N_(_d(j)),_t=[];return v_(_e,(function(j){_o(B_,j)||_o(c_,j)||M_(_t,j)})),_t},Z_=function getOwnPropertySymbols(j){var _e=j===w_,_t=N_(_e?j_:_d(j)),St=[];return v_(_t,(function(j){!_o(B_,j)||_e&&!_o(w_,j)||M_(St,B_[j])})),St};(Di||(I_=function Symbol(){if(_c(T_,this))throw C_("Symbol is not a constructor");var j=arguments.length&&void 0!==arguments[0]?_f(arguments[0]):void 0,_e=u_(j),setter=function(j){this===w_&&_n(setter,j_,j),_o(this,m_)&&_o(this[m_],_e)&&(this[m_][_e]=!1),K_(this,_e,_p(1,j))};return Ci&&V_&&K_(w_,_e,{configurable:!0,set:setter}),wrap(_e,j)},i_(T_=I_[A_],"toString",(function toString(){return E_(this).tag})),i_(I_,"withoutSetter",(function(j){return wrap(u_(j),j)})),t_.f=Y_,e_.f=W_,_A.f=J_,_m.f=Pm.f=X_,_y.f=Z_,d_.f=function(j){return wrap(l_(j),j)},Ci&&(D_(T_,"description",{configurable:!0,get:function description(){return E_(this).description}}),Ei||i_(w_,"propertyIsEnumerable",Y_,{unsafe:!0}))),St({global:!0,wrap:!0,forced:!Di,sham:!Di},{Symbol:I_}),v_(_v(G_),(function(j){h_(j)})),St({target:y_,stat:!0,forced:!Di},{for:function(j){var _e=_f(j);if(_o(U_,_e))return U_[_e];var _t=I_(_e);return U_[_e]=_t,F_[_t]=_e,_t},keyFor:function keyFor(j){if(!kc(j))throw C_(j+" is not a symbol");if(_o(F_,j))return F_[j]},useSetter:function(){V_=!0},useSimple:function(){V_=!1}}),St({target:"Object",stat:!0,forced:!Di,sham:!Ci},{create:function create(j,_e){return void 0===_e?Eg(j):H_(Eg(j),_e)},defineProperty:W_,defineProperties:H_,getOwnPropertyDescriptor:J_}),St({target:"Object",stat:!0,forced:!Di},{getOwnPropertyNames:X_,getOwnPropertySymbols:Z_}),St({target:"Object",stat:!0,forced:Fi((function(){_y.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(j){return _y.f(_l(j))}}),k_)&&St({target:"JSON",stat:!0,forced:!Di||Fi((function(){var j=I_();return"[null]"!=k_([j])||"{}"!=k_({a:j})||"{}"!=k_(Object(j))}))},{stringify:function stringify(j,_e,_t){var St=r_(arguments),Tt=_e;if((_s(_e)||void 0!==j)&&!kc(j))return ga(_e)||(_e=function(j,_e){if(_a(Tt)&&(_e=_n(Tt,this,j,_e)),!kc(_e))return _e}),St[1]=_e,_r(k_,null,St)}});if(!T_[__]){var $_=T_.valueOf;i_(T_,__,(function(j){return _n($_,this)}))}f_(I_,y_),c_[m_]=!0},9341:(j,_e,_t)=>{_t(7235)("toStringTag")},2990:(j,_e,_t)=>{"use strict";var St=_t(1702),Tt=_t(260),Ut=St(_t(1048)),_r=Tt.aTypedArray;(0,Tt.exportTypedArrayMethod)("copyWithin",(function copyWithin(j,_e){return Ut(_r(this),j,_e,arguments.length>2?arguments[2]:void 0)}))},8927:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).every,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("every",(function every(j){return Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},3105:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(6916),Ut=_t(1285),_r=St.aTypedArray;(0,St.exportTypedArrayMethod)("fill",(function fill(j){var _e=arguments.length;return Tt(Ut,_r(this),j,_e>1?arguments[1]:void 0,_e>2?arguments[2]:void 0)}))},5035:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).filter,Ut=_t(3074),_r=St.aTypedArray;(0,St.exportTypedArrayMethod)("filter",(function filter(j){var _e=Tt(_r(this),j,arguments.length>1?arguments[1]:void 0);return Ut(this,_e)}))},7174:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).findIndex,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("findIndex",(function findIndex(j){return Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},4345:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).find,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("find",(function find(j){return Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},4197:(j,_e,_t)=>{_t(9843)("Float32",(function(j){return function Float32Array(_e,_t,St){return j(this,_e,_t,St)}}))},2846:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).forEach,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("forEach",(function forEach(j){Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},4731:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(1318).includes,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("includes",(function includes(j){return Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},7209:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(1318).indexOf,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("indexOf",(function indexOf(j){return Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},6319:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(7293),Ut=_t(1702),_r=_t(260),_n=_t(6992),_i=_t(5112)("iterator"),Ei=St.Uint8Array,Ci=Ut(_n.values),Di=Ut(_n.keys),Fi=Ut(_n.entries),_o=_r.aTypedArray,ga=_r.exportTypedArrayMethod,_a=Ei&&Ei.prototype,_s=!Tt((function(){_a[_i].call([1])})),_c=!!_a&&_a.values&&_a[_i]===_a.values&&"values"===_a.values.name,kc=function values(){return Ci(_o(this))};ga("entries",(function entries(){return Fi(_o(this))}),_s),ga("keys",(function keys(){return Di(_o(this))}),_s),ga("values",kc,_s||!_c,{name:"values"}),ga(_i,kc,_s||!_c,{name:"values"})},8867:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(1702),Ut=St.aTypedArray,_r=St.exportTypedArrayMethod,_n=Tt([].join);_r("join",(function join(j){return _n(Ut(this),j)}))},7789:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2104),Ut=_t(6583),_r=St.aTypedArray;(0,St.exportTypedArrayMethod)("lastIndexOf",(function lastIndexOf(j){var _e=arguments.length;return Tt(Ut,_r(this),_e>1?[j,arguments[1]]:[j])}))},3739:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).map,Ut=_t(6304),_r=St.aTypedArray;(0,St.exportTypedArrayMethod)("map",(function map(j){return Tt(_r(this),j,arguments.length>1?arguments[1]:void 0,(function(j,_e){return new(Ut(j))(_e)}))}))},4483:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(3671).right,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("reduceRight",(function reduceRight(j){var _e=arguments.length;return Tt(Ut(this),j,_e,_e>1?arguments[1]:void 0)}))},9368:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(3671).left,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("reduce",(function reduce(j){var _e=arguments.length;return Tt(Ut(this),j,_e,_e>1?arguments[1]:void 0)}))},2056:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=St.aTypedArray,Ut=St.exportTypedArrayMethod,_r=Math.floor;Ut("reverse",(function reverse(){for(var j,_e=this,_t=Tt(_e).length,St=_r(_t/2),Ut=0;Ut<St;)j=_e[Ut],_e[Ut++]=_e[--_t],_e[_t]=j;return _e}))},3462:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(260),Ut=_t(6244),_r=_t(4590),_n=_t(7908),_i=_t(7293),Ei=St.RangeError,Ci=Tt.aTypedArray;(0,Tt.exportTypedArrayMethod)("set",(function set(j){Ci(this);var _e=_r(arguments.length>1?arguments[1]:void 0,1),_t=this.length,St=_n(j),Tt=Ut(St),_i=0;if(Tt+_e>_t)throw Ei("Wrong length");for(;_i<Tt;)this[_e+_i]=St[_i++]}),_i((function(){new Int8Array(1).set({})})))},678:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(6304),Ut=_t(7293),_r=_t(206),_n=St.aTypedArray;(0,St.exportTypedArrayMethod)("slice",(function slice(j,_e){for(var _t=_r(_n(this),j,_e),St=Tt(this),Ut=0,_i=_t.length,Ei=new St(_i);_i>Ut;)Ei[Ut]=_t[Ut++];return Ei}),Ut((function(){new Int8Array(1).slice()})))},7462:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(2092).some,Ut=St.aTypedArray;(0,St.exportTypedArrayMethod)("some",(function some(j){return Tt(Ut(this),j,arguments.length>1?arguments[1]:void 0)}))},3824:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(1702),Ut=_t(7293),_r=_t(9662),_n=_t(6329),_i=_t(260),Ei=_t(8886),Ci=_t(256),Di=_t(7392),Fi=_t(8008),_o=St.Array,ga=_i.aTypedArray,_a=_i.exportTypedArrayMethod,_s=St.Uint16Array,_c=_s&&Tt(_s.prototype.sort),kc=!(!_c||Ut((function(){_c(new _s(2),null)}))&&Ut((function(){_c(new _s(2),{})}))),_u=!!_c&&!Ut((function(){if(Di)return Di<74;if(Ei)return Ei<67;if(Ci)return!0;if(Fi)return Fi<602;var j,_e,_t=new _s(516),St=_o(516);for(j=0;j<516;j++)_e=j%4,_t[j]=515-j,St[j]=j-2*_e+3;for(_c(_t,(function(j,_e){return(j/4|0)-(_e/4|0)})),j=0;j<516;j++)if(_t[j]!==St[j])return!0}));_a("sort",(function sort(j){return void 0!==j&&_r(j),_u?_c(this,j):_n(ga(this),function(j){return function(_e,_t){return void 0!==j?+j(_e,_t)||0:_t!=_t?-1:_e!=_e?1:0===_e&&0===_t?1/_e>0&&1/_t<0?1:-1:_e>_t}}(j))}),!_u||kc)},5021:(j,_e,_t)=>{"use strict";var St=_t(260),Tt=_t(7466),Ut=_t(1400),_r=_t(6304),_n=St.aTypedArray;(0,St.exportTypedArrayMethod)("subarray",(function subarray(j,_e){var _t=_n(this),St=_t.length,_i=Ut(j,St);return new(_r(_t))(_t.buffer,_t.byteOffset+_i*_t.BYTES_PER_ELEMENT,Tt((void 0===_e?St:Ut(_e,St))-_i))}))},2974:(j,_e,_t)=>{"use strict";var St=_t(7854),Tt=_t(2104),Ut=_t(260),_r=_t(7293),_n=_t(206),_i=St.Int8Array,Ei=Ut.aTypedArray,Ci=Ut.exportTypedArrayMethod,Di=[].toLocaleString,Fi=!!_i&&_r((function(){Di.call(new _i(1))}));Ci("toLocaleString",(function toLocaleString(){return Tt(Di,Fi?_n(Ei(this)):Ei(this),_n(arguments))}),_r((function(){return[1,2].toLocaleString()!=new _i([1,2]).toLocaleString()}))||!_r((function(){_i.prototype.toLocaleString.call([1,2])})))},5016:(j,_e,_t)=>{"use strict";var St=_t(260).exportTypedArrayMethod,Tt=_t(7293),Ut=_t(7854),_r=_t(1702),_n=Ut.Uint8Array,_i=_n&&_n.prototype||{},Ei=[].toString,Ci=_r([].join);Tt((function(){Ei.call({})}))&&(Ei=function toString(){return Ci(this)});var Di=_i.toString!=Ei;St("toString",Ei,Di)},2472:(j,_e,_t)=>{_t(9843)("Uint8",(function(j){return function Uint8Array(_e,_t,St){return j(this,_e,_t,St)}}))},4129:(j,_e,_t)=>{"use strict";var St,Tt=_t(7854),Ut=_t(1702),_r=_t(2248),_n=_t(2423),_i=_t(7710),Ei=_t(9320),Ci=_t(111),Di=_t(2050),Fi=_t(9909).enforce,_o=_t(8536),ga=!Tt.ActiveXObject&&"ActiveXObject"in Tt,wrapper=function(j){return function WeakMap(){return j(this,arguments.length?arguments[0]:void 0)}},_a=_i("WeakMap",wrapper,Ei);if(_o&&ga){St=Ei.getConstructor(wrapper,"WeakMap",!0),_n.enable();var _s=_a.prototype,_c=Ut(_s.delete),kc=Ut(_s.has),_u=Ut(_s.get),_l=Ut(_s.set);_r(_s,{delete:function(j){if(Ci(j)&&!Di(j)){var _e=Fi(this);return _e.frozen||(_e.frozen=new St),_c(this,j)||_e.frozen.delete(j)}return _c(this,j)},has:function has(j){if(Ci(j)&&!Di(j)){var _e=Fi(this);return _e.frozen||(_e.frozen=new St),kc(this,j)||_e.frozen.has(j)}return kc(this,j)},get:function get(j){if(Ci(j)&&!Di(j)){var _e=Fi(this);return _e.frozen||(_e.frozen=new St),kc(this,j)?_u(this,j):_e.frozen.get(j)}return _u(this,j)},set:function set(j,_e){if(Ci(j)&&!Di(j)){var _t=Fi(this);_t.frozen||(_t.frozen=new St),kc(this,j)?_l(this,j,_e):_t.frozen.set(j,_e)}else _l(this,j,_e);return this}})}},8478:(j,_e,_t)=>{"use strict";_t(7710)("WeakSet",(function(j){return function WeakSet(){return j(this,arguments.length?arguments[0]:void 0)}}),_t(9320))},72:(j,_e,_t)=>{"use strict";_t(2109)({target:"Map",proto:!0,real:!0,forced:_t(1913)},{deleteAll:_t(4092)})},9137:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(4647),_i=_t(612);St({target:"Map",proto:!0,real:!0,forced:Tt},{every:function every(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return!_i(_t,(function(j,_t,Tt){if(!St(_t,j,_e))return Tt()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},1957:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(9974),_n=_t(6916),_i=_t(9662),Ei=_t(9670),Ci=_t(6707),Di=_t(4647),Fi=_t(612);Tt({target:"Map",proto:!0,real:!0,forced:St},{filter:function filter(j){var _e=Ei(this),_t=Di(_e),St=_r(j,arguments.length>1?arguments[1]:void 0),Tt=new(Ci(_e,Ut("Map"))),_o=_i(Tt.set);return Fi(_t,(function(j,_t){St(_t,j,_e)&&_n(_o,Tt,j,_t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),Tt}})},103:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(4647),_i=_t(612);St({target:"Map",proto:!0,real:!0,forced:Tt},{findKey:function findKey(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return _i(_t,(function(j,_t,Tt){if(St(_t,j,_e))return Tt(j)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},6306:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(4647),_i=_t(612);St({target:"Map",proto:!0,real:!0,forced:Tt},{find:function find(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return _i(_t,(function(j,_t,Tt){if(St(_t,j,_e))return Tt(_t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},4592:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(9670),_r=_t(4647),_n=_t(6465),_i=_t(612);Tt({target:"Map",proto:!0,real:!0,forced:St},{includes:function includes(j){return _i(_r(Ut(this)),(function(_e,_t,St){if(_n(_t,j))return St()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},8276:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(4647),_n=_t(612);St({target:"Map",proto:!0,real:!0,forced:Tt},{keyOf:function keyOf(j){return _n(_r(Ut(this)),(function(_e,_t,St){if(_t===j)return St(_e)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},5082:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(9974),_n=_t(6916),_i=_t(9662),Ei=_t(9670),Ci=_t(6707),Di=_t(4647),Fi=_t(612);Tt({target:"Map",proto:!0,real:!0,forced:St},{mapKeys:function mapKeys(j){var _e=Ei(this),_t=Di(_e),St=_r(j,arguments.length>1?arguments[1]:void 0),Tt=new(Ci(_e,Ut("Map"))),_o=_i(Tt.set);return Fi(_t,(function(j,_t){_n(_o,Tt,St(_t,j,_e),_t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),Tt}})},2813:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(9974),_n=_t(6916),_i=_t(9662),Ei=_t(9670),Ci=_t(6707),Di=_t(4647),Fi=_t(612);Tt({target:"Map",proto:!0,real:!0,forced:St},{mapValues:function mapValues(j){var _e=Ei(this),_t=Di(_e),St=_r(j,arguments.length>1?arguments[1]:void 0),Tt=new(Ci(_e,Ut("Map"))),_o=_i(Tt.set);return Fi(_t,(function(j,_t){_n(_o,Tt,j,St(_t,j,_e))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),Tt}})},8222:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9662),_r=_t(9670),_n=_t(612);St({target:"Map",proto:!0,real:!0,forced:Tt},{merge:function merge(j){for(var _e=_r(this),_t=Ut(_e.set),St=arguments.length,Tt=0;Tt<St;)_n(arguments[Tt++],_t,{that:_e,AS_ENTRIES:!0});return _e}})},8563:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(1913),_r=_t(9670),_n=_t(9662),_i=_t(4647),Ei=_t(612),Ci=Tt.TypeError;St({target:"Map",proto:!0,real:!0,forced:Ut},{reduce:function reduce(j){var _e=_r(this),_t=_i(_e),St=arguments.length<2,Tt=St?void 0:arguments[1];if(_n(j),Ei(_t,(function(_t,Ut){St?(St=!1,Tt=Ut):Tt=j(Tt,Ut,_t,_e)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),St)throw Ci("Reduce of empty map with no initial value");return Tt}})},336:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(4647),_i=_t(612);St({target:"Map",proto:!0,real:!0,forced:Tt},{some:function some(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return _i(_t,(function(j,_t,Tt){if(St(_t,j,_e))return Tt()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},7512:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(7854),_r=_t(6916),_n=_t(9670),_i=_t(9662),Ei=Ut.TypeError;Tt({target:"Map",proto:!0,real:!0,forced:St},{update:function update(j,_e){var _t=_n(this),St=_i(_t.get),Tt=_i(_t.has),Ut=_i(_t.set),Ci=arguments.length;_i(_e);var Di=_r(Tt,_t,j);if(!Di&&Ci<3)throw Ei("Updating absent value");var Fi=Di?_r(St,_t,j):_i(Ci>2?arguments[2]:void 0)(j,_t);return _r(Ut,_t,j,_e(Fi,j,_t)),_t}})},8921:(j,_e,_t)=>{"use strict";_t(2109)({target:"Set",proto:!0,real:!0,forced:_t(1913)},{addAll:_t(1501)})},6248:(j,_e,_t)=>{"use strict";_t(2109)({target:"Set",proto:!0,real:!0,forced:_t(1913)},{deleteAll:_t(4092)})},3599:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(6916),_n=_t(9662),_i=_t(9670),Ei=_t(6707),Ci=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{difference:function difference(j){var _e=_i(this),_t=new(Ei(_e,Ut("Set")))(_e),St=_n(_t.delete);return Ci(j,(function(j){_r(St,_t,j)})),_t}})},1477:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(6767),_i=_t(612);St({target:"Set",proto:!0,real:!0,forced:Tt},{every:function every(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return!_i(_t,(function(j,_t){if(!St(j,j,_e))return _t()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},4362:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(6916),_n=_t(9662),_i=_t(9670),Ei=_t(9974),Ci=_t(6707),Di=_t(6767),Fi=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{filter:function filter(j){var _e=_i(this),_t=Di(_e),St=Ei(j,arguments.length>1?arguments[1]:void 0),Tt=new(Ci(_e,Ut("Set"))),_o=_n(Tt.add);return Fi(_t,(function(j){St(j,j,_e)&&_r(_o,Tt,j)}),{IS_ITERATOR:!0}),Tt}})},5389:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(6767),_i=_t(612);St({target:"Set",proto:!0,real:!0,forced:Tt},{find:function find(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return _i(_t,(function(j,_t){if(St(j,j,_e))return _t(j)}),{IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},401:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(6916),_n=_t(9662),_i=_t(9670),Ei=_t(6707),Ci=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{intersection:function intersection(j){var _e=_i(this),_t=new(Ei(_e,Ut("Set"))),St=_n(_e.has),Tt=_n(_t.add);return Ci(j,(function(j){_r(St,_e,j)&&_r(Tt,_t,j)})),_t}})},5164:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(6916),_r=_t(9662),_n=_t(9670),_i=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{isDisjointFrom:function isDisjointFrom(j){var _e=_n(this),_t=_r(_e.has);return!_i(j,(function(j,St){if(!0===Ut(_t,_e,j))return St()}),{INTERRUPTED:!0}).stopped}})},1238:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(6916),_n=_t(9662),_i=_t(614),Ei=_t(9670),Ci=_t(8554),Di=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{isSubsetOf:function isSubsetOf(j){var _e=Ci(this),_t=Ei(j),St=_t.has;return _i(St)||(_t=new(Ut("Set"))(j),St=_n(_t.has)),!Di(_e,(function(j,_e){if(!1===_r(St,_t,j))return _e()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},4837:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(6916),_r=_t(9662),_n=_t(9670),_i=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{isSupersetOf:function isSupersetOf(j){var _e=_n(this),_t=_r(_e.has);return!_i(j,(function(j,St){if(!1===Ut(_t,_e,j))return St()}),{INTERRUPTED:!0}).stopped}})},7485:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(1702),_r=_t(9670),_n=_t(1340),_i=_t(6767),Ei=_t(612),Ci=Ut([].join),Di=[].push;Tt({target:"Set",proto:!0,real:!0,forced:St},{join:function join(j){var _e=_r(this),_t=_i(_e),St=void 0===j?",":_n(j),Tt=[];return Ei(_t,Di,{that:Tt,IS_ITERATOR:!0}),Ci(Tt,St)}})},465:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(9974),_n=_t(6916),_i=_t(9662),Ei=_t(9670),Ci=_t(6707),Di=_t(6767),Fi=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{map:function map(j){var _e=Ei(this),_t=Di(_e),St=_r(j,arguments.length>1?arguments[1]:void 0),Tt=new(Ci(_e,Ut("Set"))),_o=_i(Tt.add);return Fi(_t,(function(j){_n(_o,Tt,St(j,j,_e))}),{IS_ITERATOR:!0}),Tt}})},6651:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(7854),Ut=_t(1913),_r=_t(9662),_n=_t(9670),_i=_t(6767),Ei=_t(612),Ci=Tt.TypeError;St({target:"Set",proto:!0,real:!0,forced:Ut},{reduce:function reduce(j){var _e=_n(this),_t=_i(_e),St=arguments.length<2,Tt=St?void 0:arguments[1];if(_r(j),Ei(_t,(function(_t){St?(St=!1,Tt=_t):Tt=j(Tt,_t,_t,_e)}),{IS_ITERATOR:!0}),St)throw Ci("Reduce of empty set with no initial value");return Tt}})},1437:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(9670),_r=_t(9974),_n=_t(6767),_i=_t(612);St({target:"Set",proto:!0,real:!0,forced:Tt},{some:function some(j){var _e=Ut(this),_t=_n(_e),St=_r(j,arguments.length>1?arguments[1]:void 0);return _i(_t,(function(j,_t){if(St(j,j,_e))return _t()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},5285:(j,_e,_t)=>{"use strict";var St=_t(1913),Tt=_t(2109),Ut=_t(5005),_r=_t(6916),_n=_t(9662),_i=_t(9670),Ei=_t(6707),Ci=_t(612);Tt({target:"Set",proto:!0,real:!0,forced:St},{symmetricDifference:function symmetricDifference(j){var _e=_i(this),_t=new(Ei(_e,Ut("Set")))(_e),St=_n(_t.delete),Tt=_n(_t.add);return Ci(j,(function(j){_r(St,_t,j)||_r(Tt,_t,j)})),_t}})},9865:(j,_e,_t)=>{"use strict";var St=_t(2109),Tt=_t(1913),Ut=_t(5005),_r=_t(9662),_n=_t(9670),_i=_t(6707),Ei=_t(612);St({target:"Set",proto:!0,real:!0,forced:Tt},{union:function union(j){var _e=_n(this),_t=new(_i(_e,Ut("Set")))(_e);return Ei(j,_r(_t.add),{that:_t}),_t}})},8206:(j,_e,_t)=>{"use strict";_t(2109)({target:"WeakMap",proto:!0,real:!0,forced:_t(1913)},{deleteAll:_t(4092)})},3561:(j,_e,_t)=>{"use strict";_t(2109)({target:"WeakSet",proto:!0,real:!0,forced:_t(1913)},{addAll:_t(1501)})},2049:(j,_e,_t)=>{"use strict";_t(2109)({target:"WeakSet",proto:!0,real:!0,forced:_t(1913)},{deleteAll:_t(4092)})},4747:(j,_e,_t)=>{var St=_t(7854),Tt=_t(8324),Ut=_t(8509),_r=_t(8533),_n=_t(8880),handlePrototype=function(j){if(j&&j.forEach!==_r)try{_n(j,"forEach",_r)}catch(_e){j.forEach=_r}};for(var _i in Tt)Tt[_i]&&handlePrototype(St[_i]&&St[_i].prototype);handlePrototype(Ut)},3948:(j,_e,_t)=>{var St=_t(7854),Tt=_t(8324),Ut=_t(8509),_r=_t(6992),_n=_t(8880),_i=_t(5112),Ei=_i("iterator"),Ci=_i("toStringTag"),Di=_r.values,handlePrototype=function(j,_e){if(j){if(j[Ei]!==Di)try{_n(j,Ei,Di)}catch(_e){j[Ei]=Di}if(j[Ci]||_n(j,Ci,_e),Tt[_e])for(var _t in _r)if(j[_t]!==_r[_t])try{_n(j,_t,_r[_t])}catch(_e){j[_t]=_r[_t]}}};for(var Fi in Tt)handlePrototype(St[Fi]&&St[Fi].prototype,Fi);handlePrototype(Ut,"DOMTokenList")},2564:(j,_e,_t)=>{var St=_t(2109),Tt=_t(7854),Ut=_t(2104),_r=_t(614),_n=_t(8113),_i=_t(206),Ei=/MSIE .\./.test(_n),Ci=Tt.Function,wrap=function(j){return function(_e,_t){var St=arguments.length>2,Tt=St?_i(arguments,2):void 0;return j(St?function(){Ut(_r(_e)?_e:Ci(_e),this,Tt)}:_e,_t)}};St({global:!0,bind:!0,forced:Ei},{setTimeout:wrap(Tt.setTimeout),setInterval:wrap(Tt.setInterval)})},5455:j=>{"use strict";j.exports=require("agora-electron-sdk")},5760:j=>{"use strict";j.exports=__WEBPACK_EXTERNAL_MODULE__5760__}},__webpack_module_cache__={};function __webpack_require__(j){var _e=__webpack_module_cache__[j];if(void 0!==_e)return _e.exports;var _t=__webpack_module_cache__[j]={id:j,loaded:!1,exports:{}};return __webpack_modules__[j].call(_t.exports,_t,_t.exports,__webpack_require__),_t.loaded=!0,_t.exports}__webpack_require__.amdO={},__webpack_require__.n=j=>{var _e=j&&j.__esModule?()=>j.default:()=>j;return __webpack_require__.d(_e,{a:_e}),_e},__webpack_require__.d=(j,_e)=>{for(var _t in _e)__webpack_require__.o(_e,_t)&&!__webpack_require__.o(j,_t)&&Object.defineProperty(j,_t,{enumerable:!0,get:_e[_t]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(j){if("object"==typeof window)return window}}(),__webpack_require__.o=(j,_e)=>Object.prototype.hasOwnProperty.call(j,_e),__webpack_require__.r=j=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})},__webpack_require__.nmd=j=>(j.paths=[],j.children||(j.children=[]),j);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AGChannelProfile:()=>TE,AGError:()=>WE,AGErrorWrapper:()=>HE,AGEventEmitter:()=>_a,AGLighteningLevel:()=>FR,AGMediaEncryptionMode:()=>MR,AGNetworkQuality:()=>xR,AGRemoteVideoStreamType:()=>GR,AGRenderMode:()=>UR,AGRtcConnectionType:()=>TR,AGRtcState:()=>PR,AGRteErrorCode:()=>QE,AGRteTrackErrorReason:()=>LR,AGScreenShareType:()=>BR,AbstractErrorCenter:()=>KE,ActionWhenTaskFail:()=>cR,AgoraChatMessage:()=>WT,AgoraLatencyLevel:()=>qS,AgoraMediaControl:()=>DO,AgoraMediaControlEventType:()=>wO,AgoraMediaPlayerCanvas:()=>VD,AgoraRCEventType:()=>YP,AgoraRCRole:()=>zP,AgoraRegion:()=>GS,AgoraRoom:()=>QT,AgoraRtcLocalVideoCanvas:()=>FD,AgoraRtcVideoCanvas:()=>UD,AgoraRteAudioRawDataPosition:()=>iO,AgoraRteAudioSourceType:()=>ER,AgoraRteCameraVideoTrack:()=>kR,AgoraRteConnectionState:()=>IE,AgoraRteEngine:()=>uM,AgoraRteEngineConfig:()=>KS,AgoraRteEventType:()=>UT,AgoraRteLogLevel:()=>SE,AgoraRteMediaPublishState:()=>wR,AgoraRteMediaSourceState:()=>NR,AgoraRteMediaTrack:()=>CR,AgoraRteMicrophoneAudioTrack:()=>OR,AgoraRteRuntimePlatform:()=>FS,AgoraRteScene:()=>bO,AgoraRteScreenShareTrack:()=>DR,AgoraRteStreamMediaTrack:()=>RR,AgoraRteThread:()=>XO,AgoraRteVideoSourceType:()=>bR,AgoraStream:()=>qT,AgoraUser:()=>VT,ApiBase:()=>NS,Duration:()=>pR,Lodash:()=>OS,Log:()=>TS,Logger:()=>ME,MediaPlayerEvents:()=>vR,Scheduler:()=>j,StreamMediaPlayer:()=>SR,bound:()=>RS,retryAttempt:()=>hS});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{Duration:()=>pR,createScheduler:()=>AR,shared:()=>_R});var _e={};__webpack_require__.r(_e),__webpack_require__.d(_e,{identity:()=>XD});var _t={};__webpack_require__.r(_t),__webpack_require__.d(_t,{base2:()=>_x});var St={};__webpack_require__.r(St),__webpack_require__.d(St,{base8:()=>tL});var Tt={};__webpack_require__.r(Tt),__webpack_require__.d(Tt,{base10:()=>rL});var Ut={};__webpack_require__.r(Ut),__webpack_require__.d(Ut,{base16:()=>nL,base16upper:()=>iL});var _r={};__webpack_require__.r(_r),__webpack_require__.d(_r,{base32:()=>oL,base32hex:()=>dL,base32hexpad:()=>pL,base32hexpadupper:()=>gL,base32hexupper:()=>hL,base32pad:()=>cL,base32padupper:()=>uL,base32upper:()=>sL,base32z:()=>vL});var _n={};__webpack_require__.r(_n),__webpack_require__.d(_n,{base36:()=>mL,base36upper:()=>yL});var _i={};__webpack_require__.r(_i),__webpack_require__.d(_i,{base58btc:()=>AL,base58flickr:()=>_L});var Ei={};__webpack_require__.r(Ei),__webpack_require__.d(Ei,{base64:()=>bL,base64pad:()=>wL,base64url:()=>SL,base64urlpad:()=>TL});var Ci={};__webpack_require__.r(Ci),__webpack_require__.d(Ci,{base256emoji:()=>OL});var Di={};__webpack_require__.r(Di),__webpack_require__.d(Di,{sha256:()=>KL,sha512:()=>WL});var Fi={};__webpack_require__.r(Fi),__webpack_require__.d(Fi,{identity:()=>YL});var _o={};__webpack_require__.r(_o),__webpack_require__.d(_o,{code:()=>rN,decode:()=>raw_decode,encode:()=>raw_encode,name:()=>JL});var ga={};__webpack_require__.r(ga),__webpack_require__.d(ga,{code:()=>aN,decode:()=>json_decode,encode:()=>json_encode,name:()=>oN});__webpack_require__(2419),__webpack_require__(9070),__webpack_require__(2526),__webpack_require__(1817),__webpack_require__(1539),__webpack_require__(2165),__webpack_require__(6992),__webpack_require__(8783),__webpack_require__(3948),__webpack_require__(2443),__webpack_require__(9341),__webpack_require__(3706),__webpack_require__(408),__webpack_require__(8011),__webpack_require__(489),__webpack_require__(9554),__webpack_require__(4747),__webpack_require__(8309),__webpack_require__(8304),__webpack_require__(8674),__webpack_require__(5069),__webpack_require__(7042);function _typeof(j){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(j){return typeof j}:function(j){return j&&"function"==typeof Symbol&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},_typeof(j)}function _arrayLikeToArray(j,_e){(null==_e||_e>j.length)&&(_e=j.length);for(var _t=0,St=new Array(_e);_t<_e;_t++)St[_t]=j[_t];return St}function _unsupportedIterableToArray(j,_e){if(j){if("string"==typeof j)return _arrayLikeToArray(j,_e);var _t=Object.prototype.toString.call(j).slice(8,-1);return"Object"===_t&&j.constructor&&(_t=j.constructor.name),"Map"===_t||"Set"===_t?Array.from(j):"Arguments"===_t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_t)?_arrayLikeToArray(j,_e):void 0}}function _slicedToArray(j,_e){return function _arrayWithHoles(j){if(Array.isArray(j))return j}(j)||function _iterableToArrayLimit(j,_e){var _t=null==j?null:"undefined"!=typeof Symbol&&j[Symbol.iterator]||j["@@iterator"];if(null!=_t){var St,Tt,Ut,_r,_n=[],_i=!0,Ei=!1;try{if(Ut=(_t=_t.call(j)).next,0===_e){if(Object(_t)!==_t)return;_i=!1}else for(;!(_i=(St=Ut.call(_t)).done)&&(_n.push(St.value),_n.length!==_e);_i=!0);}catch(j){Ei=!0,Tt=j}finally{try{if(!_i&&null!=_t.return&&(_r=_t.return(),Object(_r)!==_r))return}finally{if(Ei)throw Tt}}return _n}}(j,_e)||_unsupportedIterableToArray(j,_e)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function asyncGeneratorStep(j,_e,_t,St,Tt,Ut,_r){try{var _n=j[Ut](_r),_i=_n.value}catch(j){return void _t(j)}_n.done?_e(_i):Promise.resolve(_i).then(St,Tt)}function _asyncToGenerator(j){return function(){var _e=this,_t=arguments;return new Promise((function(St,Tt){var Ut=j.apply(_e,_t);function _next(j){asyncGeneratorStep(Ut,St,Tt,_next,_throw,"next",j)}function _throw(j){asyncGeneratorStep(Ut,St,Tt,_next,_throw,"throw",j)}_next(void 0)}))}}function _classCallCheck(j,_e){if(!(j instanceof _e))throw new TypeError("Cannot call a class as a function")}function _toPropertyKey(j){var _e=function _toPrimitive(j,_e){if("object"!==_typeof(j)||null===j)return j;var _t=j[Symbol.toPrimitive];if(void 0!==_t){var St=_t.call(j,_e||"default");if("object"!==_typeof(St))return St;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===_e?String:Number)(j)}(j,"string");return"symbol"===_typeof(_e)?_e:String(_e)}function _defineProperties(j,_e){for(var _t=0;_t<_e.length;_t++){var St=_e[_t];St.enumerable=St.enumerable||!1,St.configurable=!0,"value"in St&&(St.writable=!0),Object.defineProperty(j,_toPropertyKey(St.key),St)}}function _createClass(j,_e,_t){return _e&&_defineProperties(j.prototype,_e),_t&&_defineProperties(j,_t),Object.defineProperty(j,"prototype",{writable:!1}),j}function _setPrototypeOf(j,_e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(j,_e){return j.__proto__=_e,j},_setPrototypeOf(j,_e)}function _inherits(j,_e){if("function"!=typeof _e&&null!==_e)throw new TypeError("Super expression must either be null or a function");j.prototype=Object.create(_e&&_e.prototype,{constructor:{value:j,writable:!0,configurable:!0}}),Object.defineProperty(j,"prototype",{writable:!1}),_e&&_setPrototypeOf(j,_e)}function _assertThisInitialized(j){if(void 0===j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function _possibleConstructorReturn(j,_e){if(_e&&("object"===_typeof(_e)||"function"==typeof _e))return _e;if(void 0!==_e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(j)}function _getPrototypeOf(j){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(j){return j.__proto__||Object.getPrototypeOf(j)},_getPrototypeOf(j)}__webpack_require__(2222),__webpack_require__(1038),__webpack_require__(9753),__webpack_require__(1532),__webpack_require__(72),__webpack_require__(9137),__webpack_require__(1957),__webpack_require__(6306),__webpack_require__(103),__webpack_require__(4592),__webpack_require__(8276),__webpack_require__(5082),__webpack_require__(2813),__webpack_require__(8222),__webpack_require__(8563),__webpack_require__(336),__webpack_require__(7512),__webpack_require__(7327);function _createForOfIteratorHelper(j,_e){var _t="undefined"!=typeof Symbol&&j[Symbol.iterator]||j["@@iterator"];if(!_t){if(Array.isArray(j)||(_t=function events_unsupportedIterableToArray(j,_e){if(!j)return;if("string"==typeof j)return events_arrayLikeToArray(j,_e);var _t=Object.prototype.toString.call(j).slice(8,-1);"Object"===_t&&j.constructor&&(_t=j.constructor.name);if("Map"===_t||"Set"===_t)return Array.from(j);if("Arguments"===_t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_t))return events_arrayLikeToArray(j,_e)}(j))||_e&&j&&"number"==typeof j.length){_t&&(j=_t);var St=0,Tt=function F(){};return{s:Tt,n:function n(){return St>=j.length?{done:!0}:{done:!1,value:j[St++]}},e:function e(j){throw j},f:Tt}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Ut,_r=!0,_n=!1;return{s:function s(){_t=_t.call(j)},n:function n(){var j=_t.next();return _r=j.done,j},e:function e(j){_n=!0,Ut=j},f:function f(){try{_r||null==_t.return||_t.return()}finally{if(_n)throw Ut}}}}function events_arrayLikeToArray(j,_e){(null==_e||_e>j.length)&&(_e=j.length);for(var _t=0,St=new Array(_e);_t<_e;_t++)St[_t]=j[_t];return St}var _a=function(){function AGEventEmitter(){_classCallCheck(this,AGEventEmitter),this._eventMap=new Map}return _createClass(AGEventEmitter,[{key:"once",value:function once(j,_e){var _t=this;return this.on(j,(function wrapper(){_t.off(j,wrapper),_e.apply(void 0,arguments)})),this}},{key:"on",value:function on(j,_e){var _t,St=null!==(_t=this._eventMap.get(j))&&void 0!==_t?_t:[];return St.push(_e),this._eventMap.set(j,St),this}},{key:"off",value:function off(j,_e){var _t=this._eventMap.get(j);return _t&&this._eventMap.set(j,_t.filter((function(j){return j!==_e}))),this}},{key:"removeAllEventListeners",value:function removeAllEventListeners(){this._eventMap.clear()}},{key:"emit",value:function emit(j){for(var _e,_t=null!==(_e=this._eventMap.get(j))&&void 0!==_e?_e:[],St=arguments.length,Tt=new Array(St>1?St-1:0),Ut=1;Ut<St;Ut++)Tt[Ut-1]=arguments[Ut];var _r,_n=_createForOfIteratorHelper(_t);try{for(_n.s();!(_r=_n.n()).done;){var _i=_r.value;try{_i&&_i.apply(void 0,Tt)}catch(_e){var Ei=_e,Ci=Ei.stack||Ei.message;console.error("[event] handling event ".concat(j," fail: ").concat(Ci))}}}catch(j){_n.e(j)}finally{_n.f()}return this}}]),AGEventEmitter}();__webpack_require__(7941),__webpack_require__(5003),__webpack_require__(9337),__webpack_require__(3321);function _defineProperty(j,_e,_t){return(_e=_toPropertyKey(_e))in j?Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}):j[_e]=_t,j}__webpack_require__(2772);function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}function _construct(j,_e,_t){return _construct=_isNativeReflectConstruct()?Reflect.construct.bind():function _construct(j,_e,_t){var St=[null];St.push.apply(St,_e);var Tt=new(Function.bind.apply(j,St));return _t&&_setPrototypeOf(Tt,_t.prototype),Tt},_construct.apply(null,arguments)}function _wrapNativeSuper(j){var _e="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(j){if(null===j||!function _isNativeFunction(j){return-1!==Function.toString.call(j).indexOf("[native code]")}(j))return j;if("function"!=typeof j)throw new TypeError("Super expression must either be null or a function");if(void 0!==_e){if(_e.has(j))return _e.get(j);_e.set(j,Wrapper)}function Wrapper(){return _construct(j,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(j.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,j)},_wrapNativeSuper(j)}__webpack_require__(6699),__webpack_require__(2023);function _toConsumableArray(j){return function _arrayWithoutHoles(j){if(Array.isArray(j))return _arrayLikeToArray(j)}(j)||function _iterableToArray(j){if("undefined"!=typeof Symbol&&null!=j[Symbol.iterator]||null!=j["@@iterator"])return Array.from(j)}(j)||_unsupportedIterableToArray(j)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}__webpack_require__(9600),__webpack_require__(3843),__webpack_require__(3710),__webpack_require__(9720);var __assign=function(){return __assign=Object.assign||function __assign(j){for(var _e,_t=1,St=arguments.length;_t<St;_t++)for(var Tt in _e=arguments[_t])Object.prototype.hasOwnProperty.call(_e,Tt)&&(j[Tt]=_e[Tt]);return j},__assign.apply(this,arguments)};function __spreadArrays(){for(var j=0,_e=0,_t=arguments.length;_e<_t;_e++)j+=arguments[_e].length;var St=Array(j),Tt=0;for(_e=0;_e<_t;_e++)for(var Ut=arguments[_e],_r=0,_n=Ut.length;_r<_n;_r++,Tt++)St[Tt]=Ut[_r];return St}var _s=Object.keys,_c=Array.isArray,kc="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function extend(j,_e){return"object"!=typeof _e||_s(_e).forEach((function(_t){j[_t]=_e[_t]})),j}"undefined"==typeof Promise||kc.Promise||(kc.Promise=Promise);var _u=Object.getPrototypeOf,_l={}.hasOwnProperty;function hasOwn(j,_e){return _l.call(j,_e)}function props(j,_e){"function"==typeof _e&&(_e=_e(_u(j))),_s(_e).forEach((function(_t){setProp(j,_t,_e[_t])}))}var _d=Object.defineProperty;function setProp(j,_e,_t,St){_d(j,_e,extend(_t&&hasOwn(_t,"get")&&"function"==typeof _t.get?{get:_t.get,set:_t.set,configurable:!0}:{value:_t,configurable:!0,writable:!0},St))}function derive(j){return{from:function(_e){return j.prototype=Object.create(_e.prototype),setProp(j.prototype,"constructor",j),{extend:props.bind(null,j.prototype)}}}}var _h=Object.getOwnPropertyDescriptor;function getPropertyDescriptor(j,_e){var _t;return _h(j,_e)||(_t=_u(j))&&getPropertyDescriptor(_t,_e)}var _f=[].slice;function slice(j,_e,_t){return _f.call(j,_e,_t)}function override(j,_e){return _e(j)}function assert(j){if(!j)throw new Error("Assertion Failed")}function asap(j){kc.setImmediate?setImmediate(j):setTimeout(j,0)}function arrayToObject(j,_e){return j.reduce((function(j,_t,St){var Tt=_e(_t,St);return Tt&&(j[Tt[0]]=Tt[1]),j}),{})}function getByKeyPath(j,_e){if(hasOwn(j,_e))return j[_e];if(!_e)return j;if("string"!=typeof _e){for(var _t=[],St=0,Tt=_e.length;St<Tt;++St){var Ut=getByKeyPath(j,_e[St]);_t.push(Ut)}return _t}var _r=_e.indexOf(".");if(-1!==_r){var _n=j[_e.substr(0,_r)];return void 0===_n?void 0:getByKeyPath(_n,_e.substr(_r+1))}}function setByKeyPath(j,_e,_t){if(j&&void 0!==_e&&(!("isFrozen"in Object)||!Object.isFrozen(j)))if("string"!=typeof _e&&"length"in _e){assert("string"!=typeof _t&&"length"in _t);for(var St=0,Tt=_e.length;St<Tt;++St)setByKeyPath(j,_e[St],_t[St])}else{var Ut=_e.indexOf(".");if(-1!==Ut){var _r=_e.substr(0,Ut),_n=_e.substr(Ut+1);if(""===_n)void 0===_t?_c(j)&&!isNaN(parseInt(_r))?j.splice(_r,1):delete j[_r]:j[_r]=_t;else{var _i=j[_r];_i||(_i=j[_r]={}),setByKeyPath(_i,_n,_t)}}else void 0===_t?_c(j)&&!isNaN(parseInt(_e))?j.splice(_e,1):delete j[_e]:j[_e]=_t}}function delByKeyPath(j,_e){"string"==typeof _e?setByKeyPath(j,_e,void 0):"length"in _e&&[].map.call(_e,(function(_e){setByKeyPath(j,_e,void 0)}))}function shallowClone(j){var _e={};for(var _t in j)hasOwn(j,_t)&&(_e[_t]=j[_t]);return _e}var _p=[].concat;function flatten(j){return _p.apply([],j)}var Eg="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(flatten([8,16,32,64].map((function(j){return["Int","Uint","Float"].map((function(_e){return _e+j+"Array"}))})))).filter((function(j){return kc[j]})),_v=Eg.map((function(j){return kc[j]})),_m=arrayToObject(Eg,(function(j){return[j,!0]}));function deepClone(j){if(!j||"object"!=typeof j)return j;var _e;if(_c(j)){_e=[];for(var _t=0,St=j.length;_t<St;++_t)_e.push(deepClone(j[_t]))}else if(_v.indexOf(j.constructor)>=0)_e=j;else for(var Tt in _e=j.constructor?Object.create(j.constructor.prototype):{},j)hasOwn(j,Tt)&&(_e[Tt]=deepClone(j[Tt]));return _e}var Pm={}.toString;function toStringTag(j){return Pm.call(j).slice(8,-1)}var getValueOf=function(j,_e){return"Array"===_e?""+j.map((function(j){return getValueOf(j,toStringTag(j))})):"ArrayBuffer"===_e?""+new Uint8Array(j):"Date"===_e?j.getTime():ArrayBuffer.isView(j)?""+new Uint8Array(j.buffer):j};function getObjectDiff(j,_e,_t,St){return _t=_t||{},St=St||"",_s(j).forEach((function(Tt){if(hasOwn(_e,Tt)){var Ut=j[Tt],_r=_e[Tt];if("object"==typeof Ut&&"object"==typeof _r&&Ut&&_r){var _n=toStringTag(Ut),_i=toStringTag(_r);_n===_i?_m[_n]?getValueOf(Ut,_n)!==getValueOf(_r,_i)&&(_t[St+Tt]=_e[Tt]):getObjectDiff(Ut,_r,_t,St+Tt+"."):_t[St+Tt]=_e[Tt]}else Ut!==_r&&(_t[St+Tt]=_e[Tt])}else _t[St+Tt]=void 0})),_s(_e).forEach((function(Tt){hasOwn(j,Tt)||(_t[St+Tt]=_e[Tt])})),_t}var _y="undefined"!=typeof Symbol&&Symbol.iterator,_A=_y?function(j){var _e;return null!=j&&(_e=j[_y])&&_e.apply(j)}:function(){return null},e_={};function getArrayOf(j){var _e,_t,St,Tt;if(1===arguments.length){if(_c(j))return j.slice();if(this===e_&&"string"==typeof j)return[j];if(Tt=_A(j)){for(_t=[];!(St=Tt.next()).done;)_t.push(St.value);return _t}if(null==j)return[j];if("number"==typeof(_e=j.length)){for(_t=new Array(_e);_e--;)_t[_e]=j[_e];return _t}return[j]}for(_e=arguments.length,_t=new Array(_e);_e--;)_t[_e]=arguments[_e];return _t}var t_="undefined"!=typeof Symbol?function(j){return"AsyncFunction"===j[Symbol.toStringTag]}:function(){return!1},r_="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function setDebug(j,_e){r_=j,libraryFilter=_e}var libraryFilter=function(){return!0},i_=!new Error("").stack;function getErrorWithStack(){if(i_)try{throw new Error}catch(j){return j}return new Error}function prettyStack(j,_e){var _t=j.stack;return _t?(_e=_e||0,0===_t.indexOf(j.name)&&(_e+=(j.name+j.message).split("\n").length),_t.split("\n").slice(_e).filter(libraryFilter).map((function(j){return"\n"+j})).join("")):""}var a_=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],s_=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(a_),c_={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function DexieError(j,_e){this._e=getErrorWithStack(),this.name=j,this.message=_e}function getMultiErrorMessage(j,_e){return j+". Errors: "+Object.keys(_e).map((function(j){return _e[j].toString()})).filter((function(j,_e,_t){return _t.indexOf(j)===_e})).join("\n")}function ModifyError(j,_e,_t,St){this._e=getErrorWithStack(),this.failures=_e,this.failedKeys=St,this.successCount=_t,this.message=getMultiErrorMessage(j,_e)}function BulkError(j,_e){this._e=getErrorWithStack(),this.name="BulkError",this.failures=_e,this.message=getMultiErrorMessage(j,_e)}derive(DexieError).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+prettyStack(this._e,2))}},toString:function(){return this.name+": "+this.message}}),derive(ModifyError).from(DexieError),derive(BulkError).from(DexieError);var u_=s_.reduce((function(j,_e){return j[_e]=_e+"Error",j}),{}),l_=DexieError,d_=s_.reduce((function(j,_e){var _t=_e+"Error";function DexieError(j,St){this._e=getErrorWithStack(),this.name=_t,j?"string"==typeof j?(this.message=j+(St?"\n "+St:""),this.inner=St||null):"object"==typeof j&&(this.message=j.name+" "+j.message,this.inner=j):(this.message=c_[_e]||_t,this.inner=null)}return derive(DexieError).from(l_),j[_e]=DexieError,j}),{});d_.Syntax=SyntaxError,d_.Type=TypeError,d_.Range=RangeError;var h_=a_.reduce((function(j,_e){return j[_e+"Error"]=d_[_e],j}),{});var f_=s_.reduce((function(j,_e){return-1===["Syntax","Type","Range"].indexOf(_e)&&(j[_e+"Error"]=d_[_e]),j}),{});function nop(){}function mirror(j){return j}function pureFunctionChain(j,_e){return null==j||j===mirror?_e:function(_t){return _e(j(_t))}}function callBoth(j,_e){return function(){j.apply(this,arguments),_e.apply(this,arguments)}}function hookCreatingChain(j,_e){return j===nop?_e:function(){var _t=j.apply(this,arguments);void 0!==_t&&(arguments[0]=_t);var St=this.onsuccess,Tt=this.onerror;this.onsuccess=null,this.onerror=null;var Ut=_e.apply(this,arguments);return St&&(this.onsuccess=this.onsuccess?callBoth(St,this.onsuccess):St),Tt&&(this.onerror=this.onerror?callBoth(Tt,this.onerror):Tt),void 0!==Ut?Ut:_t}}function hookDeletingChain(j,_e){return j===nop?_e:function(){j.apply(this,arguments);var _t=this.onsuccess,St=this.onerror;this.onsuccess=this.onerror=null,_e.apply(this,arguments),_t&&(this.onsuccess=this.onsuccess?callBoth(_t,this.onsuccess):_t),St&&(this.onerror=this.onerror?callBoth(St,this.onerror):St)}}function hookUpdatingChain(j,_e){return j===nop?_e:function(_t){var St=j.apply(this,arguments);extend(_t,St);var Tt=this.onsuccess,Ut=this.onerror;this.onsuccess=null,this.onerror=null;var _r=_e.apply(this,arguments);return Tt&&(this.onsuccess=this.onsuccess?callBoth(Tt,this.onsuccess):Tt),Ut&&(this.onerror=this.onerror?callBoth(Ut,this.onerror):Ut),void 0===St?void 0===_r?void 0:_r:extend(St,_r)}}function reverseStoppableEventChain(j,_e){return j===nop?_e:function(){return!1!==_e.apply(this,arguments)&&j.apply(this,arguments)}}function promisableChain(j,_e){return j===nop?_e:function(){var _t=j.apply(this,arguments);if(_t&&"function"==typeof _t.then){for(var St=this,Tt=arguments.length,Ut=new Array(Tt);Tt--;)Ut[Tt]=arguments[Tt];return _t.then((function(){return _e.apply(St,Ut)}))}return _e.apply(this,arguments)}}f_.ModifyError=ModifyError,f_.DexieError=DexieError,f_.BulkError=BulkError;var p_={},v_="undefined"==typeof Promise?[]:function(){var j=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[j,j.__proto__,j];var _e=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[_e,_e.__proto__,j]}(),m_=v_[0],y_=v_[1],A_=v_[2],__=y_&&y_.then,b_=m_&&m_.constructor,E_=!!A_,w_=!1,I_=A_?function(){A_.then(physicalTick)}:kc.setImmediate?setImmediate.bind(null,physicalTick):kc.MutationObserver?function(){var j=document.createElement("div");new MutationObserver((function(){physicalTick(),j=null})).observe(j,{attributes:!0}),j.setAttribute("i","1")}:function(){setTimeout(physicalTick,0)},asap$1=function(j,_e){M_.push([j,_e]),C_&&(I_(),C_=!1)},T_=!0,C_=!0,R_=[],k_=[],O_=null,D_=mirror,N_={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:globalError,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(j){try{globalError(j[0],j[1])}catch(j){}}))}},P_=N_,M_=[],B_=0,j_=[];function DexiePromise(j){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=nop,this._lib=!1;var _e=this._PSD=P_;if(r_&&(this._stackHolder=getErrorWithStack(),this._prev=null,this._numPrev=0),"function"!=typeof j){if(j!==p_)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&handleRejection(this,this._value))}this._state=null,this._value=null,++_e.ref,executePromiseTask(this,j)}var U_={get:function(){var j=P_,_e=W_;function then(_t,St){var Tt=this,Ut=!j.global&&(j!==P_||_e!==W_),_r=Ut&&!decrementExpectedAwaits(),_n=new DexiePromise((function(_e,_n){propagateToListener(Tt,new Listener(nativeAwaitCompatibleWrap(_t,j,Ut,_r),nativeAwaitCompatibleWrap(St,j,Ut,_r),_e,_n,j))}));return r_&&linkToPreviousPromise(_n,this),_n}return then.prototype=p_,then},set:function(j){setProp(this,"then",j&&j.prototype===p_?U_:{get:function(){return j},set:U_.set})}};function Listener(j,_e,_t,St,Tt){this.onFulfilled="function"==typeof j?j:null,this.onRejected="function"==typeof _e?_e:null,this.resolve=_t,this.reject=St,this.psd=Tt}function executePromiseTask(j,_e){try{_e((function(_e){if(null===j._state){if(_e===j)throw new TypeError("A promise cannot be resolved with itself.");var _t=j._lib&&beginMicroTickScope();_e&&"function"==typeof _e.then?executePromiseTask(j,(function(j,_t){_e instanceof DexiePromise?_e._then(j,_t):_e.then(j,_t)})):(j._state=!0,j._value=_e,propagateAllListeners(j)),_t&&endMicroTickScope()}}),handleRejection.bind(null,j))}catch(_e){handleRejection(j,_e)}}function handleRejection(j,_e){if(k_.push(_e),null===j._state){var _t=j._lib&&beginMicroTickScope();_e=D_(_e),j._state=!1,j._value=_e,r_&&null!==_e&&"object"==typeof _e&&!_e._promise&&function tryCatch(j,_e,_t){try{j.apply(null,_t)}catch(j){_e&&_e(j)}}((function(){var _t=getPropertyDescriptor(_e,"stack");_e._promise=j,setProp(_e,"stack",{get:function(){return w_?_t&&(_t.get?_t.get.apply(_e):_t.value):j.stack}})})),function addPossiblyUnhandledError(j){R_.some((function(_e){return _e._value===j._value}))||R_.push(j)}(j),propagateAllListeners(j),_t&&endMicroTickScope()}}function propagateAllListeners(j){var _e=j._listeners;j._listeners=[];for(var _t=0,St=_e.length;_t<St;++_t)propagateToListener(j,_e[_t]);var Tt=j._PSD;--Tt.ref||Tt.finalize(),0===B_&&(++B_,asap$1((function(){0==--B_&&finalizePhysicalTick()}),[]))}function propagateToListener(j,_e){if(null!==j._state){var _t=j._state?_e.onFulfilled:_e.onRejected;if(null===_t)return(j._state?_e.resolve:_e.reject)(j._value);++_e.psd.ref,++B_,asap$1(callListener,[_t,j,_e])}else j._listeners.push(_e)}function callListener(j,_e,_t){try{O_=_e;var St,Tt=_e._value;_e._state?St=j(Tt):(k_.length&&(k_=[]),St=j(Tt),-1===k_.indexOf(Tt)&&function markErrorAsHandled(j){var _e=R_.length;for(;_e;)if(R_[--_e]._value===j._value)return void R_.splice(_e,1)}(_e)),_t.resolve(St)}catch(j){_t.reject(j)}finally{O_=null,0==--B_&&finalizePhysicalTick(),--_t.psd.ref||_t.psd.finalize()}}function getStack(j,_e,_t){if(_e.length===_t)return _e;var St="";if(!1===j._state){var Tt,Ut,_r=j._value;null!=_r?(Tt=_r.name||"Error",Ut=_r.message||_r,St=prettyStack(_r,0)):(Tt=_r,Ut=""),_e.push(Tt+(Ut?": "+Ut:"")+St)}return r_&&((St=prettyStack(j._stackHolder,2))&&-1===_e.indexOf(St)&&_e.push(St),j._prev&&getStack(j._prev,_e,_t)),_e}function linkToPreviousPromise(j,_e){var _t=_e?_e._numPrev+1:0;_t<100&&(j._prev=_e,j._numPrev=_t)}function physicalTick(){beginMicroTickScope()&&endMicroTickScope()}function beginMicroTickScope(){var j=T_;return T_=!1,C_=!1,j}function endMicroTickScope(){var j,_e,_t;do{for(;M_.length>0;)for(j=M_,M_=[],_t=j.length,_e=0;_e<_t;++_e){var St=j[_e];St[0].apply(null,St[1])}}while(M_.length>0);T_=!0,C_=!0}function finalizePhysicalTick(){var j=R_;R_=[],j.forEach((function(j){j._PSD.onunhandled.call(null,j._value,j)}));for(var _e=j_.slice(0),_t=_e.length;_t;)_e[--_t]()}function PromiseReject(j){return new DexiePromise(p_,!1,j)}function wrap(j,_e){var _t=P_;return function(){var St=beginMicroTickScope(),Tt=P_;try{return switchToZone(_t,!0),j.apply(this,arguments)}catch(j){_e&&_e(j)}finally{switchToZone(Tt,!1),St&&endMicroTickScope()}}}props(DexiePromise.prototype,{then:U_,_then:function(j,_e){propagateToListener(this,new Listener(null,null,j,_e,P_))},catch:function(j){if(1===arguments.length)return this.then(null,j);var _e=arguments[0],_t=arguments[1];return"function"==typeof _e?this.then(null,(function(j){return j instanceof _e?_t(j):PromiseReject(j)})):this.then(null,(function(j){return j&&j.name===_e?_t(j):PromiseReject(j)}))},finally:function(j){return this.then((function(_e){return j(),_e}),(function(_e){return j(),PromiseReject(_e)}))},stack:{get:function(){if(this._stack)return this._stack;try{w_=!0;var j=getStack(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=j),j}finally{w_=!1}}},timeout:function(j,_e){var _t=this;return j<1/0?new DexiePromise((function(St,Tt){var Ut=setTimeout((function(){return Tt(new d_.Timeout(_e))}),j);_t.then(St,Tt).finally(clearTimeout.bind(null,Ut))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&setProp(DexiePromise.prototype,Symbol.toStringTag,"Dexie.Promise"),N_.env=snapShot(),props(DexiePromise,{all:function(){var j=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(_e,_t){0===j.length&&_e([]);var St=j.length;j.forEach((function(Tt,Ut){return DexiePromise.resolve(Tt).then((function(_t){j[Ut]=_t,--St||_e(j)}),_t)}))}))},resolve:function(j){if(j instanceof DexiePromise)return j;if(j&&"function"==typeof j.then)return new DexiePromise((function(_e,_t){j.then(_e,_t)}));var _e=new DexiePromise(p_,!0,j);return linkToPreviousPromise(_e,O_),_e},reject:PromiseReject,race:function(){var j=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(_e,_t){j.map((function(j){return DexiePromise.resolve(j).then(_e,_t)}))}))},PSD:{get:function(){return P_},set:function(j){return P_=j}},totalEchoes:{get:function(){return W_}},newPSD:newScope,usePSD,scheduler:{get:function(){return asap$1},set:function(j){asap$1=j}},rejectionMapper:{get:function(){return D_},set:function(j){D_=j}},follow:function(j,_e){return new DexiePromise((function(_t,St){return newScope((function(_e,_t){var St=P_;St.unhandleds=[],St.onunhandled=_t,St.finalize=callBoth((function(){var j=this;!function run_at_end_of_this_or_next_physical_tick(j){function finalizer(){j(),j_.splice(j_.indexOf(finalizer),1)}j_.push(finalizer),++B_,asap$1((function(){0==--B_&&finalizePhysicalTick()}),[])}((function(){0===j.unhandleds.length?_e():_t(j.unhandleds[0])}))}),St.finalize),j()}),_e,_t,St)}))}}),b_&&(b_.allSettled&&setProp(DexiePromise,"allSettled",(function(){var j=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(_e){0===j.length&&_e([]);var _t=j.length,St=new Array(_t);j.forEach((function(j,Tt){return DexiePromise.resolve(j).then((function(j){return St[Tt]={status:"fulfilled",value:j}}),(function(j){return St[Tt]={status:"rejected",reason:j}})).then((function(){return--_t||_e(St)}))}))}))})),b_.any&&"undefined"!=typeof AggregateError&&setProp(DexiePromise,"any",(function(){var j=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(_e,_t){0===j.length&&_t(new AggregateError([]));var St=j.length,Tt=new Array(St);j.forEach((function(j,Ut){return DexiePromise.resolve(j).then((function(j){return _e(j)}),(function(j){Tt[Ut]=j,--St||_t(new AggregateError(Tt))}))}))}))})));var F_={awaits:0,echoes:0,id:0},G_=0,V_=[],K_=0,W_=0,H_=0;function newScope(j,_e,_t,St){var Tt=P_,Ut=Object.create(Tt);Ut.parent=Tt,Ut.ref=0,Ut.global=!1,Ut.id=++H_;var _r=N_.env;Ut.env=E_?{Promise:DexiePromise,PromiseProp:{value:DexiePromise,configurable:!0,writable:!0},all:DexiePromise.all,race:DexiePromise.race,allSettled:DexiePromise.allSettled,any:DexiePromise.any,resolve:DexiePromise.resolve,reject:DexiePromise.reject,nthen:getPatchedPromiseThen(_r.nthen,Ut),gthen:getPatchedPromiseThen(_r.gthen,Ut)}:{},_e&&extend(Ut,_e),++Tt.ref,Ut.finalize=function(){--this.parent.ref||this.parent.finalize()};var _n=usePSD(Ut,j,_t,St);return 0===Ut.ref&&Ut.finalize(),_n}function incrementExpectedAwaits(){return F_.id||(F_.id=++G_),++F_.awaits,F_.echoes+=100,F_.id}function decrementExpectedAwaits(){return!!F_.awaits&&(0==--F_.awaits&&(F_.id=0),F_.echoes=100*F_.awaits,!0)}function onPossibleParallellAsync(j){return F_.echoes&&j&&j.constructor===b_?(incrementExpectedAwaits(),j.then((function(j){return decrementExpectedAwaits(),j}),(function(j){return decrementExpectedAwaits(),J_(j)}))):j}function zoneEnterEcho(j){++W_,F_.echoes&&0!=--F_.echoes||(F_.echoes=F_.id=0),V_.push(P_),switchToZone(j,!0)}function zoneLeaveEcho(){var j=V_[V_.length-1];V_.pop(),switchToZone(j,!1)}function switchToZone(j,_e){var _t=P_;if((_e?!F_.echoes||K_++&&j===P_:!K_||--K_&&j===P_)||enqueueNativeMicroTask(_e?zoneEnterEcho.bind(null,j):zoneLeaveEcho),j!==P_&&(P_=j,_t===N_&&(N_.env=snapShot()),E_)){var St=N_.env.Promise,Tt=j.env;y_.then=Tt.nthen,St.prototype.then=Tt.gthen,(_t.global||j.global)&&(Object.defineProperty(kc,"Promise",Tt.PromiseProp),St.all=Tt.all,St.race=Tt.race,St.resolve=Tt.resolve,St.reject=Tt.reject,Tt.allSettled&&(St.allSettled=Tt.allSettled),Tt.any&&(St.any=Tt.any))}}function snapShot(){var j=kc.Promise;return E_?{Promise:j,PromiseProp:Object.getOwnPropertyDescriptor(kc,"Promise"),all:j.all,race:j.race,allSettled:j.allSettled,any:j.any,resolve:j.resolve,reject:j.reject,nthen:y_.then,gthen:j.prototype.then}:{}}function usePSD(j,_e,_t,St,Tt){var Ut=P_;try{return switchToZone(j,!0),_e(_t,St,Tt)}finally{switchToZone(Ut,!1)}}function enqueueNativeMicroTask(j){__.call(m_,j)}function nativeAwaitCompatibleWrap(j,_e,_t,St){return"function"!=typeof j?j:function(){var Tt=P_;_t&&incrementExpectedAwaits(),switchToZone(_e,!0);try{return j.apply(this,arguments)}finally{switchToZone(Tt,!1),St&&enqueueNativeMicroTask(decrementExpectedAwaits)}}}function getPatchedPromiseThen(j,_e){return function(_t,St){return j.call(this,nativeAwaitCompatibleWrap(_t,_e),nativeAwaitCompatibleWrap(St,_e))}}-1===(""+__).indexOf("[native code]")&&(incrementExpectedAwaits=decrementExpectedAwaits=nop);var Y_="unhandledrejection";function globalError(j,_e){var _t;try{_t=_e.onuncatched(j)}catch(j){}if(!1!==_t)try{var St,Tt={promise:_e,reason:j};if(kc.document&&document.createEvent?((St=document.createEvent("Event")).initEvent(Y_,!0,!0),extend(St,Tt)):kc.CustomEvent&&extend(St=new CustomEvent(Y_,{detail:Tt}),Tt),St&&kc.dispatchEvent&&(dispatchEvent(St),!kc.PromiseRejectionEvent&&kc.onunhandledrejection))try{kc.onunhandledrejection(St)}catch(j){}r_&&St&&!St.defaultPrevented&&console.warn("Unhandled rejection: "+(j.stack||j))}catch(j){}}var J_=DexiePromise.reject;function tempTransaction(j,_e,_t,St){if(j._state.openComplete||P_.letThrough){var Tt=j._createTransaction(_e,_t,j._dbSchema);try{Tt.create()}catch(j){return J_(j)}return Tt._promise(_e,(function(j,_e){return newScope((function(){return P_.trans=Tt,St(j,_e,Tt)}))})).then((function(j){return Tt._completion.then((function(){return j}))}))}if(!j._state.isBeingOpened){if(!j._options.autoOpen)return J_(new d_.DatabaseClosed);j.open().catch(nop)}return j._state.dbReadyPromise.then((function(){return tempTransaction(j,_e,_t,St)}))}var X_="3.0.3",Z_=String.fromCharCode(65535),$_=-1/0,Lb="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Mb="String expected.",eE=[],tE="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),rE=tE,nE=tE,dexieStackFrameFilter=function(j){return!/(dexie\.js|dexie\.min\.js)/.test(j)},iE="__dbnames",oE="readonly",aE="readwrite";function combine(j,_e){return j?_e?function(){return j.apply(this,arguments)&&_e.apply(this,arguments)}:j:_e}var sE={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function workaroundForUndefinedPrimKey(j){return function(_e){return void 0===getByKeyPath(_e,j)&&delByKeyPath(_e=deepClone(_e),j),_e}}var cE=function(){function Table(){}return Table.prototype._trans=function(j,_e,_t){var St=this._tx||P_.trans,Tt=this.name;function checkTableInTransaction(j,_t,St){if(!St.schema[Tt])throw new d_.NotFound("Table "+Tt+" not part of transaction");return _e(St.idbtrans,St)}var Ut=beginMicroTickScope();try{return St&&St.db===this.db?St===P_.trans?St._promise(j,checkTableInTransaction,_t):newScope((function(){return St._promise(j,checkTableInTransaction,_t)}),{trans:St,transless:P_.transless||P_}):tempTransaction(this.db,j,[this.name],checkTableInTransaction)}finally{Ut&&endMicroTickScope()}},Table.prototype.get=function(j,_e){var _t=this;return j&&j.constructor===Object?this.where(j).first(_e):this._trans("readonly",(function(_e){return _t.core.get({trans:_e,key:j}).then((function(j){return _t.hook.reading.fire(j)}))})).then(_e)},Table.prototype.where=function(j){if("string"==typeof j)return new this.db.WhereClause(this,j);if(_c(j))return new this.db.WhereClause(this,"["+j.join("+")+"]");var _e=_s(j);if(1===_e.length)return this.where(_e[0]).equals(j[_e[0]]);var _t=this.schema.indexes.concat(this.schema.primKey).filter((function(j){return j.compound&&_e.every((function(_e){return j.keyPath.indexOf(_e)>=0}))&&j.keyPath.every((function(j){return _e.indexOf(j)>=0}))}))[0];if(_t&&this.db._maxKey!==Z_)return this.where(_t.name).equals(_t.keyPath.map((function(_e){return j[_e]})));!_t&&r_&&console.warn("The query "+JSON.stringify(j)+" on "+this.name+" would benefit of a compound index ["+_e.join("+")+"]");var St=this.schema.idxByName,Tt=this.db._deps.indexedDB;function equals(j,_e){try{return 0===Tt.cmp(j,_e)}catch(j){return!1}}var Ut=_e.reduce((function(_e,_t){var Tt=_e[0],Ut=_e[1],_r=St[_t],_n=j[_t];return[Tt||_r,Tt||!_r?combine(Ut,_r&&_r.multi?function(j){var _e=getByKeyPath(j,_t);return _c(_e)&&_e.some((function(j){return equals(_n,j)}))}:function(j){return equals(_n,getByKeyPath(j,_t))}):Ut]}),[null,null]),_r=Ut[0],_n=Ut[1];return _r?this.where(_r.name).equals(j[_r.keyPath]).filter(_n):_t?this.filter(_n):this.where(_e).equals("")},Table.prototype.filter=function(j){return this.toCollection().and(j)},Table.prototype.count=function(j){return this.toCollection().count(j)},Table.prototype.offset=function(j){return this.toCollection().offset(j)},Table.prototype.limit=function(j){return this.toCollection().limit(j)},Table.prototype.each=function(j){return this.toCollection().each(j)},Table.prototype.toArray=function(j){return this.toCollection().toArray(j)},Table.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Table.prototype.orderBy=function(j){return new this.db.Collection(new this.db.WhereClause(this,_c(j)?"["+j.join("+")+"]":j))},Table.prototype.reverse=function(){return this.toCollection().reverse()},Table.prototype.mapToClass=function(j){this.schema.mappedClass=j;var readHook=function(_e){if(!_e)return _e;var _t=Object.create(j.prototype);for(var St in _e)if(hasOwn(_e,St))try{_t[St]=_e[St]}catch(j){}return _t};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=readHook,this.hook("reading",readHook),j},Table.prototype.defineClass=function(){return this.mapToClass((function Class(j){extend(this,j)}))},Table.prototype.add=function(j,_e){var _t=this,St=this.schema.primKey,Tt=St.auto,Ut=St.keyPath,_r=j;return Ut&&Tt&&(_r=workaroundForUndefinedPrimKey(Ut)(j)),this._trans("readwrite",(function(j){return _t.core.mutate({trans:j,type:"add",keys:null!=_e?[_e]:null,values:[_r]})})).then((function(j){return j.numFailures?DexiePromise.reject(j.failures[0]):j.lastResult})).then((function(_e){if(Ut)try{setByKeyPath(j,Ut,_e)}catch(j){}return _e}))},Table.prototype.update=function(j,_e){if("object"!=typeof _e||_c(_e))throw new d_.InvalidArgument("Modifications must be an object.");if("object"!=typeof j||_c(j))return this.where(":id").equals(j).modify(_e);_s(_e).forEach((function(_t){setByKeyPath(j,_t,_e[_t])}));var _t=getByKeyPath(j,this.schema.primKey.keyPath);return void 0===_t?J_(new d_.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(_t).modify(_e)},Table.prototype.put=function(j,_e){var _t=this,St=this.schema.primKey,Tt=St.auto,Ut=St.keyPath,_r=j;return Ut&&Tt&&(_r=workaroundForUndefinedPrimKey(Ut)(j)),this._trans("readwrite",(function(j){return _t.core.mutate({trans:j,type:"put",values:[_r],keys:null!=_e?[_e]:null})})).then((function(j){return j.numFailures?DexiePromise.reject(j.failures[0]):j.lastResult})).then((function(_e){if(Ut)try{setByKeyPath(j,Ut,_e)}catch(j){}return _e}))},Table.prototype.delete=function(j){var _e=this;return this._trans("readwrite",(function(_t){return _e.core.mutate({trans:_t,type:"delete",keys:[j]})})).then((function(j){return j.numFailures?DexiePromise.reject(j.failures[0]):void 0}))},Table.prototype.clear=function(){var j=this;return this._trans("readwrite",(function(_e){return j.core.mutate({trans:_e,type:"deleteRange",range:sE})})).then((function(j){return j.numFailures?DexiePromise.reject(j.failures[0]):void 0}))},Table.prototype.bulkGet=function(j){var _e=this;return this._trans("readonly",(function(_t){return _e.core.getMany({keys:j,trans:_t}).then((function(j){return j.map((function(j){return _e.hook.reading.fire(j)}))}))}))},Table.prototype.bulkAdd=function(j,_e,_t){var St=this,Tt=Array.isArray(_e)?_e:void 0,Ut=(_t=_t||(Tt?void 0:_e))?_t.allKeys:void 0;return this._trans("readwrite",(function(_e){var _t=St.schema.primKey,_r=_t.auto,_n=_t.keyPath;if(_n&&Tt)throw new d_.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(Tt&&Tt.length!==j.length)throw new d_.InvalidArgument("Arguments objects and keys must have the same length");var _i=j.length,Ei=_n&&_r?j.map(workaroundForUndefinedPrimKey(_n)):j;return St.core.mutate({trans:_e,type:"add",keys:Tt,values:Ei,wantResults:Ut}).then((function(j){var _e=j.numFailures,_t=j.results,Tt=j.lastResult,_r=j.failures;if(0===_e)return Ut?_t:Tt;throw new BulkError(St.name+".bulkAdd(): "+_e+" of "+_i+" operations failed",Object.keys(_r).map((function(j){return _r[j]})))}))}))},Table.prototype.bulkPut=function(j,_e,_t){var St=this,Tt=Array.isArray(_e)?_e:void 0,Ut=(_t=_t||(Tt?void 0:_e))?_t.allKeys:void 0;return this._trans("readwrite",(function(_e){var _t=St.schema.primKey,_r=_t.auto,_n=_t.keyPath;if(_n&&Tt)throw new d_.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(Tt&&Tt.length!==j.length)throw new d_.InvalidArgument("Arguments objects and keys must have the same length");var _i=j.length,Ei=_n&&_r?j.map(workaroundForUndefinedPrimKey(_n)):j;return St.core.mutate({trans:_e,type:"put",keys:Tt,values:Ei,wantResults:Ut}).then((function(j){var _e=j.numFailures,_t=j.results,Tt=j.lastResult,_r=j.failures;if(0===_e)return Ut?_t:Tt;throw new BulkError(St.name+".bulkPut(): "+_e+" of "+_i+" operations failed",Object.keys(_r).map((function(j){return _r[j]})))}))}))},Table.prototype.bulkDelete=function(j){var _e=this,_t=j.length;return this._trans("readwrite",(function(_t){return _e.core.mutate({trans:_t,type:"delete",keys:j})})).then((function(j){var St=j.numFailures,Tt=j.lastResult,Ut=j.failures;if(0===St)return Tt;throw new BulkError(_e.name+".bulkDelete(): "+St+" of "+_t+" operations failed",Ut)}))},Table}();function Events(j){var _e={},rv=function(_t,St){if(St){for(var Tt=arguments.length,Ut=new Array(Tt-1);--Tt;)Ut[Tt-1]=arguments[Tt];return _e[_t].subscribe.apply(null,Ut),j}if("string"==typeof _t)return _e[_t]};rv.addEventType=add;for(var _t=1,St=arguments.length;_t<St;++_t)add(arguments[_t]);return rv;function add(j,_t,St){if("object"==typeof j)return addConfiguredEvents(j);_t||(_t=reverseStoppableEventChain),St||(St=nop);var Tt={subscribers:[],fire:St,subscribe:function(j){-1===Tt.subscribers.indexOf(j)&&(Tt.subscribers.push(j),Tt.fire=_t(Tt.fire,j))},unsubscribe:function(j){Tt.subscribers=Tt.subscribers.filter((function(_e){return _e!==j})),Tt.fire=Tt.subscribers.reduce(_t,St)}};return _e[j]=rv[j]=Tt,Tt}function addConfiguredEvents(j){_s(j).forEach((function(_e){var _t=j[_e];if(_c(_t))add(_e,j[_e][0],j[_e][1]);else{if("asap"!==_t)throw new d_.InvalidArgument("Invalid event config");var St=add(_e,mirror,(function fire(){for(var j=arguments.length,_e=new Array(j);j--;)_e[j]=arguments[j];St.subscribers.forEach((function(j){asap((function fireEvent(){j.apply(null,_e)}))}))}))}}))}}function makeClassConstructor(j,_e){return derive(_e).from({prototype:j}),_e}function isPlainKeyRange(j,_e){return!(j.filter||j.algorithm||j.or)&&(_e?j.justLimit:!j.replayFilter)}function addFilter(j,_e){j.filter=combine(j.filter,_e)}function addReplayFilter(j,_e,_t){var St=j.replayFilter;j.replayFilter=St?function(){return combine(St(),_e())}:_e,j.justLimit=_t&&!St}function getIndexOrStore(j,_e){if(j.isPrimKey)return _e.primaryKey;var _t=_e.getIndexByKeyPath(j.index);if(!_t)throw new d_.Schema("KeyPath "+j.index+" on object store "+_e.name+" is not indexed");return _t}function openCursor(j,_e,_t){var St=getIndexOrStore(j,_e.schema);return _e.openCursor({trans:_t,values:!j.keysOnly,reverse:"prev"===j.dir,unique:!!j.unique,query:{index:St,range:j.range}})}function iter(j,_e,_t,St){var Tt=j.replayFilter?combine(j.filter,j.replayFilter()):j.filter;if(j.or){var Ut={},union=function(j,_t,St){if(!Tt||Tt(_t,St,(function(j){return _t.stop(j)}),(function(j){return _t.fail(j)}))){var _r=_t.primaryKey,_n=""+_r;"[object ArrayBuffer]"===_n&&(_n=""+new Uint8Array(_r)),hasOwn(Ut,_n)||(Ut[_n]=!0,_e(j,_t,St))}};return Promise.all([j.or._iterate(union,_t),iterate(openCursor(j,St,_t),j.algorithm,union,!j.keysOnly&&j.valueMapper)])}return iterate(openCursor(j,St,_t),combine(j.algorithm,Tt),_e,!j.keysOnly&&j.valueMapper)}function iterate(j,_e,_t,St){var Tt=wrap(St?function(j,_e,Tt){return _t(St(j),_e,Tt)}:_t);return j.then((function(j){if(j)return j.start((function(){var c=function(){return j.continue()};_e&&!_e(j,(function(j){return c=j}),(function(_e){j.stop(_e),c=nop}),(function(_e){j.fail(_e),c=nop}))||Tt(j.value,j,(function(j){return c=j})),c()}))}))}var uE=function(){function Collection(){}return Collection.prototype._read=function(j,_e){var _t=this._ctx;return _t.error?_t.table._trans(null,J_.bind(null,_t.error)):_t.table._trans("readonly",j).then(_e)},Collection.prototype._write=function(j){var _e=this._ctx;return _e.error?_e.table._trans(null,J_.bind(null,_e.error)):_e.table._trans("readwrite",j,"locked")},Collection.prototype._addAlgorithm=function(j){var _e=this._ctx;_e.algorithm=combine(_e.algorithm,j)},Collection.prototype._iterate=function(j,_e){return iter(this._ctx,j,_e,this._ctx.table.core)},Collection.prototype.clone=function(j){var _e=Object.create(this.constructor.prototype),_t=Object.create(this._ctx);return j&&extend(_t,j),_e._ctx=_t,_e},Collection.prototype.raw=function(){return this._ctx.valueMapper=null,this},Collection.prototype.each=function(j){var _e=this._ctx;return this._read((function(_t){return iter(_e,j,_t,_e.table.core)}))},Collection.prototype.count=function(j){var _e=this;return this._read((function(j){var _t=_e._ctx,St=_t.table.core;if(isPlainKeyRange(_t,!0))return St.count({trans:j,query:{index:getIndexOrStore(_t,St.schema),range:_t.range}}).then((function(j){return Math.min(j,_t.limit)}));var Tt=0;return iter(_t,(function(){return++Tt,!1}),j,St).then((function(){return Tt}))})).then(j)},Collection.prototype.sortBy=function(j,_e){var _t=j.split(".").reverse(),St=_t[0],Tt=_t.length-1;function getval(j,_e){return _e?getval(j[_t[_e]],_e-1):j[St]}var Ut="next"===this._ctx.dir?1:-1;function sorter(j,_e){var _t=getval(j,Tt),St=getval(_e,Tt);return _t<St?-Ut:_t>St?Ut:0}return this.toArray((function(j){return j.sort(sorter)})).then(_e)},Collection.prototype.toArray=function(j){var _e=this;return this._read((function(j){var _t=_e._ctx;if("next"===_t.dir&&isPlainKeyRange(_t,!0)&&_t.limit>0){var St=_t.valueMapper,Tt=getIndexOrStore(_t,_t.table.core.schema);return _t.table.core.query({trans:j,limit:_t.limit,values:!0,query:{index:Tt,range:_t.range}}).then((function(j){var _e=j.result;return St?_e.map(St):_e}))}var Ut=[];return iter(_t,(function(j){return Ut.push(j)}),j,_t.table.core).then((function(){return Ut}))}),j)},Collection.prototype.offset=function(j){var _e=this._ctx;return j<=0||(_e.offset+=j,isPlainKeyRange(_e)?addReplayFilter(_e,(function(){var _e=j;return function(j,_t){return 0===_e||(1===_e?(--_e,!1):(_t((function(){j.advance(_e),_e=0})),!1))}})):addReplayFilter(_e,(function(){var _e=j;return function(){return--_e<0}}))),this},Collection.prototype.limit=function(j){return this._ctx.limit=Math.min(this._ctx.limit,j),addReplayFilter(this._ctx,(function(){var _e=j;return function(j,_t,St){return--_e<=0&&_t(St),_e>=0}}),!0),this},Collection.prototype.until=function(j,_e){return addFilter(this._ctx,(function(_t,St,Tt){return!j(_t.value)||(St(Tt),_e)})),this},Collection.prototype.first=function(j){return this.limit(1).toArray((function(j){return j[0]})).then(j)},Collection.prototype.last=function(j){return this.reverse().first(j)},Collection.prototype.filter=function(j){return addFilter(this._ctx,(function(_e){return j(_e.value)})),function addMatchFilter(j,_e){j.isMatch=combine(j.isMatch,_e)}(this._ctx,j),this},Collection.prototype.and=function(j){return this.filter(j)},Collection.prototype.or=function(j){return new this.db.WhereClause(this._ctx.table,j,this)},Collection.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Collection.prototype.desc=function(){return this.reverse()},Collection.prototype.eachKey=function(j){var _e=this._ctx;return _e.keysOnly=!_e.isMatch,this.each((function(_e,_t){j(_t.key,_t)}))},Collection.prototype.eachUniqueKey=function(j){return this._ctx.unique="unique",this.eachKey(j)},Collection.prototype.eachPrimaryKey=function(j){var _e=this._ctx;return _e.keysOnly=!_e.isMatch,this.each((function(_e,_t){j(_t.primaryKey,_t)}))},Collection.prototype.keys=function(j){var _e=this._ctx;_e.keysOnly=!_e.isMatch;var _t=[];return this.each((function(j,_e){_t.push(_e.key)})).then((function(){return _t})).then(j)},Collection.prototype.primaryKeys=function(j){var _e=this._ctx;if("next"===_e.dir&&isPlainKeyRange(_e,!0)&&_e.limit>0)return this._read((function(j){var _t=getIndexOrStore(_e,_e.table.core.schema);return _e.table.core.query({trans:j,values:!1,limit:_e.limit,query:{index:_t,range:_e.range}})})).then((function(j){return j.result})).then(j);_e.keysOnly=!_e.isMatch;var _t=[];return this.each((function(j,_e){_t.push(_e.primaryKey)})).then((function(){return _t})).then(j)},Collection.prototype.uniqueKeys=function(j){return this._ctx.unique="unique",this.keys(j)},Collection.prototype.firstKey=function(j){return this.limit(1).keys((function(j){return j[0]})).then(j)},Collection.prototype.lastKey=function(j){return this.reverse().firstKey(j)},Collection.prototype.distinct=function(){var j=this._ctx,_e=j.index&&j.table.schema.idxByName[j.index];if(!_e||!_e.multi)return this;var _t={};return addFilter(this._ctx,(function(j){var _e=j.primaryKey.toString(),St=hasOwn(_t,_e);return _t[_e]=!0,!St})),this},Collection.prototype.modify=function(j){var _e=this,_t=this._ctx;return this._write((function(St){var Tt;if("function"==typeof j)Tt=j;else{var Ut=_s(j),_r=Ut.length;Tt=function(_e){for(var _t=!1,St=0;St<_r;++St){var Tt=Ut[St],_n=j[Tt];getByKeyPath(_e,Tt)!==_n&&(setByKeyPath(_e,Tt,_n),_t=!0)}return _t}}var _n=_t.table.core,_i=_n.schema.primaryKey,Ei=_i.outbound,Ci=_i.extractKey,Di="testmode"in _E?1:2e3,Fi=_e.db.core.cmp,_o=[],ga=0,_a=[],applyMutateResult=function(j,_e){var _t=_e.failures,St=_e.numFailures;ga+=j-St;for(var Tt=0,Ut=_s(_t);Tt<Ut.length;Tt++){var _r=Ut[Tt];_o.push(_t[_r])}};return _e.clone().primaryKeys().then((function(j){var nextChunk=function(_e){var _t=Math.min(Di,j.length-_e);return _n.getMany({trans:St,keys:j.slice(_e,_e+_t)}).then((function(Ut){for(var _r=[],_i=[],_o=Ei?[]:null,ga=[],_a=0;_a<_t;++_a){var _s=Ut[_a],_c={value:deepClone(_s),primKey:j[_e+_a]};!1!==Tt.call(_c,_c.value,_c)&&(null==_c.value?ga.push(j[_e+_a]):Ei||0===Fi(Ci(_s),Ci(_c.value))?(_i.push(_c.value),Ei&&_o.push(j[_e+_a])):(ga.push(j[_e+_a]),_r.push(_c.value)))}return Promise.resolve(_r.length>0&&_n.mutate({trans:St,type:"add",values:_r}).then((function(j){for(var _e in j.failures)ga.splice(parseInt(_e),1);applyMutateResult(_r.length,j)}))).then((function(j){return _i.length>0&&_n.mutate({trans:St,type:"put",keys:_o,values:_i}).then((function(j){return applyMutateResult(_i.length,j)}))})).then((function(){return ga.length>0&&_n.mutate({trans:St,type:"delete",keys:ga}).then((function(j){return applyMutateResult(ga.length,j)}))})).then((function(){return j.length>_e+_t&&nextChunk(_e+Di)}))}))};return nextChunk(0).then((function(){if(_o.length>0)throw new ModifyError("Error modifying one or more objects",_o,ga,_a);return j.length}))}))}))},Collection.prototype.delete=function(){var j=this._ctx,_e=j.range;return isPlainKeyRange(j)&&(j.isPrimKey&&!nE||3===_e.type)?this._write((function(_t){var St=j.table.core.schema.primaryKey,Tt=_e;return j.table.core.count({trans:_t,query:{index:St,range:Tt}}).then((function(_e){return j.table.core.mutate({trans:_t,type:"deleteRange",range:Tt}).then((function(j){var _t=j.failures,St=(j.lastResult,j.results,j.numFailures);if(St)throw new ModifyError("Could not delete some values",Object.keys(_t).map((function(j){return _t[j]})),_e-St);return _e-St}))}))})):this.modify((function(j,_e){return _e.value=null}))},Collection}();function simpleCompare(j,_e){return j<_e?-1:j===_e?0:1}function simpleCompareReverse(j,_e){return j>_e?-1:j===_e?0:1}function fail(j,_e,_t){var St=j instanceof lE?new j.Collection(j):j;return St._ctx.error=_t?new _t(_e):new TypeError(_e),St}function emptyCollection(j){return new j.Collection(j,(function(){return rangeEqual("")})).limit(0)}function nextCasing(j,_e,_t,St,Tt,Ut){for(var _r=Math.min(j.length,St.length),_n=-1,_i=0;_i<_r;++_i){var Ei=_e[_i];if(Ei!==St[_i])return Tt(j[_i],_t[_i])<0?j.substr(0,_i)+_t[_i]+_t.substr(_i+1):Tt(j[_i],St[_i])<0?j.substr(0,_i)+St[_i]+_t.substr(_i+1):_n>=0?j.substr(0,_n)+_e[_n]+_t.substr(_n+1):null;Tt(j[_i],Ei)<0&&(_n=_i)}return _r<St.length&&"next"===Ut?j+_t.substr(j.length):_r<j.length&&"prev"===Ut?j.substr(0,_t.length):_n<0?null:j.substr(0,_n)+St[_n]+_t.substr(_n+1)}function addIgnoreCaseAlgorithm(j,_e,_t,St){var Tt,Ut,_r,_n,_i,Ei,Ci,Di=_t.length;if(!_t.every((function(j){return"string"==typeof j})))return fail(j,Mb);function initDirection(j){Tt=function upperFactory(j){return"next"===j?function(j){return j.toUpperCase()}:function(j){return j.toLowerCase()}}(j),Ut=function lowerFactory(j){return"next"===j?function(j){return j.toLowerCase()}:function(j){return j.toUpperCase()}}(j),_r="next"===j?simpleCompare:simpleCompareReverse;var _e=_t.map((function(j){return{lower:Ut(j),upper:Tt(j)}})).sort((function(j,_e){return _r(j.lower,_e.lower)}));_n=_e.map((function(j){return j.upper})),_i=_e.map((function(j){return j.lower})),Ei=j,Ci="next"===j?"":St}initDirection("next");var Fi=new j.Collection(j,(function(){return createRange(_n[0],_i[Di-1]+St)}));Fi._ondirectionchange=function(j){initDirection(j)};var _o=0;return Fi._addAlgorithm((function(j,_t,St){var Tt=j.key;if("string"!=typeof Tt)return!1;var Fi=Ut(Tt);if(_e(Fi,_i,_o))return!0;for(var ga=null,_a=_o;_a<Di;++_a){var _s=nextCasing(Tt,Fi,_n[_a],_i[_a],_r,Ei);null===_s&&null===ga?_o=_a+1:(null===ga||_r(ga,_s)>0)&&(ga=_s)}return _t(null!==ga?function(){j.continue(ga+Ci)}:St),!1})),Fi}function createRange(j,_e,_t,St){return{type:2,lower:j,upper:_e,lowerOpen:_t,upperOpen:St}}function rangeEqual(j){return{type:1,lower:j,upper:j}}var lE=function(){function WhereClause(){}return Object.defineProperty(WhereClause.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),WhereClause.prototype.between=function(j,_e,_t,St){_t=!1!==_t,St=!0===St;try{return this._cmp(j,_e)>0||0===this._cmp(j,_e)&&(_t||St)&&(!_t||!St)?emptyCollection(this):new this.Collection(this,(function(){return createRange(j,_e,!_t,!St)}))}catch(j){return fail(this,Lb)}},WhereClause.prototype.equals=function(j){return null==j?fail(this,Lb):new this.Collection(this,(function(){return rangeEqual(j)}))},WhereClause.prototype.above=function(j){return null==j?fail(this,Lb):new this.Collection(this,(function(){return createRange(j,void 0,!0)}))},WhereClause.prototype.aboveOrEqual=function(j){return null==j?fail(this,Lb):new this.Collection(this,(function(){return createRange(j,void 0,!1)}))},WhereClause.prototype.below=function(j){return null==j?fail(this,Lb):new this.Collection(this,(function(){return createRange(void 0,j,!1,!0)}))},WhereClause.prototype.belowOrEqual=function(j){return null==j?fail(this,Lb):new this.Collection(this,(function(){return createRange(void 0,j)}))},WhereClause.prototype.startsWith=function(j){return"string"!=typeof j?fail(this,Mb):this.between(j,j+Z_,!0,!0)},WhereClause.prototype.startsWithIgnoreCase=function(j){return""===j?this.startsWith(j):addIgnoreCaseAlgorithm(this,(function(j,_e){return 0===j.indexOf(_e[0])}),[j],Z_)},WhereClause.prototype.equalsIgnoreCase=function(j){return addIgnoreCaseAlgorithm(this,(function(j,_e){return j===_e[0]}),[j],"")},WhereClause.prototype.anyOfIgnoreCase=function(){var j=getArrayOf.apply(e_,arguments);return 0===j.length?emptyCollection(this):addIgnoreCaseAlgorithm(this,(function(j,_e){return-1!==_e.indexOf(j)}),j,"")},WhereClause.prototype.startsWithAnyOfIgnoreCase=function(){var j=getArrayOf.apply(e_,arguments);return 0===j.length?emptyCollection(this):addIgnoreCaseAlgorithm(this,(function(j,_e){return _e.some((function(_e){return 0===j.indexOf(_e)}))}),j,Z_)},WhereClause.prototype.anyOf=function(){var j=this,_e=getArrayOf.apply(e_,arguments),_t=this._cmp;try{_e.sort(_t)}catch(j){return fail(this,Lb)}if(0===_e.length)return emptyCollection(this);var St=new this.Collection(this,(function(){return createRange(_e[0],_e[_e.length-1])}));St._ondirectionchange=function(St){_t="next"===St?j._ascending:j._descending,_e.sort(_t)};var Tt=0;return St._addAlgorithm((function(j,St,Ut){for(var _r=j.key;_t(_r,_e[Tt])>0;)if(++Tt===_e.length)return St(Ut),!1;return 0===_t(_r,_e[Tt])||(St((function(){j.continue(_e[Tt])})),!1)})),St},WhereClause.prototype.notEqual=function(j){return this.inAnyRange([[$_,j],[j,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},WhereClause.prototype.noneOf=function(){var j=getArrayOf.apply(e_,arguments);if(0===j.length)return new this.Collection(this);try{j.sort(this._ascending)}catch(j){return fail(this,Lb)}var _e=j.reduce((function(j,_e){return j?j.concat([[j[j.length-1][1],_e]]):[[$_,_e]]}),null);return _e.push([j[j.length-1],this.db._maxKey]),this.inAnyRange(_e,{includeLowers:!1,includeUppers:!1})},WhereClause.prototype.inAnyRange=function(j,_e){var _t=this,St=this._cmp,Tt=this._ascending,Ut=this._descending,_r=this._min,_n=this._max;if(0===j.length)return emptyCollection(this);if(!j.every((function(j){return void 0!==j[0]&&void 0!==j[1]&&Tt(j[0],j[1])<=0})))return fail(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",d_.InvalidArgument);var _i=!_e||!1!==_e.includeLowers,Ei=_e&&!0===_e.includeUppers;var Ci,Di=Tt;function rangeSorter(j,_e){return Di(j[0],_e[0])}try{Ci=j.reduce((function addRange(j,_e){for(var _t=0,Tt=j.length;_t<Tt;++_t){var Ut=j[_t];if(St(_e[0],Ut[1])<0&&St(_e[1],Ut[0])>0){Ut[0]=_r(Ut[0],_e[0]),Ut[1]=_n(Ut[1],_e[1]);break}}return _t===Tt&&j.push(_e),j}),[]),Ci.sort(rangeSorter)}catch(j){return fail(this,Lb)}var Fi=0,_o=Ei?function(j){return Tt(j,Ci[Fi][1])>0}:function(j){return Tt(j,Ci[Fi][1])>=0},ga=_i?function(j){return Ut(j,Ci[Fi][0])>0}:function(j){return Ut(j,Ci[Fi][0])>=0};var _a=_o,_s=new this.Collection(this,(function(){return createRange(Ci[0][0],Ci[Ci.length-1][1],!_i,!Ei)}));return _s._ondirectionchange=function(j){"next"===j?(_a=_o,Di=Tt):(_a=ga,Di=Ut),Ci.sort(rangeSorter)},_s._addAlgorithm((function(j,_e,St){for(var Ut=j.key;_a(Ut);)if(++Fi===Ci.length)return _e(St),!1;return!!function keyWithinCurrentRange(j){return!_o(j)&&!ga(j)}(Ut)||(0===_t._cmp(Ut,Ci[Fi][1])||0===_t._cmp(Ut,Ci[Fi][0])||_e((function(){Di===Tt?j.continue(Ci[Fi][0]):j.continue(Ci[Fi][1])})),!1)})),_s},WhereClause.prototype.startsWithAnyOf=function(){var j=getArrayOf.apply(e_,arguments);return j.every((function(j){return"string"==typeof j}))?0===j.length?emptyCollection(this):this.inAnyRange(j.map((function(j){return[j,j+Z_]}))):fail(this,"startsWithAnyOf() only works with strings")},WhereClause}();function safariMultiStoreFix(j){return 1===j.length?j[0]:j}function getMaxKey(j){try{return j.only([[]]),[[]]}catch(j){return Z_}}function eventRejectHandler(j){return wrap((function(_e){return preventDefault(_e),j(_e.target.error),!1}))}function preventDefault(j){j.stopPropagation&&j.stopPropagation(),j.preventDefault&&j.preventDefault()}var hE=function(){function Transaction(){}return Transaction.prototype._lock=function(){return assert(!P_.global),++this._reculock,1!==this._reculock||P_.global||(P_.lockOwnerFor=this),this},Transaction.prototype._unlock=function(){if(assert(!P_.global),0==--this._reculock)for(P_.global||(P_.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var j=this._blockedFuncs.shift();try{usePSD(j[1],j[0])}catch(j){}}return this},Transaction.prototype._locked=function(){return this._reculock&&P_.lockOwnerFor!==this},Transaction.prototype.create=function(j){var _e=this;if(!this.mode)return this;var _t=this.db.idbdb,St=this.db._state.dbOpenError;if(assert(!this.idbtrans),!j&&!_t)switch(St&&St.name){case"DatabaseClosedError":throw new d_.DatabaseClosed(St);case"MissingAPIError":throw new d_.MissingAPI(St.message,St);default:throw new d_.OpenFailed(St)}if(!this.active)throw new d_.TransactionInactive;return assert(null===this._completion._state),(j=this.idbtrans=j||_t.transaction(safariMultiStoreFix(this.storeNames),this.mode)).onerror=wrap((function(_t){preventDefault(_t),_e._reject(j.error)})),j.onabort=wrap((function(_t){preventDefault(_t),_e.active&&_e._reject(new d_.Abort(j.error)),_e.active=!1,_e.on("abort").fire(_t)})),j.oncomplete=wrap((function(){_e.active=!1,_e._resolve()})),this},Transaction.prototype._promise=function(j,_e,_t){var St=this;if("readwrite"===j&&"readwrite"!==this.mode)return J_(new d_.ReadOnly("Transaction is readonly"));if(!this.active)return J_(new d_.TransactionInactive);if(this._locked())return new DexiePromise((function(Tt,Ut){St._blockedFuncs.push([function(){St._promise(j,_e,_t).then(Tt,Ut)},P_])}));if(_t)return newScope((function(){var j=new DexiePromise((function(j,_t){St._lock();var Tt=_e(j,_t,St);Tt&&Tt.then&&Tt.then(j,_t)}));return j.finally((function(){return St._unlock()})),j._lib=!0,j}));var Tt=new DexiePromise((function(j,_t){var Tt=_e(j,_t,St);Tt&&Tt.then&&Tt.then(j,_t)}));return Tt._lib=!0,Tt},Transaction.prototype._root=function(){return this.parent?this.parent._root():this},Transaction.prototype.waitFor=function(j){var _e=this._root(),_t=DexiePromise.resolve(j);if(_e._waitingFor)_e._waitingFor=_e._waitingFor.then((function(){return _t}));else{_e._waitingFor=_t,_e._waitingQueue=[];var St=_e.idbtrans.objectStore(_e.storeNames[0]);!function spin(){for(++_e._spinCount;_e._waitingQueue.length;)_e._waitingQueue.shift()();_e._waitingFor&&(St.get(-1/0).onsuccess=spin)}()}var Tt=_e._waitingFor;return new DexiePromise((function(j,St){_t.then((function(_t){return _e._waitingQueue.push(wrap(j.bind(null,_t)))}),(function(j){return _e._waitingQueue.push(wrap(St.bind(null,j)))})).finally((function(){_e._waitingFor===Tt&&(_e._waitingFor=null)}))}))},Transaction.prototype.abort=function(){this.active&&this._reject(new d_.Abort),this.active=!1},Transaction.prototype.table=function(j){var _e=this._memoizedTables||(this._memoizedTables={});if(hasOwn(_e,j))return _e[j];var _t=this.schema[j];if(!_t)throw new d_.NotFound("Table "+j+" not part of transaction");var St=new this.db.Table(j,_t,this);return St.core=this.db.core.table(j),_e[j]=St,St},Transaction}();function createIndexSpec(j,_e,_t,St,Tt,Ut,_r){return{name:j,keyPath:_e,unique:_t,multi:St,auto:Tt,compound:Ut,src:(_t&&!_r?"&":"")+(St?"*":"")+(Tt?"++":"")+nameFromKeyPath(_e)}}function nameFromKeyPath(j){return"string"==typeof j?j:j?"["+[].join.call(j,"+")+"]":""}function createTableSchema(j,_e,_t){return{name:j,primKey:_e,indexes:_t,mappedClass:null,idxByName:arrayToObject(_t,(function(j){return[j.name,j]}))}}function getKeyExtractor(j){return null==j?function(){}:"string"==typeof j?function getSinglePathKeyExtractor(j){var _e=j.split(".");return 1===_e.length?function(_e){return _e[j]}:function(_e){return getByKeyPath(_e,j)}}(j):function(_e){return getByKeyPath(_e,j)}}function getEffectiveKeys(j,_e){return"delete"===_e.type?_e.keys:_e.keys||_e.values.map(j.extractKey)}function arrayify(j){return[].slice.call(j)}var fE=0;function getKeyPathAlias(j){return null==j?":id":"string"==typeof j?j:"["+j.join("+")+"]"}function createDBCore(j,_e,_t,St){var Tt=_e.cmp.bind(_e);function makeIDBKeyRange(j){if(3===j.type)return null;if(4===j.type)throw new Error("Cannot convert never type to IDBKeyRange");var _e=j.lower,St=j.upper,Tt=j.lowerOpen,Ut=j.upperOpen;return void 0===_e?void 0===St?null:_t.upperBound(St,!!Ut):void 0===St?_t.lowerBound(_e,!!Tt):_t.bound(_e,St,!!Tt,!!Ut)}var Ut=function extractSchema(j,_e){var _t=arrayify(j.objectStoreNames);return{schema:{name:j.name,tables:_t.map((function(j){return _e.objectStore(j)})).map((function(j){var _e=j.keyPath,_t=j.autoIncrement,St=_c(_e),Tt=null==_e,Ut={},_r={name:j.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:Tt,compound:St,keyPath:_e,autoIncrement:_t,unique:!0,extractKey:getKeyExtractor(_e)},indexes:arrayify(j.indexNames).map((function(_e){return j.index(_e)})).map((function(j){var _e=j.name,_t=j.unique,St=j.multiEntry,Tt=j.keyPath,_r={name:_e,compound:_c(Tt),keyPath:Tt,unique:_t,multiEntry:St,extractKey:getKeyExtractor(Tt)};return Ut[getKeyPathAlias(Tt)]=_r,_r})),getIndexByKeyPath:function(j){return Ut[getKeyPathAlias(j)]}};return Ut[":id"]=_r.primaryKey,null!=_e&&(Ut[getKeyPathAlias(_e)]=_r.primaryKey),_r}))},hasGetAll:_t.length>0&&"getAll"in _e.objectStore(_t[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(j,St),_r=Ut.schema,_n=Ut.hasGetAll,_i=_r.tables.map((function(j){return function createDbCoreTable(j){var _e=j.name;return{name:_e,schema:j,mutate:function mutate(_t){var St=_t.trans,Tt=_t.type,Ut=_t.keys,_r=_t.values,_n=_t.range,_i=_t.wantResults;return new Promise((function(_t,Ei){_t=wrap(_t);var Ci=St.objectStore(_e),Di=null==Ci.keyPath,Fi="put"===Tt||"add"===Tt;if(!Fi&&"delete"!==Tt&&"deleteRange"!==Tt)throw new Error("Invalid operation type: "+Tt);var _o=(Ut||_r||{length:1}).length;if(Ut&&_r&&Ut.length!==_r.length)throw new Error("Given keys array must have same length as given values array.");if(0===_o)return _t({numFailures:0,failures:{},results:[],lastResult:void 0});var ga,_a=_i&&__spreadArrays(Ut||getEffectiveKeys(j.primaryKey,{type:Tt,keys:Ut,values:_r})),_s=[],_c=0,errorHandler=function(j){++_c,preventDefault(j),_a&&(_a[j.target._reqno]=void 0),_s[j.target._reqno]=j.target.error},setResult=function(j){var _e=j.target;_a[_e._reqno]=_e.result};if("deleteRange"===Tt){if(4===_n.type)return _t({numFailures:_c,failures:_s,results:_a,lastResult:void 0});ga=3===_n.type?Ci.clear():Ci.delete(makeIDBKeyRange(_n))}else{var kc=Fi?Di?[_r,Ut]:[_r,null]:[Ut,null],_u=kc[0],_l=kc[1];if(Fi)for(var _d=0;_d<_o;++_d)(ga=_l&&void 0!==_l[_d]?Ci[Tt](_u[_d],_l[_d]):Ci[Tt](_u[_d]))._reqno=_d,_a&&void 0===_a[_d]&&(ga.onsuccess=setResult),ga.onerror=errorHandler;else for(_d=0;_d<_o;++_d)(ga=Ci[Tt](_u[_d]))._reqno=_d,ga.onerror=errorHandler}var done=function(j){var _e=j.target.result;_a&&(_a[_o-1]=_e),_t({numFailures:_c,failures:_s,results:_a,lastResult:_e})};ga.onerror=function(j){errorHandler(j),done(j)},ga.onsuccess=done}))},getMany:function(j){var _t=j.trans,St=j.keys;return new Promise((function(j,Tt){j=wrap(j);for(var Ut,_r=_t.objectStore(_e),_n=St.length,_i=new Array(_n),Ei=0,Ci=0,successHandler=function(_e){var _t=_e.target;_i[_t._pos]=_t.result,++Ci===Ei&&j(_i)},Di=eventRejectHandler(Tt),Fi=0;Fi<_n;++Fi)null!=St[Fi]&&((Ut=_r.get(St[Fi]))._pos=Fi,Ut.onsuccess=successHandler,Ut.onerror=Di,++Ei);0===Ei&&j(_i)}))},get:function(j){var _t=j.trans,St=j.key;return new Promise((function(j,Tt){j=wrap(j);var Ut=_t.objectStore(_e).get(St);Ut.onsuccess=function(_e){return j(_e.target.result)},Ut.onerror=eventRejectHandler(Tt)}))},query:function query(j){return function(_t){return new Promise((function(St,Tt){St=wrap(St);var Ut=_t.trans,_r=_t.values,_n=_t.limit,_i=_t.query,Ei=_n===1/0?void 0:_n,Ci=_i.index,Di=_i.range,Fi=Ut.objectStore(_e),_o=Ci.isPrimaryKey?Fi:Fi.index(Ci.name),ga=makeIDBKeyRange(Di);if(0===_n)return St({result:[]});if(j){var _a=_r?_o.getAll(ga,Ei):_o.getAllKeys(ga,Ei);_a.onsuccess=function(j){return St({result:j.target.result})},_a.onerror=eventRejectHandler(Tt)}else{var _s=0,_c=_r||!("openKeyCursor"in _o)?_o.openCursor(ga):_o.openKeyCursor(ga),kc=[];_c.onsuccess=function(j){var _e=_c.result;return _e?(kc.push(_r?_e.value:_e.primaryKey),++_s===_n?St({result:kc}):void _e.continue()):St({result:kc})},_c.onerror=eventRejectHandler(Tt)}}))}}(_n),openCursor:function openCursor(j){var _t=j.trans,St=j.values,Tt=j.query,Ut=j.reverse,_r=j.unique;return new Promise((function(j,_n){j=wrap(j);var _i=Tt.index,Ei=Tt.range,Ci=_t.objectStore(_e),Di=_i.isPrimaryKey?Ci:Ci.index(_i.name),Fi=Ut?_r?"prevunique":"prev":_r?"nextunique":"next",_o=St||!("openKeyCursor"in Di)?Di.openCursor(makeIDBKeyRange(Ei),Fi):Di.openKeyCursor(makeIDBKeyRange(Ei),Fi);_o.onerror=eventRejectHandler(_n),_o.onsuccess=wrap((function(_e){var St=_o.result;if(St){St.___id=++fE,St.done=!1;var Tt=St.continue.bind(St),Ut=St.continuePrimaryKey;Ut&&(Ut=Ut.bind(St));var _r=St.advance.bind(St),doThrowCursorIsStopped=function(){throw new Error("Cursor not stopped")};St.trans=_t,St.stop=St.continue=St.continuePrimaryKey=St.advance=function(){throw new Error("Cursor not started")},St.fail=wrap(_n),St.next=function(){var j=this,_e=1;return this.start((function(){return _e--?j.continue():j.stop()})).then((function(){return j}))},St.start=function(j){var _e=new Promise((function(j,_e){j=wrap(j),_o.onerror=eventRejectHandler(_e),St.fail=_e,St.stop=function(_e){St.stop=St.continue=St.continuePrimaryKey=St.advance=doThrowCursorIsStopped,j(_e)}})),guardedCallback=function(){if(_o.result)try{j()}catch(j){St.fail(j)}else St.done=!0,St.start=function(){throw new Error("Cursor behind last entry")},St.stop()};return _o.onsuccess=wrap((function(j){_o.onsuccess=guardedCallback,guardedCallback()})),St.continue=Tt,St.continuePrimaryKey=Ut,St.advance=_r,guardedCallback(),_e},j(St)}else j(null)}),_n)}))},count:function(j){var _t=j.query,St=j.trans,Tt=_t.index,Ut=_t.range;return new Promise((function(j,_t){var _r=St.objectStore(_e),_n=Tt.isPrimaryKey?_r:_r.index(Tt.name),_i=makeIDBKeyRange(Ut),Ei=_i?_n.count(_i):_n.count();Ei.onsuccess=wrap((function(_e){return j(_e.target.result)})),Ei.onerror=eventRejectHandler(_t)}))}}}(j)})),Ei={};return _i.forEach((function(j){return Ei[j.name]=j})),{stack:"dbcore",transaction:j.transaction.bind(j),table:function(j){if(!Ei[j])throw new Error("Table '"+j+"' not found");return Ei[j]},cmp:Tt,MIN_KEY:-1/0,MAX_KEY:getMaxKey(_t),schema:_r}}function createMiddlewareStacks(j,_e,_t,St){var Tt=_t.IDBKeyRange,Ut=function createMiddlewareStack(j,_e){return _e.reduce((function(j,_e){var _t=_e.create;return __assign(__assign({},j),_t(j))}),j)}(createDBCore(_e,_t.indexedDB,Tt,St),j.dbcore);return{dbcore:Ut}}function generateMiddlewareStacks(j,_e){var _t=_e.db,St=createMiddlewareStacks(j._middlewares,_t,j._deps,_e);j.core=St.dbcore,j.tables.forEach((function(_e){var _t=_e.name;j.core.schema.tables.some((function(j){return j.name===_t}))&&(_e.core=j.core.table(_t),j[_t]instanceof j.Table&&(j[_t].core=_e.core))}))}function setApiOnPlace(j,_e,_t,St){_t.forEach((function(_t){var Tt=St[_t];_e.forEach((function(_e){var St=getPropertyDescriptor(_e,_t);(!St||"value"in St&&void 0===St.value)&&(_e===j.Transaction.prototype||_e instanceof j.Transaction?setProp(_e,_t,{get:function(){return this.table(_t)},set:function(j){_d(this,_t,{value:j,writable:!0,configurable:!0,enumerable:!0})}}):_e[_t]=new j.Table(_t,Tt))}))}))}function removeTablesApi(j,_e){_e.forEach((function(_e){for(var _t in _e)_e[_t]instanceof j.Table&&delete _e[_t]}))}function lowerVersionFirst(j,_e){return j._cfg.version-_e._cfg.version}function runUpgraders(j,_e,_t,St){var Tt=j._dbSchema,Ut=j._createTransaction("readwrite",j._storeNames,Tt);Ut.create(_t),Ut._completion.catch(St);var _r=Ut._reject.bind(Ut),_n=P_.transless||P_;newScope((function(){P_.trans=Ut,P_.transless=_n,0===_e?(_s(Tt).forEach((function(j){createTable(_t,j,Tt[j].primKey,Tt[j].indexes)})),generateMiddlewareStacks(j,_t),DexiePromise.follow((function(){return j.on.populate.fire(Ut)})).catch(_r)):function updateTablesAndIndexes(j,_e,_t,St){var Tt=[],Ut=j._versions,_r=j._dbSchema=buildGlobalSchema(j,j.idbdb,St),_n=!1,_i=Ut.filter((function(j){return j._cfg.version>=_e}));function runQueue(){return Tt.length?DexiePromise.resolve(Tt.shift()(_t.idbtrans)).then(runQueue):DexiePromise.resolve()}return _i.forEach((function(Ut){Tt.push((function(){var Tt=_r,_i=Ut._cfg.dbschema;adjustToExistingIndexNames(j,Tt,St),adjustToExistingIndexNames(j,_i,St),_r=j._dbSchema=_i;var Ei=getSchemaDiff(Tt,_i);Ei.add.forEach((function(j){createTable(St,j[0],j[1].primKey,j[1].indexes)})),Ei.change.forEach((function(j){if(j.recreate)throw new d_.Upgrade("Not yet support for changing primary key");var _e=St.objectStore(j.name);j.add.forEach((function(j){return addIndex(_e,j)})),j.change.forEach((function(j){_e.deleteIndex(j.name),addIndex(_e,j)})),j.del.forEach((function(j){return _e.deleteIndex(j)}))}));var Ci=Ut._cfg.contentUpgrade;if(Ci&&Ut._cfg.version>_e){generateMiddlewareStacks(j,St),_t._memoizedTables={},_n=!0;var Di=shallowClone(_i);Ei.del.forEach((function(j){Di[j]=Tt[j]})),removeTablesApi(j,[j.Transaction.prototype]),setApiOnPlace(j,[j.Transaction.prototype],_s(Di),Di),_t.schema=Di;var Fi,_o=t_(Ci);_o&&incrementExpectedAwaits();var ga=DexiePromise.follow((function(){if((Fi=Ci(_t))&&_o){var j=decrementExpectedAwaits.bind(null,null);Fi.then(j,j)}}));return Fi&&"function"==typeof Fi.then?DexiePromise.resolve(Fi):ga.then((function(){return Fi}))}})),Tt.push((function(_e){_n&&rE||function deleteRemovedTables(j,_e){for(var _t=0;_t<_e.db.objectStoreNames.length;++_t){var St=_e.db.objectStoreNames[_t];null==j[St]&&_e.db.deleteObjectStore(St)}}(Ut._cfg.dbschema,_e);removeTablesApi(j,[j.Transaction.prototype]),setApiOnPlace(j,[j.Transaction.prototype],j._storeNames,j._dbSchema),_t.schema=j._dbSchema}))})),runQueue().then((function(){!function createMissingTables(j,_e){_s(j).forEach((function(_t){_e.db.objectStoreNames.contains(_t)||createTable(_e,_t,j[_t].primKey,j[_t].indexes)}))}(_r,St)}))}(j,_e,Ut,_t).catch(_r)}))}function getSchemaDiff(j,_e){var _t,St={del:[],add:[],change:[]};for(_t in j)_e[_t]||St.del.push(_t);for(_t in _e){var Tt=j[_t],Ut=_e[_t];if(Tt){var _r={name:_t,def:Ut,recreate:!1,del:[],add:[],change:[]};if(""+(Tt.primKey.keyPath||"")!=""+(Ut.primKey.keyPath||"")||Tt.primKey.auto!==Ut.primKey.auto&&!tE)_r.recreate=!0,St.change.push(_r);else{var _n=Tt.idxByName,_i=Ut.idxByName,Ei=void 0;for(Ei in _n)_i[Ei]||_r.del.push(Ei);for(Ei in _i){var Ci=_n[Ei],Di=_i[Ei];Ci?Ci.src!==Di.src&&_r.change.push(Di):_r.add.push(Di)}(_r.del.length>0||_r.add.length>0||_r.change.length>0)&&St.change.push(_r)}}else St.add.push([_t,Ut])}return St}function createTable(j,_e,_t,St){var Tt=j.db.createObjectStore(_e,_t.keyPath?{keyPath:_t.keyPath,autoIncrement:_t.auto}:{autoIncrement:_t.auto});return St.forEach((function(j){return addIndex(Tt,j)})),Tt}function addIndex(j,_e){j.createIndex(_e.name,_e.keyPath,{unique:_e.unique,multiEntry:_e.multi})}function buildGlobalSchema(j,_e,_t){var St={};return slice(_e.objectStoreNames,0).forEach((function(j){for(var _e=_t.objectStore(j),Tt=_e.keyPath,Ut=createIndexSpec(nameFromKeyPath(Tt),Tt||"",!1,!1,!!_e.autoIncrement,Tt&&"string"!=typeof Tt,!0),_r=[],_n=0;_n<_e.indexNames.length;++_n){var _i=_e.index(_e.indexNames[_n]);Tt=_i.keyPath;var Ei=createIndexSpec(_i.name,Tt,!!_i.unique,!!_i.multiEntry,!1,Tt&&"string"!=typeof Tt,!1);_r.push(Ei)}St[j]=createTableSchema(j,Ut,_r)})),St}function adjustToExistingIndexNames(j,_e,_t){for(var St=_t.db.objectStoreNames,Tt=0;Tt<St.length;++Tt){var Ut=St[Tt],_r=_t.objectStore(Ut);j._hasGetAll="getAll"in _r;for(var _n=0;_n<_r.indexNames.length;++_n){var _i=_r.indexNames[_n],Ei=_r.index(_i).keyPath,Ci="string"==typeof Ei?Ei:"["+slice(Ei).join("+")+"]";if(_e[Ut]){var Di=_e[Ut].idxByName[Ci];Di&&(Di.name=_i,delete _e[Ut].idxByName[Ci],_e[Ut].idxByName[_i]=Di)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&kc.WorkerGlobalScope&&kc instanceof kc.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(j._hasGetAll=!1)}var pE,vE=function(){function Version(){}return Version.prototype._parseStoresSpec=function(j,_e){_s(j).forEach((function(_t){if(null!==j[_t]){var St=function parseIndexSyntax(j){return j.split(",").map((function(j,_e){var _t=(j=j.trim()).replace(/([&*]|\+\+)/g,""),St=/^\[/.test(_t)?_t.match(/^\[(.*)\]$/)[1].split("+"):_t;return createIndexSpec(_t,St||null,/\&/.test(j),/\*/.test(j),/\+\+/.test(j),_c(St),0===_e)}))}(j[_t]),Tt=St.shift();if(Tt.multi)throw new d_.Schema("Primary key cannot be multi-valued");St.forEach((function(j){if(j.auto)throw new d_.Schema("Only primary key can be marked as autoIncrement (++)");if(!j.keyPath)throw new d_.Schema("Index must have a name and cannot be an empty string")})),_e[_t]=createTableSchema(_t,Tt,St)}}))},Version.prototype.stores=function(j){var _e=this.db;this._cfg.storesSource=this._cfg.storesSource?extend(this._cfg.storesSource,j):j;var _t=_e._versions,St={},Tt={};return _t.forEach((function(j){extend(St,j._cfg.storesSource),Tt=j._cfg.dbschema={},j._parseStoresSpec(St,Tt)})),_e._dbSchema=Tt,removeTablesApi(_e,[_e._allTables,_e,_e.Transaction.prototype]),setApiOnPlace(_e,[_e._allTables,_e,_e.Transaction.prototype,this._cfg.tables],_s(Tt),Tt),_e._storeNames=_s(Tt),this},Version.prototype.upgrade=function(j){return this._cfg.contentUpgrade=j,this},Version}();function vip(j){return newScope((function(){return P_.letThrough=!0,j()}))}function dexieOpen(j){var _e=j._state,_t=j._deps.indexedDB;if(_e.isBeingOpened||j.idbdb)return _e.dbReadyPromise.then((function(){return _e.dbOpenError?J_(_e.dbOpenError):j}));r_&&(_e.openCanceller._stackHolder=getErrorWithStack()),_e.isBeingOpened=!0,_e.dbOpenError=null,_e.openComplete=!1;var St=_e.dbReadyResolve,Tt=null;return DexiePromise.race([_e.openCanceller,new DexiePromise((function(St,Ut){if(!_t)throw new d_.MissingAPI("indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using old Safari versions, make sure to include indexedDB polyfill.");var _r=j.name,_n=_e.autoSchema?_t.open(_r):_t.open(_r,Math.round(10*j.verno));if(!_n)throw new d_.MissingAPI("IndexedDB API not available");_n.onerror=eventRejectHandler(Ut),_n.onblocked=wrap(j._fireOnBlocked),_n.onupgradeneeded=wrap((function(St){if(Tt=_n.transaction,_e.autoSchema&&!j._options.allowEmptyDB){_n.onerror=preventDefault,Tt.abort(),_n.result.close();var _i=_t.deleteDatabase(_r);_i.onsuccess=_i.onerror=wrap((function(){Ut(new d_.NoSuchDatabase("Database "+_r+" doesnt exist"))}))}else{Tt.onerror=eventRejectHandler(Ut);var Ei=St.oldVersion>Math.pow(2,62)?0:St.oldVersion;j.idbdb=_n.result,runUpgraders(j,Ei/10,Tt,Ut)}}),Ut),_n.onsuccess=wrap((function(){Tt=null;var _t=j.idbdb=_n.result,Ut=slice(_t.objectStoreNames);if(Ut.length>0)try{var _i=_t.transaction(safariMultiStoreFix(Ut),"readonly");_e.autoSchema?function readGlobalSchema(j,_e,_t){j.verno=_e.version/10;var St=j._dbSchema=buildGlobalSchema(0,_e,_t);j._storeNames=slice(_e.objectStoreNames,0),setApiOnPlace(j,[j._allTables],_s(St),St)}(j,_t,_i):(adjustToExistingIndexNames(j,j._dbSchema,_i),function verifyInstalledSchema(j,_e){var _t=getSchemaDiff(buildGlobalSchema(0,j.idbdb,_e),j._dbSchema);return!(_t.add.length||_t.change.some((function(j){return j.add.length||j.change.length})))}(j,_i)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),generateMiddlewareStacks(j,_i)}catch(j){}eE.push(j),_t.onversionchange=wrap((function(_t){_e.vcFired=!0,j.on("versionchange").fire(_t)})),pE.add(_r),St()}),Ut)}))]).then((function(){return _e.onReadyBeingFired=[],DexiePromise.resolve(vip(j.on.ready.fire)).then((function fireRemainders(){if(_e.onReadyBeingFired.length>0){var j=_e.onReadyBeingFired.reduce(promisableChain,nop);return _e.onReadyBeingFired=[],DexiePromise.resolve(vip(j)).then(fireRemainders)}}))})).finally((function(){_e.onReadyBeingFired=null})).then((function(){return _e.isBeingOpened=!1,j})).catch((function(_t){try{Tt&&Tt.abort()}catch(j){}return _e.isBeingOpened=!1,j.close(),_e.dbOpenError=_t,J_(_e.dbOpenError)})).finally((function(){_e.openComplete=!0,St()}))}function awaitIterator(j){var callNext=function(_e){return j.next(_e)},_e=step(callNext),_t=step((function(_e){return j.throw(_e)}));function step(j){return function(St){var Tt=j(St),Ut=Tt.value;return Tt.done?Ut:Ut&&"function"==typeof Ut.then?Ut.then(_e,_t):_c(Ut)?Promise.all(Ut).then(_e,_t):_e(Ut)}}return step(callNext)()}function extractTransactionArgs(j,_e,_t){var St=arguments.length;if(St<2)throw new d_.InvalidArgument("Too few arguments");for(var Tt=new Array(St-1);--St;)Tt[St-1]=arguments[St];_t=Tt.pop();var Ut=flatten(Tt);return[j,Ut,_t]}function enterTransactionScope(j,_e,_t,St,Tt){return DexiePromise.resolve().then((function(){var Ut=P_.transless||P_,_r=j._createTransaction(_e,_t,j._dbSchema,St),_n={trans:_r,transless:Ut};St?_r.idbtrans=St.idbtrans:_r.create();var _i,Ei=t_(Tt);Ei&&incrementExpectedAwaits();var Ci=DexiePromise.follow((function(){if(_i=Tt.call(_r,_r))if(Ei){var j=decrementExpectedAwaits.bind(null,null);_i.then(j,j)}else"function"==typeof _i.next&&"function"==typeof _i.throw&&(_i=awaitIterator(_i))}),_n);return(_i&&"function"==typeof _i.then?DexiePromise.resolve(_i).then((function(j){return _r.active?j:J_(new d_.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):Ci.then((function(){return _i}))).then((function(j){return St&&_r._resolve(),_r._completion.then((function(){return j}))})).catch((function(j){return _r._reject(j),J_(j)}))}))}function pad(j,_e,_t){for(var St=_c(j)?j.slice():[j],Tt=0;Tt<_t;++Tt)St.push(_e);return St}var yE={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function createVirtualIndexMiddleware(j){return __assign(__assign({},j),{table:function(_e){var _t=j.table(_e),St=_t.schema,Tt={},Ut=[];function addVirtualIndexes(j,_e,_t){var St=getKeyPathAlias(j),_r=Tt[St]=Tt[St]||[],_n=null==j?0:"string"==typeof j?1:j.length,_i=_e>0,Ei=__assign(__assign({},_t),{isVirtual:_i,isPrimaryKey:!_i&&_t.isPrimaryKey,keyTail:_e,keyLength:_n,extractKey:getKeyExtractor(j),unique:!_i&&_t.unique});(_r.push(Ei),Ei.isPrimaryKey||Ut.push(Ei),_n>1)&&addVirtualIndexes(2===_n?j[0]:j.slice(0,_n-1),_e+1,_t);return _r.sort((function(j,_e){return j.keyTail-_e.keyTail})),Ei}var _r=addVirtualIndexes(St.primaryKey.keyPath,0,St.primaryKey);Tt[":id"]=[_r];for(var _n=0,_i=St.indexes;_n<_i.length;_n++){var Ei=_i[_n];addVirtualIndexes(Ei.keyPath,0,Ei)}function translateRequest(_e){var _t,St,Tt=_e.query.index;return Tt.isVirtual?__assign(__assign({},_e),{query:{index:Tt,range:(_t=_e.query.range,St=Tt.keyTail,{type:1===_t.type?2:_t.type,lower:pad(_t.lower,_t.lowerOpen?j.MAX_KEY:j.MIN_KEY,St),lowerOpen:!0,upper:pad(_t.upper,_t.upperOpen?j.MIN_KEY:j.MAX_KEY,St),upperOpen:!0})}}):_e}var Ci=__assign(__assign({},_t),{schema:__assign(__assign({},St),{primaryKey:_r,indexes:Ut,getIndexByKeyPath:function findBestIndex(j){var _e=Tt[getKeyPathAlias(j)];return _e&&_e[0]}}),count:function(j){return _t.count(translateRequest(j))},query:function(j){return _t.query(translateRequest(j))},openCursor:function(_e){var St=_e.query.index,Tt=St.keyTail,Ut=St.isVirtual,_r=St.keyLength;if(!Ut)return _t.openCursor(_e);return _t.openCursor(translateRequest(_e)).then((function(_t){return _t&&function createVirtualCursor(_t){var St=Object.create(_t,{continue:{value:function _continue(St){null!=St?_t.continue(pad(St,_e.reverse?j.MAX_KEY:j.MIN_KEY,Tt)):_e.unique?_t.continue(pad(_t.key,_e.reverse?j.MIN_KEY:j.MAX_KEY,Tt)):_t.continue()}},continuePrimaryKey:{value:function(_e,St){_t.continuePrimaryKey(pad(_e,j.MAX_KEY,Tt),St)}},key:{get:function(){var j=_t.key;return 1===_r?j[0]:j.slice(0,_r)}},value:{get:function(){return _t.value}}});return St}(_t)}))}});return Ci}})}},AE={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(j){return __assign(__assign({},j),{table:function(_e){var _t=j.table(_e),St=_t.schema.primaryKey,Tt=__assign(__assign({},_t),{mutate:function(j){var Tt=P_.trans,Ut=Tt.table(_e).hook,_r=Ut.deleting,_n=Ut.creating,_i=Ut.updating;switch(j.type){case"add":if(_n.fire===nop)break;return Tt._promise("readwrite",(function(){return addPutOrDelete(j)}),!0);case"put":if(_n.fire===nop&&_i.fire===nop)break;return Tt._promise("readwrite",(function(){return addPutOrDelete(j)}),!0);case"delete":if(_r.fire===nop)break;return Tt._promise("readwrite",(function(){return addPutOrDelete(j)}),!0);case"deleteRange":if(_r.fire===nop)break;return Tt._promise("readwrite",(function(){return function deleteRange(j){return deleteNextChunk(j.trans,j.range,1e4)}(j)}),!0)}return _t.mutate(j);function addPutOrDelete(j){var _e=P_.trans,Tt=j.keys||getEffectiveKeys(St,j);if(!Tt)throw new Error("Keys missing");return"delete"!==(j="add"===j.type||"put"===j.type?__assign(__assign({},j),{keys:Tt,wantResults:!0}):__assign({},j)).type&&(j.values=__spreadArrays(j.values)),j.keys&&(j.keys=__spreadArrays(j.keys)),function getExistingValues(j,_e,_t){return"add"===_e.type?Promise.resolve(new Array(_e.values.length)):j.getMany({trans:_e.trans,keys:_t})}(_t,j,Tt).then((function(Ut){var Ei=Tt.map((function(_t,Tt){var Ei=Ut[Tt],Ci={onerror:null,onsuccess:null};if("delete"===j.type)_r.fire.call(Ci,_t,Ei,_e);else if("add"===j.type||void 0===Ei){var Di=_n.fire.call(Ci,_t,j.values[Tt],_e);null==_t&&null!=Di&&(_t=Di,j.keys[Tt]=_t,St.outbound||setByKeyPath(j.values[Tt],St.keyPath,_t))}else{var Fi=getObjectDiff(Ei,j.values[Tt]),_o=_i.fire.call(Ci,Fi,_t,Ei,_e);if(_o){var ga=j.values[Tt];Object.keys(_o).forEach((function(j){hasOwn(ga,j)?ga[j]=_o[j]:setByKeyPath(ga,j,_o[j])}))}}return Ci}));return _t.mutate(j).then((function(_e){for(var _t=_e.failures,St=_e.results,_r=_e.numFailures,_n=_e.lastResult,_i=0;_i<Tt.length;++_i){var Ci=St?St[_i]:Tt[_i],Di=Ei[_i];null==Ci?Di.onerror&&Di.onerror(_t[_i]):Di.onsuccess&&Di.onsuccess("put"===j.type&&Ut[_i]?j.values[_i]:Ci)}return{failures:_t,results:St,numFailures:_r,lastResult:_n}})).catch((function(j){return Ei.forEach((function(_e){return _e.onerror&&_e.onerror(j)})),Promise.reject(j)}))}))}function deleteNextChunk(j,_e,Tt){return _t.query({trans:j,values:!1,query:{index:St,range:_e},limit:Tt}).then((function(_t){var St=_t.result;return addPutOrDelete({type:"delete",keys:St,trans:j}).then((function(_t){return _t.numFailures>0?Promise.reject(_t.failures[0]):St.length<Tt?{failures:[],numFailures:0,lastResult:void 0}:deleteNextChunk(j,__assign(__assign({},_e),{lower:St[St.length-1],lowerOpen:!0}),Tt)}))}))}}});return Tt}})}},_E=function(){function Dexie(j,_e){var _t=this;this._middlewares={},this.verno=0;var St=Dexie.dependencies;this._options=_e=__assign({addons:Dexie.addons,autoOpen:!0,indexedDB:St.indexedDB,IDBKeyRange:St.IDBKeyRange},_e),this._deps={indexedDB:_e.indexedDB,IDBKeyRange:_e.IDBKeyRange};var Tt=_e.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null;var Ut={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:nop,dbReadyPromise:null,cancelOpen:nop,openCanceller:null,autoSchema:!0};Ut.dbReadyPromise=new DexiePromise((function(j){Ut.dbReadyResolve=j})),Ut.openCanceller=new DexiePromise((function(j,_e){Ut.cancelOpen=_e})),this._state=Ut,this.name=j,this.on=Events(this,"populate","blocked","versionchange",{ready:[promisableChain,nop]}),this.on.ready.subscribe=override(this.on.ready.subscribe,(function(j){return function(_e,St){Dexie.vip((function(){var Tt=_t._state;if(Tt.openComplete)Tt.dbOpenError||DexiePromise.resolve().then(_e),St&&j(_e);else if(Tt.onReadyBeingFired)Tt.onReadyBeingFired.push(_e),St&&j(_e);else{j(_e);var Ut=_t;St||j((function unsubscribe(){Ut.on.ready.unsubscribe(_e),Ut.on.ready.unsubscribe(unsubscribe)}))}}))}})),this.Collection=function createCollectionConstructor(j){return makeClassConstructor(uE.prototype,(function Collection$$1(_e,_t){this.db=j;var St=sE,Tt=null;if(_t)try{St=_t()}catch(j){Tt=j}var Ut=_e._ctx,_r=Ut.table,_n=_r.hook.reading.fire;this._ctx={table:_r,index:Ut.index,isPrimKey:!Ut.index||_r.schema.primKey.keyPath&&Ut.index===_r.schema.primKey.name,range:St,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:Tt,or:Ut.or,valueMapper:_n!==mirror?_n:null}}))}(this),this.Table=function createTableConstructor(j){return makeClassConstructor(cE.prototype,(function Table$$1(_e,_t,St){this.db=j,this._tx=St,this.name=_e,this.schema=_t,this.hook=j._allTables[_e]?j._allTables[_e].hook:Events(null,{creating:[hookCreatingChain,nop],reading:[pureFunctionChain,mirror],updating:[hookUpdatingChain,nop],deleting:[hookDeletingChain,nop]})}))}(this),this.Transaction=function createTransactionConstructor(j){return makeClassConstructor(hE.prototype,(function Transaction$$1(_e,_t,St,Tt){var Ut=this;this.db=j,this.mode=_e,this.storeNames=_t,this.schema=St,this.idbtrans=null,this.on=Events(this,"complete","error","abort"),this.parent=Tt||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new DexiePromise((function(j,_e){Ut._resolve=j,Ut._reject=_e})),this._completion.then((function(){Ut.active=!1,Ut.on.complete.fire()}),(function(j){var _e=Ut.active;return Ut.active=!1,Ut.on.error.fire(j),Ut.parent?Ut.parent._reject(j):_e&&Ut.idbtrans&&Ut.idbtrans.abort(),J_(j)}))}))}(this),this.Version=function createVersionConstructor(j){return makeClassConstructor(vE.prototype,(function Version$$1(_e){this.db=j,this._cfg={version:_e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function createWhereClauseConstructor(j){return makeClassConstructor(lE.prototype,(function WhereClause$$1(_e,_t,St){this.db=j,this._ctx={table:_e,index:":id"===_t?null:_t,or:St};var Tt=j._deps.indexedDB;if(!Tt)throw new d_.MissingAPI("indexedDB API missing");this._cmp=this._ascending=Tt.cmp.bind(Tt),this._descending=function(j,_e){return Tt.cmp(_e,j)},this._max=function(j,_e){return Tt.cmp(j,_e)>0?j:_e},this._min=function(j,_e){return Tt.cmp(j,_e)<0?j:_e},this._IDBKeyRange=j._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(j){j.newVersion>0?console.warn("Another connection wants to upgrade database '"+_t.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+_t.name+"'. Closing db now to resume the delete request."),_t.close()})),this.on("blocked",(function(j){!j.newVersion||j.newVersion<j.oldVersion?console.warn("Dexie.delete('"+_t.name+"') was blocked"):console.warn("Upgrade '"+_t.name+"' blocked by other connection holding version "+j.oldVersion/10)})),this._maxKey=getMaxKey(_e.IDBKeyRange),this._createTransaction=function(j,_e,St,Tt){return new _t.Transaction(j,_e,St,Tt)},this._fireOnBlocked=function(j){_t.on("blocked").fire(j),eE.filter((function(j){return j.name===_t.name&&j!==_t&&!j._state.vcFired})).map((function(_e){return _e.on("versionchange").fire(j)}))},this.use(yE),this.use(AE),Tt.forEach((function(j){return j(_t)}))}return Dexie.prototype.version=function(j){if(isNaN(j)||j<.1)throw new d_.Type("Given version is not a positive number");if(j=Math.round(10*j)/10,this.idbdb||this._state.isBeingOpened)throw new d_.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,j);var _e=this._versions,_t=_e.filter((function(_e){return _e._cfg.version===j}))[0];return _t||(_t=new this.Version(j),_e.push(_t),_e.sort(lowerVersionFirst),_t.stores({}),this._state.autoSchema=!1,_t)},Dexie.prototype._whenReady=function(j){var _e=this;return this._state.openComplete||P_.letThrough?j():new DexiePromise((function(j,_t){if(!_e._state.isBeingOpened){if(!_e._options.autoOpen)return void _t(new d_.DatabaseClosed);_e.open().catch(nop)}_e._state.dbReadyPromise.then(j,_t)})).then(j)},Dexie.prototype.use=function(j){var _e=j.stack,_t=j.create,St=j.level,Tt=j.name;Tt&&this.unuse({stack:_e,name:Tt});var Ut=this._middlewares[_e]||(this._middlewares[_e]=[]);return Ut.push({stack:_e,create:_t,level:null==St?10:St,name:Tt}),Ut.sort((function(j,_e){return j.level-_e.level})),this},Dexie.prototype.unuse=function(j){var _e=j.stack,_t=j.name,St=j.create;return _e&&this._middlewares[_e]&&(this._middlewares[_e]=this._middlewares[_e].filter((function(j){return St?j.create!==St:!!_t&&j.name!==_t}))),this},Dexie.prototype.open=function(){return dexieOpen(this)},Dexie.prototype.close=function(){var j=eE.indexOf(this),_e=this._state;if(j>=0&&eE.splice(j,1),this.idbdb){try{this.idbdb.close()}catch(j){}this.idbdb=null}this._options.autoOpen=!1,_e.dbOpenError=new d_.DatabaseClosed,_e.isBeingOpened&&_e.cancelOpen(_e.dbOpenError),_e.dbReadyPromise=new DexiePromise((function(j){_e.dbReadyResolve=j})),_e.openCanceller=new DexiePromise((function(j,_t){_e.cancelOpen=_t}))},Dexie.prototype.delete=function(){var j=this,_e=arguments.length>0,_t=this._state;return new DexiePromise((function(St,Tt){var doDelete=function(){j.close();var _e=j._deps.indexedDB.deleteDatabase(j.name);_e.onsuccess=wrap((function(){pE.remove(j.name),St()})),_e.onerror=eventRejectHandler(Tt),_e.onblocked=j._fireOnBlocked};if(_e)throw new d_.InvalidArgument("Arguments not allowed in db.delete()");_t.isBeingOpened?_t.dbReadyPromise.then(doDelete):doDelete()}))},Dexie.prototype.backendDB=function(){return this.idbdb},Dexie.prototype.isOpen=function(){return null!==this.idbdb},Dexie.prototype.hasBeenClosed=function(){var j=this._state.dbOpenError;return j&&"DatabaseClosed"===j.name},Dexie.prototype.hasFailed=function(){return null!==this._state.dbOpenError},Dexie.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Dexie.prototype,"tables",{get:function(){var j=this;return _s(this._allTables).map((function(_e){return j._allTables[_e]}))},enumerable:!0,configurable:!0}),Dexie.prototype.transaction=function(){var j=extractTransactionArgs.apply(this,arguments);return this._transaction.apply(this,j)},Dexie.prototype._transaction=function(j,_e,_t){var St=this,Tt=P_.trans;Tt&&Tt.db===this&&-1===j.indexOf("!")||(Tt=null);var Ut,_r,_n=-1!==j.indexOf("?");j=j.replace("!","").replace("?","");try{if(_r=_e.map((function(j){var _e=j instanceof St.Table?j.name:j;if("string"!=typeof _e)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return _e})),"r"==j||j===oE)Ut=oE;else{if("rw"!=j&&j!=aE)throw new d_.InvalidArgument("Invalid transaction mode: "+j);Ut=aE}if(Tt){if(Tt.mode===oE&&Ut===aE){if(!_n)throw new d_.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");Tt=null}Tt&&_r.forEach((function(j){if(Tt&&-1===Tt.storeNames.indexOf(j)){if(!_n)throw new d_.SubTransaction("Table "+j+" not included in parent transaction.");Tt=null}})),_n&&Tt&&!Tt.active&&(Tt=null)}}catch(j){return Tt?Tt._promise(null,(function(_e,_t){_t(j)})):J_(j)}var _i=enterTransactionScope.bind(null,this,Ut,_r,Tt,_t);return Tt?Tt._promise(Ut,_i,"lock"):P_.trans?usePSD(P_.transless,(function(){return St._whenReady(_i)})):this._whenReady(_i)},Dexie.prototype.table=function(j){if(!hasOwn(this._allTables,j))throw new d_.InvalidTable("Table "+j+" does not exist");return this._allTables[j]},Dexie}(),bE=_E;props(bE,__assign(__assign({},f_),{delete:function(j){return new bE(j).delete()},exists:function(j){return new bE(j,{addons:[]}).open().then((function(j){return j.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(j){return pE?pE.getDatabaseNames().then(j):DexiePromise.resolve([])},defineClass:function(){return function Class(j){extend(this,j)}},ignoreTransaction:function(j){return P_.trans?usePSD(P_.transless,j):j()},vip,async:function(j){return function(){try{var _e=awaitIterator(j.apply(this,arguments));return _e&&"function"==typeof _e.then?_e:DexiePromise.resolve(_e)}catch(j){return J_(j)}}},spawn:function(j,_e,_t){try{var St=awaitIterator(j.apply(_t,_e||[]));return St&&"function"==typeof St.then?St:DexiePromise.resolve(St)}catch(j){return J_(j)}},currentTransaction:{get:function(){return P_.trans||null}},waitFor:function(j,_e){var _t=DexiePromise.resolve("function"==typeof j?bE.ignoreTransaction(j):j).timeout(_e||6e4);return P_.trans?P_.trans.waitFor(_t):_t},Promise:DexiePromise,debug:{get:function(){return r_},set:function(j){setDebug(j,"dexie"===j?function(){return!0}:dexieStackFrameFilter)}},derive,extend,props,override,Events,getByKeyPath,setByKeyPath,delByKeyPath,shallowClone,deepClone,getObjectDiff,asap,minKey:$_,addons:[],connections:eE,errnames:u_,dependencies:function(){try{return{indexedDB:kc.indexedDB||kc.mozIndexedDB||kc.webkitIndexedDB||kc.msIndexedDB,IDBKeyRange:kc.IDBKeyRange||kc.webkitIDBKeyRange}}catch(j){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:X_,version:X_.split(".").map((function(j){return parseInt(j)})).reduce((function(j,_e,_t){return j+_e/Math.pow(10,2*_t)})),default:bE,Dexie:bE})),bE.maxKey=getMaxKey(bE.dependencies.IDBKeyRange),function initDatabaseEnumerator(j){try{pE=function DatabaseEnumerator(j){var _e,_t=j&&"function"==typeof j.databases;if(!_t){var St=new _E(iE,{addons:[]});St.version(1).stores({dbnames:"name"}),_e=St.table("dbnames")}return{getDatabaseNames:function(){return _t?DexiePromise.resolve(j.databases()).then((function(j){return j.map((function(j){return j.name})).filter((function(j){return j!==iE}))})):_e.toCollection().primaryKeys()},add:function(j){return!_t&&j!==iE&&_e.put({name:j}).catch(nop)},remove:function(j){return!_t&&j!==iE&&_e.delete(j).catch(nop)}}}(j)}catch(j){}}(_E.dependencies.indexedDB),DexiePromise.rejectionMapper=function mapError(j,_e){if(!j||j instanceof DexieError||j instanceof TypeError||j instanceof SyntaxError||!j.name||!h_[j.name])return j;var _t=new h_[j.name](_e||j.message,j);return"stack"in j&&setProp(_t,"stack",{get:function(){return this.inner.stack}}),_t},setDebug(r_,dexieStackFrameFilter);function _createSuper(j){var _e=function db_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var SE,IE,TE,CE=new(function(j){_inherits(LoggerDB,j);var _e=_createSuper(LoggerDB);function LoggerDB(){var j;return _classCallCheck(this,LoggerDB),(j=_e.call(this,"AgoraLogger")).logs=void 0,j.openDatabase(),j.logs=j.table("logs"),j}return _createClass(LoggerDB,[{key:"openDatabase",value:function openDatabase(){this.version(1).stores({logs:"++id, content, label, created_at"})}}]),LoggerDB}(_E)),kE=__webpack_require__(1005),OE=__webpack_require__.n(kE);!function(j){j[j.ERROR=1]="ERROR",j[j.WARN=2]="WARN",j[j.INFO=3]="INFO",j[j.DEBUG=4]="DEBUG"}(SE||(SE={})),function(j){j[j.Idle=0]="Idle",j[j.Connecting=1]="Connecting",j[j.Connected=2]="Connected",j[j.Reconnecting=3]="Reconnecting",j[j.Error=4]="Error"}(IE||(IE={})),function(j){j[j.Communication=0]="Communication",j[j.LiveBroadcasting=1]="LiveBroadcasting"}(TE||(TE={}));var DE,xE=__webpack_require__(537),LE=__webpack_require__.n(xE);function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}var NE,PE=(_defineProperty(DE={},SE.ERROR,"error"),_defineProperty(DE,SE.WARN,"warn"),_defineProperty(DE,SE.INFO,"info"),_defineProperty(DE,SE.DEBUG,"debug"),_defineProperty(DE,"debug",SE.DEBUG),_defineProperty(DE,"info",SE.INFO),_defineProperty(DE,"warn",SE.WARN),_defineProperty(DE,"error",SE.ERROR),DE),ME=function(){function Logger(j,_e){_classCallCheck(this,Logger),this._label=j,this._dest=_e}var j,_e,_t,St;return _createClass(Logger,[{key:"debug",value:function debug(){for(var j=arguments.length,_e=new Array(j),_t=0;_t<j;_t++)_e[_t]=arguments[_t];this._log.apply(this,[SE.DEBUG].concat(_e))}},{key:"info",value:function info(){for(var j=arguments.length,_e=new Array(j),_t=0;_t<j;_t++)_e[_t]=arguments[_t];this._log.apply(this,[SE.INFO].concat(_e))}},{key:"warn",value:function warn(){for(var j=arguments.length,_e=new Array(j),_t=0;_t<j;_t++)_e[_t]=arguments[_t];this._log.apply(this,[SE.WARN].concat(_e))}},{key:"error",value:function error(){for(var j=arguments.length,_e=new Array(j),_t=0;_t<j;_t++)_e[_t]=arguments[_t];this._log.apply(this,[SE.ERROR].concat(_e))}},{key:"_log",value:function _log(j){var _e=KS.logLevel;if(!(j>_e)){for(var _t=arguments.length,St=new Array(_t>1?_t-1:0),Tt=1;Tt<_t;Tt++)St[Tt-1]=arguments[Tt];this._dest.database&&this._pipeToDatabase(St.join()),this._dest.console&&this._pipeToConsole(j,St)}}},{key:"_pipeToDatabase",value:function _pipeToDatabase(j){Logger.thread.postMessage({type:"log",data:{label:this._label,message:j}})}},{key:"_pipeToConsole",value:function _pipeToConsole(j,_e){var _t=Logger.originConsole;switch(j){case SE.DEBUG:_t.debug.apply(_t,_toConsumableArray(_e));break;case SE.INFO:_t.info.apply(_t,_toConsumableArray(_e));break;case SE.WARN:_t.warn.apply(_t,_toConsumableArray(_e));break;case SE.ERROR:_t.error.apply(_t,_toConsumableArray(_e))}}}],[{key:"warn",value:function warn(){var j;(j=Logger.logger).warn.apply(j,arguments)}},{key:"debug",value:function debug(){var j;(j=Logger.logger).debug.apply(j,arguments)}},{key:"info",value:function info(){var j;(j=Logger.logger).info.apply(j,arguments)}},{key:"error",value:function error(){var j;(j=Logger.logger).error.apply(j,arguments)}},{key:"setMaxRecords",value:function setMaxRecords(j){LE()(j)?(console.log("[logger] set maxRecords to ".concat(j)),Logger.thread.postMessage({type:"setting",data:{maxRecords:j}})):console.warn("[logger] cannot set maxRecords to an invalid number :".concat(j))}},{key:"setupConsoleHijack",value:function setupConsoleHijack(){var j=function _objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}({},Logger.originConsole);if(j.__hijackSetup)j.log("[logger] hijack already setup!");else{var _e=this.getLogger("console-hijack");j.log("[logger] setup hijack.."),Object.keys(j).filter((function(j){return["info","error","warn","debug"].indexOf(j)>=0})).forEach((function(_t){j[_t]=function proxy(j){return function(){switch(j){case"debug":_e.debug.apply(_e,arguments);break;case"info":_e.info.apply(_e,arguments);break;case"warn":_e.warn.apply(_e,arguments);break;case"error":_e.error.apply(_e,arguments)}}}(_t)})),j.__hijackSetup=!0,window.console=j}}},{key:"restoreConsoleHijack",value:function restoreConsoleHijack(){console.log("[logger] restore hijack.."),window.console=Logger.originConsole,console.__hijackSetup=!1}},{key:"collectConsoleLogs",value:(St=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var j,_e,_t;return _regeneratorRuntime().wrap((function _callee$(St){for(;;)switch(St.prev=St.next){case 0:return j="",St.next=3,CE.logs.each((function(_e){j+=_e.content+"\n",Logger._lastObjectIndex=_e.id}));case 3:return _e=+Date.now(),_t=new File([j],"".concat(_e)),St.abrupt("return",_t);case 6:case"end":return St.stop()}}),_callee)}))),function collectConsoleLogs(){return St.apply(this,arguments)})},{key:"cleanupConsoleLogs",value:(_t=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(){var j;return _regeneratorRuntime().wrap((function _callee2$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,CE.logs.where("id").belowOrEqual(Logger._lastObjectIndex).delete();case 2:j=_e.sent,console.log("[logger] delete ".concat(j," logs"));case 4:case"end":return _e.stop()}}),_callee2)}))),function cleanupConsoleLogs(){return _t.apply(this,arguments)})},{key:"_readFile",value:function _readFile(j){return new Promise((function(_e,_t){window.require("fs").readFile(j,(function(j,St){return j?_t(j):_e(St)}))}))}},{key:"_compressLogFile",value:(_e=_asyncToGenerator(_regeneratorRuntime().mark((function _callee3(j,_e){var _t,St,Tt;return _regeneratorRuntime().wrap((function _callee3$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return _t=window.require("adm-zip"),St=new _t,Ut.next=4,new Promise((function(_e,_t){St.addLocalFolderAsync(j,(function(j,St){if(St)return _t(St);_e()}))}));case 4:return St.writeZip(_e),Ut.next=7,this._readFile(_e);case 7:return Tt=Ut.sent,Ut.abrupt("return",Tt);case 9:case"end":return Ut.stop()}}),_callee3,this)}))),function _compressLogFile(j,_t){return _e.apply(this,arguments)})},{key:"collectElectronLogs",value:(j=_asyncToGenerator(_regeneratorRuntime().mark((function _callee4(j,_e){var _t,St,Tt,Ut;return _regeneratorRuntime().wrap((function _callee4$(_r){for(;;)switch(_r.prev=_r.next){case 0:return _t=+Date.now(),St=window.require("path"),Tt=St.resolve(j,"logs.zip"),_r.next=5,this._compressLogFile(_e,Tt);case 5:return Ut=_r.sent,_r.abrupt("return",new File([Ut],"".concat(_t)));case 7:case"end":return _r.stop()}}),_callee4,this)}))),function collectElectronLogs(_e,_t){return j.apply(this,arguments)})},{key:"getLogger",value:function getLogger(j){var _e=this._instancesByLabel.get(j);return _e||(this.logger.warn("no logger with label [".concat(j,"] is found, fallback to default logger")),_e=this.logger),_e}}]),Logger}();ME._lastObjectIndex=-1,ME._instancesByLabel=new Map(Object.entries({default:new ME("default",{console:!0,database:!0}),"channel-message":new ME("channel-message",{console:!0,database:!0}),"peer-message":new ME("peer-message",{console:!0,database:!0}),"http-error":new ME("http-error",{console:!0,database:!0}),"console-hijack":new ME("console-hijack",{console:!0,database:!0})})),ME.logger=ME._instancesByLabel.get("default"),ME.thread=new function Worker_fn(){return OE()('(()=>{var e={6831:(e,t,r)=>{var n=r(7772).Symbol;e.exports=n},1202:(e,t,r)=>{var n=r(6831),o=r(2107),i=r(7157),a=n?n.toStringTag:void 0;e.exports=function baseGetTag(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},1704:(e,t,r)=>{var n=r(2153),o=/^\\s+/;e.exports=function baseTrim(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},1242:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},2107:(e,t,r)=>{var n=r(6831),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=n?n.toStringTag:void 0;e.exports=function getRawTag(e){var t=i.call(e,u),r=e[u];try{e[u]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[u]=r:delete e[u]),o}},7157:e=>{var t=Object.prototype.toString;e.exports=function objectToString(e){return t.call(e)}},7772:(e,t,r)=>{var n=r(1242),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},2153:e=>{var t=/\\s/;e.exports=function trimmedEndIndex(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},4073:(e,t,r)=>{var n=r(9259),o=r(1100),i=r(7642),a=Math.max,u=Math.min;e.exports=function debounce(e,t,r){var s,l,f,p,h,d,y=0,v=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function invokeFunc(t){var r=s,n=l;return s=l=void 0,y=t,p=e.apply(n,r)}function leadingEdge(e){return y=e,h=setTimeout(timerExpired,t),v?invokeFunc(e):p}function shouldInvoke(e){var r=e-d;return void 0===d||r>=t||r<0||m&&e-y>=f}function timerExpired(){var e=o();if(shouldInvoke(e))return trailingEdge(e);h=setTimeout(timerExpired,function remainingWait(e){var r=t-(e-d);return m?u(r,f-(e-y)):r}(e))}function trailingEdge(e){return h=void 0,g&&s?invokeFunc(e):(s=l=void 0,p)}function debounced(){var e=o(),r=shouldInvoke(e);if(s=arguments,l=this,d=e,r){if(void 0===h)return leadingEdge(d);if(m)return clearTimeout(h),h=setTimeout(timerExpired,t),invokeFunc(d)}return void 0===h&&(h=setTimeout(timerExpired,t)),p}return t=i(t)||0,n(r)&&(v=!!r.leading,f=(m="maxWait"in r)?a(i(r.maxWait)||0,t):f,g="trailing"in r?!!r.trailing:g),debounced.cancel=function cancel(){void 0!==h&&clearTimeout(h),y=0,s=d=l=h=void 0},debounced.flush=function flush(){return void 0===h?p:trailingEdge(o())},debounced}},9259:e=>{e.exports=function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5125:e=>{e.exports=function isObjectLike(e){return null!=e&&"object"==typeof e}},4795:(e,t,r)=>{var n=r(1202),o=r(5125);e.exports=function isSymbol(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},1100:(e,t,r)=>{var n=r(7772);e.exports=function(){return n.Date.now()}},7642:(e,t,r)=>{var n=r(1704),o=r(9259),i=r(4795),a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;e.exports=function toNumber(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=u.test(e);return r||s.test(e)?l(e.slice(2),r?2:8):a.test(e)?NaN:+e}},9662:(e,t,r)=>{var n=r(7854),o=r(614),i=r(6330),a=n.TypeError;e.exports=function(e){if(o(e))return e;throw a(i(e)+" is not a function")}},9483:(e,t,r)=>{var n=r(7854),o=r(4411),i=r(6330),a=n.TypeError;e.exports=function(e){if(o(e))return e;throw a(i(e)+" is not a constructor")}},6077:(e,t,r)=>{var n=r(7854),o=r(614),i=n.String,a=n.TypeError;e.exports=function(e){if("object"==typeof e||o(e))return e;throw a("Can\'t set "+i(e)+" as a prototype")}},1223:(e,t,r)=>{var n=r(5112),o=r(30),i=r(3070),a=n("unscopables"),u=Array.prototype;null==u[a]&&i.f(u,a,{configurable:!0,value:o(null)}),e.exports=function(e){u[a][e]=!0}},5787:(e,t,r)=>{var n=r(7854),o=r(7976),i=n.TypeError;e.exports=function(e,t){if(o(t,e))return e;throw i("Incorrect invocation")}},9670:(e,t,r)=>{var n=r(7854),o=r(111),i=n.String,a=n.TypeError;e.exports=function(e){if(o(e))return e;throw a(i(e)+" is not an object")}},8533:(e,t,r)=>{"use strict";var n=r(2092).forEach,o=r(2133)("forEach");e.exports=o?[].forEach:function forEach(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},1318:(e,t,r)=>{var n=r(5656),o=r(1400),i=r(6244),createMethod=function(e){return function(t,r,a){var u,s=n(t),l=i(s),f=o(a,l);if(e&&r!=r){for(;l>f;)if((u=s[f++])!=u)return!0}else for(;l>f;f++)if((e||f in s)&&s[f]===r)return e||f||0;return!e&&-1}};e.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},2092:(e,t,r)=>{var n=r(9974),o=r(1702),i=r(8361),a=r(7908),u=r(6244),s=r(5417),l=o([].push),createMethod=function(e){var t=1==e,r=2==e,o=3==e,f=4==e,p=6==e,h=7==e,d=5==e||p;return function(y,v,m,g){for(var b,w,_=a(y),x=i(_),P=n(v,m),k=u(x),S=0,E=g||s,O=t?E(y,k):r||h?E(y,0):void 0;k>S;S++)if((d||S in x)&&(w=P(b=x[S],S,_),e))if(t)O[S]=w;else if(w)switch(e){case 3:return!0;case 5:return b;case 6:return S;case 2:l(O,b)}else switch(e){case 4:return!1;case 7:l(O,b)}return p?-1:o||f?f:O}};e.exports={forEach:createMethod(0),map:createMethod(1),filter:createMethod(2),some:createMethod(3),every:createMethod(4),find:createMethod(5),findIndex:createMethod(6),filterReject:createMethod(7)}},1194:(e,t,r)=>{var n=r(7293),o=r(5112),i=r(7392),a=o("species");e.exports=function(e){return i>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},2133:(e,t,r)=>{"use strict";var n=r(7293);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){throw 1},1)}))}},1589:(e,t,r)=>{var n=r(7854),o=r(1400),i=r(6244),a=r(6135),u=n.Array,s=Math.max;e.exports=function(e,t,r){for(var n=i(e),l=o(t,n),f=o(void 0===r?n:r,n),p=u(s(f-l,0)),h=0;l<f;l++,h++)a(p,h,e[l]);return p.length=h,p}},206:(e,t,r)=>{var n=r(1702);e.exports=n([].slice)},7475:(e,t,r)=>{var n=r(7854),o=r(3157),i=r(4411),a=r(111),u=r(5112)("species"),s=n.Array;e.exports=function(e){var t;return o(e)&&(t=e.constructor,(i(t)&&(t===s||o(t.prototype))||a(t)&&null===(t=t[u]))&&(t=void 0)),void 0===t?s:t}},5417:(e,t,r)=>{var n=r(7475);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},7072:(e,t,r)=>{var n=r(5112)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}},4326:(e,t,r)=>{var n=r(1702),o=n({}.toString),i=n("".slice);e.exports=function(e){return i(o(e),8,-1)}},648:(e,t,r)=>{var n=r(7854),o=r(1694),i=r(614),a=r(4326),u=r(5112)("toStringTag"),s=n.Object,l="Arguments"==a(function(){return arguments}());e.exports=o?a:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=s(e),u))?r:l?a(t):"Object"==(n=a(t))&&i(t.callee)?"Arguments":n}},9920:(e,t,r)=>{var n=r(2597),o=r(3887),i=r(1236),a=r(3070);e.exports=function(e,t,r){for(var u=o(t),s=a.f,l=i.f,f=0;f<u.length;f++){var p=u[f];n(e,p)||r&&n(r,p)||s(e,p,l(t,p))}}},8544:(e,t,r)=>{var n=r(7293);e.exports=!n((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype}))},4994:(e,t,r)=>{"use strict";var n=r(3383).IteratorPrototype,o=r(30),i=r(9114),a=r(8003),u=r(7497),returnThis=function(){return this};e.exports=function(e,t,r,s){var l=t+" Iterator";return e.prototype=o(n,{next:i(+!s,r)}),a(e,l,!1,!0),u[l]=returnThis,e}},8880:(e,t,r)=>{var n=r(9781),o=r(3070),i=r(9114);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},9114:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6135:(e,t,r)=>{"use strict";var n=r(4948),o=r(3070),i=r(9114);e.exports=function(e,t,r){var a=n(t);a in e?o.f(e,a,i(0,r)):e[a]=r}},654:(e,t,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(1913),a=r(6530),u=r(614),s=r(4994),l=r(9518),f=r(7674),p=r(8003),h=r(8880),d=r(1320),y=r(5112),v=r(7497),m=r(3383),g=a.PROPER,b=a.CONFIGURABLE,w=m.IteratorPrototype,_=m.BUGGY_SAFARI_ITERATORS,x=y("iterator"),P="keys",k="values",S="entries",returnThis=function(){return this};e.exports=function(e,t,r,a,y,m,E){s(r,t,a);var O,T,C,getIterationMethod=function(e){if(e===y&&R)return R;if(!_&&e in A)return A[e];switch(e){case P:return function keys(){return new r(this,e)};case k:return function values(){return new r(this,e)};case S:return function entries(){return new r(this,e)}}return function(){return new r(this)}},j=t+" Iterator",D=!1,A=e.prototype,I=A[x]||A["@@iterator"]||y&&A[y],R=!_&&I||getIterationMethod(y),K="Array"==t&&A.entries||I;if(K&&(O=l(K.call(new e)))!==Object.prototype&&O.next&&(i||l(O)===w||(f?f(O,w):u(O[x])||d(O,x,returnThis)),p(O,j,!0,!0),i&&(v[j]=returnThis)),g&&y==k&&I&&I.name!==k&&(!i&&b?h(A,"name",k):(D=!0,R=function values(){return o(I,this)})),y)if(T={values:getIterationMethod(k),keys:m?R:getIterationMethod(P),entries:getIterationMethod(S)},E)for(C in T)(_||D||!(C in A))&&d(A,C,T[C]);else n({target:t,proto:!0,forced:_||D},T);return i&&!E||A[x]===R||d(A,x,R,{name:y}),v[t]=R,T}},7235:(e,t,r)=>{var n=r(857),o=r(2597),i=r(6061),a=r(3070).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},9781:(e,t,r)=>{var n=r(7293);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(e,t,r)=>{var n=r(7854),o=r(111),i=n.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},8324:e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:(e,t,r)=>{var n=r(317)("span").classList,o=n&&n.constructor&&n.constructor.prototype;e.exports=o===Object.prototype?void 0:o},7871:e=>{e.exports="object"==typeof window},1528:(e,t,r)=>{var n=r(8113),o=r(7854);e.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==o.Pebble},6833:(e,t,r)=>{var n=r(8113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},5268:(e,t,r)=>{var n=r(4326),o=r(7854);e.exports="process"==n(o.process)},1036:(e,t,r)=>{var n=r(8113);e.exports=/web0s(?!.*chrome)/i.test(n)},8113:(e,t,r)=>{var n=r(5005);e.exports=n("navigator","userAgent")||""},7392:(e,t,r)=>{var n,o,i=r(7854),a=r(8113),u=i.process,s=i.Deno,l=u&&u.versions||s&&s.version,f=l&&l.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\\/(\\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\\/(\\d+)/))&&(o=+n[1]),e.exports=o},748:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(e,t,r)=>{var n=r(7854),o=r(1236).f,i=r(8880),a=r(1320),u=r(3505),s=r(9920),l=r(4705);e.exports=function(e,t){var r,f,p,h,d,y=e.target,v=e.global,m=e.stat;if(r=v?n:m?n[y]||u(y,{}):(n[y]||{}).prototype)for(f in t){if(h=t[f],p=e.noTargetGet?(d=o(r,f))&&d.value:r[f],!l(v?f:y+(m?".":"#")+f,e.forced)&&void 0!==p){if(typeof h==typeof p)continue;s(h,p)}(e.sham||p&&p.sham)&&i(h,"sham",!0),a(r,f,h,e)}}},7293:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},2104:e=>{var t=Function.prototype,r=t.apply,n=t.bind,o=t.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(r):function(){return o.apply(r,arguments)})},9974:(e,t,r)=>{var n=r(1702),o=r(9662),i=n(n.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?i(e,t):function(){return e.apply(t,arguments)}}},7065:(e,t,r)=>{"use strict";var n=r(7854),o=r(1702),i=r(9662),a=r(111),u=r(2597),s=r(206),l=n.Function,f=o([].concat),p=o([].join),h={},construct=function(e,t,r){if(!u(h,t)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";h[t]=l("C,a","return new C("+p(n,",")+")")}return h[t](e,r)};e.exports=l.bind||function bind(e){var t=i(this),r=t.prototype,n=s(arguments,1),o=function bound(){var r=f(n,s(arguments));return this instanceof o?construct(t,r.length,r):t.apply(e,r)};return a(r)&&(o.prototype=r),o}},6916:e=>{var t=Function.prototype.call;e.exports=t.bind?t.bind(t):function(){return t.apply(t,arguments)}},6530:(e,t,r)=>{var n=r(9781),o=r(2597),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,u=o(i,"name"),s=u&&"something"===function something(){}.name,l=u&&(!n||n&&a(i,"name").configurable);e.exports={EXISTS:u,PROPER:s,CONFIGURABLE:l}},1702:e=>{var t=Function.prototype,r=t.bind,n=t.call,o=r&&r.bind(n);e.exports=r?function(e){return e&&o(n,e)}:function(e){return e&&function(){return n.apply(e,arguments)}}},5005:(e,t,r)=>{var n=r(7854),o=r(614),aFunction=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?aFunction(n[e]):n[e]&&n[e][t]}},1246:(e,t,r)=>{var n=r(648),o=r(8173),i=r(7497),a=r(5112)("iterator");e.exports=function(e){if(null!=e)return o(e,a)||o(e,"@@iterator")||i[n(e)]}},8554:(e,t,r)=>{var n=r(7854),o=r(6916),i=r(9662),a=r(9670),u=r(6330),s=r(1246),l=n.TypeError;e.exports=function(e,t){var r=arguments.length<2?s(e):t;if(i(r))return a(o(r,e));throw l(u(e)+" is not iterable")}},8173:(e,t,r)=>{var n=r(9662);e.exports=function(e,t){var r=e[t];return null==r?void 0:n(r)}},7854:(e,t,r)=>{var check=function(e){return e&&e.Math==Math&&e};e.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2597:(e,t,r)=>{var n=r(1702),o=r(7908),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function hasOwn(e,t){return i(o(e),t)}},3501:e=>{e.exports={}},842:(e,t,r)=>{var n=r(7854);e.exports=function(e,t){var r=n.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))}},490:(e,t,r)=>{var n=r(5005);e.exports=n("document","documentElement")},4664:(e,t,r)=>{var n=r(9781),o=r(7293),i=r(317);e.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(e,t,r)=>{var n=r(7854),o=r(1702),i=r(7293),a=r(4326),u=n.Object,s=o("".split);e.exports=i((function(){return!u("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?s(e,""):u(e)}:u},2788:(e,t,r)=>{var n=r(1702),o=r(614),i=r(5465),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},9909:(e,t,r)=>{var n,o,i,a=r(8536),u=r(7854),s=r(1702),l=r(111),f=r(8880),p=r(2597),h=r(5465),d=r(6200),y=r(3501),v="Object already initialized",m=u.TypeError,g=u.WeakMap;if(a||h.state){var b=h.state||(h.state=new g),w=s(b.get),_=s(b.has),x=s(b.set);n=function(e,t){if(_(b,e))throw new m(v);return t.facade=e,x(b,e,t),t},o=function(e){return w(b,e)||{}},i=function(e){return _(b,e)}}else{var P=d("state");y[P]=!0,n=function(e,t){if(p(e,P))throw new m(v);return t.facade=e,f(e,P,t),t},o=function(e){return p(e,P)?e[P]:{}},i=function(e){return p(e,P)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=o(t)).type!==e)throw m("Incompatible receiver, "+e+" required");return r}}}},7659:(e,t,r)=>{var n=r(5112),o=r(7497),i=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},3157:(e,t,r)=>{var n=r(4326);e.exports=Array.isArray||function isArray(e){return"Array"==n(e)}},614:e=>{e.exports=function(e){return"function"==typeof e}},4411:(e,t,r)=>{var n=r(1702),o=r(7293),i=r(614),a=r(648),u=r(5005),s=r(2788),noop=function(){},l=[],f=u("Reflect","construct"),p=/^\\s*(?:class|function)\\b/,h=n(p.exec),d=!p.exec(noop),y=function isConstructor(e){if(!i(e))return!1;try{return f(noop,l,e),!0}catch(e){return!1}},v=function isConstructor(e){if(!i(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!h(p,s(e))}catch(e){return!0}};v.sham=!0,e.exports=!f||o((function(){var e;return y(y.call)||!y(Object)||!y((function(){e=!0}))||e}))?v:y},4705:(e,t,r)=>{var n=r(7293),o=r(614),i=/#|\\.prototype\\./,isForced=function(e,t){var r=u[a(e)];return r==l||r!=s&&(o(t)?n(t):!!t)},a=isForced.normalize=function(e){return String(e).replace(i,".").toLowerCase()},u=isForced.data={},s=isForced.NATIVE="N",l=isForced.POLYFILL="P";e.exports=isForced},111:(e,t,r)=>{var n=r(614);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},1913:e=>{e.exports=!1},2190:(e,t,r)=>{var n=r(7854),o=r(5005),i=r(614),a=r(7976),u=r(3307),s=n.Object;e.exports=u?function(e){return"symbol"==typeof e}:function(e){var t=o("Symbol");return i(t)&&a(t.prototype,s(e))}},612:(e,t,r)=>{var n=r(7854),o=r(9974),i=r(6916),a=r(9670),u=r(6330),s=r(7659),l=r(6244),f=r(7976),p=r(8554),h=r(1246),d=r(9212),y=n.TypeError,Result=function(e,t){this.stopped=e,this.result=t},v=Result.prototype;e.exports=function(e,t,r){var n,m,g,b,w,_,x,P=r&&r.that,k=!(!r||!r.AS_ENTRIES),S=!(!r||!r.IS_ITERATOR),E=!(!r||!r.INTERRUPTED),O=o(t,P),stop=function(e){return n&&d(n,"normal",e),new Result(!0,e)},callFn=function(e){return k?(a(e),E?O(e[0],e[1],stop):O(e[0],e[1])):E?O(e,stop):O(e)};if(S)n=e;else{if(!(m=h(e)))throw y(u(e)+" is not iterable");if(s(m)){for(g=0,b=l(e);b>g;g++)if((w=callFn(e[g]))&&f(v,w))return w;return new Result(!1)}n=p(e,m)}for(_=n.next;!(x=i(_,n)).done;){try{w=callFn(x.value)}catch(e){d(n,"throw",e)}if("object"==typeof w&&w&&f(v,w))return w}return new Result(!1)}},9212:(e,t,r)=>{var n=r(6916),o=r(9670),i=r(8173);e.exports=function(e,t,r){var a,u;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(e){u=!0,a=e}if("throw"===t)throw r;if(u)throw a;return o(a),r}},3383:(e,t,r)=>{"use strict";var n,o,i,a=r(7293),u=r(614),s=r(30),l=r(9518),f=r(1320),p=r(5112),h=r(1913),d=p("iterator"),y=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(n=o):y=!0),null==n||a((function(){var e={};return n[d].call(e)!==e}))?n={}:h&&(n=s(n)),u(n[d])||f(n,d,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:y}},7497:e=>{e.exports={}},6244:(e,t,r)=>{var n=r(7466);e.exports=function(e){return n(e.length)}},5948:(e,t,r)=>{var n,o,i,a,u,s,l,f,p=r(7854),h=r(9974),d=r(1236).f,y=r(261).set,v=r(6833),m=r(1528),g=r(1036),b=r(5268),w=p.MutationObserver||p.WebKitMutationObserver,_=p.document,x=p.process,P=p.Promise,k=d(p,"queueMicrotask"),S=k&&k.value;S||(n=function(){var e,t;for(b&&(e=x.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?a():i=void 0,e}}i=void 0,e&&e.enter()},v||b||g||!w||!_?!m&&P&&P.resolve?((l=P.resolve(void 0)).constructor=P,f=h(l.then,l),a=function(){f(n)}):b?a=function(){x.nextTick(n)}:(y=h(y,p),a=function(){y(n)}):(u=!0,s=_.createTextNode(""),new w(n).observe(s,{characterData:!0}),a=function(){s.data=u=!u})),e.exports=S||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,a()),i=t}},3366:(e,t,r)=>{var n=r(7854);e.exports=n.Promise},133:(e,t,r)=>{var n=r(7392),o=r(7293);e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8536:(e,t,r)=>{var n=r(7854),o=r(614),i=r(2788),a=n.WeakMap;e.exports=o(a)&&/native code/.test(i(a))},8523:(e,t,r)=>{"use strict";var n=r(9662),PromiseCapability=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new PromiseCapability(e)}},30:(e,t,r)=>{var n,o=r(9670),i=r(6048),a=r(748),u=r(3501),s=r(490),l=r(317),f=r(6200),p="prototype",h="script",d=f("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return"<"+h+">"+e+"</"+h+">"},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObject=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;NullProtoObject="undefined"!=typeof document?document.domain&&n?NullProtoObjectViaActiveX(n):(t=l("iframe"),r="java"+h+":",t.style.display="none",s.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F):NullProtoObjectViaActiveX(n);for(var o=a.length;o--;)delete NullProtoObject[p][a[o]];return NullProtoObject()};u[d]=!0,e.exports=Object.create||function create(e,t){var r;return null!==e?(EmptyConstructor[p]=o(e),r=new EmptyConstructor,EmptyConstructor[p]=null,r[d]=e):r=NullProtoObject(),void 0===t?r:i(r,t)}},6048:(e,t,r)=>{var n=r(9781),o=r(3070),i=r(9670),a=r(5656),u=r(1956);e.exports=n?Object.defineProperties:function defineProperties(e,t){i(e);for(var r,n=a(t),s=u(t),l=s.length,f=0;l>f;)o.f(e,r=s[f++],n[r]);return e}},3070:(e,t,r)=>{var n=r(7854),o=r(9781),i=r(4664),a=r(9670),u=r(4948),s=n.TypeError,l=Object.defineProperty;t.f=o?l:function defineProperty(e,t,r){if(a(e),t=u(t),a(r),i)try{return l(e,t,r)}catch(e){}if("get"in r||"set"in r)throw s("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},1236:(e,t,r)=>{var n=r(9781),o=r(6916),i=r(5296),a=r(9114),u=r(5656),s=r(4948),l=r(2597),f=r(4664),p=Object.getOwnPropertyDescriptor;t.f=n?p:function getOwnPropertyDescriptor(e,t){if(e=u(e),t=s(t),f)try{return p(e,t)}catch(e){}if(l(e,t))return a(!o(i.f,e,t),e[t])}},1156:(e,t,r)=>{var n=r(4326),o=r(5656),i=r(8006).f,a=r(1589),u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function getOwnPropertyNames(e){return u&&"Window"==n(e)?function(e){try{return i(e)}catch(e){return a(u)}}(e):i(o(e))}},8006:(e,t,r)=>{var n=r(6324),o=r(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return n(e,o)}},5181:(e,t)=>{t.f=Object.getOwnPropertySymbols},9518:(e,t,r)=>{var n=r(7854),o=r(2597),i=r(614),a=r(7908),u=r(6200),s=r(8544),l=u("IE_PROTO"),f=n.Object,p=f.prototype;e.exports=s?f.getPrototypeOf:function(e){var t=a(e);if(o(t,l))return t[l];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof f?p:null}},7976:(e,t,r)=>{var n=r(1702);e.exports=n({}.isPrototypeOf)},6324:(e,t,r)=>{var n=r(1702),o=r(2597),i=r(5656),a=r(1318).indexOf,u=r(3501),s=n([].push);e.exports=function(e,t){var r,n=i(e),l=0,f=[];for(r in n)!o(u,r)&&o(n,r)&&s(f,r);for(;t.length>l;)o(n,r=t[l++])&&(~a(f,r)||s(f,r));return f}},1956:(e,t,r)=>{var n=r(6324),o=r(748);e.exports=Object.keys||function keys(e){return n(e,o)}},5296:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);t.f=o?function propertyIsEnumerable(e){var t=n(this,e);return!!t&&t.enumerable}:r},7674:(e,t,r)=>{var n=r(1702),o=r(9670),i=r(6077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function setPrototypeOf(r,n){return o(r),i(n),t?e(r,n):r.__proto__=n,r}}():void 0)},288:(e,t,r)=>{"use strict";var n=r(1694),o=r(648);e.exports=n?{}.toString:function toString(){return"[object "+o(this)+"]"}},2140:(e,t,r)=>{var n=r(7854),o=r(6916),i=r(614),a=r(111),u=n.TypeError;e.exports=function(e,t){var r,n;if("string"===t&&i(r=e.toString)&&!a(n=o(r,e)))return n;if(i(r=e.valueOf)&&!a(n=o(r,e)))return n;if("string"!==t&&i(r=e.toString)&&!a(n=o(r,e)))return n;throw u("Can\'t convert object to primitive value")}},3887:(e,t,r)=>{var n=r(5005),o=r(1702),i=r(8006),a=r(5181),u=r(9670),s=o([].concat);e.exports=n("Reflect","ownKeys")||function ownKeys(e){var t=i.f(u(e)),r=a.f;return r?s(t,r(e)):t}},857:(e,t,r)=>{var n=r(7854);e.exports=n},2534:e=>{e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},9478:(e,t,r)=>{var n=r(9670),o=r(111),i=r(8523);e.exports=function(e,t){if(n(e),o(t)&&t.constructor===e)return t;var r=i.f(e);return(0,r.resolve)(t),r.promise}},8572:e=>{var Queue=function(){this.head=null,this.tail=null};Queue.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},e.exports=Queue},2248:(e,t,r)=>{var n=r(1320);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},1320:(e,t,r)=>{var n=r(7854),o=r(614),i=r(2597),a=r(8880),u=r(3505),s=r(2788),l=r(9909),f=r(6530).CONFIGURABLE,p=l.get,h=l.enforce,d=String(String).split("String");(e.exports=function(e,t,r,s){var l,p=!!s&&!!s.unsafe,y=!!s&&!!s.enumerable,v=!!s&&!!s.noTargetGet,m=s&&void 0!==s.name?s.name:t;o(r)&&("Symbol("===String(m).slice(0,7)&&(m="["+String(m).replace(/^Symbol\\(([^)]*)\\)/,"$1")+"]"),(!i(r,"name")||f&&r.name!==m)&&a(r,"name",m),(l=h(r)).source||(l.source=d.join("string"==typeof m?m:""))),e!==n?(p?!v&&e[t]&&(y=!0):delete e[t],y?e[t]=r:a(e,t,r)):y?e[t]=r:u(t,r)})(Function.prototype,"toString",(function toString(){return o(this)&&p(this).source||s(this)}))},4488:(e,t,r)=>{var n=r(7854).TypeError;e.exports=function(e){if(null==e)throw n("Can\'t call method on "+e);return e}},3505:(e,t,r)=>{var n=r(7854),o=Object.defineProperty;e.exports=function(e,t){try{o(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},6340:(e,t,r)=>{"use strict";var n=r(5005),o=r(3070),i=r(5112),a=r(9781),u=i("species");e.exports=function(e){var t=n(e),r=o.f;a&&t&&!t[u]&&r(t,u,{configurable:!0,get:function(){return this}})}},8003:(e,t,r)=>{var n=r(3070).f,o=r(2597),i=r(5112)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!o(e,i)&&n(e,i,{configurable:!0,value:t})}},6200:(e,t,r)=>{var n=r(2309),o=r(9711),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},5465:(e,t,r)=>{var n=r(7854),o=r(3505),i="__core-js_shared__",a=n[i]||o(i,{});e.exports=a},2309:(e,t,r)=>{var n=r(1913),o=r(5465);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.1",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},6707:(e,t,r)=>{var n=r(9670),o=r(9483),i=r(5112)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||null==(r=n(a)[i])?t:o(r)}},8710:(e,t,r)=>{var n=r(1702),o=r(9303),i=r(1340),a=r(4488),u=n("".charAt),s=n("".charCodeAt),l=n("".slice),createMethod=function(e){return function(t,r){var n,f,p=i(a(t)),h=o(r),d=p.length;return h<0||h>=d?e?"":void 0:(n=s(p,h))<55296||n>56319||h+1===d||(f=s(p,h+1))<56320||f>57343?e?u(p,h):n:e?l(p,h,h+2):f-56320+(n-55296<<10)+65536}};e.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},261:(e,t,r)=>{var n,o,i,a,u=r(7854),s=r(2104),l=r(9974),f=r(614),p=r(2597),h=r(7293),d=r(490),y=r(206),v=r(317),m=r(6833),g=r(5268),b=u.setImmediate,w=u.clearImmediate,_=u.process,x=u.Dispatch,P=u.Function,k=u.MessageChannel,S=u.String,E=0,O={},T="onreadystatechange";try{n=u.location}catch(e){}var run=function(e){if(p(O,e)){var t=O[e];delete O[e],t()}},runner=function(e){return function(){run(e)}},listener=function(e){run(e.data)},post=function(e){u.postMessage(S(e),n.protocol+"//"+n.host)};b&&w||(b=function setImmediate(e){var t=y(arguments,1);return O[++E]=function(){s(f(e)?e:P(e),void 0,t)},o(E),E},w=function clearImmediate(e){delete O[e]},g?o=function(e){_.nextTick(runner(e))}:x&&x.now?o=function(e){x.now(runner(e))}:k&&!m?(a=(i=new k).port2,i.port1.onmessage=listener,o=l(a.postMessage,a)):u.addEventListener&&f(u.postMessage)&&!u.importScripts&&n&&"file:"!==n.protocol&&!h(post)?(o=post,u.addEventListener("message",listener,!1)):o=T in v("script")?function(e){d.appendChild(v("script"))[T]=function(){d.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)}),e.exports={set:b,clear:w}},1400:(e,t,r)=>{var n=r(9303),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},5656:(e,t,r)=>{var n=r(8361),o=r(4488);e.exports=function(e){return n(o(e))}},9303:e=>{var t=Math.ceil,r=Math.floor;e.exports=function(e){var n=+e;return n!=n||0===n?0:(n>0?r:t)(n)}},7466:(e,t,r)=>{var n=r(9303),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},7908:(e,t,r)=>{var n=r(7854),o=r(4488),i=n.Object;e.exports=function(e){return i(o(e))}},7593:(e,t,r)=>{var n=r(7854),o=r(6916),i=r(111),a=r(2190),u=r(8173),s=r(2140),l=r(5112),f=n.TypeError,p=l("toPrimitive");e.exports=function(e,t){if(!i(e)||a(e))return e;var r,n=u(e,p);if(n){if(void 0===t&&(t="default"),r=o(n,e,t),!i(r)||a(r))return r;throw f("Can\'t convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},4948:(e,t,r)=>{var n=r(7593),o=r(2190);e.exports=function(e){var t=n(e,"string");return o(t)?t:t+""}},1694:(e,t,r)=>{var n={};n[r(5112)("toStringTag")]="z",e.exports="[object z]"===String(n)},1340:(e,t,r)=>{var n=r(7854),o=r(648),i=n.String;e.exports=function(e){if("Symbol"===o(e))throw TypeError("Cannot convert a Symbol value to a string");return i(e)}},6330:(e,t,r)=>{var n=r(7854).String;e.exports=function(e){try{return n(e)}catch(e){return"Object"}}},9711:(e,t,r)=>{var n=r(1702),o=0,i=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},3307:(e,t,r)=>{var n=r(133);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},6061:(e,t,r)=>{var n=r(5112);t.f=n},5112:(e,t,r)=>{var n=r(7854),o=r(2309),i=r(2597),a=r(9711),u=r(133),s=r(3307),l=o("wks"),f=n.Symbol,p=f&&f.for,h=s?f:f&&f.withoutSetter||a;e.exports=function(e){if(!i(l,e)||!u&&"string"!=typeof l[e]){var t="Symbol."+e;u&&i(f,e)?l[e]=f[e]:l[e]=s&&p?p(t):h(t)}return l[e]}},2222:(e,t,r)=>{"use strict";var n=r(2109),o=r(7854),i=r(7293),a=r(3157),u=r(111),s=r(7908),l=r(6244),f=r(6135),p=r(5417),h=r(1194),d=r(5112),y=r(7392),v=d("isConcatSpreadable"),m=9007199254740991,g="Maximum allowed index exceeded",b=o.TypeError,w=y>=51||!i((function(){var e=[];return e[v]=!1,e.concat()[0]!==e})),_=h("concat"),isConcatSpreadable=function(e){if(!u(e))return!1;var t=e[v];return void 0!==t?!!t:a(e)};n({target:"Array",proto:!0,forced:!w||!_},{concat:function concat(e){var t,r,n,o,i,a=s(this),u=p(a,0),h=0;for(t=-1,n=arguments.length;t<n;t++)if(isConcatSpreadable(i=-1===t?a:arguments[t])){if(h+(o=l(i))>m)throw b(g);for(r=0;r<o;r++,h++)r in i&&f(u,h,i[r])}else{if(h>=m)throw b(g);f(u,h++,i)}return u.length=h,u}})},9554:(e,t,r)=>{"use strict";var n=r(2109),o=r(8533);n({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},6992:(e,t,r)=>{"use strict";var n=r(5656),o=r(1223),i=r(7497),a=r(9909),u=r(3070).f,s=r(654),l=r(1913),f=r(9781),p="Array Iterator",h=a.set,d=a.getterFor(p);e.exports=s(Array,"Array",(function(e,t){h(this,{type:p,target:n(e),index:0,kind:t})}),(function(){var e=d(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");var y=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!l&&f&&"values"!==y.name)try{u(y,"name",{value:"values"})}catch(e){}},5069:(e,t,r)=>{"use strict";var n=r(2109),o=r(1702),i=r(3157),a=o([].reverse),u=[1,2];n({target:"Array",proto:!0,forced:String(u)===String(u.reverse())},{reverse:function reverse(){return i(this)&&(this.length=this.length),a(this)}})},7042:(e,t,r)=>{"use strict";var n=r(2109),o=r(7854),i=r(3157),a=r(4411),u=r(111),s=r(1400),l=r(6244),f=r(5656),p=r(6135),h=r(5112),d=r(1194),y=r(206),v=d("slice"),m=h("species"),g=o.Array,b=Math.max;n({target:"Array",proto:!0,forced:!v},{slice:function slice(e,t){var r,n,o,h=f(this),d=l(h),v=s(e,d),w=s(void 0===t?d:t,d);if(i(h)&&(r=h.constructor,(a(r)&&(r===g||i(r.prototype))||u(r)&&null===(r=r[m]))&&(r=void 0),r===g||void 0===r))return y(h,v,w);for(n=new(void 0===r?g:r)(b(w-v,0)),o=0;v<w;v++,o++)v in h&&p(n,o,h[v]);return n.length=o,n}})},3843:(e,t,r)=>{var n=r(2109),o=r(7854),i=r(1702),a=o.Date,u=i(a.prototype.getTime);n({target:"Date",stat:!0},{now:function now(){return u(new a)}})},3710:(e,t,r)=>{var n=r(1702),o=r(1320),i=Date.prototype,a="Invalid Date",u="toString",s=n(i[u]),l=n(i.getTime);String(new Date(NaN))!=a&&o(i,u,(function toString(){var e=l(this);return e==e?s(this):a}))},8309:(e,t,r)=>{var n=r(9781),o=r(6530).EXISTS,i=r(1702),a=r(3070).f,u=Function.prototype,s=i(u.toString),l=/function\\b(?:\\s|\\/\\*[\\S\\s]*?\\*\\/|\\/\\/[^\\n\\r]*[\\n\\r]+)*([^\\s(/]*)/,f=i(l.exec);n&&!o&&a(u,"name",{configurable:!0,get:function(){try{return f(l,s(this))[1]}catch(e){return""}}})},3706:(e,t,r)=>{var n=r(7854);r(8003)(n.JSON,"JSON",!0)},408:(e,t,r)=>{r(8003)(Math,"Math",!0)},8011:(e,t,r)=>{r(2109)({target:"Object",stat:!0,sham:!r(9781)},{create:r(30)})},9070:(e,t,r)=>{var n=r(2109),o=r(9781);n({target:"Object",stat:!0,forced:!o,sham:!o},{defineProperty:r(3070).f})},489:(e,t,r)=>{var n=r(2109),o=r(7293),i=r(7908),a=r(9518),u=r(8544);n({target:"Object",stat:!0,forced:o((function(){a(1)})),sham:!u},{getPrototypeOf:function getPrototypeOf(e){return a(i(e))}})},8304:(e,t,r)=>{r(2109)({target:"Object",stat:!0},{setPrototypeOf:r(7674)})},1539:(e,t,r)=>{var n=r(1694),o=r(1320),i=r(288);n||o(Object.prototype,"toString",i,{unsafe:!0})},8674:(e,t,r)=>{"use strict";var n,o,i,a,u=r(2109),s=r(1913),l=r(7854),f=r(5005),p=r(6916),h=r(3366),d=r(1320),y=r(2248),v=r(7674),m=r(8003),g=r(6340),b=r(9662),w=r(614),_=r(111),x=r(5787),P=r(2788),k=r(612),S=r(7072),E=r(6707),O=r(261).set,T=r(5948),C=r(9478),j=r(842),D=r(8523),A=r(2534),I=r(8572),R=r(9909),K=r(4705),M=r(5112),B=r(7871),L=r(5268),N=r(7392),q=M("species"),G="Promise",W=R.getterFor(G),V=R.set,U=R.getterFor(G),z=h&&h.prototype,H=h,Y=z,$=l.TypeError,Q=l.document,X=l.process,Z=D.f,J=Z,ee=!!(Q&&Q.createEvent&&l.dispatchEvent),te=w(l.PromiseRejectionEvent),re="unhandledrejection",ne=!1,oe=K(G,(function(){var e=P(H),t=e!==String(H);if(!t&&66===N)return!0;if(s&&!Y.finally)return!0;if(N>=51&&/native code/.test(e))return!1;var r=new H((function(e){e(1)})),FakePromise=function(e){e((function(){}),(function(){}))};return(r.constructor={})[q]=FakePromise,!(ne=r.then((function(){}))instanceof FakePromise)||!t&&B&&!te})),ie=oe||!S((function(e){H.all(e).catch((function(){}))})),isThenable=function(e){var t;return!(!_(e)||!w(t=e.then))&&t},callReaction=function(e,t){var r,n,o,i=t.value,a=1==t.state,u=a?e.ok:e.fail,s=e.resolve,l=e.reject,f=e.domain;try{u?(a||(2===t.rejection&&onHandleUnhandled(t),t.rejection=1),!0===u?r=i:(f&&f.enter(),r=u(i),f&&(f.exit(),o=!0)),r===e.promise?l($("Promise-chain cycle")):(n=isThenable(r))?p(n,r,s,l):s(r)):l(i)}catch(e){f&&!o&&f.exit(),l(e)}},notify=function(e,t){e.notified||(e.notified=!0,T((function(){for(var r,n=e.reactions;r=n.get();)callReaction(r,e);e.notified=!1,t&&!e.rejection&&onUnhandled(e)})))},dispatchEvent=function(e,t,r){var n,o;ee?((n=Q.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),l.dispatchEvent(n)):n={promise:t,reason:r},!te&&(o=l["on"+e])?o(n):e===re&&j("Unhandled promise rejection",r)},onUnhandled=function(e){p(O,l,(function(){var t,r=e.facade,n=e.value;if(isUnhandled(e)&&(t=A((function(){L?X.emit("unhandledRejection",n,r):dispatchEvent(re,r,n)})),e.rejection=L||isUnhandled(e)?2:1,t.error))throw t.value}))},isUnhandled=function(e){return 1!==e.rejection&&!e.parent},onHandleUnhandled=function(e){p(O,l,(function(){var t=e.facade;L?X.emit("rejectionHandled",t):dispatchEvent("rejectionhandled",t,e.value)}))},bind=function(e,t,r){return function(n){e(t,n,r)}},internalReject=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,notify(e,!0))},internalResolve=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw $("Promise can\'t be resolved itself");var n=isThenable(t);n?T((function(){var r={done:!1};try{p(n,t,bind(internalResolve,r,e),bind(internalReject,r,e))}catch(t){internalReject(r,t,e)}})):(e.value=t,e.state=1,notify(e,!1))}catch(t){internalReject({done:!1},t,e)}}};if(oe&&(Y=(H=function Promise(e){x(this,Y),b(e),p(n,this);var t=W(this);try{e(bind(internalResolve,t),bind(internalReject,t))}catch(e){internalReject(t,e)}}).prototype,(n=function Promise(e){V(this,{type:G,done:!1,notified:!1,parent:!1,reactions:new I,rejection:!1,state:0,value:void 0})}).prototype=y(Y,{then:function then(e,t){var r=U(this),n=Z(E(this,H));return r.parent=!0,n.ok=!w(e)||e,n.fail=w(t)&&t,n.domain=L?X.domain:void 0,0==r.state?r.reactions.add(n):T((function(){callReaction(n,r)})),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n,t=W(e);this.promise=e,this.resolve=bind(internalResolve,t),this.reject=bind(internalReject,t)},D.f=Z=function(e){return e===H||e===i?new o(e):J(e)},!s&&w(h)&&z!==Object.prototype)){a=z.then,ne||(d(z,"then",(function then(e,t){var r=this;return new H((function(e,t){p(a,r,e,t)})).then(e,t)}),{unsafe:!0}),d(z,"catch",Y.catch,{unsafe:!0}));try{delete z.constructor}catch(e){}v&&v(z,Y)}u({global:!0,wrap:!0,forced:oe},{Promise:H}),m(H,G,!1,!0),g(G),i=f(G),u({target:G,stat:!0,forced:oe},{reject:function reject(e){var t=Z(this);return p(t.reject,void 0,e),t.promise}}),u({target:G,stat:!0,forced:s||oe},{resolve:function resolve(e){return C(s&&this===i?H:this,e)}}),u({target:G,stat:!0,forced:ie},{all:function all(e){var t=this,r=Z(t),n=r.resolve,o=r.reject,i=A((function(){var r=b(t.resolve),i=[],a=0,u=1;k(e,(function(e){var s=a++,l=!1;u++,p(r,t,e).then((function(e){l||(l=!0,i[s]=e,--u||n(i))}),o)})),--u||n(i)}));return i.error&&o(i.value),r.promise},race:function race(e){var t=this,r=Z(t),n=r.reject,o=A((function(){var o=b(t.resolve);k(e,(function(e){p(o,t,e).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}})},2419:(e,t,r)=>{var n=r(2109),o=r(5005),i=r(2104),a=r(7065),u=r(9483),s=r(9670),l=r(111),f=r(30),p=r(7293),h=o("Reflect","construct"),d=Object.prototype,y=[].push,v=p((function(){function F(){}return!(h((function(){}),[],F)instanceof F)})),m=!p((function(){h((function(){}))})),g=v||m;n({target:"Reflect",stat:!0,forced:g,sham:g},{construct:function construct(e,t){u(e),s(t);var r=arguments.length<3?e:u(arguments[2]);if(m&&!v)return h(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return i(y,n,t),new(i(a,e,n))}var o=r.prototype,p=f(l(o)?o:d),g=i(e,p,t);return l(g)?g:p}})},8783:(e,t,r)=>{"use strict";var n=r(8710).charAt,o=r(1340),i=r(9909),a=r(654),u="String Iterator",s=i.set,l=i.getterFor(u);a(String,"String",(function(e){s(this,{type:u,string:o(e),index:0})}),(function next(){var e,t=l(this),r=t.string,o=t.index;return o>=r.length?{value:void 0,done:!0}:(e=n(r,o),t.index+=e.length,{value:e,done:!1})}))},2443:(e,t,r)=>{r(7235)("asyncIterator")},1817:(e,t,r)=>{"use strict";var n=r(2109),o=r(9781),i=r(7854),a=r(1702),u=r(2597),s=r(614),l=r(7976),f=r(1340),p=r(3070).f,h=r(9920),d=i.Symbol,y=d&&d.prototype;if(o&&s(d)&&(!("description"in y)||void 0!==d().description)){var v={},m=function Symbol(){var e=arguments.length<1||void 0===arguments[0]?void 0:f(arguments[0]),t=l(y,this)?new d(e):void 0===e?d():d(e);return""===e&&(v[t]=!0),t};h(m,d),m.prototype=y,y.constructor=m;var g="Symbol(test)"==String(d("test")),b=a(y.toString),w=a(y.valueOf),_=/^Symbol\\((.*)\\)[^)]+$/,x=a("".replace),P=a("".slice);p(y,"description",{configurable:!0,get:function description(){var e=w(this),t=b(e);if(u(v,e))return"";var r=g?P(t,7,-1):x(t,_,"$1");return""===r?void 0:r}}),n({global:!0,forced:!0},{Symbol:m})}},2165:(e,t,r)=>{r(7235)("iterator")},2526:(e,t,r)=>{"use strict";var n=r(2109),o=r(7854),i=r(5005),a=r(2104),u=r(6916),s=r(1702),l=r(1913),f=r(9781),p=r(133),h=r(7293),d=r(2597),y=r(3157),v=r(614),m=r(111),g=r(7976),b=r(2190),w=r(9670),_=r(7908),x=r(5656),P=r(4948),k=r(1340),S=r(9114),E=r(30),O=r(1956),T=r(8006),C=r(1156),j=r(5181),D=r(1236),A=r(3070),I=r(5296),R=r(206),K=r(1320),M=r(2309),B=r(6200),L=r(3501),N=r(9711),q=r(5112),G=r(6061),W=r(7235),V=r(8003),U=r(9909),z=r(2092).forEach,H=B("hidden"),Y="Symbol",$="prototype",Q=q("toPrimitive"),X=U.set,Z=U.getterFor(Y),J=Object[$],ee=o.Symbol,te=ee&&ee[$],re=o.TypeError,ne=o.QObject,oe=i("JSON","stringify"),ie=D.f,ae=A.f,ue=C.f,ce=I.f,se=s([].push),le=M("symbols"),fe=M("op-symbols"),pe=M("string-to-symbol-registry"),he=M("symbol-to-string-registry"),de=M("wks"),ye=!ne||!ne[$]||!ne[$].findChild,ve=f&&h((function(){return 7!=E(ae({},"a",{get:function(){return ae(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=ie(J,t);n&&delete J[t],ae(e,t,r),n&&e!==J&&ae(J,t,n)}:ae,wrap=function(e,t){var r=le[e]=E(te);return X(r,{type:Y,tag:e,description:t}),f||(r.description=t),r},me=function defineProperty(e,t,r){e===J&&me(fe,t,r),w(e);var n=P(t);return w(r),d(le,n)?(r.enumerable?(d(e,H)&&e[H][n]&&(e[H][n]=!1),r=E(r,{enumerable:S(0,!1)})):(d(e,H)||ae(e,H,S(1,{})),e[H][n]=!0),ve(e,n,r)):ae(e,n,r)},ge=function defineProperties(e,t){w(e);var r=x(t),n=O(r).concat(xe(r));return z(n,(function(t){f&&!u(be,r,t)||me(e,t,r[t])})),e},be=function propertyIsEnumerable(e){var t=P(e),r=u(ce,this,t);return!(this===J&&d(le,t)&&!d(fe,t))&&(!(r||!d(this,t)||!d(le,t)||d(this,H)&&this[H][t])||r)},we=function getOwnPropertyDescriptor(e,t){var r=x(e),n=P(t);if(r!==J||!d(le,n)||d(fe,n)){var o=ie(r,n);return!o||!d(le,n)||d(r,H)&&r[H][n]||(o.enumerable=!0),o}},_e=function getOwnPropertyNames(e){var t=ue(x(e)),r=[];return z(t,(function(e){d(le,e)||d(L,e)||se(r,e)})),r},xe=function getOwnPropertySymbols(e){var t=e===J,r=ue(t?fe:x(e)),n=[];return z(r,(function(e){!d(le,e)||t&&!d(J,e)||se(n,le[e])})),n};(p||(K(te=(ee=function Symbol(){if(g(te,this))throw re("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?k(arguments[0]):void 0,t=N(e),setter=function(e){this===J&&u(setter,fe,e),d(this,H)&&d(this[H],t)&&(this[H][t]=!1),ve(this,t,S(1,e))};return f&&ye&&ve(J,t,{configurable:!0,set:setter}),wrap(t,e)})[$],"toString",(function toString(){return Z(this).tag})),K(ee,"withoutSetter",(function(e){return wrap(N(e),e)})),I.f=be,A.f=me,D.f=we,T.f=C.f=_e,j.f=xe,G.f=function(e){return wrap(q(e),e)},f&&(ae(te,"description",{configurable:!0,get:function description(){return Z(this).description}}),l||K(J,"propertyIsEnumerable",be,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!p,sham:!p},{Symbol:ee}),z(O(de),(function(e){W(e)})),n({target:Y,stat:!0,forced:!p},{for:function(e){var t=k(e);if(d(pe,t))return pe[t];var r=ee(t);return pe[t]=r,he[r]=t,r},keyFor:function keyFor(e){if(!b(e))throw re(e+" is not a symbol");if(d(he,e))return he[e]},useSetter:function(){ye=!0},useSimple:function(){ye=!1}}),n({target:"Object",stat:!0,forced:!p,sham:!f},{create:function create(e,t){return void 0===t?E(e):ge(E(e),t)},defineProperty:me,defineProperties:ge,getOwnPropertyDescriptor:we}),n({target:"Object",stat:!0,forced:!p},{getOwnPropertyNames:_e,getOwnPropertySymbols:xe}),n({target:"Object",stat:!0,forced:h((function(){j.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(e){return j.f(_(e))}}),oe)&&n({target:"JSON",stat:!0,forced:!p||h((function(){var e=ee();return"[null]"!=oe([e])||"{}"!=oe({a:e})||"{}"!=oe(Object(e))}))},{stringify:function stringify(e,t,r){var n=R(arguments),o=t;if((m(t)||void 0!==e)&&!b(e))return y(t)||(t=function(e,t){if(v(o)&&(t=u(o,this,e,t)),!b(t))return t}),n[1]=t,a(oe,null,n)}});if(!te[Q]){var Pe=te.valueOf;K(te,Q,(function(e){return u(Pe,this)}))}V(ee,Y),L[H]=!0},9341:(e,t,r)=>{r(7235)("toStringTag")},4747:(e,t,r)=>{var n=r(7854),o=r(8324),i=r(8509),a=r(8533),u=r(8880),handlePrototype=function(e){if(e&&e.forEach!==a)try{u(e,"forEach",a)}catch(t){e.forEach=a}};for(var s in o)o[s]&&handlePrototype(n[s]&&n[s].prototype);handlePrototype(i)},3948:(e,t,r)=>{var n=r(7854),o=r(8324),i=r(8509),a=r(6992),u=r(8880),s=r(5112),l=s("iterator"),f=s("toStringTag"),p=a.values,handlePrototype=function(e,t){if(e){if(e[l]!==p)try{u(e,l,p)}catch(t){e[l]=p}if(e[f]||u(e,f,t),o[t])for(var r in a)if(e[r]!==a[r])try{u(e,r,a[r])}catch(t){e[r]=a[r]}}};for(var h in o)handlePrototype(n[h]&&n[h].prototype,h);handlePrototype(i,"DOMTokenList")}},t={};function __webpack_require__(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,__webpack_require__),o.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";__webpack_require__(9070),__webpack_require__(2526),__webpack_require__(1817),__webpack_require__(1539),__webpack_require__(2165),__webpack_require__(6992),__webpack_require__(8783),__webpack_require__(3948),__webpack_require__(2443),__webpack_require__(9341),__webpack_require__(3706),__webpack_require__(408),__webpack_require__(8011),__webpack_require__(489),__webpack_require__(9554),__webpack_require__(4747),__webpack_require__(8309),__webpack_require__(8304),__webpack_require__(8674),__webpack_require__(7042);function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function _next(e){asyncGeneratorStep(i,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}__webpack_require__(3710),__webpack_require__(5069),__webpack_require__(2222),__webpack_require__(3843);var e=__webpack_require__(4073),t=__webpack_require__.n(e);__webpack_require__(2419);function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _toPropertyKey(e){var t=function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return e}(e)}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}var __assign=function(){return __assign=Object.assign||function __assign(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__assign.apply(this,arguments)};function __spreadArrays(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n}var r=Object.keys,n=Array.isArray,o="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function extend(e,t){return"object"!=typeof t||r(t).forEach((function(r){e[r]=t[r]})),e}"undefined"==typeof Promise||o.Promise||(o.Promise=Promise);var i=Object.getPrototypeOf,a={}.hasOwnProperty;function hasOwn(e,t){return a.call(e,t)}function props(e,t){"function"==typeof t&&(t=t(i(e))),r(t).forEach((function(r){setProp(e,r,t[r])}))}var u=Object.defineProperty;function setProp(e,t,r,n){u(e,t,extend(r&&hasOwn(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function derive(e){return{from:function(t){return e.prototype=Object.create(t.prototype),setProp(e.prototype,"constructor",e),{extend:props.bind(null,e.prototype)}}}}var s=Object.getOwnPropertyDescriptor;function getPropertyDescriptor(e,t){var r;return s(e,t)||(r=i(e))&&getPropertyDescriptor(r,t)}var l=[].slice;function slice(e,t,r){return l.call(e,t,r)}function override(e,t){return t(e)}function assert(e){if(!e)throw new Error("Assertion Failed")}function asap(e){o.setImmediate?setImmediate(e):setTimeout(e,0)}function arrayToObject(e,t){return e.reduce((function(e,r,n){var o=t(r,n);return o&&(e[o[0]]=o[1]),e}),{})}function getByKeyPath(e,t){if(hasOwn(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,o=t.length;n<o;++n){var i=getByKeyPath(e,t[n]);r.push(i)}return r}var a=t.indexOf(".");if(-1!==a){var u=e[t.substr(0,a)];return void 0===u?void 0:getByKeyPath(u,t.substr(a+1))}}function setByKeyPath(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){assert("string"!=typeof r&&"length"in r);for(var o=0,i=t.length;o<i;++o)setByKeyPath(e,t[o],r[o])}else{var a=t.indexOf(".");if(-1!==a){var u=t.substr(0,a),s=t.substr(a+1);if(""===s)void 0===r?n(e)&&!isNaN(parseInt(u))?e.splice(u,1):delete e[u]:e[u]=r;else{var l=e[u];l||(l=e[u]={}),setByKeyPath(l,s,r)}}else void 0===r?n(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function delByKeyPath(e,t){"string"==typeof t?setByKeyPath(e,t,void 0):"length"in t&&[].map.call(t,(function(t){setByKeyPath(e,t,void 0)}))}function shallowClone(e){var t={};for(var r in e)hasOwn(e,r)&&(t[r]=e[r]);return t}var f=[].concat;function flatten(e){return f.apply([],e)}var p="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(flatten([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return o[e]})),h=p.map((function(e){return o[e]})),d=arrayToObject(p,(function(e){return[e,!0]}));function deepClone(e){if(!e||"object"!=typeof e)return e;var t;if(n(e)){t=[];for(var r=0,o=e.length;r<o;++r)t.push(deepClone(e[r]))}else if(h.indexOf(e.constructor)>=0)t=e;else for(var i in t=e.constructor?Object.create(e.constructor.prototype):{},e)hasOwn(e,i)&&(t[i]=deepClone(e[i]));return t}var y={}.toString;function toStringTag(e){return y.call(e).slice(8,-1)}var getValueOf=function(e,t){return"Array"===t?""+e.map((function(e){return getValueOf(e,toStringTag(e))})):"ArrayBuffer"===t?""+new Uint8Array(e):"Date"===t?e.getTime():ArrayBuffer.isView(e)?""+new Uint8Array(e.buffer):e};function getObjectDiff(e,t,n,o){return n=n||{},o=o||"",r(e).forEach((function(r){if(hasOwn(t,r)){var i=e[r],a=t[r];if("object"==typeof i&&"object"==typeof a&&i&&a){var u=toStringTag(i),s=toStringTag(a);u===s?d[u]?getValueOf(i,u)!==getValueOf(a,s)&&(n[o+r]=t[r]):getObjectDiff(i,a,n,o+r+"."):n[o+r]=t[r]}else i!==a&&(n[o+r]=t[r])}else n[o+r]=void 0})),r(t).forEach((function(r){hasOwn(e,r)||(n[o+r]=t[r])})),n}var v="undefined"!=typeof Symbol&&Symbol.iterator,m=v?function(e){var t;return null!=e&&(t=e[v])&&t.apply(e)}:function(){return null},g={};function getArrayOf(e){var t,r,o,i;if(1===arguments.length){if(n(e))return e.slice();if(this===g&&"string"==typeof e)return[e];if(i=m(e)){for(r=[];!(o=i.next()).done;)r.push(o.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=new Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=new Array(t);t--;)r[t]=arguments[t];return r}var b="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},w="undefined"!=typeof location&&/^(http|https):\\/\\/(localhost|127\\.0\\.0\\.1)/.test(location.href);function setDebug(e,t){w=e,libraryFilter=t}var libraryFilter=function(){return!0},_=!new Error("").stack;function getErrorWithStack(){if(_)try{throw new Error}catch(e){return e}return new Error}function prettyStack(e,t){var r=e.stack;return r?(t=t||0,0===r.indexOf(e.name)&&(t+=(e.name+e.message).split("\\n").length),r.split("\\n").slice(t).filter(libraryFilter).map((function(e){return"\\n"+e})).join("")):""}var x=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],P=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(x),k={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function DexieError(e,t){this._e=getErrorWithStack(),this.name=e,this.message=t}function getMultiErrorMessage(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,r){return r.indexOf(e)===t})).join("\\n")}function ModifyError(e,t,r,n){this._e=getErrorWithStack(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=getMultiErrorMessage(e,t)}function BulkError(e,t){this._e=getErrorWithStack(),this.name="BulkError",this.failures=t,this.message=getMultiErrorMessage(e,t)}derive(DexieError).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+prettyStack(this._e,2))}},toString:function(){return this.name+": "+this.message}}),derive(ModifyError).from(DexieError),derive(BulkError).from(DexieError);var S=P.reduce((function(e,t){return e[t]=t+"Error",e}),{}),E=DexieError,O=P.reduce((function(e,t){var r=t+"Error";function DexieError(e,n){this._e=getErrorWithStack(),this.name=r,e?"string"==typeof e?(this.message=e+(n?"\\n "+n:""),this.inner=n||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=k[t]||r,this.inner=null)}return derive(DexieError).from(E),e[t]=DexieError,e}),{});O.Syntax=SyntaxError,O.Type=TypeError,O.Range=RangeError;var T=x.reduce((function(e,t){return e[t+"Error"]=O[t],e}),{});var C=P.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=O[t]),e}),{});function nop(){}function mirror(e){return e}function pureFunctionChain(e,t){return null==e||e===mirror?t:function(r){return t(e(r))}}function callBoth(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function hookCreatingChain(e,t){return e===nop?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?callBoth(n,this.onsuccess):n),o&&(this.onerror=this.onerror?callBoth(o,this.onerror):o),void 0!==i?i:r}}function hookDeletingChain(e,t){return e===nop?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?callBoth(r,this.onsuccess):r),n&&(this.onerror=this.onerror?callBoth(n,this.onerror):n)}}function hookUpdatingChain(e,t){return e===nop?t:function(r){var n=e.apply(this,arguments);extend(r,n);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?callBoth(o,this.onsuccess):o),i&&(this.onerror=this.onerror?callBoth(i,this.onerror):i),void 0===n?void 0===a?void 0:a:extend(n,a)}}function reverseStoppableEventChain(e,t){return e===nop?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function promisableChain(e,t){return e===nop?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return r.then((function(){return t.apply(n,i)}))}return t.apply(this,arguments)}}C.ModifyError=ModifyError,C.DexieError=DexieError,C.BulkError=BulkError;var j={},D="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,e.__proto__,e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,t.__proto__,e]}(),A=D[0],I=D[1],R=D[2],K=I&&I.then,M=A&&A.constructor,B=!!R,L=!1,N=R?function(){R.then(physicalTick)}:o.setImmediate?setImmediate.bind(null,physicalTick):o.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){physicalTick(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(physicalTick,0)},asap$1=function(e,t){$.push([e,t]),G&&(N(),G=!1)},q=!0,G=!0,W=[],V=[],U=null,z=mirror,H={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:globalError,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{globalError(e[0],e[1])}catch(e){}}))}},Y=H,$=[],Q=0,X=[];function DexiePromise(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=nop,this._lib=!1;var t=this._PSD=Y;if(w&&(this._stackHolder=getErrorWithStack(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==j)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&handleRejection(this,this._value))}this._state=null,this._value=null,++t.ref,executePromiseTask(this,e)}var Z={get:function(){var e=Y,t=ne;function then(r,n){var o=this,i=!e.global&&(e!==Y||t!==ne),a=i&&!decrementExpectedAwaits(),u=new DexiePromise((function(t,u){propagateToListener(o,new Listener(nativeAwaitCompatibleWrap(r,e,i,a),nativeAwaitCompatibleWrap(n,e,i,a),t,u,e))}));return w&&linkToPreviousPromise(u,this),u}return then.prototype=j,then},set:function(e){setProp(this,"then",e&&e.prototype===j?Z:{get:function(){return e},set:Z.set})}};function Listener(e,t,r,n,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=o}function executePromiseTask(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var r=e._lib&&beginMicroTickScope();t&&"function"==typeof t.then?executePromiseTask(e,(function(e,r){t instanceof DexiePromise?t._then(e,r):t.then(e,r)})):(e._state=!0,e._value=t,propagateAllListeners(e)),r&&endMicroTickScope()}}),handleRejection.bind(null,e))}catch(t){handleRejection(e,t)}}function handleRejection(e,t){if(V.push(t),null===e._state){var r=e._lib&&beginMicroTickScope();t=z(t),e._state=!1,e._value=t,w&&null!==t&&"object"==typeof t&&!t._promise&&function tryCatch(e,t,r){try{e.apply(null,r)}catch(e){t&&t(e)}}((function(){var r=getPropertyDescriptor(t,"stack");t._promise=e,setProp(t,"stack",{get:function(){return L?r&&(r.get?r.get.apply(t):r.value):e.stack}})})),function addPossiblyUnhandledError(e){W.some((function(t){return t._value===e._value}))||W.push(e)}(e),propagateAllListeners(e),r&&endMicroTickScope()}}function propagateAllListeners(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)propagateToListener(e,t[r]);var o=e._PSD;--o.ref||o.finalize(),0===Q&&(++Q,asap$1((function(){0==--Q&&finalizePhysicalTick()}),[]))}function propagateToListener(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++Q,asap$1(callListener,[r,e,t])}else e._listeners.push(t)}function callListener(e,t,r){try{U=t;var n,o=t._value;t._state?n=e(o):(V.length&&(V=[]),n=e(o),-1===V.indexOf(o)&&function markErrorAsHandled(e){var t=W.length;for(;t;)if(W[--t]._value===e._value)return void W.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{U=null,0==--Q&&finalizePhysicalTick(),--r.psd.ref||r.psd.finalize()}}function getStack(e,t,r){if(t.length===r)return t;var n="";if(!1===e._state){var o,i,a=e._value;null!=a?(o=a.name||"Error",i=a.message||a,n=prettyStack(a,0)):(o=a,i=""),t.push(o+(i?": "+i:"")+n)}return w&&((n=prettyStack(e._stackHolder,2))&&-1===t.indexOf(n)&&t.push(n),e._prev&&getStack(e._prev,t,r)),t}function linkToPreviousPromise(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function physicalTick(){beginMicroTickScope()&&endMicroTickScope()}function beginMicroTickScope(){var e=q;return q=!1,G=!1,e}function endMicroTickScope(){var e,t,r;do{for(;$.length>0;)for(e=$,$=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}}while($.length>0);q=!0,G=!0}function finalizePhysicalTick(){var e=W;W=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=X.slice(0),r=t.length;r;)t[--r]()}function PromiseReject(e){return new DexiePromise(j,!1,e)}function wrap(e,t){var r=Y;return function(){var n=beginMicroTickScope(),o=Y;try{return switchToZone(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{switchToZone(o,!1),n&&endMicroTickScope()}}}props(DexiePromise.prototype,{then:Z,_then:function(e,t){propagateToListener(this,new Listener(null,null,e,t,Y))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,(function(e){return e instanceof t?r(e):PromiseReject(e)})):this.then(null,(function(e){return e&&e.name===t?r(e):PromiseReject(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),PromiseReject(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{L=!0;var e=getStack(this,[],20).join("\\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{L=!1}}},timeout:function(e,t){var r=this;return e<1/0?new DexiePromise((function(n,o){var i=setTimeout((function(){return o(new O.Timeout(t))}),e);r.then(n,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&setProp(DexiePromise.prototype,Symbol.toStringTag,"Dexie.Promise"),H.env=snapShot(),props(DexiePromise,{all:function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t,r){0===e.length&&t([]);var n=e.length;e.forEach((function(o,i){return DexiePromise.resolve(o).then((function(r){e[i]=r,--n||t(e)}),r)}))}))},resolve:function(e){if(e instanceof DexiePromise)return e;if(e&&"function"==typeof e.then)return new DexiePromise((function(t,r){e.then(t,r)}));var t=new DexiePromise(j,!0,e);return linkToPreviousPromise(t,U),t},reject:PromiseReject,race:function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t,r){e.map((function(e){return DexiePromise.resolve(e).then(t,r)}))}))},PSD:{get:function(){return Y},set:function(e){return Y=e}},totalEchoes:{get:function(){return ne}},newPSD:newScope,usePSD,scheduler:{get:function(){return asap$1},set:function(e){asap$1=e}},rejectionMapper:{get:function(){return z},set:function(e){z=e}},follow:function(e,t){return new DexiePromise((function(r,n){return newScope((function(t,r){var n=Y;n.unhandleds=[],n.onunhandled=r,n.finalize=callBoth((function(){var e=this;!function run_at_end_of_this_or_next_physical_tick(e){function finalizer(){e(),X.splice(X.indexOf(finalizer),1)}X.push(finalizer),++Q,asap$1((function(){0==--Q&&finalizePhysicalTick()}),[])}((function(){0===e.unhandleds.length?t():r(e.unhandleds[0])}))}),n.finalize),e()}),t,r,n)}))}}),M&&(M.allSettled&&setProp(DexiePromise,"allSettled",(function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t){0===e.length&&t([]);var r=e.length,n=new Array(r);e.forEach((function(e,o){return DexiePromise.resolve(e).then((function(e){return n[o]={status:"fulfilled",value:e}}),(function(e){return n[o]={status:"rejected",reason:e}})).then((function(){return--r||t(n)}))}))}))})),M.any&&"undefined"!=typeof AggregateError&&setProp(DexiePromise,"any",(function(){var e=getArrayOf.apply(null,arguments).map(onPossibleParallellAsync);return new DexiePromise((function(t,r){0===e.length&&r(new AggregateError([]));var n=e.length,o=new Array(n);e.forEach((function(e,i){return DexiePromise.resolve(e).then((function(e){return t(e)}),(function(e){o[i]=e,--n||r(new AggregateError(o))}))}))}))})));var J={awaits:0,echoes:0,id:0},ee=0,te=[],re=0,ne=0,oe=0;function newScope(e,t,r,n){var o=Y,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++oe;var a=H.env;i.env=B?{Promise:DexiePromise,PromiseProp:{value:DexiePromise,configurable:!0,writable:!0},all:DexiePromise.all,race:DexiePromise.race,allSettled:DexiePromise.allSettled,any:DexiePromise.any,resolve:DexiePromise.resolve,reject:DexiePromise.reject,nthen:getPatchedPromiseThen(a.nthen,i),gthen:getPatchedPromiseThen(a.gthen,i)}:{},t&&extend(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=usePSD(i,e,r,n);return 0===i.ref&&i.finalize(),u}function incrementExpectedAwaits(){return J.id||(J.id=++ee),++J.awaits,J.echoes+=100,J.id}function decrementExpectedAwaits(){return!!J.awaits&&(0==--J.awaits&&(J.id=0),J.echoes=100*J.awaits,!0)}function onPossibleParallellAsync(e){return J.echoes&&e&&e.constructor===M?(incrementExpectedAwaits(),e.then((function(e){return decrementExpectedAwaits(),e}),(function(e){return decrementExpectedAwaits(),ae(e)}))):e}function zoneEnterEcho(e){++ne,J.echoes&&0!=--J.echoes||(J.echoes=J.id=0),te.push(Y),switchToZone(e,!0)}function zoneLeaveEcho(){var e=te[te.length-1];te.pop(),switchToZone(e,!1)}function switchToZone(e,t){var r=Y;if((t?!J.echoes||re++&&e===Y:!re||--re&&e===Y)||enqueueNativeMicroTask(t?zoneEnterEcho.bind(null,e):zoneLeaveEcho),e!==Y&&(Y=e,r===H&&(H.env=snapShot()),B)){var n=H.env.Promise,i=e.env;I.then=i.nthen,n.prototype.then=i.gthen,(r.global||e.global)&&(Object.defineProperty(o,"Promise",i.PromiseProp),n.all=i.all,n.race=i.race,n.resolve=i.resolve,n.reject=i.reject,i.allSettled&&(n.allSettled=i.allSettled),i.any&&(n.any=i.any))}}function snapShot(){var e=o.Promise;return B?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(o,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:I.then,gthen:e.prototype.then}:{}}function usePSD(e,t,r,n,o){var i=Y;try{return switchToZone(e,!0),t(r,n,o)}finally{switchToZone(i,!1)}}function enqueueNativeMicroTask(e){K.call(A,e)}function nativeAwaitCompatibleWrap(e,t,r,n){return"function"!=typeof e?e:function(){var o=Y;r&&incrementExpectedAwaits(),switchToZone(t,!0);try{return e.apply(this,arguments)}finally{switchToZone(o,!1),n&&enqueueNativeMicroTask(decrementExpectedAwaits)}}}function getPatchedPromiseThen(e,t){return function(r,n){return e.call(this,nativeAwaitCompatibleWrap(r,t),nativeAwaitCompatibleWrap(n,t))}}-1===(""+K).indexOf("[native code]")&&(incrementExpectedAwaits=decrementExpectedAwaits=nop);var ie="unhandledrejection";function globalError(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,i={promise:t,reason:e};if(o.document&&document.createEvent?((n=document.createEvent("Event")).initEvent(ie,!0,!0),extend(n,i)):o.CustomEvent&&extend(n=new CustomEvent(ie,{detail:i}),i),n&&o.dispatchEvent&&(dispatchEvent(n),!o.PromiseRejectionEvent&&o.onunhandledrejection))try{o.onunhandledrejection(n)}catch(e){}w&&n&&!n.defaultPrevented&&console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var ae=DexiePromise.reject;function tempTransaction(e,t,r,n){if(e._state.openComplete||Y.letThrough){var o=e._createTransaction(t,r,e._dbSchema);try{o.create()}catch(e){return ae(e)}return o._promise(t,(function(e,t){return newScope((function(){return Y.trans=o,n(e,t,o)}))})).then((function(e){return o._completion.then((function(){return e}))}))}if(!e._state.isBeingOpened){if(!e._options.autoOpen)return ae(new O.DatabaseClosed);e.open().catch(nop)}return e._state.dbReadyPromise.then((function(){return tempTransaction(e,t,r,n)}))}var ue="3.0.3",ce=String.fromCharCode(65535),se=-1/0,le="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",fe="String expected.",pe=[],he="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),de=he,ye=he,dexieStackFrameFilter=function(e){return!/(dexie\\.js|dexie\\.min\\.js)/.test(e)},ve="__dbnames",me="readonly",ge="readwrite";function combine(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var be={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function workaroundForUndefinedPrimKey(e){return function(t){return void 0===getByKeyPath(t,e)&&delByKeyPath(t=deepClone(t),e),t}}var we=function(){function Table(){}return Table.prototype._trans=function(e,t,r){var n=this._tx||Y.trans,o=this.name;function checkTableInTransaction(e,r,n){if(!n.schema[o])throw new O.NotFound("Table "+o+" not part of transaction");return t(n.idbtrans,n)}var i=beginMicroTickScope();try{return n&&n.db===this.db?n===Y.trans?n._promise(e,checkTableInTransaction,r):newScope((function(){return n._promise(e,checkTableInTransaction,r)}),{trans:n,transless:Y.transless||Y}):tempTransaction(this.db,e,[this.name],checkTableInTransaction)}finally{i&&endMicroTickScope()}},Table.prototype.get=function(e,t){var r=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(function(t){return r.core.get({trans:t,key:e}).then((function(e){return r.hook.reading.fire(e)}))})).then(t)},Table.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(n(e))return new this.db.WhereClause(this,"["+e.join("+")+"]");var t=r(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var o=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&t.every((function(t){return e.keyPath.indexOf(t)>=0}))&&e.keyPath.every((function(e){return t.indexOf(e)>=0}))}))[0];if(o&&this.db._maxKey!==ce)return this.where(o.name).equals(o.keyPath.map((function(t){return e[t]})));!o&&w&&console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var i=this.schema.idxByName,a=this.db._deps.indexedDB;function equals(e,t){try{return 0===a.cmp(e,t)}catch(e){return!1}}var u=t.reduce((function(t,r){var o=t[0],a=t[1],u=i[r],s=e[r];return[o||u,o||!u?combine(a,u&&u.multi?function(e){var t=getByKeyPath(e,r);return n(t)&&t.some((function(e){return equals(s,e)}))}:function(e){return equals(s,getByKeyPath(e,r))}):a]}),[null,null]),s=u[0],l=u[1];return s?this.where(s.name).equals(e[s.keyPath]).filter(l):o?this.filter(l):this.where(t).equals("")},Table.prototype.filter=function(e){return this.toCollection().and(e)},Table.prototype.count=function(e){return this.toCollection().count(e)},Table.prototype.offset=function(e){return this.toCollection().offset(e)},Table.prototype.limit=function(e){return this.toCollection().limit(e)},Table.prototype.each=function(e){return this.toCollection().each(e)},Table.prototype.toArray=function(e){return this.toCollection().toArray(e)},Table.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Table.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,n(e)?"["+e.join("+")+"]":e))},Table.prototype.reverse=function(){return this.toCollection().reverse()},Table.prototype.mapToClass=function(e){this.schema.mappedClass=e;var readHook=function(t){if(!t)return t;var r=Object.create(e.prototype);for(var n in t)if(hasOwn(t,n))try{r[n]=t[n]}catch(e){}return r};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=readHook,this.hook("reading",readHook),e},Table.prototype.defineClass=function(){return this.mapToClass((function Class(e){extend(this,e)}))},Table.prototype.add=function(e,t){var r=this,n=this.schema.primKey,o=n.auto,i=n.keyPath,a=e;return i&&o&&(a=workaroundForUndefinedPrimKey(i)(e)),this._trans("readwrite",(function(e){return r.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{setByKeyPath(e,i,t)}catch(e){}return t}))},Table.prototype.update=function(e,t){if("object"!=typeof t||n(t))throw new O.InvalidArgument("Modifications must be an object.");if("object"!=typeof e||n(e))return this.where(":id").equals(e).modify(t);r(t).forEach((function(r){setByKeyPath(e,r,t[r])}));var o=getByKeyPath(e,this.schema.primKey.keyPath);return void 0===o?ae(new O.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(o).modify(t)},Table.prototype.put=function(e,t){var r=this,n=this.schema.primKey,o=n.auto,i=n.keyPath,a=e;return i&&o&&(a=workaroundForUndefinedPrimKey(i)(e)),this._trans("readwrite",(function(e){return r.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{setByKeyPath(e,i,t)}catch(e){}return t}))},Table.prototype.delete=function(e){var t=this;return this._trans("readwrite",(function(r){return t.core.mutate({trans:r,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):void 0}))},Table.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:be})})).then((function(e){return e.numFailures?DexiePromise.reject(e.failures[0]):void 0}))},Table.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",(function(r){return t.core.getMany({keys:e,trans:r}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))},Table.prototype.bulkAdd=function(e,t,r){var n=this,o=Array.isArray(t)?t:void 0,i=(r=r||(o?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(function(t){var r=n.schema.primKey,a=r.auto,u=r.keyPath;if(u&&o)throw new O.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new O.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,l=u&&a?e.map(workaroundForUndefinedPrimKey(u)):e;return n.core.mutate({trans:t,type:"add",keys:o,values:l,wantResults:i}).then((function(e){var t=e.numFailures,r=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?r:o;throw new BulkError(n.name+".bulkAdd(): "+t+" of "+s+" operations failed",Object.keys(a).map((function(e){return a[e]})))}))}))},Table.prototype.bulkPut=function(e,t,r){var n=this,o=Array.isArray(t)?t:void 0,i=(r=r||(o?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(function(t){var r=n.schema.primKey,a=r.auto,u=r.keyPath;if(u&&o)throw new O.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new O.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,l=u&&a?e.map(workaroundForUndefinedPrimKey(u)):e;return n.core.mutate({trans:t,type:"put",keys:o,values:l,wantResults:i}).then((function(e){var t=e.numFailures,r=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?r:o;throw new BulkError(n.name+".bulkPut(): "+t+" of "+s+" operations failed",Object.keys(a).map((function(e){return a[e]})))}))}))},Table.prototype.bulkDelete=function(e){var t=this,r=e.length;return this._trans("readwrite",(function(r){return t.core.mutate({trans:r,type:"delete",keys:e})})).then((function(e){var n=e.numFailures,o=e.lastResult,i=e.failures;if(0===n)return o;throw new BulkError(t.name+".bulkDelete(): "+n+" of "+r+" operations failed",i)}))},Table}();function Events(e){var t={},rv=function(r,n){if(n){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return t[r].subscribe.apply(null,i),e}if("string"==typeof r)return t[r]};rv.addEventType=add;for(var o=1,i=arguments.length;o<i;++o)add(arguments[o]);return rv;function add(e,r,n){if("object"==typeof e)return addConfiguredEvents(e);r||(r=reverseStoppableEventChain),n||(n=nop);var o={subscribers:[],fire:n,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=r(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(r,n)}};return t[e]=rv[e]=o,o}function addConfiguredEvents(e){r(e).forEach((function(t){var r=e[t];if(n(r))add(t,e[t][0],e[t][1]);else{if("asap"!==r)throw new O.InvalidArgument("Invalid event config");var o=add(t,mirror,(function fire(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];o.subscribers.forEach((function(e){asap((function fireEvent(){e.apply(null,t)}))}))}))}}))}}function makeClassConstructor(e,t){return derive(t).from({prototype:e}),t}function isPlainKeyRange(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function addFilter(e,t){e.filter=combine(e.filter,t)}function addReplayFilter(e,t,r){var n=e.replayFilter;e.replayFilter=n?function(){return combine(n(),t())}:t,e.justLimit=r&&!n}function getIndexOrStore(e,t){if(e.isPrimKey)return t.primaryKey;var r=t.getIndexByKeyPath(e.index);if(!r)throw new O.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function openCursor(e,t,r){var n=getIndexOrStore(e,t.schema);return t.openCursor({trans:r,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:n,range:e.range}})}function iter(e,t,r,n){var o=e.replayFilter?combine(e.filter,e.replayFilter()):e.filter;if(e.or){var i={},union=function(e,r,n){if(!o||o(r,n,(function(e){return r.stop(e)}),(function(e){return r.fail(e)}))){var a=r.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),hasOwn(i,u)||(i[u]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(union,r),iterate(openCursor(e,n,r),e.algorithm,union,!e.keysOnly&&e.valueMapper)])}return iterate(openCursor(e,n,r),combine(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function iterate(e,t,r,n){var o=wrap(n?function(e,t,o){return r(n(e),t,o)}:r);return e.then((function(e){if(e)return e.start((function(){var c=function(){return e.continue()};t&&!t(e,(function(e){return c=e}),(function(t){e.stop(t),c=nop}),(function(t){e.fail(t),c=nop}))||o(e.value,e,(function(e){return c=e})),c()}))}))}var _e=function(){function Collection(){}return Collection.prototype._read=function(e,t){var r=this._ctx;return r.error?r.table._trans(null,ae.bind(null,r.error)):r.table._trans("readonly",e).then(t)},Collection.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,ae.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},Collection.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=combine(t.algorithm,e)},Collection.prototype._iterate=function(e,t){return iter(this._ctx,e,t,this._ctx.table.core)},Collection.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&extend(r,e),t._ctx=r,t},Collection.prototype.raw=function(){return this._ctx.valueMapper=null,this},Collection.prototype.each=function(e){var t=this._ctx;return this._read((function(r){return iter(t,e,r,t.table.core)}))},Collection.prototype.count=function(e){var t=this;return this._read((function(e){var r=t._ctx,n=r.table.core;if(isPlainKeyRange(r,!0))return n.count({trans:e,query:{index:getIndexOrStore(r,n.schema),range:r.range}}).then((function(e){return Math.min(e,r.limit)}));var o=0;return iter(r,(function(){return++o,!1}),e,n).then((function(){return o}))})).then(e)},Collection.prototype.sortBy=function(e,t){var r=e.split(".").reverse(),n=r[0],o=r.length-1;function getval(e,t){return t?getval(e[r[t]],t-1):e[n]}var i="next"===this._ctx.dir?1:-1;function sorter(e,t){var r=getval(e,o),n=getval(t,o);return r<n?-i:r>n?i:0}return this.toArray((function(e){return e.sort(sorter)})).then(t)},Collection.prototype.toArray=function(e){var t=this;return this._read((function(e){var r=t._ctx;if("next"===r.dir&&isPlainKeyRange(r,!0)&&r.limit>0){var n=r.valueMapper,o=getIndexOrStore(r,r.table.core.schema);return r.table.core.query({trans:e,limit:r.limit,values:!0,query:{index:o,range:r.range}}).then((function(e){var t=e.result;return n?t.map(n):t}))}var i=[];return iter(r,(function(e){return i.push(e)}),e,r.table.core).then((function(){return i}))}),e)},Collection.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,isPlainKeyRange(t)?addReplayFilter(t,(function(){var t=e;return function(e,r){return 0===t||(1===t?(--t,!1):(r((function(){e.advance(t),t=0})),!1))}})):addReplayFilter(t,(function(){var t=e;return function(){return--t<0}}))),this},Collection.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),addReplayFilter(this._ctx,(function(){var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}}),!0),this},Collection.prototype.until=function(e,t){return addFilter(this._ctx,(function(r,n,o){return!e(r.value)||(n(o),t)})),this},Collection.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},Collection.prototype.last=function(e){return this.reverse().first(e)},Collection.prototype.filter=function(e){return addFilter(this._ctx,(function(t){return e(t.value)})),function addMatchFilter(e,t){e.isMatch=combine(e.isMatch,t)}(this._ctx,e),this},Collection.prototype.and=function(e){return this.filter(e)},Collection.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},Collection.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Collection.prototype.desc=function(){return this.reverse()},Collection.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.key,r)}))},Collection.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},Collection.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.primaryKey,r)}))},Collection.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.key)})).then((function(){return r})).then(e)},Collection.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&isPlainKeyRange(t,!0)&&t.limit>0)return this._read((function(e){var r=getIndexOrStore(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:r,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.primaryKey)})).then((function(){return r})).then(e)},Collection.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},Collection.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},Collection.prototype.lastKey=function(e){return this.reverse().firstKey(e)},Collection.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var r={};return addFilter(this._ctx,(function(e){var t=e.primaryKey.toString(),n=hasOwn(r,t);return r[t]=!0,!n})),this},Collection.prototype.modify=function(e){var t=this,n=this._ctx;return this._write((function(o){var i;if("function"==typeof e)i=e;else{var a=r(e),u=a.length;i=function(t){for(var r=!1,n=0;n<u;++n){var o=a[n],i=e[o];getByKeyPath(t,o)!==i&&(setByKeyPath(t,o,i),r=!0)}return r}}var s=n.table.core,l=s.schema.primaryKey,f=l.outbound,p=l.extractKey,h="testmode"in Ce?1:2e3,d=t.db.core.cmp,y=[],v=0,m=[],applyMutateResult=function(e,t){var n=t.failures,o=t.numFailures;v+=e-o;for(var i=0,a=r(n);i<a.length;i++){var u=a[i];y.push(n[u])}};return t.clone().primaryKeys().then((function(e){var nextChunk=function(t){var r=Math.min(h,e.length-t);return s.getMany({trans:o,keys:e.slice(t,t+r)}).then((function(n){for(var a=[],u=[],l=f?[]:null,y=[],v=0;v<r;++v){var m=n[v],g={value:deepClone(m),primKey:e[t+v]};!1!==i.call(g,g.value,g)&&(null==g.value?y.push(e[t+v]):f||0===d(p(m),p(g.value))?(u.push(g.value),f&&l.push(e[t+v])):(y.push(e[t+v]),a.push(g.value)))}return Promise.resolve(a.length>0&&s.mutate({trans:o,type:"add",values:a}).then((function(e){for(var t in e.failures)y.splice(parseInt(t),1);applyMutateResult(a.length,e)}))).then((function(e){return u.length>0&&s.mutate({trans:o,type:"put",keys:l,values:u}).then((function(e){return applyMutateResult(u.length,e)}))})).then((function(){return y.length>0&&s.mutate({trans:o,type:"delete",keys:y}).then((function(e){return applyMutateResult(y.length,e)}))})).then((function(){return e.length>t+r&&nextChunk(t+h)}))}))};return nextChunk(0).then((function(){if(y.length>0)throw new ModifyError("Error modifying one or more objects",y,v,m);return e.length}))}))}))},Collection.prototype.delete=function(){var e=this._ctx,t=e.range;return isPlainKeyRange(e)&&(e.isPrimKey&&!ye||3===t.type)?this._write((function(r){var n=e.table.core.schema.primaryKey,o=t;return e.table.core.count({trans:r,query:{index:n,range:o}}).then((function(t){return e.table.core.mutate({trans:r,type:"deleteRange",range:o}).then((function(e){var r=e.failures,n=(e.lastResult,e.results,e.numFailures);if(n)throw new ModifyError("Could not delete some values",Object.keys(r).map((function(e){return r[e]})),t-n);return t-n}))}))})):this.modify((function(e,t){return t.value=null}))},Collection}();function simpleCompare(e,t){return e<t?-1:e===t?0:1}function simpleCompareReverse(e,t){return e>t?-1:e===t?0:1}function fail(e,t,r){var n=e instanceof xe?new e.Collection(e):e;return n._ctx.error=r?new r(t):new TypeError(t),n}function emptyCollection(e){return new e.Collection(e,(function(){return rangeEqual("")})).limit(0)}function nextCasing(e,t,r,n,o,i){for(var a=Math.min(e.length,n.length),u=-1,s=0;s<a;++s){var l=t[s];if(l!==n[s])return o(e[s],r[s])<0?e.substr(0,s)+r[s]+r.substr(s+1):o(e[s],n[s])<0?e.substr(0,s)+n[s]+r.substr(s+1):u>=0?e.substr(0,u)+t[u]+r.substr(u+1):null;o(e[s],l)<0&&(u=s)}return a<n.length&&"next"===i?e+r.substr(e.length):a<e.length&&"prev"===i?e.substr(0,r.length):u<0?null:e.substr(0,u)+n[u]+r.substr(u+1)}function addIgnoreCaseAlgorithm(e,t,r,n){var o,i,a,u,s,l,f,p=r.length;if(!r.every((function(e){return"string"==typeof e})))return fail(e,fe);function initDirection(e){o=function upperFactory(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),i=function lowerFactory(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),a="next"===e?simpleCompare:simpleCompareReverse;var t=r.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),s=t.map((function(e){return e.lower})),l=e,f="next"===e?"":n}initDirection("next");var h=new e.Collection(e,(function(){return createRange(u[0],s[p-1]+n)}));h._ondirectionchange=function(e){initDirection(e)};var d=0;return h._addAlgorithm((function(e,r,n){var o=e.key;if("string"!=typeof o)return!1;var h=i(o);if(t(h,s,d))return!0;for(var y=null,v=d;v<p;++v){var m=nextCasing(o,h,u[v],s[v],a,l);null===m&&null===y?d=v+1:(null===y||a(y,m)>0)&&(y=m)}return r(null!==y?function(){e.continue(y+f)}:n),!1})),h}function createRange(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function rangeEqual(e){return{type:1,lower:e,upper:e}}var xe=function(){function WhereClause(){}return Object.defineProperty(WhereClause.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),WhereClause.prototype.between=function(e,t,r,n){r=!1!==r,n=!0===n;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(r||n)&&(!r||!n)?emptyCollection(this):new this.Collection(this,(function(){return createRange(e,t,!r,!n)}))}catch(e){return fail(this,le)}},WhereClause.prototype.equals=function(e){return null==e?fail(this,le):new this.Collection(this,(function(){return rangeEqual(e)}))},WhereClause.prototype.above=function(e){return null==e?fail(this,le):new this.Collection(this,(function(){return createRange(e,void 0,!0)}))},WhereClause.prototype.aboveOrEqual=function(e){return null==e?fail(this,le):new this.Collection(this,(function(){return createRange(e,void 0,!1)}))},WhereClause.prototype.below=function(e){return null==e?fail(this,le):new this.Collection(this,(function(){return createRange(void 0,e,!1,!0)}))},WhereClause.prototype.belowOrEqual=function(e){return null==e?fail(this,le):new this.Collection(this,(function(){return createRange(void 0,e)}))},WhereClause.prototype.startsWith=function(e){return"string"!=typeof e?fail(this,fe):this.between(e,e+ce,!0,!0)},WhereClause.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):addIgnoreCaseAlgorithm(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],ce)},WhereClause.prototype.equalsIgnoreCase=function(e){return addIgnoreCaseAlgorithm(this,(function(e,t){return e===t[0]}),[e],"")},WhereClause.prototype.anyOfIgnoreCase=function(){var e=getArrayOf.apply(g,arguments);return 0===e.length?emptyCollection(this):addIgnoreCaseAlgorithm(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},WhereClause.prototype.startsWithAnyOfIgnoreCase=function(){var e=getArrayOf.apply(g,arguments);return 0===e.length?emptyCollection(this):addIgnoreCaseAlgorithm(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,ce)},WhereClause.prototype.anyOf=function(){var e=this,t=getArrayOf.apply(g,arguments),r=this._cmp;try{t.sort(r)}catch(e){return fail(this,le)}if(0===t.length)return emptyCollection(this);var n=new this.Collection(this,(function(){return createRange(t[0],t[t.length-1])}));n._ondirectionchange=function(n){r="next"===n?e._ascending:e._descending,t.sort(r)};var o=0;return n._addAlgorithm((function(e,n,i){for(var a=e.key;r(a,t[o])>0;)if(++o===t.length)return n(i),!1;return 0===r(a,t[o])||(n((function(){e.continue(t[o])})),!1)})),n},WhereClause.prototype.notEqual=function(e){return this.inAnyRange([[se,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},WhereClause.prototype.noneOf=function(){var e=getArrayOf.apply(g,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return fail(this,le)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[se,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},WhereClause.prototype.inAnyRange=function(e,t){var r=this,n=this._cmp,o=this._ascending,i=this._descending,a=this._min,u=this._max;if(0===e.length)return emptyCollection(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&o(e[0],e[1])<=0})))return fail(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",O.InvalidArgument);var s=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers;var f,p=o;function rangeSorter(e,t){return p(e[0],t[0])}try{f=e.reduce((function addRange(e,t){for(var r=0,o=e.length;r<o;++r){var i=e[r];if(n(t[0],i[1])<0&&n(t[1],i[0])>0){i[0]=a(i[0],t[0]),i[1]=u(i[1],t[1]);break}}return r===o&&e.push(t),e}),[]),f.sort(rangeSorter)}catch(e){return fail(this,le)}var h=0,d=l?function(e){return o(e,f[h][1])>0}:function(e){return o(e,f[h][1])>=0},y=s?function(e){return i(e,f[h][0])>0}:function(e){return i(e,f[h][0])>=0};var v=d,m=new this.Collection(this,(function(){return createRange(f[0][0],f[f.length-1][1],!s,!l)}));return m._ondirectionchange=function(e){"next"===e?(v=d,p=o):(v=y,p=i),f.sort(rangeSorter)},m._addAlgorithm((function(e,t,n){for(var i=e.key;v(i);)if(++h===f.length)return t(n),!1;return!!function keyWithinCurrentRange(e){return!d(e)&&!y(e)}(i)||(0===r._cmp(i,f[h][1])||0===r._cmp(i,f[h][0])||t((function(){p===o?e.continue(f[h][0]):e.continue(f[h][1])})),!1)})),m},WhereClause.prototype.startsWithAnyOf=function(){var e=getArrayOf.apply(g,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?emptyCollection(this):this.inAnyRange(e.map((function(e){return[e,e+ce]}))):fail(this,"startsWithAnyOf() only works with strings")},WhereClause}();function safariMultiStoreFix(e){return 1===e.length?e[0]:e}function getMaxKey(e){try{return e.only([[]]),[[]]}catch(e){return ce}}function eventRejectHandler(e){return wrap((function(t){return preventDefault(t),e(t.target.error),!1}))}function preventDefault(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Pe=function(){function Transaction(){}return Transaction.prototype._lock=function(){return assert(!Y.global),++this._reculock,1!==this._reculock||Y.global||(Y.lockOwnerFor=this),this},Transaction.prototype._unlock=function(){if(assert(!Y.global),0==--this._reculock)for(Y.global||(Y.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{usePSD(e[1],e[0])}catch(e){}}return this},Transaction.prototype._locked=function(){return this._reculock&&Y.lockOwnerFor!==this},Transaction.prototype.create=function(e){var t=this;if(!this.mode)return this;var r=this.db.idbdb,n=this.db._state.dbOpenError;if(assert(!this.idbtrans),!e&&!r)switch(n&&n.name){case"DatabaseClosedError":throw new O.DatabaseClosed(n);case"MissingAPIError":throw new O.MissingAPI(n.message,n);default:throw new O.OpenFailed(n)}if(!this.active)throw new O.TransactionInactive;return assert(null===this._completion._state),(e=this.idbtrans=e||r.transaction(safariMultiStoreFix(this.storeNames),this.mode)).onerror=wrap((function(r){preventDefault(r),t._reject(e.error)})),e.onabort=wrap((function(r){preventDefault(r),t.active&&t._reject(new O.Abort(e.error)),t.active=!1,t.on("abort").fire(r)})),e.oncomplete=wrap((function(){t.active=!1,t._resolve()})),this},Transaction.prototype._promise=function(e,t,r){var n=this;if("readwrite"===e&&"readwrite"!==this.mode)return ae(new O.ReadOnly("Transaction is readonly"));if(!this.active)return ae(new O.TransactionInactive);if(this._locked())return new DexiePromise((function(o,i){n._blockedFuncs.push([function(){n._promise(e,t,r).then(o,i)},Y])}));if(r)return newScope((function(){var e=new DexiePromise((function(e,r){n._lock();var o=t(e,r,n);o&&o.then&&o.then(e,r)}));return e.finally((function(){return n._unlock()})),e._lib=!0,e}));var o=new DexiePromise((function(e,r){var o=t(e,r,n);o&&o.then&&o.then(e,r)}));return o._lib=!0,o},Transaction.prototype._root=function(){return this.parent?this.parent._root():this},Transaction.prototype.waitFor=function(e){var t=this._root(),r=DexiePromise.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return r}));else{t._waitingFor=r,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function spin(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=spin)}()}var o=t._waitingFor;return new DexiePromise((function(e,n){r.then((function(r){return t._waitingQueue.push(wrap(e.bind(null,r)))}),(function(e){return t._waitingQueue.push(wrap(n.bind(null,e)))})).finally((function(){t._waitingFor===o&&(t._waitingFor=null)}))}))},Transaction.prototype.abort=function(){this.active&&this._reject(new O.Abort),this.active=!1},Transaction.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(hasOwn(t,e))return t[e];var r=this.schema[e];if(!r)throw new O.NotFound("Table "+e+" not part of transaction");var n=new this.db.Table(e,r,this);return n.core=this.db.core.table(e),t[e]=n,n},Transaction}();function createIndexSpec(e,t,r,n,o,i,a){return{name:e,keyPath:t,unique:r,multi:n,auto:o,compound:i,src:(r&&!a?"&":"")+(n?"*":"")+(o?"++":"")+nameFromKeyPath(t)}}function nameFromKeyPath(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function createTableSchema(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:arrayToObject(r,(function(e){return[e.name,e]}))}}function getKeyExtractor(e){return null==e?function(){}:"string"==typeof e?function getSinglePathKeyExtractor(e){var t=e.split(".");return 1===t.length?function(t){return t[e]}:function(t){return getByKeyPath(t,e)}}(e):function(t){return getByKeyPath(t,e)}}function getEffectiveKeys(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}function arrayify(e){return[].slice.call(e)}var ke=0;function getKeyPathAlias(e){return null==e?":id":"string"==typeof e?e:"["+e.join("+")+"]"}function createDBCore(e,t,r,o){var i=t.cmp.bind(t);function makeIDBKeyRange(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var t=e.lower,n=e.upper,o=e.lowerOpen,i=e.upperOpen;return void 0===t?void 0===n?null:r.upperBound(n,!!i):void 0===n?r.lowerBound(t,!!o):r.bound(t,n,!!o,!!i)}var a=function extractSchema(e,t){var r=arrayify(e.objectStoreNames);return{schema:{name:e.name,tables:r.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,r=e.autoIncrement,o=n(t),i=null==t,a={},u={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:o,keyPath:t,autoIncrement:r,unique:!0,extractKey:getKeyExtractor(t)},indexes:arrayify(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,r=e.unique,o=e.multiEntry,i=e.keyPath,u={name:t,compound:n(i),keyPath:i,unique:r,multiEntry:o,extractKey:getKeyExtractor(i)};return a[getKeyPathAlias(i)]=u,u})),getIndexByKeyPath:function(e){return a[getKeyPathAlias(e)]}};return a[":id"]=u.primaryKey,null!=t&&(a[getKeyPathAlias(t)]=u.primaryKey),u}))},hasGetAll:r.length>0&&"getAll"in t.objectStore(r[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\\/|Edge\\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\\/(\\d*)/))[1]<604)}}(e,o),u=a.schema,s=a.hasGetAll,l=u.tables.map((function(e){return function createDbCoreTable(e){var t=e.name;return{name:t,schema:e,mutate:function mutate(r){var n=r.trans,o=r.type,i=r.keys,a=r.values,u=r.range,s=r.wantResults;return new Promise((function(r,l){r=wrap(r);var f=n.objectStore(t),p=null==f.keyPath,h="put"===o||"add"===o;if(!h&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var d=(i||a||{length:1}).length;if(i&&a&&i.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return r({numFailures:0,failures:{},results:[],lastResult:void 0});var y,v=s&&__spreadArrays(i||getEffectiveKeys(e.primaryKey,{type:o,keys:i,values:a})),m=[],g=0,errorHandler=function(e){++g,preventDefault(e),v&&(v[e.target._reqno]=void 0),m[e.target._reqno]=e.target.error},setResult=function(e){var t=e.target;v[t._reqno]=t.result};if("deleteRange"===o){if(4===u.type)return r({numFailures:g,failures:m,results:v,lastResult:void 0});y=3===u.type?f.clear():f.delete(makeIDBKeyRange(u))}else{var b=h?p?[a,i]:[a,null]:[i,null],w=b[0],_=b[1];if(h)for(var x=0;x<d;++x)(y=_&&void 0!==_[x]?f[o](w[x],_[x]):f[o](w[x]))._reqno=x,v&&void 0===v[x]&&(y.onsuccess=setResult),y.onerror=errorHandler;else for(x=0;x<d;++x)(y=f[o](w[x]))._reqno=x,y.onerror=errorHandler}var done=function(e){var t=e.target.result;v&&(v[d-1]=t),r({numFailures:g,failures:m,results:v,lastResult:t})};y.onerror=function(e){errorHandler(e),done(e)},y.onsuccess=done}))},getMany:function(e){var r=e.trans,n=e.keys;return new Promise((function(e,o){e=wrap(e);for(var i,a=r.objectStore(t),u=n.length,s=new Array(u),l=0,f=0,successHandler=function(t){var r=t.target;s[r._pos]=r.result,++f===l&&e(s)},p=eventRejectHandler(o),h=0;h<u;++h)null!=n[h]&&((i=a.get(n[h]))._pos=h,i.onsuccess=successHandler,i.onerror=p,++l);0===l&&e(s)}))},get:function(e){var r=e.trans,n=e.key;return new Promise((function(e,o){e=wrap(e);var i=r.objectStore(t).get(n);i.onsuccess=function(t){return e(t.target.result)},i.onerror=eventRejectHandler(o)}))},query:function query(e){return function(r){return new Promise((function(n,o){n=wrap(n);var i=r.trans,a=r.values,u=r.limit,s=r.query,l=u===1/0?void 0:u,f=s.index,p=s.range,h=i.objectStore(t),d=f.isPrimaryKey?h:h.index(f.name),y=makeIDBKeyRange(p);if(0===u)return n({result:[]});if(e){var v=a?d.getAll(y,l):d.getAllKeys(y,l);v.onsuccess=function(e){return n({result:e.target.result})},v.onerror=eventRejectHandler(o)}else{var m=0,g=a||!("openKeyCursor"in d)?d.openCursor(y):d.openKeyCursor(y),b=[];g.onsuccess=function(e){var t=g.result;return t?(b.push(a?t.value:t.primaryKey),++m===u?n({result:b}):void t.continue()):n({result:b})},g.onerror=eventRejectHandler(o)}}))}}(s),openCursor:function openCursor(e){var r=e.trans,n=e.values,o=e.query,i=e.reverse,a=e.unique;return new Promise((function(e,u){e=wrap(e);var s=o.index,l=o.range,f=r.objectStore(t),p=s.isPrimaryKey?f:f.index(s.name),h=i?a?"prevunique":"prev":a?"nextunique":"next",d=n||!("openKeyCursor"in p)?p.openCursor(makeIDBKeyRange(l),h):p.openKeyCursor(makeIDBKeyRange(l),h);d.onerror=eventRejectHandler(u),d.onsuccess=wrap((function(t){var n=d.result;if(n){n.___id=++ke,n.done=!1;var o=n.continue.bind(n),i=n.continuePrimaryKey;i&&(i=i.bind(n));var a=n.advance.bind(n),doThrowCursorIsStopped=function(){throw new Error("Cursor not stopped")};n.trans=r,n.stop=n.continue=n.continuePrimaryKey=n.advance=function(){throw new Error("Cursor not started")},n.fail=wrap(u),n.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},n.start=function(e){var t=new Promise((function(e,t){e=wrap(e),d.onerror=eventRejectHandler(t),n.fail=t,n.stop=function(t){n.stop=n.continue=n.continuePrimaryKey=n.advance=doThrowCursorIsStopped,e(t)}})),guardedCallback=function(){if(d.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=function(){throw new Error("Cursor behind last entry")},n.stop()};return d.onsuccess=wrap((function(e){d.onsuccess=guardedCallback,guardedCallback()})),n.continue=o,n.continuePrimaryKey=i,n.advance=a,guardedCallback(),t},e(n)}else e(null)}),u)}))},count:function(e){var r=e.query,n=e.trans,o=r.index,i=r.range;return new Promise((function(e,r){var a=n.objectStore(t),u=o.isPrimaryKey?a:a.index(o.name),s=makeIDBKeyRange(i),l=s?u.count(s):u.count();l.onsuccess=wrap((function(t){return e(t.target.result)})),l.onerror=eventRejectHandler(r)}))}}}(e)})),f={};return l.forEach((function(e){return f[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!f[e])throw new Error("Table \'"+e+"\' not found");return f[e]},cmp:i,MIN_KEY:-1/0,MAX_KEY:getMaxKey(r),schema:u}}function createMiddlewareStacks(e,t,r,n){var o=r.IDBKeyRange,i=function createMiddlewareStack(e,t){return t.reduce((function(e,t){var r=t.create;return __assign(__assign({},e),r(e))}),e)}(createDBCore(t,r.indexedDB,o,n),e.dbcore);return{dbcore:i}}function generateMiddlewareStacks(e,t){var r=t.db,n=createMiddlewareStacks(e._middlewares,r,e._deps,t);e.core=n.dbcore,e.tables.forEach((function(t){var r=t.name;e.core.schema.tables.some((function(e){return e.name===r}))&&(t.core=e.core.table(r),e[r]instanceof e.Table&&(e[r].core=t.core))}))}function setApiOnPlace(e,t,r,n){r.forEach((function(r){var o=n[r];t.forEach((function(t){var n=getPropertyDescriptor(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?setProp(t,r,{get:function(){return this.table(r)},set:function(e){u(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,o))}))}))}function removeTablesApi(e,t){t.forEach((function(t){for(var r in t)t[r]instanceof e.Table&&delete t[r]}))}function lowerVersionFirst(e,t){return e._cfg.version-t._cfg.version}function runUpgraders(e,t,n,o){var i=e._dbSchema,a=e._createTransaction("readwrite",e._storeNames,i);a.create(n),a._completion.catch(o);var u=a._reject.bind(a),s=Y.transless||Y;newScope((function(){Y.trans=a,Y.transless=s,0===t?(r(i).forEach((function(e){createTable(n,e,i[e].primKey,i[e].indexes)})),generateMiddlewareStacks(e,n),DexiePromise.follow((function(){return e.on.populate.fire(a)})).catch(u)):function updateTablesAndIndexes(e,t,n,o){var i=[],a=e._versions,u=e._dbSchema=buildGlobalSchema(e,e.idbdb,o),s=!1,l=a.filter((function(e){return e._cfg.version>=t}));function runQueue(){return i.length?DexiePromise.resolve(i.shift()(n.idbtrans)).then(runQueue):DexiePromise.resolve()}return l.forEach((function(a){i.push((function(){var i=u,l=a._cfg.dbschema;adjustToExistingIndexNames(e,i,o),adjustToExistingIndexNames(e,l,o),u=e._dbSchema=l;var f=getSchemaDiff(i,l);f.add.forEach((function(e){createTable(o,e[0],e[1].primKey,e[1].indexes)})),f.change.forEach((function(e){if(e.recreate)throw new O.Upgrade("Not yet support for changing primary key");var t=o.objectStore(e.name);e.add.forEach((function(e){return addIndex(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),addIndex(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var p=a._cfg.contentUpgrade;if(p&&a._cfg.version>t){generateMiddlewareStacks(e,o),n._memoizedTables={},s=!0;var h=shallowClone(l);f.del.forEach((function(e){h[e]=i[e]})),removeTablesApi(e,[e.Transaction.prototype]),setApiOnPlace(e,[e.Transaction.prototype],r(h),h),n.schema=h;var d,y=b(p);y&&incrementExpectedAwaits();var v=DexiePromise.follow((function(){if((d=p(n))&&y){var e=decrementExpectedAwaits.bind(null,null);d.then(e,e)}}));return d&&"function"==typeof d.then?DexiePromise.resolve(d):v.then((function(){return d}))}})),i.push((function(t){s&&de||function deleteRemovedTables(e,t){for(var r=0;r<t.db.objectStoreNames.length;++r){var n=t.db.objectStoreNames[r];null==e[n]&&t.db.deleteObjectStore(n)}}(a._cfg.dbschema,t);removeTablesApi(e,[e.Transaction.prototype]),setApiOnPlace(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),runQueue().then((function(){!function createMissingTables(e,t){r(e).forEach((function(r){t.db.objectStoreNames.contains(r)||createTable(t,r,e[r].primKey,e[r].indexes)}))}(u,o)}))}(e,t,a,n).catch(u)}))}function getSchemaDiff(e,t){var r,n={del:[],add:[],change:[]};for(r in e)t[r]||n.del.push(r);for(r in t){var o=e[r],i=t[r];if(o){var a={name:r,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!he)a.recreate=!0,n.change.push(a);else{var u=o.idxByName,s=i.idxByName,l=void 0;for(l in u)s[l]||a.del.push(l);for(l in s){var f=u[l],p=s[l];f?f.src!==p.src&&a.change.push(p):a.add.push(p)}(a.del.length>0||a.add.length>0||a.change.length>0)&&n.change.push(a)}}else n.add.push([r,i])}return n}function createTable(e,t,r,n){var o=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach((function(e){return addIndex(o,e)})),o}function addIndex(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function buildGlobalSchema(e,t,r){var n={};return slice(t.objectStoreNames,0).forEach((function(e){for(var t=r.objectStore(e),o=t.keyPath,i=createIndexSpec(nameFromKeyPath(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<t.indexNames.length;++u){var s=t.index(t.indexNames[u]);o=s.keyPath;var l=createIndexSpec(s.name,o,!!s.unique,!!s.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(l)}n[e]=createTableSchema(e,i,a)})),n}function adjustToExistingIndexNames(e,t,r){for(var n=r.db.objectStoreNames,i=0;i<n.length;++i){var a=n[i],u=r.objectStore(a);e._hasGetAll="getAll"in u;for(var s=0;s<u.indexNames.length;++s){var l=u.indexNames[s],f=u.index(l).keyPath,p="string"==typeof f?f:"["+slice(f).join("+")+"]";if(t[a]){var h=t[a].idxByName[p];h&&(h.name=l,delete t[a].idxByName[p],t[a].idxByName[l]=h)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\\/|Edge\\/)/.test(navigator.userAgent)&&o.WorkerGlobalScope&&o instanceof o.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\\/(\\d*)/))[1]<604&&(e._hasGetAll=!1)}var Se,Ee=function(){function Version(){}return Version.prototype._parseStoresSpec=function(e,t){r(e).forEach((function(r){if(null!==e[r]){var o=function parseIndexSyntax(e){return e.split(",").map((function(e,t){var r=(e=e.trim()).replace(/([&*]|\\+\\+)/g,""),o=/^\\[/.test(r)?r.match(/^\\[(.*)\\]$/)[1].split("+"):r;return createIndexSpec(r,o||null,/\\&/.test(e),/\\*/.test(e),/\\+\\+/.test(e),n(o),0===t)}))}(e[r]),i=o.shift();if(i.multi)throw new O.Schema("Primary key cannot be multi-valued");o.forEach((function(e){if(e.auto)throw new O.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new O.Schema("Index must have a name and cannot be an empty string")})),t[r]=createTableSchema(r,i,o)}}))},Version.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?extend(this._cfg.storesSource,e):e;var n=t._versions,o={},i={};return n.forEach((function(e){extend(o,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(o,i)})),t._dbSchema=i,removeTablesApi(t,[t._allTables,t,t.Transaction.prototype]),setApiOnPlace(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],r(i),i),t._storeNames=r(i),this},Version.prototype.upgrade=function(e){return this._cfg.contentUpgrade=e,this},Version}();function vip(e){return newScope((function(){return Y.letThrough=!0,e()}))}function dexieOpen(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?ae(t.dbOpenError):e}));w&&(t.openCanceller._stackHolder=getErrorWithStack()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var o=t.dbReadyResolve,i=null;return DexiePromise.race([t.openCanceller,new DexiePromise((function(o,a){if(!n)throw new O.MissingAPI("indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using old Safari versions, make sure to include indexedDB polyfill.");var u=e.name,s=t.autoSchema?n.open(u):n.open(u,Math.round(10*e.verno));if(!s)throw new O.MissingAPI("IndexedDB API not available");s.onerror=eventRejectHandler(a),s.onblocked=wrap(e._fireOnBlocked),s.onupgradeneeded=wrap((function(r){if(i=s.transaction,t.autoSchema&&!e._options.allowEmptyDB){s.onerror=preventDefault,i.abort(),s.result.close();var o=n.deleteDatabase(u);o.onsuccess=o.onerror=wrap((function(){a(new O.NoSuchDatabase("Database "+u+" doesnt exist"))}))}else{i.onerror=eventRejectHandler(a);var l=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;e.idbdb=s.result,runUpgraders(e,l/10,i,a)}}),a),s.onsuccess=wrap((function(){i=null;var n=e.idbdb=s.result,a=slice(n.objectStoreNames);if(a.length>0)try{var l=n.transaction(safariMultiStoreFix(a),"readonly");t.autoSchema?function readGlobalSchema(e,t,n){e.verno=t.version/10;var o=e._dbSchema=buildGlobalSchema(0,t,n);e._storeNames=slice(t.objectStoreNames,0),setApiOnPlace(e,[e._allTables],r(o),o)}(e,n,l):(adjustToExistingIndexNames(e,e._dbSchema,l),function verifyInstalledSchema(e,t){var r=getSchemaDiff(buildGlobalSchema(0,e.idbdb,t),e._dbSchema);return!(r.add.length||r.change.some((function(e){return e.add.length||e.change.length})))}(e,l)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),generateMiddlewareStacks(e,l)}catch(e){}pe.push(e),n.onversionchange=wrap((function(r){t.vcFired=!0,e.on("versionchange").fire(r)})),Se.add(u),o()}),a)}))]).then((function(){return t.onReadyBeingFired=[],DexiePromise.resolve(vip(e.on.ready.fire)).then((function fireRemainders(){if(t.onReadyBeingFired.length>0){var e=t.onReadyBeingFired.reduce(promisableChain,nop);return t.onReadyBeingFired=[],DexiePromise.resolve(vip(e)).then(fireRemainders)}}))})).finally((function(){t.onReadyBeingFired=null})).then((function(){return t.isBeingOpened=!1,e})).catch((function(r){try{i&&i.abort()}catch(e){}return t.isBeingOpened=!1,e.close(),t.dbOpenError=r,ae(t.dbOpenError)})).finally((function(){t.openComplete=!0,o()}))}function awaitIterator(e){var callNext=function(t){return e.next(t)},t=step(callNext),r=step((function(t){return e.throw(t)}));function step(e){return function(o){var i=e(o),a=i.value;return i.done?a:a&&"function"==typeof a.then?a.then(t,r):n(a)?Promise.all(a).then(t,r):t(a)}}return step(callNext)()}function extractTransactionArgs(e,t,r){var n=arguments.length;if(n<2)throw new O.InvalidArgument("Too few arguments");for(var o=new Array(n-1);--n;)o[n-1]=arguments[n];r=o.pop();var i=flatten(o);return[e,i,r]}function enterTransactionScope(e,t,r,n,o){return DexiePromise.resolve().then((function(){var i=Y.transless||Y,a=e._createTransaction(t,r,e._dbSchema,n),u={trans:a,transless:i};n?a.idbtrans=n.idbtrans:a.create();var s,l=b(o);l&&incrementExpectedAwaits();var f=DexiePromise.follow((function(){if(s=o.call(a,a))if(l){var e=decrementExpectedAwaits.bind(null,null);s.then(e,e)}else"function"==typeof s.next&&"function"==typeof s.throw&&(s=awaitIterator(s))}),u);return(s&&"function"==typeof s.then?DexiePromise.resolve(s).then((function(e){return a.active?e:ae(new O.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):f.then((function(){return s}))).then((function(e){return n&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),ae(e)}))}))}function pad(e,t,r){for(var o=n(e)?e.slice():[e],i=0;i<r;++i)o.push(t);return o}var Oe={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function createVirtualIndexMiddleware(e){return __assign(__assign({},e),{table:function(t){var r=e.table(t),n=r.schema,o={},i=[];function addVirtualIndexes(e,t,r){var n=getKeyPathAlias(e),a=o[n]=o[n]||[],u=null==e?0:"string"==typeof e?1:e.length,s=t>0,l=__assign(__assign({},r),{isVirtual:s,isPrimaryKey:!s&&r.isPrimaryKey,keyTail:t,keyLength:u,extractKey:getKeyExtractor(e),unique:!s&&r.unique});(a.push(l),l.isPrimaryKey||i.push(l),u>1)&&addVirtualIndexes(2===u?e[0]:e.slice(0,u-1),t+1,r);return a.sort((function(e,t){return e.keyTail-t.keyTail})),l}var a=addVirtualIndexes(n.primaryKey.keyPath,0,n.primaryKey);o[":id"]=[a];for(var u=0,s=n.indexes;u<s.length;u++){var l=s[u];addVirtualIndexes(l.keyPath,0,l)}function translateRequest(t){var r,n,o=t.query.index;return o.isVirtual?__assign(__assign({},t),{query:{index:o,range:(r=t.query.range,n=o.keyTail,{type:1===r.type?2:r.type,lower:pad(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:pad(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0})}}):t}var f=__assign(__assign({},r),{schema:__assign(__assign({},n),{primaryKey:a,indexes:i,getIndexByKeyPath:function findBestIndex(e){var t=o[getKeyPathAlias(e)];return t&&t[0]}}),count:function(e){return r.count(translateRequest(e))},query:function(e){return r.query(translateRequest(e))},openCursor:function(t){var n=t.query.index,o=n.keyTail,i=n.isVirtual,a=n.keyLength;if(!i)return r.openCursor(t);return r.openCursor(translateRequest(t)).then((function(r){return r&&function createVirtualCursor(r){var n=Object.create(r,{continue:{value:function _continue(n){null!=n?r.continue(pad(n,t.reverse?e.MAX_KEY:e.MIN_KEY,o)):t.unique?r.continue(pad(r.key,t.reverse?e.MIN_KEY:e.MAX_KEY,o)):r.continue()}},continuePrimaryKey:{value:function(t,n){r.continuePrimaryKey(pad(t,e.MAX_KEY,o),n)}},key:{get:function(){var e=r.key;return 1===a?e[0]:e.slice(0,a)}},value:{get:function(){return r.value}}});return n}(r)}))}});return f}})}},Te={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return __assign(__assign({},e),{table:function(t){var r=e.table(t),n=r.schema.primaryKey,o=__assign(__assign({},r),{mutate:function(e){var o=Y.trans,i=o.table(t).hook,a=i.deleting,u=i.creating,s=i.updating;switch(e.type){case"add":if(u.fire===nop)break;return o._promise("readwrite",(function(){return addPutOrDelete(e)}),!0);case"put":if(u.fire===nop&&s.fire===nop)break;return o._promise("readwrite",(function(){return addPutOrDelete(e)}),!0);case"delete":if(a.fire===nop)break;return o._promise("readwrite",(function(){return addPutOrDelete(e)}),!0);case"deleteRange":if(a.fire===nop)break;return o._promise("readwrite",(function(){return function deleteRange(e){return deleteNextChunk(e.trans,e.range,1e4)}(e)}),!0)}return r.mutate(e);function addPutOrDelete(e){var t=Y.trans,o=e.keys||getEffectiveKeys(n,e);if(!o)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?__assign(__assign({},e),{keys:o,wantResults:!0}):__assign({},e)).type&&(e.values=__spreadArrays(e.values)),e.keys&&(e.keys=__spreadArrays(e.keys)),function getExistingValues(e,t,r){return"add"===t.type?Promise.resolve(new Array(t.values.length)):e.getMany({trans:t.trans,keys:r})}(r,e,o).then((function(i){var l=o.map((function(r,o){var l=i[o],f={onerror:null,onsuccess:null};if("delete"===e.type)a.fire.call(f,r,l,t);else if("add"===e.type||void 0===l){var p=u.fire.call(f,r,e.values[o],t);null==r&&null!=p&&(r=p,e.keys[o]=r,n.outbound||setByKeyPath(e.values[o],n.keyPath,r))}else{var h=getObjectDiff(l,e.values[o]),d=s.fire.call(f,h,r,l,t);if(d){var y=e.values[o];Object.keys(d).forEach((function(e){hasOwn(y,e)?y[e]=d[e]:setByKeyPath(y,e,d[e])}))}}return f}));return r.mutate(e).then((function(t){for(var r=t.failures,n=t.results,a=t.numFailures,u=t.lastResult,s=0;s<o.length;++s){var f=n?n[s]:o[s],p=l[s];null==f?p.onerror&&p.onerror(r[s]):p.onsuccess&&p.onsuccess("put"===e.type&&i[s]?e.values[s]:f)}return{failures:r,results:n,numFailures:a,lastResult:u}})).catch((function(e){return l.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}function deleteNextChunk(e,t,o){return r.query({trans:e,values:!1,query:{index:n,range:t},limit:o}).then((function(r){var n=r.result;return addPutOrDelete({type:"delete",keys:n,trans:e}).then((function(r){return r.numFailures>0?Promise.reject(r.failures[0]):n.length<o?{failures:[],numFailures:0,lastResult:void 0}:deleteNextChunk(e,__assign(__assign({},t),{lower:n[n.length-1],lowerOpen:!0}),o)}))}))}}});return o}})}},Ce=function(){function Dexie(e,t){var r=this;this._middlewares={},this.verno=0;var n=Dexie.dependencies;this._options=t=__assign({addons:Dexie.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},t),this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};var o=t.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null;var i={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:nop,dbReadyPromise:null,cancelOpen:nop,openCanceller:null,autoSchema:!0};i.dbReadyPromise=new DexiePromise((function(e){i.dbReadyResolve=e})),i.openCanceller=new DexiePromise((function(e,t){i.cancelOpen=t})),this._state=i,this.name=e,this.on=Events(this,"populate","blocked","versionchange",{ready:[promisableChain,nop]}),this.on.ready.subscribe=override(this.on.ready.subscribe,(function(e){return function(t,n){Dexie.vip((function(){var o=r._state;if(o.openComplete)o.dbOpenError||DexiePromise.resolve().then(t),n&&e(t);else if(o.onReadyBeingFired)o.onReadyBeingFired.push(t),n&&e(t);else{e(t);var i=r;n||e((function unsubscribe(){i.on.ready.unsubscribe(t),i.on.ready.unsubscribe(unsubscribe)}))}}))}})),this.Collection=function createCollectionConstructor(e){return makeClassConstructor(_e.prototype,(function Collection$$1(t,r){this.db=e;var n=be,o=null;if(r)try{n=r()}catch(e){o=e}var i=t._ctx,a=i.table,u=a.hook.reading.fire;this._ctx={table:a,index:i.index,isPrimKey:!i.index||a.schema.primKey.keyPath&&i.index===a.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:o,or:i.or,valueMapper:u!==mirror?u:null}}))}(this),this.Table=function createTableConstructor(e){return makeClassConstructor(we.prototype,(function Table$$1(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:Events(null,{creating:[hookCreatingChain,nop],reading:[pureFunctionChain,mirror],updating:[hookUpdatingChain,nop],deleting:[hookDeletingChain,nop]})}))}(this),this.Transaction=function createTransactionConstructor(e){return makeClassConstructor(Pe.prototype,(function Transaction$$1(t,r,n,o){var i=this;this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.idbtrans=null,this.on=Events(this,"complete","error","abort"),this.parent=o||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new DexiePromise((function(e,t){i._resolve=e,i._reject=t})),this._completion.then((function(){i.active=!1,i.on.complete.fire()}),(function(e){var t=i.active;return i.active=!1,i.on.error.fire(e),i.parent?i.parent._reject(e):t&&i.idbtrans&&i.idbtrans.abort(),ae(e)}))}))}(this),this.Version=function createVersionConstructor(e){return makeClassConstructor(Ee.prototype,(function Version$$1(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function createWhereClauseConstructor(e){return makeClassConstructor(xe.prototype,(function WhereClause$$1(t,r,n){this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n};var o=e._deps.indexedDB;if(!o)throw new O.MissingAPI("indexedDB API missing");this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(e,t){return o.cmp(t,e)},this._max=function(e,t){return o.cmp(e,t)>0?e:t},this._min=function(e,t){return o.cmp(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database \'"+r.name+"\'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database \'"+r.name+"\'. Closing db now to resume the delete request."),r.close()})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete(\'"+r.name+"\') was blocked"):console.warn("Upgrade \'"+r.name+"\' blocked by other connection holding version "+e.oldVersion/10)})),this._maxKey=getMaxKey(t.IDBKeyRange),this._createTransaction=function(e,t,n,o){return new r.Transaction(e,t,n,o)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),pe.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(Oe),this.use(Te),o.forEach((function(e){return e(r)}))}return Dexie.prototype.version=function(e){if(isNaN(e)||e<.1)throw new O.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new O.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,r=t.filter((function(t){return t._cfg.version===e}))[0];return r||(r=new this.Version(e),t.push(r),t.sort(lowerVersionFirst),r.stores({}),this._state.autoSchema=!1,r)},Dexie.prototype._whenReady=function(e){var t=this;return this._state.openComplete||Y.letThrough?e():new DexiePromise((function(e,r){if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void r(new O.DatabaseClosed);t.open().catch(nop)}t._state.dbReadyPromise.then(e,r)})).then(e)},Dexie.prototype.use=function(e){var t=e.stack,r=e.create,n=e.level,o=e.name;o&&this.unuse({stack:t,name:o});var i=this._middlewares[t]||(this._middlewares[t]=[]);return i.push({stack:t,create:r,level:null==n?10:n,name:o}),i.sort((function(e,t){return e.level-t.level})),this},Dexie.prototype.unuse=function(e){var t=e.stack,r=e.name,n=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return n?e.create!==n:!!r&&e.name!==r}))),this},Dexie.prototype.open=function(){return dexieOpen(this)},Dexie.prototype.close=function(){var e=pe.indexOf(this),t=this._state;if(e>=0&&pe.splice(e,1),this.idbdb){try{this.idbdb.close()}catch(e){}this.idbdb=null}this._options.autoOpen=!1,t.dbOpenError=new O.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError),t.dbReadyPromise=new DexiePromise((function(e){t.dbReadyResolve=e})),t.openCanceller=new DexiePromise((function(e,r){t.cancelOpen=r}))},Dexie.prototype.delete=function(){var e=this,t=arguments.length>0,r=this._state;return new DexiePromise((function(n,o){var doDelete=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=wrap((function(){Se.remove(e.name),n()})),t.onerror=eventRejectHandler(o),t.onblocked=e._fireOnBlocked};if(t)throw new O.InvalidArgument("Arguments not allowed in db.delete()");r.isBeingOpened?r.dbReadyPromise.then(doDelete):doDelete()}))},Dexie.prototype.backendDB=function(){return this.idbdb},Dexie.prototype.isOpen=function(){return null!==this.idbdb},Dexie.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},Dexie.prototype.hasFailed=function(){return null!==this._state.dbOpenError},Dexie.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Dexie.prototype,"tables",{get:function(){var e=this;return r(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!0,configurable:!0}),Dexie.prototype.transaction=function(){var e=extractTransactionArgs.apply(this,arguments);return this._transaction.apply(this,e)},Dexie.prototype._transaction=function(e,t,r){var n=this,o=Y.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);var i,a,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map((function(e){var t=e instanceof n.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||e===me)i=me;else{if("rw"!=e&&e!=ge)throw new O.InvalidArgument("Invalid transaction mode: "+e);i=ge}if(o){if(o.mode===me&&i===ge){if(!u)throw new O.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach((function(e){if(o&&-1===o.storeNames.indexOf(e)){if(!u)throw new O.SubTransaction("Table "+e+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(function(t,r){r(e)})):ae(e)}var s=enterTransactionScope.bind(null,this,i,a,o,r);return o?o._promise(i,s,"lock"):Y.trans?usePSD(Y.transless,(function(){return n._whenReady(s)})):this._whenReady(s)},Dexie.prototype.table=function(e){if(!hasOwn(this._allTables,e))throw new O.InvalidTable("Table "+e+" does not exist");return this._allTables[e]},Dexie}(),je=Ce;props(je,__assign(__assign({},C),{delete:function(e){return new je(e).delete()},exists:function(e){return new je(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){return Se?Se.getDatabaseNames().then(e):DexiePromise.resolve([])},defineClass:function(){return function Class(e){extend(this,e)}},ignoreTransaction:function(e){return Y.trans?usePSD(Y.transless,e):e()},vip,async:function(e){return function(){try{var t=awaitIterator(e.apply(this,arguments));return t&&"function"==typeof t.then?t:DexiePromise.resolve(t)}catch(e){return ae(e)}}},spawn:function(e,t,r){try{var n=awaitIterator(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:DexiePromise.resolve(n)}catch(e){return ae(e)}},currentTransaction:{get:function(){return Y.trans||null}},waitFor:function(e,t){var r=DexiePromise.resolve("function"==typeof e?je.ignoreTransaction(e):e).timeout(t||6e4);return Y.trans?Y.trans.waitFor(r):r},Promise:DexiePromise,debug:{get:function(){return w},set:function(e){setDebug(e,"dexie"===e?function(){return!0}:dexieStackFrameFilter)}},derive,extend,props,override,Events,getByKeyPath,setByKeyPath,delByKeyPath,shallowClone,deepClone,getObjectDiff,asap,minKey:se,addons:[],connections:pe,errnames:S,dependencies:function(){try{return{indexedDB:o.indexedDB||o.mozIndexedDB||o.webkitIndexedDB||o.msIndexedDB,IDBKeyRange:o.IDBKeyRange||o.webkitIDBKeyRange}}catch(e){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:ue,version:ue.split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,r){return e+t/Math.pow(10,2*r)})),default:je,Dexie:je})),je.maxKey=getMaxKey(je.dependencies.IDBKeyRange),function initDatabaseEnumerator(e){try{Se=function DatabaseEnumerator(e){var t,r=e&&"function"==typeof e.databases;if(!r){var n=new Ce(ve,{addons:[]});n.version(1).stores({dbnames:"name"}),t=n.table("dbnames")}return{getDatabaseNames:function(){return r?DexiePromise.resolve(e.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==ve}))})):t.toCollection().primaryKeys()},add:function(e){return!r&&e!==ve&&t.put({name:e}).catch(nop)},remove:function(e){return!r&&e!==ve&&t.delete(e).catch(nop)}}}(e)}catch(e){}}(Ce.dependencies.indexedDB),DexiePromise.rejectionMapper=function mapError(e,t){if(!e||e instanceof DexieError||e instanceof TypeError||e instanceof SyntaxError||!e.name||!T[e.name])return e;var r=new T[e.name](t||e.message,e);return"stack"in e&&setProp(r,"stack",{get:function(){return this.inner.stack}}),r},setDebug(w,dexieStackFrameFilter);function _createSuper(e){var t=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}var De=new(function(e){!function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}(LoggerDB,e);var t=_createSuper(LoggerDB);function LoggerDB(){var e;return _classCallCheck(this,LoggerDB),(e=t.call(this,"AgoraLogger")).logs=void 0,e.openDatabase(),e.logs=e.table("logs"),e}return _createClass(LoggerDB,[{key:"openDatabase",value:function openDatabase(){this.version(1).stores({logs:"++id, content, label, created_at"})}}]),LoggerDB}(Ce));function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function define(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{define({},"")}catch(e){define=function define(e,t,r){return e[t]=r}}function wrap(e,t,r,o){var i=t&&t.prototype instanceof Generator?t:Generator,a=Object.create(i.prototype),u=new Context(o||[]);return n(a,"_invoke",{value:makeInvokeMethod(e,r,u)}),a}function tryCatch(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=wrap;var s={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var l={};define(l,i,(function(){return this}));var f=Object.getPrototypeOf,p=f&&f(f(values([])));p&&p!==t&&r.call(p,i)&&(l=p);var h=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(l);function defineIteratorMethods(e){["next","throw","return"].forEach((function(t){define(e,t,(function(e){return this._invoke(t,e)}))}))}function AsyncIterator(e,t){function invoke(n,o,i,a){var u=tryCatch(e[n],e,o);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==_typeof(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){invoke("next",e,i,a)}),(function(e){invoke("throw",e,i,a)})):t.resolve(l).then((function(e){s.value=e,i(s)}),(function(e){return invoke("throw",e,i,a)}))}a(u.arg)}var o;n(this,"_invoke",{value:function value(e,r){function callInvokeWithMethodAndArg(){return new t((function(t,n){invoke(e,r,t,n)}))}return o=o?o.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return doneResult()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=maybeInvokeDelegate(a,r);if(u){if(u===s)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=tryCatch(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function maybeInvokeDelegate(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,maybeInvokeDelegate(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a \'"+r+"\' method")),s;var o=tryCatch(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,s;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function pushTryEntry(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function next(){for(;++n<e.length;)if(r.call(e,n))return next.value=e[n],next.done=!1,next;return next.value=void 0,next.done=!0,next};return o.next=o}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,n(h,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),n(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,define(e,u,"GeneratorFunction")),e.prototype=Object.create(h),e},e.awrap=function(e){return{__await:e}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,a,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},defineIteratorMethods(h),define(h,u,"Generator"),define(h,i,(function(){return this})),define(h,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function next(){for(;r.length;){var e=r.pop();if(e in t)return next.value=e,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function stop(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var t=this;function handle(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0);if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}}}},abrupt:function abrupt(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function complete(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function finish(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),s}},catch:function _catch(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(e,t,r){return this.delegate={iterator:values(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},e}var Ae=function(){function Mutex(){_classCallCheck(this,Mutex),this.mutex=Promise.resolve()}var e;return _createClass(Mutex,[{key:"lock",value:function lock(){var e=function begin(){};return this.mutex=this.mutex.then((function(){return new Promise(e)})),new Promise((function(t){e=t}))}},{key:"dispatch",value:(e=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(e){var t;return _regeneratorRuntime().wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.lock();case 2:return t=r.sent,r.prev=3,r.next=6,Promise.resolve(e());case 6:return r.abrupt("return",r.sent);case 7:return r.prev=7,t(),r.finish(7);case 10:case"end":return r.stop()}}),_callee,this,[[3,,7,10]])}))),function dispatch(t){return e.apply(this,arguments)})}]),Mutex}();function log_worker_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */log_worker_regeneratorRuntime=function _regeneratorRuntime(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function define(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{define({},"")}catch(e){define=function define(e,t,r){return e[t]=r}}function wrap(e,t,r,o){var i=t&&t.prototype instanceof Generator?t:Generator,a=Object.create(i.prototype),u=new Context(o||[]);return n(a,"_invoke",{value:makeInvokeMethod(e,r,u)}),a}function tryCatch(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=wrap;var s={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var l={};define(l,i,(function(){return this}));var f=Object.getPrototypeOf,p=f&&f(f(values([])));p&&p!==t&&r.call(p,i)&&(l=p);var h=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(l);function defineIteratorMethods(e){["next","throw","return"].forEach((function(t){define(e,t,(function(e){return this._invoke(t,e)}))}))}function AsyncIterator(e,t){function invoke(n,o,i,a){var u=tryCatch(e[n],e,o);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==_typeof(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){invoke("next",e,i,a)}),(function(e){invoke("throw",e,i,a)})):t.resolve(l).then((function(e){s.value=e,i(s)}),(function(e){return invoke("throw",e,i,a)}))}a(u.arg)}var o;n(this,"_invoke",{value:function value(e,r){function callInvokeWithMethodAndArg(){return new t((function(t,n){invoke(e,r,t,n)}))}return o=o?o.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return doneResult()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=maybeInvokeDelegate(a,r);if(u){if(u===s)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=tryCatch(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function maybeInvokeDelegate(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,maybeInvokeDelegate(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a \'"+r+"\' method")),s;var o=tryCatch(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,s;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function pushTryEntry(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function next(){for(;++n<e.length;)if(r.call(e,n))return next.value=e[n],next.done=!1,next;return next.value=void 0,next.done=!0,next};return o.next=o}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,n(h,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),n(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,define(e,u,"GeneratorFunction")),e.prototype=Object.create(h),e},e.awrap=function(e){return{__await:e}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,a,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},defineIteratorMethods(h),define(h,u,"Generator"),define(h,i,(function(){return this})),define(h,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function next(){for(;r.length;){var e=r.pop();if(e in t)return next.value=e,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function stop(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var t=this;function handle(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0);if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}}}},abrupt:function abrupt(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function complete(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function finish(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),s}},catch:function _catch(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(e,t,r){return this.delegate={iterator:values(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},e}console.log("[worker] log worker initialzied");var Ie=self,Re=new Ae,Ke=5e4,Fe=[],Me=function log(){var e;(e=console).debug.apply(e,arguments)},Be=t()((function(){Re.dispatch(_asyncToGenerator(log_worker_regeneratorRuntime().mark((function _callee(){var e,t,r,n,o;return log_worker_regeneratorRuntime().wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:return e=(new Date).getTime(),t=Fe,Fe=[],i.prev=3,i.next=6,De.logs.count();case 6:if(r=i.sent,!((n=t.length+r-Ke)>0)){i.next=12;break}return i.next=11,De.logs.orderBy(":id").reverse().limit(n).delete();case 11:console.debug("[worker] clear ".concat(n," records"));case 12:i.next=17;break;case 14:i.prev=14,i.t0=i.catch(3),console.error("[worker] clear db failed");case 17:return i.prev=17,i.next=20,De.logs.bulkPut(t);case 20:i.next=25;break;case 22:i.prev=22,i.t1=i.catch(17),console.error("[worker] bulkPut ".concat(t.length," failed"));case 25:o=(new Date).getTime(),Me("[worker] done writing ".concat(t.length," records in ").concat(o-e,"ms"));case 27:case"end":return i.stop()}}),_callee,null,[[3,14],[17,22]])}))))}),2e3,{maxWait:3e4});Ie.onmessage=function(){var e=_asyncToGenerator(log_worker_regeneratorRuntime().mark((function _callee2(e){var t,r,n,o;return log_worker_regeneratorRuntime().wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:e.data&&"log"===e.data.type?(t=new Date,r=e.data.data,n=r.label,o=r.message,Fe.push({label:n,content:o,created_at:+Date.now(),timestamp:"".concat(t)}),Be()):e.data&&"setting"===e.data.type&&(Ke=e.data.data.maxRecords||5e4);case 1:case"end":return i.stop()}}),_callee2)})));return function(t){return e.apply(this,arguments)}}()})()})();',"Worker",void 0,void 0)},ME.originConsole=window.console;var BE=new Uint8Array(16);function rng(){if(!NE&&!(NE="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return NE(BE)}const jE=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const UE=function validate(j){return"string"==typeof j&&jE.test(j)};for(var FE=[],GE=0;GE<256;++GE)FE.push((GE+256).toString(16).substr(1));const VE=function stringify(j){var _e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,_t=(FE[j[_e+0]]+FE[j[_e+1]]+FE[j[_e+2]]+FE[j[_e+3]]+"-"+FE[j[_e+4]]+FE[j[_e+5]]+"-"+FE[j[_e+6]]+FE[j[_e+7]]+"-"+FE[j[_e+8]]+FE[j[_e+9]]+"-"+FE[j[_e+10]]+FE[j[_e+11]]+FE[j[_e+12]]+FE[j[_e+13]]+FE[j[_e+14]]+FE[j[_e+15]]).toLowerCase();if(!UE(_t))throw TypeError("Stringified UUID is invalid");return _t};const qE=function v4(j,_e,_t){var St=(j=j||{}).random||(j.rng||rng)();if(St[6]=15&St[6]|64,St[8]=63&St[8]|128,_e){_t=_t||0;for(var Tt=0;Tt<16;++Tt)_e[_t+Tt]=St[Tt];return _e}return VE(St)};function error_createSuper(j){var _e=function error_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var QE,KE=function(j){_inherits(AbstractErrorCenter,j);var _e=error_createSuper(AbstractErrorCenter);function AbstractErrorCenter(){return _classCallCheck(this,AbstractErrorCenter),_e.apply(this,arguments)}return _createClass(AbstractErrorCenter)}(_a),WE=function(j){_inherits(AGError,j);var _e=error_createSuper(AGError);function AGError(j,_t,St){var Tt;return _classCallCheck(this,AGError),(Tt=_e.call(this))._extra=St,Tt.id=qE(),Tt.original=void 0,Tt.codeList=void 0,Tt.message=_t.message,Tt.original=_t,Tt.codeList=[j],Tt.stack=_t.stack,Tt}return _createClass(AGError,[{key:"servCode",get:function get(){var j;return null===(j=this._extra)||void 0===j?void 0:j.servCode}}],[{key:"isOf",value:function isOf(j){if(!(j instanceof AGError))return!1;for(var _e=arguments.length,_t=new Array(_e>1?_e-1:0),St=1;St<_e;St++)_t[St-1]=arguments[St];return _t.includes(j.servCode)}}]),AGError}(_wrapNativeSuper(Error)),HE=function AGErrorWrapper(j,_e){return _e instanceof WE?(_e.codeList.push(j),_e):new WE(j,_e)},zE=function(j){_inherits(RteErrorCenter,j);var _e=error_createSuper(RteErrorCenter);function RteErrorCenter(){return _classCallCheck(this,RteErrorCenter),_e.apply(this,arguments)}return _createClass(RteErrorCenter,[{key:"_handleError",value:function _handleError(j,_e){var _t=(null==_e?void 0:_e.stack)||(null==_e?void 0:_e.message);ME.error("[RteErrorCenter] error ".concat(j,": ").concat(_t))}},{key:"handleThrowableError",value:function handleThrowableError(j,_e){var _t=HE(j,_e);throw this._handleError(j,_t),_t}},{key:"handleNonThrowableError",value:function handleNonThrowableError(j,_e){var _t=HE(j,_e);this._handleError(j,_t)}}]),RteErrorCenter}(KE);zE.shared=new zE,function(j){j.RTE_ERR_MISSING_PARAMS="100000",j.RTE_ERR_SCENE_NOT_READY="100001",j.RTE_ERR_INVALID_DATA_STRUCT="100002",j.RTE_ERR_LOG_UPLOAD_FAIL="100003",j.RTE_ERR_RESTFUL_SERVICE_ERR="100004",j.RTE_ERR_RESTFUL_HTTP_CLIENT_ERR="100005",j.RTE_ERR_AGORA_FETCH_ERR="100006",j.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR="100007",j.RTE_ERR_WEB_LOG_UPLOAD_ERR="100008",j.RTE_ERR_JOIN_SCENE_FAILED="100009",j.RTE_ERR_LEAVE_SCENE_FAIL="100010",j.RTE_ERR_EVENT_CALLBACK_ERR="100011",j.RTE_ERR_SCENE_ALREADY_JOINED="100012",j.RTE_ERR_ENGINE_NOT_READY="100013",j.RTE_ERR_CONFIG_NOT_READY="100014",j.RTE_ERR_RESTFUL_NETWORK_ERR="100015",j.RTE_ERR_RESTFUL_NETWORK_TIMEOUT_ERR="100016",j.RTE_ERR_LOCAL_USER_NOT_EXIST="100017",j.RTM_ERR_LOGGED_IN_ALREADY="200000",j.RTM_ERR_JOIN_FAILED="200001",j.RTM_ERR_LEAVE_FAILED="200002",j.RTM_ERR_DESTROY_FAILED="200003",j.RTM_ERR_LOGIN_FAIL="200004",j.RTM_ERR_REGION_NOT_SPECIFIED="200005",j.RTC_ERR_CAM_ERR="300000",j.RTC_ERR_MIC_ERR="300001",j.RTC_ERR_TRACK_PUBLISH_FAIL="300002",j.RTC_ERR_TRACK_UNPUBLISH_FAIL="300003",j.RTC_ERR_TRACK_SUBSCRIBE_FAIL="300004",j.RTC_ERR_TRACK_UNSUBSCRIBE_FAIL="300005",j.RTC_ERR_NO_CHANNEL_EXISTS="300006",j.RTC_ERR_INVALID_CANVAS="300007",j.RTC_ERR_SCREEN_SHARE_ERR="300008",j.RTC_ERR_CLIENT_LEAVE_CHANNEL_FAIL="300009",j.RTC_ERR_LEAVE_MAIN_CHANNEL_FAIL="300010",j.RTC_ERR_LEAVE_SUB_CHANNEL_FAIL="300011",j.RTC_ERR_LEAVE_CHANNEL_FAIL="300012",j.RTC_ERR_VDM_GET_DEVICES_FAIL="300013",j.RTC_ERR_ADM_GET_RECORD_DEVICES_FAIL="300014",j.RTC_ERR_ADM_GET_PLAYBACK_DEVICES_FAIL="300015",j.RTC_ERR_REGION_NOT_SPECIFIED="300016",j.RTC_ERR_RTC_ENGINE_INITIALZIE_FAILED="300017",j.RTC_ERR_RTC_VDM_NOT_READY="300018",j.RTC_ERR_RTC_ADM_NOT_READY="300019"}(QE||(QE={}));var YE,JE=__webpack_require__(2579),XE=__webpack_require__.n(JE);__webpack_require__(9601),__webpack_require__(1249),__webpack_require__(7727),__webpack_require__(6210);function proxy_createSuper(j){var _e=function proxy_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j[j.pre=0]="pre",j[j.post=1]="post"}(YE||(YE={}));var ZE=function failQuitely(j,_e){try{return j.apply(void 0,_toConsumableArray(_e))}catch(j){}},$E=function invokeMethod(j,_e,_t,St,Tt,Ut){var _r={};ZE(Ut,[{type:YE.pre,arguments:Tt,method:St,class:_t.constructor.__$$className||_t.constructor.name,context:_r}]);var _n,_i,Ei=_e.apply(j,Tt),Ci=function post(j,_e){ZE(Ut,[{type:YE.post,arguments:Tt,return:j,method:St,class:_t.constructor.__$$className||_t.constructor.name,context:_r,error:_e}])};Ei&&!!Ei.then?Ei.then((function(j){_n=j})).catch((function(j){_i=j})).finally((function(){Ci(_n,_i)})):Ci(Ei);return Ei},_w=function proxyMethod(j,_e,_t,St){return function(){for(var Tt=arguments.length,Ut=new Array(Tt),_r=0;_r<Tt;_r++)Ut[_r]=arguments[_r];return $E(this,j,_e,_t,Ut,St)}},tS=function getMethods(j){for(var _e=[],_t=[],St=j;(St=Object.getPrototypeOf(St))&&St!==Object.prototype;){Object.getOwnPropertyNames(St).forEach((function(Tt){if(-1===_e.indexOf(Tt)){if(_e.push(Tt),"constructor"===Tt)return;try{"function"==typeof j[Tt]&&_t.push(Tt)}catch(j){var Ut=Object.getOwnPropertyDescriptor(St,Tt);"function"==typeof(null==Ut?void 0:Ut.value)&&_t.push(Tt)}}}))}return _t},rS=__webpack_require__(5760),iS=__webpack_require__.n(rS),oS=__webpack_require__(6635),cS=(__webpack_require__(9826),__webpack_require__(4916),__webpack_require__(4723),__webpack_require__(2564),__webpack_require__(8640)),uS=__webpack_require__.n(cS);function utils_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */utils_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function utils_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function utils_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?utils_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):utils_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}var lS,dS=function(){function Retry(j,_e,_t){_classCallCheck(this,Retry),this.fn=void 0,this.args=void 0,this.onRetryAttemptFail=void 0,this.onRetryAbort=void 0,this.opts=void 0,this.fn=j,this.args=_e,this.opts=_t}var j;return _createClass(Retry,[{key:"fail",value:function fail(j){return this.onRetryAttemptFail=j,this}},{key:"abort",value:function abort(j){return this.onRetryAbort=j,this}},{key:"exec",value:(j=_asyncToGenerator(utils_regeneratorRuntime().mark((function _callee(){return utils_regeneratorRuntime().wrap((function _callee$(j){for(;;)switch(j.prev=j.next){case 0:return j.prev=0,j.next=3,uS()(this.fn,this.args,utils_objectSpread(utils_objectSpread({retriesMax:3},this.opts),{},{onAttemptFail:this.onRetryAttemptFail}));case 3:j.next=12;break;case 5:if(j.prev=5,j.t0=j.catch(0),j.t1=this.onRetryAbort,!j.t1){j.next=11;break}return j.next=11,this.onRetryAbort(j.t0);case 11:throw j.t0;case 12:case"end":return j.stop()}}),_callee,this,[[0,5]])}))),function exec(){return j.apply(this,arguments)})}]),Retry}(),hS=function retryAttempt(j,_e,_t){return new dS(j,_e,_t)},fS=function jsonstring(j){try{return JSON.stringify(j)}catch(j){}return"invalid json"},pS=function sleep(j){return new Promise((function(_e){setTimeout(_e,j)}))},gS=function timeout(j,_e){var _t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Promise.race([j,new Promise((function(j,St){setTimeout(_t?St:j,_e)}))])},vS=[],AS={match:function match(j){return!0},serialize:function serialize(j){return fS(j)}},_S=function addSerializer(j){vS.push(j)},bS=function serialize(j){if("string"==typeof j)return j;var _e=vS.find((function(_e){return _e.match(j)}));return _e?_e.serialize(j):"".concat(j)},ES=function serializeArgs(j){return j.map(bS).join(" ")};_S({match:function match(j){return j instanceof File},serialize:function serialize(j){return fS({filename:j.name,size:j.size})}}),_S(AS),function(j){j[j.Break=0]="Break",j[j.Continue=1]="Continue"}(lS||(lS={}));var wS=function formatLog(j,_e,_t){return"".concat(iS()().format("YYYY-MM-DD HH:mm:ss")," ").concat((0,oS.upperCase)(PE[j]||"unknown")," [").concat(_t.className,".").concat(_t.methodName,"] [").concat(_t.traceId,"] ").concat(_e)},SS=function createLogHandler(j){var _e=SE.INFO;return function(_t){if(_t.type===YE.pre){var St;_t.context.start=(new Date).getTime(),_t.context.traceId="trace-".concat(_t.context.start).concat(Math.ceil(1e3*Math.random()));var Tt=[];(null===(St=_t.arguments)||void 0===St?void 0:St.length)&&Tt.push("args:",_t.arguments);var Ut=wS(_e,ES(Tt),{className:_t.class,methodName:_t.method,traceId:_t.context.traceId});j.info(Ut)}else{var _r=(new Date).getTime()-_t.context.start,_n=[];_t.return&&_n.push("return:",_t.return),_t.error&&_n.push("err:",_t.error),_n.push("Time elapsed: ".concat(_r,"ms"));var _i=wS(_e,ES(_n),{className:_t.class,methodName:_t.method,traceId:_t.context.traceId});j.info(_i)}return lS.Continue}},IS=(__webpack_require__(3371),function formatLog(j,_e,_t){return"".concat(iS()().format("YYYY-MM-DD HH:mm:ss")," ").concat((0,oS.upperCase)(PE[j]||"unknown")," [").concat(_t,"] [trace-0] ").concat(_e)}),TS={attach:function attach(j){var _e=!0,_t=(null==j?void 0:j.label)||"default",St=ME.getLogger(_t);return j&&(_e=!!j.proxyMethods),function(j){var _t=function chain(){for(var j=arguments.length,_e=new Array(j),_t=0;_t<j;_t++)_e[_t]=arguments[_t];return function(j){var _t=lS.Continue;for(var St in _e)if((_t=(0,_e[St])(j))===lS.Break)break;return _t}}(function createSilenceHandler(j){return function(_e){return function isIgnoredMethod(j,_e){var _t=j.__$$ignoreMethods;return _t&&_t.indexOf(_e)>-1}(j.prototype,_e.method)?lS.Break:lS.Continue}}(j),SS(St)),Tt=function createFormatLogger(j,_e){return Object.freeze({info:function info(){for(var _t=arguments.length,St=new Array(_t),Tt=0;Tt<_t;Tt++)St[Tt]=arguments[Tt];var Ut=IS(SE.INFO,ES(St),j.name);_e.info(Ut)},warn:function warn(){for(var _t=arguments.length,St=new Array(_t),Tt=0;Tt<_t;Tt++)St[Tt]=arguments[Tt];var Ut=IS(SE.WARN,ES(St),j.name);_e.warn(Ut)},error:function error(){for(var _t=arguments.length,St=new Array(_t),Tt=0;Tt<_t;Tt++)St[Tt]=arguments[Tt];var Ut=IS(SE.ERROR,ES(St),j.name);_e.error(Ut)},debug:function debug(){for(var _t=arguments.length,St=new Array(_t),Tt=0;Tt<_t;Tt++)St[Tt]=arguments[Tt];var Ut=IS(SE.DEBUG,ES(St),j.name);_e.debug(Ut)}})}(j,St);return function extendConstructor(j,_e,_t,St){var Tt;return Tt=function(j){_inherits(_class,j);var Tt=proxy_createSuper(_class);function _class(){var j;_classCallCheck(this,_class);for(var Ut=arguments.length,_r=new Array(Ut),_n=0;_n<Ut;_n++)_r[_n]=arguments[_n];(j=Tt.call.apply(Tt,[this].concat(_r)),St)&&tS(_assertThisInitialized(j)).forEach((function(_t){var St=j[_t];Object.defineProperty(_assertThisInitialized(j),_t,{writable:!0,configurable:!0,enumerable:!1,value:_w(St,_assertThisInitialized(j),_t,_e)})}));return Object.keys(_t).forEach((function(_e){Object.defineProperty(_assertThisInitialized(j),_e,{configurable:!0,enumerable:!1,writable:!1,value:_t[_e]})})),j}return _createClass(_class)}(j),Tt.__$$className=j.name,Tt}(j,_t,{logger:Tt},_e)}},trace:function trace(j,_e,_t){var St=SS(ME.logger),Tt=_t.value;"function"==typeof Tt&&(_t.value=_w(Tt,j,_e,St))},silence:function silence(j,_e){!function addIgnoredMethod(j,_e){j.__$$ignoreMethods||(j.__$$ignoreMethods=[]);var _t=j.__$$ignoreMethods;_t.includes(_e)||_t.push(_e)}(j,_e)}},CS=(__webpack_require__(189),__webpack_require__(8921),__webpack_require__(6248),__webpack_require__(3599),__webpack_require__(1477),__webpack_require__(4362),__webpack_require__(5389),__webpack_require__(401),__webpack_require__(5164),__webpack_require__(1238),__webpack_require__(4837),__webpack_require__(7485),__webpack_require__(465),__webpack_require__(6651),__webpack_require__(1437),__webpack_require__(5285),__webpack_require__(9865),__webpack_require__(4129),__webpack_require__(8206),__webpack_require__(4812),new Set),RS=function bound(j,_e,_t){var St=_t.value;return{configurable:!0,enumerable:!1,get:function get(){var j=this.__cacheMap;return j||(j=new WeakMap,this.__cacheMap=j,CS.add(this)),j.has(St)||j.set(St,St.bind(this)),j.get(St)},set:function set(j){var _e=this.__cacheMap;_e||(_e=new WeakMap,this.__cacheMap=_e,CS.add(this)),_e.set(j,j.bind(this))}}},kS=new Set,OS={debounced:function debounced(j,_e){return function(_t,St,Tt){var Ut=Tt.value;"function"==typeof Ut&&(Tt.value=(0,oS.debounce)(Ut,j,_e))}},throttled:function throttled(j,_e){return function(_t,St,Tt){var Ut=Tt.value;"function"==typeof Ut&&(Tt.value=(0,oS.throttle)(Ut,j,_e))}}};function http_client_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */http_client_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function http_client_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function http_client_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?http_client_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):http_client_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}var xS,LS=function(){var j=_asyncToGenerator(http_client_regeneratorRuntime().mark((function _callee(j,_e){return http_client_regeneratorRuntime().wrap((function _callee$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.abrupt("return",new Promise((function(_t,St){var Tt=new AbortController,Ut=setTimeout((function(){return Tt.abort()}),1e4);fetch(j,http_client_objectSpread(http_client_objectSpread({},_e),{},{signal:Tt.signal})).then((function(j){return _t(j)})).catch((function(j){St(j)})).finally((function(){clearTimeout(Ut)}))})));case 1:case"end":return _t.stop()}}),_callee)})));return function HttpClient(_e,_t){return j.apply(this,arguments)}}();function base_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */base_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}var NS=TS.attach({proxyMethods:!1,label:"http-error"})(xS=function(){function ApiBase(){_classCallCheck(this,ApiBase),this.logger=void 0,this.host=void 0,this.pathPrefix=void 0,this.headers=void 0}var j;return _createClass(ApiBase,[{key:"fetch",value:(j=_asyncToGenerator(base_regeneratorRuntime().mark((function _callee(j){var _e,_t,St,Tt,Ut,_r,_n,_i,Ei,Ci,Di,Fi,_o,ga,_a,_s;return base_regeneratorRuntime().wrap((function _callee$(_c){for(;;)switch(_c.prev=_c.next){case 0:if(_e=j.method,_t=j.data,St=j.full_url,Tt=j.path,Ut=j.query,_r=void 0===Ut?{}:Ut,_n=KS.shared.service,_i=_n.host,Ei=_n.pathPrefix,Ci={method:_e,headers:Object.assign({},KS.shared.service.headers,this.headers,j.headers)},Di=Object.entries(_r).filter((function(j){return!!_slicedToArray(j,2)[1]})).map((function(j){var _e=_slicedToArray(j,2),_t=_e[0],St=_e[1];return"".concat(_t,"=").concat(St)})),Fi=Di.length>0?"?".concat(Di.join("&")):"",_t&&(Ci.body=JSON.stringify(_t)),_c.prev=6,!St){_c.next=13;break}return _c.next=10,LS("".concat(St),Ci);case 10:_o=_c.sent,_c.next=16;break;case 13:return _c.next=15,LS("".concat(j.host||this.host||_i).concat(j.pathPrefix||this.pathPrefix||Ei||"").concat(Tt).concat(Fi),Ci);case 15:_o=_c.sent;case 16:_c.next=25;break;case 18:if(_c.prev=18,_c.t0=_c.catch(6),ga=_c.t0,this.logger.error(ga),20!==ga.code){_c.next=24;break}return _c.abrupt("return",zE.shared.handleThrowableError(QE.RTE_ERR_RESTFUL_NETWORK_TIMEOUT_ERR,ga));case 24:return _c.abrupt("return",zE.shared.handleThrowableError(QE.RTE_ERR_RESTFUL_NETWORK_ERR,ga));case 25:return _c.next=27,_o.json();case 27:if(_a=_c.sent,0==(_s=+_a.code)){_c.next=35;break}if(!isNaN(_s)){_c.next=34;break}return _c.abrupt("return",zE.shared.handleThrowableError(QE.RTE_ERR_RESTFUL_SERVICE_ERR,new WE(QE.RTE_ERR_RESTFUL_SERVICE_ERR,new Error(_a.msg),{servCode:-1})));case 34:return _c.abrupt("return",zE.shared.handleThrowableError(QE.RTE_ERR_RESTFUL_SERVICE_ERR,new WE(QE.RTE_ERR_RESTFUL_SERVICE_ERR,new Error(_a.msg),{servCode:_s})));case 35:return _c.abrupt("return",_a);case 36:case"end":return _c.stop()}}),_callee,this,[[6,18]])}))),function fetch(_e){return j.apply(this,arguments)})}]),ApiBase}())||xS,PS=__webpack_require__(2775),MS=__webpack_require__.n(PS);function report_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */report_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function report_createSuper(j){var _e=function report_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var BS,jS,US=function(j){_inherits(ReportService,j);var _e,_t,St,Tt,Ut,_r=report_createSuper(ReportService);function ReportService(){var j;_classCallCheck(this,ReportService);for(var _e=arguments.length,_t=new Array(_e),St=0;St<_e;St++)_t[St]=arguments[St];return(j=_r.call.apply(_r,[this].concat(_t))).tickerMap=new Map,j.timer=void 0,j}return _createClass(ReportService,[{key:"guardParams",value:function guardParams(){var j=KS.shared.appId,_e=KS.shared.userId;if(j&&_e)return!0;zE.shared.handleThrowableError(QE.RTE_ERR_MISSING_PARAMS,new Error("invalid params"))}},{key:"platform",get:function get(){return KS.platform===FS.Electron?"electron":"web"}},{key:"buildBaseParams",value:function buildBaseParams(j,_e,_t,St,Tt,Ut,_r){var _n=(new Date).getTime(),_i=MS()("src=".concat(_e,"&ts=").concat(_n)),Ei=Tt.result,Ci=Tt.errCode,Di=Tt.httpCode,Fi=Tt.api;return{pts:[{m:_t,ls:{ctype:j,platform:this.platform,version:uM.getVersion(),appId:KS.shared.appId,event:Ut,category:_r,result:void 0===Ei?void 0:"".concat(+Ei),errCode:Ci,httpCode:Di,api:Fi},vs:St}],sign:_i,src:_e,ts:_n}}},{key:"buildEventParams",value:function buildEventParams(j,_e,_t,St){return this.buildBaseParams("flexibleClass","rte","event",_t,St,j,_e)}},{key:"buildHBParams",value:function buildHBParams(){return this.buildBaseParams("flexibleClass","rte","online_user",{count:1},{})}},{key:"reportHB",value:(Ut=_asyncToGenerator(report_regeneratorRuntime().mark((function _callee(){var j;return report_regeneratorRuntime().wrap((function _callee$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(this.guardParams()){_e.next=2;break}return _e.abrupt("return");case 2:return _e.next=4,this.fetch({path:"/v1/report",method:"POST",data:this.buildHBParams()});case 4:return j=_e.sent,_e.abrupt("return",j.data);case 6:case"end":return _e.stop()}}),_callee,this)}))),function reportHB(){return Ut.apply(this,arguments)})},{key:"report",value:(Tt=_asyncToGenerator(report_regeneratorRuntime().mark((function _callee2(j,_e,_t,St){var Tt;return report_regeneratorRuntime().wrap((function _callee2$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(this.guardParams()){Ut.next=2;break}return Ut.abrupt("return");case 2:return Ut.next=4,this.fetch({path:"/v1/report",method:"POST",data:this.buildEventParams(j,_e,_t,St||{})});case 4:return Tt=Ut.sent,Ut.abrupt("return",Tt.data);case 6:case"end":return Ut.stop()}}),_callee2,this)}))),function report(j,_e,_t,St){return Tt.apply(this,arguments)})},{key:"tickerKey",value:function tickerKey(j,_e,_t){return"".concat(j,"/").concat(_e,"/").concat(_t||"")}},{key:"startTick",value:function startTick(j,_e,_t){this.tickerMap.set(this.tickerKey(j,_e,_t),(new Date).getTime())}},{key:"getElapse",value:function getElapse(j,_e,_t){var St=this.tickerKey(j,_e,_t);return this.tickerMap.has(St)?(new Date).getTime()-this.tickerMap.get(St):0}},{key:"reportEC",value:(St=_asyncToGenerator(report_regeneratorRuntime().mark((function _callee3(j,_e,_t){return report_regeneratorRuntime().wrap((function _callee3$(St){for(;;)switch(St.prev=St.next){case 0:return St.abrupt("return",this.report(j,_e,{count:1},_t));case 1:case"end":return St.stop()}}),_callee3,this)}))),function reportEC(j,_e,_t){return St.apply(this,arguments)})},{key:"reportElapse",value:(_t=_asyncToGenerator(report_regeneratorRuntime().mark((function _callee4(j,_e,_t){return report_regeneratorRuntime().wrap((function _callee4$(St){for(;;)switch(St.prev=St.next){case 0:return St.abrupt("return",this.report(j,_e,{elapse:this.getElapse(j,_e,null==_t?void 0:_t.api)},_t));case 1:case"end":return St.stop()}}),_callee4,this)}))),function reportElapse(j,_e,St){return _t.apply(this,arguments)})},{key:"reportHttp",value:(_e=_asyncToGenerator(report_regeneratorRuntime().mark((function _callee5(j,_e,_t,St,Tt,Ut){return report_regeneratorRuntime().wrap((function _callee5$(_r){for(;;)switch(_r.prev=_r.next){case 0:return _r.abrupt("return",this.report(j,_e,{elapse:this.getElapse(j,_e,_t)},{api:_t,httpCode:St,result:Tt,errCode:Ut}));case 1:case"end":return _r.stop()}}),_callee5,this)}))),function reportHttp(j,_t,St,Tt,Ut,_r){return _e.apply(this,arguments)})}]),ReportService}(NS);function api_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */api_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function api_createSuper(j){var _e=function api_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}US.shared=new US,function(j){j[j.v1=1]="v1",j[j.v2=2]="v2"}(jS||(jS={}));var FS,GS,VS,qS,QS=TS.attach()(BS=function(j){_inherits(AgoraRteService,j);var _e,_t,St,Tt,Ut,_r,_n,_i,Ei,Ci,Di,Fi,_o,ga,_a,_s,_c=api_createSuper(AgoraRteService);function AgoraRteService(){return _classCallCheck(this,AgoraRteService),_c.call(this)}return _createClass(AgoraRteService,[{key:"checkIn",value:(_s=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee(j,_e,_t,St,Tt){var Ut,_r;return api_regeneratorRuntime().wrap((function _callee$(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.next=2,this.fetch({path:"/v2/rooms/".concat(j,"/users/").concat(_e),pathPrefix:"/edu/apps/".concat(KS.shared.appId),method:"PUT",data:{boardRegion:"cn-hz",duration:18e3,role:Tt,roomName:_t,roomType:4,userName:St,userProperties:{}}});case 2:return Ut=_n.sent,_r=Ut.data,_n.abrupt("return",_r);case 5:case"end":return _n.stop()}}),_callee,this)}))),function checkIn(j,_e,_t,St,Tt){return _s.apply(this,arguments)})},{key:"entryRoom",value:(_a=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee2(j){var _e,_t,St;return api_regeneratorRuntime().wrap((function _callee2$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return US.shared.startTick("joinRoom","http","entry"),Tt.next=3,this.fetch({path:"/v1/rooms/".concat(j.roomUuid,"/users/").concat(j.userUuid,"/entry"),method:"POST",data:j});case 3:return _e=Tt.sent,_t=_e.__status,St=_e.code,US.shared.reportHttp("joinRoom","http","entry",_t,200===_t,St),Tt.abrupt("return",_e.data);case 8:case"end":return Tt.stop()}}),_callee2,this)}))),function entryRoom(j){return _a.apply(this,arguments)})},{key:"syncSnapShot",value:(ga=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee3(j){var _e,_t,St,Tt,Ut,_r,_n,_i;return api_regeneratorRuntime().wrap((function _callee3$(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return Ei.next=2,this.fetch({path:"/v1/rooms/".concat(j,"/snapshot"),method:"GET"});case 2:return _t=Ei.sent,St=_t.data,Tt=null!==(_e=St.sequence)&&void 0!==_e?_e:0,Ut=XE()(St,"snapshot.room.roomInfo",null),_r=XE()(St,"snapshot.room.roomProperties",null),_n=XE()(St,"snapshot.room.roomState"),_i=XE()(St,"snapshot.users",[]),Ei.abrupt("return",{seq:Tt,roomInfo:Ut,roomState:_n,roomProperties:_r,users:_i});case 10:case"end":return Ei.stop()}}),_callee3,this)}))),function syncSnapShot(j){return ga.apply(this,arguments)})},{key:"syncSequence",value:(_o=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee4(j,_e,_t){var St;return api_regeneratorRuntime().wrap((function _callee4$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,this.fetch({path:"/v1/rooms/".concat(j,"/sequences?nextId=").concat(_e,"&count=").concat(_t),method:"GET"});case 2:return St=Tt.sent,Tt.abrupt("return",St.data);case 4:case"end":return Tt.stop()}}),_callee4,this)}))),function syncSequence(j,_e,_t){return _o.apply(this,arguments)})},{key:"updateRoomProperties",value:(Fi=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee5(j){var _e,_t,St,Tt,Ut;return api_regeneratorRuntime().wrap((function _callee5$(_r){for(;;)switch(_r.prev=_r.next){case 0:return _e=j.roomUuid,_t=j.properties,St=j.cause,Tt={properties:_t},St&&(Tt.cause=St),_r.next=5,this.fetch({path:"/v1/rooms/".concat(_e,"/properties"),method:"PUT",data:Tt});case 5:return Ut=_r.sent,_r.abrupt("return",Ut.data);case 7:case"end":return _r.stop()}}),_callee5,this)}))),function updateRoomProperties(j){return Fi.apply(this,arguments)})},{key:"deleteRoomProperties",value:(Di=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee6(j){var _e,_t,St,Tt,Ut;return api_regeneratorRuntime().wrap((function _callee6$(_r){for(;;)switch(_r.prev=_r.next){case 0:return _e=j.roomUuid,_t=j.properties,St=j.cause,Tt={properties:_t},St&&(Tt.cause=St),_r.next=5,this.fetch({path:"/v1/rooms/".concat(_e,"/properties"),method:"DELETE",data:Tt});case 5:return Ut=_r.sent,_r.abrupt("return",Ut.data);case 7:case"end":return _r.stop()}}),_callee6,this)}))),function deleteRoomProperties(j){return Di.apply(this,arguments)})},{key:"updateUserProperties",value:(Ci=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee7(j){var _e,_t,St,Tt,Ut,_r;return api_regeneratorRuntime().wrap((function _callee7$(_n){for(;;)switch(_n.prev=_n.next){case 0:return _e=j.roomUuid,_t=j.userUuid,St=j.properties,Tt=j.cause,Ut={properties:St,cause:void 0===Tt?void 0:Tt},_n.next=4,this.fetch({path:"/v1/rooms/".concat(_e,"/users/").concat(_t,"/properties"),method:"PUT",data:Ut});case 4:return _r=_n.sent,_n.abrupt("return",_r.data);case 6:case"end":return _n.stop()}}),_callee7,this)}))),function updateUserProperties(j){return Ci.apply(this,arguments)})},{key:"updateBatchUserProperties",value:(Ei=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee8(j){var _e,_t,St;return api_regeneratorRuntime().wrap((function _callee8$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return _e=j.roomUuid,_t=j.data,Tt.next=3,this.fetch({path:"/v1/rooms/".concat(_e,"/users/properties"),method:"PUT",data:{users:_t}});case 3:return St=Tt.sent,Tt.abrupt("return",St.data);case 5:case"end":return Tt.stop()}}),_callee8,this)}))),function updateBatchUserProperties(j){return Ei.apply(this,arguments)})},{key:"deleteUserProperties",value:(_i=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee9(j){var _e,_t,St,Tt,Ut,_r,_n;return api_regeneratorRuntime().wrap((function _callee9$(_i){for(;;)switch(_i.prev=_i.next){case 0:return _e=j.roomUuid,_t=j.userUuid,St=j.properties,Tt=j.cause,_r={properties:St},(Ut=void 0===Tt?void 0:Tt)&&(_r.cause=Ut),_i.next=5,this.fetch({path:"/v1/rooms/".concat(_e,"/users/").concat(_t,"/properties"),method:"DELETE",data:{users:_r}});case 5:return _n=_i.sent,_i.abrupt("return",_n.data);case 7:case"end":return _i.stop()}}),_callee9,this)}))),function deleteUserProperties(j){return _i.apply(this,arguments)})},{key:"deleteBatchUserProperties",value:(_n=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee10(j){var _e,_t,St;return api_regeneratorRuntime().wrap((function _callee10$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return _e=j.roomUuid,_t=j.data,Tt.next=3,this.fetch({path:"/v1/rooms/".concat(_e,"/users/properties"),method:"DELETE",data:{users:_t}});case 3:return St=Tt.sent,Tt.abrupt("return",St.data);case 5:case"end":return Tt.stop()}}),_callee10,this)}))),function deleteBatchUserProperties(j){return _n.apply(this,arguments)})},{key:"upsertStream",value:(_r=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee11(j,_e,_t,St){var Tt,Ut,_r,_n;return api_regeneratorRuntime().wrap((function _callee11$(_i){for(;;)switch(_i.prev=_i.next){case 0:return Tt=St.publishVideo,Ut=St.publishAudio,_r=St.videoSourceType,_n=St.audioSourceType,_i.next=3,this.fetch({path:"/v1/rooms/".concat(j,"/users/").concat(_e,"/streams/").concat(_t),method:"PUT",data:{videoState:Tt,audioState:Ut,videoSourceType:_r,audioSourceType:_n}});case 3:return _i.abrupt("return",_i.sent);case 4:case"end":return _i.stop()}}),_callee11,this)}))),function upsertStream(j,_e,_t,St){return _r.apply(this,arguments)})},{key:"deleteStream",value:(Ut=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee12(j,_e,_t){return api_regeneratorRuntime().wrap((function _callee12$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,this.fetch({path:"/v1/rooms/".concat(j,"/users/").concat(_e,"/streams/").concat(_t),method:"DELETE"});case 2:return St.abrupt("return",St.sent);case 3:case"end":return St.stop()}}),_callee12,this)}))),function deleteStream(j,_e,_t){return Ut.apply(this,arguments)})},{key:"updateDeviceState",value:(Tt=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee13(j,_e,_t,St){var Tt,Ut;return api_regeneratorRuntime().wrap((function _callee13$(_r){for(;;)switch(_r.prev=_r.next){case 0:return Tt=St.videoSourceState,Ut=St.audioSourceState,_r.next=3,this.fetch({path:"/v1/rooms/".concat(j,"/users/").concat(_e,"/streams/").concat(_t),method:"PATCH",data:{videoSourceState:Tt,audioSourceState:Ut}});case 3:return _r.abrupt("return",_r.sent);case 4:case"end":return _r.stop()}}),_callee13,this)}))),function updateDeviceState(j,_e,_t,St){return Tt.apply(this,arguments)})},{key:"sendRoomChatMessage",value:(St=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee14(j,_e){var _t;return api_regeneratorRuntime().wrap((function _callee14$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,this.fetch({path:"/v1/rooms/".concat(_e,"/chat/channel"),method:"POST",data:{message:j,type:1}});case 2:return _t=St.sent,St.abrupt("return",_t.data);case 4:case"end":return St.stop()}}),_callee14,this)}))),function sendRoomChatMessage(j,_e){return St.apply(this,arguments)})},{key:"publishStreamToCdn",value:(_t=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee15(j,_e,_t,St){return api_regeneratorRuntime().wrap((function _callee15$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,this.fetch({path:"/v1/rooms/".concat(j,"/users/").concat(_e,"/streams/").concat(_t),method:"PUT",data:St});case 2:return Tt.abrupt("return",Tt.sent);case 3:case"end":return Tt.stop()}}),_callee15,this)}))),function publishStreamToCdn(j,_e,St,Tt){return _t.apply(this,arguments)})},{key:"updateOnlineState",value:(_e=_asyncToGenerator(api_regeneratorRuntime().mark((function _callee16(j){var _e,_t;return api_regeneratorRuntime().wrap((function _callee16$(St){for(;;)switch(St.prev=St.next){case 0:return _e=j.userUuid,_t=j.roomUuid,St.next=3,this.fetch({path:"/v1/rooms/".concat(_t,"/users/").concat(_e,"/states/1"),method:"PUT"});case 3:return St.abrupt("return",St.sent);case 4:case"end":return St.stop()}}),_callee16,this)}))),function updateOnlineState(j){return _e.apply(this,arguments)})}]),AgoraRteService}(NS))||BS;function configs_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function configs_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?configs_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):configs_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}!function(j){j[j.Electron=0]="Electron",j[j.Web=1]="Web"}(FS||(FS={})),function(j){j.CN="CN",j.AP="AP",j.EU="EU",j.NA="NA"}(GS||(GS={})),function(j){j.AREA_GLOBAL="AREA_GLOBAL",j.AREA_CN="AREA_CN",j.AREA_AS="AREA_AS",j.AREA_EUR="AREA_EUR",j.AREA_NA="AREA_NA",j.AREA_JAPAN="AREA_JAPAN",j.AREA_INDIA="AREA_INDIA"}(VS||(VS={})),function(j){j[j.Low=1]="Low",j[j.UltraLow=2]="UltraLow"}(qS||(qS={}));var KS=function(){function AgoraRteEngineConfig(j,_e){_classCallCheck(this,AgoraRteEngineConfig),this.appId=void 0,this.service={},this.rtcConfigs={},this.logFilePath=void 0,this.rtcSDKParameters=[],this.rtcSDKExtensions=[],this.latencyLevel=qS.UltraLow,this.userId="",this.token="",this.ignoreUrlRegionPrefix=!1,this.region=GS.CN,this._rtcRegion=void 0,this._rtmRegion=void 0,this.SCENE_JOIN_RETRY_ATTEMPTS=3,this.appId=j,_e&&(_e.region&&(this.region=_e.region),_e.rtcConfigs&&(this.rtcConfigs=configs_objectSpread(configs_objectSpread({},this.rtcConfigs),_e.rtcConfigs)),_e.rtcSDKParameters&&(this.rtcSDKParameters=_e.rtcSDKParameters),_e.rtcSDKExtensions&&(this.rtcSDKExtensions=_e.rtcSDKExtensions),_e.latencyLevel&&(this.latencyLevel=_e.latencyLevel))}return _createClass(AgoraRteEngineConfig,[{key:"rtcRegion",get:function get(){var j;return null!==(j=this._rtcRegion)&&void 0!==j?j:VS.AREA_GLOBAL}},{key:"rtmRegion",get:function get(){var j;return null!==(j=this._rtmRegion)&&void 0!==j?j:VS.AREA_GLOBAL}},{key:"setRtcRegion",value:function setRtcRegion(j){this._rtcRegion=j}},{key:"setRtmRegion",value:function setRtmRegion(j){this._rtmRegion=j}}],[{key:"setConfig",value:function setConfig(j){this._config=j}},{key:"shared",get:function get(){return this._config?this._config:zE.shared.handleThrowableError(QE.RTE_ERR_CONFIG_NOT_READY,new Error("classroom config not ready"))}},{key:"platform",get:function get(){return navigator.userAgent.toLowerCase().indexOf(" electron/")>-1?FS.Electron:FS.Web}},{key:"version",get:function get(){return"2.8.40"}}]),AgoraRteEngineConfig}();function _applyDecoratedDescriptor(j,_e,_t,St,Tt){var Ut={};return Object.keys(St).forEach((function(j){Ut[j]=St[j]})),Ut.enumerable=!!Ut.enumerable,Ut.configurable=!!Ut.configurable,("value"in Ut||Ut.initializer)&&(Ut.writable=!0),Ut=_t.slice().reverse().reduce((function(_t,St){return St(j,_e,_t)||_t}),Ut),Tt&&void 0!==Ut.initializer&&(Ut.value=Ut.initializer?Ut.initializer.call(Tt):void 0,Ut.initializer=void 0),void 0===Ut.initializer&&(Object.defineProperty(j,_e,Ut),Ut=null),Ut}KS._config=void 0,KS.logLevel=SE.INFO,KS.consoleHijackEnabled=!1,KS.sequenceVersion=jS.v2;__webpack_require__(2707),__webpack_require__(3123),__webpack_require__(561);var WS="delete",HS=32,zS=31,YS={};function SetRef(j){j&&(j.value=!0)}function OwnerID(){}function ensureSize(j){return void 0===j.size&&(j.size=j.__iterate(returnTrue)),j.size}function wrapIndex(j,_e){if("number"!=typeof _e){var _t=_e>>>0;if(""+_t!==_e||4294967295===_t)return NaN;_e=_t}return _e<0?ensureSize(j)+_e:_e}function returnTrue(){return!0}function wholeSlice(j,_e,_t){return(0===j&&!isNeg(j)||void 0!==_t&&j<=-_t)&&(void 0===_e||void 0!==_t&&_e>=_t)}function resolveBegin(j,_e){return resolveIndex(j,_e,0)}function resolveEnd(j,_e){return resolveIndex(j,_e,_e)}function resolveIndex(j,_e,_t){return void 0===j?_t:isNeg(j)?_e===1/0?_e:0|Math.max(0,_e+j):void 0===_e||_e===j?j:0|Math.min(_e,j)}function isNeg(j){return j<0||0===j&&1/j==-1/0}var JS="@@__IMMUTABLE_ITERABLE__@@";function isCollection(j){return Boolean(j&&j[JS])}var XS="@@__IMMUTABLE_KEYED__@@";function isKeyed(j){return Boolean(j&&j[XS])}var ZS="@@__IMMUTABLE_INDEXED__@@";function isIndexed(j){return Boolean(j&&j[ZS])}function isAssociative(j){return isKeyed(j)||isIndexed(j)}var $S=function Collection(j){return isCollection(j)?j:pI(j)},eI=function(j){function KeyedCollection(j){return isKeyed(j)?j:gI(j)}return j&&(KeyedCollection.__proto__=j),KeyedCollection.prototype=Object.create(j&&j.prototype),KeyedCollection.prototype.constructor=KeyedCollection,KeyedCollection}($S),tI=function(j){function IndexedCollection(j){return isIndexed(j)?j:vI(j)}return j&&(IndexedCollection.__proto__=j),IndexedCollection.prototype=Object.create(j&&j.prototype),IndexedCollection.prototype.constructor=IndexedCollection,IndexedCollection}($S),rI=function(j){function SetCollection(j){return isCollection(j)&&!isAssociative(j)?j:mI(j)}return j&&(SetCollection.__proto__=j),SetCollection.prototype=Object.create(j&&j.prototype),SetCollection.prototype.constructor=SetCollection,SetCollection}($S);$S.Keyed=eI,$S.Indexed=tI,$S.Set=rI;var nI="@@__IMMUTABLE_SEQ__@@";function isSeq(j){return Boolean(j&&j[nI])}var iI="@@__IMMUTABLE_RECORD__@@";function isRecord(j){return Boolean(j&&j[iI])}function isImmutable(j){return isCollection(j)||isRecord(j)}var oI="@@__IMMUTABLE_ORDERED__@@";function isOrdered(j){return Boolean(j&&j[oI])}var sI="function"==typeof Symbol&&Symbol.iterator,cI="@@iterator",uI=sI||cI,lI=function Iterator(j){this.next=j};function iteratorValue(j,_e,_t,St){var Tt=0===j?_e:1===j?_t:[_e,_t];return St?St.value=Tt:St={value:Tt,done:!1},St}function iteratorDone(){return{value:void 0,done:!0}}function hasIterator(j){return!!Array.isArray(j)||!!getIteratorFn(j)}function isIterator(j){return j&&"function"==typeof j.next}function getIterator(j){var _e=getIteratorFn(j);return _e&&_e.call(j)}function getIteratorFn(j){var _e=j&&(sI&&j[sI]||j[cI]);if("function"==typeof _e)return _e}lI.prototype.toString=function toString(){return"[Iterator]"},lI.KEYS=0,lI.VALUES=1,lI.ENTRIES=2,lI.prototype.inspect=lI.prototype.toSource=function(){return this.toString()},lI.prototype[uI]=function(){return this};var fI=Object.prototype.hasOwnProperty;function isArrayLike(j){return!(!Array.isArray(j)&&"string"!=typeof j)||j&&"object"==typeof j&&Number.isInteger(j.length)&&j.length>=0&&(0===j.length?1===Object.keys(j).length:j.hasOwnProperty(j.length-1))}var pI=function(j){function Seq(j){return null==j?emptySequence():isImmutable(j)?j.toSeq():function seqFromValue(j){var _e=maybeIndexedSeqFromValue(j);if(_e)return function isEntriesIterable(j){var _e=getIteratorFn(j);return _e&&_e===j.entries}(j)?_e.fromEntrySeq():function isKeysIterable(j){var _e=getIteratorFn(j);return _e&&_e===j.keys}(j)?_e.toSetSeq():_e;if("object"==typeof j)return new _I(j);throw new TypeError("Expected Array or collection object of values, or keyed object: "+j)}(j)}return j&&(Seq.__proto__=j),Seq.prototype=Object.create(j&&j.prototype),Seq.prototype.constructor=Seq,Seq.prototype.toSeq=function toSeq(){return this},Seq.prototype.toString=function toString(){return this.__toString("Seq {","}")},Seq.prototype.cacheResult=function cacheResult(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},Seq.prototype.__iterate=function __iterate(j,_e){var _t=this._cache;if(_t){for(var St=_t.length,Tt=0;Tt!==St;){var Ut=_t[_e?St-++Tt:Tt++];if(!1===j(Ut[1],Ut[0],this))break}return Tt}return this.__iterateUncached(j,_e)},Seq.prototype.__iterator=function __iterator(j,_e){var _t=this._cache;if(_t){var St=_t.length,Tt=0;return new lI((function(){if(Tt===St)return{value:void 0,done:!0};var Ut=_t[_e?St-++Tt:Tt++];return iteratorValue(j,Ut[0],Ut[1])}))}return this.__iteratorUncached(j,_e)},Seq}($S),gI=function(j){function KeyedSeq(j){return null==j?emptySequence().toKeyedSeq():isCollection(j)?isKeyed(j)?j.toSeq():j.fromEntrySeq():isRecord(j)?j.toSeq():keyedSeqFromValue(j)}return j&&(KeyedSeq.__proto__=j),KeyedSeq.prototype=Object.create(j&&j.prototype),KeyedSeq.prototype.constructor=KeyedSeq,KeyedSeq.prototype.toKeyedSeq=function toKeyedSeq(){return this},KeyedSeq}(pI),vI=function(j){function IndexedSeq(j){return null==j?emptySequence():isCollection(j)?isKeyed(j)?j.entrySeq():j.toIndexedSeq():isRecord(j)?j.toSeq().entrySeq():indexedSeqFromValue(j)}return j&&(IndexedSeq.__proto__=j),IndexedSeq.prototype=Object.create(j&&j.prototype),IndexedSeq.prototype.constructor=IndexedSeq,IndexedSeq.of=function of(){return IndexedSeq(arguments)},IndexedSeq.prototype.toIndexedSeq=function toIndexedSeq(){return this},IndexedSeq.prototype.toString=function toString(){return this.__toString("Seq [","]")},IndexedSeq}(pI),mI=function(j){function SetSeq(j){return(isCollection(j)&&!isAssociative(j)?j:vI(j)).toSetSeq()}return j&&(SetSeq.__proto__=j),SetSeq.prototype=Object.create(j&&j.prototype),SetSeq.prototype.constructor=SetSeq,SetSeq.of=function of(){return SetSeq(arguments)},SetSeq.prototype.toSetSeq=function toSetSeq(){return this},SetSeq}(pI);pI.isSeq=isSeq,pI.Keyed=gI,pI.Set=mI,pI.Indexed=vI,pI.prototype[nI]=!0;var AI=function(j){function ArraySeq(j){this._array=j,this.size=j.length}return j&&(ArraySeq.__proto__=j),ArraySeq.prototype=Object.create(j&&j.prototype),ArraySeq.prototype.constructor=ArraySeq,ArraySeq.prototype.get=function get(j,_e){return this.has(j)?this._array[wrapIndex(this,j)]:_e},ArraySeq.prototype.__iterate=function __iterate(j,_e){for(var _t=this._array,St=_t.length,Tt=0;Tt!==St;){var Ut=_e?St-++Tt:Tt++;if(!1===j(_t[Ut],Ut,this))break}return Tt},ArraySeq.prototype.__iterator=function __iterator(j,_e){var _t=this._array,St=_t.length,Tt=0;return new lI((function(){if(Tt===St)return{value:void 0,done:!0};var Ut=_e?St-++Tt:Tt++;return iteratorValue(j,Ut,_t[Ut])}))},ArraySeq}(vI),_I=function(j){function ObjectSeq(j){var _e=Object.keys(j);this._object=j,this._keys=_e,this.size=_e.length}return j&&(ObjectSeq.__proto__=j),ObjectSeq.prototype=Object.create(j&&j.prototype),ObjectSeq.prototype.constructor=ObjectSeq,ObjectSeq.prototype.get=function get(j,_e){return void 0===_e||this.has(j)?this._object[j]:_e},ObjectSeq.prototype.has=function has(j){return fI.call(this._object,j)},ObjectSeq.prototype.__iterate=function __iterate(j,_e){for(var _t=this._object,St=this._keys,Tt=St.length,Ut=0;Ut!==Tt;){var _r=St[_e?Tt-++Ut:Ut++];if(!1===j(_t[_r],_r,this))break}return Ut},ObjectSeq.prototype.__iterator=function __iterator(j,_e){var _t=this._object,St=this._keys,Tt=St.length,Ut=0;return new lI((function(){if(Ut===Tt)return{value:void 0,done:!0};var _r=St[_e?Tt-++Ut:Ut++];return iteratorValue(j,_r,_t[_r])}))},ObjectSeq}(gI);_I.prototype[oI]=!0;var EI,wI=function(j){function CollectionSeq(j){this._collection=j,this.size=j.length||j.size}return j&&(CollectionSeq.__proto__=j),CollectionSeq.prototype=Object.create(j&&j.prototype),CollectionSeq.prototype.constructor=CollectionSeq,CollectionSeq.prototype.__iterateUncached=function __iterateUncached(j,_e){if(_e)return this.cacheResult().__iterate(j,_e);var _t=getIterator(this._collection),St=0;if(isIterator(_t))for(var Tt;!(Tt=_t.next()).done&&!1!==j(Tt.value,St++,this););return St},CollectionSeq.prototype.__iteratorUncached=function __iteratorUncached(j,_e){if(_e)return this.cacheResult().__iterator(j,_e);var _t=getIterator(this._collection);if(!isIterator(_t))return new lI(iteratorDone);var St=0;return new lI((function(){var _e=_t.next();return _e.done?_e:iteratorValue(j,St++,_e.value)}))},CollectionSeq}(vI);function emptySequence(){return EI||(EI=new AI([]))}function keyedSeqFromValue(j){var _e=maybeIndexedSeqFromValue(j);if(_e)return _e.fromEntrySeq();if("object"==typeof j)return new _I(j);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+j)}function indexedSeqFromValue(j){var _e=maybeIndexedSeqFromValue(j);if(_e)return _e;throw new TypeError("Expected Array or collection object of values: "+j)}function maybeIndexedSeqFromValue(j){return isArrayLike(j)?new AI(j):hasIterator(j)?new wI(j):void 0}var SI="@@__IMMUTABLE_MAP__@@";function isMap(j){return Boolean(j&&j[SI])}function isOrderedMap(j){return isMap(j)&&isOrdered(j)}function isValueObject(j){return Boolean(j&&"function"==typeof j.equals&&"function"==typeof j.hashCode)}function is(j,_e){if(j===_e||j!=j&&_e!=_e)return!0;if(!j||!_e)return!1;if("function"==typeof j.valueOf&&"function"==typeof _e.valueOf){if((j=j.valueOf())===(_e=_e.valueOf())||j!=j&&_e!=_e)return!0;if(!j||!_e)return!1}return!!(isValueObject(j)&&isValueObject(_e)&&j.equals(_e))}var II="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function imul(j,_e){var _t=65535&(j|=0),St=65535&(_e|=0);return _t*St+((j>>>16)*St+_t*(_e>>>16)<<16>>>0)|0};function smi(j){return j>>>1&1073741824|3221225471&j}var RI=Object.prototype.valueOf;function hash(j){if(null==j)return hashNullish(j);if("function"==typeof j.hashCode)return smi(j.hashCode(j));var _e=function immutable_es_valueOf(j){return j.valueOf!==RI&&"function"==typeof j.valueOf?j.valueOf(j):j}(j);if(null==_e)return hashNullish(_e);switch(typeof _e){case"boolean":return _e?1108378657:1108378656;case"number":return function hashNumber(j){if(j!=j||j===1/0)return 0;var _e=0|j;_e!==j&&(_e^=4294967295*j);for(;j>4294967295;)_e^=j/=4294967295;return smi(_e)}(_e);case"string":return _e.length>BI?function cachedHashString(j){var _e=FI[j];void 0===_e&&(_e=hashString(j),UI===jI&&(UI=0,FI={}),UI++,FI[j]=_e);return _e}(_e):hashString(_e);case"object":case"function":return function hashJSObj(j){var _e;if(xI&&void 0!==(_e=DI.get(j)))return _e;if(void 0!==(_e=j[MI]))return _e;if(!OI){if(void 0!==(_e=j.propertyIsEnumerable&&j.propertyIsEnumerable[MI]))return _e;if(void 0!==(_e=function getIENodeHash(j){if(j&&j.nodeType>0)switch(j.nodeType){case 1:return j.uniqueID;case 9:return j.documentElement&&j.documentElement.uniqueID}}(j)))return _e}if(_e=nextHash(),xI)DI.set(j,_e);else{if(void 0!==kI&&!1===kI(j))throw new Error("Non-extensible objects are not allowed as keys.");if(OI)Object.defineProperty(j,MI,{enumerable:!1,configurable:!1,writable:!1,value:_e});else if(void 0!==j.propertyIsEnumerable&&j.propertyIsEnumerable===j.constructor.prototype.propertyIsEnumerable)j.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},j.propertyIsEnumerable[MI]=_e;else{if(void 0===j.nodeType)throw new Error("Unable to set a non-enumerable property on object.");j[MI]=_e}}return _e}(_e);case"symbol":return function hashSymbol(j){var _e=LI[j];if(void 0!==_e)return _e;return _e=nextHash(),LI[j]=_e,_e}(_e);default:if("function"==typeof _e.toString)return hashString(_e.toString());throw new Error("Value type "+typeof _e+" cannot be hashed.")}}function hashNullish(j){return null===j?1108378658:1108378659}function hashString(j){for(var _e=0,_t=0;_t<j.length;_t++)_e=31*_e+j.charCodeAt(_t)|0;return smi(_e)}var kI=Object.isExtensible,OI=function(){try{return Object.defineProperty({},"@",{}),!0}catch(j){return!1}}();function nextHash(){var j=++NI;return 1073741824&NI&&(NI=0),j}var DI,xI="function"==typeof WeakMap;xI&&(DI=new WeakMap);var LI=Object.create(null),NI=0,MI="__immutablehash__";"function"==typeof Symbol&&(MI=Symbol(MI));var BI=16,jI=255,UI=0,FI={},GI=function(j){function ToKeyedSequence(j,_e){this._iter=j,this._useKeys=_e,this.size=j.size}return j&&(ToKeyedSequence.__proto__=j),ToKeyedSequence.prototype=Object.create(j&&j.prototype),ToKeyedSequence.prototype.constructor=ToKeyedSequence,ToKeyedSequence.prototype.get=function get(j,_e){return this._iter.get(j,_e)},ToKeyedSequence.prototype.has=function has(j){return this._iter.has(j)},ToKeyedSequence.prototype.valueSeq=function valueSeq(){return this._iter.valueSeq()},ToKeyedSequence.prototype.reverse=function reverse(){var j=this,_e=reverseFactory(this,!0);return this._useKeys||(_e.valueSeq=function(){return j._iter.toSeq().reverse()}),_e},ToKeyedSequence.prototype.map=function map(j,_e){var _t=this,St=mapFactory(this,j,_e);return this._useKeys||(St.valueSeq=function(){return _t._iter.toSeq().map(j,_e)}),St},ToKeyedSequence.prototype.__iterate=function __iterate(j,_e){var _t=this;return this._iter.__iterate((function(_e,St){return j(_e,St,_t)}),_e)},ToKeyedSequence.prototype.__iterator=function __iterator(j,_e){return this._iter.__iterator(j,_e)},ToKeyedSequence}(gI);GI.prototype[oI]=!0;var VI=function(j){function ToIndexedSequence(j){this._iter=j,this.size=j.size}return j&&(ToIndexedSequence.__proto__=j),ToIndexedSequence.prototype=Object.create(j&&j.prototype),ToIndexedSequence.prototype.constructor=ToIndexedSequence,ToIndexedSequence.prototype.includes=function includes(j){return this._iter.includes(j)},ToIndexedSequence.prototype.__iterate=function __iterate(j,_e){var _t=this,St=0;return _e&&ensureSize(this),this._iter.__iterate((function(Tt){return j(Tt,_e?_t.size-++St:St++,_t)}),_e)},ToIndexedSequence.prototype.__iterator=function __iterator(j,_e){var _t=this,St=this._iter.__iterator(1,_e),Tt=0;return _e&&ensureSize(this),new lI((function(){var Ut=St.next();return Ut.done?Ut:iteratorValue(j,_e?_t.size-++Tt:Tt++,Ut.value,Ut)}))},ToIndexedSequence}(vI),qI=function(j){function ToSetSequence(j){this._iter=j,this.size=j.size}return j&&(ToSetSequence.__proto__=j),ToSetSequence.prototype=Object.create(j&&j.prototype),ToSetSequence.prototype.constructor=ToSetSequence,ToSetSequence.prototype.has=function has(j){return this._iter.includes(j)},ToSetSequence.prototype.__iterate=function __iterate(j,_e){var _t=this;return this._iter.__iterate((function(_e){return j(_e,_e,_t)}),_e)},ToSetSequence.prototype.__iterator=function __iterator(j,_e){var _t=this._iter.__iterator(1,_e);return new lI((function(){var _e=_t.next();return _e.done?_e:iteratorValue(j,_e.value,_e.value,_e)}))},ToSetSequence}(mI),QI=function(j){function FromEntriesSequence(j){this._iter=j,this.size=j.size}return j&&(FromEntriesSequence.__proto__=j),FromEntriesSequence.prototype=Object.create(j&&j.prototype),FromEntriesSequence.prototype.constructor=FromEntriesSequence,FromEntriesSequence.prototype.entrySeq=function entrySeq(){return this._iter.toSeq()},FromEntriesSequence.prototype.__iterate=function __iterate(j,_e){var _t=this;return this._iter.__iterate((function(_e){if(_e){validateEntry(_e);var St=isCollection(_e);return j(St?_e.get(1):_e[1],St?_e.get(0):_e[0],_t)}}),_e)},FromEntriesSequence.prototype.__iterator=function __iterator(j,_e){var _t=this._iter.__iterator(1,_e);return new lI((function(){for(;;){var _e=_t.next();if(_e.done)return _e;var St=_e.value;if(St){validateEntry(St);var Tt=isCollection(St);return iteratorValue(j,Tt?St.get(0):St[0],Tt?St.get(1):St[1],_e)}}}))},FromEntriesSequence}(gI);function flipFactory(j){var _e=makeSequence(j);return _e._iter=j,_e.size=j.size,_e.flip=function(){return j},_e.reverse=function(){var _e=j.reverse.apply(this);return _e.flip=function(){return j.reverse()},_e},_e.has=function(_e){return j.includes(_e)},_e.includes=function(_e){return j.has(_e)},_e.cacheResult=cacheResultThrough,_e.__iterateUncached=function(_e,_t){var St=this;return j.__iterate((function(j,_t){return!1!==_e(_t,j,St)}),_t)},_e.__iteratorUncached=function(_e,_t){if(2===_e){var St=j.__iterator(_e,_t);return new lI((function(){var j=St.next();if(!j.done){var _e=j.value[0];j.value[0]=j.value[1],j.value[1]=_e}return j}))}return j.__iterator(1===_e?0:1,_t)},_e}function mapFactory(j,_e,_t){var St=makeSequence(j);return St.size=j.size,St.has=function(_e){return j.has(_e)},St.get=function(St,Tt){var Ut=j.get(St,YS);return Ut===YS?Tt:_e.call(_t,Ut,St,j)},St.__iterateUncached=function(St,Tt){var Ut=this;return j.__iterate((function(j,Tt,_r){return!1!==St(_e.call(_t,j,Tt,_r),Tt,Ut)}),Tt)},St.__iteratorUncached=function(St,Tt){var Ut=j.__iterator(2,Tt);return new lI((function(){var Tt=Ut.next();if(Tt.done)return Tt;var _r=Tt.value,_n=_r[0];return iteratorValue(St,_n,_e.call(_t,_r[1],_n,j),Tt)}))},St}function reverseFactory(j,_e){var _t=this,St=makeSequence(j);return St._iter=j,St.size=j.size,St.reverse=function(){return j},j.flip&&(St.flip=function(){var _e=flipFactory(j);return _e.reverse=function(){return j.flip()},_e}),St.get=function(_t,St){return j.get(_e?_t:-1-_t,St)},St.has=function(_t){return j.has(_e?_t:-1-_t)},St.includes=function(_e){return j.includes(_e)},St.cacheResult=cacheResultThrough,St.__iterate=function(_t,St){var Tt=this,Ut=0;return St&&ensureSize(j),j.__iterate((function(j,_r){return _t(j,_e?_r:St?Tt.size-++Ut:Ut++,Tt)}),!St)},St.__iterator=function(St,Tt){var Ut=0;Tt&&ensureSize(j);var _r=j.__iterator(2,!Tt);return new lI((function(){var j=_r.next();if(j.done)return j;var _n=j.value;return iteratorValue(St,_e?_n[0]:Tt?_t.size-++Ut:Ut++,_n[1],j)}))},St}function filterFactory(j,_e,_t,St){var Tt=makeSequence(j);return St&&(Tt.has=function(St){var Tt=j.get(St,YS);return Tt!==YS&&!!_e.call(_t,Tt,St,j)},Tt.get=function(St,Tt){var Ut=j.get(St,YS);return Ut!==YS&&_e.call(_t,Ut,St,j)?Ut:Tt}),Tt.__iterateUncached=function(Tt,Ut){var _r=this,_n=0;return j.__iterate((function(j,Ut,_i){if(_e.call(_t,j,Ut,_i))return _n++,Tt(j,St?Ut:_n-1,_r)}),Ut),_n},Tt.__iteratorUncached=function(Tt,Ut){var _r=j.__iterator(2,Ut),_n=0;return new lI((function(){for(;;){var Ut=_r.next();if(Ut.done)return Ut;var _i=Ut.value,Ei=_i[0],Ci=_i[1];if(_e.call(_t,Ci,Ei,j))return iteratorValue(Tt,St?Ei:_n++,Ci,Ut)}}))},Tt}function sliceFactory(j,_e,_t,St){var Tt=j.size;if(wholeSlice(_e,_t,Tt))return j;var Ut=resolveBegin(_e,Tt),_r=resolveEnd(_t,Tt);if(Ut!=Ut||_r!=_r)return sliceFactory(j.toSeq().cacheResult(),_e,_t,St);var _n,_i=_r-Ut;_i==_i&&(_n=_i<0?0:_i);var Ei=makeSequence(j);return Ei.size=0===_n?_n:j.size&&_n||void 0,!St&&isSeq(j)&&_n>=0&&(Ei.get=function(_e,_t){return(_e=wrapIndex(this,_e))>=0&&_e<_n?j.get(_e+Ut,_t):_t}),Ei.__iterateUncached=function(_e,_t){var Tt=this;if(0===_n)return 0;if(_t)return this.cacheResult().__iterate(_e,_t);var _r=0,_i=!0,Ei=0;return j.__iterate((function(j,_t){if(!_i||!(_i=_r++<Ut))return Ei++,!1!==_e(j,St?_t:Ei-1,Tt)&&Ei!==_n})),Ei},Ei.__iteratorUncached=function(_e,_t){if(0!==_n&&_t)return this.cacheResult().__iterator(_e,_t);if(0===_n)return new lI(iteratorDone);var Tt=j.__iterator(_e,_t),_r=0,_i=0;return new lI((function(){for(;_r++<Ut;)Tt.next();if(++_i>_n)return{value:void 0,done:!0};var j=Tt.next();return St||1===_e||j.done?j:iteratorValue(_e,_i-1,0===_e?void 0:j.value[1],j)}))},Ei}function skipWhileFactory(j,_e,_t,St){var Tt=makeSequence(j);return Tt.__iterateUncached=function(Tt,Ut){var _r=this;if(Ut)return this.cacheResult().__iterate(Tt,Ut);var _n=!0,_i=0;return j.__iterate((function(j,Ut,Ei){if(!_n||!(_n=_e.call(_t,j,Ut,Ei)))return _i++,Tt(j,St?Ut:_i-1,_r)})),_i},Tt.__iteratorUncached=function(Tt,Ut){var _r=this;if(Ut)return this.cacheResult().__iterator(Tt,Ut);var _n=j.__iterator(2,Ut),_i=!0,Ei=0;return new lI((function(){var j,Ut,Ci;do{if((j=_n.next()).done)return St||1===Tt?j:iteratorValue(Tt,Ei++,0===Tt?void 0:j.value[1],j);var Di=j.value;Ut=Di[0],Ci=Di[1],_i&&(_i=_e.call(_t,Ci,Ut,_r))}while(_i);return 2===Tt?j:iteratorValue(Tt,Ut,Ci,j)}))},Tt}function concatFactory(j,_e){var _t=isKeyed(j),St=[j].concat(_e).map((function(j){return isCollection(j)?_t&&(j=eI(j)):j=_t?keyedSeqFromValue(j):indexedSeqFromValue(Array.isArray(j)?j:[j]),j})).filter((function(j){return 0!==j.size}));if(0===St.length)return j;if(1===St.length){var Tt=St[0];if(Tt===j||_t&&isKeyed(Tt)||isIndexed(j)&&isIndexed(Tt))return Tt}var Ut=new AI(St);return _t?Ut=Ut.toKeyedSeq():isIndexed(j)||(Ut=Ut.toSetSeq()),(Ut=Ut.flatten(!0)).size=St.reduce((function(j,_e){if(void 0!==j){var _t=_e.size;if(void 0!==_t)return j+_t}}),0),Ut}function flattenFactory(j,_e,_t){var St=makeSequence(j);return St.__iterateUncached=function(Tt,Ut){if(Ut)return this.cacheResult().__iterate(Tt,Ut);var _r=0,_n=!1;return function flatDeep(j,_i){j.__iterate((function(j,Ut){return(!_e||_i<_e)&&isCollection(j)?flatDeep(j,_i+1):(_r++,!1===Tt(j,_t?Ut:_r-1,St)&&(_n=!0)),!_n}),Ut)}(j,0),_r},St.__iteratorUncached=function(St,Tt){if(Tt)return this.cacheResult().__iterator(St,Tt);var Ut=j.__iterator(St,Tt),_r=[],_n=0;return new lI((function(){for(;Ut;){var j=Ut.next();if(!1===j.done){var _i=j.value;if(2===St&&(_i=_i[1]),_e&&!(_r.length<_e)||!isCollection(_i))return _t?j:iteratorValue(St,_n++,_i,j);_r.push(Ut),Ut=_i.__iterator(St,Tt)}else Ut=_r.pop()}return{value:void 0,done:!0}}))},St}function sortFactory(j,_e,_t){_e||(_e=defaultComparator);var St=isKeyed(j),Tt=0,Ut=j.toSeq().map((function(_e,St){return[St,_e,Tt++,_t?_t(_e,St,j):_e]})).valueSeq().toArray();return Ut.sort((function(j,_t){return _e(j[3],_t[3])||j[2]-_t[2]})).forEach(St?function(j,_e){Ut[_e].length=2}:function(j,_e){Ut[_e]=j[1]}),St?gI(Ut):isIndexed(j)?vI(Ut):mI(Ut)}function maxFactory(j,_e,_t){if(_e||(_e=defaultComparator),_t){var St=j.toSeq().map((function(_e,St){return[_e,_t(_e,St,j)]})).reduce((function(j,_t){return maxCompare(_e,j[1],_t[1])?_t:j}));return St&&St[0]}return j.reduce((function(j,_t){return maxCompare(_e,j,_t)?_t:j}))}function maxCompare(j,_e,_t){var St=j(_t,_e);return 0===St&&_t!==_e&&(null==_t||_t!=_t)||St>0}function zipWithFactory(j,_e,_t,St){var Tt=makeSequence(j),Ut=new AI(_t).map((function(j){return j.size}));return Tt.size=St?Ut.max():Ut.min(),Tt.__iterate=function(j,_e){for(var _t,St=this.__iterator(1,_e),Tt=0;!(_t=St.next()).done&&!1!==j(_t.value,Tt++,this););return Tt},Tt.__iteratorUncached=function(j,Tt){var Ut=_t.map((function(j){return j=$S(j),getIterator(Tt?j.reverse():j)})),_r=0,_n=!1;return new lI((function(){var _t;return _n||(_t=Ut.map((function(j){return j.next()})),_n=St?_t.every((function(j){return j.done})):_t.some((function(j){return j.done}))),_n?{value:void 0,done:!0}:iteratorValue(j,_r++,_e.apply(null,_t.map((function(j){return j.value}))))}))},Tt}function reify(j,_e){return j===_e?j:isSeq(j)?_e:j.constructor(_e)}function validateEntry(j){if(j!==Object(j))throw new TypeError("Expected [K, V] tuple: "+j)}function collectionClass(j){return isKeyed(j)?eI:isIndexed(j)?tI:rI}function makeSequence(j){return Object.create((isKeyed(j)?gI:isIndexed(j)?vI:mI).prototype)}function cacheResultThrough(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):pI.prototype.cacheResult.call(this)}function defaultComparator(j,_e){return void 0===j&&void 0===_e?0:void 0===j?1:void 0===_e?-1:j>_e?1:j<_e?-1:0}function arrCopy(j,_e){_e=_e||0;for(var _t=Math.max(0,j.length-_e),St=new Array(_t),Tt=0;Tt<_t;Tt++)St[Tt]=j[Tt+_e];return St}function invariant(j,_e){if(!j)throw new Error(_e)}function assertNotInfinite(j){invariant(j!==1/0,"Cannot perform this action with an infinite size.")}function coerceKeyPath(j){if(isArrayLike(j)&&"string"!=typeof j)return j;if(isOrdered(j))return j.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+j)}VI.prototype.cacheResult=GI.prototype.cacheResult=qI.prototype.cacheResult=QI.prototype.cacheResult=cacheResultThrough;var KI=Object.prototype.toString;function isPlainObject(j){if(!j||"object"!=typeof j||"[object Object]"!==KI.call(j))return!1;var _e=Object.getPrototypeOf(j);if(null===_e)return!0;for(var _t=_e,St=Object.getPrototypeOf(_e);null!==St;)_t=St,St=Object.getPrototypeOf(_t);return _t===_e}function isDataStructure(j){return"object"==typeof j&&(isImmutable(j)||Array.isArray(j)||isPlainObject(j))}function quoteString(j){try{return"string"==typeof j?JSON.stringify(j):String(j)}catch(_e){return JSON.stringify(j)}}function has(j,_e){return isImmutable(j)?j.has(_e):isDataStructure(j)&&fI.call(j,_e)}function immutable_es_get(j,_e,_t){return isImmutable(j)?j.get(_e,_t):has(j,_e)?"function"==typeof j.get?j.get(_e):j[_e]:_t}function shallowCopy(j){if(Array.isArray(j))return arrCopy(j);var _e={};for(var _t in j)fI.call(j,_t)&&(_e[_t]=j[_t]);return _e}function remove(j,_e){if(!isDataStructure(j))throw new TypeError("Cannot update non-data-structure value: "+j);if(isImmutable(j)){if(!j.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+j);return j.remove(_e)}if(!fI.call(j,_e))return j;var _t=shallowCopy(j);return Array.isArray(_t)?_t.splice(_e,1):delete _t[_e],_t}function set(j,_e,_t){if(!isDataStructure(j))throw new TypeError("Cannot update non-data-structure value: "+j);if(isImmutable(j)){if(!j.set)throw new TypeError("Cannot update immutable value without .set() method: "+j);return j.set(_e,_t)}if(fI.call(j,_e)&&_t===j[_e])return j;var St=shallowCopy(j);return St[_e]=_t,St}function updateIn$1(j,_e,_t,St){St||(St=_t,_t=void 0);var Tt=updateInDeeply(isImmutable(j),j,coerceKeyPath(_e),0,_t,St);return Tt===YS?_t:Tt}function updateInDeeply(j,_e,_t,St,Tt,Ut){var _r=_e===YS;if(St===_t.length){var _n=_r?Tt:_e,_i=Ut(_n);return _i===_n?_e:_i}if(!_r&&!isDataStructure(_e))throw new TypeError("Cannot update within non-data-structure value in path ["+_t.slice(0,St).map(quoteString)+"]: "+_e);var Ei=_t[St],Ci=_r?YS:immutable_es_get(_e,Ei,YS),Di=updateInDeeply(Ci===YS?j:isImmutable(Ci),Ci,_t,St+1,Tt,Ut);return Di===Ci?_e:Di===YS?remove(_e,Ei):set(_r?j?emptyMap():{}:_e,Ei,Di)}function setIn$1(j,_e,_t){return updateIn$1(j,_e,YS,(function(){return _t}))}function setIn(j,_e){return setIn$1(this,j,_e)}function removeIn(j,_e){return updateIn$1(j,_e,(function(){return YS}))}function deleteIn(j){return removeIn(this,j)}function update$1(j,_e,_t,St){return updateIn$1(j,[_e],_t,St)}function update(j,_e,_t){return 1===arguments.length?j(this):update$1(this,j,_e,_t)}function updateIn(j,_e,_t){return updateIn$1(this,j,_e,_t)}function merge$1(){for(var j=[],_e=arguments.length;_e--;)j[_e]=arguments[_e];return mergeIntoKeyedWith(this,j)}function mergeWith$1(j){for(var _e=[],_t=arguments.length-1;_t-- >0;)_e[_t]=arguments[_t+1];if("function"!=typeof j)throw new TypeError("Invalid merger function: "+j);return mergeIntoKeyedWith(this,_e,j)}function mergeIntoKeyedWith(j,_e,_t){for(var St=[],Tt=0;Tt<_e.length;Tt++){var Ut=eI(_e[Tt]);0!==Ut.size&&St.push(Ut)}return 0===St.length?j:0!==j.toSeq().size||j.__ownerID||1!==St.length?j.withMutations((function(j){for(var _e=_t?function(_e,St){update$1(j,St,YS,(function(j){return j===YS?_e:_t(j,_e,St)}))}:function(_e,_t){j.set(_t,_e)},Tt=0;Tt<St.length;Tt++)St[Tt].forEach(_e)})):j.constructor(St[0])}function mergeDeepWithSources(j,_e,_t){return mergeWithSources(j,_e,function deepMergerWith(j){function deepMerger(_e,_t,St){return isDataStructure(_e)&&isDataStructure(_t)&&function areMergeable(j,_e){var _t=pI(j),St=pI(_e);return isIndexed(_t)===isIndexed(St)&&isKeyed(_t)===isKeyed(St)}(_e,_t)?mergeWithSources(_e,[_t],deepMerger):j?j(_e,_t,St):_t}return deepMerger}(_t))}function mergeWithSources(j,_e,_t){if(!isDataStructure(j))throw new TypeError("Cannot merge into non-data-structure value: "+j);if(isImmutable(j))return"function"==typeof _t&&j.mergeWith?j.mergeWith.apply(j,[_t].concat(_e)):j.merge?j.merge.apply(j,_e):j.concat.apply(j,_e);for(var St=Array.isArray(j),Tt=j,Ut=St?tI:eI,_r=St?function(_e){Tt===j&&(Tt=shallowCopy(Tt)),Tt.push(_e)}:function(_e,St){var Ut=fI.call(Tt,St),_r=Ut&&_t?_t(Tt[St],_e,St):_e;Ut&&_r===Tt[St]||(Tt===j&&(Tt=shallowCopy(Tt)),Tt[St]=_r)},_n=0;_n<_e.length;_n++)Ut(_e[_n]).forEach(_r);return Tt}function mergeDeep(){for(var j=[],_e=arguments.length;_e--;)j[_e]=arguments[_e];return mergeDeepWithSources(this,j)}function mergeDeepWith(j){for(var _e=[],_t=arguments.length-1;_t-- >0;)_e[_t]=arguments[_t+1];return mergeDeepWithSources(this,_e,j)}function mergeIn(j){for(var _e=[],_t=arguments.length-1;_t-- >0;)_e[_t]=arguments[_t+1];return updateIn$1(this,j,emptyMap(),(function(j){return mergeWithSources(j,_e)}))}function mergeDeepIn(j){for(var _e=[],_t=arguments.length-1;_t-- >0;)_e[_t]=arguments[_t+1];return updateIn$1(this,j,emptyMap(),(function(j){return mergeDeepWithSources(j,_e)}))}function withMutations(j){var _e=this.asMutable();return j(_e),_e.wasAltered()?_e.__ensureOwner(this.__ownerID):this}function asMutable(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)}function asImmutable(){return this.__ensureOwner()}function wasAltered(){return this.__altered}var WI=function(j){function Map(_e){return null==_e?emptyMap():isMap(_e)&&!isOrdered(_e)?_e:emptyMap().withMutations((function(_t){var St=j(_e);assertNotInfinite(St.size),St.forEach((function(j,_e){return _t.set(_e,j)}))}))}return j&&(Map.__proto__=j),Map.prototype=Object.create(j&&j.prototype),Map.prototype.constructor=Map,Map.of=function of(){for(var j=[],_e=arguments.length;_e--;)j[_e]=arguments[_e];return emptyMap().withMutations((function(_e){for(var _t=0;_t<j.length;_t+=2){if(_t+1>=j.length)throw new Error("Missing value for key: "+j[_t]);_e.set(j[_t],j[_t+1])}}))},Map.prototype.toString=function toString(){return this.__toString("Map {","}")},Map.prototype.get=function get(j,_e){return this._root?this._root.get(0,void 0,j,_e):_e},Map.prototype.set=function set(j,_e){return updateMap(this,j,_e)},Map.prototype.remove=function remove(j){return updateMap(this,j,YS)},Map.prototype.deleteAll=function deleteAll(j){var _e=$S(j);return 0===_e.size?this:this.withMutations((function(j){_e.forEach((function(_e){return j.remove(_e)}))}))},Map.prototype.clear=function clear(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):emptyMap()},Map.prototype.sort=function sort(j){return dT(sortFactory(this,j))},Map.prototype.sortBy=function sortBy(j,_e){return dT(sortFactory(this,_e,j))},Map.prototype.map=function map(j,_e){var _t=this;return this.withMutations((function(St){St.forEach((function(Tt,Ut){St.set(Ut,j.call(_e,Tt,Ut,_t))}))}))},Map.prototype.__iterator=function __iterator(j,_e){return new eT(this,j,_e)},Map.prototype.__iterate=function __iterate(j,_e){var _t=this,St=0;return this._root&&this._root.iterate((function(_e){return St++,j(_e[1],_e[0],_t)}),_e),St},Map.prototype.__ensureOwner=function __ensureOwner(j){return j===this.__ownerID?this:j?makeMap(this.size,this._root,j,this.__hash):0===this.size?emptyMap():(this.__ownerID=j,this.__altered=!1,this)},Map}(eI);WI.isMap=isMap;var HI=WI.prototype;HI[SI]=!0,HI[WS]=HI.remove,HI.removeAll=HI.deleteAll,HI.setIn=setIn,HI.removeIn=HI.deleteIn=deleteIn,HI.update=update,HI.updateIn=updateIn,HI.merge=HI.concat=merge$1,HI.mergeWith=mergeWith$1,HI.mergeDeep=mergeDeep,HI.mergeDeepWith=mergeDeepWith,HI.mergeIn=mergeIn,HI.mergeDeepIn=mergeDeepIn,HI.withMutations=withMutations,HI.wasAltered=wasAltered,HI.asImmutable=asImmutable,HI["@@transducer/init"]=HI.asMutable=asMutable,HI["@@transducer/step"]=function(j,_e){return j.set(_e[0],_e[1])},HI["@@transducer/result"]=function(j){return j.asImmutable()};var zI=function ArrayMapNode(j,_e){this.ownerID=j,this.entries=_e};zI.prototype.get=function get(j,_e,_t,St){for(var Tt=this.entries,Ut=0,_r=Tt.length;Ut<_r;Ut++)if(is(_t,Tt[Ut][0]))return Tt[Ut][1];return St},zI.prototype.update=function update(j,_e,_t,St,Tt,Ut,_r){for(var _n=Tt===YS,_i=this.entries,Ei=0,Ci=_i.length;Ei<Ci&&!is(St,_i[Ei][0]);Ei++);var Di=Ei<Ci;if(Di?_i[Ei][1]===Tt:_n)return this;if(SetRef(_r),(_n||!Di)&&SetRef(Ut),!_n||1!==_i.length){if(!Di&&!_n&&_i.length>=tT)return function createNodes(j,_e,_t,St){j||(j=new OwnerID);for(var Tt=new ZI(j,hash(_t),[_t,St]),Ut=0;Ut<_e.length;Ut++){var _r=_e[Ut];Tt=Tt.update(j,0,void 0,_r[0],_r[1])}return Tt}(j,_i,St,Tt);var Fi=j&&j===this.ownerID,_o=Fi?_i:arrCopy(_i);return Di?_n?Ei===Ci-1?_o.pop():_o[Ei]=_o.pop():_o[Ei]=[St,Tt]:_o.push([St,Tt]),Fi?(this.entries=_o,this):new zI(j,_o)}};var YI=function BitmapIndexedNode(j,_e,_t){this.ownerID=j,this.bitmap=_e,this.nodes=_t};YI.prototype.get=function get(j,_e,_t,St){void 0===_e&&(_e=hash(_t));var Tt=1<<((0===j?_e:_e>>>j)&zS),Ut=this.bitmap;return 0==(Ut&Tt)?St:this.nodes[popCount(Ut&Tt-1)].get(j+5,_e,_t,St)},YI.prototype.update=function update(j,_e,_t,St,Tt,Ut,_r){void 0===_t&&(_t=hash(St));var _n=(0===_e?_t:_t>>>_e)&zS,_i=1<<_n,Ei=this.bitmap,Ci=0!=(Ei&_i);if(!Ci&&Tt===YS)return this;var Di=popCount(Ei&_i-1),Fi=this.nodes,_o=Ci?Fi[Di]:void 0,ga=updateNode(_o,j,_e+5,_t,St,Tt,Ut,_r);if(ga===_o)return this;if(!Ci&&ga&&Fi.length>=rT)return function expandNodes(j,_e,_t,St,Tt){for(var Ut=0,_r=new Array(HS),_n=0;0!==_t;_n++,_t>>>=1)_r[_n]=1&_t?_e[Ut++]:void 0;return _r[St]=Tt,new JI(j,Ut+1,_r)}(j,Fi,Ei,_n,ga);if(Ci&&!ga&&2===Fi.length&&isLeafNode(Fi[1^Di]))return Fi[1^Di];if(Ci&&ga&&1===Fi.length&&isLeafNode(ga))return ga;var _a=j&&j===this.ownerID,_s=Ci?ga?Ei:Ei^_i:Ei|_i,_c=Ci?ga?setAt(Fi,Di,ga,_a):function spliceOut(j,_e,_t){var St=j.length-1;if(_t&&_e===St)return j.pop(),j;for(var Tt=new Array(St),Ut=0,_r=0;_r<St;_r++)_r===_e&&(Ut=1),Tt[_r]=j[_r+Ut];return Tt}(Fi,Di,_a):function spliceIn(j,_e,_t,St){var Tt=j.length+1;if(St&&_e+1===Tt)return j[_e]=_t,j;for(var Ut=new Array(Tt),_r=0,_n=0;_n<Tt;_n++)_n===_e?(Ut[_n]=_t,_r=-1):Ut[_n]=j[_n+_r];return Ut}(Fi,Di,ga,_a);return _a?(this.bitmap=_s,this.nodes=_c,this):new YI(j,_s,_c)};var JI=function HashArrayMapNode(j,_e,_t){this.ownerID=j,this.count=_e,this.nodes=_t};JI.prototype.get=function get(j,_e,_t,St){void 0===_e&&(_e=hash(_t));var Tt=(0===j?_e:_e>>>j)&zS,Ut=this.nodes[Tt];return Ut?Ut.get(j+5,_e,_t,St):St},JI.prototype.update=function update(j,_e,_t,St,Tt,Ut,_r){void 0===_t&&(_t=hash(St));var _n=(0===_e?_t:_t>>>_e)&zS,_i=Tt===YS,Ei=this.nodes,Ci=Ei[_n];if(_i&&!Ci)return this;var Di=updateNode(Ci,j,_e+5,_t,St,Tt,Ut,_r);if(Di===Ci)return this;var Fi=this.count;if(Ci){if(!Di&&--Fi<nT)return function packNodes(j,_e,_t,St){for(var Tt=0,Ut=0,_r=new Array(_t),_n=0,_i=1,Ei=_e.length;_n<Ei;_n++,_i<<=1){var Ci=_e[_n];void 0!==Ci&&_n!==St&&(Tt|=_i,_r[Ut++]=Ci)}return new YI(j,Tt,_r)}(j,Ei,Fi,_n)}else Fi++;var _o=j&&j===this.ownerID,ga=setAt(Ei,_n,Di,_o);return _o?(this.count=Fi,this.nodes=ga,this):new JI(j,Fi,ga)};var XI=function HashCollisionNode(j,_e,_t){this.ownerID=j,this.keyHash=_e,this.entries=_t};XI.prototype.get=function get(j,_e,_t,St){for(var Tt=this.entries,Ut=0,_r=Tt.length;Ut<_r;Ut++)if(is(_t,Tt[Ut][0]))return Tt[Ut][1];return St},XI.prototype.update=function update(j,_e,_t,St,Tt,Ut,_r){void 0===_t&&(_t=hash(St));var _n=Tt===YS;if(_t!==this.keyHash)return _n?this:(SetRef(_r),SetRef(Ut),mergeIntoNode(this,j,_e,_t,[St,Tt]));for(var _i=this.entries,Ei=0,Ci=_i.length;Ei<Ci&&!is(St,_i[Ei][0]);Ei++);var Di=Ei<Ci;if(Di?_i[Ei][1]===Tt:_n)return this;if(SetRef(_r),(_n||!Di)&&SetRef(Ut),_n&&2===Ci)return new ZI(j,this.keyHash,_i[1^Ei]);var Fi=j&&j===this.ownerID,_o=Fi?_i:arrCopy(_i);return Di?_n?Ei===Ci-1?_o.pop():_o[Ei]=_o.pop():_o[Ei]=[St,Tt]:_o.push([St,Tt]),Fi?(this.entries=_o,this):new XI(j,this.keyHash,_o)};var ZI=function ValueNode(j,_e,_t){this.ownerID=j,this.keyHash=_e,this.entry=_t};ZI.prototype.get=function get(j,_e,_t,St){return is(_t,this.entry[0])?this.entry[1]:St},ZI.prototype.update=function update(j,_e,_t,St,Tt,Ut,_r){var _n=Tt===YS,_i=is(St,this.entry[0]);return(_i?Tt===this.entry[1]:_n)?this:(SetRef(_r),_n?void SetRef(Ut):_i?j&&j===this.ownerID?(this.entry[1]=Tt,this):new ZI(j,this.keyHash,[St,Tt]):(SetRef(Ut),mergeIntoNode(this,j,_e,hash(St),[St,Tt])))},zI.prototype.iterate=XI.prototype.iterate=function(j,_e){for(var _t=this.entries,St=0,Tt=_t.length-1;St<=Tt;St++)if(!1===j(_t[_e?Tt-St:St]))return!1},YI.prototype.iterate=JI.prototype.iterate=function(j,_e){for(var _t=this.nodes,St=0,Tt=_t.length-1;St<=Tt;St++){var Ut=_t[_e?Tt-St:St];if(Ut&&!1===Ut.iterate(j,_e))return!1}},ZI.prototype.iterate=function(j,_e){return j(this.entry)};var $I,eT=function(j){function MapIterator(j,_e,_t){this._type=_e,this._reverse=_t,this._stack=j._root&&mapIteratorFrame(j._root)}return j&&(MapIterator.__proto__=j),MapIterator.prototype=Object.create(j&&j.prototype),MapIterator.prototype.constructor=MapIterator,MapIterator.prototype.next=function next(){for(var j=this._type,_e=this._stack;_e;){var _t=_e.node,St=_e.index++,Tt=void 0;if(_t.entry){if(0===St)return mapIteratorValue(j,_t.entry)}else if(_t.entries){if(St<=(Tt=_t.entries.length-1))return mapIteratorValue(j,_t.entries[this._reverse?Tt-St:St])}else if(St<=(Tt=_t.nodes.length-1)){var Ut=_t.nodes[this._reverse?Tt-St:St];if(Ut){if(Ut.entry)return mapIteratorValue(j,Ut.entry);_e=this._stack=mapIteratorFrame(Ut,_e)}continue}_e=this._stack=this._stack.__prev}return{value:void 0,done:!0}},MapIterator}(lI);function mapIteratorValue(j,_e){return iteratorValue(j,_e[0],_e[1])}function mapIteratorFrame(j,_e){return{node:j,index:0,__prev:_e}}function makeMap(j,_e,_t,St){var Tt=Object.create(HI);return Tt.size=j,Tt._root=_e,Tt.__ownerID=_t,Tt.__hash=St,Tt.__altered=!1,Tt}function emptyMap(){return $I||($I=makeMap(0))}function updateMap(j,_e,_t){var St,Tt;if(j._root){var Ut={value:!1},_r={value:!1};if(St=updateNode(j._root,j.__ownerID,0,void 0,_e,_t,Ut,_r),!_r.value)return j;Tt=j.size+(Ut.value?_t===YS?-1:1:0)}else{if(_t===YS)return j;Tt=1,St=new zI(j.__ownerID,[[_e,_t]])}return j.__ownerID?(j.size=Tt,j._root=St,j.__hash=void 0,j.__altered=!0,j):St?makeMap(Tt,St):emptyMap()}function updateNode(j,_e,_t,St,Tt,Ut,_r,_n){return j?j.update(_e,_t,St,Tt,Ut,_r,_n):Ut===YS?j:(SetRef(_n),SetRef(_r),new ZI(_e,St,[Tt,Ut]))}function isLeafNode(j){return j.constructor===ZI||j.constructor===XI}function mergeIntoNode(j,_e,_t,St,Tt){if(j.keyHash===St)return new XI(_e,St,[j.entry,Tt]);var Ut,_r=(0===_t?j.keyHash:j.keyHash>>>_t)&zS,_n=(0===_t?St:St>>>_t)&zS,_i=_r===_n?[mergeIntoNode(j,_e,_t+5,St,Tt)]:(Ut=new ZI(_e,St,Tt),_r<_n?[j,Ut]:[Ut,j]);return new YI(_e,1<<_r|1<<_n,_i)}function popCount(j){return j=(j=(858993459&(j-=j>>1&1431655765))+(j>>2&858993459))+(j>>4)&252645135,j+=j>>8,127&(j+=j>>16)}function setAt(j,_e,_t,St){var Tt=St?j:arrCopy(j);return Tt[_e]=_t,Tt}var tT=8,rT=16,nT=8,iT="@@__IMMUTABLE_LIST__@@";function isList(j){return Boolean(j&&j[iT])}var oT=function(j){function List(_e){var _t=emptyList();if(null==_e)return _t;if(isList(_e))return _e;var St=j(_e),Tt=St.size;return 0===Tt?_t:(assertNotInfinite(Tt),Tt>0&&Tt<HS?makeList(0,Tt,5,null,new sT(St.toArray())):_t.withMutations((function(j){j.setSize(Tt),St.forEach((function(_e,_t){return j.set(_t,_e)}))})))}return j&&(List.__proto__=j),List.prototype=Object.create(j&&j.prototype),List.prototype.constructor=List,List.of=function of(){return this(arguments)},List.prototype.toString=function toString(){return this.__toString("List [","]")},List.prototype.get=function get(j,_e){if((j=wrapIndex(this,j))>=0&&j<this.size){var _t=listNodeFor(this,j+=this._origin);return _t&&_t.array[j&zS]}return _e},List.prototype.set=function set(j,_e){return function updateList(j,_e,_t){if(_e=wrapIndex(j,_e),_e!=_e)return j;if(_e>=j.size||_e<0)return j.withMutations((function(j){_e<0?setListBounds(j,_e).set(0,_t):setListBounds(j,0,_e+1).set(_e,_t)}));_e+=j._origin;var St=j._tail,Tt=j._root,Ut={value:!1};_e>=getTailOffset(j._capacity)?St=updateVNode(St,j.__ownerID,0,_e,_t,Ut):Tt=updateVNode(Tt,j.__ownerID,j._level,_e,_t,Ut);if(!Ut.value)return j;if(j.__ownerID)return j._root=Tt,j._tail=St,j.__hash=void 0,j.__altered=!0,j;return makeList(j._origin,j._capacity,j._level,Tt,St)}(this,j,_e)},List.prototype.remove=function remove(j){return this.has(j)?0===j?this.shift():j===this.size-1?this.pop():this.splice(j,1):this},List.prototype.insert=function insert(j,_e){return this.splice(j,0,_e)},List.prototype.clear=function clear(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):emptyList()},List.prototype.push=function push(){var j=arguments,_e=this.size;return this.withMutations((function(_t){setListBounds(_t,0,_e+j.length);for(var St=0;St<j.length;St++)_t.set(_e+St,j[St])}))},List.prototype.pop=function pop(){return setListBounds(this,0,-1)},List.prototype.unshift=function unshift(){var j=arguments;return this.withMutations((function(_e){setListBounds(_e,-j.length);for(var _t=0;_t<j.length;_t++)_e.set(_t,j[_t])}))},List.prototype.shift=function shift(){return setListBounds(this,1)},List.prototype.concat=function concat(){for(var _e=arguments,_t=[],St=0;St<arguments.length;St++){var Tt=_e[St],Ut=j("string"!=typeof Tt&&hasIterator(Tt)?Tt:[Tt]);0!==Ut.size&&_t.push(Ut)}return 0===_t.length?this:0!==this.size||this.__ownerID||1!==_t.length?this.withMutations((function(j){_t.forEach((function(_e){return _e.forEach((function(_e){return j.push(_e)}))}))})):this.constructor(_t[0])},List.prototype.setSize=function setSize(j){return setListBounds(this,0,j)},List.prototype.map=function map(j,_e){var _t=this;return this.withMutations((function(St){for(var Tt=0;Tt<_t.size;Tt++)St.set(Tt,j.call(_e,St.get(Tt),Tt,_t))}))},List.prototype.slice=function slice(j,_e){var _t=this.size;return wholeSlice(j,_e,_t)?this:setListBounds(this,resolveBegin(j,_t),resolveEnd(_e,_t))},List.prototype.__iterator=function __iterator(j,_e){var _t=_e?this.size:0,St=iterateList(this,_e);return new lI((function(){var Tt=St();return Tt===uT?{value:void 0,done:!0}:iteratorValue(j,_e?--_t:_t++,Tt)}))},List.prototype.__iterate=function __iterate(j,_e){for(var _t,St=_e?this.size:0,Tt=iterateList(this,_e);(_t=Tt())!==uT&&!1!==j(_t,_e?--St:St++,this););return St},List.prototype.__ensureOwner=function __ensureOwner(j){return j===this.__ownerID?this:j?makeList(this._origin,this._capacity,this._level,this._root,this._tail,j,this.__hash):0===this.size?emptyList():(this.__ownerID=j,this.__altered=!1,this)},List}(tI);oT.isList=isList;var aT=oT.prototype;aT[iT]=!0,aT[WS]=aT.remove,aT.merge=aT.concat,aT.setIn=setIn,aT.deleteIn=aT.removeIn=deleteIn,aT.update=update,aT.updateIn=updateIn,aT.mergeIn=mergeIn,aT.mergeDeepIn=mergeDeepIn,aT.withMutations=withMutations,aT.wasAltered=wasAltered,aT.asImmutable=asImmutable,aT["@@transducer/init"]=aT.asMutable=asMutable,aT["@@transducer/step"]=function(j,_e){return j.push(_e)},aT["@@transducer/result"]=function(j){return j.asImmutable()};var sT=function VNode(j,_e){this.array=j,this.ownerID=_e};sT.prototype.removeBefore=function removeBefore(j,_e,_t){if(_t===_e?1<<_e:0===this.array.length)return this;var St=_t>>>_e&zS;if(St>=this.array.length)return new sT([],j);var Tt,Ut=0===St;if(_e>0){var _r=this.array[St];if((Tt=_r&&_r.removeBefore(j,_e-5,_t))===_r&&Ut)return this}if(Ut&&!Tt)return this;var _n=editableVNode(this,j);if(!Ut)for(var _i=0;_i<St;_i++)_n.array[_i]=void 0;return Tt&&(_n.array[St]=Tt),_n},sT.prototype.removeAfter=function removeAfter(j,_e,_t){if(_t===(_e?1<<_e:0)||0===this.array.length)return this;var St,Tt=_t-1>>>_e&zS;if(Tt>=this.array.length)return this;if(_e>0){var Ut=this.array[Tt];if((St=Ut&&Ut.removeAfter(j,_e-5,_t))===Ut&&Tt===this.array.length-1)return this}var _r=editableVNode(this,j);return _r.array.splice(Tt+1),St&&(_r.array[Tt]=St),_r};var cT,uT={};function iterateList(j,_e){var _t=j._origin,St=j._capacity,Tt=getTailOffset(St),Ut=j._tail;return iterateNodeOrLeaf(j._root,j._level,0);function iterateNodeOrLeaf(j,_r,_n){return 0===_r?function iterateLeaf(j,_r){var _n=_r===Tt?Ut&&Ut.array:j&&j.array,_i=_r>_t?0:_t-_r,Ei=St-_r;Ei>HS&&(Ei=HS);return function(){if(_i===Ei)return uT;var j=_e?--Ei:_i++;return _n&&_n[j]}}(j,_n):function iterateNode(j,Tt,Ut){var _r,_n=j&&j.array,_i=Ut>_t?0:_t-Ut>>Tt,Ei=1+(St-Ut>>Tt);Ei>HS&&(Ei=HS);return function(){for(;;){if(_r){var j=_r();if(j!==uT)return j;_r=null}if(_i===Ei)return uT;var _t=_e?--Ei:_i++;_r=iterateNodeOrLeaf(_n&&_n[_t],Tt-5,Ut+(_t<<Tt))}}}(j,_r,_n)}}function makeList(j,_e,_t,St,Tt,Ut,_r){var _n=Object.create(aT);return _n.size=_e-j,_n._origin=j,_n._capacity=_e,_n._level=_t,_n._root=St,_n._tail=Tt,_n.__ownerID=Ut,_n.__hash=_r,_n.__altered=!1,_n}function emptyList(){return cT||(cT=makeList(0,0,5))}function updateVNode(j,_e,_t,St,Tt,Ut){var _r,_n=St>>>_t&zS,_i=j&&_n<j.array.length;if(!_i&&void 0===Tt)return j;if(_t>0){var Ei=j&&j.array[_n],Ci=updateVNode(Ei,_e,_t-5,St,Tt,Ut);return Ci===Ei?j:((_r=editableVNode(j,_e)).array[_n]=Ci,_r)}return _i&&j.array[_n]===Tt?j:(Ut&&SetRef(Ut),_r=editableVNode(j,_e),void 0===Tt&&_n===_r.array.length-1?_r.array.pop():_r.array[_n]=Tt,_r)}function editableVNode(j,_e){return _e&&j&&_e===j.ownerID?j:new sT(j?j.array.slice():[],_e)}function listNodeFor(j,_e){if(_e>=getTailOffset(j._capacity))return j._tail;if(_e<1<<j._level+5){for(var _t=j._root,St=j._level;_t&&St>0;)_t=_t.array[_e>>>St&zS],St-=5;return _t}}function setListBounds(j,_e,_t){void 0!==_e&&(_e|=0),void 0!==_t&&(_t|=0);var St=j.__ownerID||new OwnerID,Tt=j._origin,Ut=j._capacity,_r=Tt+_e,_n=void 0===_t?Ut:_t<0?Ut+_t:Tt+_t;if(_r===Tt&&_n===Ut)return j;if(_r>=_n)return j.clear();for(var _i=j._level,Ei=j._root,Ci=0;_r+Ci<0;)Ei=new sT(Ei&&Ei.array.length?[void 0,Ei]:[],St),Ci+=1<<(_i+=5);Ci&&(_r+=Ci,Tt+=Ci,_n+=Ci,Ut+=Ci);for(var Di=getTailOffset(Ut),Fi=getTailOffset(_n);Fi>=1<<_i+5;)Ei=new sT(Ei&&Ei.array.length?[Ei]:[],St),_i+=5;var _o=j._tail,ga=Fi<Di?listNodeFor(j,_n-1):Fi>Di?new sT([],St):_o;if(_o&&Fi>Di&&_r<Ut&&_o.array.length){for(var _a=Ei=editableVNode(Ei,St),_s=_i;_s>5;_s-=5){var _c=Di>>>_s&zS;_a=_a.array[_c]=editableVNode(_a.array[_c],St)}_a.array[Di>>>5&zS]=_o}if(_n<Ut&&(ga=ga&&ga.removeAfter(St,0,_n)),_r>=Fi)_r-=Fi,_n-=Fi,_i=5,Ei=null,ga=ga&&ga.removeBefore(St,0,_r);else if(_r>Tt||Fi<Di){for(Ci=0;Ei;){var kc=_r>>>_i&zS;if(kc!==Fi>>>_i&zS)break;kc&&(Ci+=(1<<_i)*kc),_i-=5,Ei=Ei.array[kc]}Ei&&_r>Tt&&(Ei=Ei.removeBefore(St,_i,_r-Ci)),Ei&&Fi<Di&&(Ei=Ei.removeAfter(St,_i,Fi-Ci)),Ci&&(_r-=Ci,_n-=Ci)}return j.__ownerID?(j.size=_n-_r,j._origin=_r,j._capacity=_n,j._level=_i,j._root=Ei,j._tail=ga,j.__hash=void 0,j.__altered=!0,j):makeList(_r,_n,_i,Ei,ga)}function getTailOffset(j){return j<HS?0:j-1>>>5<<5}var lT,dT=function(j){function OrderedMap(j){return null==j?emptyOrderedMap():isOrderedMap(j)?j:emptyOrderedMap().withMutations((function(_e){var _t=eI(j);assertNotInfinite(_t.size),_t.forEach((function(j,_t){return _e.set(_t,j)}))}))}return j&&(OrderedMap.__proto__=j),OrderedMap.prototype=Object.create(j&&j.prototype),OrderedMap.prototype.constructor=OrderedMap,OrderedMap.of=function of(){return this(arguments)},OrderedMap.prototype.toString=function toString(){return this.__toString("OrderedMap {","}")},OrderedMap.prototype.get=function get(j,_e){var _t=this._map.get(j);return void 0!==_t?this._list.get(_t)[1]:_e},OrderedMap.prototype.clear=function clear(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):emptyOrderedMap()},OrderedMap.prototype.set=function set(j,_e){return updateOrderedMap(this,j,_e)},OrderedMap.prototype.remove=function remove(j){return updateOrderedMap(this,j,YS)},OrderedMap.prototype.__iterate=function __iterate(j,_e){var _t=this;return this._list.__iterate((function(_e){return _e&&j(_e[1],_e[0],_t)}),_e)},OrderedMap.prototype.__iterator=function __iterator(j,_e){return this._list.fromEntrySeq().__iterator(j,_e)},OrderedMap.prototype.__ensureOwner=function __ensureOwner(j){if(j===this.__ownerID)return this;var _e=this._map.__ensureOwner(j),_t=this._list.__ensureOwner(j);return j?makeOrderedMap(_e,_t,j,this.__hash):0===this.size?emptyOrderedMap():(this.__ownerID=j,this.__altered=!1,this._map=_e,this._list=_t,this)},OrderedMap}(WI);function makeOrderedMap(j,_e,_t,St){var Tt=Object.create(dT.prototype);return Tt.size=j?j.size:0,Tt._map=j,Tt._list=_e,Tt.__ownerID=_t,Tt.__hash=St,Tt.__altered=!1,Tt}function emptyOrderedMap(){return lT||(lT=makeOrderedMap(emptyMap(),emptyList()))}function updateOrderedMap(j,_e,_t){var St,Tt,Ut=j._map,_r=j._list,_n=Ut.get(_e),_i=void 0!==_n;if(_t===YS){if(!_i)return j;_r.size>=HS&&_r.size>=2*Ut.size?(St=(Tt=_r.filter((function(j,_e){return void 0!==j&&_n!==_e}))).toKeyedSeq().map((function(j){return j[0]})).flip().toMap(),j.__ownerID&&(St.__ownerID=Tt.__ownerID=j.__ownerID)):(St=Ut.remove(_e),Tt=_n===_r.size-1?_r.pop():_r.set(_n,void 0))}else if(_i){if(_t===_r.get(_n)[1])return j;St=Ut,Tt=_r.set(_n,[_e,_t])}else St=Ut.set(_e,_r.size),Tt=_r.set(_r.size,[_e,_t]);return j.__ownerID?(j.size=St.size,j._map=St,j._list=Tt,j.__hash=void 0,j.__altered=!0,j):makeOrderedMap(St,Tt)}dT.isOrderedMap=isOrderedMap,dT.prototype[oI]=!0,dT.prototype[WS]=dT.prototype.remove;var hT="@@__IMMUTABLE_STACK__@@";function isStack(j){return Boolean(j&&j[hT])}var fT=function(j){function Stack(j){return null==j?emptyStack():isStack(j)?j:emptyStack().pushAll(j)}return j&&(Stack.__proto__=j),Stack.prototype=Object.create(j&&j.prototype),Stack.prototype.constructor=Stack,Stack.of=function of(){return this(arguments)},Stack.prototype.toString=function toString(){return this.__toString("Stack [","]")},Stack.prototype.get=function get(j,_e){var _t=this._head;for(j=wrapIndex(this,j);_t&&j--;)_t=_t.next;return _t?_t.value:_e},Stack.prototype.peek=function peek(){return this._head&&this._head.value},Stack.prototype.push=function push(){var j=arguments;if(0===arguments.length)return this;for(var _e=this.size+arguments.length,_t=this._head,St=arguments.length-1;St>=0;St--)_t={value:j[St],next:_t};return this.__ownerID?(this.size=_e,this._head=_t,this.__hash=void 0,this.__altered=!0,this):makeStack(_e,_t)},Stack.prototype.pushAll=function pushAll(_e){if(0===(_e=j(_e)).size)return this;if(0===this.size&&isStack(_e))return _e;assertNotInfinite(_e.size);var _t=this.size,St=this._head;return _e.__iterate((function(j){_t++,St={value:j,next:St}}),!0),this.__ownerID?(this.size=_t,this._head=St,this.__hash=void 0,this.__altered=!0,this):makeStack(_t,St)},Stack.prototype.pop=function pop(){return this.slice(1)},Stack.prototype.clear=function clear(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):emptyStack()},Stack.prototype.slice=function slice(_e,_t){if(wholeSlice(_e,_t,this.size))return this;var St=resolveBegin(_e,this.size);if(resolveEnd(_t,this.size)!==this.size)return j.prototype.slice.call(this,_e,_t);for(var Tt=this.size-St,Ut=this._head;St--;)Ut=Ut.next;return this.__ownerID?(this.size=Tt,this._head=Ut,this.__hash=void 0,this.__altered=!0,this):makeStack(Tt,Ut)},Stack.prototype.__ensureOwner=function __ensureOwner(j){return j===this.__ownerID?this:j?makeStack(this.size,this._head,j,this.__hash):0===this.size?emptyStack():(this.__ownerID=j,this.__altered=!1,this)},Stack.prototype.__iterate=function __iterate(j,_e){var _t=this;if(_e)return new AI(this.toArray()).__iterate((function(_e,St){return j(_e,St,_t)}),_e);for(var St=0,Tt=this._head;Tt&&!1!==j(Tt.value,St++,this);)Tt=Tt.next;return St},Stack.prototype.__iterator=function __iterator(j,_e){if(_e)return new AI(this.toArray()).__iterator(j,_e);var _t=0,St=this._head;return new lI((function(){if(St){var _e=St.value;return St=St.next,iteratorValue(j,_t++,_e)}return{value:void 0,done:!0}}))},Stack}(tI);fT.isStack=isStack;var gT,vT=fT.prototype;function makeStack(j,_e,_t,St){var Tt=Object.create(vT);return Tt.size=j,Tt._head=_e,Tt.__ownerID=_t,Tt.__hash=St,Tt.__altered=!1,Tt}function emptyStack(){return gT||(gT=makeStack(0))}vT[hT]=!0,vT.shift=vT.pop,vT.unshift=vT.push,vT.unshiftAll=vT.pushAll,vT.withMutations=withMutations,vT.wasAltered=wasAltered,vT.asImmutable=asImmutable,vT["@@transducer/init"]=vT.asMutable=asMutable,vT["@@transducer/step"]=function(j,_e){return j.unshift(_e)},vT["@@transducer/result"]=function(j){return j.asImmutable()};var mT="@@__IMMUTABLE_SET__@@";function isSet(j){return Boolean(j&&j[mT])}function isOrderedSet(j){return isSet(j)&&isOrdered(j)}function deepEqual(j,_e){if(j===_e)return!0;if(!isCollection(_e)||void 0!==j.size&&void 0!==_e.size&&j.size!==_e.size||void 0!==j.__hash&&void 0!==_e.__hash&&j.__hash!==_e.__hash||isKeyed(j)!==isKeyed(_e)||isIndexed(j)!==isIndexed(_e)||isOrdered(j)!==isOrdered(_e))return!1;if(0===j.size&&0===_e.size)return!0;var _t=!isAssociative(j);if(isOrdered(j)){var St=j.entries();return _e.every((function(j,_e){var Tt=St.next().value;return Tt&&is(Tt[1],j)&&(_t||is(Tt[0],_e))}))&&St.next().done}var Tt=!1;if(void 0===j.size)if(void 0===_e.size)"function"==typeof j.cacheResult&&j.cacheResult();else{Tt=!0;var Ut=j;j=_e,_e=Ut}var _r=!0,_n=_e.__iterate((function(_e,St){if(_t?!j.has(_e):Tt?!is(_e,j.get(St,YS)):!is(j.get(St,YS),_e))return _r=!1,!1}));return _r&&j.size===_n}function mixin(j,_e){var keyCopier=function(_t){j.prototype[_t]=_e[_t]};return Object.keys(_e).forEach(keyCopier),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(_e).forEach(keyCopier),j}function toJS(j){if(!j||"object"!=typeof j)return j;if(!isCollection(j)){if(!isDataStructure(j))return j;j=pI(j)}if(isKeyed(j)){var _e={};return j.__iterate((function(j,_t){_e[_t]=toJS(j)})),_e}var _t=[];return j.__iterate((function(j){_t.push(toJS(j))})),_t}var yT=function(j){function Set(_e){return null==_e?emptySet():isSet(_e)&&!isOrdered(_e)?_e:emptySet().withMutations((function(_t){var St=j(_e);assertNotInfinite(St.size),St.forEach((function(j){return _t.add(j)}))}))}return j&&(Set.__proto__=j),Set.prototype=Object.create(j&&j.prototype),Set.prototype.constructor=Set,Set.of=function of(){return this(arguments)},Set.fromKeys=function fromKeys(j){return this(eI(j).keySeq())},Set.intersect=function intersect(j){return(j=$S(j).toArray()).length?_T.intersect.apply(Set(j.pop()),j):emptySet()},Set.union=function union(j){return(j=$S(j).toArray()).length?_T.union.apply(Set(j.pop()),j):emptySet()},Set.prototype.toString=function toString(){return this.__toString("Set {","}")},Set.prototype.has=function has(j){return this._map.has(j)},Set.prototype.add=function add(j){return updateSet(this,this._map.set(j,j))},Set.prototype.remove=function remove(j){return updateSet(this,this._map.remove(j))},Set.prototype.clear=function clear(){return updateSet(this,this._map.clear())},Set.prototype.map=function map(j,_e){var _t=this,St=!1,Tt=updateSet(this,this._map.mapEntries((function(Tt){var Ut=Tt[1],_r=j.call(_e,Ut,Ut,_t);return _r!==Ut&&(St=!0),[_r,_r]}),_e));return St?Tt:this},Set.prototype.union=function union(){for(var _e=[],_t=arguments.length;_t--;)_e[_t]=arguments[_t];return 0===(_e=_e.filter((function(j){return 0!==j.size}))).length?this:0!==this.size||this.__ownerID||1!==_e.length?this.withMutations((function(_t){for(var St=0;St<_e.length;St++)j(_e[St]).forEach((function(j){return _t.add(j)}))})):this.constructor(_e[0])},Set.prototype.intersect=function intersect(){for(var _e=[],_t=arguments.length;_t--;)_e[_t]=arguments[_t];if(0===_e.length)return this;_e=_e.map((function(_e){return j(_e)}));var St=[];return this.forEach((function(j){_e.every((function(_e){return _e.includes(j)}))||St.push(j)})),this.withMutations((function(j){St.forEach((function(_e){j.remove(_e)}))}))},Set.prototype.subtract=function subtract(){for(var _e=[],_t=arguments.length;_t--;)_e[_t]=arguments[_t];if(0===_e.length)return this;_e=_e.map((function(_e){return j(_e)}));var St=[];return this.forEach((function(j){_e.some((function(_e){return _e.includes(j)}))&&St.push(j)})),this.withMutations((function(j){St.forEach((function(_e){j.remove(_e)}))}))},Set.prototype.sort=function sort(j){return CT(sortFactory(this,j))},Set.prototype.sortBy=function sortBy(j,_e){return CT(sortFactory(this,_e,j))},Set.prototype.wasAltered=function wasAltered(){return this._map.wasAltered()},Set.prototype.__iterate=function __iterate(j,_e){var _t=this;return this._map.__iterate((function(_e){return j(_e,_e,_t)}),_e)},Set.prototype.__iterator=function __iterator(j,_e){return this._map.__iterator(j,_e)},Set.prototype.__ensureOwner=function __ensureOwner(j){if(j===this.__ownerID)return this;var _e=this._map.__ensureOwner(j);return j?this.__make(_e,j):0===this.size?this.__empty():(this.__ownerID=j,this._map=_e,this)},Set}(rI);yT.isSet=isSet;var AT,_T=yT.prototype;function updateSet(j,_e){return j.__ownerID?(j.size=_e.size,j._map=_e,j):_e===j._map?j:0===_e.size?j.__empty():j.__make(_e)}function makeSet(j,_e){var _t=Object.create(_T);return _t.size=j?j.size:0,_t._map=j,_t.__ownerID=_e,_t}function emptySet(){return AT||(AT=makeSet(emptyMap()))}_T[mT]=!0,_T[WS]=_T.remove,_T.merge=_T.concat=_T.union,_T.withMutations=withMutations,_T.asImmutable=asImmutable,_T["@@transducer/init"]=_T.asMutable=asMutable,_T["@@transducer/step"]=function(j,_e){return j.add(_e)},_T["@@transducer/result"]=function(j){return j.asImmutable()},_T.__empty=emptySet,_T.__make=makeSet;var bT,ET=function(j){function Range(j,_e,_t){if(!(this instanceof Range))return new Range(j,_e,_t);if(invariant(0!==_t,"Cannot step a Range by 0"),j=j||0,void 0===_e&&(_e=1/0),_t=void 0===_t?1:Math.abs(_t),_e<j&&(_t=-_t),this._start=j,this._end=_e,this._step=_t,this.size=Math.max(0,Math.ceil((_e-j)/_t-1)+1),0===this.size){if(bT)return bT;bT=this}}return j&&(Range.__proto__=j),Range.prototype=Object.create(j&&j.prototype),Range.prototype.constructor=Range,Range.prototype.toString=function toString(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},Range.prototype.get=function get(j,_e){return this.has(j)?this._start+wrapIndex(this,j)*this._step:_e},Range.prototype.includes=function includes(j){var _e=(j-this._start)/this._step;return _e>=0&&_e<this.size&&_e===Math.floor(_e)},Range.prototype.slice=function slice(j,_e){return wholeSlice(j,_e,this.size)?this:(j=resolveBegin(j,this.size),(_e=resolveEnd(_e,this.size))<=j?new Range(0,0):new Range(this.get(j,this._end),this.get(_e,this._end),this._step))},Range.prototype.indexOf=function indexOf(j){var _e=j-this._start;if(_e%this._step==0){var _t=_e/this._step;if(_t>=0&&_t<this.size)return _t}return-1},Range.prototype.lastIndexOf=function lastIndexOf(j){return this.indexOf(j)},Range.prototype.__iterate=function __iterate(j,_e){for(var _t=this.size,St=this._step,Tt=_e?this._start+(_t-1)*St:this._start,Ut=0;Ut!==_t&&!1!==j(Tt,_e?_t-++Ut:Ut++,this);)Tt+=_e?-St:St;return Ut},Range.prototype.__iterator=function __iterator(j,_e){var _t=this.size,St=this._step,Tt=_e?this._start+(_t-1)*St:this._start,Ut=0;return new lI((function(){if(Ut===_t)return{value:void 0,done:!0};var _r=Tt;return Tt+=_e?-St:St,iteratorValue(j,_e?_t-++Ut:Ut++,_r)}))},Range.prototype.equals=function equals(j){return j instanceof Range?this._start===j._start&&this._end===j._end&&this._step===j._step:deepEqual(this,j)},Range}(vI);function getIn$1(j,_e,_t){for(var St=coerceKeyPath(_e),Tt=0;Tt!==St.length;)if((j=immutable_es_get(j,St[Tt++],YS))===YS)return _t;return j}function getIn(j,_e){return getIn$1(this,j,_e)}function hasIn$1(j,_e){return getIn$1(j,_e,YS)!==YS}function toObject(){assertNotInfinite(this.size);var j={};return this.__iterate((function(_e,_t){j[_t]=_e})),j}$S.isIterable=isCollection,$S.isKeyed=isKeyed,$S.isIndexed=isIndexed,$S.isAssociative=isAssociative,$S.isOrdered=isOrdered,$S.Iterator=lI,mixin($S,{toArray:function toArray(){assertNotInfinite(this.size);var j=new Array(this.size||0),_e=isKeyed(this),_t=0;return this.__iterate((function(St,Tt){j[_t++]=_e?[Tt,St]:St})),j},toIndexedSeq:function toIndexedSeq(){return new VI(this)},toJS:function toJS$1(){return toJS(this)},toKeyedSeq:function toKeyedSeq(){return new GI(this,!0)},toMap:function toMap(){return WI(this.toKeyedSeq())},toObject,toOrderedMap:function toOrderedMap(){return dT(this.toKeyedSeq())},toOrderedSet:function toOrderedSet(){return CT(isKeyed(this)?this.valueSeq():this)},toSet:function toSet(){return yT(isKeyed(this)?this.valueSeq():this)},toSetSeq:function toSetSeq(){return new qI(this)},toSeq:function toSeq(){return isIndexed(this)?this.toIndexedSeq():isKeyed(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function toStack(){return fT(isKeyed(this)?this.valueSeq():this)},toList:function toList(){return oT(isKeyed(this)?this.valueSeq():this)},toString:function toString(){return"[Collection]"},__toString:function __toString(j,_e){return 0===this.size?j+_e:j+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+_e},concat:function concat(){for(var j=[],_e=arguments.length;_e--;)j[_e]=arguments[_e];return reify(this,concatFactory(this,j))},includes:function includes(j){return this.some((function(_e){return is(_e,j)}))},entries:function entries(){return this.__iterator(2)},every:function every(j,_e){assertNotInfinite(this.size);var _t=!0;return this.__iterate((function(St,Tt,Ut){if(!j.call(_e,St,Tt,Ut))return _t=!1,!1})),_t},filter:function filter(j,_e){return reify(this,filterFactory(this,j,_e,!0))},find:function find(j,_e,_t){var St=this.findEntry(j,_e);return St?St[1]:_t},forEach:function forEach(j,_e){return assertNotInfinite(this.size),this.__iterate(_e?j.bind(_e):j)},join:function join(j){assertNotInfinite(this.size),j=void 0!==j?""+j:",";var _e="",_t=!0;return this.__iterate((function(St){_t?_t=!1:_e+=j,_e+=null!=St?St.toString():""})),_e},keys:function keys(){return this.__iterator(0)},map:function map(j,_e){return reify(this,mapFactory(this,j,_e))},reduce:function reduce$1(j,_e,_t){return reduce(this,j,_e,_t,arguments.length<2,!1)},reduceRight:function reduceRight(j,_e,_t){return reduce(this,j,_e,_t,arguments.length<2,!0)},reverse:function reverse(){return reify(this,reverseFactory(this,!0))},slice:function slice(j,_e){return reify(this,sliceFactory(this,j,_e,!0))},some:function some(j,_e){return!this.every(not(j),_e)},sort:function sort(j){return reify(this,sortFactory(this,j))},values:function values(){return this.__iterator(1)},butLast:function butLast(){return this.slice(0,-1)},isEmpty:function isEmpty(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function count(j,_e){return ensureSize(j?this.toSeq().filter(j,_e):this)},countBy:function countBy(j,_e){return function countByFactory(j,_e,_t){var St=WI().asMutable();return j.__iterate((function(Tt,Ut){St.update(_e.call(_t,Tt,Ut,j),0,(function(j){return j+1}))})),St.asImmutable()}(this,j,_e)},equals:function equals(j){return deepEqual(this,j)},entrySeq:function entrySeq(){var j=this;if(j._cache)return new AI(j._cache);var _e=j.toSeq().map(entryMapper).toIndexedSeq();return _e.fromEntrySeq=function(){return j.toSeq()},_e},filterNot:function filterNot(j,_e){return this.filter(not(j),_e)},findEntry:function findEntry(j,_e,_t){var St=_t;return this.__iterate((function(_t,Tt,Ut){if(j.call(_e,_t,Tt,Ut))return St=[Tt,_t],!1})),St},findKey:function findKey(j,_e){var _t=this.findEntry(j,_e);return _t&&_t[0]},findLast:function findLast(j,_e,_t){return this.toKeyedSeq().reverse().find(j,_e,_t)},findLastEntry:function findLastEntry(j,_e,_t){return this.toKeyedSeq().reverse().findEntry(j,_e,_t)},findLastKey:function findLastKey(j,_e){return this.toKeyedSeq().reverse().findKey(j,_e)},first:function first(j){return this.find(returnTrue,null,j)},flatMap:function flatMap(j,_e){return reify(this,function flatMapFactory(j,_e,_t){var St=collectionClass(j);return j.toSeq().map((function(Tt,Ut){return St(_e.call(_t,Tt,Ut,j))})).flatten(!0)}(this,j,_e))},flatten:function flatten(j){return reify(this,flattenFactory(this,j,!0))},fromEntrySeq:function fromEntrySeq(){return new QI(this)},get:function get(j,_e){return this.find((function(_e,_t){return is(_t,j)}),void 0,_e)},getIn,groupBy:function groupBy(j,_e){return function groupByFactory(j,_e,_t){var St=isKeyed(j),Tt=(isOrdered(j)?dT():WI()).asMutable();j.__iterate((function(Ut,_r){Tt.update(_e.call(_t,Ut,_r,j),(function(j){return(j=j||[]).push(St?[_r,Ut]:Ut),j}))}));var Ut=collectionClass(j);return Tt.map((function(_e){return reify(j,Ut(_e))})).asImmutable()}(this,j,_e)},has:function has(j){return this.get(j,YS)!==YS},hasIn:function hasIn(j){return hasIn$1(this,j)},isSubset:function isSubset(j){return j="function"==typeof j.includes?j:$S(j),this.every((function(_e){return j.includes(_e)}))},isSuperset:function isSuperset(j){return(j="function"==typeof j.isSubset?j:$S(j)).isSubset(this)},keyOf:function keyOf(j){return this.findKey((function(_e){return is(_e,j)}))},keySeq:function keySeq(){return this.toSeq().map(keyMapper).toIndexedSeq()},last:function last(j){return this.toSeq().reverse().first(j)},lastKeyOf:function lastKeyOf(j){return this.toKeyedSeq().reverse().keyOf(j)},max:function max(j){return maxFactory(this,j)},maxBy:function maxBy(j,_e){return maxFactory(this,_e,j)},min:function min(j){return maxFactory(this,j?neg(j):defaultNegComparator)},minBy:function minBy(j,_e){return maxFactory(this,_e?neg(_e):defaultNegComparator,j)},rest:function rest(){return this.slice(1)},skip:function skip(j){return 0===j?this:this.slice(Math.max(0,j))},skipLast:function skipLast(j){return 0===j?this:this.slice(0,-Math.max(0,j))},skipWhile:function skipWhile(j,_e){return reify(this,skipWhileFactory(this,j,_e,!0))},skipUntil:function skipUntil(j,_e){return this.skipWhile(not(j),_e)},sortBy:function sortBy(j,_e){return reify(this,sortFactory(this,_e,j))},take:function take(j){return this.slice(0,Math.max(0,j))},takeLast:function takeLast(j){return this.slice(-Math.max(0,j))},takeWhile:function takeWhile(j,_e){return reify(this,function takeWhileFactory(j,_e,_t){var St=makeSequence(j);return St.__iterateUncached=function(St,Tt){var Ut=this;if(Tt)return this.cacheResult().__iterate(St,Tt);var _r=0;return j.__iterate((function(j,Tt,_n){return _e.call(_t,j,Tt,_n)&&++_r&&St(j,Tt,Ut)})),_r},St.__iteratorUncached=function(St,Tt){var Ut=this;if(Tt)return this.cacheResult().__iterator(St,Tt);var _r=j.__iterator(2,Tt),_n=!0;return new lI((function(){if(!_n)return{value:void 0,done:!0};var j=_r.next();if(j.done)return j;var Tt=j.value,_i=Tt[0],Ei=Tt[1];return _e.call(_t,Ei,_i,Ut)?2===St?j:iteratorValue(St,_i,Ei,j):(_n=!1,{value:void 0,done:!0})}))},St}(this,j,_e))},takeUntil:function takeUntil(j,_e){return this.takeWhile(not(j),_e)},update:function update(j){return j(this)},valueSeq:function valueSeq(){return this.toIndexedSeq()},hashCode:function hashCode(){return this.__hash||(this.__hash=function hashCollection(j){if(j.size===1/0)return 0;var _e=isOrdered(j),_t=isKeyed(j),St=_e?1:0;return function murmurHashOfSize(j,_e){return _e=II(_e,3432918353),_e=II(_e<<15|_e>>>-15,461845907),_e=II(_e<<13|_e>>>-13,5),_e=(_e+3864292196|0)^j,_e=II(_e^_e>>>16,2246822507),_e=II(_e^_e>>>13,3266489909),_e=smi(_e^_e>>>16),_e}(j.__iterate(_t?_e?function(j,_e){St=31*St+hashMerge(hash(j),hash(_e))|0}:function(j,_e){St=St+hashMerge(hash(j),hash(_e))|0}:_e?function(j){St=31*St+hash(j)|0}:function(j){St=St+hash(j)|0}),St)}(this))}});var wT=$S.prototype;wT[JS]=!0,wT[uI]=wT.values,wT.toJSON=wT.toArray,wT.__toStringMapper=quoteString,wT.inspect=wT.toSource=function(){return this.toString()},wT.chain=wT.flatMap,wT.contains=wT.includes,mixin(eI,{flip:function flip(){return reify(this,flipFactory(this))},mapEntries:function mapEntries(j,_e){var _t=this,St=0;return reify(this,this.toSeq().map((function(Tt,Ut){return j.call(_e,[Ut,Tt],St++,_t)})).fromEntrySeq())},mapKeys:function mapKeys(j,_e){var _t=this;return reify(this,this.toSeq().flip().map((function(St,Tt){return j.call(_e,St,Tt,_t)})).flip())}});var ST=eI.prototype;ST[XS]=!0,ST[uI]=wT.entries,ST.toJSON=toObject,ST.__toStringMapper=function(j,_e){return quoteString(_e)+": "+quoteString(j)},mixin(tI,{toKeyedSeq:function toKeyedSeq(){return new GI(this,!1)},filter:function filter(j,_e){return reify(this,filterFactory(this,j,_e,!1))},findIndex:function findIndex(j,_e){var _t=this.findEntry(j,_e);return _t?_t[0]:-1},indexOf:function indexOf(j){var _e=this.keyOf(j);return void 0===_e?-1:_e},lastIndexOf:function lastIndexOf(j){var _e=this.lastKeyOf(j);return void 0===_e?-1:_e},reverse:function reverse(){return reify(this,reverseFactory(this,!1))},slice:function slice(j,_e){return reify(this,sliceFactory(this,j,_e,!1))},splice:function splice(j,_e){var _t=arguments.length;if(_e=Math.max(_e||0,0),0===_t||2===_t&&!_e)return this;j=resolveBegin(j,j<0?this.count():this.size);var St=this.slice(0,j);return reify(this,1===_t?St:St.concat(arrCopy(arguments,2),this.slice(j+_e)))},findLastIndex:function findLastIndex(j,_e){var _t=this.findLastEntry(j,_e);return _t?_t[0]:-1},first:function first(j){return this.get(0,j)},flatten:function flatten(j){return reify(this,flattenFactory(this,j,!1))},get:function get(j,_e){return(j=wrapIndex(this,j))<0||this.size===1/0||void 0!==this.size&&j>this.size?_e:this.find((function(_e,_t){return _t===j}),void 0,_e)},has:function has(j){return(j=wrapIndex(this,j))>=0&&(void 0!==this.size?this.size===1/0||j<this.size:-1!==this.indexOf(j))},interpose:function interpose(j){return reify(this,function interposeFactory(j,_e){var _t=makeSequence(j);return _t.size=j.size&&2*j.size-1,_t.__iterateUncached=function(_t,St){var Tt=this,Ut=0;return j.__iterate((function(j){return(!Ut||!1!==_t(_e,Ut++,Tt))&&!1!==_t(j,Ut++,Tt)}),St),Ut},_t.__iteratorUncached=function(_t,St){var Tt,Ut=j.__iterator(1,St),_r=0;return new lI((function(){return(!Tt||_r%2)&&(Tt=Ut.next()).done?Tt:_r%2?iteratorValue(_t,_r++,_e):iteratorValue(_t,_r++,Tt.value,Tt)}))},_t}(this,j))},interleave:function interleave(){var j=[this].concat(arrCopy(arguments)),_e=zipWithFactory(this.toSeq(),vI.of,j),_t=_e.flatten(!0);return _e.size&&(_t.size=_e.size*j.length),reify(this,_t)},keySeq:function keySeq(){return ET(0,this.size)},last:function last(j){return this.get(-1,j)},skipWhile:function skipWhile(j,_e){return reify(this,skipWhileFactory(this,j,_e,!1))},zip:function zip(){var j=[this].concat(arrCopy(arguments));return reify(this,zipWithFactory(this,defaultZipper,j))},zipAll:function zipAll(){var j=[this].concat(arrCopy(arguments));return reify(this,zipWithFactory(this,defaultZipper,j,!0))},zipWith:function zipWith(j){var _e=arrCopy(arguments);return _e[0]=this,reify(this,zipWithFactory(this,j,_e))}});var IT=tI.prototype;IT[ZS]=!0,IT[oI]=!0,mixin(rI,{get:function get(j,_e){return this.has(j)?j:_e},includes:function includes(j){return this.has(j)},keySeq:function keySeq(){return this.valueSeq()}});var TT=rI.prototype;function reduce(j,_e,_t,St,Tt,Ut){return assertNotInfinite(j.size),j.__iterate((function(j,Ut,_r){Tt?(Tt=!1,_t=j):_t=_e.call(St,_t,j,Ut,_r)}),Ut),_t}function keyMapper(j,_e){return _e}function entryMapper(j,_e){return[_e,j]}function not(j){return function(){return!j.apply(this,arguments)}}function neg(j){return function(){return-j.apply(this,arguments)}}function defaultZipper(){return arrCopy(arguments)}function defaultNegComparator(j,_e){return j<_e?1:j>_e?-1:0}function hashMerge(j,_e){return j^_e+2654435769+(j<<6)+(j>>2)|0}TT.has=wT.includes,TT.contains=TT.includes,TT.keys=TT.values,mixin(gI,ST),mixin(vI,IT),mixin(mI,TT);var CT=function(j){function OrderedSet(j){return null==j?emptyOrderedSet():isOrderedSet(j)?j:emptyOrderedSet().withMutations((function(_e){var _t=rI(j);assertNotInfinite(_t.size),_t.forEach((function(j){return _e.add(j)}))}))}return j&&(OrderedSet.__proto__=j),OrderedSet.prototype=Object.create(j&&j.prototype),OrderedSet.prototype.constructor=OrderedSet,OrderedSet.of=function of(){return this(arguments)},OrderedSet.fromKeys=function fromKeys(j){return this(eI(j).keySeq())},OrderedSet.prototype.toString=function toString(){return this.__toString("OrderedSet {","}")},OrderedSet}(yT);CT.isOrderedSet=isOrderedSet;var RT,kT=CT.prototype;function makeOrderedSet(j,_e){var _t=Object.create(kT);return _t.size=j?j.size:0,_t._map=j,_t.__ownerID=_e,_t}function emptyOrderedSet(){return RT||(RT=makeOrderedSet(emptyOrderedMap()))}kT[oI]=!0,kT.zip=IT.zip,kT.zipWith=IT.zipWith,kT.zipAll=IT.zipAll,kT.__empty=emptyOrderedSet,kT.__make=makeOrderedSet;var OT=function Record(j,_e){var _t;!function throwOnInvalidDefaultValues(j){if(isRecord(j))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(isImmutable(j))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===j||"object"!=typeof j)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(j);var St=function Record(Ut){var _r=this;if(Ut instanceof St)return Ut;if(!(this instanceof St))return new St(Ut);if(!_t){_t=!0;var _n=Object.keys(j),_i=Tt._indices={};Tt._name=_e,Tt._keys=_n,Tt._defaultValues=j;for(var Ei=0;Ei<_n.length;Ei++){var Ci=_n[Ei];_i[Ci]=Ei,Tt[Ci]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+recordName(this)+' with property "'+Ci+'" since that property name is part of the Record API.'):immutable_es_setProp(Tt,Ci)}}return this.__ownerID=void 0,this._values=oT().withMutations((function(j){j.setSize(_r._keys.length),eI(Ut).forEach((function(_e,_t){j.set(_r._indices[_t],_e===_r._defaultValues[_t]?void 0:_e)}))})),this},Tt=St.prototype=Object.create(DT);return Tt.constructor=St,_e&&(St.displayName=_e),St};OT.prototype.toString=function toString(){for(var j,_e=recordName(this)+" { ",_t=this._keys,St=0,Tt=_t.length;St!==Tt;St++)_e+=(St?", ":"")+(j=_t[St])+": "+quoteString(this.get(j));return _e+" }"},OT.prototype.equals=function equals(j){return this===j||j&&recordSeq(this).equals(recordSeq(j))},OT.prototype.hashCode=function hashCode(){return recordSeq(this).hashCode()},OT.prototype.has=function has(j){return this._indices.hasOwnProperty(j)},OT.prototype.get=function get(j,_e){if(!this.has(j))return _e;var _t=this._indices[j],St=this._values.get(_t);return void 0===St?this._defaultValues[j]:St},OT.prototype.set=function set(j,_e){if(this.has(j)){var _t=this._values.set(this._indices[j],_e===this._defaultValues[j]?void 0:_e);if(_t!==this._values&&!this.__ownerID)return makeRecord(this,_t)}return this},OT.prototype.remove=function remove(j){return this.set(j)},OT.prototype.clear=function clear(){var j=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:makeRecord(this,j)},OT.prototype.wasAltered=function wasAltered(){return this._values.wasAltered()},OT.prototype.toSeq=function toSeq(){return recordSeq(this)},OT.prototype.toJS=function toJS$1(){return toJS(this)},OT.prototype.entries=function entries(){return this.__iterator(2)},OT.prototype.__iterator=function __iterator(j,_e){return recordSeq(this).__iterator(j,_e)},OT.prototype.__iterate=function __iterate(j,_e){return recordSeq(this).__iterate(j,_e)},OT.prototype.__ensureOwner=function __ensureOwner(j){if(j===this.__ownerID)return this;var _e=this._values.__ensureOwner(j);return j?makeRecord(this,_e,j):(this.__ownerID=j,this._values=_e,this)},OT.isRecord=isRecord,OT.getDescriptiveName=recordName;var DT=OT.prototype;function makeRecord(j,_e,_t){var St=Object.create(Object.getPrototypeOf(j));return St._values=_e,St.__ownerID=_t,St}function recordName(j){return j.constructor.displayName||j.constructor.name||"Record"}function recordSeq(j){return keyedSeqFromValue(j._keys.map((function(_e){return[_e,j.get(_e)]})))}function immutable_es_setProp(j,_e){try{Object.defineProperty(j,_e,{get:function(){return this.get(_e)},set:function(j){invariant(this.__ownerID,"Cannot set on an immutable record."),this.set(_e,j)}})}catch(j){}}DT[iI]=!0,DT[WS]=DT.remove,DT.deleteIn=DT.removeIn=deleteIn,DT.getIn=getIn,DT.hasIn=wT.hasIn,DT.merge=merge$1,DT.mergeWith=mergeWith$1,DT.mergeIn=mergeIn,DT.mergeDeep=mergeDeep,DT.mergeDeepWith=mergeDeepWith,DT.mergeDeepIn=mergeDeepIn,DT.setIn=setIn,DT.update=update,DT.updateIn=updateIn,DT.withMutations=withMutations,DT.asMutable=asMutable,DT.asImmutable=asImmutable,DT[uI]=DT.entries,DT.toJSON=DT.toObject=wT.toObject,DT.inspect=DT.toSource=function(){return this.toString()};var xT,LT=function(j){function Repeat(j,_e){if(!(this instanceof Repeat))return new Repeat(j,_e);if(this._value=j,this.size=void 0===_e?1/0:Math.max(0,_e),0===this.size){if(xT)return xT;xT=this}}return j&&(Repeat.__proto__=j),Repeat.prototype=Object.create(j&&j.prototype),Repeat.prototype.constructor=Repeat,Repeat.prototype.toString=function toString(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Repeat.prototype.get=function get(j,_e){return this.has(j)?this._value:_e},Repeat.prototype.includes=function includes(j){return is(this._value,j)},Repeat.prototype.slice=function slice(j,_e){var _t=this.size;return wholeSlice(j,_e,_t)?this:new Repeat(this._value,resolveEnd(_e,_t)-resolveBegin(j,_t))},Repeat.prototype.reverse=function reverse(){return this},Repeat.prototype.indexOf=function indexOf(j){return is(this._value,j)?0:-1},Repeat.prototype.lastIndexOf=function lastIndexOf(j){return is(this._value,j)?this.size:-1},Repeat.prototype.__iterate=function __iterate(j,_e){for(var _t=this.size,St=0;St!==_t&&!1!==j(this._value,_e?_t-++St:St++,this););return St},Repeat.prototype.__iterator=function __iterator(j,_e){var _t=this,St=this.size,Tt=0;return new lI((function(){return Tt===St?{value:void 0,done:!0}:iteratorValue(j,_e?St-++Tt:Tt++,_t._value)}))},Repeat.prototype.equals=function equals(j){return j instanceof Repeat?is(this._value,j._value):deepEqual(j)},Repeat}(vI);function fromJSWith(j,_e,_t,St,Tt,Ut){if("string"!=typeof _t&&!isImmutable(_t)&&(isArrayLike(_t)||hasIterator(_t)||isPlainObject(_t))){if(~j.indexOf(_t))throw new TypeError("Cannot convert circular structure to Immutable");j.push(_t),Tt&&""!==St&&Tt.push(St);var _r=_e.call(Ut,St,pI(_t).map((function(St,Ut){return fromJSWith(j,_e,St,Ut,Tt,_t)})),Tt&&Tt.slice());return j.pop(),Tt&&Tt.pop(),_r}return _t}function defaultConverter(j,_e){return isIndexed(_e)?_e.toList():isKeyed(_e)?_e.toMap():_e.toSet()}var NT={version:"4.0.0",Collection:$S,Iterable:$S,Seq:pI,Map:WI,OrderedMap:dT,List:oT,Stack:fT,Set:yT,OrderedSet:CT,Record:OT,Range:ET,Repeat:LT,is,fromJS:function fromJS(j,_e){return fromJSWith([],_e||defaultConverter,j,"",_e&&_e.length>2?[]:void 0,{"":j})},hash,isImmutable,isCollection,isKeyed,isIndexed,isAssociative,isOrdered,isValueObject,isPlainObject,isSeq,isList,isMap,isOrderedMap,isStack,isSet,isOrderedSet,isRecord,get:immutable_es_get,getIn:getIn$1,has,hasIn:hasIn$1,merge:function merge(j){for(var _e=[],_t=arguments.length-1;_t-- >0;)_e[_t]=arguments[_t+1];return mergeWithSources(j,_e)},mergeDeep:function mergeDeep$1(j){for(var _e=[],_t=arguments.length-1;_t-- >0;)_e[_t]=arguments[_t+1];return mergeDeepWithSources(j,_e)},mergeWith:function mergeWith(j,_e){for(var _t=[],St=arguments.length-2;St-- >0;)_t[St]=arguments[St+2];return mergeWithSources(_e,_t,j)},mergeDeepWith:function mergeDeepWith$1(j,_e){for(var _t=[],St=arguments.length-2;St-- >0;)_t[St]=arguments[St+2];return mergeDeepWithSources(_e,_t,j)},remove,removeIn,set,setIn:setIn$1,update:update$1,updateIn:updateIn$1};const PT=NT;function struct_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function struct_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?struct_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):struct_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}var MT,BT,jT,UT,GT=function(){function AgoraRteSyncSnapshotData(j){var _e=this;_classCallCheck(this,AgoraRteSyncSnapshotData),this.sequence=void 0,this.users=new Map,this.streams=new Map,this.roomProperties=PT.Map(),this.room=void 0,this.roomState=void 0;var _t=j.seq,St=j.users,Tt=j.roomProperties,Ut=j.roomInfo,_r=j.roomState;this.sequence=_t,St.forEach((function(j){var _t=VT.fromData(j),St=j.streams;(void 0===St?[]:St).forEach((function(j){_e.streams.set(j.streamUuid,qT.fromData(struct_objectSpread(struct_objectSpread({},j),{},{fromUser:{userName:_t.userName,role:_t.userRole,userUuid:_t.userUuid}})))})),_e.users.set(j.userUuid,_t)})),this.roomProperties=PT.Map(Tt),this.room=QT.fromData(Ut),this.roomState=KT.fromData(_r)}return _createClass(AgoraRteSyncSnapshotData,null,[{key:"fromData",value:function fromData(j){return new AgoraRteSyncSnapshotData(j)}}]),AgoraRteSyncSnapshotData}(),VT=function(){function AgoraUser(j){_classCallCheck(this,AgoraUser),this.userUuid=void 0,this.userName=void 0,this.userRole=void 0,this.userProperties=void 0,this.userName=j.userName,this.userRole=j.role,this.userUuid=j.userUuid,this.userProperties=PT.Map(j.userProperties)}return _createClass(AgoraUser,[{key:"setUserProperties",value:function setUserProperties(j){this.userProperties=PT.Map(j)}},{key:"toString",value:function toString(){return this.userUuid}}],[{key:"fromData",value:function fromData(j){return new AgoraUser(j)}}]),AgoraUser}(),qT=function(){function AgoraStream(j){_classCallCheck(this,AgoraStream),this.streamUuid=void 0,this.streamName=void 0,this.fromUser=void 0,this.videoSourceType=void 0,this.audioSourceType=void 0,this.videoState=void 0,this.audioState=void 0,this.videoSourceState=void 0,this.audioSourceState=void 0,this.playUrl=void 0,this.flvPlayUrl=void 0,this.rtmpPlayUrl=void 0,this.previous=void 0,this.streamUuid=j.streamUuid,this.streamName=j.streamName,this.fromUser=j.fromUser,this.videoSourceType=j.videoSourceType,this.audioSourceType=j.audioSourceType,this.videoState=j.videoState,this.audioState=j.audioState,this.videoSourceState=j.videoSourceState,this.audioSourceState=j.audioSourceState,this.playUrl=j.playUrl,this.flvPlayUrl=j.flvPlayUrl,this.rtmpPlayUrl=j.rtmpPlayUrl,["streamUuid","fromUser","videoSourceType","audioSourceType","videoState","audioState","videoSourceState","audioSourceState"].forEach((function(_e){void 0===j[_e]&&ME.warn("stream key ".concat(_e," is unexpectedly undefined"))})),this.fromUser||(ME.error("[stream-data-struct] stream must have owner info"),zE.shared.handleThrowableError(QE.RTE_ERR_INVALID_DATA_STRUCT,new Error("invalid stream data")))}return _createClass(AgoraStream,[{key:"toString",value:function toString(){return this.streamUuid}}],[{key:"fromData",value:function fromData(j){return new AgoraStream(j)}}]),AgoraStream}(),QT=function(){function AgoraRoom(j){_classCallCheck(this,AgoraRoom),this.roomName=void 0,this.roomUuid=void 0,this.roomScenario=void 0,this.roomName=j.roomName,this.roomUuid=j.roomUuid,this.roomScenario=j.roomScenario}return _createClass(AgoraRoom,null,[{key:"fromData",value:function fromData(j){return new AgoraRoom(j)}}]),AgoraRoom}(),KT=function(){function AgoraRoomState(j){_classCallCheck(this,AgoraRoomState),this.total=void 0,this.total=j.total}return _createClass(AgoraRoomState,null,[{key:"fromData",value:function fromData(j){return new AgoraRoomState(j)}}]),AgoraRoomState}(),WT=function(){function AgoraChatMessage(j){_classCallCheck(this,AgoraChatMessage),this.fromUser=void 0,this.message=void 0,this.type=void 0,this.sendTime=void 0,this.sensitiveWords=void 0,this.messageId=void 0,this.ext=void 0,this.fromUser=j.fromUser,this.message=j.message,this.type=j.type,this.sendTime=j.sendTime,this.sensitiveWords=j.sensitiveWords,this.messageId=j.messageId||j.peerMessageId,this.ext=j.ext}return _createClass(AgoraChatMessage,[{key:"toString",value:function toString(){return"".concat(this.fromUser.userName,": ").concat(this.message)}}],[{key:"fromData",value:function fromData(j){return new AgoraChatMessage(j)}}]),AgoraChatMessage}(),HT=__webpack_require__(9850),zT=__webpack_require__.n(HT);function handler_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function handler_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?handler_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):handler_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}function handler_createForOfIteratorHelper(j,_e){var _t="undefined"!=typeof Symbol&&j[Symbol.iterator]||j["@@iterator"];if(!_t){if(Array.isArray(j)||(_t=function handler_unsupportedIterableToArray(j,_e){if(!j)return;if("string"==typeof j)return handler_arrayLikeToArray(j,_e);var _t=Object.prototype.toString.call(j).slice(8,-1);"Object"===_t&&j.constructor&&(_t=j.constructor.name);if("Map"===_t||"Set"===_t)return Array.from(j);if("Arguments"===_t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_t))return handler_arrayLikeToArray(j,_e)}(j))||_e&&j&&"number"==typeof j.length){_t&&(j=_t);var St=0,Tt=function F(){};return{s:Tt,n:function n(){return St>=j.length?{done:!0}:{done:!1,value:j[St++]}},e:function e(j){throw j},f:Tt}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Ut,_r=!0,_n=!1;return{s:function s(){_t=_t.call(j)},n:function n(){var j=_t.next();return _r=j.done,j},e:function e(j){_n=!0,Ut=j},f:function f(){try{_r||null==_t.return||_t.return()}finally{if(_n)throw Ut}}}}function handler_arrayLikeToArray(j,_e){(null==_e||_e>j.length)&&(_e=j.length);for(var _t=0,St=new Array(_e);_t<_e;_t++)St[_t]=j[_t];return St}function handler_createSuper(j){var _e=function handler_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j[j.Chat=3]="Chat",j[j.RoomProperty=4]="RoomProperty",j[j.RoomProperties=5]="RoomProperties",j[j.UserInOut=20]="UserInOut",j[j.UserInfo=21]="UserInfo",j[j.UserProperty=22]="UserProperty",j[j.UserProperties=23]="UserProperties",j[j.UserSubscribeInOut=24]="UserSubscribeInOut",j[j.StreamInOut=40]="StreamInOut",j[j.StreamsInOut=41]="StreamsInOut",j[j.MessageExtension=99]="MessageExtension"}(BT||(BT={})),function(j){j[j.PeerChat=1]="PeerChat"}(jT||(jT={})),function(j){j.SnapshotUpdated="snapshot-updated",j.ChatReceived="chat-received",j.UserAdded="user-added",j.UserUpdated="user-updated",j.UserRemoved="user-removed",j.UserCountUpdated="user-count-updated",j.RoomPropertyUpdated="room-property-updated",j.UserPropertyUpdated="user-property-updated",j.LocalStreamAdded="local-stream-added",j.LocalStreamUpdate="local-stream-update",j.LocalStreamRemove="local-stream-removed",j.RemoteStreamAdded="remote-stream-added",j.RemoteStreamUpdate="remote-stream-update",j.RemoteStreamRemove="remote-stream-removed",j.ChatUserMessage="user-chat-message",j.ChatRoomMessage="room-chat-message",j.NetworkStats="network-stats",j.LocalAudioVolume="local-audio-volume",j.AudioVolumes="audio-volumes",j.LocalVideoCameraListChanged="local-video-camera-list-changed",j.LocalAudioRecordingListChanged="local-audio-recording-list-changed",j.LocalAudioPlaybackListChanged="local-audio-playback-list-changed",j.LocalVideoTrackStateChanged="local-video-track-state-changed",j.LocalAudioTrackStateChanged="local-audio-track-state-changed",j.RtcConnectionStateChanged="rtc-connection-state-changed",j.RtmConnectionStateChanged="rtm-connection-state-changed",j.RteConnectionStateChanged="rte-connection-state-changed",j.TimeStampGapUpdate="timestamp-gap-update",j.UserPropertyListUpdated="user-property-list-updated"}(UT||(UT={}));var YT,JT,XT=TS.attach({proxyMethods:!1,label:"channel-message"})(MT=function(j){_inherits(AgoraRteChannelMessageHandle,j);var _e=handler_createSuper(AgoraRteChannelMessageHandle);function AgoraRteChannelMessageHandle(j,_t){var St,Tt=_t.sceneId,Ut=_t.userUuid,_r=_t.streamUuid;return _classCallCheck(this,AgoraRteChannelMessageHandle),(St=_e.call(this)).logger=void 0,St._dataStore=void 0,St._timestampGap=0,St.sceneId=void 0,St.userUuid=void 0,St.streamUuid=void 0,St.sceneId=Tt,St.userUuid=Ut,St.streamUuid=_r,St._dataStore=j,St}return _createClass(AgoraRteChannelMessageHandle,[{key:"handleSnapshot",value:function handleSnapshot(j){this.logger.info("snapshot loaded:",j),this._dataStore.setUsers(j.users),this._dataStore.setStreams(j.streams),this._dataStore.setRoomProperties(j.roomProperties),this._dataStore.setRoomInfo(j.room),this.emit(UT.SnapshotUpdated,j)}},{key:"handleMessage",value:function handleMessage(j){var _e=j.sequence,_t=_e.batch,St=_e.cmd;_t?this._handleBatchMessage(j,St):this._handleSimpleMessage(j,St),this._syncTsGapWithServerAndLocal(j)}},{key:"_handleSimpleMessage",value:function _handleSimpleMessage(j,_e){switch(_e){case BT.Chat:this._handleChat(j);break;case BT.RoomProperty:case BT.RoomProperties:this._handleRoomProperties(j);break;case BT.UserInOut:this._handleUserInOut(j);break;case BT.UserInfo:this._handleUserInfo(j);break;case BT.UserProperty:this._handleUserProperty(j);break;case BT.UserProperties:this._handleUserProperties(j);break;case BT.UserSubscribeInOut:this._handleUserSubscribe(j);break;case BT.StreamInOut:this._handleStreamInOut(j);break;case BT.StreamsInOut:this._handleStreamsInOut(j);break;case BT.MessageExtension:this._handleMessageExtension(j)}}},{key:"_handleBatchMessage",value:function _handleBatchMessage(j,_e){if(_e===BT.UserProperties)this._handleUserPropertyList(j)}},{key:"_handleUserPropertyList",value:function _handleUserPropertyList(j){var _e,_t,St=this,Tt=j.sequence,Ut=Tt.batch,_r=Tt.list,_n=void 0===_r?[]:_r,_i=null===(_e=_n[0])||void 0===_e?void 0:_e.operator,Ei=null===(_t=_n[0])||void 0===_t?void 0:_t.cause,Ci=[];_n.forEach((function(j){var _e=j,_t=_e.changeProperties,Tt=_e.fromUser.userUuid,Ut=St._dataStore.findUser(Tt);if(!Ut)return St.logger.warn("user ".concat(Tt," not exists, update property failed"));Ut.setUserProperties(St._mergeProperties(Ut.userProperties.toJS(),_t)),Ci.push({userUuid:Tt,userProperties:Ut.userProperties.toObject()})}));var Di={id:null==Ut?void 0:Ut.id,total:null==Ut?void 0:Ut.total,index:null==Ut?void 0:Ut.progress};this.emit(UT.UserPropertyListUpdated,Ci,Di,_i,Ei)}},{key:"_handleChat",value:function _handleChat(j){var _e=j.sequence.data,_t=WT.fromData(_e);this._dataStore.addMessage(_t),this.emit(UT.ChatReceived,_t)}},{key:"_mergeProperties",value:function _mergeProperties(j,_e){for(var _t=0,St=Object.keys(_e);_t<St.length;_t++){var Tt=St[_t],Ut=Tt.split(".");if(0!==Ut.length){var _r,_n=Ut.filter((function(j){return j})),_i=j,Ei=handler_createForOfIteratorHelper(_n);try{for(Ei.s();!(_r=Ei.n()).done;){var Ci=_r.value;_i[Ci]=_i[Ci]||{},_i=_i[Ci]}}catch(j){Ei.e(j)}finally{Ei.f()}var Di=1===_n.length?j:XE()(j,_toConsumableArray(_n).splice(0,_n.length-1).join("."),{}),Fi=zT()(_e[Tt]);"deleted"===Fi?delete Di[_toConsumableArray(_n).pop()]:Di[_toConsumableArray(_n).pop()]=Fi}else this.logger.error("invalid key when batch set room properties ".concat(Tt))}return j}},{key:"_handleRoomProperties",value:function _handleRoomProperties(j){var _e=j.sequence.data,_t=_e.changeProperties,St=_e.cause,Tt=_e.operator;this._dataStore.setRoomProperties(this._mergeProperties(this._dataStore.roomProperties.toJS(),_t));var Ut=Array.from(new Set(Object.keys(_t).map((function(j){return j.split(".")[0]}))));this.emit(UT.RoomPropertyUpdated,Ut,this._dataStore.roomProperties,Tt,St)}},{key:"_handleUserSubscribe",value:function _handleUserSubscribe(j){var _e=this,_t=j.sequence.data.users,St=[],Tt=[],Ut=[];_t.forEach((function(j){var _t=VT.fromData(j);if(1===j.subscribe){_e._dataStore.setUser(_t.userUuid,_t);var _r=j.streams;(void 0===_r?[]:_r).forEach((function(j){var St=qT.fromData(handler_objectSpread(handler_objectSpread({},j),{},{fromUser:{userUuid:_t.userUuid,role:_t.userRole,userName:_t.userName}}));_e._dataStore.setStream(St.streamUuid,St)})),St.push(_t)}else if(0===j.subscribe){var _n=_e._dataStore.findUserStreams(j.userUuid),_i=_n.map((function(j){return j.streamUuid}));_e._dataStore.deleteStreams(_i),_e._dataStore.deleteUser(j.userUuid),_n.length&&(Ut=_n),Tt.push(_t)}})),St.length>0&&this.emit(UT.UserAdded,St),Tt.length>0&&this.emit(UT.UserRemoved,Tt,Ut)}},{key:"_handleUserInOut",value:function _handleUserInOut(j){var _e=this,_t=j.sequence.data,St=_t.offlineUsers,Tt=_t.onlineUsers,Ut=_t.total,_r=[],_n=St.map((function(j){var _t=VT.fromData(j),St=_e._dataStore.findUserStreams(j.userUuid),Tt=St.map((function(j){return j.streamUuid}));return _e._dataStore.deleteStreams(Tt),_e._dataStore.deleteUser(j.userUuid),St.length&&(_r=St),_t})),_i=Tt.map((function(j){var _t=VT.fromData(j);_e._dataStore.setUser(_t.userUuid,_t);var St=j.streams;return(void 0===St?[]:St).forEach((function(j){var St=qT.fromData(handler_objectSpread(handler_objectSpread({},j),{},{fromUser:{userUuid:_t.userUuid,role:_t.userRole,userName:_t.userName}}));_e._dataStore.setStream(St.streamUuid,St)})),_t}));if(_i.length>0&&this.emit(UT.UserAdded,_i),_n.length>0){var Ei=St.length?St[0].type:void 0;this.emit(UT.UserRemoved,_n,_r,Ei)}void 0!==Ut&&this.emit(UT.UserCountUpdated,Ut)}},{key:"_handleUserInfo",value:function _handleUserInfo(j){var _e=j.sequence.data,_t=_e.userUuid,St=_e.userName,Tt=_e.role,Ut=this._dataStore.findUser(_t);if(!Ut)return this.logger.warn("user ".concat(_t," not exists, update info failed"));Ut.userName=St,Ut.userRole=Tt,this.emit(UT.UserUpdated,Ut)}},{key:"_handleUserProperty",value:function _handleUserProperty(j){throw"not_implemented"}},{key:"_handleUserProperties",value:function _handleUserProperties(j){var _e=j.sequence.data,_t=_e.changeProperties,St=_e.cause,Tt=_e.fromUser,Ut=_e.operator,_r=Tt.userUuid,_n=this._dataStore.findUser(_r);if(!_n)return this.logger.warn("user ".concat(_r," not exists, update property failed"));_n.setUserProperties(this._mergeProperties(_n.userProperties.toJS(),_t)),this.emit(UT.UserPropertyUpdated,_r,_n.userProperties.toObject(),Ut,St)}},{key:"_processStreamEvent",value:function _processStreamEvent(j,_e){var _t=_e.fromUser.userUuid===this.userUuid;if(3===j){var St=this._dataStore.findStream(_e.streamUuid);return this._dataStore.deleteStream(_e.streamUuid),_e.previous=St,_t?UT.LocalStreamRemove:UT.RemoteStreamRemove}if(2===j){var Tt=this._dataStore.findStream(_e.streamUuid);return this._dataStore.setStream(_e.streamUuid,_e),_e.previous=Tt,_t?UT.LocalStreamUpdate:UT.RemoteStreamUpdate}return _e.previous=void 0,this._dataStore.setStream(_e.streamUuid,_e),_t?UT.LocalStreamAdded:UT.RemoteStreamAdded}},{key:"_handleStreamInOut",value:function _handleStreamInOut(j){var _e=j.sequence.data,_t=_e.action,St=_e.fromUser,Tt=_e.streamUuid,Ut=_e.streamName,_r=_e.videoSourceType,_n=_e.audioSourceType,_i=_e.videoSourceState,Ei=_e.audioSourceState,Ci=_e.videoState,Di=_e.audioState,Fi=_e.operator,_o=_e.playUrl,ga=_e.flvPlayUrl,_a=_e.rtmpPlayUrl,_s=qT.fromData({streamName:Ut,streamUuid:Tt,fromUser:St,videoSourceType:_r,audioSourceType:_n,videoState:Ci,audioState:Di,videoSourceState:_i,audioSourceState:Ei,playUrl:_o,flvPlayUrl:ga,rtmpPlayUrl:_a}),_c=this._processStreamEvent(_t,_s);this.emit(_c,[_s],Fi)}},{key:"_handleStreamsInOut",value:function _handleStreamsInOut(j){var _e=this,_t=j.sequence.data,St=_t.streams,Tt=_t.operator,Ut=(_t.cause,new Map);St.forEach((function(j){var _t=j.action,St=qT.fromData(j),Tt=_e._processStreamEvent(_t,St);Ut.has(Tt)?Ut.set(Tt,Ut.get(Tt).concat([St])):Ut.set(Tt,[St])})),Ut.forEach((function(j,_t){_e.emit(_t,j,Tt)}))}},{key:"_handleMessageExtension",value:function _handleMessageExtension(j){}},{key:"_syncTsGapWithServerAndLocal",value:function _syncTsGapWithServerAndLocal(j){var _e=j.sequence.timestamp-Date.now();this._timestampGap!==_e&&Math.abs(this._timestampGap-_e)>800&&(this._timestampGap=_e,this.emit(UT.TimeStampGapUpdate,this._timestampGap))}}]),AgoraRteChannelMessageHandle}(_a))||MT,ZT=function(){function SequenceMessageParserV1(){_classCallCheck(this,SequenceMessageParserV1)}return _createClass(SequenceMessageParserV1,[{key:"parsePacket",value:function parsePacket(j){var _e=JSON.parse(j);return{total:1,startSequence:_e.sequence,list:[_e]}}}]),SequenceMessageParserV1}(),$T=function(){function SequenceMessageParserV2(){_classCallCheck(this,SequenceMessageParserV2)}return _createClass(SequenceMessageParserV2,[{key:"parsePacket",value:function parsePacket(j){return JSON.parse(j)}}]),SequenceMessageParserV2}();function synchronizer_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */synchronizer_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}var _C,eR=TS.attach({proxyMethods:!1,label:"channel-message"})((JT=function(){function AgoraRteSynchronizer(j,_e){var _t=this,St=_e.scene,Tt=_e.userUuid,Ut=_e.streamUuid,_r=_e.channelObserver,_n=_e.sequenceVersion;_classCallCheck(this,AgoraRteSynchronizer),this.logger=void 0,this._scene=void 0,this._channelObserver=void 0,this._snapshot=void 0,this._queueTasks=[],this._currentTask=void 0,this._lastSeq=-1,this._requestingGap=!1,this._seqMessageParser=void 0,this._handle=void 0,this.runNextTask=function(){if(_t._currentTask)_t.logger.info("task Running");else{var j=_t.dequeueTask();j?(_t._currentTask=j,_t.processTask(_t._currentTask).then((function(){_t._currentTask=void 0,_t.notifyTaskQueueUpdate()})).catch((function(j){_t.logger.error("message handle failed: ".concat(j)),_t._currentTask=void 0,_t.notifyTaskQueueUpdate()}))):_t.logger.info("message handle queue clear")}},this._scene=St,this._channelObserver=_r,this._seqMessageParser=function getMessageParser(j){return j===jS.v1?new ZT:new $T}(_n),this._channelObserver.on("ChannelMessage",this.handleChannelMessage),this._handle=new XT(j,{sceneId:St.sceneId,userUuid:Tt,streamUuid:Ut})}var j,_e;return _createClass(AgoraRteSynchronizer,[{key:"handle",get:function get(){return this._handle}},{key:"handleChannelMessage",value:function handleChannelMessage(j){var _e=j.message,_t=j.memberId;if(this.logger.info("channel message from [".concat(this._scene.sceneId,"]: ").concat(_e.text,", memberId: ").concat(_t)),"server"===_t)try{var St=this._seqMessageParser.parsePacket(_e.text);this.logger.info("add ".concat(St.total," tasks to task queue, start: ").concat(St.startSequence,", total: ").concat(St.total));var Tt=St.list.map((function(j){return{sequence:j}}));this.addTasks(Tt)}catch(j){this.logger.error("".concat(j.message," original: ").concat(_e.text))}}},{key:"syncSnapshot",value:function syncSnapshot(j){this._snapshot=j,this._handle.handleSnapshot(j),this._lastSeq=j.sequence,this.notifyTaskQueueUpdate()}},{key:"findSequenceGap",value:function findSequenceGap(){if(0===this._queueTasks.length)return null;var j=this._queueTasks[0].sequence.sequence;return j-this._lastSeq>1?{seq:this._lastSeq+1,count:j-this._lastSeq-1,queueHeadSeq:j}:null}},{key:"sortTasks",value:function sortTasks(){this._queueTasks=this._queueTasks.sort((function(j,_e){return j.sequence.sequence-_e.sequence.sequence}))}},{key:"addTasks",value:function addTasks(j){var _e;(_e=this._queueTasks).push.apply(_e,_toConsumableArray(j)),this.sortTasks(),this.notifyTaskQueueUpdate()}},{key:"prependTasks",value:function prependTasks(j){this._queueTasks=j.concat(this._queueTasks),this.sortTasks()}},{key:"notifyTaskQueueUpdate",value:function notifyTaskQueueUpdate(){if(this._snapshot){var j=this.findSequenceGap();if(j){var _e=j.seq,_t=j.count,St=j.queueHeadSeq;return this.logger.warn("gap ".concat(this._lastSeq," - ").concat(St," exists, need fill ").concat(_e," ").concat(_t,". stop task processing before gap is resolved")),void this.syncSequenceUntilSuccess(_e,_t)}this.runNextTask()}else this.logger.warn("snapshot not ready yet..wait")}},{key:"dequeueTask",value:function dequeueTask(){return 0===this._queueTasks.length?null:this._queueTasks.shift()}},{key:"processTask",value:(_e=_asyncToGenerator(synchronizer_regeneratorRuntime().mark((function _callee(j){return synchronizer_regeneratorRuntime().wrap((function _callee$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(this._snapshot){_e.next=2;break}return _e.abrupt("return");case 2:if(!(j.sequence.sequence<=this._lastSeq)){_e.next=5;break}return this.logger.info("skip sequence ".concat(j.sequence.sequence,", snapshot ").concat(this._snapshot.sequence)),_e.abrupt("return");case 5:return this.logger.info("process sequence ".concat(j.sequence.sequence,", snapshot ").concat(this._snapshot.sequence,", last ").concat(this._lastSeq)),this._handle.handleMessage(j),this._lastSeq=j.sequence.sequence,_e.next=10,new Promise((function(j){return setTimeout(j,0)}));case 10:case"end":return _e.stop()}}),_callee,this)}))),function processTask(j){return _e.apply(this,arguments)})},{key:"syncSequenceUntilSuccess",value:(j=_asyncToGenerator(synchronizer_regeneratorRuntime().mark((function _callee2(j,_e){var _t,St,Tt,Ut,_r;return synchronizer_regeneratorRuntime().wrap((function _callee2$(_n){for(;;)switch(_n.prev=_n.next){case 0:if(!this._requestingGap){_n.next=2;break}return _n.abrupt("return");case 2:this._requestingGap=!0,_t=!1,this.logger.info("begin resolve gap ".concat(j," - ").concat(_e));case 5:return _n.prev=5,_n.next=8,this._scene.getApiService().syncSequence(this._scene.sceneId,j,_e);case 8:St=_n.sent,Tt=St.list,Ut=Math.min(_e,Tt.length),_r=Tt.slice(0,Ut).map((function(j){return{sequence:j}})),this.prependTasks(_r),_t=!0,this.logger.info("gap resolved, new ".concat(_r.length," tasks prepended ")),this.notifyTaskQueueUpdate(),_n.next=23;break;case 18:return _n.prev=18,_n.t0=_n.catch(5),this.logger.error("syncSequence failed: ".concat(_n.t0)),_n.next=23,new Promise((function(j){return setTimeout(j,3e3)}));case 23:if(!_t){_n.next=5;break}case 24:this._requestingGap=!1;case 25:case"end":return _n.stop()}}),_callee2,this,[[5,18]])}))),function syncSequenceUntilSuccess(_e,_t){return j.apply(this,arguments)})}]),AgoraRteSynchronizer}(),_applyDecoratedDescriptor(JT.prototype,"handleChannelMessage",[RS],Object.getOwnPropertyDescriptor(JT.prototype,"handleChannelMessage"),JT.prototype),YT=JT))||YT,tR=__webpack_require__(2699),rR=__webpack_require__(3136),nR=__webpack_require__.n(rR);function rtm_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */rtm_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function rtm_createSuper(j){var _e=function rtm_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j.DISCONNECTED="DISCONNECTED",j.CONNECTING="CONNECTING",j.CONNECTED="CONNECTED",j.RECONNECTING="RECONNECTING",j.ABORTED="ABORTED"}(_C||(_C={}));var iR=function isTextMessage(j){return void 0!==j.text},oR=function(j){_inherits(AGRtmManager,j);var _e,_t,St,Tt,Ut,_r=rtm_createSuper(AGRtmManager);function AGRtmManager(){var j;return _classCallCheck(this,AGRtmManager),(j=_r.call(this)).connectionState=_C.DISCONNECTED,j.prevConnectionState=_C.DISCONNECTED,j.channels={},j._client=void 0,j.connectionState=_C.DISCONNECTED,j.prevConnectionState=_C.DISCONNECTED,j.channels={},j._client=void 0,j}return _createClass(AGRtmManager,[{key:"client",get:function get(){return this._client}},{key:"sessionId",get:function get(){return this.client.context.sid}},{key:"logFilter",get:function get(){var j=nR().LOG_FILTER_INFO;switch(KS.logLevel){case SE.WARN:j=nR().LOG_FILTER_WARNING;break;case SE.ERROR:j=nR().LOG_FILTER_ERROR}return j}},{key:"_region",get:function get(){switch(KS.shared.rtmRegion){case VS.AREA_GLOBAL:return"GLOBAL";case VS.AREA_CN:return"CHINA";case VS.AREA_AS:return"ASIA";case VS.AREA_EUR:return"EUROPE";case VS.AREA_NA:return"NORTH_AMERICA";case VS.AREA_JAPAN:return"JAPAN";case VS.AREA_INDIA:return"INDIA"}}},{key:"login",value:(Ut=_asyncToGenerator(rtm_regeneratorRuntime().mark((function _callee(j,_e,_t){var St,Tt=this;return rtm_regeneratorRuntime().wrap((function _callee$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.prev=0,nR().setArea({areaCodes:[this._region]}),St=nR().createInstance(KS.shared.appId,{enableLogUpload:_t.uploadLog,logFilter:this.logFilter}),ME.info("[AGRtmManager] wrapper init"),St.on("ConnectionStateChanged",(function(j,_e){ME.info("[AGRtmManager] ConnectionStateChanged",j,_e),Tt.prevConnectionState=Tt.connectionState,Tt.connectionState=j,Tt.emit(UT.RtmConnectionStateChanged,{newState:j,reason:_e})})),St.on("MessageFromPeer",(function(j,_e,_t){iR(j)&&Tt.emit("MessageFromPeer",{message:j.text,peerId:_e,props:_t})})),Ut.next=8,St.login({uid:_e,token:j});case 8:this._client=St,Ut.next=15;break;case 11:Ut.prev=11,Ut.t0=Ut.catch(0),this._destroyRtm(St),zE.shared.handleThrowableError(QE.RTM_ERR_LOGIN_FAIL,Ut.t0);case 15:case"end":return Ut.stop()}}),_callee,this,[[0,11]])}))),function login(j,_e,_t){return Ut.apply(this,arguments)})},{key:"createObserverChannel",value:function createObserverChannel(j){return[this.client.createChannel(j),new tR.EventEmitter]}},{key:"join",value:(Tt=_asyncToGenerator(rtm_regeneratorRuntime().mark((function _callee2(j,_e,_t){return rtm_regeneratorRuntime().wrap((function _callee2$(St){for(;;)switch(St.prev=St.next){case 0:if(St.prev=0,US.shared.startTick("joinRoom","rtm","joinChannel"),this.channels[_t]!==j){St.next=4;break}return St.abrupt("return",ME.warn("[AGRtmManager] skip channel ".concat(_t," join as the channel is already joined")));case 4:return j.on("ChannelMessage",(function(j,St,Tt){_e.emit("ChannelMessage",{channelName:_t,message:j,memberId:St,messagePros:Tt})})),j.on("MemberJoined",(function(j){_e.emit("MemberJoined",{channelName:_t,memberId:j})})),j.on("MemberLeft",(function(j){_e.emit("MemberLeft",{channelName:_t,memberId:j})})),j.on("MemberCountUpdated",(function(j){_e.emit("MemberCountUpdated",{channelName:_t,memberCount:j})})),St.next=10,j.join();case 10:this.channels[_t]=j,US.shared.reportElapse("joinRoom","rtm",{api:"joinChannel",result:!0}),St.next=18;break;case 14:St.prev=14,St.t0=St.catch(0),US.shared.reportElapse("joinRoom","rtm",{api:"joinChannel",result:!1,errCode:"".concat(St.t0.message)}),zE.shared.handleThrowableError(QE.RTM_ERR_JOIN_FAILED,St.t0);case 18:case"end":return St.stop()}}),_callee2,this,[[0,14]])}))),function join(j,_e,_t){return Tt.apply(this,arguments)})},{key:"leave",value:(St=_asyncToGenerator(rtm_regeneratorRuntime().mark((function _callee3(j){var _e;return rtm_regeneratorRuntime().wrap((function _callee3$(_t){for(;;)switch(_t.prev=_t.next){case 0:if(_t.prev=0,!(_e=this.channels[j])){_t.next=7;break}return _t.next=5,_e.leave();case 5:_e.removeAllListeners(),delete this.channels[j];case 7:_t.next=12;break;case 9:_t.prev=9,_t.t0=_t.catch(0),zE.shared.handleNonThrowableError(QE.RTM_ERR_LEAVE_FAILED,_t.t0);case 12:case"end":return _t.stop()}}),_callee3,this,[[0,9]])}))),function leave(j){return St.apply(this,arguments)})},{key:"releaseChannels",value:function releaseChannels(){for(var j=0,_e=Object.keys(this.channels);j<_e.length;j++){var _t=_e[j];this.channels[_t]&&this.release(this.channels[_t]),this.channels[_t]=void 0}}},{key:"releaseClient",value:function releaseClient(){this._client&&this.release(this._client)}},{key:"release",value:function release(j){j.removeAllListeners(),ME.info("[AGRtmManager] eventClient removeAllListeners ")}},{key:"reset",value:function reset(){this.connectionState=_C.DISCONNECTED,this.prevConnectionState=_C.DISCONNECTED,this.releaseClient(),this.releaseChannels(),this.channels={},this.client&&(this.client.removeAllListeners(),ME.info("[AGRtmManager] removeAllListeners")),this._client=void 0,this.removeAllListeners(),ME.info("[AGRtmManager] self removeAllListeners")}},{key:"_destroyRtm",value:function _destroyRtm(j){try{null==j||j.logout()}catch(j){zE.shared.handleNonThrowableError(QE.RTM_ERR_DESTROY_FAILED,j)}}},{key:"destroyRtm",value:function destroyRtm(){this._destroyRtm(this._client),this._client=void 0}},{key:"sendChannelMessage",value:(_t=_asyncToGenerator(rtm_regeneratorRuntime().mark((function _callee4(j,_e,_t){var St;return rtm_regeneratorRuntime().wrap((function _callee4$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return St=this.channels[j],Tt.next=3,St.sendMessage(_e,{enableHistoricalMessaging:_t.enableHistoricalMessaging});case 3:case"end":return Tt.stop()}}),_callee4,this)}))),function sendChannelMessage(j,_e,St){return _t.apply(this,arguments)})},{key:"sendPeerMessage",value:(_e=_asyncToGenerator(rtm_regeneratorRuntime().mark((function _callee5(j,_e,_t){var St;return rtm_regeneratorRuntime().wrap((function _callee5$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,this.client.sendMessageToPeer(_e,j,{enableHistoricalMessaging:_t.enableHistoricalMessaging});case 2:return St=Tt.sent,Tt.abrupt("return",St.hasPeerReceived);case 4:case"end":return Tt.stop()}}),_callee5,this)}))),function sendPeerMessage(j,_t,St){return _e.apply(this,arguments)})}]),AGRtmManager}(tR.EventEmitter),aR=(__webpack_require__(86),__webpack_require__(4073)),sR=__webpack_require__.n(aR);function _superPropBase(j,_e){for(;!Object.prototype.hasOwnProperty.call(j,_e)&&null!==(j=_getPrototypeOf(j)););return j}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(j,_e,_t){var St=_superPropBase(j,_e);if(St){var Tt=Object.getOwnPropertyDescriptor(St,_e);return Tt.get?Tt.get.call(arguments.length<3?j:_t):Tt.value}},_get.apply(this,arguments)}__webpack_require__(5827);var cR,uR=__webpack_require__(8711),lR=__webpack_require__.n(uR);__webpack_require__(8478),__webpack_require__(3561),__webpack_require__(2049);function task_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */task_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}!function(j){j[j.continue=0]="continue",j[j.exit=1]="exit"}(cR||(cR={}));var dR=function promisify(j){return new Promise(function(){var _e=_asyncToGenerator(task_regeneratorRuntime().mark((function _callee(_e,_t){var St;return task_regeneratorRuntime().wrap((function _callee$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.prev=0,Tt.next=3,j();case 3:St=Tt.sent,_e(St),Tt.next=10;break;case 7:Tt.prev=7,Tt.t0=Tt.catch(0),_t(Tt.t0);case 10:case"end":return Tt.stop()}}),_callee,null,[[0,7]])})));return function(j,_t){return _e.apply(this,arguments)}}())},hR=function(){function PollingTask(j){_classCallCheck(this,PollingTask),this.__arguments=j,this.__timer=void 0,this.__running=!1}return _createClass(PollingTask,[{key:"start",value:function start(){var j=this;if(this.__running)throw new Error("Task is already running");this.__running=!0,this.__arguments.immediate?dR(this.__arguments.runnable).then((function(){j.poll()})):this.poll()}},{key:"poll",value:function poll(){var j=this;if(!this.__running)return this.stop();this.__timer=setTimeout(_asyncToGenerator(task_regeneratorRuntime().mark((function _callee2(){return task_regeneratorRuntime().wrap((function _callee2$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,dR(j.__arguments.runnable).catch((function(_e){j.__arguments.onFail(_e)===cR.exit&&(j.__running=!1)}));case 2:!j.__arguments.once&&j.poll();case 3:case"end":return _e.stop()}}),_callee2)}))),this.__arguments.interval)}},{key:"stop",value:function stop(){clearTimeout(this.__timer),this.__running=!1}},{key:"isStopped",get:function get(){return!this.__running}}]),PollingTask}(),fR=function(){function IntervalTask(j){_classCallCheck(this,IntervalTask),this.__arguments=j,this.__timer=void 0,this.__running=!1}return _createClass(IntervalTask,[{key:"start",value:function start(){var j=this;if(this.__running)throw new Error("Task is already running");this.__running=!0;var _e=this.__arguments,_t=_e.immediate,St=_e.interval;_t&&this.poll(),this.__timer=setInterval((function(){j.poll()}),St)}},{key:"poll",value:function poll(){var j=this;if(!this.__running)return this.stop();var _e=this.__arguments.runnable;dR(_e).catch((function(_e){j.__arguments.onFail(_e)===cR.exit&&(j.__running=!1)}))}},{key:"stop",value:function stop(){clearInterval(this.__timer),this.__running=!1}},{key:"isStopped",get:function get(){return!this.__running}}]),IntervalTask}(),pR=function(){function Duration(){_classCallCheck(this,Duration)}return _createClass(Duration,null,[{key:"second",value:function second(j){return this._factors.second*j}},{key:"minute",value:function minute(j){return this._factors.minute*j}},{key:"hour",value:function hour(j){return this._factors.hour*j}}]),Duration}();pR._factors={hour:36e5,minute:6e4,second:1e3};var vR,mR,yR=function(){function Scheduler(){_classCallCheck(this,Scheduler),this._tasks=new WeakSet}return _createClass(Scheduler,[{key:"addPollingTask",value:function addPollingTask(j,_e){var _t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],St=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return cR.continue},Tt=new hR({runnable:j,interval:_e,immediate:_t,onFail:St});return Tt.start(),this._tasks.add(Tt),Tt}},{key:"addDelayTask",value:function addDelayTask(j,_e){var _t=this,St=new hR({runnable:j,interval:_e,once:!0,onFail:function onFail(){return cR.exit},onComplete:function onComplete(){_t._tasks.delete(St)}});return St.start(),this._tasks.add(St),St}},{key:"addIntervalTask",value:function addIntervalTask(j,_e){var _t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],St=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return cR.continue},Tt=new fR({runnable:j,interval:_e,immediate:_t,onFail:St});return Tt.start(),this._tasks.add(Tt),Tt}}]),Scheduler}(),AR=function createScheduler(){return new yR},_R=AR();function stream_media_player_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */stream_media_player_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function stream_media_player_createSuper(j){var _e=function stream_media_player_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j.ReadyToPlay="ready-to-play",j.InteractiveNeeded="interactive-needed",j.CdnDelayUpdated="cdn-delay-updated"}(vR||(vR={}));var bR,ER,wR,SR=TS.attach({proxyMethods:!1})(mR=function(j){_inherits(StreamMediaPlayer,j);var _e=stream_media_player_createSuper(StreamMediaPlayer);function StreamMediaPlayer(j){var _t;return _classCallCheck(this,StreamMediaPlayer),(_t=_e.call(this))._streamUrl=j,_t.logger=void 0,_t._view=void 0,_t._mediaElement=void 0,_t._containerElement=void 0,_t._hls=void 0,_t._task=void 0,_t._delayTask=void 0,lR().isSupported()&&!_t.browserHlsSupported()&&_t._createHls(),_t}return _createClass(StreamMediaPlayer,[{key:"mediaElement",get:function get(){return this._mediaElement}},{key:"_createHls",value:function _createHls(){var j=this;this._hls=new(lR())({lowLatencyMode:!0,progressive:!0,liveSyncDuration:1});var _e=this._hls;_e.on(lR().Events.MEDIA_ATTACHED,(function(){_e.loadSource(j._streamUrl)})),_e.on(lR().Events.ERROR,(function(_t,St){if(j.logger.error("HLS ->","ERROR:",_t,St),St.fatal)switch(St.type){case lR().ErrorTypes.NETWORK_ERROR:j.logger.error("fatal network error encountered, try to recover"),_e.loadSource(j._streamUrl);break;case lR().ErrorTypes.MEDIA_ERROR:j.logger.error("fatal media error encountered, try to recover"),_e.recoverMediaError();break;default:_e.destroy()}})),_e.on(lR().Events.MANIFEST_PARSED,(function(_e,_t){j.logger.info("HLS ->","manifest loaded, found "+_t.levels.length+" quality level")})),_e.on(lR().Events.FRAG_PARSING_METADATA,(function(_e,_t){j.logger.info("HLS ->","FRAG_PARSING_METADATA:",_e,_t)})),_e.on(lR().Events.FRAG_PARSING_USERDATA,(function(_e,_t){var St=_t.samples.reduce((function(j,_e){var _t=JSON.parse(_e.userData).ts;return j>_t?_t:j}),Date.now()),Tt=Date.now()-St;j.logger.info("HLS ->","FRAG_PARSING_USERDATA:",_e,_t,Tt),j.emit(vR.CdnDelayUpdated,Tt+3e3)}))}},{key:"_attachMediaTag",value:function _attachMediaTag(j,_e){var _t,St=this;if(j!==(null===(_t=this._mediaElement)||void 0===_t?void 0:_t.tagName)&&this._detachMediaTag(),this._view){var Tt,Ut=document.createElement(j);Ut.style.width="100%",Ut.style.height="100%",Ut.style.objectFit="cover",Ut.autoplay=!0,Ut.muted=!_e,Ut.setAttribute("playsinline","");var _r=document.createElement("div");_r.style.width="100%",_r.style.height="100%",_r.style.position="relative",_r.style.overflow="hidden",_r.style.backgroundColor="black",_r.className="agora_stream_media_player",_r.appendChild(Ut),this._view.appendChild(_r),this._mediaElement=Ut,this._containerElement=_r,null===(Tt=this._mediaElement)||void 0===Tt||Tt.addEventListener("canplay",(function(){St.emit(vR.ReadyToPlay)}),{once:!0})}if(this._mediaElement&&this._hls)this._hls.attachMedia(this._mediaElement),"audio"===j&&(this._delayTask=_R.addPollingTask((function(){St.emit(vR.CdnDelayUpdated,7e3)}),pR.second(1)));else{if(!this._mediaElement||!this.browserHlsSupported())throw new Error("can not play hls on this device");this._mediaElement.src=this._streamUrl,this.emit(vR.CdnDelayUpdated,7e3)}}},{key:"_detachMediaTag",value:function _detachMediaTag(){this._mediaElement&&(this._view&&this._containerElement&&(this._view.removeChild(this._containerElement),this._containerElement=void 0),this._mediaElement=void 0),this._hls&&this._hls.detachMedia()}},{key:"takeSnapshot",value:function takeSnapshot(){return new Blob}},{key:"setView",value:function setView(j){this._view&&j&&this._view!==j&&this._detachMediaTag(),this._view=j}},{key:"play",value:function play(j,_e){var _t=this;j&&this._attachMediaTag("video",j),_e&&!j&&this._attachMediaTag("audio",_e),this._mediaElement&&(this._mediaElement.play().then((function(){_t.emit(vR.InteractiveNeeded,!1)})).catch((function(j){"NotAllowedError"===j.name&&_t.emit(vR.InteractiveNeeded,!0)})),this.playAttempt())}},{key:"stop",value:function stop(){this._mediaElement&&this._mediaElement.pause(),this._detachMediaTag()}},{key:"playAttempt",value:function playAttempt(){var j=this;this._task||(this._task=_R.addPollingTask(_asyncToGenerator(stream_media_player_regeneratorRuntime().mark((function _callee(){return stream_media_player_regeneratorRuntime().wrap((function _callee$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(j._mediaElement){_e.next=2;break}return _e.abrupt("return");case 2:return _e.prev=2,_e.next=5,j._mediaElement.play();case 5:j.emit(vR.InteractiveNeeded,!1),j._task&&j._task.stop(),_e.next=12;break;case 9:_e.prev=9,_e.t0=_e.catch(2),j.emit(vR.InteractiveNeeded,!0);case 12:case"end":return _e.stop()}}),_callee,null,[[2,9]])}))),1e3))}},{key:"on",value:function on(j,_e){return _get(_getPrototypeOf(StreamMediaPlayer.prototype),"on",this).call(this,j,_e)}},{key:"once",value:function once(j,_e){return _get(_getPrototypeOf(StreamMediaPlayer.prototype),"once",this).call(this,j,_e)}},{key:"off",value:function off(j,_e){return _get(_getPrototypeOf(StreamMediaPlayer.prototype),"off",this).call(this,j,_e)}},{key:"dispose",value:function dispose(){this._detachMediaTag(),this._hls&&this._hls.destroy(),this._task&&this._task.stop()}},{key:"clearDelayTask",value:function clearDelayTask(){this._delayTask&&(this._delayTask.stop(),this._delayTask=void 0)}},{key:"browserHlsSupported",value:function browserHlsSupported(){return!!document.createElement("video").canPlayType("application/vnd.apple.mpegURL")}}]),StreamMediaPlayer}(_a))||mR;function track_createSuper(j){var _e=function track_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j[j.None=0]="None",j[j.Camera=1]="Camera",j[j.ScreenShare=2]="ScreenShare",j[j.MediaPlayer=3]="MediaPlayer"}(bR||(bR={})),function(j){j[j.None=0]="None",j[j.Mic=1]="Mic",j[j.ScreenShare=2]="ScreenShare",j[j.MediaPlayer=3]="MediaPlayer"}(ER||(ER={})),function(j){j[j.Unpublished=0]="Unpublished",j[j.Published=1]="Published"}(wR||(wR={}));var IR,TR,CR=_createClass((function AgoraRteMediaTrack(j,_e){var _t=_e.videoSourceType,St=_e.audioSourceType;_classCallCheck(this,AgoraRteMediaTrack),this.videoSourceType=bR.None,this.audioSourceType=ER.None,this.rtc=void 0,this.rtc=j,_t&&(this.videoSourceType=_t),St&&(this.audioSourceType=St)})),RR=function(j){_inherits(AgoraRteStreamMediaTrack,j);var _e=track_createSuper(AgoraRteStreamMediaTrack);function AgoraRteStreamMediaTrack(j,_t){var St,Tt,Ut;return _classCallCheck(this,AgoraRteStreamMediaTrack),(Ut=_e.call(this,j,{videoSourceType:bR.MediaPlayer,audioSourceType:ER.MediaPlayer})).playVideo=void 0,Ut.playAudio=void 0,Ut.streamUrl=void 0,Ut.player=void 0,Ut.playVideo=null===(St=null==_t?void 0:_t.playVideo)||void 0===St||St,Ut.playAudio=null===(Tt=null==_t?void 0:_t.playAudio)||void 0===Tt||Tt,Ut}return _createClass(AgoraRteStreamMediaTrack,[{key:"setPlayVideo",value:function setPlayVideo(j){this.playVideo=j}},{key:"setPlayAudio",value:function setPlayAudio(j){this.playAudio=j}},{key:"setView",value:function setView(j){this.player&&this.player.dispose(),this.player=new SR(j.streamUrl),this.player.setView(j.view)}},{key:"start",value:function start(){return this.player&&(this.playVideo||this.playAudio)&&this.player.play(this.playVideo,this.playAudio),0}},{key:"stop",value:function stop(){return this.player&&this.player.stop(),0}}]),AgoraRteStreamMediaTrack}(CR),kR=function(j){_inherits(AgoraRteCameraVideoTrack,j);var _e=track_createSuper(AgoraRteCameraVideoTrack);function AgoraRteCameraVideoTrack(j){var _t;return _classCallCheck(this,AgoraRteCameraVideoTrack),(_t=_e.call(this,j,{videoSourceType:bR.Camera})).state=NR.stopped,j.onLocalVideoTrackStateChanged((function(j,_e){_e===bR.Camera&&(_t.state=j)})),_t}return _createClass(AgoraRteCameraVideoTrack,[{key:"addProcessors",value:function addProcessors(j){this.rtc.addCameraProcessors(j)}},{key:"removeProcessors",value:function removeProcessors(){this.rtc.removeCameraProcessors()}},{key:"setView",value:function setView(j){this.rtc.setupLocalVideo(j,bR.Camera)}},{key:"setDeviceId",value:function setDeviceId(j){this.rtc.setVideoCameraDevice(j)}},{key:"setVideoEncoderConfiguration",value:function setVideoEncoderConfiguration(){}},{key:"start",value:function start(){return this.rtc.enableLocalVideo(!0)}},{key:"stop",value:function stop(){return this.rtc.enableLocalVideo(!1)}}]),AgoraRteCameraVideoTrack}(CR),OR=function(j){_inherits(AgoraRteMicrophoneAudioTrack,j);var _e=track_createSuper(AgoraRteMicrophoneAudioTrack);function AgoraRteMicrophoneAudioTrack(j){var _t;return _classCallCheck(this,AgoraRteMicrophoneAudioTrack),(_t=_e.call(this,j,{audioSourceType:ER.Mic})).state=NR.stopped,j.onLocalAudioTrackStateChanged((function(j,_e){_e===ER.Mic&&(_t.state=j)})),_t}return _createClass(AgoraRteMicrophoneAudioTrack,[{key:"addProcessors",value:function addProcessors(j){return this.rtc.addMicrophoneProcessors(j)}},{key:"removeProcessors",value:function removeProcessors(){return this.rtc.removeMicrophoneProcessors()}},{key:"setRecordingDevice",value:function setRecordingDevice(j){return this.rtc.setAudioRecordingDevice(j)}},{key:"setPlaybackDevice",value:function setPlaybackDevice(j){return this.rtc.setAudioPlaybackDevice(j)}},{key:"setAudioRawDataConfig",value:function setAudioRawDataConfig(j){this.rtc.setAudioRawDataConfig(j,iO.record)}},{key:"addAudioRawDataObserver",value:function addAudioRawDataObserver(j){this.rtc.addAudioRawDataObserver(j,iO.record)}},{key:"removeAudioRawDataObserver",value:function removeAudioRawDataObserver(j){this.rtc.removeAudioRawDataObserver(j,iO.record)}},{key:"start",value:function start(){return this.rtc.enableLocalAudio(!0)}},{key:"stop",value:function stop(){return this.rtc.enableLocalAudio(!1)}}]),AgoraRteMicrophoneAudioTrack}(CR),DR=function(j){_inherits(AgoraRteScreenShareTrack,j);var _e=track_createSuper(AgoraRteScreenShareTrack);function AgoraRteScreenShareTrack(j){return _classCallCheck(this,AgoraRteScreenShareTrack),_e.call(this,j,{videoSourceType:bR.ScreenShare,audioSourceType:ER.ScreenShare})}return _createClass(AgoraRteScreenShareTrack,[{key:"setView",value:function setView(j){this.rtc.setupLocalVideo(j,bR.ScreenShare)}},{key:"start",value:function start(){return this.rtc.startScreenCapture()}},{key:"startWithParams",value:function startWithParams(j){return this.rtc.startScreenCapture(j)}},{key:"stop",value:function stop(){return this.rtc.stopScreenCapture()}}]),AgoraRteScreenShareTrack}(CR);!function(j){j[j.main=0]="main",j[j.sub=1]="sub"}(TR||(TR={}));var xR,LR,NR,PR,MR,BR,UR,FR,GR,qR,QR,WR=TS.attach()(IR=function(){function AGRtcChannel(j,_e){_classCallCheck(this,AGRtcChannel),this.channelName=void 0,this._adapter=void 0,this._adapter=_e,this.channelName=j}return _createClass(AGRtcChannel,[{key:"connectionType",value:function connectionType(j){return void 0===j?TR.main:j}},{key:"enableDualStream",value:function enableDualStream(j,_e){return this._adapter.enableDualStream(j,this.connectionType(_e))}},{key:"setLowStreamParameter",value:function setLowStreamParameter(j,_e){return this._adapter.setLowStreamParameter(j,this.connectionType(_e))}},{key:"setRemoteVideoStreamType",value:function setRemoteVideoStreamType(j,_e,_t){return this._adapter.setRemoteVideoStreamType(j,_e,this.connectionType(_t))}},{key:"getRtcSid",value:function getRtcSid(){return this._adapter.getSessionId()}},{key:"join",value:function join(j,_e,_t){return this._adapter.join(j,_e,this.connectionType(_t))}},{key:"leave",value:function leave(j){return this._adapter.leave(j)}},{key:"muteLocalVideoStream",value:function muteLocalVideoStream(j,_e){return this._adapter.muteLocalVideo(j,this.connectionType(_e))}},{key:"muteLocalAudioStream",value:function muteLocalAudioStream(j,_e){return this._adapter.muteLocalAudio(j,this.connectionType(_e))}},{key:"muteLocalScreenStream",value:function muteLocalScreenStream(j,_e){return this._adapter.muteLocalScreenShare(j,this.connectionType(_e))}},{key:"muteRemoteVideoStream",value:function muteRemoteVideoStream(j,_e){return this._adapter.muteRemoteVideo(j,_e)}},{key:"muteRemoteAudioStream",value:function muteRemoteAudioStream(j,_e){return this._adapter.muteRemoteAudio(j,_e)}},{key:"onNetworkStats",value:function onNetworkStats(j){return this._adapter.onNetworkStats(j)}},{key:"onAudioVolumeIndication",value:function onAudioVolumeIndication(j){return this._adapter.onAudioVolumeIndication(j)}},{key:"onConnectionStageChanged",value:function onConnectionStageChanged(j){return this._adapter.onConnectionStateChanged(j)}},{key:"setLatencyLevel",value:function setLatencyLevel(j){this._adapter.setLatencyLevel(j)}},{key:"muteRemoteVideoStreamMass",value:function muteRemoteVideoStreamMass(j,_e){return this._adapter.muteRemoteVideoMass(j,_e)}}]),AGRtcChannel}())||IR;__webpack_require__(3290);function user_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */user_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}!function(j){j[j.unknown=99]="unknown",j[j.bad=1]="bad",j[j.poor=2]="poor",j[j.good=3]="good",j[j.great=4]="great",j[j.down=5]="down"}(xR||(xR={})),function(j){j[j.Unknown=0]="Unknown",j[j.PermissionDenied=1]="PermissionDenied"}(LR||(LR={})),function(j){j[j.stopped=0]="stopped",j[j.starting=2]="starting",j[j.started=1]="started",j[j.error=-1]="error"}(NR||(NR={})),function(j){j[j.Idle=0]="Idle",j[j.Connecting=1]="Connecting",j[j.Connected=2]="Connected",j[j.Reconnecting=3]="Reconnecting"}(PR||(PR={})),function(j){j[j.AES_128_XTS=1]="AES_128_XTS",j[j.AES_128_ECB=2]="AES_128_ECB",j[j.AES_256_XTS=3]="AES_256_XTS",j[j.SM4_128_ECB=4]="SM4_128_ECB",j[j.AES_128_GCM=5]="AES_128_GCM",j[j.AES_256_GCM=6]="AES_256_GCM"}(MR||(MR={})),function(j){j[j.Window=0]="Window",j[j.Screen=1]="Screen"}(BR||(BR={})),function(j){j[j.fit=0]="fit",j[j.fill=1]="fill"}(UR||(UR={})),function(j){j[j.low=0]="low",j[j.normal=1]="normal",j[j.height=2]="height"}(FR||(FR={})),function(j){j[j.HIGH_STREAM=0]="HIGH_STREAM",j[j.LOW_STREAM=1]="LOW_STREAM"}(GR||(GR={}));var zR=TS.attach({proxyMethods:!1})((QR=function(){function AgoraRteLocalUser(j,_e){var _t,St,Tt=_e.userUuid,Ut=_e.userName,_r=_e.userRole,_n=_e.streamUuid,_i=_e.sceneId,Ei=_e.rtcToken,Ci=_e.rtc,Di=_e.userProperties;_classCallCheck(this,AgoraRteLocalUser),this.logger=void 0,this.userUuid=void 0,this.userName=void 0,this.userRole=void 0,this.userProperties=void 0,this.streamUuid=void 0,this.sceneId=void 0,this.rtcToken=void 0,this._rtc=void 0,this._scene=void 0,this._debouncedSyncVideo=sR()(this._syncVideoSourceState,500),this._debouncedSyncAudio=sR()(this._syncAudioSourceState,500),this._cameraState=void 0,this._micState=void 0,this.subStream=void 0,this.userUuid=Tt,this.userName=Ut,this.userRole=_r,this.userProperties=Di,this.streamUuid=_n,this.sceneId=_i,this.rtcToken=Ei,this._rtc=Ci,this._scene=j,this._cameraState=null===(_t=j.engine.getAgoraMediaControl().camera)||void 0===_t?void 0:_t.state,this._micState=null===(St=j.engine.getAgoraMediaControl().microphone)||void 0===St?void 0:St.state,this._addEventHandler()}var j,_e,_t,St,Tt,Ut,_r,_n,_i,Ei,Ci;return _createClass(AgoraRteLocalUser,[{key:"toData",value:function toData(){var j=this.userName,_e=this.userUuid,_t=this.userRole,St=this.userProperties;return VT.fromData({userName:j,userUuid:_e,role:_t,userProperties:St})}},{key:"destroy",value:function destroy(){var j=this._scene.engine;j.getAgoraMediaControl().off(wO.localVideoTrackChanged,this._handleVideoTrackStateChange),j.getAgoraMediaControl().off(wO.localAudioTrackChanged,this._handleAudioTrackStateChange),this._scene.off(UT.LocalStreamAdded,this._checkMediaStateStayInSync),this._scene.off(UT.LocalStreamUpdate,this._checkMediaStateStayInSync)}},{key:"_addEventHandler",value:function _addEventHandler(){var j=this._scene.engine;j.getAgoraMediaControl().on(wO.localVideoTrackChanged,this._handleVideoTrackStateChange),j.getAgoraMediaControl().on(wO.localAudioTrackChanged,this._handleAudioTrackStateChange),this._scene.on(UT.LocalStreamAdded,this._checkMediaStateStayInSync),this._scene.on(UT.LocalStreamUpdate,this._checkMediaStateStayInSync)}},{key:"_checkMediaStateStayInSync",value:function _checkMediaStateStayInSync(j){var _e=this;j.forEach((function(j){(0,oS.isUndefined)(_e._cameraState)||j.videoSourceType!==bR.Camera||_e._cameraState===j.videoSourceState||(_e.logger.info("camera state is not synced with stream's state, attempt to rectify.. videoSourceState => ".concat(_e._cameraState)),_e._debouncedSyncVideo(_e._cameraState)),(0,oS.isUndefined)(_e._micState)||j.audioSourceType!==ER.Mic||_e._micState===j.audioSourceState||(_e.logger.info("mic state is not synced with stream's state, attempt to rectify.. audioSourceState => ".concat(_e._micState)),_e._debouncedSyncAudio(_e._micState))}))}},{key:"_handleVideoTrackStateChange",value:function _handleVideoTrackStateChange(j,_e){_e===bR.Camera&&j!==NR.starting&&(this._cameraState=j,this.logger.info("camera state changed, syncing video source state => ".concat(j)),this._debouncedSyncVideo(j))}},{key:"_handleAudioTrackStateChange",value:function _handleAudioTrackStateChange(j,_e){_e===ER.Mic&&j!==NR.starting&&(this._micState=j,this.logger.info("mic state changed, syncing audio source state => ".concat(j)),this._debouncedSyncAudio(j))}},{key:"_syncVideoSourceState",value:function _syncVideoSourceState(j){this.updateLocalMediaState({videoSourceState:j})}},{key:"_syncAudioSourceState",value:function _syncAudioSourceState(j){this.updateLocalMediaState({audioSourceState:j})}},{key:"setSceneProperties",value:(Ci=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee(j,_e){return user_regeneratorRuntime().wrap((function _callee$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.next=2,this._scene.getApiService().updateRoomProperties({roomUuid:this.sceneId,properties:j,cause:_e});case 2:return _t.abrupt("return",_t.sent);case 3:case"end":return _t.stop()}}),_callee,this)}))),function setSceneProperties(j,_e){return Ci.apply(this,arguments)})},{key:"deleteSceneProperties",value:(Ei=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee2(j,_e){return user_regeneratorRuntime().wrap((function _callee2$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.next=2,this._scene.getApiService().deleteRoomProperties({roomUuid:this.sceneId,properties:j,cause:_e});case 2:return _t.abrupt("return",_t.sent);case 3:case"end":return _t.stop()}}),_callee2,this)}))),function deleteSceneProperties(j,_e){return Ei.apply(this,arguments)})},{key:"setUserProperties",value:(_i=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee3(j,_e){return user_regeneratorRuntime().wrap((function _callee3$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.next=2,this._scene.getApiService().updateUserProperties({userUuid:this.userUuid,roomUuid:this.sceneId,properties:j,cause:_e});case 2:return _t.abrupt("return",_t.sent);case 3:case"end":return _t.stop()}}),_callee3,this)}))),function setUserProperties(j,_e){return _i.apply(this,arguments)})},{key:"deleteUserProperties",value:(_n=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee4(j,_e){return user_regeneratorRuntime().wrap((function _callee4$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.next=2,this._scene.getApiService().deleteUserProperties({userUuid:this.userUuid,roomUuid:this.sceneId,properties:j,cause:_e});case 2:return _t.abrupt("return",_t.sent);case 3:case"end":return _t.stop()}}),_callee4,this)}))),function deleteUserProperties(j,_e){return _n.apply(this,arguments)})},{key:"updateLocalMediaState",value:(_r=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee5(j,_e){var _t,St,Tt;return user_regeneratorRuntime().wrap((function _callee5$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return St=j.videoSourceState,Tt=j.audioSourceState,Ut.next=3,this._scene.getApiService().updateDeviceState(this.sceneId,this.userUuid,_e&&_e===TR.sub?(null===(_t=this.subStream)||void 0===_t?void 0:_t.streamUuid)||"0":this.streamUuid,{videoSourceState:St,audioSourceState:Tt});case 3:return Ut.abrupt("return",Ut.sent);case 4:case"end":return Ut.stop()}}),_callee5,this)}))),function updateLocalMediaState(j,_e){return _r.apply(this,arguments)})},{key:"updateLocalMediaStream",value:(Ut=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee6(j,_e){var _t,St,Tt,Ut,_r;return user_regeneratorRuntime().wrap((function _callee6$(_n){for(;;)switch(_n.prev=_n.next){case 0:return St=j.publishVideo,Tt=j.publishAudio,Ut=j.videoSourceType,_r=j.audioSourceType,_n.next=3,this._scene.getApiService().upsertStream(this.sceneId,this.userUuid,_e&&_e===TR.sub?(null===(_t=this.subStream)||void 0===_t?void 0:_t.streamUuid)||"0":this.streamUuid,{publishVideo:St,publishAudio:Tt,videoSourceType:Ut,audioSourceType:_r});case 3:return _n.abrupt("return",_n.sent);case 4:case"end":return _n.stop()}}),_callee6,this)}))),function updateLocalMediaStream(j,_e){return Ut.apply(this,arguments)})},{key:"updateRemoteMediaStream",value:(Tt=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee7(j,_e,_t,St){var Tt,Ut;return user_regeneratorRuntime().wrap((function _callee7$(St){for(;;)switch(St.prev=St.next){case 0:return Tt=_t.publishVideo,Ut=_t.publishAudio,St.next=3,this._scene.getApiService().upsertStream(this.sceneId,j,_e,{publishVideo:Tt,publishAudio:Ut});case 3:return St.abrupt("return",St.sent);case 4:case"end":return St.stop()}}),_callee7,this)}))),function updateRemoteMediaStream(j,_e,_t,St){return Tt.apply(this,arguments)})},{key:"deleteLocalMediaStream",value:(St=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee8(){return user_regeneratorRuntime().wrap((function _callee8$(j){for(;;)switch(j.prev=j.next){case 0:return j.next=2,this._scene.getApiService().deleteStream(this.sceneId,this.userUuid,this.streamUuid);case 2:return j.abrupt("return",j.sent);case 3:case"end":return j.stop()}}),_callee8,this)}))),function deleteLocalMediaStream(){return St.apply(this,arguments)})},{key:"deleteLocalScreenStream",value:(_t=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee9(){return user_regeneratorRuntime().wrap((function _callee9$(j){for(;;)switch(j.prev=j.next){case 0:if(!this.subStream){j.next=4;break}return j.next=3,this._scene.getApiService().deleteStream(this.sceneId,this.userUuid,this.subStream.streamUuid);case 3:return j.abrupt("return",j.sent);case 4:case"end":return j.stop()}}),_callee9,this)}))),function deleteLocalScreenStream(){return _t.apply(this,arguments)})},{key:"sendRoomMessage",value:(_e=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee10(j){return user_regeneratorRuntime().wrap((function _callee10$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this._scene.getApiService().sendRoomChatMessage(j,this.sceneId);case 2:return _e.abrupt("return",_e.sent);case 3:case"end":return _e.stop()}}),_callee10,this)}))),function sendRoomMessage(j){return _e.apply(this,arguments)})},{key:"publishStreamToCdn",value:(j=_asyncToGenerator(user_regeneratorRuntime().mark((function _callee11(j){var _e,_t,St,Tt,Ut,_r,_n,_i;return user_regeneratorRuntime().wrap((function _callee11$(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return _e=KS.shared.rtcConfigs.defaultCameraEncoderConfigurations,St=(_t=j||_e||{}).height,Tt=void 0===St?0:St,Ut=_t.width,_r=void 0===Ut?0:Ut,_n=_t.bitrate,_i=void 0===_n?0:_n,Ei.next=4,this._scene.getApiService().publishStreamToCdn(this.sceneId,this.userUuid,this.streamUuid,{converterOptions:{height:Tt,width:_r,bitrate:_i,seiOptions:{source:{metadata:!0,datastream:!1},sink:{type:5}}}});case 4:return Ei.abrupt("return",Ei.sent);case 5:case"end":return Ei.stop()}}),_callee11,this)}))),function publishStreamToCdn(_e){return j.apply(this,arguments)})},{key:"setupRemoteVideo",value:function setupRemoteVideo(j){this._rtc.setupRemoteVideo(j)}}]),AgoraRteLocalUser}(),_applyDecoratedDescriptor(QR.prototype,"_checkMediaStateStayInSync",[RS],Object.getOwnPropertyDescriptor(QR.prototype,"_checkMediaStateStayInSync"),QR.prototype),_applyDecoratedDescriptor(QR.prototype,"_handleVideoTrackStateChange",[RS],Object.getOwnPropertyDescriptor(QR.prototype,"_handleVideoTrackStateChange"),QR.prototype),_applyDecoratedDescriptor(QR.prototype,"_handleAudioTrackStateChange",[RS],Object.getOwnPropertyDescriptor(QR.prototype,"_handleAudioTrackStateChange"),QR.prototype),_applyDecoratedDescriptor(QR.prototype,"_syncVideoSourceState",[RS],Object.getOwnPropertyDescriptor(QR.prototype,"_syncVideoSourceState"),QR.prototype),_applyDecoratedDescriptor(QR.prototype,"_syncAudioSourceState",[RS],Object.getOwnPropertyDescriptor(QR.prototype,"_syncAudioSourceState"),QR.prototype),qR=QR))||qR,YR=function(){function AgoraRteSyncDataStore(){_classCallCheck(this,AgoraRteSyncDataStore),this._users=PT.Map(),this._roomProperties=PT.Map({}),this._streams=PT.Map(),this._roomInfo=PT.Map(),this._messages=PT.List([])}return _createClass(AgoraRteSyncDataStore,[{key:"users",get:function get(){return this._users}},{key:"setUsers",value:function setUsers(j){this._users=PT.Map(j)}},{key:"setUser",value:function setUser(j,_e){this._users=this._users.set(j,_e)}},{key:"deleteUser",value:function deleteUser(j){this._users=this._users.delete(j)}},{key:"findUser",value:function findUser(j){return this._users.get(j)}},{key:"roomProperties",get:function get(){return this._roomProperties}},{key:"setRoomProperties",value:function setRoomProperties(j){this._roomProperties=PT.Map(j)}},{key:"streams",get:function get(){return this._streams}},{key:"setStreams",value:function setStreams(j){this._streams=PT.Map(j)}},{key:"findUserStreams",value:function findUserStreams(j){return Array.from(this._streams.values()).filter((function(_e){return _e.fromUser.userUuid===j}))}},{key:"setStream",value:function setStream(j,_e){this._streams=this._streams.set(j,_e)}},{key:"deleteStream",value:function deleteStream(j){this._streams=this._streams.delete(j)}},{key:"deleteStreams",value:function deleteStreams(j){this._streams=this._streams.deleteAll(j)}},{key:"findStream",value:function findStream(j){return this._streams.get(j)}},{key:"roomInfo",get:function get(){return this._roomInfo}},{key:"setRoomInfo",value:function setRoomInfo(j){this._roomInfo=PT.Map(j)}},{key:"messages",get:function get(){return this._messages}},{key:"addMessage",value:function addMessage(j){this._messages.push(j)}}]),AgoraRteSyncDataStore}();function to(j,_e){return j.then((function(j){return[null,j]})).catch((function(j){return _e&&Object.assign(j,_e),[j,void 0]}))}const JR=to;var XR,ZR;__webpack_require__(5212);function state_sync_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */state_sync_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}var $R,eO=TS.attach({proxyMethods:!1})((ZR=function(){function AGOnlineStateSynchronizer(j,_e){_classCallCheck(this,AGOnlineStateSynchronizer),this.logger=void 0,this._task=void 0,this._api=void 0,this._sceneId=void 0,this._delay=0,this._connState=IE.Idle,this._isOnline=!1,this._api=j,this._sceneId=_e}var j;return _createClass(AGOnlineStateSynchronizer,[{key:"setSyncDelay",value:function setSyncDelay(j){this._delay=j}},{key:"addMessageEventListeners",value:function addMessageEventListeners(j){var _e=this,_t=KS.shared.userId;j.on(UT.SnapshotUpdated,(function(j){j.users.has(_t)?_e._isOnline=!0:_e._isOnline=!1,_e._isOnline||_e.start()})),j.on(UT.UserAdded,(function(j){var St=j.some((function(j){return j.userUuid===_t}));_e._isOnline=St,_e._isOnline||_e.start()})),j.on(UT.UserRemoved,(function(j){var St=j.some((function(j){return j.userUuid===_t}));_e._isOnline=!St,_e._isOnline||_e.start()}))}},{key:"addConnectionStateListeners",value:function addConnectionStateListeners(j){var _e=this;j.on(UT.RteConnectionStateChanged,(function(j){_e._connState=j}))}},{key:"start",value:function start(){this._task||(this.logger.info("state syncing will occur in ".concat(this._delay,"ms")),this._task=_R.addDelayTask(this._notifyServerStateOnline,this._delay))}},{key:"stop",value:function stop(){var j;null===(j=this._task)||void 0===j||j.stop(),this._task=void 0}},{key:"isStateNotInSync",get:function get(){return!this._isOnline&&this._connState===IE.Connected}},{key:"_notifyServerStateOnline",value:(j=_asyncToGenerator(state_sync_regeneratorRuntime().mark((function _callee(){var j;return state_sync_regeneratorRuntime().wrap((function _callee$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(!this.isStateNotInSync){_e.next=10;break}return j=KS.shared.userId,_e.prev=2,_e.next=5,this._api.updateOnlineState({userUuid:j,roomUuid:this._sceneId});case 5:_e.next=10;break;case 7:_e.prev=7,_e.t0=_e.catch(2),this.logger.error("failed to sync online state with server",_e.t0);case 10:this._task=void 0;case 11:case"end":return _e.stop()}}),_callee,this,[[2,7]])}))),function _notifyServerStateOnline(){return j.apply(this,arguments)})}]),AGOnlineStateSynchronizer}(),_applyDecoratedDescriptor(ZR.prototype,"_notifyServerStateOnline",[RS],Object.getOwnPropertyDescriptor(ZR.prototype,"_notifyServerStateOnline"),ZR.prototype),XR=ZR))||XR;function peer_msg_handler_createSuper(j){var _e=function peer_msg_handler_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var tO,rO,nO=TS.attach({proxyMethods:!1,label:"peer-message"})($R=function(j){_inherits(AgoraRtePeerMessageHandle,j);var _e=peer_msg_handler_createSuper(AgoraRtePeerMessageHandle);function AgoraRtePeerMessageHandle(j){var _t,St=j.dataStore;return _classCallCheck(this,AgoraRtePeerMessageHandle),(_t=_e.call(this))._dataStore=void 0,_t._dataStore=St,_t}return _createClass(AgoraRtePeerMessageHandle,[{key:"handlePeerMessage",value:function handlePeerMessage(j){if(j.cmd===jT.PeerChat)this._handlePeerChat(j)}},{key:"_handlePeerChat",value:function _handlePeerChat(j){var _e=j.data,_t=WT.fromData(_e);this._dataStore.addMessage(_t),this.emit(UT.ChatUserMessage,_t)}}]),AgoraRtePeerMessageHandle}(_a))||$R;function scene_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */scene_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function scene_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function scene_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?scene_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):scene_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}function scene_createSuper(j){var _e=function scene_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var iO,bO=TS.attach({proxyMethods:!1})((rO=function(j){_inherits(AgoraRteScene,j);var _e,_t,St,Tt,Ut=scene_createSuper(AgoraRteScene);function AgoraRteScene(j,_e){var _t;_classCallCheck(this,AgoraRteScene),(_t=Ut.call(this)).logger=void 0,_t.sceneId=void 0,_t._localUser=void 0,_t._sceneState=IE.Idle,_t._initialSync=!1,_t._apiService=void 0,_t._engine=void 0,_t.dataStore=void 0,_t._rtmManager=void 0,_t._rtcManager=void 0,_t._rtcChannel=void 0,_t._stateSynchronizer=void 0,_t._synchronizer=void 0,_t._timestampGap=0,_t.createTs=void 0,_t.sceneId=j,_t._engine=_e.engine,_t._rtmManager=_e.rtm,_t._rtcManager=_e.rtc,_t._rtcChannel=_e.rtcChannel,_t._apiService=new QS,_t._stateSynchronizer=new eO(_t._apiService,j),_t._apiService.pathPrefix=_e.engine.apiServicePathPrefix,_t.dataStore=new YR;var St=_t._rtcChannel,Tt=_t._rtmManager;return St.onNetworkStats((function(j){_t.emit(UT.NetworkStats,j)})),St.onAudioVolumeIndication((function(j){_t.emit(UT.AudioVolumes,j)})),St.onConnectionStageChanged((function(j,_e){_t.emit(UT.RtcConnectionStateChanged,j,_e)})),Tt.on(UT.RtmConnectionStateChanged,_t._handleRtmStateChange),_t}return _createClass(AgoraRteScene,[{key:"getApiService",value:function getApiService(){return this._apiService}},{key:"localUser",get:function get(){return this._localUser}},{key:"engine",get:function get(){return this._engine}},{key:"rtcSid",get:function get(){return this._rtcChannel.getRtcSid()}},{key:"rtmSid",get:function get(){return this._rtmManager.sessionId}},{key:"rtcChannel",get:function get(){return this._rtcChannel}},{key:"timestampServerLocalGap",get:function get(){return this._timestampGap}},{key:"enableDualStream",value:function enableDualStream(j,_e){return this._rtcChannel.enableDualStream(j,_e)}},{key:"setLowStreamParameter",value:function setLowStreamParameter(j,_e){return this._rtcChannel.setLowStreamParameter(j,_e)}},{key:"setRemoteVideoStreamType",value:function setRemoteVideoStreamType(j,_e){return this._rtcChannel.setRemoteVideoStreamType(j,_e)}},{key:"joinScene",value:(Tt=_asyncToGenerator(scene_regeneratorRuntime().mark((function _callee(j){var _e,_t,St,Tt,Ut,_r,_n,_i,Ei,Ci,Di,Fi,_o,ga,_a,_s,_c,kc,_u,_l,_d,_h,_f,_p;return scene_regeneratorRuntime().wrap((function _callee$(Eg){for(;;)switch(Eg.prev=Eg.next){case 0:if(this._sceneState===IE.Idle){Eg.next=3;break}return this.logger.warn("scene not idle"),Eg.abrupt("return");case 3:return Eg.prev=3,this._setRteConnectionState(IE.Connecting),_e=this._engine.getAgoraMediaControl(),_t=KS.sequenceVersion,Eg.next=9,this.getApiService().entryRoom({userUuid:KS.shared.userId,roomUuid:this.sceneId,userName:j.userName,streamUuid:j.streamId,role:j.userRole,stream:{videoSourceState:_e.createCameraVideoTrack().state,audioSourceState:_e.createMicrophoneAudioTrack().state},sequenceVersion:_t});case 9:return St=Eg.sent,Tt=St.user,Ut=St.room,_r=St.sysConfig,_n=_slicedToArray(_r.rtmChannels,1),_i=_n[0],Ei=this._rtmManager.createObserverChannel(_i),Ci=_slicedToArray(Ei,2),Di=Ci[0],Fi=Ci[1],1===Tt.subscribe&&this._stateSynchronizer.setSyncDelay(_r.onlineStateEnsureDelay||5e3),this._stateSynchronizer.addConnectionStateListeners(this),this.createTs=Ut.roomState.createTime,this._apiService.headers=scene_objectSpread(scene_objectSpread({},KS.shared.service.headers),{},{token:Tt.userToken}),Eg.next=21,this._rtmManager.join(Di,Fi,this.sceneId);case 21:return _o=Tt.streamUuid,ga=Tt.userName,_a=Tt.userUuid,_s=Tt.role,_c=Tt.rtcToken,kc=Tt.streams,_u=void 0===kc?[]:kc,_l=Tt.userProperties,_d=_u.map((function(j){return qT.fromData({streamUuid:j.streamUuid,streamName:j.streamName,fromUser:{userName:ga,userUuid:_a,role:_s},videoSourceState:j.videoSourceState,audioSourceState:j.audioSourceState,videoSourceType:j.videoSourceType,audioSourceType:j.audioSourceType,videoState:j.videoState,audioState:j.audioState,playUrl:j.playUrl,flvPlayUrl:j.flvPlayUrl,rtmpPlayUrl:j.rtmpPlayUrl})})),this.dataStore.setStreams(_d),this._localUser=new zR(this,{userUuid:KS.shared.userId,userName:ga,userRole:_s,streamUuid:_o,sceneId:this.sceneId,rtcToken:_c,rtc:this._rtcManager,userProperties:_l}),2===_u.length&&(_h=_u.find((function(j){return j.streamUuid!==_o})),this._localUser.subStream=_h),this._synchronizer=new eR(this.dataStore,{scene:this,userUuid:KS.shared.userId,streamUuid:_o,channelObserver:Fi,sequenceVersion:_t}),_f=new nO({dataStore:this.dataStore}),this._addEventListeners(this._synchronizer.handle,_f),Eg.next=31,this.getApiService().syncSnapShot(this.sceneId);case 31:_p=Eg.sent,this._synchronizer.syncSnapshot(GT.fromData(_p)),Eg.next=39;break;case 35:return Eg.prev=35,Eg.t0=Eg.catch(3),this._cleanup(),Eg.abrupt("return",zE.shared.handleThrowableError(QE.RTE_ERR_JOIN_SCENE_FAILED,Eg.t0));case 39:case"end":return Eg.stop()}}),_callee,this,[[3,35]])}))),function joinScene(j){return Tt.apply(this,arguments)})},{key:"leaveScene",value:(St=_asyncToGenerator(scene_regeneratorRuntime().mark((function _callee2(){var j,_e,_t;return scene_regeneratorRuntime().wrap((function _callee2$(St){for(;;)switch(St.prev=St.next){case 0:return this._stateSynchronizer.stop(),St.next=3,JR(this._rtmManager.leave(this.sceneId));case 3:j=St.sent,_e=_slicedToArray(j,1),(_t=_e[0])&&zE.shared.handleNonThrowableError(QE.RTE_ERR_LEAVE_SCENE_FAIL,_t),this._rtmManager.off(UT.RtmConnectionStateChanged,this._handleRtmStateChange),this._cleanup();case 9:case"end":return St.stop()}}),_callee2,this)}))),function leaveScene(){return St.apply(this,arguments)})},{key:"joinRTC",value:(_t=_asyncToGenerator(scene_regeneratorRuntime().mark((function _callee3(j){var _e;return scene_regeneratorRuntime().wrap((function _callee3$(_t){for(;;)switch(_t.prev=_t.next){case 0:if(this._initialSync&&this.localUser){_t.next=2;break}return _t.abrupt("return",zE.shared.handleThrowableError(QE.RTE_ERR_SCENE_NOT_READY,new Error("try to join rtc before scene is ready ".concat(!!this._initialSync," ").concat(!!this.localUser))));case 2:if(!j){_t.next=8;break}return _t.next=5,this._rtcChannel.join(j.token,j.streamUuid,j.connectionType);case 5:case 10:return _t.abrupt("return",_t.sent);case 8:return _t.next=10,this._rtcChannel.join(this.localUser.rtcToken,null===(_e=this.localUser)||void 0===_e?void 0:_e.streamUuid);case 11:case"end":return _t.stop()}}),_callee3,this)}))),function joinRTC(j){return _t.apply(this,arguments)})},{key:"leaveRTC",value:(_e=_asyncToGenerator(scene_regeneratorRuntime().mark((function _callee4(j){var _e,_t,St;return scene_regeneratorRuntime().wrap((function _callee4$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,JR(this._rtcChannel.leave(j));case 2:_e=Tt.sent,_t=_slicedToArray(_e,1),(St=_t[0])&&zE.shared.handleNonThrowableError(QE.RTC_ERR_LEAVE_CHANNEL_FAIL,St);case 6:case"end":return Tt.stop()}}),_callee4,this)}))),function leaveRTC(j){return _e.apply(this,arguments)})},{key:"muteRemoteAudioStream",value:function muteRemoteAudioStream(j,_e){return this._rtcChannel.muteRemoteAudioStream(j,_e)}},{key:"muteRemoteVideoStream",value:function muteRemoteVideoStream(j,_e){return this._rtcChannel.muteRemoteVideoStream(j,_e)}},{key:"muteRemoteVideoStreamMass",value:function muteRemoteVideoStreamMass(j,_e){return this._rtcChannel.muteRemoteVideoStreamMass(j,_e)}},{key:"_cleanup",value:function _cleanup(){var j;null===(j=this._localUser)||void 0===j||j.destroy(),this._localUser=void 0,this._synchronizer=void 0,this._initialSync=!1}},{key:"_setRteConnectionState",value:function _setRteConnectionState(j,_e){var _t=this._sceneState;this._sceneState=j,this._sceneState!==_t&&this.emit(UT.RteConnectionStateChanged,j,_e)}},{key:"_setInitialSnapshotSync",value:function _setInitialSnapshotSync(j){this._initialSync=j,this._recalculateRteState()}},{key:"_recalculateRteState",value:function _recalculateRteState(j){var _e=this._rtmManager.connectionState,_t=this._initialSync;return _e===_C.DISCONNECTED?this._setRteConnectionState(IE.Idle):_e===_C.CONNECTING?this._setRteConnectionState(IE.Connecting):_e===_C.CONNECTED?_t?this._setRteConnectionState(IE.Connected):this._setRteConnectionState(IE.Connecting):_e===_C.RECONNECTING?_t?this._setRteConnectionState(IE.Reconnecting):this._setRteConnectionState(IE.Connecting):_e===_C.ABORTED?this._setRteConnectionState(IE.Error,j):void this.logger.warn("unhandled rte connection state: rtm: ".concat(_e,", snapshot: ").concat(_t))}},{key:"_handleUserAdded",value:function _handleUserAdded(j){var _e=this,_t=[],St=[];j.forEach((function(j){var Tt;if(_e.logger.info("check streams with user",j),(null===(Tt=_e.localUser)||void 0===Tt?void 0:Tt.userUuid)===j.userUuid){var Ut=_e.dataStore.findUserStreams(j.userUuid);Ut.length?(_e.logger.info("local streams come with user",Ut),_t=_t.concat(Ut)):_e.logger.info("no local streams come with user",Ut)}else{var _r=_e.dataStore.findUserStreams(j.userUuid);_r.length?(_e.logger.info("remote streams come with user",_r),St=St.concat(_r)):_e.logger.info("no remote streams come with user",_r)}})),this.emit(UT.LocalStreamAdded,_t),this.emit(UT.RemoteStreamAdded,St),this.emit(UT.UserAdded,j)}},{key:"_handleUserRemoved",value:function _handleUserRemoved(j,_e,_t){var St=this,Tt=[],Ut=[];_e.forEach((function(j){var _e;(null===(_e=St.localUser)||void 0===_e?void 0:_e.userUuid)===j.fromUser.userUuid?Tt.push(j):Ut.push(j)})),this._handleLocalStreamRemoved(Tt),this._handleRemoteStreamsRemoved(Ut),this.emit(UT.UserRemoved,j,_t)}},{key:"_handleLocalStreamRemoved",value:function _handleLocalStreamRemoved(j,_e){0!==j.length&&this.emit(UT.LocalStreamRemove,j,_e)}},{key:"_handleRemoteStreamsRemoved",value:function _handleRemoteStreamsRemoved(j,_e){0!==j.length&&this.emit(UT.RemoteStreamRemove,j,_e)}},{key:"_addEventListeners",value:function _addEventListeners(j,_e){var _t=this;j.on(UT.SnapshotUpdated,(function(j){if(_t.logger.info("sceneId:".concat(_t.sceneId," snapshot updated")),_t._setInitialSnapshotSync(!0),!_t.localUser)return zE.shared.handleThrowableError(QE.RTE_ERR_LOCAL_USER_NOT_EXIST,new Error("local user not exist"));var _e=_t.localUser.toData();_t.dataStore.setUser(_t.localUser.userUuid,VT.fromData(_e));var St=Array.from(_t.dataStore.users.values()).filter((function(j){return j.userUuid!==_t.localUser.userUuid}));St.push(_e),St.length>0&&_t._handleUserAdded(St),_t._handleRoomPropertyChange(Array.from(_t.dataStore.roomProperties.keys()),_t.dataStore.roomProperties,{},{}),void 0!==j.roomState.total&&_t.emit(UT.UserCountUpdated,j.roomState.total)})),j.on(UT.ChatReceived,(function(j){_t.emit(UT.ChatReceived,j)})),j.on(UT.UserCountUpdated,(function(j){_t.emit(UT.UserCountUpdated,j)})),j.on(UT.UserAdded,(function(j){_t.logger.info("sceneId:".concat(_t.sceneId," user-added [").concat(j.join(","),"]")),_t._handleUserAdded(j)})),j.on(UT.UserUpdated,(function(j){_t.logger.info("sceneId:".concat(_t.sceneId," user-updated ").concat(j))})),j.on(UT.UserRemoved,(function(j,_e,St){_t.logger.info("sceneId:".concat(_t.sceneId," user-removed [").concat(j.join(","),"]")),_t._handleUserRemoved(j,_e,St)})),j.on(UT.RoomPropertyUpdated,(function(j,_e,St,Tt){_t.logger.info("sceneId:".concat(_t.sceneId," room-property-updated ").concat(fS(_e)," ").concat(fS(St)," ").concat(fS(Tt))),_t._handleRoomPropertyChange(j,_e,St,Tt)})),j.on(UT.UserPropertyUpdated,(function(j,_e,St,Tt){_t.logger.info("sceneId:".concat(_t.sceneId," user-property-updated ").concat(j," ").concat(fS(_e)," ").concat(fS(St)," ").concat(fS(Tt))),_t.emit(UT.UserPropertyUpdated,j,_e,St,Tt)})),j.on(UT.UserPropertyListUpdated,(function(j,_e,St,Tt){_t.logger.info("user-property-list-updated ".concat(fS(j)," ").concat(fS(_e)," ").concat(fS(St)," ").concat(fS(Tt))),_t.emit(UT.UserPropertyListUpdated,j,_e,St,Tt)})),j.on(UT.LocalStreamAdded,(function(j,_e){_t.logger.info("sceneId:".concat(_t.sceneId," local-stream-added [").concat(j.join(","),"]")),0!==j.length&&_t.emit(UT.LocalStreamAdded,j,_e)})),j.on(UT.LocalStreamUpdate,(function(j,_e){_t.logger.info("sceneId:".concat(_t.sceneId," local-stream-upsert [").concat(j.join(","),"]")),0!==j.length&&_t.emit(UT.LocalStreamUpdate,j,_e)})),j.on(UT.LocalStreamRemove,(function(j,_e){_t.logger.info("sceneId:".concat(_t.sceneId," local-stream-removed [").concat(j.join(","),"]")),0!==j.length&&_t.emit(UT.LocalStreamRemove,j,_e)})),j.on(UT.RemoteStreamAdded,(function(j,_e){_t.logger.info("sceneId:".concat(_t.sceneId," remote-stream-added [").concat(j.join(","),"]")),0!==j.length&&_t.emit(UT.RemoteStreamAdded,j,_e)})),j.on(UT.RemoteStreamUpdate,(function(j,_e){_t.logger.info("sceneId:".concat(_t.sceneId," remote-stream-upsert [").concat(j.join(","),"]")),0!==j.length&&_t.emit(UT.RemoteStreamUpdate,j,_e)})),j.on(UT.RemoteStreamRemove,(function(j,_e){_t.logger.info("sceneId:".concat(_t.sceneId," remote-stream-removed [").concat(j.join(","),"]")),0!==j.length&&_t.emit(UT.RemoteStreamRemove,j,_e)})),j.on(UT.TimeStampGapUpdate,(function(j){_t._timestampGap=j,_t.emit(UT.TimeStampGapUpdate,j)})),_e.on(UT.ChatUserMessage,(function(j){_t.emit(UT.ChatUserMessage,j)})),this._rtmManager.on("MessageFromPeer",(function(j){var St=j.message,Tt=j.peerId;if(_t.logger.info("peer message from [".concat(_t.sceneId,"]: ").concat(St,", peerId: ").concat(Tt)),"server"===Tt)try{var Ut=JSON.parse(St);_e.handlePeerMessage(Ut)}catch(j){_t.logger.error("".concat(j.message," original: ").concat(St))}})),this._stateSynchronizer.addMessageEventListeners(j)}},{key:"_handleRoomPropertyChange",value:function _handleRoomPropertyChange(j,_e,_t,St){this.emit(UT.RoomPropertyUpdated,j,_e.toObject(),_t,St)}},{key:"_handleRtmStateChange",value:function _handleRtmStateChange(j){this._recalculateRteState(j.reason)}}]),AgoraRteScene}(tR.EventEmitter),_applyDecoratedDescriptor(rO.prototype,"_handleRtmStateChange",[RS],Object.getOwnPropertyDescriptor(rO.prototype,"_handleRtmStateChange"),rO.prototype),tO=rO))||tO;!function(j){j[j.record=2]="record",j[j.beforeMixed=8]="beforeMixed"}(iO||(iO={}));var wO,OO=function(){function AgoraRteStreamPlayer(j){_classCallCheck(this,AgoraRteStreamPlayer),this._rtc=void 0,this._rtc=j}return _createClass(AgoraRteStreamPlayer,[{key:"setAudioRawDataConfig",value:function setAudioRawDataConfig(j){this._rtc.setAudioRawDataConfig(j,iO.beforeMixed)}},{key:"addAudioRawDataObserver",value:function addAudioRawDataObserver(j){this._rtc.addAudioRawDataObserver(j,iO.beforeMixed)}},{key:"removeAudioRawDataObserver",value:function removeAudioRawDataObserver(j){this._rtc.removeAudioRawDataObserver(j,iO.beforeMixed)}}]),AgoraRteStreamPlayer}();function control_createSuper(j){var _e=function control_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j.cameraListChanged="camera-list-changed",j.localAudioVolume="local-audio-volume",j.localAudioRecordingListChanged="local-audio-recording-list-changed",j.localVideoTrackChanged="local-video-track-changed",j.localAudioTrackChanged="local-audio-track-changed",j.trackStateChanged="track-state-changed",j.playbackDeviceListChanged="playback-device-list-changed",j.recordingDeviceListChanged="recording-device-list-changed",j.localAudioPlaybackVolumeIndicator="start-test-audio-playback-volume-indicator",j.audioPlaybackStateChanged="audio-playback-state-changed",j.localTrackBeforeDestroy="local-track-before-destroy",j.videoAutoPlayFailed="video-auto-play-failed"}(wO||(wO={}));var DO=function(j){_inherits(AgoraMediaControl,j);var _e=control_createSuper(AgoraMediaControl);function AgoraMediaControl(j){var _t;return _classCallCheck(this,AgoraMediaControl),(_t=_e.call(this))._camera=void 0,_t._microphone=void 0,_t._screen=void 0,_t._player=void 0,_t._rtc=void 0,_t._rtc=j,_t._addEventListener(j),_t}return _createClass(AgoraMediaControl,[{key:"camera",get:function get(){return this._camera}},{key:"microphone",get:function get(){return this._microphone}},{key:"screen",get:function get(){return this._screen}},{key:"player",get:function get(){return this._player}},{key:"_addEventListener",value:function _addEventListener(j){var _e=this;j.onAutoPlayFailed((function(){_e.emit(wO.videoAutoPlayFailed)})),j.getVideoDeviceManager().onLocalCameraListChanged((function(){for(var j=arguments.length,_t=new Array(j),St=0;St<j;St++)_t[St]=arguments[St];_e.emit.apply(_e,[wO.cameraListChanged].concat(_t))})),j.getAudioDeviceManager().onLocalRecordingDeviceListChanged((function(){for(var j=arguments.length,_t=new Array(j),St=0;St<j;St++)_t[St]=arguments[St];_e.emit.apply(_e,[wO.recordingDeviceListChanged].concat(_t))})),j.getAudioDeviceManager().onLocalPlaybackDeviceListChanged((function(){for(var j=arguments.length,_t=new Array(j),St=0;St<j;St++)_t[St]=arguments[St];_e.emit.apply(_e,[wO.playbackDeviceListChanged].concat(_t))})),j.getVideoDeviceManager().onLocalVideoTrackStateChanged((function(){for(var j=arguments.length,_t=new Array(j),St=0;St<j;St++)_t[St]=arguments[St];_e.emit.apply(_e,[wO.localVideoTrackChanged].concat(_t))})),j.getAudioDeviceManager().onLocalAudioTrackStateChanged((function(){for(var j=arguments.length,_t=new Array(j),St=0;St<j;St++)_t[St]=arguments[St];_e.emit.apply(_e,[wO.localAudioTrackChanged].concat(_t))})),j.getAudioDeviceManager().onLocalAudioVolume((function(j){_e.emit(wO.localAudioVolume,j)})),j.getAudioDeviceManager().onLocalAudioPlaybackTestVolumeChanged((function(j){_e.emit(wO.localAudioPlaybackVolumeIndicator,j)})),j.onLocalScreenShareTrackStateChanged((function(){for(var j=arguments.length,_t=new Array(j),St=0;St<j;St++)_t[St]=arguments[St];_e.emit.apply(_e,[wO.localVideoTrackChanged].concat(_t)),_e.emit.apply(_e,[wO.localAudioTrackChanged].concat(_t))}))}},{key:"createCameraVideoTrack",value:function createCameraVideoTrack(){return this._camera||(this._camera=new kR(this._rtc)),this._camera}},{key:"createMicrophoneAudioTrack",value:function createMicrophoneAudioTrack(){return this._microphone||(this._microphone=new OR(this._rtc)),this._microphone}},{key:"createScreenShareTrack",value:function createScreenShareTrack(){return this._screen||(this._screen=new DR(this._rtc)),this._screen}},{key:"createStreamPlayer",value:function createStreamPlayer(){return this._player||(this._player=new OO(this._rtc)),this._player}},{key:"getVideoCameraList",value:function getVideoCameraList(){return this._rtc.getVideoDeviceManager().getVideoCameraDevices()}},{key:"getAudioRecordingList",value:function getAudioRecordingList(){return this._rtc.getAudioDeviceManager().getAudioRecordingDevices()}},{key:"getAudioPlaybackList",value:function getAudioPlaybackList(){return this._rtc.getAudioDeviceManager().getAudioPlaybackDevices()}},{key:"isScreenDeviceEnumerateSupported",value:function isScreenDeviceEnumerateSupported(){return this._rtc.isScreenDeviceEnumerateSupported()}},{key:"hasScreenSharePermission",value:function hasScreenSharePermission(){return this._rtc.hasScreenSharePermission()}},{key:"getWindowDevices",value:function getWindowDevices(){return this._rtc.getWindowDevices()}},{key:"getDisplayDevices",value:function getDisplayDevices(){return this._rtc.getDisplayDevices()}},{key:"startAudioRecordingDeviceTest",value:function startAudioRecordingDeviceTest(j){return this._rtc.startAudioRecordingDeviceTest(j)}},{key:"stopAudioRecordingDeviceTest",value:function stopAudioRecordingDeviceTest(){return this._rtc.stopAudioRecordingDeviceTest()}},{key:"startAudioPlaybackDeviceTest",value:function startAudioPlaybackDeviceTest(j){return this._rtc.startAudioPlaybackDeviceTest(j)}},{key:"stopAudioPlaybackDeviceTest",value:function stopAudioPlaybackDeviceTest(){return this._rtc.stopAudioPlaybackDeviceTest()}},{key:"setBeautyEffectOptions",value:function setBeautyEffectOptions(j,_e){return this._rtc.setBeautyEffectOptions(j,_e)}},{key:"createStreamMediaTrack",value:function createStreamMediaTrack(){return new RR(this._rtc)}},{key:"takeSnapshot",value:function takeSnapshot(j,_e,_t){return this._rtc.takeSnapshot(j,_e,_t)}},{key:"getCurrentFrameData",value:function getCurrentFrameData(j,_e,_t){return this._rtc.getCurrentFrameData(j,_e,_t)}}]),AgoraMediaControl}(_a);__webpack_require__(1058);function base_createSuper(j){var _e=function base_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var LO=function(j){_inherits(RtcVideoDeviceManagerBase,j);var _e=base_createSuper(RtcVideoDeviceManagerBase);function RtcVideoDeviceManagerBase(){return _classCallCheck(this,RtcVideoDeviceManagerBase),_e.apply(this,arguments)}return _createClass(RtcVideoDeviceManagerBase)}(_a),NO=function(j){_inherits(RtcAudioDeviceManagerBase,j);var _e=base_createSuper(RtcAudioDeviceManagerBase);function RtcAudioDeviceManagerBase(){return _classCallCheck(this,RtcAudioDeviceManagerBase),_e.apply(this,arguments)}return _createClass(RtcAudioDeviceManagerBase)}(_a),PO=function(j){_inherits(RtcChannelAdapterBase,j);var _e=base_createSuper(RtcChannelAdapterBase);function RtcChannelAdapterBase(){return _classCallCheck(this,RtcChannelAdapterBase),_e.apply(this,arguments)}return _createClass(RtcChannelAdapterBase)}(_a),BO=function(j){_inherits(RtcAdapterBase,j);var _e=base_createSuper(RtcAdapterBase);function RtcAdapterBase(){return _classCallCheck(this,RtcAdapterBase),_e.apply(this,arguments)}return _createClass(RtcAdapterBase,null,[{key:"getRtcVersion",value:function getRtcVersion(){return""}}]),RtcAdapterBase}(_a);function device_createSuper(j){var _e=function device_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var UO,QO=function(j){_inherits(RtcVideoDeviceManagerElectron,j);var _e=device_createSuper(RtcVideoDeviceManagerElectron);function RtcVideoDeviceManagerElectron(j){var _t;return _classCallCheck(this,RtcVideoDeviceManagerElectron),(_t=_e.call(this)).adapter=j,_t._deviceInfo=new Map,_t._deviceIds=new Set,_t._initializeDeviceList(),_t}return _createClass(RtcVideoDeviceManagerElectron,[{key:"onLocalVideoTrackStateChanged",value:function onLocalVideoTrackStateChanged(j){return this.adapter.onLocalVideoTrackStateChanged(j),0}},{key:"onLocalCameraListChanged",value:function onLocalCameraListChanged(j){return this.on(wO.cameraListChanged,j),0}},{key:"getVideoCameraDevices",value:function getVideoCameraDevices(){return this.cameraList}},{key:"cameraList",get:function get(){var j=this,_e=[];return this._deviceIds.forEach((function(_t){var St=j._deviceInfo.get(_t);St&&_e.push({deviceid:St.deviceid,devicename:St.devicename})})),_e}},{key:"_emitCameraListChanged",value:function _emitCameraListChanged(j,_e,_t){this.emit(wO.cameraListChanged,j,_e,_t)}},{key:"_initializeDeviceList",value:function _initializeDeviceList(){var j=this;this.fetchDeviceList(),this.adapter.rtcEngine.on("videoDeviceStateChanged",(function(){j.fetchDeviceList()}))}},{key:"fetchDeviceList",value:function fetchDeviceList(){var j=this,_e=this.adapter.rtcEngine.getVideoDevices(),_t=[];this._deviceIds.clear(),this._deviceInfo.clear(),_e.forEach((function(_e){j._deviceInfo.set(_e.deviceid,_e),j._deviceIds.add(_e.deviceid),_t.push(_e)})),this._emitCameraListChanged(!0,_t,this.cameraList)}}]),RtcVideoDeviceManagerElectron}(LO),KO=function(j){_inherits(RtcAudioDeviceManagerElectron,j);var _e=device_createSuper(RtcAudioDeviceManagerElectron);function RtcAudioDeviceManagerElectron(j){var _t;return _classCallCheck(this,RtcAudioDeviceManagerElectron),(_t=_e.call(this)).adapter=j,_t._recordingDeviceInfo=new Map,_t._recordingDeviceIds=new Set,_t._playbackDeviceInfo=new Map,_t._playbackDeviceIds=new Set,_t._initializeDeviceList(),_t}return _createClass(RtcAudioDeviceManagerElectron,[{key:"_initializeDeviceList",value:function _initializeDeviceList(){var j=this;this._fetchRecordingDeviceList(),this._fetchPlaybackDeviceList(),this.adapter.rtcEngine.on("audioDeviceStateChanged",(function(){j._fetchRecordingDeviceList(),j._fetchPlaybackDeviceList()}))}},{key:"onLocalAudioPlaybackTestVolumeChanged",value:function onLocalAudioPlaybackTestVolumeChanged(j){return this.adapter.onLocalAudioPlaybackTestVolumeChanged(j)}},{key:"onLocalAudioTrackStateChanged",value:function onLocalAudioTrackStateChanged(j){return this.adapter.onLocalAudioTrackStateChanged(j)}},{key:"onLocalAudioVolume",value:function onLocalAudioVolume(j){return this.adapter.onLocalAudioVolume(j)}},{key:"onLocalRecordingDeviceListChanged",value:function onLocalRecordingDeviceListChanged(j){return this.on(wO.recordingDeviceListChanged,j),0}},{key:"onLocalPlaybackDeviceListChanged",value:function onLocalPlaybackDeviceListChanged(j){return this.on(wO.playbackDeviceListChanged,j),0}},{key:"getAudioPlaybackDevices",value:function getAudioPlaybackDevices(){return this.speakerList}},{key:"getAudioRecordingDevices",value:function getAudioRecordingDevices(){return this.microphoneList}},{key:"microphoneList",get:function get(){var j=this,_e=[];return this._recordingDeviceIds.forEach((function(_t){var St=j._recordingDeviceInfo.get(_t);St&&_e.push({deviceid:St.deviceid,devicename:St.devicename})})),_e}},{key:"speakerList",get:function get(){var j=this,_e=[];return this._playbackDeviceIds.forEach((function(_t){var St=j._playbackDeviceInfo.get(_t);St&&_e.push({deviceid:St.deviceid,devicename:St.devicename})})),_e}},{key:"_emitPlaybackListChanged",value:function _emitPlaybackListChanged(j,_e,_t){this.emit(wO.playbackDeviceListChanged,j,_e,_t)}},{key:"_emitRecordingListChanged",value:function _emitRecordingListChanged(j,_e,_t){this.emit(wO.recordingDeviceListChanged,j,_e,_t)}},{key:"_fetchPlaybackDeviceList",value:function _fetchPlaybackDeviceList(){var j=this,_e=this.adapter.rtcEngine.getAudioPlaybackDevices(),_t=[];this._playbackDeviceInfo.clear(),this._playbackDeviceIds.clear(),_e.forEach((function(_e){j._playbackDeviceInfo.set(_e.deviceid,_e),j._playbackDeviceIds.add(_e.deviceid),_t.push(_e)})),this._emitPlaybackListChanged(!0,_t,this.speakerList)}},{key:"_fetchRecordingDeviceList",value:function _fetchRecordingDeviceList(){var j=this,_e=this.adapter.rtcEngine.getAudioRecordingDevices(),_t=[];this._recordingDeviceInfo.clear(),this._recordingDeviceIds.clear(),_e.forEach((function(_e){j._recordingDeviceInfo.set(_e.deviceid,_e),j._recordingDeviceIds.add(_e.deviceid),_t.push(_e)})),this._emitRecordingListChanged(!0,_t,this.microphoneList)}}]),RtcAudioDeviceManagerElectron}(NO),HO=function(){function QualityCalc(){_classCallCheck(this,QualityCalc),this.quality=xR.good,this.qualities=[]}return _createClass(QualityCalc,[{key:"_updateQualities",value:function _updateQualities(j){this.qualities.push(j),this.qualities.length>QualityCalc.MAX_QUALITY_NUMBER&&this.qualities.shift()}},{key:"_resetQualities",value:function _resetQualities(){this.qualities=[]}},{key:"toAGQuality",value:function toAGQuality(j){return void 0===j?this.quality:0===j||8===j||7===j?(this._resetQualities(),this.quality):6===j?(this._resetQualities(),this.quality=xR.down,this.quality):(this._updateQualities(j),this.qualities.length<QualityCalc.MAX_QUALITY_NUMBER||(this.qualities.reduce((function(j,_e){return j+_e}))>=QualityCalc.QUALITY_THRESHOLD?this.quality=xR.bad:this.quality=xR.good),this.quality)}}]),QualityCalc}();HO.MAX_QUALITY_NUMBER=3,HO.QUALITY_THRESHOLD=10;var zO=TS.attach({proxyMethods:!1})(UO=function(){function RtcNetworkQualityElectron(){_classCallCheck(this,RtcNetworkQualityElectron),this.logger=void 0,this.rtt=void 0,this.downlinkNetworkQuality=0,this.uplinkNetworkQuality=0,this.end2EndDelay=0,this.txVideoPacketLoss=0,this.rxVideoPacketLoss=0,this.cpu=-1,this.cpuTotal=-1,this._downlinkNetworkQualityClacInstance=new HO,this._uplinkNetworkQualityClacInstance=new HO}return _createClass(RtcNetworkQualityElectron,[{key:"networkStats",value:function networkStats(){var networkStats={packetLoss:Math.max(this.txVideoPacketLoss,this.rxVideoPacketLoss),cpu:this.cpu,cpuTotal:this.cpuTotal,delay:this.end2EndDelay,downlinkNetworkQuality:this._downlinkNetworkQualityClacInstance.toAGQuality(this.downlinkNetworkQuality),uplinkNetworkQuality:this._uplinkNetworkQualityClacInstance.toAGQuality(this.downlinkNetworkQuality)};return networkStats}}]),RtcNetworkQualityElectron}())||UO;function thread_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */thread_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function thread_createSuper(j){var _e=function thread_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var JO,XO=function(j){_inherits(AgoraRteThread,j);var _e,_t=thread_createSuper(AgoraRteThread);function AgoraRteThread(){var j;_classCallCheck(this,AgoraRteThread);for(var _e=arguments.length,St=new Array(_e),Tt=0;Tt<_e;Tt++)St[Tt]=arguments[Tt];return(j=_t.call.apply(_t,[this].concat(St)))._dirty=!1,j._dirtyTimer=void 0,j.logger=void 0,j.running=!1,j.runnable=!0,j}return _createClass(AgoraRteThread,[{key:"run",value:function run(){var j=this;!this.running&&this.runnable?(this.running=!0,this._dirtyTimer=setTimeout(_asyncToGenerator(thread_regeneratorRuntime().mark((function _callee(){return thread_regeneratorRuntime().wrap((function _callee$(_e){for(;;)switch(_e.prev=_e.next){case 0:return j._dirty=!1,j._dirtyTimer&&clearTimeout(j._dirtyTimer),_e.next=4,j.onExecution();case 4:j.running=!1,j._dirty&&(j.logger.info("thread state is dirty, rerun"),j.run());case 6:case"end":return _e.stop()}}),_callee)}))),0)):this._dirty=!0}},{key:"onExecution",value:(_e=_asyncToGenerator(thread_regeneratorRuntime().mark((function _callee2(){return thread_regeneratorRuntime().wrap((function _callee2$(j){for(;;)switch(j.prev=j.next){case 0:case"end":return j.stop()}}),_callee2)}))),function onExecution(){return _e.apply(this,arguments)})},{key:"stop",value:function stop(){this.running=!1}}]),AgoraRteThread}(_a);function electron_thread_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */electron_thread_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function electron_thread_createSuper(j){var _e=function electron_thread_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var $O,rD,sD,uD=TS.attach({proxyMethods:!1})(JO=function(j){_inherits(AgoraRteElectronCameraThread,j);var _e,_t=electron_thread_createSuper(AgoraRteElectronCameraThread);function AgoraRteElectronCameraThread(j){var _e;return _classCallCheck(this,AgoraRteElectronCameraThread),(_e=_t.call(this)).logger=void 0,_e.canvas=void 0,_e.trackState=NR.stopped,_e.cameraEnable=!1,_e._rtcEngine=void 0,_e.currentCanvas=void 0,_e.videoStreamState=0,_e._rtcEngine=j.rtcEngine,_e}return _createClass(AgoraRteElectronCameraThread,[{key:"setCameraTrackState",value:function setCameraTrackState(j,_e){this.trackState!==j&&(this.trackState=j,this.emit(wO.trackStateChanged,j,bR.Camera,_e))}},{key:"onExecution",value:(_e=_asyncToGenerator(electron_thread_regeneratorRuntime().mark((function _callee2(){var j,_e=this;return electron_thread_regeneratorRuntime().wrap((function _callee2$(_t){for(;;)switch(_t.prev=_t.next){case 0:if(this.logger.debug("thread notify start..."),!this.cameraEnable){_t.next=17;break}if(0!==(j=this.videoStreamState)&&3!==j){_t.next=10;break}return _t.delegateYield(electron_thread_regeneratorRuntime().mark((function _callee(){var _t,St,Tt;return electron_thread_regeneratorRuntime().wrap((function _callee$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(_e.logger.info("starting camera..."),_e.setCameraTrackState(NR.starting),_t=void 0,St=void 0,Ut.prev=4,0!==j){Ut.next=14;break}return Ut.next=8,new Promise((function(j){_t=function cameraStateChangeCallback(_e){1!==_e&&2!==_e||j(1)},St=function roleChangeCallback(_e,_t){2===_t&&j(0)},_e._rtcEngine.on("localVideoStateChanged",_t),_e._rtcEngine.on("clientRoleChanged",St),_e._rtcEngine.enableLocalVideo(!0);var Tt=KS.shared.rtcConfigs.defaultCameraEncoderConfigurations,Ut=Tt?{width:Tt.width,height:Tt.height,frameRate:Tt.frameRate,bitrate:Tt.bitrate,minFrameRate:0,orientationMode:0,minBitrate:0,mirrorMode:0,degradationPreference:1}:void 0;Ut&&(_e._rtcEngine.setVideoEncoderConfiguration(Ut),_e._rtcEngine.setVideoRenderFPS(Ut.frameRate))}));case 8:if(Tt=Ut.sent,_t&&_e._rtcEngine.off("localVideoStateChanged",_t),St&&_e._rtcEngine.off("clientRoleChanged",St),Tt){Ut.next=14;break}return _e.logger.info("camera not started."),Ut.abrupt("return","break");case 14:_e.setCameraTrackState(NR.started),_e.logger.info("camera started."),Ut.next=24;break;case 18:return Ut.prev=18,Ut.t0=Ut.catch(4),_e.setCameraTrackState(NR.error),_t&&_e._rtcEngine.off("localVideoStateChanged",_t),St&&_e._rtcEngine.off("clientRoleChanged",St),Ut.abrupt("return","break");case 24:case"end":return Ut.stop()}}),_callee,null,[[4,18]])}))(),"t0",5);case 5:if("break"!==_t.t0){_t.next=8;break}return _t.abrupt("break",23);case 8:_t.next=11;break;case 10:this.trackState!==NR.started&&this.setCameraTrackState(NR.started);case 11:if(this.trackState!==NR.started){_t.next=15;break}return(!this.currentCanvas&&this.canvas||this.currentCanvas&&this.canvas&&this.canvas.view!==this.currentCanvas.view)&&(this._rtcEngine.setupLocalVideo(this.canvas.view),this.currentCanvas=this.canvas),this.currentCanvas&&this.currentCanvas.view,_t.abrupt("break",23);case 15:_t.next=20;break;case 17:if(this.trackState!==NR.stopped&&(this.logger.info("stopping camera..."),this._rtcEngine.enableLocalVideo(!1),this.currentCanvas&&this.currentCanvas.view,this.setCameraTrackState(NR.stopped),this.logger.info("camera stopped")),this.trackState!==NR.stopped){_t.next=20;break}return _t.abrupt("break",23);case 20:return _t.next=22,new Promise((function(j){return setTimeout(j,500)}));case 22:if(this.running){_t.next=0;break}case 23:this.logger.debug("thread sleep...");case 24:case"end":return _t.stop()}}),_callee2,this)}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRteElectronCameraThread}(XO))||JO;function electron_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */electron_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function electron_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function electron_createSuper(j){var _e=function electron_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var pD=_createClass((function A(){_classCallCheck(this,A)}));try{pD=__webpack_require__(5455).default}catch(j){KS.platform===FS.Electron&&ME.warn("load electron sdk failed: ".concat(j))}var AD=TS.attach({proxyMethods:!1})((rD=function(j){_inherits(RtcAdapterElectron,j);var _e=electron_createSuper(RtcAdapterElectron);function RtcAdapterElectron(){var j;_classCallCheck(this,RtcAdapterElectron),(j=_e.call(this)).logger=void 0,j._vdm=void 0,j._adm=void 0,j._engine=void 0,j._channels=new Map,j._configs={},j._screenEventBus=new _a,j.cameraThread=void 0,j._localVideoEnabled=!1,j._localAudioEnabled=!1,j.screenShareId=void 0,j.screenShareType=void 0,j.screenShareWithAudio=void 0,j.screenShareAudioDeviceName=void 0,RtcAdapterElectron.rtcEngine||(RtcAdapterElectron.rtcEngine=new pD),j._engine=RtcAdapterElectron.rtcEngine;var _t=RtcAdapterElectron.logPath,St=0;_t?(ME.info("sdk log path: ".concat(_t)),St=j.rtcEngine.initialize(KS.shared.appId,j._region,{filePath:_t,fileSize:1024,level:RtcAdapterElectron.getLogLevel()})):(ME.warn("no log path found, sdk logs will be put in default folder"),St=j.rtcEngine.initialize(KS.shared.appId,j._region));var Tt=KS.shared.rtcConfigs.defaultRemoteVideoStreamType;return void 0!==Tt&&j.rtcEngine.setRemoteDefaultVideoStreamType(Tt),j.rtcEngine.registerMediaMetadataObserver(),0!==St&&zE.shared.handleThrowableError(QE.RTC_ERR_RTC_ENGINE_INITIALZIE_FAILED,new Error("rtc engine initialize failed ".concat(St))),KS.shared.rtcSDKParameters&&KS.shared.rtcSDKParameters.forEach((function(_e){j.rtcEngine.setParameters(JSON.stringify(_e))})),j._adm=new KO(_assertThisInitialized(j)),j._vdm=new QO(_assertThisInitialized(j)),j.cameraThread=new uD(_assertThisInitialized(j)),j._addEventListeners(),j}return _createClass(RtcAdapterElectron,[{key:"configs",get:function get(){return function electron_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?electron_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):electron_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}({},this._configs)}},{key:"rtcEngine",get:function get(){return this._engine}},{key:"channelProfile",get:function get(){var j;return null!==(j=KS.shared.rtcConfigs.channelProfile)&&void 0!==j?j:TE.LiveBroadcasting}},{key:"latencyLevel",get:function get(){var j;return(j={},_defineProperty(j,qS.Low,1),_defineProperty(j,qS.UltraLow,2),j)[KS.shared.latencyLevel]}},{key:"createRtcChannel",value:function createRtcChannel(j,_e){var _t=this._channels.get(j);return _t||(_t=new ED(j,this.configs,_e),this._channels.set(j,_t)),_t}},{key:"getVideoDeviceManager",value:function getVideoDeviceManager(){return this._vdm}},{key:"getAudioDeviceManager",value:function getAudioDeviceManager(){return this._adm}},{key:"getWindowDevices",value:function getWindowDevices(){var j=this;return new Promise((function(_e){j.rtcEngine.getScreenWindowsInfo((function(j){_e(j.map((function(j){return{id:j.windowId,type:BR.Window,title:j.name||j.ownerName,image:j.image,isCurrent:"".concat(j.processId)===window.main_pid}})))}))}))}},{key:"getDiaplayDevices",value:function getDiaplayDevices(){var j=this;return new Promise((function(_e){j.rtcEngine.getScreenDisplaysInfo((function(j){_e(j.map((function(j){return{id:j.displayId.id,type:BR.Screen,title:"Display",image:j.image}})))}))}))}},{key:"isScreenDeviceEnumerateSupported",value:function isScreenDeviceEnumerateSupported(){return!0}},{key:"setVideoCameraDevice",value:function setVideoCameraDevice(j){return this.rtcEngine.setVideoDevice(j)}},{key:"setAudioRecordingDevice",value:function setAudioRecordingDevice(j){return this.rtcEngine.setAudioRecordingDevice(j)}},{key:"setAudioPlaybackDevice",value:function setAudioPlaybackDevice(j){return this.rtcEngine.setAudioPlaybackDevice(j)}},{key:"enableLocalVideo",value:function enableLocalVideo(j){return this._localVideoEnabled=j,this.cameraThread.cameraEnable=j,this.cameraThread.run(),0}},{key:"enableLocalAudio",value:function enableLocalAudio(j){return this._localAudioEnabled=j,this.rtcEngine.enableLocalAudio(j)}},{key:"restoreAVState",value:function restoreAVState(){this._localVideoEnabled&&(this.logger.info("rtc role changed to audience, re-enabling local camera..."),this.enableLocalVideo(!0),this.logger.info("re-enabled local camera")),this._localAudioEnabled&&(this.logger.info("rtc role changed to audience, re-enabling local microphone..."),this.enableLocalAudio(!0),this.logger.info("re-enabled local microphone"))}},{key:"setupLocalVideo",value:function setupLocalVideo(j,_e){return _e===bR.Camera?(this.cameraThread.canvas=j,this.cameraThread.run()):_e===bR.ScreenShare&&this.rtcEngine.videoSourceSetupLocalVideo(j.view),0}},{key:"setupRemoteVideo",value:function setupRemoteVideo(j){return this.rtcEngine.setupRemoteVideo(+j.streamUuid,j.view),this.rtcEngine.setupViewContentMode(+j.streamUuid,j.renderMode===UR.fill?0:1,void 0),0}},{key:"startAudioRecordingDeviceTest",value:function startAudioRecordingDeviceTest(j){return this.rtcEngine.startAudioRecordingDeviceTest(j)}},{key:"stopAudioRecordingDeviceTest",value:function stopAudioRecordingDeviceTest(){return this.rtcEngine.stopAudioRecordingDeviceTest()}},{key:"startAudioPlaybackDeviceTest",value:function startAudioPlaybackDeviceTest(j){return this.rtcEngine.startAudioPlaybackDeviceTest(j)}},{key:"stopAudioPlaybackDeviceTest",value:function stopAudioPlaybackDeviceTest(){return this.rtcEngine.stopAudioPlaybackDeviceTest()}},{key:"startScreenCapture",value:function startScreenCapture(j){if(this.rtcEngine.videoSourceInitialize(KS.shared.appId),void 0!==(null==j?void 0:j.id)){var _e=j.id,_t=j.type,St=j.withAudio,Tt=j.audioDeviceName;this.screenShareId=_e,this.screenShareType=_t,this.screenShareWithAudio=St,this.screenShareAudioDeviceName=Tt,this._screenEventBus.emit(wO.trackStateChanged,NR.started,bR.ScreenShare,void 0,St)}return 0}},{key:"stopScreenCapture",value:function stopScreenCapture(){return this.screenShareWithAudio&&this.rtcEngine.enableLoopbackRecording(!1,this.screenShareAudioDeviceName),this.rtcEngine.videoSourceStopScreenCapture(),this.screenShareId=void 0,this.screenShareType=void 0,this.screenShareWithAudio=void 0,this.screenShareAudioDeviceName=void 0,this._screenEventBus.emit(wO.trackStateChanged,NR.stopped,bR.ScreenShare),0}},{key:"onAutoplayFailed",value:function onAutoplayFailed(){return this.logger.warn("electron platform does not support onAutoplayFailed"),0}},{key:"onLocalAudioPlaybackTestVolumeChanged",value:function onLocalAudioPlaybackTestVolumeChanged(j){return this.on(wO.localAudioPlaybackVolumeIndicator,j),0}},{key:"onLocalVideoTrackStateChanged",value:function onLocalVideoTrackStateChanged(j){return this.cameraThread.on(wO.trackStateChanged,j),0}},{key:"onLocalAudioTrackStateChanged",value:function onLocalAudioTrackStateChanged(j){return this.on(wO.localAudioTrackChanged,j),0}},{key:"onLocalAudioVolume",value:function onLocalAudioVolume(j){return this.on(wO.localAudioVolume,j),0}},{key:"onLocalScreenShareTrackStateChanged",value:function onLocalScreenShareTrackStateChanged(j){return this._screenEventBus.on(wO.trackStateChanged,j),0}},{key:"setBeautyEffectOptions",value:function setBeautyEffectOptions(j,_e){return this.rtcEngine.setBeautyEffectOptions(j,_e)}},{key:"hasScreenSharePermission",value:function hasScreenSharePermission(){return!RtcAdapterElectron.remote||"denied"!==RtcAdapterElectron.remote.systemPreferences.getMediaAccessStatus("screen")}},{key:"setAudioRawDataConfig",value:function setAudioRawDataConfig(j,_e){return this.logger.warn("electron platform does not support setAudioRawDataConfig for now"),1}},{key:"addAudioRawDataObserver",value:function addAudioRawDataObserver(j){return this.logger.warn("electron platform does not support addAudioRawDataObserver for now"),1}},{key:"removeAudioRawDataObserver",value:function removeAudioRawDataObserver(j){return this.logger.warn("electron platform does not support removeAudioRawDataObserver for now"),1}},{key:"takeSnapshot",value:function takeSnapshot(j,_e,_t){var St=this;return new Promise((function(Tt,Ut){St.rtcEngine.once("snapshotTaken",(function(j,_e,_t,St,Ut,_r){Tt({channel:j,uid:_e,filePath:_t,width:St,height:Ut,errCode:_r})})),0!==St.rtcEngine.takeSnapshot(j,_e,_t)&&Ut()}))}},{key:"getCurrentFrameData",value:function getCurrentFrameData(j,_e,_t){return this.logger.warn("electron platform does not support this"),new ImageData(1,1)}},{key:"addCameraProcessors",value:function addCameraProcessors(j){return this.logger.warn("electron platform does not support add camera processors"),0}},{key:"removeCameraProcessors",value:function removeCameraProcessors(){return this.logger.warn("electron platform does not support remove camera processors"),0}},{key:"addMicrophoneProcessors",value:function addMicrophoneProcessors(j){return this.logger.warn("electron platform does not support add microphone processors"),0}},{key:"removeMicrophoneProcessors",value:function removeMicrophoneProcessors(){return this.logger.warn("electron platform does not support remove microphone processors"),0}},{key:"destroy",value:function destroy(){this._channels.forEach((function(j){j.leave()})),this._channels.clear();var j=this.rtcEngine.release();return RtcAdapterElectron.rtcEngine=void 0,j}},{key:"_region",get:function get(){switch(KS.shared.rtcRegion){case VS.AREA_GLOBAL:return 4294967295;case VS.AREA_CN:return 1;case VS.AREA_NA:return 2;case VS.AREA_EUR:return 4;case VS.AREA_AS:return 8;case VS.AREA_JAPAN:return 16;case VS.AREA_INDIA:return 32}}},{key:"_addEventListeners",value:function _addEventListeners(){var j=this;this.rtcEngine.on("clientRoleChanged",(function(_e,_t){2===_t&&j.restoreAVState()})),this.rtcEngine.on("localVideoStateChanged",(function(_e,_t){j.logger.info("[rtc] video state changed ".concat(_e," ").concat(_t)),j.cameraThread.videoStreamState=_e})),this.rtcEngine.on("localAudioStateChanged",(function(_e){0===_e&&j.emit(wO.localAudioTrackChanged,NR.stopped,ER.Mic),2!==_e&&1!==_e||j.emit(wO.localAudioTrackChanged,NR.started,ER.Mic)})),this.rtcEngine.on("groupAudioVolumeIndication",(function(_e){var _t=_e.find((function(j){return 0===j.uid})),St=_e.find((function(j){return 1===j.uid}));_t&&j.emit(wO.localAudioVolume,_t.volume/255),St&&j.emit(wO.localAudioPlaybackVolumeIndicator,St.volume/255)}))}}],[{key:"remote",get:function get(){var j=window.require("electron").remote;if(j)return j;ME.warn("enableRemoteModule is not set, we will not be able to tell you screenshare access status in this case. You can still use screenshare feature though")}},{key:"getLogLevel",value:function getLogLevel(){switch(KS.logLevel){case SE.DEBUG:case SE.INFO:return 1;case SE.WARN:return 2;case SE.ERROR:return 4;default:return 0}}},{key:"getRtcVersion",value:function getRtcVersion(){if(!this.version){var j=this.rtcEngine;j||(j=new pD),this.version=j.getVersion(),this.rtcEngine||j.release()}var _e=this.version,_t=_e.version,St=_e.build;return"".concat(_t,".").concat(St)}},{key:"logBasePath",get:function get(){if(RtcAdapterElectron.remote)return RtcAdapterElectron.remote.app.getPath("logs")}},{key:"logFolderPath",get:function get(){if(this.logBasePath)return window.require("path").resolve(this.logBasePath,"logs")}},{key:"logPath",get:function get(){var j=this.logFolderPath;if(j)return window.require("path").resolve(j,"sdk.log")}}]),RtcAdapterElectron}(BO),rD.rtcEngine=void 0,rD.version=void 0,$O=rD))||$O,ED=TS.attach({proxyMethods:!1})(sD=function(j){_inherits(RtcChannelAdapterElectron,j);var _e=electron_createSuper(RtcChannelAdapterElectron);function RtcChannelAdapterElectron(j,_t,St){var Tt;return _classCallCheck(this,RtcChannelAdapterElectron),(Tt=_e.call(this)).logger=void 0,Tt.channelName=void 0,Tt.uid=void 0,Tt.base=void 0,Tt._muteLocalVideo=!0,Tt._muteLocalAudio=!0,Tt._metaTask=void 0,Tt._networkStats=new zO,Tt.channelName=j,Tt.base=St,_R.addPollingTask((function(){Tt.emit(UT.NetworkStats,Tt._networkStats.networkStats())}),pR.second(2)),Tt._addEventListeners(),Tt}return _createClass(RtcChannelAdapterElectron,[{key:"getSessionId",value:function getSessionId(){return this.base.rtcEngine.getCallId()}},{key:"setLatencyLevel",value:function setLatencyLevel(j){this.logger.info("set client role to audience and audience level to",j),this.base.rtcEngine.setClientRoleWithOptions(2,{audienceLatencyLevel:j})}},{key:"muteRemoteVideoMass",value:function muteRemoteVideoMass(j,_e){return Promise.resolve(j)}},{key:"enableDualStream",value:function enableDualStream(j){return 0===this.base.rtcEngine.enableDualStreamMode(j)?Promise.resolve():Promise.reject()}},{key:"setLowStreamParameter",value:function setLowStreamParameter(j){var _e={"che.video.lowBitRateStreamParameter":{width:j.width,height:j.height,frameRate:j.frameRate,bitRate:j.bitrate}};return this.base.rtcEngine.setParameters(JSON.stringify(_e))}},{key:"getCurrentFrameData",value:function getCurrentFrameData(j){return this.logger.warn("electron platform does not support this"),new ImageData(1,1)}},{key:"setRemoteVideoStreamType",value:function setRemoteVideoStreamType(j,_e){return 0===this.base.rtcEngine.setRemoteVideoStreamType(+j,_e)?Promise.resolve():Promise.reject()}},{key:"onConnectionStateChanged",value:function onConnectionStateChanged(j){return this.on(UT.RtcConnectionStateChanged,j),0}},{key:"leave",value:function leave(j){return(null!=j?j:TR.main)===TR.main?this.base.rtcEngine.leaveChannel():this.base.rtcEngine.videoSourceLeave(),Promise.resolve()}},{key:"onNetworkStats",value:function onNetworkStats(j){return this.on(UT.NetworkStats,j),0}},{key:"onAudioVolumeIndication",value:function onAudioVolumeIndication(j){return this.on(UT.AudioVolumes,j),0}},{key:"muteRemoteVideo",value:function muteRemoteVideo(j,_e){return this.base.rtcEngine.muteRemoteVideoStream(+j,_e)}},{key:"muteRemoteAudio",value:function muteRemoteAudio(j,_e){return this.base.rtcEngine.muteRemoteAudioStream(+j,_e)}},{key:"_startScreenCapture",value:function _startScreenCapture(){var j,_e,_t,St,Tt=this.base.screenShareType,Ut=this.base.screenShareId,_r=this.base.screenShareWithAudio,_n=this.base.screenShareAudioDeviceName;if(void 0!==Ut&&void 0!==Tt){var _i=KS.shared.rtcConfigs.defaultScreenEncoderConfigurations,Ei={width:null!==(j=null==_i?void 0:_i.width)&&void 0!==j?j:0,height:null!==(_e=null==_i?void 0:_i.height)&&void 0!==_e?_e:0,frameRate:null!==(_t=null==_i?void 0:_i.frameRate)&&void 0!==_t?_t:10,bitrate:null!==(St=null==_i?void 0:_i.bitrate)&&void 0!==St?St:0,captureMouseCursor:!0,windowFocus:!0,excludeWindowCount:0,excludeWindowList:[],highLightWidth:0,highLightColor:0,enableHighLight:!1},Ci={width:0,height:0,x:0,y:0};if(Tt===BR.Screen){var Di="darwin"===process.platform?{id:parseInt(Ut),width:0,height:0,x:0,y:0}:{width:0,height:0,x:0,y:0};this.base.rtcEngine.videoSourceStartScreenCaptureByScreen(Di,Ci,Ei)}else Tt===BR.Window&&this.base.rtcEngine.videoSourceStartScreenCaptureByWindow(Ut,Ci,Ei);_r&&this.base.rtcEngine.enableLoopbackRecording(!0,_n)}}},{key:"join",value:function join(j,_e,_t){var St=this;return new Promise((function(Tt,Ut){var _r=St.base.rtcEngine;if(_t===TR.main)_r.once("joinedChannel",(function(){Tt()})),_r.setChannelProfile(St.base.channelProfile),_r.enableAudioVolumeIndication(500,3),_r.joinChannel(j,St.channelName,"",+_e,{autoSubscribeAudio:!1,autoSubscribeVideo:!1,publishLocalAudio:!1,publishLocalVideo:!1}),St.uid=+_e;else if(_t===TR.sub){_r.once("videoSourceJoinedSuccess",(function(){St._startScreenCapture(),Tt()})),_r.videoSourceSetChannelProfile(St.base.channelProfile);var _n=_r.videoSourceJoin(j,St.channelName,"",+_e,{autoSubscribeAudio:!1,autoSubscribeVideo:!1,publishLocalAudio:!0,publishLocalVideo:!0});St.logger.info("[rtc] videosource join ".concat(_n))}}))}},{key:"muteLocalVideo",value:function muteLocalVideo(j,_e){var _t=this.base.rtcEngine;this._updateRole({video:j,audio:this._muteLocalAudio});var St=_t.muteLocalVideoStream(j);return 0===St&&(this._muteLocalVideo=j),St}},{key:"muteLocalAudio",value:function muteLocalAudio(j,_e){var _t=this.base.rtcEngine;this._updateRole({video:this._muteLocalVideo,audio:j});var St=_t.muteLocalAudioStream(j);return 0===St&&(this._muteLocalAudio=j),St}},{key:"muteLocalScreenShare",value:function muteLocalScreenShare(j,_e){return this.base.rtcEngine.videoSourceMuteLocalVideoStream(j)}},{key:"_updateRole",value:function _updateRole(j){var _e;(null!==(_e=KS.shared.rtcConfigs.channelProfile)&&void 0!==_e?_e:TE.LiveBroadcasting)===TE.LiveBroadcasting&&(j.video&&j.audio?(this.logger.info("update rtc role to audience, latency level: ".concat(this.base.latencyLevel)),this.base.rtcEngine.setClientRoleWithOptions(2,{audienceLatencyLevel:this.base.latencyLevel}),this.base.restoreAVState()):(this.logger.info("update rtc role to host"),this.base.rtcEngine.setClientRole(1)))}},{key:"_getRtcState",value:function _getRtcState(j){switch(j){case 1:case 5:return PR.Idle;case 2:return PR.Connecting;case 3:return PR.Connected;case 4:return PR.Reconnecting}}},{key:"_addEventListeners",value:function _addEventListeners(){var j=this,_e=this.base.rtcEngine;_e.on("networkQuality",(function(_e,_t,St){0===_e&&(j._networkStats.downlinkNetworkQuality=St,j._networkStats.uplinkNetworkQuality=_t)})),_e.on("rtcStats",(function(_e){var _t=_e.txPacketLossRate,St=_e.rxPacketLossRate,Tt=_e.cpuAppUsage,Ut=_e.cpuTotalUsage,_r=_e.lastmileDelay,_n=_e.gatewayRtt;j._networkStats.txVideoPacketLoss=_t/100,j._networkStats.rxVideoPacketLoss=St/100,j._networkStats.rtt=_n,j._networkStats.end2EndDelay=_r,j._networkStats.cpu=Tt/100,j._networkStats.cpuTotal=Ut/100})),_e.on("groupAudioVolumeIndication",(function(_e){var _t=new Map;_e.forEach((function(j){return _t.set(""+j.uid,j.volume)})),j.emit(UT.AudioVolumes,_t)})),_e.on("connectionStateChanged",(function(_e){j.emit(UT.RtcConnectionStateChanged,j._getRtcState(_e))})),_e.on("videoSourceJoinedSuccess",(function(){j.emit(UT.RtcConnectionStateChanged,PR.Connected,TR.sub)})),_e.on("videoSourceLeaveChannel",(function(){j.emit(UT.RtcConnectionStateChanged,PR.Idle,TR.sub)}))}},{key:"_emitMetadata",value:function _emitMetadata(){var j=this;this._metaTask||(this._metaTask=_R.addPollingTask(_asyncToGenerator(electron_regeneratorRuntime().mark((function _callee(){var _e;return electron_regeneratorRuntime().wrap((function _callee$(_t){for(;;)switch(_t.prev=_t.next){case 0:_e="".concat(JSON.stringify({uid:j.uid,ts:Date.now()})),j.base.rtcEngine.sendMetadata({uid:j.uid,timeStampMs:Date.now(),size:_e.length,buffer:_e});case 2:case"end":return _t.stop()}}),_callee)}))),500))}},{key:"_stopEmitMetadata",value:function _stopEmitMetadata(){this._metaTask&&(this._metaTask.stop(),this._metaTask=void 0)}}]),RtcChannelAdapterElectron}(PO))||sD,xD=__webpack_require__(5904),MD=__webpack_require__.n(xD);__webpack_require__(9575),__webpack_require__(2472),__webpack_require__(2990),__webpack_require__(8927),__webpack_require__(3105),__webpack_require__(5035),__webpack_require__(4345),__webpack_require__(7174),__webpack_require__(2846),__webpack_require__(4731),__webpack_require__(7209),__webpack_require__(6319),__webpack_require__(8867),__webpack_require__(7789),__webpack_require__(3739),__webpack_require__(9368),__webpack_require__(4483),__webpack_require__(2056),__webpack_require__(3462),__webpack_require__(678),__webpack_require__(7462),__webpack_require__(3824),__webpack_require__(5021),__webpack_require__(2974),__webpack_require__(5016),__webpack_require__(6541);function canvas_createSuper(j){var _e=function canvas_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var BD=_createClass((function AgoraStreamCanvas(j,_e,_t,St){var Tt;_classCallCheck(this,AgoraStreamCanvas),this.streamUuid=void 0,this.channelName=void 0,this.view=void 0,this.mirror=void 0,this.streamUuid=j,this.channelName=_e,this.view=_t,this.mirror=null!==(Tt=null==St?void 0:St.mirror)&&void 0!==Tt&&Tt})),UD=function(j){_inherits(AgoraRtcVideoCanvas,j);var _e=canvas_createSuper(AgoraRtcVideoCanvas);function AgoraRtcVideoCanvas(j,_t,St,Tt){var Ut;return _classCallCheck(this,AgoraRtcVideoCanvas),(Ut=_e.call(this,j,_t,St,Tt)).renderMode=UR.fill,void 0!==(null==Tt?void 0:Tt.renderMode)&&(Ut.renderMode=Tt.renderMode),Ut}return _createClass(AgoraRtcVideoCanvas,null,[{key:"key",value:function key(j,_e){return"".concat(j,"-").concat(_e)}}]),AgoraRtcVideoCanvas}(BD),FD=function(j){_inherits(AgoraRtcLocalVideoCanvas,j);var _e=canvas_createSuper(AgoraRtcLocalVideoCanvas);function AgoraRtcLocalVideoCanvas(j,_t){return _classCallCheck(this,AgoraRtcLocalVideoCanvas),_e.call(this,"0","",j,{mirror:_t})}return _createClass(AgoraRtcLocalVideoCanvas)}(UD),VD=function(j){_inherits(AgoraMediaPlayerCanvas,j);var _e=canvas_createSuper(AgoraMediaPlayerCanvas);function AgoraMediaPlayerCanvas(j,_t,St){var Tt,Ut,_r;return _classCallCheck(this,AgoraMediaPlayerCanvas),(_r=_e.call(this,"","",_t,St)).streamUrl=void 0,_r.playVideo=void 0,_r.playAudio=void 0,_r.streamUrl=j,_r.playVideo=null===(Tt=null==St?void 0:St.playVideo)||void 0===Tt||Tt,_r.playAudio=null===(Ut=null==St?void 0:St.playAudio)||void 0===Ut||Ut,_r}return _createClass(AgoraMediaPlayerCanvas)}(BD);function concat_concat(j,_e){_e||(_e=j.reduce(((j,_e)=>j+_e.length),0));const _t=new Uint8Array(_e);let St=0;for(const _e of j)_t.set(_e,St),St+=_e.length;return _t}var qD=function base(j,_e){if(j.length>=255)throw new TypeError("Alphabet too long");for(var _t=new Uint8Array(256),St=0;St<_t.length;St++)_t[St]=255;for(var Tt=0;Tt<j.length;Tt++){var Ut=j.charAt(Tt),_r=Ut.charCodeAt(0);if(255!==_t[_r])throw new TypeError(Ut+" is ambiguous");_t[_r]=Tt}var _n=j.length,_i=j.charAt(0),Ei=Math.log(_n)/Math.log(256),Ci=Math.log(256)/Math.log(_n);function decodeUnsafe(j){if("string"!=typeof j)throw new TypeError("Expected String");if(0===j.length)return new Uint8Array;var _e=0;if(" "!==j[_e]){for(var St=0,Tt=0;j[_e]===_i;)St++,_e++;for(var Ut=(j.length-_e)*Ei+1>>>0,_r=new Uint8Array(Ut);j[_e];){var Ci=_t[j.charCodeAt(_e)];if(255===Ci)return;for(var Di=0,Fi=Ut-1;(0!==Ci||Di<Tt)&&-1!==Fi;Fi--,Di++)Ci+=_n*_r[Fi]>>>0,_r[Fi]=Ci%256>>>0,Ci=Ci/256>>>0;if(0!==Ci)throw new Error("Non-zero carry");Tt=Di,_e++}if(" "!==j[_e]){for(var _o=Ut-Tt;_o!==Ut&&0===_r[_o];)_o++;for(var ga=new Uint8Array(St+(Ut-_o)),_a=St;_o!==Ut;)ga[_a++]=_r[_o++];return ga}}}return{encode:function encode(_e){if(_e instanceof Uint8Array||(ArrayBuffer.isView(_e)?_e=new Uint8Array(_e.buffer,_e.byteOffset,_e.byteLength):Array.isArray(_e)&&(_e=Uint8Array.from(_e))),!(_e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===_e.length)return"";for(var _t=0,St=0,Tt=0,Ut=_e.length;Tt!==Ut&&0===_e[Tt];)Tt++,_t++;for(var _r=(Ut-Tt)*Ci+1>>>0,Ei=new Uint8Array(_r);Tt!==Ut;){for(var Di=_e[Tt],Fi=0,_o=_r-1;(0!==Di||Fi<St)&&-1!==_o;_o--,Fi++)Di+=256*Ei[_o]>>>0,Ei[_o]=Di%_n>>>0,Di=Di/_n>>>0;if(0!==Di)throw new Error("Non-zero carry");St=Fi,Tt++}for(var ga=_r-St;ga!==_r&&0===Ei[ga];)ga++;for(var _a=_i.repeat(_t);ga<_r;++ga)_a+=j.charAt(Ei[ga]);return _a},decodeUnsafe,decode:function decode(j){var _t=decodeUnsafe(j);if(_t)return _t;throw new Error(`Non-${_e} character`)}}};const QD=qD,HD=(new Uint8Array(0),j=>{if(j instanceof Uint8Array&&"Uint8Array"===j.constructor.name)return j;if(j instanceof ArrayBuffer)return new Uint8Array(j);if(ArrayBuffer.isView(j))return new Uint8Array(j.buffer,j.byteOffset,j.byteLength);throw new Error("Unknown type, must be binary type")});class Encoder{constructor(j,_e,_t){this.name=j,this.prefix=_e,this.baseEncode=_t}encode(j){if(j instanceof Uint8Array)return`${this.prefix}${this.baseEncode(j)}`;throw Error("Unknown type, must be binary type")}}class Decoder{constructor(j,_e,_t){if(this.name=j,this.prefix=_e,void 0===_e.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=_e.codePointAt(0),this.baseDecode=_t}decode(j){if("string"==typeof j){if(j.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(j)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(j.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(j){return or(this,j)}}class ComposedDecoder{constructor(j){this.decoders=j}or(j){return or(this,j)}decode(j){const _e=j[0],_t=this.decoders[_e];if(_t)return _t.decode(j);throw RangeError(`Unable to decode multibase string ${JSON.stringify(j)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const or=(j,_e)=>new ComposedDecoder({...j.decoders||{[j.prefix]:j},..._e.decoders||{[_e.prefix]:_e}});class Codec{constructor(j,_e,_t,St){this.name=j,this.prefix=_e,this.baseEncode=_t,this.baseDecode=St,this.encoder=new Encoder(j,_e,_t),this.decoder=new Decoder(j,_e,St)}encode(j){return this.encoder.encode(j)}decode(j){return this.decoder.decode(j)}}const from=({name:j,prefix:_e,encode:_t,decode:St})=>new Codec(j,_e,_t,St),baseX=({prefix:j,name:_e,alphabet:_t})=>{const{encode:St,decode:Tt}=QD(_t,_e);return from({prefix:j,name:_e,encode:St,decode:j=>HD(Tt(j))})},rfc4648=({name:j,prefix:_e,bitsPerChar:_t,alphabet:St})=>from({prefix:_e,name:j,encode:j=>((j,_e,_t)=>{const St="="===_e[_e.length-1],Tt=(1<<_t)-1;let Ut="",_r=0,_n=0;for(let St=0;St<j.length;++St)for(_n=_n<<8|j[St],_r+=8;_r>_t;)_r-=_t,Ut+=_e[Tt&_n>>_r];if(_r&&(Ut+=_e[Tt&_n<<_t-_r]),St)for(;Ut.length*_t&7;)Ut+="=";return Ut})(j,St,_t),decode:_e=>((j,_e,_t,St)=>{const Tt={};for(let j=0;j<_e.length;++j)Tt[_e[j]]=j;let Ut=j.length;for(;"="===j[Ut-1];)--Ut;const _r=new Uint8Array(Ut*_t/8|0);let _n=0,_i=0,Ei=0;for(let _e=0;_e<Ut;++_e){const Ut=Tt[j[_e]];if(void 0===Ut)throw new SyntaxError(`Non-${St} character`);_i=_i<<_t|Ut,_n+=_t,_n>=8&&(_n-=8,_r[Ei++]=255&_i>>_n)}if(_n>=_t||255&_i<<8-_n)throw new SyntaxError("Unexpected end of data");return _r})(_e,St,_t,j)}),XD=from({prefix:"\0",name:"identity",encode:j=>{return _e=j,(new TextDecoder).decode(_e);var _e},decode:j=>(j=>(new TextEncoder).encode(j))(j)}),_x=rfc4648({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),tL=rfc4648({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),rL=baseX({prefix:"9",name:"base10",alphabet:"0123456789"}),nL=rfc4648({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),iL=rfc4648({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),oL=rfc4648({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),sL=rfc4648({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),cL=rfc4648({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),uL=rfc4648({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),dL=rfc4648({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),hL=rfc4648({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),pL=rfc4648({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),gL=rfc4648({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),vL=rfc4648({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),mL=baseX({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),yL=baseX({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),AL=baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),_L=baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),bL=rfc4648({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),wL=rfc4648({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),SL=rfc4648({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),TL=rfc4648({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),CL=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),RL=CL.reduce(((j,_e,_t)=>(j[_t]=_e,j)),[]),kL=CL.reduce(((j,_e,_t)=>(j[_e.codePointAt(0)]=_t,j)),[]);const OL=from({prefix:"🚀",name:"base256emoji",encode:function base256emoji_encode(j){return j.reduce(((j,_e)=>j+=RL[_e]),"")},decode:function base256emoji_decode(j){const _e=[];for(const _t of j){const j=kL[_t.codePointAt(0)];if(void 0===j)throw new Error(`Non-base256emoji character: ${_t}`);_e.push(j)}return new Uint8Array(_e)}});var DL=function varint_encode(j,_e,_t){_e=_e||[];var St=_t=_t||0;for(;j>=xL;)_e[_t++]=255&j|128,j/=128;for(;-128&j;)_e[_t++]=255&j|128,j>>>=7;return _e[_t]=0|j,varint_encode.bytes=_t-St+1,_e},xL=Math.pow(2,31);var LL=function read(j,_e){var _t,St=0,Tt=0,Ut=_e=_e||0,_r=j.length;do{if(Ut>=_r)throw read.bytes=0,new RangeError("Could not decode varint");_t=j[Ut++],St+=Tt<28?(127&_t)<<Tt:(127&_t)*Math.pow(2,Tt),Tt+=7}while(_t>=128);return read.bytes=Ut-_e,St};var NL=Math.pow(2,7),PL=Math.pow(2,14),ML=Math.pow(2,21),BL=Math.pow(2,28),jL=Math.pow(2,35),UL=Math.pow(2,42),FL=Math.pow(2,49),GL=Math.pow(2,56),VL=Math.pow(2,63);const QL={encode:DL,decode:LL,encodingLength:function(j){return j<NL?1:j<PL?2:j<ML?3:j<BL?4:j<jL?5:j<UL?6:j<FL?7:j<GL?8:j<VL?9:10}},encodeTo=(j,_e,_t=0)=>(QL.encode(j,_e,_t),_e),encodingLength=j=>QL.encodingLength(j),create=(j,_e)=>{const _t=_e.byteLength,St=encodingLength(j),Tt=St+encodingLength(_t),Ut=new Uint8Array(Tt+_t);return encodeTo(j,Ut,0),encodeTo(_t,Ut,St),Ut.set(_e,Tt),new digest_Digest(j,_t,_e,Ut)};class digest_Digest{constructor(j,_e,_t,St){this.code=j,this.size=_e,this.digest=_t,this.bytes=St}}const hasher_from=({name:j,code:_e,encode:_t})=>new Hasher(j,_e,_t);class Hasher{constructor(j,_e,_t){this.name=j,this.code=_e,this.encode=_t}digest(j){if(j instanceof Uint8Array){const _e=this.encode(j);return _e instanceof Uint8Array?create(this.code,_e):_e.then((j=>create(this.code,j)))}throw Error("Unknown type, must be binary type")}}const sha=j=>async _e=>new Uint8Array(await crypto.subtle.digest(j,_e)),KL=hasher_from({name:"sha2-256",code:18,encode:sha("SHA-256")}),WL=hasher_from({name:"sha2-512",code:19,encode:sha("SHA-512")}),HL=HD,YL={code:0,name:"identity",encode:HL,digest:j=>create(0,HL(j))},JL="raw",rN=85,raw_encode=j=>HD(j),raw_decode=j=>HD(j),nN=new TextEncoder,iN=new TextDecoder,oN="json",aN=512,json_encode=j=>nN.encode(JSON.stringify(j)),json_decode=j=>JSON.parse(iN.decode(j));class CID{constructor(j,_e,_t,St){this.code=_e,this.version=j,this.multihash=_t,this.bytes=St,this.byteOffset=St.byteOffset,this.byteLength=St.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:cid_hidden,byteLength:cid_hidden,code:readonly,version:readonly,multihash:readonly,bytes:readonly,_baseCache:cid_hidden,asCID:cid_hidden})}toV0(){if(0===this.version)return this;{const{code:j,multihash:_e}=this;if(j!==DAG_PB_CODE)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(_e.code!==SHA_256_CODE)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return CID.createV0(_e)}}toV1(){switch(this.version){case 0:{const{code:j,digest:_e}=this.multihash,_t=Digest.create(j,_e);return CID.createV1(this.code,_t)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(j){return j&&this.code===j.code&&this.version===j.version&&Digest.equals(this.multihash,j.multihash)}toString(j){const{bytes:_e,version:_t,_baseCache:St}=this;return 0===_t?toStringV0(_e,St,j||base58btc.encoder):toStringV1(_e,St,j||base32.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(j){return deprecate(/^0\.0/,IS_CID_DEPRECATION),!(!j||!j[cidSymbol]&&j.asCID!==j)}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(j){if(j instanceof CID)return j;if(null!=j&&j.asCID===j){const{version:_e,code:_t,multihash:St,bytes:Tt}=j;return new CID(_e,_t,St,Tt||encodeCID(_e,_t,St.bytes))}if(null!=j&&!0===j[cidSymbol]){const{version:_e,multihash:_t,code:St}=j,Tt=Digest.decode(_t);return CID.create(_e,St,Tt)}return null}static create(j,_e,_t){if("number"!=typeof _e)throw new Error("String codecs are no longer supported");switch(j){case 0:if(_e!==DAG_PB_CODE)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`);return new CID(j,_e,_t,_t.bytes);case 1:{const St=encodeCID(j,_e,_t.bytes);return new CID(j,_e,_t,St)}default:throw new Error("Invalid version")}}static createV0(j){return CID.create(0,DAG_PB_CODE,j)}static createV1(j,_e){return CID.create(1,j,_e)}static decode(j){const[_e,_t]=CID.decodeFirst(j);if(_t.length)throw new Error("Incorrect length");return _e}static decodeFirst(j){const _e=CID.inspectBytes(j),_t=_e.size-_e.multihashSize,St=coerce(j.subarray(_t,_t+_e.multihashSize));if(St.byteLength!==_e.multihashSize)throw new Error("Incorrect length");const Tt=St.subarray(_e.multihashSize-_e.digestSize),Ut=new Digest.Digest(_e.multihashCode,_e.digestSize,Tt,St);return[0===_e.version?CID.createV0(Ut):CID.createV1(_e.codec,Ut),j.subarray(_e.size)]}static inspectBytes(j){let _e=0;const next=()=>{const[_t,St]=varint.decode(j.subarray(_e));return St,_t};let _t=next(),St=DAG_PB_CODE;if(18===_t?(0,0):1===_t&&next(),0!==_t&&1!==_t)throw new RangeError(`Invalid CID version ${_t}`);const Tt=_e,Ut=next(),_r=next(),_n=_e+_r;return{version:_t,codec:St,multihashCode:Ut,digestSize:_r,multihashSize:_n-Tt,size:_n}}static parse(j,_e){const[_t,St]=parseCIDtoBytes(j,_e),Tt=CID.decode(St);return Tt._baseCache.set(_t,j),Tt}}Symbol.for("@ipld/js-cid/CID");const sN={..._e,..._t,...St,...Tt,...Ut,..._r,..._n,..._i,...Ei,...Ci};function createCodec(j,_e,_t,St){return{name:j,prefix:_e,encoder:{name:j,prefix:_e,encode:_t},decoder:{decode:St}}}const cN=createCodec("utf8","u",(j=>"u"+new TextDecoder("utf8").decode(j)),(j=>(new TextEncoder).encode(j.substring(1)))),lN=createCodec("ascii","a",(j=>{let _e="a";for(let _t=0;_t<j.length;_t++)_e+=String.fromCharCode(j[_t]);return _e}),(j=>{j=j.substring(1);const _e=new Uint8Array(j.length);for(let _t=0;_t<j.length;_t++)_e[_t]=j.charCodeAt(_t);return _e}));var dN,pN,vN,yN,AN,_N,EN,SN;function web_thread_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */web_thread_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function web_thread_createSuper(j){var _e=function web_thread_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var IN,TN,CN,kN=function(j){_inherits(AgoraRteMediaTrackThread,j);var _e=web_thread_createSuper(AgoraRteMediaTrackThread);function AgoraRteMediaTrackThread(){var j;_classCallCheck(this,AgoraRteMediaTrackThread);for(var _t=arguments.length,St=new Array(_t),Tt=0;Tt<_t;Tt++)St[Tt]=arguments[Tt];return(j=_e.call.apply(_e,[this].concat(St))).track=void 0,j.processors=[],j.isPipedProcessors=!1,j}return _createClass(AgoraRteMediaTrackThread,[{key:"pipeProcessors",value:function pipeProcessors(){if(!this.isPipedProcessors&&this.processors.length>0){var j=this.track;if(j){j.unpipe();var _e=this.processors.reduce((function(_e,_t){return _e?_e.pipe(_t):j.pipe(_t)}),null);_e&&_e.pipe(j.processorDestination),this.isPipedProcessors=!0}}}},{key:"addProcessors",value:function addProcessors(j){var _e=this;j.forEach((function(j){_e.processors.find((function(_e){return j.name===_e.name}))||_e.processors.push(j)})),this.isPipedProcessors=!1,this.pipeProcessors()}},{key:"removeProcessors",value:function removeProcessors(){var j;null===(j=this.track)||void 0===j||j.unpipe(),this.processors=[],this.isPipedProcessors=!1}}]),AgoraRteMediaTrackThread}(XO),xN=TS.attach({proxyMethods:!1})(dN=function(j){_inherits(AgoraRteCameraThread,j);var _e,_t=web_thread_createSuper(AgoraRteCameraThread);function AgoraRteCameraThread(){var j;_classCallCheck(this,AgoraRteCameraThread);for(var _e=arguments.length,St=new Array(_e),Tt=0;Tt<_e;Tt++)St[Tt]=arguments[Tt];return(j=_t.call.apply(_t,[this].concat(St))).canvas=void 0,j.trackState=NR.stopped,j.cameraEnable=!1,j._deviceId=void 0,j._deviceChanged=!1,j}return _createClass(AgoraRteCameraThread,[{key:"setCameraTrackState",value:function setCameraTrackState(j,_e){this.trackState!==j&&(this.trackState=j,this.emit(wO.trackStateChanged,j,bR.Camera,_e))}},{key:"setDevice",value:function setDevice(j){this._deviceId=j,this._deviceChanged=!0}},{key:"onExecution",value:(_e=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee2(){var j=this;return web_thread_regeneratorRuntime().wrap((function _callee2$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(!this.cameraEnable){_e.next=35;break}if(!this._deviceChanged){_e.next=16;break}if(!this.track){_e.next=15;break}if(_e.prev=3,!this._deviceId){_e.next=9;break}return this.logger.info("setting camera device [".concat(this._deviceId,"] for local track...")),_e.next=8,this.track.setDevice(this._deviceId);case 8:this.logger.info("local camera track's device is set to [".concat(this._deviceId,"]"));case 9:_e.next=15;break;case 11:return _e.prev=11,_e.t0=_e.catch(3),zE.shared.handleNonThrowableError(QE.RTC_ERR_CAM_ERR,_e.t0),_e.abrupt("break",42);case 15:this._deviceChanged=!1;case 16:if(this.track){_e.next=28;break}return this.logger.info("starting camera..."),this.setCameraTrackState(NR.starting),_e.prev=19,_e.delegateYield(web_thread_regeneratorRuntime().mark((function _callee(){var _e,_t,St,Tt;return web_thread_regeneratorRuntime().wrap((function _callee$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return _e=KS.shared.rtcConfigs,_t=_e.defaultCameraEncoderConfigurations,St=_t?{width:_t.width,height:_t.height,frameRate:_t.frameRate,bitrateMax:_t.bitrate}:void 0,j.logger.info("creating camera track..."),Ut.next=6,MD().createCameraVideoTrack({cameraId:j._deviceId,encoderConfig:St});case 6:j.track=Ut.sent,j.logger.info("camera track created"),(Tt=j.track).on("track-ended",(function(){j.logger.warn("camera track ended"),Tt.stop(),j.emit(wO.localTrackBeforeDestroy,Tt),Tt.close(),j.track=void 0,j.isPipedProcessors=!1,j.setCameraTrackState(NR.stopped)})),j.setCameraTrackState(NR.started),j.logger.info("camera started");case 12:case"end":return Ut.stop()}}),_callee)}))(),"t1",21);case 21:_e.next=28;break;case 23:return _e.prev=23,_e.t2=_e.catch(19),zE.shared.handleNonThrowableError(QE.RTC_ERR_CAM_ERR,_e.t2),this.setCameraTrackState(NR.error),_e.abrupt("break",42);case 28:if(this.track&&this.canvas&&this.canvas.view&&this.track.play(this.canvas.view),this.pipeProcessors(),!this.track||!(this.canvas&&this.canvas.view&&this.track.isPlaying)&&this.canvas&&this.canvas.view){_e.next=33;break}return this.logger.info("complete thread run"),_e.abrupt("break",42);case 33:_e.next=39;break;case 35:if(this.track&&(this.logger.info("stopping camera..."),this.track.stop(),this.emit(wO.localTrackBeforeDestroy,this.track),this.track.close(),this.track=void 0,this.setCameraTrackState(NR.stopped),this.isPipedProcessors=!1,this.logger.info("camera stopped")),this.track){_e.next=39;break}return this.logger.info("complete thread run"),_e.abrupt("break",42);case 39:return _e.next=41,new Promise((function(j){return setTimeout(j,500)}));case 41:if(this.running){_e.next=0;break}case 42:case"end":return _e.stop()}}),_callee2,this,[[3,11],[19,23]])}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRteCameraThread}(kN))||dN,LN=TS.attach({proxyMethods:!1})(pN=function(j){_inherits(AgoraRteMicrophoneThread,j);var _e,_t,St=web_thread_createSuper(AgoraRteMicrophoneThread);function AgoraRteMicrophoneThread(j){var _e;return _classCallCheck(this,AgoraRteMicrophoneThread),(_e=St.call(this)).micEnable=!1,_e.trackState=NR.stopped,_e._recordingDeviceId=void 0,_e._recordingDeviceChanged=!1,_e._volumePollingTask=void 0,_e._rawDataDispatcher=void 0,_e._pcmTrack=void 0,_e._rawDataDispatcher=j,j.register("ObserverChanged",(function(){_e.preparePcmCallback()})),j.register("MicrophoneTrackCreated",(function(){_e.preparePcmCallback()})),j.register("MicrophoneTrackDestroyed",(function(){_e.stopAudioFrameCallback()})),j.register("Start",(function(){j.hasMicrophoneRawDataObservers&&_e.setAudioFrameCallback()})),j.register("Stop",(function(){_e.stopAudioFrameCallback()})),_e}return _createClass(AgoraRteMicrophoneThread,[{key:"setMicTrackState",value:function setMicTrackState(j,_e){var _t,St=this;this.trackState!==j&&(this.trackState=j,this.emit(wO.trackStateChanged,j,ER.Mic,_e),j===NR.started?this._volumePollingTask||(this._volumePollingTask=_R.addPollingTask((function(){if(St.track){var j=St.track.getVolumeLevel();j=Math.min(3*j,1),St.emit(wO.localAudioVolume,j)}}),pR.second(.5))):(null===(_t=this._volumePollingTask)||void 0===_t||_t.stop(),this._volumePollingTask=void 0))}},{key:"setRecordingDevice",value:function setRecordingDevice(j){this._recordingDeviceId=j,this._recordingDeviceChanged=!0}},{key:"preparePcmCallback",value:function preparePcmCallback(){this._rawDataDispatcher.hasMicrophoneRawDataObservers?this.setAudioFrameCallback():this.stopAudioFrameCallback()}},{key:"setAudioFrameCallback",value:(_t=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee3(){var j,_e,_t,St,Tt,Ut,_r=this;return web_thread_regeneratorRuntime().wrap((function _callee3$(_n){for(;;)switch(_n.prev=_n.next){case 0:if(this.track){_n.next=3;break}return this.logger.warn("Cannot set PCM callback as there's no microphone track subscribed"),_n.abrupt("return");case 3:j=this._rawDataDispatcher.microphoneTrackRawDataConfig,_e=j.sampleRate,_t=j.frameSize,St=j.stereo,this._pcmTrack||(Tt={stereo:St,sampleRate:_e},Ut=this.track.getMediaStreamTrack().clone(),this._pcmTrack=MD().createCustomAudioTrack({mediaStreamTrack:Ut,encoderConfig:Tt})),this.logger.info("attach PCM listener on microphone track"),this._pcmTrack.setAudioFrameCallback((function(j){_r._rawDataDispatcher.dispatch("AudioRawDataRecored",{buffer:j})}),_t);case 7:case"end":return _n.stop()}}),_callee3,this)}))),function setAudioFrameCallback(){return _t.apply(this,arguments)})},{key:"stopAudioFrameCallback",value:function stopAudioFrameCallback(){this._pcmTrack&&(this.logger.info("detach PCM listener"),this._pcmTrack.setAudioFrameCallback(null),this._pcmTrack.close()),this._pcmTrack=void 0}},{key:"onExecution",value:(_e=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee5(){var j=this;return web_thread_regeneratorRuntime().wrap((function _callee5$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(!this.micEnable){_e.next=35;break}if(!this._recordingDeviceChanged){_e.next=17;break}if(!this.track){_e.next=16;break}if(_e.prev=3,!this._recordingDeviceId){_e.next=9;break}return this.logger.info("setting microphone device [".concat(this._recordingDeviceId,"] for local track...")),_e.next=8,this.track.setDevice(this._recordingDeviceId);case 8:this.logger.info("local microphone track's device is set to [".concat(this._recordingDeviceId,"]"));case 9:_e.next=16;break;case 11:return _e.prev=11,_e.t0=_e.catch(3),zE.shared.handleNonThrowableError(QE.RTC_ERR_MIC_ERR,_e.t0),this.setMicTrackState(NR.error),_e.abrupt("break",42);case 16:this._recordingDeviceChanged=!1;case 17:if(this.track){_e.next=29;break}return this.logger.info("starting mic..."),this.setMicTrackState(NR.starting),_e.prev=20,_e.delegateYield(web_thread_regeneratorRuntime().mark((function _callee4(){var _e,_t,St,Tt;return web_thread_regeneratorRuntime().wrap((function _callee4$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return _e=KS.shared.rtcConfigs,_t=_e.defaultMicrophoneEncoderConfigurations,St=_t?{sampleRate:_t.sampleRate,sampleSize:_t.sampleSize,stereo:_t.stereo,bitrate:_t.bitrate}:void 0,j.logger.info("creating microphone track..."),Ut.next=6,MD().createMicrophoneAudioTrack({microphoneId:j._recordingDeviceId,encoderConfig:St});case 6:Tt=Ut.sent,j.track=Tt,j.logger.info("microphone track created"),j.track.on("track-ended",(function(){j.logger.warn("mic track ended"),Tt.stop(),j.emit(wO.localTrackBeforeDestroy,Tt),Tt.close(),j.track=void 0,j.isPipedProcessors=!1,j.setMicTrackState(NR.stopped)})),j.setMicTrackState(NR.started),j._rawDataDispatcher.dispatch("MicrophoneTrackCreated",Tt),j.logger.info("mic started");case 13:case"end":return Ut.stop()}}),_callee4)}))(),"t1",22);case 22:_e.next=29;break;case 24:return _e.prev=24,_e.t2=_e.catch(20),zE.shared.handleNonThrowableError(QE.RTC_ERR_MIC_ERR,_e.t2),this.setMicTrackState(NR.error),_e.abrupt("break",42);case 29:if(this.pipeProcessors(),!this.track){_e.next=33;break}return this.logger.info("complete thread run"),_e.abrupt("break",42);case 33:_e.next=39;break;case 35:if(this.track&&(this.logger.info("stopping microphone..."),this.track.stop(),this.emit(wO.localTrackBeforeDestroy,this.track),this.track.close(),this.track=void 0,this.isPipedProcessors=!1,this.setMicTrackState(NR.stopped),this._rawDataDispatcher.dispatch("MicrophoneTrackDestroyed"),this.logger.info("microphone stopped")),this.track){_e.next=39;break}return this.logger.info("complete thread run"),_e.abrupt("break",42);case 39:return _e.next=41,new Promise((function(j){return setTimeout(j,500)}));case 41:if(this.running){_e.next=0;break}case 42:case"end":return _e.stop()}}),_callee5,this,[[3,11],[20,24]])}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRteMicrophoneThread}(kN))||pN,NN=TS.attach({proxyMethods:!1})(vN=function(j){_inherits(AgoraRteScreenShareThread,j);var _e,_t=web_thread_createSuper(AgoraRteScreenShareThread);function AgoraRteScreenShareThread(){var j;_classCallCheck(this,AgoraRteScreenShareThread);for(var _e=arguments.length,St=new Array(_e),Tt=0;Tt<_e;Tt++)St[Tt]=arguments[Tt];return(j=_t.call.apply(_t,[this].concat(St))).canvas=void 0,j.audioTrack=void 0,j.withAudio=!1,j.screenEnable=!1,j.trackState=NR.stopped,j}return _createClass(AgoraRteScreenShareThread,[{key:"playing",get:function get(){return this.track&&this.track.isPlaying&&(!this.audioTrack||this.audioTrack&&this.audioTrack.isPlaying)}},{key:"setScreenShareTrackState",value:function setScreenShareTrackState(j,_e,_t){this.trackState!==j&&(this.trackState=j,this.emit(wO.trackStateChanged,j,bR.ScreenShare,_t,_e))}},{key:"onExecution",value:(_e=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee7(){var j=this;return web_thread_regeneratorRuntime().wrap((function _callee7$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(!this.screenEnable){_e.next=22;break}if(this.track){_e.next=16;break}return this.logger.info("starting screenshare..."),this.setScreenShareTrackState(NR.starting),_e.prev=4,_e.delegateYield(web_thread_regeneratorRuntime().mark((function _callee6(){var _e,_t,St,Tt,Ut;return web_thread_regeneratorRuntime().wrap((function _callee6$(_r){for(;;)switch(_r.prev=_r.next){case 0:if(_e=KS.shared.rtcConfigs,_t=_e.defaultScreenEncoderConfigurations,St=_t?{width:_t.width,height:_t.height,frameRate:_t.frameRate,bitrateMax:_t.bitrate}:void 0,!j.withAudio){_r.next=12;break}return j.logger.info("creating screenshare track..."),_r.next=7,MD().createScreenVideoTrack({encoderConfig:St},"auto");case 7:Tt=_r.sent,j.logger.info("screenshare track created"),Tt instanceof Array?(j.track=Tt[0],j.audioTrack=Tt[1]):j.track=Tt,_r.next=17;break;case 12:return j.logger.info("creating screenshare track..."),_r.next=15,MD().createScreenVideoTrack({encoderConfig:St},"disable");case 15:j.track=_r.sent,j.logger.info("screenshare track created");case 17:Ut=j.track,j.track.on("track-ended",(function(){j.logger.warn("camera track ended"),Ut.stop(),j.emit(wO.localTrackBeforeDestroy,Ut),Ut.close(),j.track=void 0,j.setScreenShareTrackState(NR.stopped)})),j.setScreenShareTrackState(NR.started,!!j.audioTrack);case 20:case"end":return _r.stop()}}),_callee6)}))(),"t0",6);case 6:_e.next=15;break;case 8:if(_e.prev=8,_e.t1=_e.catch(4),"PERMISSION_DENIED"!==_e.t1.code||/system/.test(_e.t1.message)){_e.next=12;break}return _e.abrupt("break",30);case 12:return this.setScreenShareTrackState(NR.error,void 0,"PERMISSION_DENIED"===_e.t1.code?LR.PermissionDenied:LR.Unknown),zE.shared.handleNonThrowableError(QE.RTC_ERR_SCREEN_SHARE_ERR,_e.t1),_e.abrupt("break",30);case 15:this.logger.info("screenshare started");case 16:if(this.track&&this.canvas&&this.canvas.view&&this.track.play(this.canvas.view),!(!this.canvas||this.canvas&&this.playing)){_e.next=20;break}return this.logger.info("complete thread run"),_e.abrupt("break",30);case 20:_e.next=27;break;case 22:if(this.track&&(this.logger.info("stopping screenshare..."),this.track.stop(),this.emit(wO.localTrackBeforeDestroy,this.track),this.track.close(),this.track=void 0,this.logger.info("screenshare stopped"),this.setScreenShareTrackState(NR.stopped)),this.audioTrack&&(this.logger.info("stopping screenshare audio..."),this.audioTrack.stop(),this.audioTrack.close(),this.audioTrack=void 0,this.logger.info("screenshare audio stopped")),this.track||this.audioTrack){_e.next=27;break}return this.logger.info("complete thread run"),_e.abrupt("break",30);case 27:return _e.next=29,new Promise((function(j){return setTimeout(j,500)}));case 29:if(this.running){_e.next=0;break}case 30:case"end":return _e.stop()}}),_callee7,this,[[4,8]])}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRteScreenShareThread}(kN))||vN,PN=TS.attach({proxyMethods:!1})((AN=function(j){_inherits(AgoraRtePublishThreadMain,j);var _e,_t,St,Tt,Ut,_r,_n=web_thread_createSuper(AgoraRtePublishThreadMain);function AgoraRtePublishThreadMain(j,_e){var _t;return _classCallCheck(this,AgoraRtePublishThreadMain),(_t=_n.call(this))._config=_e,_t._client=void 0,_t.muteLocalVideo=!0,_t.muteLocalAudio=!0,_t._localVideoTrackThread=void 0,_t._localAudioTrackThread=void 0,_t._metaTask=void 0,_t._client=j,_t}return _createClass(AgoraRtePublishThreadMain,[{key:"localVideoTrack",get:function get(){var j;return null===(j=this._localVideoTrackThread)||void 0===j?void 0:j.track}},{key:"localAudioTrack",get:function get(){var j;return null===(j=this._localAudioTrackThread)||void 0===j?void 0:j.track}},{key:"latencyLevel",get:function get(){return this._config.latencyLevel}},{key:"setTrackThread",value:function setTrackThread(j,_e){var _t,St;switch(j){case"audio":null===(_t=this._localAudioTrackThread)||void 0===_t||_t.off(wO.trackStateChanged,this.handleTrackStateChanged),_e.off(wO.localTrackBeforeDestroy,this.handleTrackDestroy),this._localAudioTrackThread=_e,_e.on(wO.trackStateChanged,this.handleTrackStateChanged),_e.on(wO.localTrackBeforeDestroy,this.handleTrackDestroy);break;case"video":null===(St=this._localVideoTrackThread)||void 0===St||St.off(wO.trackStateChanged,this.handleTrackStateChanged),_e.off(wO.localTrackBeforeDestroy,this.handleTrackDestroy),this._localVideoTrackThread=_e,_e.on(wO.trackStateChanged,this.handleTrackStateChanged),_e.on(wO.localTrackBeforeDestroy,this.handleTrackDestroy)}}},{key:"handleTrackStateChanged",value:function handleTrackStateChanged(j){j===NR.started&&this.run()}},{key:"handleTrackDestroy",value:(_r=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee8(j){return web_thread_regeneratorRuntime().wrap((function _callee8$(_e){for(;;)switch(_e.prev=_e.next){case 0:return this.logger.info("unpublishing..."),_e.prev=1,_e.next=4,this._client.unpublish(j);case 4:_e.next=9;break;case 6:_e.prev=6,_e.t0=_e.catch(1),zE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_UNPUBLISH_FAIL,_e.t0);case 9:this.logger.info("unpublished.");case 10:case"end":return _e.stop()}}),_callee8,this,[[1,6]])}))),function handleTrackDestroy(j){return _r.apply(this,arguments)})},{key:"isTrackPublished",value:function isTrackPublished(j){return void 0!==this._client.localTracks.find((function(_e){return _e===j}))}},{key:"_emitMetadata",value:function _emitMetadata(){var j=this;this._metaTask||(this._metaTask=_R.addPollingTask(_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee9(){var _e,_t,St;return web_thread_regeneratorRuntime().wrap((function _callee9$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return _e=new Uint8Array([0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]),_t=(new TextEncoder).encode("".concat(JSON.stringify({uid:j._client.uid,ts:Date.now()}))),St=concat_concat([_e,_t]),Tt.next=5,j._client.sendMetadata(St);case 5:case"end":return Tt.stop()}}),_callee9)}))),500))}},{key:"_stopEmitMetadata",value:function _stopEmitMetadata(){this._metaTask&&(this._metaTask.stop(),this._metaTask=void 0)}},{key:"_setClientRole",value:(Ut=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee10(j){return web_thread_regeneratorRuntime().wrap((function _callee10$(_e){for(;;)switch(_e.prev=_e.next){case 0:if("live"!==this._config.mode){_e.next=10;break}if("host"!==j){_e.next=7;break}return this.logger.info("update rtc role to host"),_e.next=5,this._client.setClientRole(j);case 5:_e.next=10;break;case 7:return this.logger.info("update rtc role to audience, latency level: ".concat(this.latencyLevel)),_e.next=10,this._client.setClientRole(j,{level:this.latencyLevel});case 10:case"end":return _e.stop()}}),_callee10,this)}))),function _setClientRole(j){return Ut.apply(this,arguments)})},{key:"unpublishTracks",value:(Tt=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee11(j){return web_thread_regeneratorRuntime().wrap((function _callee11$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this._client.unpublish(j);case 2:case"end":return _e.stop()}}),_callee11,this)}))),function unpublishTracks(j){return Tt.apply(this,arguments)})},{key:"publishTracks",value:(St=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee12(j){return web_thread_regeneratorRuntime().wrap((function _callee12$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this._client.publish(j);case 2:case"end":return _e.stop()}}),_callee12,this)}))),function publishTracks(j){return St.apply(this,arguments)})},{key:"checkDuplicateTypeTracks",value:(_t=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee13(j){var _e;return web_thread_regeneratorRuntime().wrap((function _callee13$(_t){for(;;)switch(_t.prev=_t.next){case 0:if(!((_e=this._client.localTracks.filter((function(_e){return!!j.find((function(j){return _e.trackMediaType===j.trackMediaType}))}))).length>0)){_t.next=5;break}return this.logger.warn("unpublishing old [".concat(_e.map((function(j){return j.trackMediaType})).join(","),"] track...")),_t.next=5,this.unpublishTracks(_e);case 5:case"end":return _t.stop()}}),_callee13,this)}))),function checkDuplicateTypeTracks(j){return _t.apply(this,arguments)})},{key:"supportedEmitTsMetadata",value:function supportedEmitTsMetadata(j){var _e=this;return!!j.find((function(j){return"video"===j.trackMediaType&&"h264"===_e._config.codec}))}},{key:"checkAllTracksPublishState",value:function checkAllTracksPublishState(){var j=!this.localVideoTrack||(this.muteLocalVideo?!this.isTrackPublished(this.localVideoTrack):this.isTrackPublished(this.localVideoTrack)),_e=!this.localAudioTrack||(this.muteLocalAudio?!this.isTrackPublished(this.localAudioTrack):this.isTrackPublished(this.localAudioTrack));return j&&_e}},{key:"onExecution",value:(_e=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee14(){var j,_e;return web_thread_regeneratorRuntime().wrap((function _callee14$(_t){for(;;)switch(_t.prev=_t.next){case 0:case 1:if(this.muteLocalAudio&&this.muteLocalVideo){_t.next=20;break}return _t.next=4,this._setClientRole("host");case 4:if(j=[],this.muteLocalAudio||this.localAudioTrack&&!this.isTrackPublished(this.localAudioTrack)&&j.push(this.localAudioTrack),this.muteLocalVideo||this.localVideoTrack&&!this.isTrackPublished(this.localVideoTrack)&&j.push(this.localVideoTrack),!(j.length>0)){_t.next=20;break}return _t.next=10,this.checkDuplicateTypeTracks(j);case 10:return _t.prev=10,this.logger.info("publishing..."),_t.next=14,this.publishTracks(j);case 14:this.logger.info("published."),_t.next=20;break;case 17:_t.prev=17,_t.t0=_t.catch(10),zE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_PUBLISH_FAIL,_t.t0);case 20:if(_e=[],!this.muteLocalAudio&&!this.muteLocalVideo){_t.next=35;break}if(this.muteLocalAudio&&this.localAudioTrack&&this.isTrackPublished(this.localAudioTrack)&&_e.push(this.localAudioTrack),this.muteLocalVideo&&this.localVideoTrack&&this.isTrackPublished(this.localVideoTrack)&&_e.push(this.localVideoTrack),!(_e.length>0)){_t.next=35;break}return this.logger.info("unpublishing..."),_t.prev=26,_t.next=29,this.unpublishTracks(_e);case 29:_t.next=35;break;case 31:return _t.prev=31,_t.t1=_t.catch(26),zE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_UNPUBLISH_FAIL,_t.t1),_t.abrupt("break",46);case 35:if(!this.muteLocalAudio||!this.muteLocalVideo){_t.next=40;break}if(0!==this._client.localTracks.length){_t.next=40;break}return _t.next=39,this._setClientRole("audience");case 39:return _t.abrupt("break",46);case 40:if(!this.checkAllTracksPublishState()){_t.next=42;break}return _t.abrupt("break",46);case 42:return _t.next=44,new Promise((function(j){return setTimeout(j,500)}));case 44:case 45:if(this.running){_t.next=1;break}case 46:case"end":return _t.stop()}}),_callee14,this,[[10,17],[26,31]])}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRtePublishThreadMain}(XO),_applyDecoratedDescriptor(AN.prototype,"handleTrackStateChanged",[RS],Object.getOwnPropertyDescriptor(AN.prototype,"handleTrackStateChanged"),AN.prototype),_applyDecoratedDescriptor(AN.prototype,"handleTrackDestroy",[RS],Object.getOwnPropertyDescriptor(AN.prototype,"handleTrackDestroy"),AN.prototype),_applyDecoratedDescriptor(AN.prototype,"isTrackPublished",[RS],Object.getOwnPropertyDescriptor(AN.prototype,"isTrackPublished"),AN.prototype),yN=AN))||yN,MN=TS.attach({proxyMethods:!1})((EN=function(j){_inherits(AgoraRtePublishThreadSub,j);var _e,_t,St,Tt,Ut,_r,_n,_i=web_thread_createSuper(AgoraRtePublishThreadSub);function AgoraRtePublishThreadSub(j,_e){var _t;return _classCallCheck(this,AgoraRtePublishThreadSub),(_t=_i.call(this))._config=_e,_t._client=void 0,_t.mute=!0,_t._trackThread=void 0,_t._clientRole=void 0,_t._client=j,_t}return _createClass(AgoraRtePublishThreadSub,[{key:"videoTrack",get:function get(){var j;return null===(j=this._trackThread)||void 0===j?void 0:j.track}},{key:"audioTrack",get:function get(){var j;return null===(j=this._trackThread)||void 0===j?void 0:j.audioTrack}},{key:"latencyLevel",get:function get(){return this._config.latencyLevel}},{key:"setTrackThread",value:function setTrackThread(j){var _e;null===(_e=this._trackThread)||void 0===_e||_e.off(wO.trackStateChanged,this.handleTrackStateChanged),j.off(wO.localTrackBeforeDestroy,this.unpublish),this._trackThread=j,j.on(wO.trackStateChanged,this.handleTrackStateChanged),j.on(wO.localTrackBeforeDestroy,this.unpublish)}},{key:"handleTrackStateChanged",value:function handleTrackStateChanged(j){j===NR.started&&this.run()}},{key:"isTrackPublished",value:function isTrackPublished(j){return void 0!==this._client.localTracks.find((function(_e){return _e===j}))}},{key:"isTrackUnpublished",value:function isTrackUnpublished(j){return void 0===this._client.localTracks.find((function(_e){return _e===j}))}},{key:"unpublishTracks",value:(_n=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee15(j){return web_thread_regeneratorRuntime().wrap((function _callee15$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this._client.unpublish(j);case 2:case"end":return _e.stop()}}),_callee15,this)}))),function unpublishTracks(j){return _n.apply(this,arguments)})},{key:"checkDuplicateTypeTracks",value:(_r=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee16(j){var _e;return web_thread_regeneratorRuntime().wrap((function _callee16$(_t){for(;;)switch(_t.prev=_t.next){case 0:if(!((_e=this._client.localTracks.filter((function(_e){return!!j.find((function(j){return _e.trackMediaType===j.trackMediaType}))}))).length>0)){_t.next=5;break}return this.logger.warn("unpublishing old [".concat(_e.map((function(j){return j.trackMediaType})).join(","),"] track...")),_t.next=5,this.unpublishTracks(_e);case 5:case"end":return _t.stop()}}),_callee16,this)}))),function checkDuplicateTypeTracks(j){return _r.apply(this,arguments)})},{key:"_setClientRole",value:(Ut=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee17(j){return web_thread_regeneratorRuntime().wrap((function _callee17$(_e){for(;;)switch(_e.prev=_e.next){case 0:if("live"!==this._config.mode){_e.next=12;break}if("host"!==j){_e.next=8;break}return this.logger.info("update rtc role to host"),_e.next=5,this._client.setClientRole(j);case 5:this._clientRole="host",_e.next=12;break;case 8:return this.logger.info("update rtc role to audience, latency level: ".concat(this.latencyLevel)),_e.next=11,this._client.setClientRole(j,{level:this.latencyLevel});case 11:this._clientRole="audience";case 12:case"end":return _e.stop()}}),_callee17,this)}))),function _setClientRole(j){return Ut.apply(this,arguments)})},{key:"publishTracks",value:(Tt=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee18(j){return web_thread_regeneratorRuntime().wrap((function _callee18$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this._client.publish(j);case 2:case"end":return _e.stop()}}),_callee18,this)}))),function publishTracks(j){return Tt.apply(this,arguments)})},{key:"checkAllTracksPublishState",value:function checkAllTracksPublishState(){if(!this.videoTrack)return this.logger.error("screen share video track dose not found"),!0;var j=[this.videoTrack];return this.audioTrack&&j.push(this.audioTrack),this.mute?j.every(this.isTrackUnpublished):j.every(this.isTrackPublished)}},{key:"unpublish",value:(St=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee19(){var j;return web_thread_regeneratorRuntime().wrap((function _callee19$(_e){for(;;)switch(_e.prev=_e.next){case 0:if(j=[],this.videoTrack&&this.isTrackPublished(this.videoTrack)&&j.push(this.videoTrack),this.audioTrack&&this.isTrackPublished(this.audioTrack)&&j.push(this.audioTrack),!(j.length>0)){_e.next=7;break}return this.logger.info("unpublishing..."),_e.next=7,this.unpublishTracks(j);case 7:case"end":return _e.stop()}}),_callee19,this)}))),function unpublish(){return St.apply(this,arguments)})},{key:"publish",value:(_t=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee20(){var j;return web_thread_regeneratorRuntime().wrap((function _callee20$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this._setClientRole("host");case 2:if(j=[],this.videoTrack&&this.isTrackUnpublished(this.videoTrack)&&j.push(this.videoTrack),this.audioTrack&&this.isTrackUnpublished(this.audioTrack)&&j.push(this.audioTrack),!(j.length>0)){_e.next=12;break}return _e.next=8,this.checkDuplicateTypeTracks(j);case 8:return this.logger.info("publishing..."),_e.next=11,this.publishTracks(j);case 11:this.logger.info("published.");case 12:case"end":return _e.stop()}}),_callee20,this)}))),function publish(){return _t.apply(this,arguments)})},{key:"onExecution",value:(_e=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee21(){return web_thread_regeneratorRuntime().wrap((function _callee21$(j){for(;;)switch(j.prev=j.next){case 0:case 1:if(this.mute){j.next=10;break}return j.prev=2,j.next=5,this.publish();case 5:j.next=10;break;case 7:j.prev=7,j.t0=j.catch(2),zE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_PUBLISH_FAIL,j.t0);case 10:if(!this.mute){j.next=24;break}return j.prev=11,j.next=14,this.unpublish();case 14:if(0!==this._client.localTracks.length){j.next=18;break}return j.next=17,this._setClientRole("audience");case 17:return j.abrupt("break",30);case 18:j.next=24;break;case 20:return j.prev=20,j.t1=j.catch(11),zE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_UNPUBLISH_FAIL,j.t1),j.abrupt("break",30);case 24:if(!this.checkAllTracksPublishState()){j.next=26;break}return j.abrupt("break",30);case 26:return j.next=28,new Promise((function(j){return setTimeout(j,500)}));case 28:case 29:if(this.running){j.next=1;break}case 30:case"end":return j.stop()}}),_callee21,this,[[2,7],[11,20]])}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRtePublishThreadSub}(XO),_applyDecoratedDescriptor(EN.prototype,"handleTrackStateChanged",[RS],Object.getOwnPropertyDescriptor(EN.prototype,"handleTrackStateChanged"),EN.prototype),_applyDecoratedDescriptor(EN.prototype,"isTrackPublished",[RS],Object.getOwnPropertyDescriptor(EN.prototype,"isTrackPublished"),EN.prototype),_applyDecoratedDescriptor(EN.prototype,"isTrackUnpublished",[RS],Object.getOwnPropertyDescriptor(EN.prototype,"isTrackUnpublished"),EN.prototype),_applyDecoratedDescriptor(EN.prototype,"unpublish",[RS],Object.getOwnPropertyDescriptor(EN.prototype,"unpublish"),EN.prototype),_N=EN))||_N,FN=TS.attach({proxyMethods:!1})(SN=function(j){_inherits(AgoraRteSubscribeThread,j);var _e,_t,St=web_thread_createSuper(AgoraRteSubscribeThread);function AgoraRteSubscribeThread(j,_e,_t,Tt){var Ut,_r=_t.channelName,_n=_t.muteMap,_i=_t.canvasMap,Ei=_t.mediaType;return _classCallCheck(this,AgoraRteSubscribeThread),(Ut=St.call(this))._client=void 0,Ut._user=void 0,Ut._channelName=void 0,Ut._muteMap=void 0,Ut._canvasMap=void 0,Ut._mediaType=void 0,Ut._volumePollingTask=void 0,Ut._prevCanvasView=void 0,Ut._prevRenderMode=void 0,Ut._pcmTrack=void 0,Ut._rawDataDispatcher=void 0,Ut._client=j,Ut._user=_e,Ut._muteMap=_n,Ut._mediaType=Ei,Ut._canvasMap=_i,Ut._channelName=_r,Ut._rawDataDispatcher=Tt,"audio"===Ut._mediaType&&(Tt.register("ObserverChanged",(function(){Ut.preparePcmCallback()})),Tt.register("AudioTrackSubscribed",(function(j,_e){_e===Ut.streamUuid&&Ut.preparePcmCallback()})),Tt.register("AudioTrackUnsubscribed",(function(j){j===Ut.streamUuid&&Ut.stopAudioFrameCallback()})),Tt.register("Start",(function(){Ut._rawDataDispatcher.hasAudioTrackRawDataObservers&&Ut.setAudioFrameCallback()})),Tt.register("Stop",(function(){Ut.stopAudioFrameCallback()}))),Ut}return _createClass(AgoraRteSubscribeThread,[{key:"mute",get:function get(){return!this._muteMap.has(this.streamUuid)||this._muteMap.get(this.streamUuid)}},{key:"streamUuid",get:function get(){return"".concat(this._user.uid)}},{key:"canvas",get:function get(){if("audio"!==this._mediaType&&this._canvasMap){var j=UD.key(this.streamUuid,this._channelName);return this._canvasMap.get(j)}}},{key:"isTrackSubscribed",value:function isTrackSubscribed(){return"video"===this._mediaType?!!this._user.videoTrack:!!this._user.audioTrack}},{key:"track",get:function get(){return"video"===this._mediaType?this._user.videoTrack:this._user.audioTrack}},{key:"play",value:function play(){if(this.track&&this.canvas&&this.canvas.view){if(this.canvas.view===this._prevCanvasView&&this.canvas.renderMode===this._prevRenderMode)return;this._prevCanvasView=this.canvas.view,this._prevRenderMode=this.canvas.renderMode,this.track.play(this.canvas.view,{fit:this.canvas.renderMode===UR.fill?"cover":"contain"})}}},{key:"preparePcmCallback",value:function preparePcmCallback(){this._rawDataDispatcher.hasAudioTrackRawDataObservers?this.setAudioFrameCallback():this.stopAudioFrameCallback()}},{key:"setAudioFrameCallback",value:(_t=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee22(){var j,_e,_t,St,Tt,Ut,_r=this;return web_thread_regeneratorRuntime().wrap((function _callee22$(_n){for(;;)switch(_n.prev=_n.next){case 0:if(this.track){_n.next=3;break}return this.logger.warn("Cannot set PCM callback as there's no remote audio track subscribed"),_n.abrupt("return");case 3:j=this._rawDataDispatcher.audioTrackRawDataConfig,_e=j.sampleRate,_t=j.frameSize,St=j.stereo,this._pcmTrack||(Tt=this.track.getMediaStreamTrack().clone(),Ut={stereo:St,sampleRate:_e},this._pcmTrack=MD().createCustomAudioTrack({mediaStreamTrack:Tt,encoderConfig:Ut})),this.logger.info("attach PCM listener on remote audio track:",this._channelName,this.streamUuid),this._pcmTrack.setAudioFrameCallback((function(j){_r._rawDataDispatcher.dispatch("AudioRawDataBeforeMixed",{buffer:j},_r.streamUuid,_r._channelName)}),_t);case 7:case"end":return _n.stop()}}),_callee22,this)}))),function setAudioFrameCallback(){return _t.apply(this,arguments)})},{key:"stopAudioFrameCallback",value:function stopAudioFrameCallback(){this._pcmTrack&&(this.logger.info("detach PCM listener on remote audio track:",this._channelName,this.streamUuid),this._pcmTrack.setAudioFrameCallback(null),this._pcmTrack.close()),this._pcmTrack=void 0}},{key:"onExecution",value:(_e=_asyncToGenerator(web_thread_regeneratorRuntime().mark((function _callee23(){var j,_e,_t=this;return web_thread_regeneratorRuntime().wrap((function _callee23$(St){for(;;)switch(St.prev=St.next){case 0:j=0;case 1:if(this.mute){St.next=20;break}if(this.isTrackSubscribed()){St.next=15;break}return this.logger.info("[".concat(this._user.uid,"] subscribing ").concat(this._mediaType,"...")),St.prev=4,St.next=7,this._client.subscribe(this._user,this._mediaType);case 7:_e=St.sent,"audio"===this._mediaType&&this._rawDataDispatcher.dispatch("AudioTrackSubscribed",_e,this.streamUuid,this._channelName),St.next=14;break;case 11:St.prev=11,St.t0=St.catch(4),zE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_SUBSCRIBE_FAIL,St.t0);case 14:this.logger.info("[".concat(this._user.uid,"] subscribed."));case 15:if("video"===this._mediaType?this.play():this.track&&(this._volumePollingTask||(this._volumePollingTask=_R.addPollingTask((function(){var j=_t.track.getVolumeLevel();j=Math.min(3*j,1),_t.emit("audio-volume-indication",j)}),pR.second(.5))),this.track.play()),!this.isTrackSubscribed()){St.next=18;break}return St.abrupt("break",41);case 18:St.next=36;break;case 20:if(!this.isTrackSubscribed()){St.next=33;break}return this.logger.info("[".concat(this._user.uid,"] unpublishing...")),St.prev=22,St.next=25,this._client.unsubscribe(this._user,this._mediaType);case 25:"audio"===this._mediaType&&this._rawDataDispatcher.dispatch("AudioTrackUnsubscribed",this.streamUuid,this._channelName),St.next=32;break;case 28:return St.prev=28,St.t1=St.catch(22),zE.shared.handleNonThrowableError(QE.RTC_ERR_TRACK_UNSUBSCRIBE_FAIL,St.t1),St.abrupt("break",41);case 32:this.logger.info("[".concat(this._user.uid,"] unpublished."));case 33:if(this.track&&(this.logger.info("[".concat(this._user.uid,"] stopping track...")),this.track.stop(),this._volumePollingTask&&this._volumePollingTask.stop(),this.logger.info("[".concat(this._user.uid,"] track stopped"))),this.isTrackSubscribed()){St.next=36;break}return St.abrupt("break",41);case 36:return St.next=38,new Promise((function(j){return setTimeout(j,500)}));case 38:++j%10==0&&this.logger.info("thread running...");case 40:if(this.running){St.next=1;break}case 41:case"end":return St.stop()}}),_callee23,this,[[4,11],[22,28]])}))),function onExecution(){return _e.apply(this,arguments)})}]),AgoraRteSubscribeThread}(XO))||SN,GN=(__webpack_require__(2479),__webpack_require__(5306),TS.attach({proxyMethods:!1})(IN=function(){function RtcNetworkQualityWeb(){_classCallCheck(this,RtcNetworkQualityWeb),this.logger=void 0,this.rtt=void 0,this.downlinkNetworkQuality=0,this.uplinkNetworkQuality=0,this.end2EndDelay=0,this.txVideoPacketLoss=0,this.rxVideoPacketLoss=0,this._downlinkNetworkQualityClacInstance=new HO,this._uplinkNetworkQualityClacInstance=new HO}return _createClass(RtcNetworkQualityWeb,[{key:"networkStats",value:function networkStats(){var networkStats={packetLoss:Math.max(this.txVideoPacketLoss,this.rxVideoPacketLoss),cpu:-1,delay:this.end2EndDelay,downlinkNetworkQuality:this._downlinkNetworkQualityClacInstance.toAGQuality(this.downlinkNetworkQuality),uplinkNetworkQuality:this._uplinkNetworkQualityClacInstance.toAGQuality(this.downlinkNetworkQuality)};return networkStats}}]),RtcNetworkQualityWeb}())||IN);function client_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */client_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function client_createSuper(j){var _e=function client_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var VN=TS.attach({proxyMethods:!1})(TN=function(j){_inherits(AgoraRteWebClientBase,j);var _e,_t,St=client_createSuper(AgoraRteWebClientBase);function AgoraRteWebClientBase(j,_e,_t,Tt,Ut){var _r;_classCallCheck(this,AgoraRteWebClientBase),(_r=St.call(this)).logger=void 0,_r._client=void 0,_r._base=void 0,_r.configs=void 0,_r.channelName=void 0,_r.connectionType=void 0,_r._audioRawDataDispatcher=void 0,_r._connectionState=PR.Idle,_r._networkStats=new GN,_r._recentLocalPacketStats=[],_r._recentRemotePacketStats=[],_r.channelName=j,_r.configs=_e,_r._base=_t,_r.connectionType=Tt,_r._audioRawDataDispatcher=Ut,MD().setArea({areaCode:[_r._rtcRegion()]}),KS.shared.rtcSDKParameters&&KS.shared.rtcSDKParameters.forEach((function(j){_r._setPrivateParameter(j)})),_r._client=MD().createClient({codec:_r.configs.codec,mode:_r.configs.mode});var _n=KS.shared.rtcConfigs.defaultRemoteVideoStreamType;void 0!==_n&&_r._client.setRemoteDefaultVideoStreamType(_n);var _i=KS.shared.rtcConfigs.encryption;return _i&&_r._client.setEncryptionConfig(_r._getEncryptionMode(_i.mode),_i.key),_r._client.on("connection-state-change",(function(j){_r.setConnectionState(_r._getRtcState(j))})),_r._client.on("network-quality",(function(j){_r._networkStats.uplinkNetworkQuality=j.uplinkNetworkQuality,_r._networkStats.downlinkNetworkQuality=j.downlinkNetworkQuality;var _e=_r._client.getLocalVideoStats(),_t=_r._client.getRemoteVideoStats(),St=_r._client.getRTCStats();_r._networkStats.rtt=St.RTT;var Tt={lossPackets:_e.sendPacketsLost,totalPackets:_e.sendPackets};_r._recentLocalPacketStats.unshift(Tt),_r._recentLocalPacketStats=_r._recentLocalPacketStats.slice(0,10);for(var Ut=0,_n=0,_i=0,Ei=Object.values(_t),Ci=0,Di=Ei;Ci<Di.length;Ci++){var Fi=Di[Ci];Ut+=Fi.receivePacketsLost,_n+=Fi.receivePackets,_i+=Fi.end2EndDelay}var _o={lossPackets:Ut,totalPackets:_n};_r._recentRemotePacketStats.unshift(_o),_r._recentRemotePacketStats=_r._recentRemotePacketStats.slice(0,10),Ei.length>0&&(_r._networkStats.end2EndDelay=0===Ei.length?0:_i/Ei.length);var ga=_r._getRecentPacketLoss(),_a=ga.rx,_s=ga.tx;_r._networkStats.rxVideoPacketLoss=_a,_r._networkStats.txVideoPacketLoss=_s,_r.emit("network-stats-changed",_r._networkStats.networkStats(),_r.connectionType)})),_r}return _createClass(AgoraRteWebClientBase,[{key:"base",get:function get(){return this._base}},{key:"_setPrivateParameter",value:function _setPrivateParameter(j){Object.keys(j).forEach((function(_e){var _t=j[_e];_e=_e.replace("rtc.","").toUpperCase(),"string"!=typeof _t&&(_t=JSON.stringify(_t)),MD().setParameter(_e,_t)}))}},{key:"_getRecentPacketLoss",value:function _getRecentPacketLoss(){var j=this._recentLocalPacketStats[0],_e=this._recentLocalPacketStats[this._recentLocalPacketStats.length-1],_t=j.lossPackets-_e.lossPackets,St=j.totalPackets-_e.totalPackets,Tt=this._recentRemotePacketStats[0],Ut=this._recentRemotePacketStats[this._recentRemotePacketStats.length-1],_r=Tt.lossPackets-Ut.lossPackets,_n=Tt.totalPackets-Ut.totalPackets;return{rx:Math.abs(St>0?_t/St:0),tx:Math.abs(_n>0?_r/_n:0)}}},{key:"ready",get:function get(){return this._connectionState===PR.Connected}},{key:"setConnectionState",value:function setConnectionState(j){this._connectionState=j,this.emit("rtc-connection-state-changed",j,this.connectionType)}},{key:"getClientSessionId",value:function getClientSessionId(){return this._client._sessionId}},{key:"join",value:(_t=_asyncToGenerator(client_regeneratorRuntime().mark((function _callee(j,_e,_t){return client_regeneratorRuntime().wrap((function _callee$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,this._client.join(j,this.channelName,_e,+_t);case 2:case"end":return St.stop()}}),_callee,this)}))),function join(j,_e,St){return _t.apply(this,arguments)})},{key:"leave",value:(_e=_asyncToGenerator(client_regeneratorRuntime().mark((function _callee2(){var j,_e,_t;return client_regeneratorRuntime().wrap((function _callee2$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,JR(this._client.leave());case 2:j=St.sent,_e=_slicedToArray(j,1),(_t=_e[0])&&zE.shared.handleNonThrowableError(QE.RTC_ERR_CLIENT_LEAVE_CHANNEL_FAIL,_t);case 6:case"end":return St.stop()}}),_callee2,this)}))),function leave(){return _e.apply(this,arguments)})},{key:"setLatencyLevel",value:function setLatencyLevel(j){this.logger.info("set client role to audience and audience level to",j),this._client.setClientRole("audience",{level:j})}},{key:"_rtcRegion",value:function _rtcRegion(){switch(KS.shared.rtcRegion){case VS.AREA_GLOBAL:return"GLOBAL";case VS.AREA_CN:return"CHINA";case VS.AREA_AS:return"ASIA";case VS.AREA_EUR:return"EUROPE";case VS.AREA_NA:return"NORTH_AMERICA";case VS.AREA_JAPAN:return"JAPAN";case VS.AREA_INDIA:return"INDIA"}}},{key:"_getRtcState",value:function _getRtcState(j){switch(j){case"CONNECTED":return PR.Connected;case"CONNECTING":return PR.Connecting;case"DISCONNECTING":case"DISCONNECTED":return PR.Idle;case"RECONNECTING":return PR.Reconnecting}}},{key:"_getEncryptionMode",value:function _getEncryptionMode(j){switch(j){case MR.AES_128_ECB:return"aes-128-ecb";case MR.AES_128_GCM:return"aes-128-gcm";case MR.AES_128_XTS:return"aes-128-xts";case MR.AES_256_XTS:return"aes-256-xts";case MR.AES_256_GCM:return"aes-256-gcm";case MR.AES_256_XTS:return"aes-256-xts"}return"none"}}]),AgoraRteWebClientBase}(_a))||TN,qN=(CN=function(j){_inherits(AgoraRteWebClientMain,j);var _e,_t,St=client_createSuper(AgoraRteWebClientMain);function AgoraRteWebClientMain(j,_e,_t,Tt,Ut){var _r;_classCallCheck(this,AgoraRteWebClientMain),(_r=St.call(this,j,_e,_t,Tt,Ut))._remoteRtcUsers=new Map,_r._muteRemoteVideo=new Map,_r._muteRemoteAudio=new Map,_r._audioVolumes=new Map,_r._publishThread=void 0,_r._subscribeVideoThreads=new Map,_r._subscribeAudioThreads=new Map,_r._publishThread=new PN(_r._client,_e),_r._publishThread.runnable=!1;var _n=(0,oS.throttle)(_r._notifyStreamVolumes,500);return _r._client.on("user-published",(function(j,_e){var _t="".concat(j.uid);if(_r._remoteRtcUsers.set(_t,j),"video"===_e){var St=new FN(_r._client,j,{channelName:_r.channelName,muteMap:_r._muteRemoteVideo,mediaType:"video",canvasMap:_r.base.remoteCanvas},Ut);_r._subscribeVideoThreads.set(_t,St),St.runnable=_r.ready}else{var Tt=new FN(_r._client,j,{channelName:_r.channelName,muteMap:_r._muteRemoteAudio,mediaType:"audio"},Ut);Tt.on("audio-volume-indication",(function(j){_r._audioVolumes.set(_t,j),_n()})),_r._subscribeAudioThreads.set(_t,Tt),Tt.runnable=_r.ready}_r._notifySubscribeThreads(_t,_e)})),_r._client.on("user-unpublished",(function(_e){if(!_e.hasAudio&&!_e.hasVideo){var _t="".concat(_e.uid);_r._remoteRtcUsers.delete(_t);var St=_r._subscribeVideoThreads.get(_t),Tt=_r._subscribeAudioThreads.get(_t);St&&(St.stop(),_r._subscribeVideoThreads.delete(_t)),Tt&&(Ut.dispatch("AudioTrackUnsubscribed",Tt.streamUuid,j),Tt.stop(),_r._audioVolumes.delete(_t),_r._subscribeAudioThreads.delete(_t))}})),_r._client.on("user-left",(function(_e){var _t="".concat(_e.uid);_r._remoteRtcUsers.delete(_t);var St=_r._subscribeVideoThreads.get(_t),Tt=_r._subscribeAudioThreads.get(_t);St&&(St.stop(),_r._subscribeVideoThreads.delete(_t)),Tt&&(Ut.dispatch("AudioTrackUnsubscribed",_t,j),Tt.stop(),_r._audioVolumes.delete(_t),_r._subscribeAudioThreads.delete(_t))})),_r}return _createClass(AgoraRteWebClientMain,[{key:"videoSubscribeThread",value:function videoSubscribeThread(j){return this._subscribeVideoThreads.get(j)}},{key:"remoteRtcUsers",get:function get(){return this._remoteRtcUsers}},{key:"_notifyStreamVolumes",value:function _notifyStreamVolumes(){this.emit("audio-volume-indication",this._audioVolumes)}},{key:"_notifySubscribeThreads",value:function _notifySubscribeThreads(j,_e){var _t="video"===_e?this._subscribeVideoThreads.get(j):this._subscribeAudioThreads.get(j);_t&&_t.run()}},{key:"setConnectionState",value:function setConnectionState(j){j===PR.Connected&&(this._publishThread.runnable=!0,this._publishThread.run(),this._subscribeVideoThreads.forEach((function(j){j.runnable=!0,j.run()})),this._subscribeAudioThreads.forEach((function(j){j.runnable=!0,j.run()}))),j===PR.Idle&&(this._publishThread.runnable=!1,this._subscribeVideoThreads.forEach((function(j){j.runnable=!1})),this._subscribeAudioThreads.forEach((function(j){j.runnable=!1,j.run()}))),_get(_getPrototypeOf(AgoraRteWebClientMain.prototype),"setConnectionState",this).call(this,j)}},{key:"muteLocalVideo",value:function muteLocalVideo(j){return this.logger.info("muteLocalVideo ".concat(j)),this.base.cameraThread?(this._publishThread.muteLocalVideo=j,this._publishThread.setTrackThread("video",this.base.cameraThread),this._publishThread.run(),0):-1}},{key:"muteLocalAudio",value:function muteLocalAudio(j){return this.logger.info("muteLocalAudio ".concat(j)),this.base.micThread?(this._publishThread.muteLocalAudio=j,this._publishThread.setTrackThread("audio",this.base.micThread),this._publishThread.run(),0):-1}},{key:"muteLocalScreenShare",value:function muteLocalScreenShare(j){return this.logger.warn("muteLocalScreenShare dose not supported in main client, please use sub client"),-1}},{key:"muteRemoteVideo",value:function muteRemoteVideo(j,_e){return this.logger.info("muteRemoteVideo ".concat(j," ").concat(_e)),this._muteRemoteVideo.set(j,_e),this._notifySubscribeThreads(j,"video"),0}},{key:"muteRemoteAudio",value:function muteRemoteAudio(j,_e){return this.logger.info("muteRemoteAudio ".concat(j," ").concat(_e)),this._muteRemoteAudio.set(j,_e),this._notifySubscribeThreads(j,"audio"),0}},{key:"muteRemoteVideoMass",value:(_t=_asyncToGenerator(client_regeneratorRuntime().mark((function _callee3(j,_e){var _t,St,Tt=this;return client_regeneratorRuntime().wrap((function _callee3$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(this.logger.info("muteRemoteVideoMass ".concat(_e)),_t=j.map((function(j){return Tt.remoteRtcUsers.get(j)})).filter((function(j){return!!j})).map((function(j){return{user:j,mediaType:"video"}})),!_e){Ut.next=9;break}return Ut.next=5,this._client.massUnsubscribe(_t);case 5:return j.forEach((function(j){Tt._muteRemoteVideo.set(j,_e)})),Ut.abrupt("return",j);case 9:return Ut.next=11,this._client.massSubscribe(_t);case 11:return(St=Ut.sent.map((function(j){var _e=j.user;return"".concat(_e.uid)}))).forEach((function(j){Tt._muteRemoteVideo.set(j,_e)})),Ut.abrupt("return",St);case 14:case"end":return Ut.stop()}}),_callee3,this)}))),function muteRemoteVideoMass(j,_e){return _t.apply(this,arguments)})},{key:"enableDualStream",value:function enableDualStream(j){return j?this._client.enableDualStream():this._client.disableDualStream()}},{key:"setLowStreamParameter",value:function setLowStreamParameter(j){return this._client.setLowStreamParameter({width:j.width,height:j.height,framerate:j.frameRate,bitrate:j.bitrate}),0}},{key:"setRemoteVideoStreamType",value:function setRemoteVideoStreamType(j,_e){return this._client.setRemoteVideoStreamType(+j,_e)}},{key:"leave",value:(_e=_asyncToGenerator(client_regeneratorRuntime().mark((function _callee4(){var j=this;return client_regeneratorRuntime().wrap((function _callee4$(_e){for(;;)switch(_e.prev=_e.next){case 0:return this._publishThread.stop(),_e.next=3,_get(_getPrototypeOf(AgoraRteWebClientMain.prototype),"leave",this).call(this);case 3:this._remoteRtcUsers.clear(),this._subscribeVideoThreads.forEach((function(j){j.stop()})),this._subscribeVideoThreads.clear(),this._subscribeAudioThreads.forEach((function(_e){j._audioRawDataDispatcher.dispatch("AudioTrackUnsubscribed",_e.streamUuid,j.channelName),_e.stop()})),this._subscribeAudioThreads.clear(),this._remoteRtcUsers.clear();case 9:case"end":return _e.stop()}}),_callee4,this)}))),function leave(){return _e.apply(this,arguments)})}]),AgoraRteWebClientMain}(VN),_applyDecoratedDescriptor(CN.prototype,"_notifyStreamVolumes",[RS],Object.getOwnPropertyDescriptor(CN.prototype,"_notifyStreamVolumes"),CN.prototype),CN),KN=function(j){_inherits(AgoraRteWebClientSub,j);var _e,_t=client_createSuper(AgoraRteWebClientSub);function AgoraRteWebClientSub(j,_e,St,Tt,Ut){var _r;return _classCallCheck(this,AgoraRteWebClientSub),(_r=_t.call(this,j,_e,St,Tt,Ut))._publishThread=void 0,_r._publishThread=new MN(_r._client,_e),_r._publishThread.runnable=!1,_r}return _createClass(AgoraRteWebClientSub,[{key:"muteLocalVideo",value:function muteLocalVideo(j){return this.logger.warn("muteLocalVideo dose not supported in sub client, please use main client"),-1}},{key:"muteLocalAudio",value:function muteLocalAudio(j){return this.logger.warn("muteLocalAudio dose not supported in sub client, please use main client"),-1}},{key:"muteLocalScreenShare",value:function muteLocalScreenShare(j){return this.logger.info("muteLocalScreenShare ".concat(j)),this.base.screenThread?(this._publishThread.mute=j,this._publishThread.setTrackThread(this.base.screenThread),this._publishThread.run(),0):-1}},{key:"setLowStreamParameter",value:function setLowStreamParameter(j){return this._client.setLowStreamParameter({width:j.width,height:j.height,framerate:j.frameRate,bitrate:j.bitrate}),0}},{key:"setRemoteVideoStreamType",value:function setRemoteVideoStreamType(j,_e){return this._client.setRemoteVideoStreamType(+j,_e)}},{key:"enableDualStream",value:function enableDualStream(j){return j?this._client.enableDualStream():this._client.disableDualStream()}},{key:"setConnectionState",value:function setConnectionState(j){j===PR.Connected&&(this._publishThread.runnable=!0,this._publishThread.run()),j===PR.Idle&&(this._publishThread.runnable=!1),_get(_getPrototypeOf(AgoraRteWebClientSub.prototype),"setConnectionState",this).call(this,j)}},{key:"leave",value:(_e=_asyncToGenerator(client_regeneratorRuntime().mark((function _callee5(){return client_regeneratorRuntime().wrap((function _callee5$(j){for(;;)switch(j.prev=j.next){case 0:return this._publishThread.stop(),j.next=3,_get(_getPrototypeOf(AgoraRteWebClientSub.prototype),"leave",this).call(this);case 3:case"end":return j.stop()}}),_callee5,this)}))),function leave(){return _e.apply(this,arguments)})}]),AgoraRteWebClientSub}(VN);function device_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */device_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function web_device_createSuper(j){var _e=function web_device_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var WN=function(j){_inherits(RtcVideoDeviceManagerWeb,j);var _e,_t=web_device_createSuper(RtcVideoDeviceManagerWeb);function RtcVideoDeviceManagerWeb(j,_e){var St;return _classCallCheck(this,RtcVideoDeviceManagerWeb),(St=_t.call(this)).adapter=j,St._deviceInfo=new Map,St._deviceIds=new Set,St._initializeDeviceList(_e),St}return _createClass(RtcVideoDeviceManagerWeb,[{key:"onLocalVideoTrackStateChanged",value:function onLocalVideoTrackStateChanged(j){return this.adapter.onLocalVideoTrackStateChanged(j),0}},{key:"onLocalCameraListChanged",value:function onLocalCameraListChanged(j){return this.on(wO.cameraListChanged,j),0}},{key:"getVideoCameraDevices",value:function getVideoCameraDevices(){return this.cameraList}},{key:"cameraList",get:function get(){var j=this,_e=[];return this._deviceIds.forEach((function(_t){var St=j._deviceInfo.get(_t);St&&_e.push({deviceid:St.deviceid,devicename:St.devicename})})),_e}},{key:"_emitCameraListChanged",value:function _emitCameraListChanged(j,_e,_t){this.emit(wO.cameraListChanged,j,_e,_t)}},{key:"_initializeDeviceList",value:(_e=_asyncToGenerator(device_regeneratorRuntime().mark((function _callee(j){var _e,_t,St,Tt,Ut,_r=this;return device_regeneratorRuntime().wrap((function _callee$(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.next=2,JR(MD().getCameras(j));case 2:_e=_n.sent,_t=_slicedToArray(_e,2),St=_t[0],Tt=_t[1],St&&zE.shared.handleThrowableError(QE.RTC_ERR_VDM_GET_DEVICES_FAIL,St),Tt&&(Ut=[],Tt.forEach((function(j){if("default"!==j.deviceId){var _e={deviceid:j.deviceId,devicename:j.label};_r._deviceInfo.set(j.deviceId,_e),_r._deviceIds.add(j.deviceId),Ut.push(_e)}})),this._emitCameraListChanged(!0,Ut,this.cameraList)),MD().onCameraChanged=function(j){var _e={deviceid:j.device.deviceId,devicename:j.device.label};"ACTIVE"===j.state?(_r._deviceInfo.set(j.device.deviceId,_e),_r._deviceIds.add(j.device.deviceId),_r._emitCameraListChanged(!0,[_e],_r.cameraList)):"INACTIVE"===j.state&&(_r._deviceInfo.delete(j.device.deviceId),_r._deviceIds.delete(j.device.deviceId),_r._emitCameraListChanged(!1,[_e],_r.cameraList))};case 9:case"end":return _n.stop()}}),_callee,this)}))),function _initializeDeviceList(j){return _e.apply(this,arguments)})}]),RtcVideoDeviceManagerWeb}(LO),HN=function(j){_inherits(RtcAudioDeviceManagerWeb,j);var _e,_t,St=web_device_createSuper(RtcAudioDeviceManagerWeb);function RtcAudioDeviceManagerWeb(j,_e){var _t;return _classCallCheck(this,RtcAudioDeviceManagerWeb),(_t=St.call(this)).adapter=j,_t._recordingDeviceInfo=new Map,_t._recordingDeviceIds=new Set,_t._playbackDeviceInfo=new Map,_t._playbackDeviceIds=new Set,_t._initializeDeviceList(_e),_t._initializePlaybackDeviceList(_e),_t}return _createClass(RtcAudioDeviceManagerWeb,[{key:"onLocalAudioPlaybackTestVolumeChanged",value:function onLocalAudioPlaybackTestVolumeChanged(j){return this.adapter.onLocalAudioPlaybackTestVolumeChanged(j)}},{key:"onLocalAudioTrackStateChanged",value:function onLocalAudioTrackStateChanged(j){return this.adapter.onLocalAudioTrackStateChanged(j)}},{key:"onLocalAudioVolume",value:function onLocalAudioVolume(j){return this.adapter.onLocalAudioVolume(j)}},{key:"onLocalRecordingDeviceListChanged",value:function onLocalRecordingDeviceListChanged(j){return this.on(wO.recordingDeviceListChanged,j),0}},{key:"onLocalPlaybackDeviceListChanged",value:function onLocalPlaybackDeviceListChanged(j){return this.on(wO.playbackDeviceListChanged,j),0}},{key:"microphoneList",get:function get(){var j=this,_e=[];return this._recordingDeviceIds.forEach((function(_t){var St=j._recordingDeviceInfo.get(_t);St&&_e.push({deviceid:St.deviceid,devicename:St.devicename})})),_e}},{key:"speakerList",get:function get(){var j=this,_e=[];return this._playbackDeviceIds.forEach((function(_t){var St=j._playbackDeviceInfo.get(_t);St&&_e.push({deviceid:St.deviceid,devicename:St.devicename})})),_e}},{key:"_emitPlaybackListChanged",value:function _emitPlaybackListChanged(j,_e,_t){this.emit(wO.playbackDeviceListChanged,j,_e,_t)}},{key:"_emitRecordingListChanged",value:function _emitRecordingListChanged(j,_e,_t){this.emit(wO.recordingDeviceListChanged,j,_e,_t)}},{key:"_initializePlaybackDeviceList",value:(_t=_asyncToGenerator(device_regeneratorRuntime().mark((function _callee2(j){var _e,_t,St,Tt,Ut,_r=this;return device_regeneratorRuntime().wrap((function _callee2$(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.next=2,JR(MD().getPlaybackDevices(j));case 2:_e=_n.sent,_t=_slicedToArray(_e,2),St=_t[0],Tt=_t[1],St&&zE.shared.handleThrowableError(QE.RTC_ERR_ADM_GET_PLAYBACK_DEVICES_FAIL,St),Tt&&(Ut=[],Tt.forEach((function(j){if("default"!==j.deviceId){var _e={deviceid:j.deviceId,devicename:j.label};_r._playbackDeviceInfo.set(j.deviceId,_e),_r._playbackDeviceIds.add(j.deviceId),Ut.push(_e)}})),this._emitPlaybackListChanged(!0,Ut,this.speakerList)),MD().onPlaybackDeviceChanged=function(j){var _e={deviceid:j.device.deviceId,devicename:j.device.label};"ACTIVE"===j.state?(_r._playbackDeviceInfo.set(j.device.deviceId,_e),_r._playbackDeviceIds.add(j.device.deviceId),_r._emitPlaybackListChanged(!0,[_e],_r.speakerList)):"INACTIVE"===j.state&&(_r._playbackDeviceInfo.delete(j.device.deviceId),_r._playbackDeviceIds.delete(j.device.deviceId),_r._emitPlaybackListChanged(!1,[_e],_r.speakerList))};case 9:case"end":return _n.stop()}}),_callee2,this)}))),function _initializePlaybackDeviceList(j){return _t.apply(this,arguments)})},{key:"_initializeDeviceList",value:(_e=_asyncToGenerator(device_regeneratorRuntime().mark((function _callee3(j){var _e,_t,St,Tt,Ut,_r=this;return device_regeneratorRuntime().wrap((function _callee3$(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.next=2,JR(MD().getMicrophones(j));case 2:_e=_n.sent,_t=_slicedToArray(_e,2),St=_t[0],Tt=_t[1],St&&zE.shared.handleThrowableError(QE.RTC_ERR_ADM_GET_RECORD_DEVICES_FAIL,St),Tt&&(Ut=[],Tt.forEach((function(j){if("default"!==j.deviceId){var _e={deviceid:j.deviceId,devicename:j.label};_r._recordingDeviceInfo.set(j.deviceId,_e),_r._recordingDeviceIds.add(j.deviceId),Ut.push(_e)}})),this._emitRecordingListChanged(!0,Ut,this.microphoneList)),MD().onMicrophoneChanged=function(j){var _e={deviceid:j.device.deviceId,devicename:j.device.label};"ACTIVE"===j.state?(_r._recordingDeviceInfo.set(j.device.deviceId,_e),_r._recordingDeviceIds.add(j.device.deviceId),_r._emitRecordingListChanged(!0,[_e],_r.microphoneList)):"INACTIVE"===j.state&&(_r._recordingDeviceInfo.delete(j.device.deviceId),_r._recordingDeviceIds.delete(j.device.deviceId),_r._emitRecordingListChanged(!1,[_e],_r.microphoneList))};case 9:case"end":return _n.stop()}}),_callee3,this)}))),function _initializeDeviceList(j){return _e.apply(this,arguments)})},{key:"getAudioPlaybackDevices",value:function getAudioPlaybackDevices(){return this.speakerList}},{key:"getAudioRecordingDevices",value:function getAudioRecordingDevices(){return this.microphoneList}}]),RtcAudioDeviceManagerWeb}(NO);__webpack_require__(4197);function player_createForOfIteratorHelper(j,_e){var _t="undefined"!=typeof Symbol&&j[Symbol.iterator]||j["@@iterator"];if(!_t){if(Array.isArray(j)||(_t=function player_unsupportedIterableToArray(j,_e){if(!j)return;if("string"==typeof j)return player_arrayLikeToArray(j,_e);var _t=Object.prototype.toString.call(j).slice(8,-1);"Object"===_t&&j.constructor&&(_t=j.constructor.name);if("Map"===_t||"Set"===_t)return Array.from(j);if("Arguments"===_t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_t))return player_arrayLikeToArray(j,_e)}(j))||_e&&j&&"number"==typeof j.length){_t&&(j=_t);var St=0,Tt=function F(){};return{s:Tt,n:function n(){return St>=j.length?{done:!0}:{done:!1,value:j[St++]}},e:function e(j){throw j},f:Tt}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Ut,_r=!0,_n=!1;return{s:function s(){_t=_t.call(j)},n:function n(){var j=_t.next();return _r=j.done,j},e:function e(j){_n=!0,Ut=j},f:function f(){try{_r||null==_t.return||_t.return()}finally{if(_n)throw Ut}}}}function player_arrayLikeToArray(j,_e){(null==_e||_e>j.length)&&(_e=j.length);for(var _t=0,St=new Array(_e);_t<_e;_t++)St[_t]=j[_t];return St}function player_createSuper(j){var _e=function player_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var YN,XN,$N,cP,uP,lP,dP,fP,pP,gP,vP=function(j){_inherits(AGWebAudioPlayer,j);var _e=player_createSuper(AGWebAudioPlayer);function AGWebAudioPlayer(){var j;return _classCallCheck(this,AGWebAudioPlayer),(j=_e.call(this))._audioContext=void 0,j._audioTagId=qE(),j._playingSourceNode=void 0,j._analyserNode=void 0,j._volumePollingTask=void 0,j._initialized=!1,j._initialize(),j}return _createClass(AGWebAudioPlayer,[{key:"_initialize",value:function _initialize(){try{window.AudioContext=window.AudioContext||window.webkitAudioContext,this._audioContext=new AudioContext,this._analyserNode=this._audioContext.createAnalyser(),this._analyserNode.smoothingTimeConstant=.3,this._analyserNode.fftSize=1024,"running"===this._audioContext.state&&(this._initialized=!0)}catch(j){ME.error("[audio player] initialize audio context failed ".concat(j,"."))}}},{key:"_getAudioVirtualDom",value:function _getAudioVirtualDom(){if(document){var j=document.getElementById(this._audioTagId);if(!j){var _e=document.createElement("audio");_e.id=this._audioTagId,_e.hidden=!0,document.body.appendChild(_e),j=_e}return j}ME.error("[audio player] audio element creation failed.")}},{key:"play",value:function play(j){var _e=this;this._initialized||this._initialize(),this.stop();var _t=this._audioContext,St=this._getAudioVirtualDom();if(St&&_t){var Tt=_t.createMediaElementSource(St);if(Tt.connect(_t.destination),St.src=j,this._analyserNode){var Ut=this._analyserNode;Tt.connect(Ut);var _r=new Float32Array(Ut.fftSize);this._volumePollingTask=_R.addPollingTask((function(){Ut.getFloatTimeDomainData(_r);var j,_t=0,St=player_createForOfIteratorHelper(_r);try{for(St.s();!(j=St.n()).done;){var Tt=j.value;_t+=Tt*Tt}}catch(j){St.e(j)}finally{St.f()}var _n=Math.sqrt(_t/_r.length);_e.emit(wO.localAudioPlaybackVolumeIndicator,Math.min(_n,1))}),pR.second(.2))}St.addEventListener("ended",(function(){_e.stop()})),this._playingSourceNode=Tt,St.play()}else ME.error("[audio player] start audio playback test failed.")}},{key:"stop",value:function stop(){var j=this._audioContext,_e=this._getAudioVirtualDom();if(_e&&j){var _t;if(_e.pause(),_e.currentTime=0,this._analyserNode)try{var St;null===(St=this._playingSourceNode)||void 0===St||St.disconnect(this._analyserNode)}catch(j){ME.warn("[audio player] failed to detach analyser node")}if(this._audioContext)try{var Tt;null===(Tt=this._playingSourceNode)||void 0===Tt||Tt.disconnect(j.destination)}catch(j){ME.warn("[audio player] failed to detach audio context")}null===(_t=this._volumePollingTask)||void 0===_t||_t.stop(),this._volumePollingTask=void 0,_e.remove(),this.emit(wO.localAudioPlaybackVolumeIndicator,0)}}}]),AGWebAudioPlayer}(_a),mP=(YN=TS.attach({proxyMethods:!1}),XN=TS.trace,$N=TS.trace,cP=TS.trace,YN((dP=function(){function AGAudioRawDataDispatcher(){_classCallCheck(this,AGAudioRawDataDispatcher),this.logger=void 0,this._microphoneTrackRawDataObservers=new Set,this._audioTrackRawDataObservers=new Set,this._eventBus=new _a,this._configs={},this._state=0}return _createClass(AGAudioRawDataDispatcher,[{key:"setConfig",value:function setConfig(j,_e){this._configs[_e]=j}},{key:"isStarted",get:function get(){return 1===this._state}},{key:"microphoneTrackRawDataConfig",get:function get(){var j;return null!==(j=this._configs[iO.record])&&void 0!==j?j:{frameSize:AGAudioRawDataDispatcher.DEFAULT_FRAME_SIZE}}},{key:"audioTrackRawDataConfig",get:function get(){var j;return null!==(j=this._configs[iO.beforeMixed])&&void 0!==j?j:{frameSize:AGAudioRawDataDispatcher.DEFAULT_FRAME_SIZE}}},{key:"hasMicrophoneRawDataObservers",get:function get(){return!!this._microphoneTrackRawDataObservers.size}},{key:"hasAudioTrackRawDataObservers",get:function get(){return!!this._audioTrackRawDataObservers.size}},{key:"_callbackAudioRawRecorded",value:function _callbackAudioRawRecorded(j){this._microphoneTrackRawDataObservers.forEach((function(_e){_e(j)}))}},{key:"_callbackAudioRawBeforeMixed",value:function _callbackAudioRawBeforeMixed(j,_e,_t){this._audioTrackRawDataObservers.forEach((function(St){St(j,_e,_t)}))}},{key:"start",value:function start(){this._state=1,this.register("AudioRawDataBeforeMixed",this._callbackAudioRawBeforeMixed),this.register("AudioRawDataRecored",this._callbackAudioRawRecorded),this.dispatch("Start")}},{key:"stop",value:function stop(){this._state=0,this.unregister("AudioRawDataBeforeMixed",this._callbackAudioRawBeforeMixed),this.unregister("AudioRawDataRecored",this._callbackAudioRawRecorded),this.dispatch("Stop")}},{key:"dispatch",value:function dispatch(j){if(this.isStarted){for(var _e,_t=arguments.length,St=new Array(_t>1?_t-1:0),Tt=1;Tt<_t;Tt++)St[Tt-1]=arguments[Tt];this.logger.debug("event: ".concat(j,", params:"),St),(_e=this._eventBus).emit.apply(_e,[j].concat(St))}}},{key:"register",value:function register(j,_e){this._eventBus.on(j,_e)}},{key:"unregister",value:function unregister(j,_e){this._eventBus.off(j,_e)}},{key:"addAudioRawDataObserver",value:function addAudioRawDataObserver(j,_e){_e===iO.record&&this._microphoneTrackRawDataObservers.add(j.onAudioRawDataRecored),_e===iO.beforeMixed&&this._audioTrackRawDataObservers.add(j.onAudioRawDataBeforeMixed),this.dispatch("ObserverChanged",_e)}},{key:"removeAudioRawDataObserver",value:function removeAudioRawDataObserver(j,_e){_e===iO.record&&this._microphoneTrackRawDataObservers.delete(j.onAudioRawDataRecored),_e===iO.beforeMixed&&this._audioTrackRawDataObservers.delete(j.onAudioRawDataBeforeMixed),this.dispatch("ObserverChanged",_e)}}]),AGAudioRawDataDispatcher}(),dP.DEFAULT_FRAME_SIZE=1024,_applyDecoratedDescriptor((lP=dP).prototype,"setConfig",[XN],Object.getOwnPropertyDescriptor(lP.prototype,"setConfig"),lP.prototype),_applyDecoratedDescriptor(lP.prototype,"_callbackAudioRawRecorded",[RS],Object.getOwnPropertyDescriptor(lP.prototype,"_callbackAudioRawRecorded"),lP.prototype),_applyDecoratedDescriptor(lP.prototype,"_callbackAudioRawBeforeMixed",[RS],Object.getOwnPropertyDescriptor(lP.prototype,"_callbackAudioRawBeforeMixed"),lP.prototype),_applyDecoratedDescriptor(lP.prototype,"start",[$N],Object.getOwnPropertyDescriptor(lP.prototype,"start"),lP.prototype),_applyDecoratedDescriptor(lP.prototype,"stop",[cP],Object.getOwnPropertyDescriptor(lP.prototype,"stop"),lP.prototype),uP=lP))||uP);function web_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */web_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function web_ownKeys(j,_e){var _t=Object.keys(j);if(Object.getOwnPropertySymbols){var St=Object.getOwnPropertySymbols(j);_e&&(St=St.filter((function(_e){return Object.getOwnPropertyDescriptor(j,_e).enumerable}))),_t.push.apply(_t,St)}return _t}function web_objectSpread(j){for(var _e=1;_e<arguments.length;_e++){var _t=null!=arguments[_e]?arguments[_e]:{};_e%2?web_ownKeys(Object(_t),!0).forEach((function(_e){_defineProperty(j,_e,_t[_e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(_t)):web_ownKeys(Object(_t)).forEach((function(_e){Object.defineProperty(j,_e,Object.getOwnPropertyDescriptor(_t,_e))}))}return j}function web_createSuper(j){var _e=function web_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var yP,AP,_P,bP,EP,wP,SP,IP,TP,CP,RP,kP,OP,DP,LP=TS.attach({proxyMethods:!1})((pP=function(j){_inherits(RtcAdapterWeb,j);var _e=web_createSuper(RtcAdapterWeb);function RtcAdapterWeb(j){var _t;return _classCallCheck(this,RtcAdapterWeb),(_t=_e.call(this)).logger=void 0,_t._channels=new Map,_t._vdm=new WN(_assertThisInitialized(_t),KS.shared.rtcConfigs.noDevicePermission),_t._adm=new HN(_assertThisInitialized(_t),KS.shared.rtcConfigs.noDevicePermission),_t._audioRawDataDispatcher=new mP,_t._audioPlayer=new vP,_t.cameraThread=new xN,_t.micThread=new LN(_t._audioRawDataDispatcher),_t.screenThread=new NN,_t.remoteCanvas=new Map,_t._configs=void 0,_t._configs=j,SE.DEBUG===KS.logLevel?MD().enableLogUpload():MD().disableLogUpload(),MD().setLogLevel(RtcAdapterWeb.getLogLevel()),KS.shared.rtcSDKExtensions.length>0&&(ME.info("register extensions for WebRTC SDK",KS.shared.rtcSDKExtensions),MD().registerExtensions(KS.shared.rtcSDKExtensions.map((function(j){return j.instance})))),_t._audioRawDataDispatcher.start(),_t}return _createClass(RtcAdapterWeb,[{key:"configs",get:function get(){var j,_e,_t=(j={},_defineProperty(j,TE.LiveBroadcasting,"live"),_defineProperty(j,TE.Communication,"rtc"),j)[this.channelProfile]||"live",St=(_e={},_defineProperty(_e,qS.Low,1),_defineProperty(_e,qS.UltraLow,2),_e)[KS.shared.latencyLevel];return web_objectSpread(web_objectSpread(web_objectSpread({},RtcAdapterWeb.defaultConfigs),this._configs),{},{mode:_t,latencyLevel:St})}},{key:"channelProfile",get:function get(){var j;return null!==(j=KS.shared.rtcConfigs.channelProfile)&&void 0!==j?j:TE.LiveBroadcasting}},{key:"createRtcChannel",value:function createRtcChannel(j,_e){var _t=this._channels.get(j);return _t||(_t=new NP(j,this.configs,_e,this._audioRawDataDispatcher),this._channels.set(j,_t)),_t}},{key:"getVideoDeviceManager",value:function getVideoDeviceManager(){return this._vdm}},{key:"setVideoCameraDevice",value:function setVideoCameraDevice(j){return this.cameraThread.setDevice(j),this.cameraThread.run(),0}},{key:"setAudioRecordingDevice",value:function setAudioRecordingDevice(j){return this.micThread.setRecordingDevice(j),this.micThread.run(),0}},{key:"setAudioPlaybackDevice",value:function setAudioPlaybackDevice(j){throw new Error("Method not implemented.")}},{key:"getAudioDeviceManager",value:function getAudioDeviceManager(){return this._adm}},{key:"getWindowDevices",value:function getWindowDevices(){throw new Error("Method not supported.")}},{key:"getDiaplayDevices",value:function getDiaplayDevices(){throw new Error("Method not supported.")}},{key:"isScreenDeviceEnumerateSupported",value:function isScreenDeviceEnumerateSupported(){return!1}},{key:"enableLocalVideo",value:function enableLocalVideo(j){return this.cameraThread.cameraEnable=j,this.cameraThread.run(),0}},{key:"enableLocalAudio",value:function enableLocalAudio(j){return this.micThread.micEnable=j,this.micThread.run(),0}},{key:"setupLocalVideo",value:function setupLocalVideo(j,_e){return _e===bR.Camera?(this.cameraThread.canvas=j,this.cameraThread.run()):(this.screenThread.canvas=j,this.screenThread.run()),0}},{key:"setupRemoteVideo",value:function setupRemoteVideo(j){if(!j.channelName)return zE.shared.handleThrowableError(QE.RTC_ERR_NO_CHANNEL_EXISTS,new Error("invalid canvas w/o canvas name")),-1;this.remoteCanvas.set("".concat(j.streamUuid,"-").concat(j.channelName),j);var _e=this._channels.get(j.channelName),_t=null==_e?void 0:_e.main.videoSubscribeThread(j.streamUuid);return _t&&_t.play(),0}},{key:"startAudioRecordingDeviceTest",value:function startAudioRecordingDeviceTest(j){return this.logger.warn("web platform does not support this, it silence the error as recording device can be started testing w/o this api"),0}},{key:"stopAudioRecordingDeviceTest",value:function stopAudioRecordingDeviceTest(){return this.logger.warn("web platform does not support this, it silence the error as recording device can be started testing w/o this api"),0}},{key:"startAudioPlaybackDeviceTest",value:function startAudioPlaybackDeviceTest(j){return this._audioPlayer.play(j),0}},{key:"stopAudioPlaybackDeviceTest",value:function stopAudioPlaybackDeviceTest(){return this._audioPlayer.stop(),0}},{key:"startScreenCapture",value:function startScreenCapture(j){return this.screenThread.screenEnable=!0,this.screenThread.withAudio=!(null==j||!j.withAudio),this.screenThread.run(),0}},{key:"stopScreenCapture",value:function stopScreenCapture(){return this.screenThread.screenEnable=!1,this.screenThread.run(),0}},{key:"onAutoplayFailed",value:function onAutoplayFailed(j){return MD().onAutoplayFailed=j,0}},{key:"onLocalAudioPlaybackTestVolumeChanged",value:function onLocalAudioPlaybackTestVolumeChanged(j){return this._audioPlayer.on(wO.localAudioPlaybackVolumeIndicator,j),0}},{key:"onLocalVideoTrackStateChanged",value:function onLocalVideoTrackStateChanged(j){return this.cameraThread.on(wO.trackStateChanged,j),0}},{key:"onLocalAudioTrackStateChanged",value:function onLocalAudioTrackStateChanged(j){return this.micThread.on(wO.trackStateChanged,j),0}},{key:"onLocalScreenShareTrackStateChanged",value:function onLocalScreenShareTrackStateChanged(j){return this.screenThread.on(wO.trackStateChanged,j),0}},{key:"onLocalAudioVolume",value:function onLocalAudioVolume(j){return this.micThread.on(wO.localAudioVolume,j),0}},{key:"setBeautyEffectOptions",value:function setBeautyEffectOptions(j,_e){return this.logger.warn("web platform does not support this"),0}},{key:"setAudioFrameCallback",value:function setAudioFrameCallback(){return this._audioRawDataDispatcher.start(),0}},{key:"stopAudioFrameCallback",value:function stopAudioFrameCallback(){return this._audioRawDataDispatcher.stop(),0}},{key:"addAudioRawDataObserver",value:function addAudioRawDataObserver(j,_e){return this._audioRawDataDispatcher.addAudioRawDataObserver(j,_e),0}},{key:"removeAudioRawDataObserver",value:function removeAudioRawDataObserver(j,_e){return this._audioRawDataDispatcher.removeAudioRawDataObserver(j,_e),0}},{key:"setAudioRawDataConfig",value:function setAudioRawDataConfig(j,_e){return this._audioRawDataDispatcher.setConfig(j,_e),0}},{key:"hasScreenSharePermission",value:function hasScreenSharePermission(){return!0}},{key:"takeSnapshot",value:function takeSnapshot(j,_e,_t){return this.logger.warn("web platform does not support this"),Promise.reject()}},{key:"getCurrentFrameData",value:function getCurrentFrameData(j,_e,_t){if(_t)return this.cameraThread.track.getCurrentFrameData();try{return this._channels.get(j).getCurrentFrameData(_e)}catch(_t){return this.logger.error("getCurrentFrameData from channel: ".concat(j," stream: ").concat(_e," failed")),new ImageData(1,1)}}},{key:"addCameraProcessors",value:function addCameraProcessors(j){return this.cameraThread.addProcessors(j),0}},{key:"removeCameraProcessors",value:function removeCameraProcessors(){return this.cameraThread.removeProcessors(),0}},{key:"addMicrophoneProcessors",value:function addMicrophoneProcessors(j){return this.micThread.addProcessors(j),0}},{key:"removeMicrophoneProcessors",value:function removeMicrophoneProcessors(){return this.micThread.removeProcessors(),0}},{key:"destroy",value:function destroy(){return this._channels.forEach((function(j){return j.leave()})),this._channels.clear(),this.enableLocalVideo(!1),this.enableLocalAudio(!1),this.stopScreenCapture(),0}}],[{key:"getLogLevel",value:function getLogLevel(){switch(KS.logLevel){case SE.DEBUG:return 0;case SE.INFO:return 1;case SE.WARN:return 2;case SE.ERROR:return 3;default:return 4}}},{key:"getRtcVersion",value:function getRtcVersion(){return MD().VERSION}}]),RtcAdapterWeb}(BO),pP.defaultConfigs={codec:"vp8",mode:"live",latencyLevel:2},fP=pP))||fP,NP=TS.attach({proxyMethods:!1})(gP=function(j){_inherits(RtcChannelAdapterWeb,j);var _e,_t,St=web_createSuper(RtcChannelAdapterWeb);function RtcChannelAdapterWeb(j,_e,_t,Tt){var Ut;return _classCallCheck(this,RtcChannelAdapterWeb),(Ut=St.call(this)).logger=void 0,Ut.main=void 0,Ut.sub=void 0,Ut.channelName=void 0,Ut.channelName=j,Ut.main=new qN(j,_e,_t,TR.main,Tt),Ut.sub=new KN(j,_e,_t,TR.sub,Tt),Ut}return _createClass(RtcChannelAdapterWeb,[{key:"getSessionId",value:function getSessionId(){return this.main.getClientSessionId()}},{key:"client",value:function client(j){return j===TR.main?this.main:this.sub}},{key:"setLatencyLevel",value:function setLatencyLevel(j){this.main.setLatencyLevel(j),this.sub.setLatencyLevel(j)}},{key:"muteRemoteVideoMass",value:function muteRemoteVideoMass(j,_e){return this.main.muteRemoteVideoMass(j,_e)}},{key:"join",value:(_t=_asyncToGenerator(web_regeneratorRuntime().mark((function _callee(j,_e,_t){return web_regeneratorRuntime().wrap((function _callee$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,this.client(_t).join(KS.shared.appId,j,_e);case 2:_t===TR.sub&&(this.main.muteRemoteVideo(_e,!0),this.main.muteRemoteAudio(_e,!0));case 3:case"end":return St.stop()}}),_callee,this)}))),function join(j,_e,St){return _t.apply(this,arguments)})},{key:"leave",value:(_e=_asyncToGenerator(web_regeneratorRuntime().mark((function _callee2(j){var _e,_t,St,Tt,Ut;return web_regeneratorRuntime().wrap((function _callee2$(_r){for(;;)switch(_r.prev=_r.next){case 0:if(!this.sub.ready){_r.next=7;break}return _r.next=3,JR(this.sub.leave());case 3:_t=_r.sent,St=_slicedToArray(_t,1),(_e=St[0])&&zE.shared.handleNonThrowableError(QE.RTC_ERR_LEAVE_SUB_CHANNEL_FAIL,_e);case 7:if(j===TR.sub){_r.next=14;break}return _r.next=10,JR(this.main.leave());case 10:Tt=_r.sent,Ut=_slicedToArray(Tt,1),(_e=Ut[0])&&zE.shared.handleNonThrowableError(QE.RTC_ERR_LEAVE_MAIN_CHANNEL_FAIL,_e);case 14:case"end":return _r.stop()}}),_callee2,this)}))),function leave(j){return _e.apply(this,arguments)})},{key:"enableDualStream",value:function enableDualStream(j,_e){return this.client(_e).enableDualStream(j)}},{key:"setLowStreamParameter",value:function setLowStreamParameter(j,_e){return this.client(_e).setLowStreamParameter(j),0}},{key:"setRemoteVideoStreamType",value:function setRemoteVideoStreamType(j,_e,_t){return this.client(_t).setRemoteVideoStreamType(j,_e)}},{key:"muteLocalVideo",value:function muteLocalVideo(j,_e){return this.logger.info("muteLocalVideo ".concat(j)),this.client(_e).muteLocalVideo(j)}},{key:"muteLocalAudio",value:function muteLocalAudio(j,_e){return this.logger.info("muteLocalAudio ".concat(j)),this.client(_e).muteLocalAudio(j)}},{key:"muteLocalScreenShare",value:function muteLocalScreenShare(j,_e){return this.logger.info("muteLocalScreenShare ".concat(j)),this.client(_e).muteLocalScreenShare(j)}},{key:"muteRemoteVideo",value:function muteRemoteVideo(j,_e){return this.logger.info("muteRemoteVideo ".concat(j," ").concat(_e)),this.main.muteRemoteVideo(j,_e)}},{key:"muteRemoteAudio",value:function muteRemoteAudio(j,_e){return this.logger.info("muteRemoteAudio ".concat(j," ").concat(_e)),this.main.muteRemoteAudio(j,_e)}},{key:"getCurrentFrameData",value:function getCurrentFrameData(j){try{return this.main.videoSubscribeThread(j).track.getCurrentFrameData()}catch(_e){return this.logger.error("getCurrentFrameData from stream: ".concat(j," failed")),new ImageData(1,1)}}},{key:"onNetworkStats",value:function onNetworkStats(j){return this.main.on("network-stats-changed",j),0}},{key:"onAudioVolumeIndication",value:function onAudioVolumeIndication(j){return this.main.on("audio-volume-indication",j),0}},{key:"onConnectionStateChanged",value:function onConnectionStateChanged(j){return this.main.on("rtc-connection-state-changed",j),this.sub.on("rtc-connection-state-changed",j),0}}]),RtcChannelAdapterWeb}(PO))||gP,PP=function(){function RtcAdapterFactory(){_classCallCheck(this,RtcAdapterFactory)}return _createClass(RtcAdapterFactory,null,[{key:"getAdapter",value:function getAdapter(j,_e){switch(j){case FS.Electron:return new AD;case FS.Web:return new LP(null==_e?void 0:_e.web)}}}]),RtcAdapterFactory}(),MP=(yP=TS.attach(),AP=TS.silence,_P=TS.silence,bP=TS.silence,EP=TS.silence,wP=TS.silence,SP=TS.silence,IP=TS.silence,TP=TS.silence,CP=TS.silence,RP=TS.silence,kP=TS.silence,yP((DP=function(){function AGRtcManager(j){_classCallCheck(this,AGRtcManager),this._adapter=void 0,this._channels=new Map,this._adapter=PP.getAdapter(KS.platform,j)}return _createClass(AGRtcManager,[{key:"getRtcChannel",value:function getRtcChannel(j){var _e=this._channels.get(j);if(!_e){var _t=this._adapter.createRtcChannel(j,this._adapter);_e=new WR(j,_t),this._channels.set(j,_e)}return _e}},{key:"getVideoDeviceManager",value:function getVideoDeviceManager(){return this._adapter.getVideoDeviceManager()}},{key:"getAudioDeviceManager",value:function getAudioDeviceManager(){return this._adapter.getAudioDeviceManager()}},{key:"getWindowDevices",value:function getWindowDevices(){return this._adapter.getWindowDevices()}},{key:"getDisplayDevices",value:function getDisplayDevices(){return this._adapter.getDiaplayDevices()}},{key:"isScreenDeviceEnumerateSupported",value:function isScreenDeviceEnumerateSupported(){return this._adapter.isScreenDeviceEnumerateSupported()}},{key:"setVideoCameraDevice",value:function setVideoCameraDevice(j){return this._adapter.setVideoCameraDevice(j)}},{key:"setAudioRecordingDevice",value:function setAudioRecordingDevice(j){return this._adapter.setAudioRecordingDevice(j)}},{key:"setAudioPlaybackDevice",value:function setAudioPlaybackDevice(j){return this._adapter.setAudioPlaybackDevice(j)}},{key:"enableLocalVideo",value:function enableLocalVideo(j){return this._adapter.enableLocalVideo(j)}},{key:"setupLocalVideo",value:function setupLocalVideo(j,_e){return j.view.style.setProperty("transform",j.mirror?"rotateY(180deg)":""),this._adapter.setupLocalVideo(j,_e)}},{key:"setupRemoteVideo",value:function setupRemoteVideo(j){return j.view.style.setProperty("transform",j.mirror?"rotateY(180deg)":""),this._adapter.setupRemoteVideo(j)}},{key:"enableLocalAudio",value:function enableLocalAudio(j){return this._adapter.enableLocalAudio(j)}},{key:"startScreenCapture",value:function startScreenCapture(j){return this._adapter.startScreenCapture(j)}},{key:"stopScreenCapture",value:function stopScreenCapture(){return this._adapter.stopScreenCapture()}},{key:"onLocalScreenShareTrackStateChanged",value:function onLocalScreenShareTrackStateChanged(j){return this._adapter.onLocalScreenShareTrackStateChanged(j)}},{key:"startAudioRecordingDeviceTest",value:function startAudioRecordingDeviceTest(j){return this._adapter.startAudioRecordingDeviceTest(j)}},{key:"stopAudioRecordingDeviceTest",value:function stopAudioRecordingDeviceTest(){return this._adapter.stopAudioRecordingDeviceTest()}},{key:"startAudioPlaybackDeviceTest",value:function startAudioPlaybackDeviceTest(j){return this._adapter.startAudioPlaybackDeviceTest(j)}},{key:"stopAudioPlaybackDeviceTest",value:function stopAudioPlaybackDeviceTest(){return this._adapter.stopAudioPlaybackDeviceTest()}},{key:"onAutoPlayFailed",value:function onAutoPlayFailed(j){return this._adapter.onAutoplayFailed(j)}},{key:"onLocalCameraListChanged",value:function onLocalCameraListChanged(j){return this._adapter.getVideoDeviceManager().onLocalCameraListChanged(j)}},{key:"onLocalRecordingDeviceListChanged",value:function onLocalRecordingDeviceListChanged(j){return this._adapter.getAudioDeviceManager().onLocalRecordingDeviceListChanged(j)}},{key:"onLocalPlaybackListChanged",value:function onLocalPlaybackListChanged(j){return this._adapter.getAudioDeviceManager().onLocalPlaybackDeviceListChanged(j)}},{key:"onLocalVideoTrackStateChanged",value:function onLocalVideoTrackStateChanged(j){return this._adapter.getVideoDeviceManager().onLocalVideoTrackStateChanged(j)}},{key:"onLocalAudioTrackStateChanged",value:function onLocalAudioTrackStateChanged(j){return this._adapter.getAudioDeviceManager().onLocalAudioTrackStateChanged(j)}},{key:"onLocalAudioVolume",value:function onLocalAudioVolume(j){return this._adapter.getAudioDeviceManager().onLocalAudioVolume(j)}},{key:"setBeautyEffectOptions",value:function setBeautyEffectOptions(j,_e){return this._adapter.setBeautyEffectOptions(j,_e)}},{key:"setAudioRawDataConfig",value:function setAudioRawDataConfig(j,_e){return this._adapter.setAudioRawDataConfig(j,_e)}},{key:"addAudioRawDataObserver",value:function addAudioRawDataObserver(j,_e){return this._adapter.addAudioRawDataObserver(j,_e)}},{key:"removeAudioRawDataObserver",value:function removeAudioRawDataObserver(j,_e){return this._adapter.removeAudioRawDataObserver(j,_e)}},{key:"hasScreenSharePermission",value:function hasScreenSharePermission(){return this._adapter.hasScreenSharePermission()}},{key:"takeSnapshot",value:function takeSnapshot(j,_e,_t){return this._adapter.takeSnapshot(j,_e,_t)}},{key:"getCurrentFrameData",value:function getCurrentFrameData(j,_e,_t){return this._adapter.getCurrentFrameData(j,_e,_t)}},{key:"addCameraProcessors",value:function addCameraProcessors(j){return this._adapter.addCameraProcessors(j)}},{key:"removeCameraProcessors",value:function removeCameraProcessors(){return this._adapter.removeCameraProcessors()}},{key:"addMicrophoneProcessors",value:function addMicrophoneProcessors(j){return this._adapter.addMicrophoneProcessors(j)}},{key:"removeMicrophoneProcessors",value:function removeMicrophoneProcessors(){return this._adapter.removeMicrophoneProcessors()}},{key:"destroy",value:function destroy(){return this._adapter.destroy()}}]),AGRtcManager}(),_applyDecoratedDescriptor(DP.prototype,"getRtcChannel",[AP],Object.getOwnPropertyDescriptor(DP.prototype,"getRtcChannel"),DP.prototype),_applyDecoratedDescriptor(DP.prototype,"getVideoDeviceManager",[_P],Object.getOwnPropertyDescriptor(DP.prototype,"getVideoDeviceManager"),DP.prototype),_applyDecoratedDescriptor(DP.prototype,"getAudioDeviceManager",[bP],Object.getOwnPropertyDescriptor(DP.prototype,"getAudioDeviceManager"),DP.prototype),_applyDecoratedDescriptor(DP.prototype,"onLocalScreenShareTrackStateChanged",[EP],Object.getOwnPropertyDescriptor(DP.prototype,"onLocalScreenShareTrackStateChanged"),DP.prototype),_applyDecoratedDescriptor(DP.prototype,"onAutoPlayFailed",[wP],Object.getOwnPropertyDescriptor(DP.prototype,"onAutoPlayFailed"),DP.prototype),_applyDecoratedDescriptor(DP.prototype,"onLocalCameraListChanged",[SP],Object.getOwnPropertyDescriptor(DP.prototype,"onLocalCameraListChanged"),DP.prototype),_applyDecoratedDescriptor(DP.prototype,"onLocalRecordingDeviceListChanged",[IP],Object.getOwnPropertyDescriptor(DP.prototype,"onLocalRecordingDeviceListChanged"),DP.prototype),_applyDecoratedDescriptor(DP.prototype,"onLocalPlaybackListChanged",[TP],Object.getOwnPropertyDescriptor(DP.prototype,"onLocalPlaybackListChanged"),DP.prototype),_applyDecoratedDescriptor(DP.prototype,"onLocalVideoTrackStateChanged",[CP],Object.getOwnPropertyDescriptor(DP.prototype,"onLocalVideoTrackStateChanged"),DP.prototype),_applyDecoratedDescriptor(DP.prototype,"onLocalAudioTrackStateChanged",[RP],Object.getOwnPropertyDescriptor(DP.prototype,"onLocalAudioTrackStateChanged"),DP.prototype),_applyDecoratedDescriptor(DP.prototype,"onLocalAudioVolume",[kP],Object.getOwnPropertyDescriptor(DP.prototype,"onLocalAudioVolume"),DP.prototype),OP=DP))||OP),BP=__webpack_require__(3977),UP=__webpack_require__.n(BP),GP=__webpack_require__(9644),qP=__webpack_require__.n(GP);function oss_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */oss_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}var KP=(new(__webpack_require__(6353).UAParser)).getResult(),WP=function(){function OSSFileUploader(j,_e){_classCallCheck(this,OSSFileUploader),this._appId=j,this._tagInfo=_e,this._adapter=void 0,this._adapter=new HP(this._appId,this._tagInfo)}var j;return _createClass(OSSFileUploader,[{key:"upload",value:(j=_asyncToGenerator(oss_regeneratorRuntime().mark((function _callee(j,_e){return oss_regeneratorRuntime().wrap((function _callee$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.next=2,this._adapter.upload(j,_e);case 2:case"end":return _t.stop()}}),_callee,this)}))),function upload(_e,_t){return j.apply(this,arguments)})}]),OSSFileUploader}(),HP=function(){function OSSUploader(j,_e){_classCallCheck(this,OSSUploader),this._appId=j,this._tagInfo=_e,this._apiService=new NS,this._checkpoints=new Map}var j,_e,_t,St;return _createClass(OSSUploader,[{key:"_uploadByAli",value:(St=_asyncToGenerator(oss_regeneratorRuntime().mark((function _callee2(j,_e,_t,St){var Tt,Ut,_r,_n,_i,Ei,Ci,Di,Fi,_o,ga,_a,_s,_c,kc=this;return oss_regeneratorRuntime().wrap((function _callee2$(_u){for(;;)switch(_u.prev=_u.next){case 0:return Tt=_t.ossKey,Ut=_t.accessKeyId,_r=_t.accessKeySecret,_n=_t.bucketName,_i=_t.ossEndpoint,Ei=_t.securityToken,Ci=St.callbackHost,Di=St.callbackBody,Fi=St.callbackContentType,_o=new(UP())({accessKeyId:Ut,accessKeySecret:_r,bucket:_n,endpoint:_i,secure:!0,stsToken:Ei}),ga=this._checkpoints.get(_e),_a="".concat(Ci,"/monitor/apps/").concat(this._appId,"/v1/log/oss/callback"),_u.next=7,_o.multipartUpload(Tt,j,{progress:function progress(j,_t){kc._checkpoints.set(_e,_t)},callback:{url:_a,body:Di,contentType:Fi},checkpoint:ga});case 7:if(_s=_u.sent,200===(_c=_s.res).status){_u.next=11;break}throw new Error("upload to ali oss error, status is ".concat(_c.status));case 11:this._checkpoints.delete(_e),_o.generateObjectUrl(Tt);case 13:case"end":return _u.stop()}}),_callee2,this)}))),function _uploadByAli(j,_e,_t,Tt){return St.apply(this,arguments)})},{key:"_uploadByAws",value:(_t=_asyncToGenerator(oss_regeneratorRuntime().mark((function _callee3(j,_e,_t,St){var Tt,Ut,_r,_n,_i,Ei;return oss_regeneratorRuntime().wrap((function _callee3$(Ci){for(;;)switch(Ci.prev=Ci.next){case 0:return Tt=_t.preSignedUrl,Ut=St.callbackHost,_r=St.callbackBody,_n=St.callbackContentType,_i="".concat(Ut,"/monitor/apps/").concat(this._appId,"/v1/log/oss/callback"),Ci.next=5,qP().put(Tt,j,{headers:{"Content-Type":j.type}});case 5:return Ci.next=7,qP().post(_i,JSON.parse(_r),{headers:_defineProperty({},"content-type",_n)});case 7:if(200===(Ei=Ci.sent).status){Ci.next=10;break}throw new Error("upload to aws oss error, status is ".concat(Ei.status));case 10:this._checkpoints.delete(_e);case 11:case"end":return Ci.stop()}}),_callee3,this)}))),function _uploadByAws(j,_e,St,Tt){return _t.apply(this,arguments)})},{key:"_fetchStsToken",value:(_e=_asyncToGenerator(oss_regeneratorRuntime().mark((function _callee4(j,_e){var _t,St,Tt,Ut,_r,_n,_i;return oss_regeneratorRuntime().wrap((function _callee4$(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return _t=(new Date).getTime(),St={appId:KS.shared.appId,appVersion:KS.version,deviceName:KP.os.name,deviceVersion:KP.os.version,fileExt:_e,platform:"web",tag:j},Tt=JSON.stringify(St),Ut="7AIsPeMJgQAppO0Z"+Tt+_t,_r=MS()(Ut),Ei.next=8,this._apiService.fetch({host:"https://api.sd-rtn.com",path:"/monitor/v1/log/oss/policy",data:St,method:"POST",headers:{sign:_r,timestamp:_t}});case 8:return _n=Ei.sent,_i=_n.data,Ei.abrupt("return",{bucketName:_i.bucketName,callbackBody:_i.callbackBody,callbackContentType:_i.callbackContentType,accessKeyId:_i.accessKeyId,accessKeySecret:_i.accessKeySecret,securityToken:_i.securityToken,ossKey:_i.ossKey,callbackHost:_i.callbackHost,preSignedUrl:_i.preSignedUrl,vendor:_i.vendor,ossEndpoint:_i.ossEndpoint});case 11:case"end":return Ei.stop()}}),_callee4,this)}))),function _fetchStsToken(j,_t){return _e.apply(this,arguments)})},{key:"upload",value:(j=_asyncToGenerator(oss_regeneratorRuntime().mark((function _callee5(j,_e){var _t,St,Tt,Ut,_r,_n,_i,Ei,Ci,Di,Fi,_o,ga,_a,_s,_c,kc;return oss_regeneratorRuntime().wrap((function _callee5$(_u){for(;;)switch(_u.prev=_u.next){case 0:return _u.next=2,this._fetchStsToken(this._tagInfo,_e);case 2:if(_t=_u.sent,St=_t.vendor,1!==(Tt=void 0===St?-1:St)){_u.next=10;break}return Ut=_t.ossKey,_r=_t.callbackBody,_n=_t.callbackContentType,_i=_t.callbackHost,Ei=_t.preSignedUrl,_u.next=8,this._uploadByAws(j,Ut,{preSignedUrl:Ei},{callbackBody:_r,callbackContentType:_n,callbackHost:_i});case 8:case 14:_u.next=17;break;case 10:if(2!==Tt){_u.next=16;break}return Ci=_t.accessKeyId,Di=_t.accessKeySecret,Fi=_t.bucketName,_o=_t.ossEndpoint,ga=_t.securityToken,_a=_t.ossKey,_s=_t.callbackBody,_c=_t.callbackContentType,kc=_t.callbackHost,_u.next=14,this._uploadByAli(j,_a,{accessKeyId:Ci,accessKeySecret:Di,bucketName:Fi,ossEndpoint:_o,securityToken:ga,ossKey:_a},{callbackBody:_s,callbackContentType:_c,callbackHost:kc});case 16:throw new Error("vendor ".concat(Tt," is not supported"));case 17:case"end":return _u.stop()}}),_callee5,this)}))),function upload(_e,_t){return j.apply(this,arguments)})}]),OSSUploader}();function log_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */log_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function log_createSuper(j){var _e=function log_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var zP,YP,JP,XP,ZP,aM=function(j){_inherits(AgoraLogService,j);var _e,_t,St,Tt,Ut=log_createSuper(AgoraLogService);function AgoraLogService(){return _classCallCheck(this,AgoraLogService),Ut.apply(this,arguments)}return _createClass(AgoraLogService,[{key:"uploadZipLogFile",value:(Tt=_asyncToGenerator(log_regeneratorRuntime().mark((function _callee(j,_e){var _t;return log_regeneratorRuntime().wrap((function _callee$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,this.uploadToOss(j,_e,"zip");case 2:return _t=St.sent,St.abrupt("return",_t);case 4:case"end":return St.stop()}}),_callee,this)}))),function uploadZipLogFile(j,_e){return Tt.apply(this,arguments)})},{key:"uploadLogFile",value:(St=_asyncToGenerator(log_regeneratorRuntime().mark((function _callee2(j,_e){var _t;return log_regeneratorRuntime().wrap((function _callee2$(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,this.uploadToOss(j,_e,"log");case 2:return _t=St.sent,St.abrupt("return",_t);case 4:case"end":return St.stop()}}),_callee2,this)}))),function uploadLogFile(j,_e){return St.apply(this,arguments)})},{key:"uploadToOss",value:(_t=_asyncToGenerator(log_regeneratorRuntime().mark((function _callee3(j,_e,_t){var St;return log_regeneratorRuntime().wrap((function _callee3$(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.prev=0,St=new WP(KS.shared.appId,j),Tt.next=4,St.upload(_e,_t);case 4:Tt.next=9;break;case 6:Tt.prev=6,Tt.t0=Tt.catch(0),zE.shared.handleThrowableError(QE.RTE_ERR_LOG_UPLOAD_FAIL,Tt.t0);case 9:case"end":return Tt.stop()}}),_callee3,null,[[0,6]])}))),function uploadToOss(j,_e,St){return _t.apply(this,arguments)})},{key:"uploadElectronLog",value:(_e=_asyncToGenerator(log_regeneratorRuntime().mark((function _callee4(j){var _e,_t;return log_regeneratorRuntime().wrap((function _callee4$(St){for(;;)switch(St.prev=St.next){case 0:if(!window.doGzip){St.next=8;break}return St.next=3,window.doGzip();case 3:return _e=St.sent,St.next=6,this.uploadZipLogFile(j,_e);case 6:return _t=St.sent,St.abrupt("return",_t);case 8:case"end":return St.stop()}}),_callee4,this)}))),function uploadElectronLog(j){return _e.apply(this,arguments)})}]),AgoraLogService}(NS);function rc_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */rc_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function rc_createSuper(j){var _e=function rc_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}!function(j){j[j.Host=1]="Host",j[j.Controlled=2]="Controlled"}(zP||(zP={})),function(j){j.RequestControl="request-control",j.QuitControl="quit-control",j.RequestAuthorized="request-authorized",j.RequestUnauthorized="request-unauthorized"}(YP||(YP={}));try{var sM=__webpack_require__(1709).AgoraRemoteDesktopControl;ZP=sM}catch(j){KS.platform===FS.Electron&&ME.warn("load electron rc sdk failed: ".concat(j))}var cM=TS.attach({proxyMethods:!1})((XP=function(j){_inherits(AgoraRemoteControlContext,j);var _e,_t,St,Tt,Ut,_r,_n,_i,Ei=rc_createSuper(AgoraRemoteControlContext);function AgoraRemoteControlContext(j,_e){var _t;return _classCallCheck(this,AgoraRemoteControlContext),(_t=Ei.call(this))._rtcChannel=j,_t._role=_e,_t.logger=void 0,_t._rdcEngine=void 0,_t._displays=[],_t._streamId=void 0,_t.handleRDCStateChange=function(j,_e){var St;(St=_t.logger).info.apply(St,["RDC state changed to",j].concat(_toConsumableArray(_e?["with message",_e]:[])))},_t.handleRDCRequestControl=function(j){_t.logger.info("RequestControl fired with args",j),_t.emit(YP.RequestControl,j)},_t.handleRDCQuitControl=function(j){_t.logger.info("QuitControl fired with args",j),_t.emit(YP.QuitControl,j)},_t.handleRDCRequestControlAuthorized=function(j){_t.logger.info("RequestAuthorized fired with args",j),_t.emit(YP.RequestAuthorized,j)},_t.handleRDCRequestControlUnauthorized=function(j){_t.logger.info("RequestUnauthorized fired with args",j),_t.emit(YP.RequestUnauthorized,j)},_t._checkPlatform(),_t._initialize(),_t._addListeners(),_t}return _createClass(AgoraRemoteControlContext,[{key:"_checkPlatform",value:function _checkPlatform(){if(!(KS.platform===FS.Electron))throw new Error("Remote Control currently not supported in web browser")}},{key:"rdcEngine",get:function get(){if(!this._rdcEngine)throw new Error("RCEngine not ready");return this._rdcEngine}},{key:"_initialize",value:function _initialize(){this._rdcEngine=new ZP(AD.rtcEngine,{appId:KS.shared.appId,role:this._role})}},{key:"_addListeners",value:function _addListeners(){this.rdcEngine.on("rdc-state",this.handleRDCStateChange),this.rdcEngine.on("rdc-request-control",this.handleRDCRequestControl),this.rdcEngine.on("rdc-quit-control",this.handleRDCQuitControl),this.rdcEngine.on("rdc-request-control-authorized",this.handleRDCRequestControlAuthorized),this.rdcEngine.on("rdc-request-control-unauthorized",this.handleRDCRequestControlUnauthorized)}},{key:"_removeListeners",value:function _removeListeners(){this.rdcEngine.off("rdc-state",this.handleRDCStateChange),this.rdcEngine.off("rdc-request-control",this.handleRDCRequestControl),this.rdcEngine.off("rdc-quit-control",this.handleRDCQuitControl),this.rdcEngine.off("rdc-request-control-authorized",this.handleRDCRequestControlAuthorized),this.rdcEngine.off("rdc-request-control-unauthorized",this.handleRDCRequestControlUnauthorized)}},{key:"join",value:(_i=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee2(j){var _e=this;return rc_regeneratorRuntime().wrap((function _callee2$(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.abrupt("return",new Promise(function(){var _t=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee(_t,St){var Tt,Ut,_r,_n;return rc_regeneratorRuntime().wrap((function _callee$(_i){for(;;)switch(_i.prev=_i.next){case 0:return Tt=j.userId,Ut=j.userToken,_r=j.streamId,_n=j.streamToken,_e.logger.info("join rc channel [".concat(_e._rtcChannel.channelName,"] with params"),j),_e._streamId=_r,_e.rdcEngine.once("rdc-join-error",(function(j,Tt){0===j?(_t(null),_e.logger.info("rc channel joined")):(St(),_e.logger.info("rc channel join failed, message: ".concat(Tt)))})),_i.next=6,_e.rdcEngine.join(Tt,Ut,_e._rtcChannel.channelName,parseInt(_r),_n);case 6:case"end":return _i.stop()}}),_callee)})));return function(j,_e){return _t.apply(this,arguments)}}()));case 1:case"end":return _t.stop()}}),_callee2)}))),function join(j){return _i.apply(this,arguments)})},{key:"_waitForUserJoin",value:(_n=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee4(j){var _e,_t,St=this,Tt=arguments;return rc_regeneratorRuntime().wrap((function _callee4$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(_e=Tt.length>1&&void 0!==Tt[1]?Tt[1]:1e4,(_t=function isUserJoined(){return AgoraRemoteControlContext._channelUsers.has(j)})()){Ut.next=7;break}return Ut.next=5,gS(new Promise(function(){var Tt=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee3(Tt){var Ut;return rc_regeneratorRuntime().wrap((function _callee3$(_r){for(;;)switch(_r.prev=_r.next){case 0:Ut=Date.now()+_e;case 1:if(!(Date.now()<Ut)){_r.next=11;break}if(St.logger.info("wait for user joining rc channel"),!_t()){_r.next=7;break}return St.logger.info("user [".concat(j,"] joined the rc channel!")),Tt(),_r.abrupt("break",11);case 7:return _r.next=9,pS(100);case 9:_r.next=1;break;case 11:case"end":return _r.stop()}}),_callee3)})));return function(j){return Tt.apply(this,arguments)}}()),_e,!1);case 5:Ut.next=8;break;case 7:this.logger.info("user [".concat(j,"] has already joined the rc channel!"));case 8:case"end":return Ut.stop()}}),_callee4,this)}))),function _waitForUserJoin(j){return _n.apply(this,arguments)})},{key:"requestControl",value:(_r=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee5(j,_e){return rc_regeneratorRuntime().wrap((function _callee5$(_t){for(;;)switch(_t.prev=_t.next){case 0:return this.logger.info("request user ".concat(j," for remote controlling")),_t.next=3,this._waitForUserJoin(_e.streamId,_e.timeout);case 3:this.rdcEngine.requestControl(j);case 4:case"end":return _t.stop()}}),_callee5,this)}))),function requestControl(j,_e){return _r.apply(this,arguments)})},{key:"takeControl",value:(Ut=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee6(j,_e,_t,St){return rc_regeneratorRuntime().wrap((function _callee6$(St){for(;;)switch(St.prev=St.next){case 0:this.logger.info("take control of the remote device of user ".concat(j)),this.rdcEngine.takeControl(j,parseInt(_e),_t);case 2:case"end":return St.stop()}}),_callee6,this)}))),function takeControl(j,_e,_t,St){return Ut.apply(this,arguments)})},{key:"unauthorizeControl",value:(Tt=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee7(j,_e){return rc_regeneratorRuntime().wrap((function _callee7$(_e){for(;;)switch(_e.prev=_e.next){case 0:this.logger.info("unauthorize user ".concat(j," for remote controlling")),this.rdcEngine.unauthorizeControl(j);case 2:case"end":return _e.stop()}}),_callee7,this)}))),function unauthorizeControl(j,_e){return Tt.apply(this,arguments)})},{key:"authorizeControl",value:(St=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee8(j,_e,_t){var St,Tt,Ut,_r,_n,_i,Ei,Ci;return rc_regeneratorRuntime().wrap((function _callee8$(_t){for(;;)switch(_t.prev=_t.next){case 0:if(this.logger.info("authorize user ".concat(j," for remote controlling")),_n=this._displays.find((function(j){return j.id===_e.id}))){_t.next=4;break}throw new Error("Invalid display obj, display with id ".concat(JSON.stringify(_e.id)," not exist"));case 4:this.logger.info("display with id ".concat(_e.id," is going to be controled")),_i=KS.shared.rtcConfigs,Ei=_i.defaultScreenEncoderConfigurations,Ci={width:null!==(St=null==Ei?void 0:Ei.width)&&void 0!==St?St:0,height:null!==(Tt=null==Ei?void 0:Ei.height)&&void 0!==Tt?Tt:0,frameRate:null!==(Ut=null==Ei?void 0:Ei.frameRate)&&void 0!==Ut?Ut:10,bitrate:null!==(_r=null==Ei?void 0:Ei.bitrate)&&void 0!==_r?_r:0,captureMouseCursor:!0,windowFocus:!0,excludeWindowCount:0,excludeWindowList:[],highLightWidth:0,highLightColor:0,enableHighLight:!1},this.rdcEngine.authorizeControl(j,_n,Ci);case 9:case"end":return _t.stop()}}),_callee8,this)}))),function authorizeControl(j,_e,_t){return St.apply(this,arguments)})},{key:"quitControl",value:function quitControl(j,_e,_t){this.logger.info("role ".concat(_e," is quit control from ").concat(j," and streamId ").concat(_t)),_t?this.rdcEngine.quitControl(j,_e,_t):this.rdcEngine.quitControl(j,_e)}},{key:"leave",value:(_t=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee10(){var j,_e,_t=this;return rc_regeneratorRuntime().wrap((function _callee10$(St){for(;;)switch(St.prev=St.next){case 0:if(this.logger.info("leave rc channel [".concat(this._rtcChannel.channelName,"],streamId is [").concat(this._streamId,"]")),AD.rtcEngine.stopScreenCapture2(),AD.rtcEngine.videoSourceLeave(),j=1e4,_e=this._streamId){St.next=8;break}return this.logger.info("user not joined yet, no op"),St.abrupt("return");case 8:return St.next=10,gS(new Promise(function(){var St=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee9(St){var Tt;return rc_regeneratorRuntime().wrap((function _callee9$(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:Tt=Date.now()+j;case 1:if(!(Date.now()<Tt)){Ut.next=10;break}if(AgoraRemoteControlContext._channelUsers.has(_e)){Ut.next=6;break}return _t.logger.info("user not in rc channel, stop loop"),St(),Ut.abrupt("break",10);case 6:return Ut.next=8,pS(100);case 8:Ut.next=1;break;case 10:case"end":return Ut.stop()}}),_callee9)})));return function(j){return St.apply(this,arguments)}}()),j);case 10:case"end":return St.stop()}}),_callee10,this)}))),function leave(){return _t.apply(this,arguments)})},{key:"dispose",value:function dispose(){this.logger.info("RCEngine start disposing"),this.logger.info("remove rc listeners"),this._removeListeners(),this.rdcEngine.dispose(),this.logger.info("RCEngine start disposed")}},{key:"getDisplays",value:(_e=_asyncToGenerator(rc_regeneratorRuntime().mark((function _callee11(){var j;return rc_regeneratorRuntime().wrap((function _callee11$(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,this.rdcEngine.getDisplays();case 2:return this._displays=_e.sent,j=this._displays.map((function(j){return{id:j.id,size:{width:j.width,height:j.height},thumbnail:j.thumbnail}})),this.logger.info("get rc displays",j),_e.abrupt("return",j);case 6:case"end":return _e.stop()}}),_callee11,this)}))),function getDisplays(){return _e.apply(this,arguments)})}],[{key:"initialize",value:function initialize(){AD.rtcEngine.on("userJoined",AgoraRemoteControlContext.handleRTCUserJoined),AD.rtcEngine.on("removeStream",AgoraRemoteControlContext.handleRTCUserLeft)}},{key:"cleanup",value:function cleanup(){AgoraRemoteControlContext._channelUsers.clear(),AD.rtcEngine&&AD.rtcEngine.off("userJoined",AgoraRemoteControlContext.handleRTCUserJoined),AD.rtcEngine&&AD.rtcEngine.off("removeStream",AgoraRemoteControlContext.handleRTCUserLeft)}}]),AgoraRemoteControlContext}(_a),XP._channelUsers=new Set,XP.handleRTCUserJoined=function(j){ME.info("RC user joined channel",j),XP._channelUsers.add("".concat(j))},XP.handleRTCUserLeft=function(j){ME.info("RC user left channel",j),XP._channelUsers.delete("".concat(j))},JP=XP))||JP;function engine_regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */engine_regeneratorRuntime=function _regeneratorRuntime(){return j};var j={},_e=Object.prototype,_t=_e.hasOwnProperty,St=Object.defineProperty||function(j,_e,_t){j[_e]=_t.value},Tt="function"==typeof Symbol?Symbol:{},Ut=Tt.iterator||"@@iterator",_r=Tt.asyncIterator||"@@asyncIterator",_n=Tt.toStringTag||"@@toStringTag";function define(j,_e,_t){return Object.defineProperty(j,_e,{value:_t,enumerable:!0,configurable:!0,writable:!0}),j[_e]}try{define({},"")}catch(j){define=function define(j,_e,_t){return j[_e]=_t}}function wrap(j,_e,_t,Tt){var Ut=_e&&_e.prototype instanceof Generator?_e:Generator,_r=Object.create(Ut.prototype),_n=new Context(Tt||[]);return St(_r,"_invoke",{value:makeInvokeMethod(j,_t,_n)}),_r}function tryCatch(j,_e,_t){try{return{type:"normal",arg:j.call(_e,_t)}}catch(j){return{type:"throw",arg:j}}}j.wrap=wrap;var _i={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Ei={};define(Ei,Ut,(function(){return this}));var Ci=Object.getPrototypeOf,Di=Ci&&Ci(Ci(values([])));Di&&Di!==_e&&_t.call(Di,Ut)&&(Ei=Di);var Fi=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(Ei);function defineIteratorMethods(j){["next","throw","return"].forEach((function(_e){define(j,_e,(function(j){return this._invoke(_e,j)}))}))}function AsyncIterator(j,_e){function invoke(St,Tt,Ut,_r){var _n=tryCatch(j[St],j,Tt);if("throw"!==_n.type){var _i=_n.arg,Ei=_i.value;return Ei&&"object"==_typeof(Ei)&&_t.call(Ei,"__await")?_e.resolve(Ei.__await).then((function(j){invoke("next",j,Ut,_r)}),(function(j){invoke("throw",j,Ut,_r)})):_e.resolve(Ei).then((function(j){_i.value=j,Ut(_i)}),(function(j){return invoke("throw",j,Ut,_r)}))}_r(_n.arg)}var Tt;St(this,"_invoke",{value:function value(j,_t){function callInvokeWithMethodAndArg(){return new _e((function(_e,St){invoke(j,_t,_e,St)}))}return Tt=Tt?Tt.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(j,_e,_t){var St="suspendedStart";return function(Tt,Ut){if("executing"===St)throw new Error("Generator is already running");if("completed"===St){if("throw"===Tt)throw Ut;return doneResult()}for(_t.method=Tt,_t.arg=Ut;;){var _r=_t.delegate;if(_r){var _n=maybeInvokeDelegate(_r,_t);if(_n){if(_n===_i)continue;return _n}}if("next"===_t.method)_t.sent=_t._sent=_t.arg;else if("throw"===_t.method){if("suspendedStart"===St)throw St="completed",_t.arg;_t.dispatchException(_t.arg)}else"return"===_t.method&&_t.abrupt("return",_t.arg);St="executing";var Ei=tryCatch(j,_e,_t);if("normal"===Ei.type){if(St=_t.done?"completed":"suspendedYield",Ei.arg===_i)continue;return{value:Ei.arg,done:_t.done}}"throw"===Ei.type&&(St="completed",_t.method="throw",_t.arg=Ei.arg)}}}function maybeInvokeDelegate(j,_e){var _t=_e.method,St=j.iterator[_t];if(void 0===St)return _e.delegate=null,"throw"===_t&&j.iterator.return&&(_e.method="return",_e.arg=void 0,maybeInvokeDelegate(j,_e),"throw"===_e.method)||"return"!==_t&&(_e.method="throw",_e.arg=new TypeError("The iterator does not provide a '"+_t+"' method")),_i;var Tt=tryCatch(St,j.iterator,_e.arg);if("throw"===Tt.type)return _e.method="throw",_e.arg=Tt.arg,_e.delegate=null,_i;var Ut=Tt.arg;return Ut?Ut.done?(_e[j.resultName]=Ut.value,_e.next=j.nextLoc,"return"!==_e.method&&(_e.method="next",_e.arg=void 0),_e.delegate=null,_i):Ut:(_e.method="throw",_e.arg=new TypeError("iterator result is not an object"),_e.delegate=null,_i)}function pushTryEntry(j){var _e={tryLoc:j[0]};1 in j&&(_e.catchLoc=j[1]),2 in j&&(_e.finallyLoc=j[2],_e.afterLoc=j[3]),this.tryEntries.push(_e)}function resetTryEntry(j){var _e=j.completion||{};_e.type="normal",delete _e.arg,j.completion=_e}function Context(j){this.tryEntries=[{tryLoc:"root"}],j.forEach(pushTryEntry,this),this.reset(!0)}function values(j){if(j){var _e=j[Ut];if(_e)return _e.call(j);if("function"==typeof j.next)return j;if(!isNaN(j.length)){var St=-1,Tt=function next(){for(;++St<j.length;)if(_t.call(j,St))return next.value=j[St],next.done=!1,next;return next.value=void 0,next.done=!0,next};return Tt.next=Tt}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,St(Fi,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),St(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,_n,"GeneratorFunction"),j.isGeneratorFunction=function(j){var _e="function"==typeof j&&j.constructor;return!!_e&&(_e===GeneratorFunction||"GeneratorFunction"===(_e.displayName||_e.name))},j.mark=function(j){return Object.setPrototypeOf?Object.setPrototypeOf(j,GeneratorFunctionPrototype):(j.__proto__=GeneratorFunctionPrototype,define(j,_n,"GeneratorFunction")),j.prototype=Object.create(Fi),j},j.awrap=function(j){return{__await:j}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,_r,(function(){return this})),j.AsyncIterator=AsyncIterator,j.async=function(_e,_t,St,Tt,Ut){void 0===Ut&&(Ut=Promise);var _r=new AsyncIterator(wrap(_e,_t,St,Tt),Ut);return j.isGeneratorFunction(_t)?_r:_r.next().then((function(j){return j.done?j.value:_r.next()}))},defineIteratorMethods(Fi),define(Fi,_n,"Generator"),define(Fi,Ut,(function(){return this})),define(Fi,"toString",(function(){return"[object Generator]"})),j.keys=function(j){var _e=Object(j),_t=[];for(var St in _e)_t.push(St);return _t.reverse(),function next(){for(;_t.length;){var j=_t.pop();if(j in _e)return next.value=j,next.done=!1,next}return next.done=!0,next}},j.values=values,Context.prototype={constructor:Context,reset:function reset(j){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!j)for(var _e in this)"t"===_e.charAt(0)&&_t.call(this,_e)&&!isNaN(+_e.slice(1))&&(this[_e]=void 0)},stop:function stop(){this.done=!0;var j=this.tryEntries[0].completion;if("throw"===j.type)throw j.arg;return this.rval},dispatchException:function dispatchException(j){if(this.done)throw j;var _e=this;function handle(_t,St){return Ut.type="throw",Ut.arg=j,_e.next=_t,St&&(_e.method="next",_e.arg=void 0),!!St}for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St],Ut=Tt.completion;if("root"===Tt.tryLoc)return handle("end");if(Tt.tryLoc<=this.prev){var _r=_t.call(Tt,"catchLoc"),_n=_t.call(Tt,"finallyLoc");if(_r&&_n){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0);if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}else if(_r){if(this.prev<Tt.catchLoc)return handle(Tt.catchLoc,!0)}else{if(!_n)throw new Error("try statement without catch or finally");if(this.prev<Tt.finallyLoc)return handle(Tt.finallyLoc)}}}},abrupt:function abrupt(j,_e){for(var St=this.tryEntries.length-1;St>=0;--St){var Tt=this.tryEntries[St];if(Tt.tryLoc<=this.prev&&_t.call(Tt,"finallyLoc")&&this.prev<Tt.finallyLoc){var Ut=Tt;break}}Ut&&("break"===j||"continue"===j)&&Ut.tryLoc<=_e&&_e<=Ut.finallyLoc&&(Ut=null);var _r=Ut?Ut.completion:{};return _r.type=j,_r.arg=_e,Ut?(this.method="next",this.next=Ut.finallyLoc,_i):this.complete(_r)},complete:function complete(j,_e){if("throw"===j.type)throw j.arg;return"break"===j.type||"continue"===j.type?this.next=j.arg:"return"===j.type?(this.rval=this.arg=j.arg,this.method="return",this.next="end"):"normal"===j.type&&_e&&(this.next=_e),_i},finish:function finish(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.finallyLoc===j)return this.complete(_t.completion,_t.afterLoc),resetTryEntry(_t),_i}},catch:function _catch(j){for(var _e=this.tryEntries.length-1;_e>=0;--_e){var _t=this.tryEntries[_e];if(_t.tryLoc===j){var St=_t.completion;if("throw"===St.type){var Tt=St.arg;resetTryEntry(_t)}return Tt}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(j,_e,_t){return this.delegate={iterator:values(j),resultName:_e,nextLoc:_t},"next"===this.method&&(this.arg=void 0),_i}},j}function engine_createSuper(j){var _e=function engine_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(j){return!1}}();return function _createSuperInternal(){var _t,St=_getPrototypeOf(j);if(_e){var Tt=_getPrototypeOf(this).constructor;_t=Reflect.construct(St,arguments,Tt)}else _t=St.apply(this,arguments);return _possibleConstructorReturn(this,_t)}}var uM=function(j){_inherits(AgoraRteEngine,j);var _e,_t,St=engine_createSuper(AgoraRteEngine);function AgoraRteEngine(j){var _e;return _classCallCheck(this,AgoraRteEngine),(_e=St.call(this))._mediaControl=void 0,_e._logService=void 0,_e._rtmManager=void 0,_e._rtcManager=void 0,_e._apiServicePathPrefix="",KS.setConfig(j),KS.consoleHijackEnabled&&ME.setupConsoleHijack(),_e._logService=new aM,_e._rtmManager=new oR,_e._rtcManager=new MP(j.rtcConfigs),_e._mediaControl=new DO(_e._rtcManager),KS.platform===FS.Electron&&cM.initialize(),_e}return _createClass(AgoraRteEngine,[{key:"apiServicePathPrefix",get:function get(){return this._apiServicePathPrefix}},{key:"destroy",value:function destroy(){ME.info("RTE engine destroy"),this.getAgoraMediaControl().createCameraVideoTrack().stop(),this.getAgoraMediaControl().createMicrophoneAudioTrack().stop(),this.getAgoraMediaControl().createScreenShareTrack().stop(),KS.platform===FS.Electron&&cM.cleanup(),this.logout(),KS.consoleHijackEnabled&&ME.restoreConsoleHijack(),function cleanup(){CS.forEach((function(j){delete j.__cacheMap})),CS=new Set}(),function cleanup(){kS.forEach((function(j){delete j.__cacheMap})),kS=new Set}()}},{key:"login",value:(_t=_asyncToGenerator(engine_regeneratorRuntime().mark((function _callee(j,_e){var _t;return engine_regeneratorRuntime().wrap((function _callee$(St){for(;;)switch(St.prev=St.next){case 0:return US.shared.host="https://api.sd-rtn.com",US.shared.pathPrefix="/cn/v1.0/projects/".concat(KS.shared.appId,"/app-dev-report"),_t=KS.shared.ignoreUrlRegionPrefix,this._apiServicePathPrefix="".concat(_t?"":"/"+KS.shared.region.toLowerCase(),"/scene/apps/").concat(KS.shared.appId),KS.shared.token=j,KS.shared.userId=_e,KS.shared.service.headers={"Content-Type":"application/json","x-agora-token":j,"x-agora-uid":_e,Authorization:'agora token="'.concat(j,'"')},St.next=9,this._rtmManager.login(j,_e,{uploadLog:!1});case 9:return St.abrupt("return",St.sent);case 10:case"end":return St.stop()}}),_callee,this)}))),function login(j,_e){return _t.apply(this,arguments)})},{key:"logout",value:function logout(){this._rtcManager.destroy(),this._rtmManager.destroyRtm()}},{key:"createAgoraRteScene",value:function createAgoraRteScene(j){var _e=this._rtcManager.getRtcChannel(j);return new bO(j,{engine:this,rtc:this._rtcManager,rtm:this._rtmManager,rtcChannel:_e})}},{key:"createRemoteControlContext",value:function createRemoteControlContext(j,_e){return new cM(j.rtcChannel,_e)}},{key:"getAgoraMediaControl",value:function getAgoraMediaControl(){return this._mediaControl}},{key:"uploadSDKLogToAgoraService",value:(_e=_asyncToGenerator(engine_regeneratorRuntime().mark((function _callee2(j){var _e,_t,St,Tt,Ut,_r,_n,_i,Ei,Ci,Di;return engine_regeneratorRuntime().wrap((function _callee2$(Fi){for(;;)switch(Fi.prev=Fi.next){case 0:return _t=null,St=null,Fi.next=4,to(ME.collectConsoleLogs());case 4:if(Tt=Fi.sent,Ut=_slicedToArray(Tt,2),_e=Ut[0],_t=Ut[1],_e){Fi.next=22;break}return Fi.next=11,to(this._logService.uploadLogFile(j,_t));case 11:if(_r=Fi.sent,_n=_slicedToArray(_r,1),!(_e=_n[0])){Fi.next=18;break}zE.shared.handleNonThrowableError(QE.RTE_ERR_WEB_LOG_UPLOAD_ERR,_e),Fi.next=20;break;case 18:return Fi.next=20,to(ME.cleanupConsoleLogs());case 20:Fi.next=23;break;case 22:zE.shared.handleNonThrowableError(QE.RTE_ERR_WEB_LOG_UPLOAD_ERR,_e);case 23:if(KS.platform!==FS.Electron){Fi.next=40;break}return Fi.next=26,to(ME.collectElectronLogs(AD.logBasePath,AD.logFolderPath));case 26:if(_i=Fi.sent,Ei=_slicedToArray(_i,2),_e=Ei[0],St=Ei[1],_e){Fi.next=39;break}return Fi.next=33,to(this._logService.uploadZipLogFile(j,St));case 33:Ci=Fi.sent,Di=_slicedToArray(Ci,1),(_e=Di[0])&&zE.shared.handleNonThrowableError(QE.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR,_e),Fi.next=40;break;case 39:zE.shared.handleNonThrowableError(QE.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR,_e);case 40:case"end":return Fi.stop()}}),_callee2,this)}))),function uploadSDKLogToAgoraService(j){return _e.apply(this,arguments)})}],[{key:"createWithConfig",value:function createWithConfig(j){return new AgoraRteEngine(j)}},{key:"getVersion",value:function getVersion(){return KS.version}},{key:"getRtcVersion",value:function getRtcVersion(){return KS.platform===FS.Electron?AD.getRtcVersion():LP.getRtcVersion()}}]),AgoraRteEngine}(_a)})(),__webpack_exports__})()}));
|