agora-rte-sdk 2.5.1 → 2.5.2
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 +15 -1
- package/lib/configs/index.js +41 -2
- package/lib/core/media-player/index.d.ts +2 -0
- package/lib/core/media-player/index.js +23 -0
- package/lib/core/media-player/stream-media-player.d.ts +25 -0
- package/lib/core/media-player/stream-media-player.js +351 -0
- package/lib/core/media-player/type.d.ts +11 -0
- package/lib/core/media-player/type.js +16 -0
- package/lib/core/processor/channel-msg/handler.d.ts +6 -5
- package/lib/core/processor/channel-msg/handler.js +77 -64
- package/lib/core/processor/channel-msg/struct.d.ts +19 -8
- package/lib/core/rtc/adapter/electron/index.js +16 -7
- package/lib/core/rtc/adapter/web/client.js +14 -5
- package/lib/core/rtm/index.js +14 -5
- package/lib/core/services/api.d.ts +17 -1
- package/lib/core/services/api.js +123 -47
- package/lib/scene/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -87,4 +87,4 @@ t.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeo
|
|
|
87
87
|
*
|
|
88
88
|
* Copyright © 2012-2019 Faisal Salman <f@faisalman.com>
|
|
89
89
|
* Licensed under MIT License
|
|
90
|
-
*/!function(i,o){"use strict";var a="function",s="undefined",c="object",u="model",l="name",h="type",f="vendor",d="version",p="architecture",g="console",v="mobile",A="tablet",m="smarttv",y="wearable",_={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:o},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},b={rgx:function(e,t){for(var r,n,i,s,u,l,h=0;h<t.length&&!u;){var f=t[h],d=t[h+1];for(r=n=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(i=0;i<d.length;i++)l=u[++n],typeof(s=d[i])===c&&s.length>0?2==s.length?typeof s[1]==a?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):o:this[s[0]]=l?s[1].call(this,l,s[2]):o:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):o):this[s]=l||o;h+=2}},str:function(e,t){for(var r in t)if(typeof t[r]===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(_.has(t[r][n],e))return"?"===r?o:r}else if(_.has(t[r],e))return"?"===r?o:r;return e}},E={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"}}}},w={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6}).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[l,d],[/(opios)[\/\s]+([\w\.]+)/i],[[l,"Opera Mini"],d],[/\s(opr)\/([\w\.]+)/i],[[l,"Opera"],d],[/(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],[l,d],[/(konqueror)\/([\w\.]+)/i],[[l,"Konqueror"],d],[/(trident).+rv[:\s]([\w\.]{1,9}).+like\sgecko/i],[[l,"IE"],d],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[l,"Edge"],d],[/(yabrowser)\/([\w\.]+)/i],[[l,"Yandex"],d],[/(Avast)\/([\w\.]+)/i],[[l,"Avast Secure Browser"],d],[/(AVG)\/([\w\.]+)/i],[[l,"AVG Secure Browser"],d],[/(puffin)\/([\w\.]+)/i],[[l,"Puffin"],d],[/(focus)\/([\w\.]+)/i],[[l,"Firefox Focus"],d],[/(opt)\/([\w\.]+)/i],[[l,"Opera Touch"],d],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[l,"UCBrowser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],d],[/(windowswechat qbcore)\/([\w\.]+)/i],[[l,"WeChat(Win) Desktop"],d],[/(micromessenger)\/([\w\.]+)/i],[[l,"WeChat"],d],[/(brave)\/([\w\.]+)/i],[[l,"Brave"],d],[/(whale)\/([\w\.]+)/i],[[l,"Whale"],d],[/(qqbrowserlite)\/([\w\.]+)/i],[l,d],[/(QQ)\/([\d\.]+)/i],[l,d],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[l,d],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[l,d],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[l,d],[/(MetaSr)[\/\s]?([\w\.]+)/i],[l],[/(LBBROWSER)/i],[l],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[l,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[d,[l,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[l,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[l,d],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[l,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[l,/(.+)/,"$1 WebView"],d],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[l,/(.+(?:g|us))(.+)/,"$1 $2"],d],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[d,[l,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[l,"Sailfish Browser"],d],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[l,d],[/(dolfin)\/([\w\.]+)/i],[[l,"Dolphin"],d],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[l,"360 Browser"]],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[l,"Chrome"],d],[/(coast)\/([\w\.]+)/i],[[l,"Opera Coast"],d],[/fxios\/([\w\.-]+)/i],[d,[l,"Firefox"]],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[d,[l,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[d,l],[/webkit.+?(gsa)\/([\w\.]+)\s.*(mobile\s?safari|safari)(\/[\w\.]+)/i],[[l,"GSA"],d],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[l,[d,b.str,E.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[l,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[l,"Netscape"],d],[/(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],[l,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,_.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[p,/ower/,"",_.lowerize]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[p,_.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[u,f,[h,A]],[/applecoremedia\/[\w\.]+ \((ipad)/],[u,[f,"Apple"],[h,A]],[/(apple\s{0,1}tv)/i],[[u,"Apple TV"],[f,"Apple"],[h,m]],[/(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],[f,u,[h,A]],[/(kf[A-z]+)(\sbuild\/|\)).+silk\//i],[u,[f,"Amazon"],[h,A]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[u,b.str,E.device.amazon.model],[f,"Amazon"],[h,v]],[/android.+aft([bms])\sbuild/i],[u,[f,"Amazon"],[h,m]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[u,f,[h,v]],[/\((ip[honed|\s\w*]+);/i],[u,[f,"Apple"],[h,v]],[/(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],[f,u,[h,v]],[/\(bb10;\s(\w+)/i],[u,[f,"BlackBerry"],[h,v]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[u,[f,"Asus"],[h,A]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[f,"Sony"],[u,"Xperia Tablet"],[h,A]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[f,"Sony"],[h,v]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[f,u,[h,g]],[/android.+;\s(shield)\sbuild/i],[u,[f,"Nvidia"],[h,g]],[/(playstation\s[34portablevi]+)/i],[u,[f,"Sony"],[h,g]],[/(sprint\s(\w+))/i],[[f,b.str,E.device.sprint.vendor],[u,b.str,E.device.sprint.model],[h,v]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[u,/_/g," "],[h,v]],[/(nexus\s9)/i],[u,[f,"HTC"],[h,A]],[/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],[u,[f,"Huawei"],[h,v]],[/android.+(bah2?-a?[lw]\d{2})/i],[u,[f,"Huawei"],[h,A]],[/(microsoft);\s(lumia[\s\w]+)/i],[f,u,[h,v]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[u,[f,"Microsoft"],[h,g]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,"Microsoft"],[h,v]],[/\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],[u,[f,"Motorola"],[h,v]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[u,[f,"Motorola"],[h,A]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,_.trim],[u,_.trim],[h,m]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,"Samsung"],[h,m]],[/\(dtv[\);].+(aquos)/i],[u,[f,"Sharp"],[h,m]],[/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],[[f,"Samsung"],u,[h,A]],[/smart-tv.+(samsung)/i],[f,[h,m],u],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[f,"Samsung"],u,[h,v]],[/sie-(\w*)/i],[u,[f,"Siemens"],[h,v]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[f,"Nokia"],u,[h,v]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[u,[f,"Acer"],[h,A]],[/android.+([vl]k\-?\d{3})\s+build/i],[u,[f,"LG"],[h,A]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[f,"LG"],u,[h,A]],[/linux;\snetcast.+smarttv/i,/lg\snetcast\.tv-201\d/i],[[f,"LG"],u,[h,m]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[u,[f,"LG"],[h,v]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[f,u,[h,A]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[u,[f,"Lenovo"],[h,A]],[/(lenovo)[_\s-]?([\w-]+)/i],[f,u,[h,v]],[/linux;.+((jolla));/i],[f,u,[h,v]],[/((pebble))app\/[\d\.]+\s/i],[f,u,[h,y]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,u,[h,v]],[/crkey/i],[[u,"Chromecast"],[f,"Google"],[h,m]],[/android.+;\s(glass)\s\d/i],[u,[f,"Google"],[h,y]],[/android.+;\s(pixel c)[\s)]/i],[u,[f,"Google"],[h,A]],[/android.+;\s(pixel( [2-9]a?)?( xl)?)[\s)]/i],[u,[f,"Google"],[h,v]],[/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],[[u,/_/g," "],[f,"Xiaomi"],[h,v]],[/android.+(mi[\s\-_]?(?:pad)(?:[\s_]?[\w\s]+))(?:\sbuild|\))/i],[[u,/_/g," "],[f,"Xiaomi"],[h,A]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[u,[f,"Meizu"],[h,v]],[/(mz)-([\w-]{2,})/i],[[f,"Meizu"],u,[h,v]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[u,[f,"OnePlus"],[h,v]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[u,[f,"RCA"],[h,A]],[/android.+[;\/\s](Venue[\d\s]{2,7})\s+build/i],[u,[f,"Dell"],[h,A]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[u,[f,"Verizon"],[h,A]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[f,"Barnes & Noble"],u,[h,A]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[u,[f,"NuVision"],[h,A]],[/android.+;\s(k88)\sbuild/i],[u,[f,"ZTE"],[h,A]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[u,[f,"Swiss"],[h,v]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[u,[f,"Swiss"],[h,A]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[u,[f,"Zeki"],[h,A]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[f,"Dragon Touch"],u,[h,A]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[u,[f,"Insignia"],[h,A]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[u,[f,"NextBook"],[h,A]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[f,"Voice"],u,[h,v]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[f,"LvTel"],u,[h,v]],[/android.+;\s(PH-1)\s/i],[u,[f,"Essential"],[h,v]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[u,[f,"Envizen"],[h,A]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[f,u,[h,A]],[/android.+[;\/]\s*(Trio[\s\w\-\.]+)\s+build/i],[u,[f,"MachSpeed"],[h,A]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[f,u,[h,A]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[u,[f,"Rotor"],[h,A]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[f,u,[h,A]],[/android .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[u,[h,v]],[/android .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[u,[h,A]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[h,_.lowerize],f,u],[/[\s\/\(](smart-?tv)[;\)]/i],[[h,m]],[/(android[\w\.\s\-]{0,9});.+build/i],[u,[f,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[d,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[l,"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],[l,d],[/rv\:([\w\.]{1,9}).+(gecko)/i],[d,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,d],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[d,b.str,E.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[d,b.str,E.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],d],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[l,d],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[l,"Symbian"],d],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],d],[/crkey\/([\d\.]+)/i],[d,[l,"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],[l,d],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],d],[/(sunos)\s?([\w\.\d]*)/i],[[l,"Solaris"],d],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[l,d],[/(haiku)\s(\w+)/i],[l,d],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[d,/_/g,"."],[l,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[l,"Mac OS"],[d,/_/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],[l,d]]},I=function(e,t){if("object"==typeof e&&(t=e,e=o),!(this instanceof I))return new I(e,t).getResult();var r=e||(i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),n=t?_.extend(w,t):w;return this.getBrowser=function(){var e={name:o,version:o};return b.rgx.call(e,r,n.browser),e.major=_.major(e.version),e},this.getCPU=function(){var e={architecture:o};return b.rgx.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:o,model:o,type:o};return b.rgx.call(e,r,n.device),e},this.getEngine=function(){var e={name:o,version:o};return b.rgx.call(e,r,n.engine),e},this.getOS=function(){var e={name:o,version:o};return b.rgx.call(e,r,n.os),e},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 r},this.setUA=function(e){return r=e,this},this};I.VERSION="0.7.23",I.BROWSER={NAME:l,MAJOR:"major",VERSION:d},I.CPU={ARCHITECTURE:p},I.DEVICE={MODEL:u,VENDOR:f,TYPE:h,CONSOLE:g,MOBILE:v,SMARTTV:m,TABLET:A,WEARABLE:y,EMBEDDED:"embedded"},I.ENGINE={NAME:l,VERSION:d},I.OS={NAME:l,VERSION:d},typeof t!==s?(e.exports&&(t=e.exports=I),t.UAParser=I):(n=function(){return I}.call(t,r,t,e))===o||(e.exports=n);var C=i&&(i.jQuery||i.Zepto);if(C&&!C.ua){var S=new I;C.ua=S.getResult(),C.ua.get=function(){return S.getUA()},C.ua.set=function(e){S.setUA(e);var t=S.getResult();for(var r in t)C.ua[r]=t[r]}}}("object"==typeof window?window:this)},1005:e=>{"use strict";e.exports=function(e,t,r,n){var i=self||window;try{try{var o;try{o=new i.Blob([e])}catch(t){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(e),o=o.getBlob()}var a=i.URL||i.webkitURL,s=a.createObjectURL(o),c=new i[t](s,r);return a.revokeObjectURL(s),c}catch(n){return new i[t]("data:application/javascript,".concat(encodeURIComponent(e)),r)}}catch(e){if(!n)throw Error("Inline worker is not supported");return new i[t](n,r)}}},9662:(e,t,r)=>{var n=r(7854),i=r(614),o=r(6330),a=n.TypeError;e.exports=function(e){if(i(e))return e;throw a(o(e)+" is not a function")}},9483:(e,t,r)=>{var n=r(7854),i=r(4411),o=r(6330),a=n.TypeError;e.exports=function(e){if(i(e))return e;throw a(o(e)+" is not a constructor")}},6077:(e,t,r)=>{var n=r(7854),i=r(614),o=n.String,a=n.TypeError;e.exports=function(e){if("object"==typeof e||i(e))return e;throw a("Can't set "+o(e)+" as a prototype")}},1223:(e,t,r)=>{var n=r(5112),i=r(30),o=r(3070),a=n("unscopables"),s=Array.prototype;null==s[a]&&o.f(s,a,{configurable:!0,value:i(null)}),e.exports=function(e){s[a][e]=!0}},1530:(e,t,r)=>{"use strict";var n=r(8710).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},5787:(e,t,r)=>{var n=r(7854),i=r(7976),o=n.TypeError;e.exports=function(e,t){if(i(t,e))return e;throw o("Incorrect invocation")}},9670:(e,t,r)=>{var n=r(7854),i=r(111),o=n.String,a=n.TypeError;e.exports=function(e){if(i(e))return e;throw a(o(e)+" is not an object")}},5381:e=>{e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7556:(e,t,r)=>{var n=r(7293);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},260:(e,t,r)=>{"use strict";var n,i,o,a=r(5381),s=r(9781),c=r(7854),u=r(614),l=r(111),h=r(2597),f=r(648),d=r(6330),p=r(8880),g=r(1320),v=r(3070).f,A=r(7976),m=r(9518),y=r(7674),_=r(5112),b=r(9711),E=c.Int8Array,w=E&&E.prototype,I=c.Uint8ClampedArray,C=I&&I.prototype,S=E&&m(E),T=w&&m(w),R=Object.prototype,k=c.TypeError,O=_("toStringTag"),N=b("TYPED_ARRAY_TAG"),x=b("TYPED_ARRAY_CONSTRUCTOR"),D=a&&!!y&&"Opera"!==f(c.opera),L=!1,P={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},B={BigInt64Array:8,BigUint64Array:8},M=function(e){if(!l(e))return!1;var t=f(e);return h(P,t)||h(B,t)};for(n in P)(o=(i=c[n])&&i.prototype)?p(o,x,i):D=!1;for(n in B)(o=(i=c[n])&&i.prototype)&&p(o,x,i);if((!D||!u(S)||S===Function.prototype)&&(S=function(){throw k("Incorrect invocation")},D))for(n in P)c[n]&&y(c[n],S);if((!D||!T||T===R)&&(T=S.prototype,D))for(n in P)c[n]&&y(c[n].prototype,T);if(D&&m(C)!==T&&y(C,T),s&&!h(T,O))for(n in L=!0,v(T,O,{get:function(){return l(this)?this[N]:void 0}}),P)c[n]&&p(c[n],N,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:D,TYPED_ARRAY_CONSTRUCTOR:x,TYPED_ARRAY_TAG:L&&N,aTypedArray:function(e){if(M(e))return e;throw k("Target is not a typed array")},aTypedArrayConstructor:function(e){if(u(e)&&(!y||A(S,e)))return e;throw k(d(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(s){if(r)for(var i in P){var o=c[i];if(o&&h(o.prototype,e))try{delete o.prototype[e]}catch(e){}}T[e]&&!r||g(T,e,r?t:D&&w[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(s){if(y){if(r)for(n in P)if((i=c[n])&&h(i,e))try{delete i[e]}catch(e){}if(S[e]&&!r)return;try{return g(S,e,r?t:D&&S[e]||t)}catch(e){}}for(n in P)!(i=c[n])||i[e]&&!r||g(i,e,t)}},isView:function(e){if(!l(e))return!1;var t=f(e);return"DataView"===t||h(P,t)||h(B,t)},isTypedArray:M,TypedArray:S,TypedArrayPrototype:T}},3331:(e,t,r)=>{"use strict";var n=r(7854),i=r(1702),o=r(9781),a=r(5381),s=r(6530),c=r(8880),u=r(2248),l=r(7293),h=r(5787),f=r(9303),d=r(7466),p=r(7067),g=r(1179),v=r(9518),A=r(7674),m=r(8006).f,y=r(3070).f,_=r(1285),b=r(1589),E=r(8003),w=r(9909),I=s.PROPER,C=s.CONFIGURABLE,S=w.get,T=w.set,R="ArrayBuffer",k="DataView",O="Wrong index",N=n.ArrayBuffer,x=N,D=x&&x.prototype,L=n.DataView,P=L&&L.prototype,B=Object.prototype,M=n.Array,j=n.RangeError,U=i(_),F=i([].reverse),Q=g.pack,q=g.unpack,G=function(e){return[255&e]},V=function(e){return[255&e,e>>8&255]},K=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},H=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},z=function(e){return Q(e,23,4)},W=function(e){return Q(e,52,8)},Y=function(e,t){y(e.prototype,t,{get:function(){return S(this)[t]}})},J=function(e,t,r,n){var i=p(r),o=S(e);if(i+t>o.byteLength)throw j(O);var a=S(o.buffer).bytes,s=i+o.byteOffset,c=b(a,s,s+t);return n?c:F(c)},X=function(e,t,r,n,i,o){var a=p(r),s=S(e);if(a+t>s.byteLength)throw j(O);for(var c=S(s.buffer).bytes,u=a+s.byteOffset,l=n(+i),h=0;h<t;h++)c[u+h]=l[o?h:t-h-1]};if(a){var Z=I&&N.name!==R;if(l((function(){N(1)}))&&l((function(){new N(-1)}))&&!l((function(){return new N,new N(1.5),new N(NaN),Z&&!C})))Z&&C&&c(N,"name",R);else{(x=function(e){return h(this,D),new N(p(e))}).prototype=D;for(var $,ee=m(N),te=0;ee.length>te;)($=ee[te++])in x||c(x,$,N[$]);D.constructor=x}A&&v(P)!==B&&A(P,B);var re=new L(new x(2)),ne=i(P.setInt8);re.setInt8(0,2147483648),re.setInt8(1,2147483649),!re.getInt8(0)&&re.getInt8(1)||u(P,{setInt8:function(e,t){ne(this,e,t<<24>>24)},setUint8:function(e,t){ne(this,e,t<<24>>24)}},{unsafe:!0})}else D=(x=function(e){h(this,D);var t=p(e);T(this,{bytes:U(M(t),0),byteLength:t}),o||(this.byteLength=t)}).prototype,P=(L=function(e,t,r){h(this,P),h(e,D);var n=S(e).byteLength,i=f(t);if(i<0||i>n)throw j("Wrong offset");if(i+(r=void 0===r?n-i:d(r))>n)throw j("Wrong length");T(this,{buffer:e,byteLength:r,byteOffset:i}),o||(this.buffer=e,this.byteLength=r,this.byteOffset=i)}).prototype,o&&(Y(x,"byteLength"),Y(L,"buffer"),Y(L,"byteLength"),Y(L,"byteOffset")),u(P,{getInt8:function(e){return J(this,1,e)[0]<<24>>24},getUint8:function(e){return J(this,1,e)[0]},getInt16:function(e){var t=J(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=J(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return H(J(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return H(J(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return q(J(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return q(J(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){X(this,1,e,G,t)},setUint8:function(e,t){X(this,1,e,G,t)},setInt16:function(e,t){X(this,2,e,V,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){X(this,2,e,V,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){X(this,4,e,K,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){X(this,4,e,K,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){X(this,4,e,z,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){X(this,8,e,W,t,arguments.length>2?arguments[2]:void 0)}});E(x,R),E(L,k),e.exports={ArrayBuffer:x,DataView:L}},1048:(e,t,r)=>{"use strict";var n=r(7908),i=r(1400),o=r(6244),a=Math.min;e.exports=[].copyWithin||function(e,t){var r=n(this),s=o(r),c=i(e,s),u=i(t,s),l=arguments.length>2?arguments[2]:void 0,h=a((void 0===l?s:i(l,s))-u,s-c),f=1;for(u<c&&c<u+h&&(f=-1,u+=h-1,c+=h-1);h-- >0;)u in r?r[c]=r[u]:delete r[c],c+=f,u+=f;return r}},1285:(e,t,r)=>{"use strict";var n=r(7908),i=r(1400),o=r(6244);e.exports=function(e){for(var t=n(this),r=o(t),a=arguments.length,s=i(a>1?arguments[1]:void 0,r),c=a>2?arguments[2]:void 0,u=void 0===c?r:i(c,r);u>s;)t[s++]=e;return t}},8533:(e,t,r)=>{"use strict";var n=r(2092).forEach,i=r(9341)("forEach");e.exports=i?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},7745:(e,t,r)=>{var n=r(6244);e.exports=function(e,t){for(var r=0,i=n(t),o=new e(i);i>r;)o[r]=t[r++];return o}},8457:(e,t,r)=>{"use strict";var n=r(7854),i=r(9974),o=r(6916),a=r(7908),s=r(3411),c=r(7659),u=r(4411),l=r(6244),h=r(6135),f=r(8554),d=r(1246),p=n.Array;e.exports=function(e){var t=a(e),r=u(this),n=arguments.length,g=n>1?arguments[1]:void 0,v=void 0!==g;v&&(g=i(g,n>2?arguments[2]:void 0));var A,m,y,_,b,E,w=d(t),I=0;if(!w||this==p&&c(w))for(A=l(t),m=r?new this(A):p(A);A>I;I++)E=v?g(t[I],I):t[I],h(m,I,E);else for(b=(_=f(t,w)).next,m=r?new this:[];!(y=o(b,_)).done;I++)E=v?s(_,g,[y.value,I],!0):y.value,h(m,I,E);return m.length=I,m}},1318:(e,t,r)=>{var n=r(5656),i=r(1400),o=r(6244),a=function(e){return function(t,r,a){var s,c=n(t),u=o(c),l=i(a,u);if(e&&r!=r){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===r)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},2092:(e,t,r)=>{var n=r(9974),i=r(1702),o=r(8361),a=r(7908),s=r(6244),c=r(5417),u=i([].push),l=function(e){var t=1==e,r=2==e,i=3==e,l=4==e,h=6==e,f=7==e,d=5==e||h;return function(p,g,v,A){for(var m,y,_=a(p),b=o(_),E=n(g,v),w=s(b),I=0,C=A||c,S=t?C(p,w):r||f?C(p,0):void 0;w>I;I++)if((d||I in b)&&(y=E(m=b[I],I,_),e))if(t)S[I]=y;else if(y)switch(e){case 3:return!0;case 5:return m;case 6:return I;case 2:u(S,m)}else switch(e){case 4:return!1;case 7:u(S,m)}return h?-1:i||l?l:S}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},6583:(e,t,r)=>{"use strict";var n=r(2104),i=r(5656),o=r(9303),a=r(6244),s=r(9341),c=Math.min,u=[].lastIndexOf,l=!!u&&1/[1].lastIndexOf(1,-0)<0,h=s("lastIndexOf"),f=l||!h;e.exports=f?function(e){if(l)return n(u,this,arguments)||0;var t=i(this),r=a(t),s=r-1;for(arguments.length>1&&(s=c(s,o(arguments[1]))),s<0&&(s=r+s);s>=0;s--)if(s in t&&t[s]===e)return s||0;return-1}:u},1194:(e,t,r)=>{var n=r(7293),i=r(5112),o=r(7392),a=i("species");e.exports=function(e){return o>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},9341:(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)}))}},3671:(e,t,r)=>{var n=r(7854),i=r(9662),o=r(7908),a=r(8361),s=r(6244),c=n.TypeError,u=function(e){return function(t,r,n,u){i(r);var l=o(t),h=a(l),f=s(l),d=e?f-1:0,p=e?-1:1;if(n<2)for(;;){if(d in h){u=h[d],d+=p;break}if(d+=p,e?d<0:f<=d)throw c("Reduce of empty array with no initial value")}for(;e?d>=0:f>d;d+=p)d in h&&(u=r(u,h[d],d,l));return u}};e.exports={left:u(!1),right:u(!0)}},1589:(e,t,r)=>{var n=r(7854),i=r(1400),o=r(6244),a=r(6135),s=n.Array,c=Math.max;e.exports=function(e,t,r){for(var n=o(e),u=i(t,n),l=i(void 0===r?n:r,n),h=s(c(l-u,0)),f=0;u<l;u++,f++)a(h,f,e[u]);return h.length=f,h}},206:(e,t,r)=>{var n=r(1702);e.exports=n([].slice)},4362:(e,t,r)=>{var n=r(1589),i=Math.floor,o=function(e,t){var r=e.length,c=i(r/2);return r<8?a(e,t):s(e,o(n(e,0,c),t),o(n(e,c),t),t)},a=function(e,t){for(var r,n,i=e.length,o=1;o<i;){for(n=o,r=e[o];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==o++&&(e[n]=r)}return e},s=function(e,t,r,n){for(var i=t.length,o=r.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?n(t[a],r[s])<=0?t[a++]:r[s++]:a<i?t[a++]:r[s++];return e};e.exports=o},7475:(e,t,r)=>{var n=r(7854),i=r(3157),o=r(4411),a=r(111),s=r(5112)("species"),c=n.Array;e.exports=function(e){var t;return i(e)&&(t=e.constructor,(o(t)&&(t===c||i(t.prototype))||a(t)&&null===(t=t[s]))&&(t=void 0)),void 0===t?c:t}},5417:(e,t,r)=>{var n=r(7475);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},3411:(e,t,r)=>{var n=r(9670),i=r(9212);e.exports=function(e,t,r,o){try{return o?t(n(r)[0],r[1]):t(r)}catch(t){i(e,"throw",t)}}},7072:(e,t,r)=>{var n=r(5112)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},e(o)}catch(e){}return r}},4326:(e,t,r)=>{var n=r(1702),i=n({}.toString),o=n("".slice);e.exports=function(e){return o(i(e),8,-1)}},648:(e,t,r)=>{var n=r(7854),i=r(1694),o=r(614),a=r(4326),s=r(5112)("toStringTag"),c=n.Object,u="Arguments"==a(function(){return arguments}());e.exports=i?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=c(e),s))?r:u?a(t):"Object"==(n=a(t))&&o(t.callee)?"Arguments":n}},1501:(e,t,r)=>{"use strict";var n=r(6916),i=r(9662),o=r(9670);e.exports=function(){for(var e=o(this),t=i(e.add),r=0,a=arguments.length;r<a;r++)n(t,e,arguments[r]);return e}},4092:(e,t,r)=>{"use strict";var n=r(6916),i=r(9662),o=r(9670);e.exports=function(){for(var e,t=o(this),r=i(t.delete),a=!0,s=0,c=arguments.length;s<c;s++)e=n(r,t,arguments[s]),a=a&&e;return!!a}},5631:(e,t,r)=>{"use strict";var n=r(3070).f,i=r(30),o=r(2248),a=r(9974),s=r(5787),c=r(408),u=r(654),l=r(6340),h=r(9781),f=r(2423).fastKey,d=r(9909),p=d.set,g=d.getterFor;e.exports={getConstructor:function(e,t,r,u){var l=e((function(e,n){s(e,d),p(e,{type:t,index:i(null),first:void 0,last:void 0,size:0}),h||(e.size=0),null!=n&&c(n,e[u],{that:e,AS_ENTRIES:r})})),d=l.prototype,v=g(t),A=function(e,t,r){var n,i,o=v(e),a=m(e,t);return a?a.value=r:(o.last=a={index:i=f(t,!0),key:t,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=a),n&&(n.next=a),h?o.size++:e.size++,"F"!==i&&(o.index[i]=a)),e},m=function(e,t){var r,n=v(e),i=f(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return o(d,{clear:function(){for(var e=v(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,h?e.size=0:this.size=0},delete:function(e){var t=this,r=v(t),n=m(t,e);if(n){var i=n.next,o=n.previous;delete r.index[n.index],n.removed=!0,o&&(o.next=i),i&&(i.previous=o),r.first==n&&(r.first=i),r.last==n&&(r.last=o),h?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=v(this),n=a(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!m(this,e)}}),o(d,r?{get:function(e){var t=m(this,e);return t&&t.value},set:function(e,t){return A(this,0===e?0:e,t)}}:{add:function(e){return A(this,e=0===e?0:e,e)}}),h&&n(d,"size",{get:function(){return v(this).size}}),l},setStrong:function(e,t,r){var n=t+" Iterator",i=g(t),o=g(n);u(e,t,(function(e,t){p(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),l(t)}}},9320:(e,t,r)=>{"use strict";var n=r(1702),i=r(2248),o=r(2423).getWeakData,a=r(9670),s=r(111),c=r(5787),u=r(408),l=r(2092),h=r(2597),f=r(9909),d=f.set,p=f.getterFor,g=l.find,v=l.findIndex,A=n([].splice),m=0,y=function(e){return e.frozen||(e.frozen=new _)},_=function(){this.entries=[]},b=function(e,t){return g(e.entries,(function(e){return e[0]===t}))};_.prototype={get:function(e){var t=b(this,e);if(t)return t[1]},has:function(e){return!!b(this,e)},set:function(e,t){var r=b(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=v(this.entries,(function(t){return t[0]===e}));return~t&&A(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,r,n){var l=e((function(e,i){c(e,f),d(e,{type:t,id:m++,frozen:void 0}),null!=i&&u(i,e[n],{that:e,AS_ENTRIES:r})})),f=l.prototype,g=p(t),v=function(e,t,r){var n=g(e),i=o(a(t),!0);return!0===i?y(n).set(t,r):i[n.id]=r,e};return i(f,{delete:function(e){var t=g(this);if(!s(e))return!1;var r=o(e);return!0===r?y(t).delete(e):r&&h(r,t.id)&&delete r[t.id]},has:function(e){var t=g(this);if(!s(e))return!1;var r=o(e);return!0===r?y(t).has(e):r&&h(r,t.id)}}),i(f,r?{get:function(e){var t=g(this);if(s(e)){var r=o(e);return!0===r?y(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return v(this,e,t)}}:{add:function(e){return v(this,e,!0)}}),l}}},7710:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(1702),a=r(4705),s=r(1320),c=r(2423),u=r(408),l=r(5787),h=r(614),f=r(111),d=r(7293),p=r(7072),g=r(8003),v=r(9587);e.exports=function(e,t,r){var A=-1!==e.indexOf("Map"),m=-1!==e.indexOf("Weak"),y=A?"set":"add",_=i[e],b=_&&_.prototype,E=_,w={},I=function(e){var t=o(b[e]);s(b,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(m&&!f(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return m&&!f(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(m&&!f(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(a(e,!h(_)||!(m||b.forEach&&!d((function(){(new _).entries().next()})))))E=r.getConstructor(t,e,A,y),c.enable();else if(a(e,!0)){var C=new E,S=C[y](m?{}:-0,1)!=C,T=d((function(){C.has(1)})),R=p((function(e){new _(e)})),k=!m&&d((function(){for(var e=new _,t=5;t--;)e[y](t,t);return!e.has(-0)}));R||((E=t((function(e,t){l(e,b);var r=v(new _,e,E);return null!=t&&u(t,r[y],{that:r,AS_ENTRIES:A}),r}))).prototype=b,b.constructor=E),(T||k)&&(I("delete"),I("has"),A&&I("get")),(k||S)&&I(y),m&&b.clear&&delete b.clear}return w[e]=E,n({global:!0,forced:E!=_},w),g(E,e),m||r.setStrong(E,e,A),E}},9920:(e,t,r)=>{var n=r(2597),i=r(3887),o=r(1236),a=r(3070);e.exports=function(e,t,r){for(var s=i(t),c=a.f,u=o.f,l=0;l<s.length;l++){var h=s[l];n(e,h)||r&&n(r,h)||c(e,h,u(t,h))}}},4964:(e,t,r)=>{var n=r(5112)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},8544:(e,t,r)=>{var n=r(7293);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},4230:(e,t,r)=>{var n=r(1702),i=r(4488),o=r(1340),a=/"/g,s=n("".replace);e.exports=function(e,t,r,n){var c=o(i(e)),u="<"+t;return""!==r&&(u+=" "+r+'="'+s(o(n),a,""")+'"'),u+">"+c+"</"+t+">"}},4994:(e,t,r)=>{"use strict";var n=r(3383).IteratorPrototype,i=r(30),o=r(9114),a=r(8003),s=r(7497),c=function(){return this};e.exports=function(e,t,r,u){var l=t+" Iterator";return e.prototype=i(n,{next:o(+!u,r)}),a(e,l,!1,!0),s[l]=c,e}},8880:(e,t,r)=>{var n=r(9781),i=r(3070),o=r(9114);e.exports=n?function(e,t,r){return i.f(e,t,o(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),i=r(3070),o=r(9114);e.exports=function(e,t,r){var a=n(t);a in e?i.f(e,a,o(0,r)):e[a]=r}},654:(e,t,r)=>{"use strict";var n=r(2109),i=r(6916),o=r(1913),a=r(6530),s=r(614),c=r(4994),u=r(9518),l=r(7674),h=r(8003),f=r(8880),d=r(1320),p=r(5112),g=r(7497),v=r(3383),A=a.PROPER,m=a.CONFIGURABLE,y=v.IteratorPrototype,_=v.BUGGY_SAFARI_ITERATORS,b=p("iterator"),E="keys",w="values",I="entries",C=function(){return this};e.exports=function(e,t,r,a,p,v,S){c(r,t,a);var T,R,k,O=function(e){if(e===p&&P)return P;if(!_&&e in D)return D[e];switch(e){case E:case w:case I:return function(){return new r(this,e)}}return function(){return new r(this)}},N=t+" Iterator",x=!1,D=e.prototype,L=D[b]||D["@@iterator"]||p&&D[p],P=!_&&L||O(p),B="Array"==t&&D.entries||L;if(B&&(T=u(B.call(new e)))!==Object.prototype&&T.next&&(o||u(T)===y||(l?l(T,y):s(T[b])||d(T,b,C)),h(T,N,!0,!0),o&&(g[N]=C)),A&&p==w&&L&&L.name!==w&&(!o&&m?f(D,"name",w):(x=!0,P=function(){return i(L,this)})),p)if(R={values:O(w),keys:v?P:O(E),entries:O(I)},S)for(k in R)(_||x||!(k in D))&&d(D,k,R[k]);else n({target:t,proto:!0,forced:_||x},R);return o&&!S||D[b]===P||d(D,b,P,{name:p}),g[t]=P,R}},7235:(e,t,r)=>{var n=r(857),i=r(2597),o=r(6061),a=r(3070).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});i(t,e)||a(t,e,{value:o.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),i=r(111),o=n.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.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,i=n&&n.constructor&&n.constructor.prototype;e.exports=i===Object.prototype?void 0:i},8886:(e,t,r)=>{var n=r(8113).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},7871:e=>{e.exports="object"==typeof window},256:(e,t,r)=>{var n=r(8113);e.exports=/MSIE|Trident/.test(n)},1528:(e,t,r)=>{var n=r(8113),i=r(7854);e.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==i.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),i=r(7854);e.exports="process"==n(i.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,i,o=r(7854),a=r(8113),s=o.process,c=o.Deno,u=s&&s.versions||c&&c.version,l=u&&u.v8;l&&(i=(n=l.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},8008:(e,t,r)=>{var n=r(8113).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},748:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(e,t,r)=>{var n=r(7854),i=r(1236).f,o=r(8880),a=r(1320),s=r(3505),c=r(9920),u=r(4705);e.exports=function(e,t){var r,l,h,f,d,p=e.target,g=e.global,v=e.stat;if(r=g?n:v?n[p]||s(p,{}):(n[p]||{}).prototype)for(l in t){if(f=t[l],h=e.noTargetGet?(d=i(r,l))&&d.value:r[l],!u(g?l:p+(v?".":"#")+l,e.forced)&&void 0!==h){if(typeof f==typeof h)continue;c(f,h)}(e.sham||h&&h.sham)&&o(f,"sham",!0),a(r,l,f,e)}}},7293:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},7007:(e,t,r)=>{"use strict";r(4916);var n=r(1702),i=r(1320),o=r(2261),a=r(7293),s=r(5112),c=r(8880),u=s("species"),l=RegExp.prototype;e.exports=function(e,t,r,h){var f=s(e),d=!a((function(){var t={};return t[f]=function(){return 7},7!=""[e](t)})),p=d&&!a((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[u]=function(){return r},r.flags="",r[f]=/./[f]),r.exec=function(){return t=!0,null},r[f](""),!t}));if(!d||!p||r){var g=n(/./[f]),v=t(f,""[e],(function(e,t,r,i,a){var s=n(e),c=t.exec;return c===o||c===l.exec?d&&!a?{done:!0,value:g(t,r,i)}:{done:!0,value:s(r,t,i)}:{done:!1}}));i(String.prototype,e,v[0]),i(l,f,v[1])}h&&c(l[f],"sham",!0)}},6677:(e,t,r)=>{var n=r(7293);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},2104:e=>{var t=Function.prototype,r=t.apply,n=t.bind,i=t.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?i.bind(r):function(){return i.apply(r,arguments)})},9974:(e,t,r)=>{var n=r(1702),i=r(9662),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?o(e,t):function(){return e.apply(t,arguments)}}},7065:(e,t,r)=>{"use strict";var n=r(7854),i=r(1702),o=r(9662),a=r(111),s=r(2597),c=r(206),u=n.Function,l=i([].concat),h=i([].join),f={},d=function(e,t,r){if(!s(f,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";f[t]=u("C,a","return new C("+h(n,",")+")")}return f[t](e,r)};e.exports=u.bind||function(e){var t=o(this),r=t.prototype,n=c(arguments,1),i=function(){var r=l(n,c(arguments));return this instanceof i?d(t,r.length,r):t.apply(e,r)};return a(r)&&(i.prototype=r),i}},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),i=r(2597),o=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=i(o,"name"),c=s&&"something"===function(){}.name,u=s&&(!n||n&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:u}},1702:e=>{var t=Function.prototype,r=t.bind,n=t.call,i=r&&r.bind(n);e.exports=r?function(e){return e&&i(n,e)}:function(e){return e&&function(){return n.apply(e,arguments)}}},5005:(e,t,r)=>{var n=r(7854),i=r(614),o=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e]):n[e]&&n[e][t]}},1246:(e,t,r)=>{var n=r(648),i=r(8173),o=r(7497),a=r(5112)("iterator");e.exports=function(e){if(null!=e)return i(e,a)||i(e,"@@iterator")||o[n(e)]}},8554:(e,t,r)=>{var n=r(7854),i=r(6916),o=r(9662),a=r(9670),s=r(6330),c=r(1246),u=n.TypeError;e.exports=function(e,t){var r=arguments.length<2?c(e):t;if(o(r))return a(i(r,e));throw u(s(e)+" is not iterable")}},4647:(e,t,r)=>{var n=r(6916);e.exports=function(e){return n(Map.prototype.entries,e)}},8173:(e,t,r)=>{var n=r(9662);e.exports=function(e,t){var r=e[t];return null==r?void 0:n(r)}},6767:(e,t,r)=>{var n=r(6916);e.exports=function(e){return n(Set.prototype.values,e)}},7854:(e,t,r)=>{var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2597:(e,t,r)=>{var n=r(1702),i=r(7908),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(i(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),i=r(7293),o=r(317);e.exports=!n&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},1179:(e,t,r)=>{var n=r(7854).Array,i=Math.abs,o=Math.pow,a=Math.floor,s=Math.log,c=Math.LN2;e.exports={pack:function(e,t,r){var u,l,h,f=n(r),d=8*r-t-1,p=(1<<d)-1,g=p>>1,v=23===t?o(2,-24)-o(2,-77):0,A=e<0||0===e&&1/e<0?1:0,m=0;for((e=i(e))!=e||e===1/0?(l=e!=e?1:0,u=p):(u=a(s(e)/c),e*(h=o(2,-u))<1&&(u--,h*=2),(e+=u+g>=1?v/h:v*o(2,1-g))*h>=2&&(u++,h/=2),u+g>=p?(l=0,u=p):u+g>=1?(l=(e*h-1)*o(2,t),u+=g):(l=e*o(2,g-1)*o(2,t),u=0));t>=8;)f[m++]=255&l,l/=256,t-=8;for(u=u<<t|l,d+=t;d>0;)f[m++]=255&u,u/=256,d-=8;return f[--m]|=128*A,f},unpack:function(e,t){var r,n=e.length,i=8*n-t-1,a=(1<<i)-1,s=a>>1,c=i-7,u=n-1,l=e[u--],h=127&l;for(l>>=7;c>0;)h=256*h+e[u--],c-=8;for(r=h&(1<<-c)-1,h>>=-c,c+=t;c>0;)r=256*r+e[u--],c-=8;if(0===h)h=1-s;else{if(h===a)return r?NaN:l?-1/0:1/0;r+=o(2,t),h-=s}return(l?-1:1)*r*o(2,h-t)}}},8361:(e,t,r)=>{var n=r(7854),i=r(1702),o=r(7293),a=r(4326),s=n.Object,c=i("".split);e.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?c(e,""):s(e)}:s},9587:(e,t,r)=>{var n=r(614),i=r(111),o=r(7674);e.exports=function(e,t,r){var a,s;return o&&n(a=t.constructor)&&a!==r&&i(s=a.prototype)&&s!==r.prototype&&o(e,s),e}},2788:(e,t,r)=>{var n=r(1702),i=r(614),o=r(5465),a=n(Function.toString);i(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},2423:(e,t,r)=>{var n=r(2109),i=r(1702),o=r(3501),a=r(111),s=r(2597),c=r(3070).f,u=r(8006),l=r(1156),h=r(2050),f=r(9711),d=r(6677),p=!1,g=f("meta"),v=0,A=function(e){c(e,g,{value:{objectID:"O"+v++,weakData:{}}})},m=e.exports={enable:function(){m.enable=function(){},p=!0;var e=u.f,t=i([].splice),r={};r[g]=1,e(r).length&&(u.f=function(r){for(var n=e(r),i=0,o=n.length;i<o;i++)if(n[i]===g){t(n,i,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,g)){if(!h(e))return"F";if(!t)return"E";A(e)}return e[g].objectID},getWeakData:function(e,t){if(!s(e,g)){if(!h(e))return!0;if(!t)return!1;A(e)}return e[g].weakData},onFreeze:function(e){return d&&p&&h(e)&&!s(e,g)&&A(e),e}};o[g]=!0},9909:(e,t,r)=>{var n,i,o,a=r(8536),s=r(7854),c=r(1702),u=r(111),l=r(8880),h=r(2597),f=r(5465),d=r(6200),p=r(3501),g="Object already initialized",v=s.TypeError,A=s.WeakMap;if(a||f.state){var m=f.state||(f.state=new A),y=c(m.get),_=c(m.has),b=c(m.set);n=function(e,t){if(_(m,e))throw new v(g);return t.facade=e,b(m,e,t),t},i=function(e){return y(m,e)||{}},o=function(e){return _(m,e)}}else{var E=d("state");p[E]=!0,n=function(e,t){if(h(e,E))throw new v(g);return t.facade=e,l(e,E,t),t},i=function(e){return h(e,E)?e[E]:{}},o=function(e){return h(e,E)}}e.exports={set:n,get:i,has:o,enforce:function(e){return o(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=i(t)).type!==e)throw v("Incompatible receiver, "+e+" required");return r}}}},7659:(e,t,r)=>{var n=r(5112),i=r(7497),o=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[o]===e)}},3157:(e,t,r)=>{var n=r(4326);e.exports=Array.isArray||function(e){return"Array"==n(e)}},614:e=>{e.exports=function(e){return"function"==typeof e}},4411:(e,t,r)=>{var n=r(1702),i=r(7293),o=r(614),a=r(648),s=r(5005),c=r(2788),u=function(){},l=[],h=s("Reflect","construct"),f=/^\s*(?:class|function)\b/,d=n(f.exec),p=!f.exec(u),g=function(e){if(!o(e))return!1;try{return h(u,l,e),!0}catch(e){return!1}},v=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!d(f,c(e))}catch(e){return!0}};v.sham=!0,e.exports=!h||i((function(){var e;return g(g.call)||!g(Object)||!g((function(){e=!0}))||e}))?v:g},4705:(e,t,r)=>{var n=r(7293),i=r(614),o=/#|\.prototype\./,a=function(e,t){var r=c[s(e)];return r==l||r!=u&&(i(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=a.data={},u=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},5988:(e,t,r)=>{var n=r(111),i=Math.floor;e.exports=Number.isInteger||function(e){return!n(e)&&isFinite(e)&&i(e)===e}},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},7850:(e,t,r)=>{var n=r(111),i=r(4326),o=r(5112)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},2190:(e,t,r)=>{var n=r(7854),i=r(5005),o=r(614),a=r(7976),s=r(3307),c=n.Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=i("Symbol");return o(t)&&a(t.prototype,c(e))}},408:(e,t,r)=>{var n=r(7854),i=r(9974),o=r(6916),a=r(9670),s=r(6330),c=r(7659),u=r(6244),l=r(7976),h=r(8554),f=r(1246),d=r(9212),p=n.TypeError,g=function(e,t){this.stopped=e,this.result=t},v=g.prototype;e.exports=function(e,t,r){var n,A,m,y,_,b,E,w=r&&r.that,I=!(!r||!r.AS_ENTRIES),C=!(!r||!r.IS_ITERATOR),S=!(!r||!r.INTERRUPTED),T=i(t,w),R=function(e){return n&&d(n,"normal",e),new g(!0,e)},k=function(e){return I?(a(e),S?T(e[0],e[1],R):T(e[0],e[1])):S?T(e,R):T(e)};if(C)n=e;else{if(!(A=f(e)))throw p(s(e)+" is not iterable");if(c(A)){for(m=0,y=u(e);y>m;m++)if((_=k(e[m]))&&l(v,_))return _;return new g(!1)}n=h(e,A)}for(b=n.next;!(E=o(b,n)).done;){try{_=k(E.value)}catch(e){d(n,"throw",e)}if("object"==typeof _&&_&&l(v,_))return _}return new g(!1)}},9212:(e,t,r)=>{var n=r(6916),i=r(9670),o=r(8173);e.exports=function(e,t,r){var a,s;i(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw r;if(s)throw a;return i(a),r}},3383:(e,t,r)=>{"use strict";var n,i,o,a=r(7293),s=r(614),c=r(30),u=r(9518),l=r(1320),h=r(5112),f=r(1913),d=h("iterator"),p=!1;[].keys&&("next"in(o=[].keys())?(i=u(u(o)))!==Object.prototype&&(n=i):p=!0),null==n||a((function(){var e={};return n[d].call(e)!==e}))?n={}:f&&(n=c(n)),s(n[d])||l(n,d,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}},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,i,o,a,s,c,u,l,h=r(7854),f=r(9974),d=r(1236).f,p=r(261).set,g=r(6833),v=r(1528),A=r(1036),m=r(5268),y=h.MutationObserver||h.WebKitMutationObserver,_=h.document,b=h.process,E=h.Promise,w=d(h,"queueMicrotask"),I=w&&w.value;I||(n=function(){var e,t;for(m&&(e=b.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?a():o=void 0,e}}o=void 0,e&&e.enter()},g||m||A||!y||!_?!v&&E&&E.resolve?((u=E.resolve(void 0)).constructor=E,l=f(u.then,u),a=function(){l(n)}):m?a=function(){b.nextTick(n)}:(p=f(p,h),a=function(){p(n)}):(s=!0,c=_.createTextNode(""),new y(n).observe(c,{characterData:!0}),a=function(){c.data=s=!s})),e.exports=I||function(e){var t={fn:e,next:void 0};o&&(o.next=t),i||(i=t,a()),o=t}},3366:(e,t,r)=>{var n=r(7854);e.exports=n.Promise},133:(e,t,r)=>{var n=r(7392),i=r(7293);e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8536:(e,t,r)=>{var n=r(7854),i=r(614),o=r(2788),a=n.WeakMap;e.exports=i(a)&&/native code/.test(o(a))},8523:(e,t,r)=>{"use strict";var n=r(9662),i=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 i(e)}},3929:(e,t,r)=>{var n=r(7854),i=r(7850),o=n.TypeError;e.exports=function(e){if(i(e))throw o("The method doesn't accept regular expressions");return e}},3009:(e,t,r)=>{var n=r(7854),i=r(7293),o=r(1702),a=r(1340),s=r(3111).trim,c=r(1361),u=n.parseInt,l=n.Symbol,h=l&&l.iterator,f=/^[+-]?0x/i,d=o(f.exec),p=8!==u(c+"08")||22!==u(c+"0x16")||h&&!i((function(){u(Object(h))}));e.exports=p?function(e,t){var r=s(a(e));return u(r,t>>>0||(d(f,r)?16:10))}:u},1574:(e,t,r)=>{"use strict";var n=r(9781),i=r(1702),o=r(6916),a=r(7293),s=r(1956),c=r(5181),u=r(5296),l=r(7908),h=r(8361),f=Object.assign,d=Object.defineProperty,p=i([].concat);e.exports=!f||a((function(){if(n&&1!==f({b:1},f(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach((function(e){t[e]=e})),7!=f({},e)[r]||s(f({},t)).join("")!=i}))?function(e,t){for(var r=l(e),i=arguments.length,a=1,f=c.f,d=u.f;i>a;)for(var g,v=h(arguments[a++]),A=f?p(s(v),f(v)):s(v),m=A.length,y=0;m>y;)g=A[y++],n&&!o(d,v,g)||(r[g]=v[g]);return r}:f},30:(e,t,r)=>{var n,i=r(9670),o=r(6048),a=r(748),s=r(3501),c=r(490),u=r(317),l=r(6200),h=l("IE_PROTO"),f=function(){},d=function(e){return"<script>"+e+"</"+"script>"},p=function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t;g="undefined"!=typeof document?document.domain&&n?p(n):((t=u("iframe")).style.display="none",c.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F):p(n);for(var r=a.length;r--;)delete g.prototype[a[r]];return g()};s[h]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f.prototype=i(e),r=new f,f.prototype=null,r[h]=e):r=g(),void 0===t?r:o(r,t)}},6048:(e,t,r)=>{var n=r(9781),i=r(3070),o=r(9670),a=r(5656),s=r(1956);e.exports=n?Object.defineProperties:function(e,t){o(e);for(var r,n=a(t),c=s(t),u=c.length,l=0;u>l;)i.f(e,r=c[l++],n[r]);return e}},3070:(e,t,r)=>{var n=r(7854),i=r(9781),o=r(4664),a=r(9670),s=r(4948),c=n.TypeError,u=Object.defineProperty;t.f=i?u:function(e,t,r){if(a(e),t=s(t),a(r),o)try{return u(e,t,r)}catch(e){}if("get"in r||"set"in r)throw c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},1236:(e,t,r)=>{var n=r(9781),i=r(6916),o=r(5296),a=r(9114),s=r(5656),c=r(4948),u=r(2597),l=r(4664),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=s(e),t=c(t),l)try{return h(e,t)}catch(e){}if(u(e,t))return a(!i(o.f,e,t),e[t])}},1156:(e,t,r)=>{var n=r(4326),i=r(5656),o=r(8006).f,a=r(1589),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"==n(e)?function(e){try{return o(e)}catch(e){return a(s)}}(e):o(i(e))}},8006:(e,t,r)=>{var n=r(6324),i=r(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},5181:(e,t)=>{t.f=Object.getOwnPropertySymbols},9518:(e,t,r)=>{var n=r(7854),i=r(2597),o=r(614),a=r(7908),s=r(6200),c=r(8544),u=s("IE_PROTO"),l=n.Object,h=l.prototype;e.exports=c?l.getPrototypeOf:function(e){var t=a(e);if(i(t,u))return t[u];var r=t.constructor;return o(r)&&t instanceof r?r.prototype:t instanceof l?h:null}},2050:(e,t,r)=>{var n=r(7293),i=r(111),o=r(4326),a=r(7556),s=Object.isExtensible,c=n((function(){s(1)}));e.exports=c||a?function(e){return!!i(e)&&((!a||"ArrayBuffer"!=o(e))&&(!s||s(e)))}:s},7976:(e,t,r)=>{var n=r(1702);e.exports=n({}.isPrototypeOf)},6324:(e,t,r)=>{var n=r(1702),i=r(2597),o=r(5656),a=r(1318).indexOf,s=r(3501),c=n([].push);e.exports=function(e,t){var r,n=o(e),u=0,l=[];for(r in n)!i(s,r)&&i(n,r)&&c(l,r);for(;t.length>u;)i(n,r=t[u++])&&(~a(l,r)||c(l,r));return l}},1956:(e,t,r)=>{var n=r(6324),i=r(748);e.exports=Object.keys||function(e){return n(e,i)}},5296:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},7674:(e,t,r)=>{var n=r(1702),i=r(9670),o=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(r,n){return i(r),o(n),t?e(r,n):r.__proto__=n,r}}():void 0)},4699:(e,t,r)=>{var n=r(9781),i=r(1702),o=r(1956),a=r(5656),s=i(r(5296).f),c=i([].push),u=function(e){return function(t){for(var r,i=a(t),u=o(i),l=u.length,h=0,f=[];l>h;)r=u[h++],n&&!s(i,r)||c(f,e?[r,i[r]]:i[r]);return f}};e.exports={entries:u(!0),values:u(!1)}},288:(e,t,r)=>{"use strict";var n=r(1694),i=r(648);e.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},2140:(e,t,r)=>{var n=r(7854),i=r(6916),o=r(614),a=r(111),s=n.TypeError;e.exports=function(e,t){var r,n;if("string"===t&&o(r=e.toString)&&!a(n=i(r,e)))return n;if(o(r=e.valueOf)&&!a(n=i(r,e)))return n;if("string"!==t&&o(r=e.toString)&&!a(n=i(r,e)))return n;throw s("Can't convert object to primitive value")}},3887:(e,t,r)=>{var n=r(5005),i=r(1702),o=r(8006),a=r(5181),s=r(9670),c=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(s(e)),r=a.f;return r?c(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),i=r(111),o=r(8523);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=o.f(e);return(0,r.resolve)(t),r.promise}},8572:e=>{var t=function(){this.head=null,this.tail=null};t.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=t},2248:(e,t,r)=>{var n=r(1320);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},1320:(e,t,r)=>{var n=r(7854),i=r(614),o=r(2597),a=r(8880),s=r(3505),c=r(2788),u=r(9909),l=r(6530).CONFIGURABLE,h=u.get,f=u.enforce,d=String(String).split("String");(e.exports=function(e,t,r,c){var u,h=!!c&&!!c.unsafe,p=!!c&&!!c.enumerable,g=!!c&&!!c.noTargetGet,v=c&&void 0!==c.name?c.name:t;i(r)&&("Symbol("===String(v).slice(0,7)&&(v="["+String(v).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!o(r,"name")||l&&r.name!==v)&&a(r,"name",v),(u=f(r)).source||(u.source=d.join("string"==typeof v?v:""))),e!==n?(h?!g&&e[t]&&(p=!0):delete e[t],p?e[t]=r:a(e,t,r)):p?e[t]=r:s(t,r)})(Function.prototype,"toString",(function(){return i(this)&&h(this).source||c(this)}))},7651:(e,t,r)=>{var n=r(7854),i=r(6916),o=r(9670),a=r(614),s=r(4326),c=r(2261),u=n.TypeError;e.exports=function(e,t){var r=e.exec;if(a(r)){var n=i(r,e,t);return null!==n&&o(n),n}if("RegExp"===s(e))return i(c,e,t);throw u("RegExp#exec called on incompatible receiver")}},2261:(e,t,r)=>{"use strict";var n,i,o=r(6916),a=r(1702),s=r(1340),c=r(7066),u=r(2999),l=r(2309),h=r(30),f=r(9909).get,d=r(9441),p=r(7168),g=l("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,A=v,m=a("".charAt),y=a("".indexOf),_=a("".replace),b=a("".slice),E=(i=/b*/g,o(v,n=/a/,"a"),o(v,i,"a"),0!==n.lastIndex||0!==i.lastIndex),w=u.BROKEN_CARET,I=void 0!==/()??/.exec("")[1];(E||I||w||d||p)&&(A=function(e){var t,r,n,i,a,u,l,d=this,p=f(d),C=s(e),S=p.raw;if(S)return S.lastIndex=d.lastIndex,t=o(A,S,C),d.lastIndex=S.lastIndex,t;var T=p.groups,R=w&&d.sticky,k=o(c,d),O=d.source,N=0,x=C;if(R&&(k=_(k,"y",""),-1===y(k,"g")&&(k+="g"),x=b(C,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==m(C,d.lastIndex-1))&&(O="(?: "+O+")",x=" "+x,N++),r=new RegExp("^(?:"+O+")",k)),I&&(r=new RegExp("^"+O+"$(?!\\s)",k)),E&&(n=d.lastIndex),i=o(v,R?r:d,x),R?i?(i.input=b(i.input,N),i[0]=b(i[0],N),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:E&&i&&(d.lastIndex=d.global?i.index+i[0].length:n),I&&i&&i.length>1&&o(g,i[0],r,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&T)for(i.groups=u=h(null),a=0;a<T.length;a++)u[(l=T[a])[0]]=i[l[1]];return i}),e.exports=A},7066:(e,t,r)=>{"use strict";var n=r(9670);e.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},2999:(e,t,r)=>{var n=r(7293),i=r(7854).RegExp,o=n((function(){var e=i("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),a=o||n((function(){return!i("a","y").sticky})),s=o||n((function(){var e=i("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},9441:(e,t,r)=>{var n=r(7293),i=r(7854).RegExp;e.exports=n((function(){var e=i(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},7168:(e,t,r)=>{var n=r(7293),i=r(7854).RegExp;e.exports=n((function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},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}},6465:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},3505:(e,t,r)=>{var n=r(7854),i=Object.defineProperty;e.exports=function(e,t){try{i(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),i=r(3070),o=r(5112),a=r(9781),s=o("species");e.exports=function(e){var t=n(e),r=i.f;a&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}},8003:(e,t,r)=>{var n=r(3070).f,i=r(2597),o=r(5112)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!i(e,o)&&n(e,o,{configurable:!0,value:t})}},6200:(e,t,r)=>{var n=r(2309),i=r(9711),o=n("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},5465:(e,t,r)=>{var n=r(7854),i=r(3505),o="__core-js_shared__",a=n[o]||i(o,{});e.exports=a},2309:(e,t,r)=>{var n=r(1913),i=r(5465);(e.exports=function(e,t){return i[e]||(i[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),i=r(9483),o=r(5112)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||null==(r=n(a)[o])?t:i(r)}},3429:(e,t,r)=>{var n=r(7293);e.exports=function(e){return n((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},8710:(e,t,r)=>{var n=r(1702),i=r(9303),o=r(1340),a=r(4488),s=n("".charAt),c=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,r){var n,l,h=o(a(t)),f=i(r),d=h.length;return f<0||f>=d?e?"":void 0:(n=c(h,f))<55296||n>56319||f+1===d||(l=c(h,f+1))<56320||l>57343?e?s(h,f):n:e?u(h,f,f+2):l-56320+(n-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},3111:(e,t,r)=>{var n=r(1702),i=r(4488),o=r(1340),a=r(1361),s=n("".replace),c="["+a+"]",u=RegExp("^"+c+c+"*"),l=RegExp(c+c+"*$"),h=function(e){return function(t){var r=o(i(t));return 1&e&&(r=s(r,u,"")),2&e&&(r=s(r,l,"")),r}};e.exports={start:h(1),end:h(2),trim:h(3)}},261:(e,t,r)=>{var n,i,o,a,s=r(7854),c=r(2104),u=r(9974),l=r(614),h=r(2597),f=r(7293),d=r(490),p=r(206),g=r(317),v=r(6833),A=r(5268),m=s.setImmediate,y=s.clearImmediate,_=s.process,b=s.Dispatch,E=s.Function,w=s.MessageChannel,I=s.String,C=0,S={},T="onreadystatechange";try{n=s.location}catch(e){}var R=function(e){if(h(S,e)){var t=S[e];delete S[e],t()}},k=function(e){return function(){R(e)}},O=function(e){R(e.data)},N=function(e){s.postMessage(I(e),n.protocol+"//"+n.host)};m&&y||(m=function(e){var t=p(arguments,1);return S[++C]=function(){c(l(e)?e:E(e),void 0,t)},i(C),C},y=function(e){delete S[e]},A?i=function(e){_.nextTick(k(e))}:b&&b.now?i=function(e){b.now(k(e))}:w&&!v?(a=(o=new w).port2,o.port1.onmessage=O,i=u(a.postMessage,a)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!f(N)?(i=N,s.addEventListener("message",O,!1)):i=T in g("script")?function(e){d.appendChild(g("script")).onreadystatechange=function(){d.removeChild(this),R(e)}}:function(e){setTimeout(k(e),0)}),e.exports={set:m,clear:y}},1400:(e,t,r)=>{var n=r(9303),i=Math.max,o=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):o(r,t)}},7067:(e,t,r)=>{var n=r(7854),i=r(9303),o=r(7466),a=n.RangeError;e.exports=function(e){if(void 0===e)return 0;var t=i(e),r=o(t);if(t!==r)throw a("Wrong length or index");return r}},5656:(e,t,r)=>{var n=r(8361),i=r(4488);e.exports=function(e){return n(i(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),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},7908:(e,t,r)=>{var n=r(7854),i=r(4488),o=n.Object;e.exports=function(e){return o(i(e))}},4590:(e,t,r)=>{var n=r(7854),i=r(3002),o=n.RangeError;e.exports=function(e,t){var r=i(e);if(r%t)throw o("Wrong offset");return r}},3002:(e,t,r)=>{var n=r(7854),i=r(9303),o=n.RangeError;e.exports=function(e){var t=i(e);if(t<0)throw o("The argument can't be less than 0");return t}},7593:(e,t,r)=>{var n=r(7854),i=r(6916),o=r(111),a=r(2190),s=r(8173),c=r(2140),u=r(5112),l=n.TypeError,h=u("toPrimitive");e.exports=function(e,t){if(!o(e)||a(e))return e;var r,n=s(e,h);if(n){if(void 0===t&&(t="default"),r=i(n,e,t),!o(r)||a(r))return r;throw l("Can't convert object to primitive value")}return void 0===t&&(t="number"),c(e,t)}},4948:(e,t,r)=>{var n=r(7593),i=r(2190);e.exports=function(e){var t=n(e,"string");return i(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),i=r(648),o=n.String;e.exports=function(e){if("Symbol"===i(e))throw TypeError("Cannot convert a Symbol value to a string");return o(e)}},6330:(e,t,r)=>{var n=r(7854).String;e.exports=function(e){try{return n(e)}catch(e){return"Object"}}},9843:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(6916),a=r(9781),s=r(3832),c=r(260),u=r(3331),l=r(5787),h=r(9114),f=r(8880),d=r(5988),p=r(7466),g=r(7067),v=r(4590),A=r(4948),m=r(2597),y=r(648),_=r(111),b=r(2190),E=r(30),w=r(7976),I=r(7674),C=r(8006).f,S=r(7321),T=r(2092).forEach,R=r(6340),k=r(3070),O=r(1236),N=r(9909),x=r(9587),D=N.get,L=N.set,P=k.f,B=O.f,M=Math.round,j=i.RangeError,U=u.ArrayBuffer,F=U.prototype,Q=u.DataView,q=c.NATIVE_ARRAY_BUFFER_VIEWS,G=c.TYPED_ARRAY_CONSTRUCTOR,V=c.TYPED_ARRAY_TAG,K=c.TypedArray,H=c.TypedArrayPrototype,z=c.aTypedArrayConstructor,W=c.isTypedArray,Y="BYTES_PER_ELEMENT",J="Wrong length",X=function(e,t){z(e);for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i},Z=function(e,t){P(e,t,{get:function(){return D(this)[t]}})},$=function(e){var t;return w(F,e)||"ArrayBuffer"==(t=y(e))||"SharedArrayBuffer"==t},ee=function(e,t){return W(e)&&!b(t)&&t in e&&d(+t)&&t>=0},te=function(e,t){return t=A(t),ee(e,t)?h(2,e[t]):B(e,t)},re=function(e,t,r){return t=A(t),!(ee(e,t)&&_(r)&&m(r,"value"))||m(r,"get")||m(r,"set")||r.configurable||m(r,"writable")&&!r.writable||m(r,"enumerable")&&!r.enumerable?P(e,t,r):(e[t]=r.value,e)};a?(q||(O.f=te,k.f=re,Z(H,"buffer"),Z(H,"byteOffset"),Z(H,"byteLength"),Z(H,"length")),n({target:"Object",stat:!0,forced:!q},{getOwnPropertyDescriptor:te,defineProperty:re}),e.exports=function(e,t,r){var a=e.match(/\d+$/)[0]/8,c=e+(r?"Clamped":"")+"Array",u="get"+e,h="set"+e,d=i[c],A=d,m=A&&A.prototype,y={},b=function(e,t){P(e,t,{get:function(){return function(e,t){var r=D(e);return r.view[u](t*a+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var i=D(e);r&&(n=(n=M(n))<0?0:n>255?255:255&n),i.view[h](t*a+i.byteOffset,n,!0)}(this,t,e)},enumerable:!0})};q?s&&(A=t((function(e,t,r,n){return l(e,m),x(_(t)?$(t)?void 0!==n?new d(t,v(r,a),n):void 0!==r?new d(t,v(r,a)):new d(t):W(t)?X(A,t):o(S,A,t):new d(g(t)),e,A)})),I&&I(A,K),T(C(d),(function(e){e in A||f(A,e,d[e])})),A.prototype=m):(A=t((function(e,t,r,n){l(e,m);var i,s,c,u=0,h=0;if(_(t)){if(!$(t))return W(t)?X(A,t):o(S,A,t);i=t,h=v(r,a);var f=t.byteLength;if(void 0===n){if(f%a)throw j(J);if((s=f-h)<0)throw j(J)}else if((s=p(n)*a)+h>f)throw j(J);c=s/a}else c=g(t),i=new U(s=c*a);for(L(e,{buffer:i,byteOffset:h,byteLength:s,length:c,view:new Q(i)});u<c;)b(e,u++)})),I&&I(A,K),m=A.prototype=E(H)),m.constructor!==A&&f(m,"constructor",A),f(m,G,A),V&&f(m,V,c),y[c]=A,n({global:!0,forced:A!=d,sham:!q},y),Y in A||f(A,Y,a),Y in m||f(m,Y,a),R(c)}):e.exports=function(){}},3832:(e,t,r)=>{var n=r(7854),i=r(7293),o=r(7072),a=r(260).NATIVE_ARRAY_BUFFER_VIEWS,s=n.ArrayBuffer,c=n.Int8Array;e.exports=!a||!i((function(){c(1)}))||!i((function(){new c(-1)}))||!o((function(e){new c,new c(null),new c(1.5),new c(e)}),!0)||i((function(){return 1!==new c(new s(2),1,void 0).length}))},3074:(e,t,r)=>{var n=r(7745),i=r(6304);e.exports=function(e,t){return n(i(e),t)}},7321:(e,t,r)=>{var n=r(9974),i=r(6916),o=r(9483),a=r(7908),s=r(6244),c=r(8554),u=r(1246),l=r(7659),h=r(260).aTypedArrayConstructor;e.exports=function(e){var t,r,f,d,p,g,v=o(this),A=a(e),m=arguments.length,y=m>1?arguments[1]:void 0,_=void 0!==y,b=u(A);if(b&&!l(b))for(g=(p=c(A,b)).next,A=[];!(d=i(g,p)).done;)A.push(d.value);for(_&&m>2&&(y=n(y,arguments[2])),r=s(A),f=new(h(v))(r),t=0;r>t;t++)f[t]=_?y(A[t],t):A[t];return f}},6304:(e,t,r)=>{var n=r(260),i=r(6707),o=n.TYPED_ARRAY_CONSTRUCTOR,a=n.aTypedArrayConstructor;e.exports=function(e){return a(i(e,e[o]))}},9711:(e,t,r)=>{var n=r(1702),i=0,o=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+o,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),i=r(2309),o=r(2597),a=r(9711),s=r(133),c=r(3307),u=i("wks"),l=n.Symbol,h=l&&l.for,f=c?l:l&&l.withoutSetter||a;e.exports=function(e){if(!o(u,e)||!s&&"string"!=typeof u[e]){var t="Symbol."+e;s&&o(l,e)?u[e]=l[e]:u[e]=c&&h?h(t):f(t)}return u[e]}},1361:e=>{e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},9575:(e,t,r)=>{"use strict";var n=r(2109),i=r(1702),o=r(7293),a=r(3331),s=r(9670),c=r(1400),u=r(7466),l=r(6707),h=a.ArrayBuffer,f=a.DataView,d=f.prototype,p=i(h.prototype.slice),g=i(d.getUint8),v=i(d.setUint8);n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:o((function(){return!new h(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(p&&void 0===t)return p(s(this),e);for(var r=s(this).byteLength,n=c(e,r),i=c(void 0===t?r:t,r),o=new(l(this,h))(u(i-n)),a=new f(this),d=new f(o),A=0;n<i;)v(d,A++,g(a,n++));return o}})},2222:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(7293),a=r(3157),s=r(111),c=r(7908),u=r(6244),l=r(6135),h=r(5417),f=r(1194),d=r(5112),p=r(7392),g=d("isConcatSpreadable"),v=9007199254740991,A="Maximum allowed index exceeded",m=i.TypeError,y=p>=51||!o((function(){var e=[];return e[g]=!1,e.concat()[0]!==e})),_=f("concat"),b=function(e){if(!s(e))return!1;var t=e[g];return void 0!==t?!!t:a(e)};n({target:"Array",proto:!0,forced:!y||!_},{concat:function(e){var t,r,n,i,o,a=c(this),s=h(a,0),f=0;for(t=-1,n=arguments.length;t<n;t++)if(b(o=-1===t?a:arguments[t])){if(f+(i=u(o))>v)throw m(A);for(r=0;r<i;r++,f++)r in o&&l(s,f,o[r])}else{if(f>=v)throw m(A);l(s,f++,o)}return s.length=f,s}})},3290:(e,t,r)=>{var n=r(2109),i=r(1285),o=r(1223);n({target:"Array",proto:!0},{fill:i}),o("fill")},7327:(e,t,r)=>{"use strict";var n=r(2109),i=r(2092).filter;n({target:"Array",proto:!0,forced:!r(1194)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},9826:(e,t,r)=>{"use strict";var n=r(2109),i=r(2092).find,o=r(1223),a="find",s=!0;a in[]&&Array(1).find((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o(a)},9554:(e,t,r)=>{"use strict";var n=r(2109),i=r(8533);n({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},1038:(e,t,r)=>{var n=r(2109),i=r(8457);n({target:"Array",stat:!0,forced:!r(7072)((function(e){Array.from(e)}))},{from:i})},6699:(e,t,r)=>{"use strict";var n=r(2109),i=r(1318).includes,o=r(1223);n({target:"Array",proto:!0},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},2772:(e,t,r)=>{"use strict";var n=r(2109),i=r(1702),o=r(1318).indexOf,a=r(9341),s=i([].indexOf),c=!!s&&1/s([1],1,-0)<0,u=a("indexOf");n({target:"Array",proto:!0,forced:c||!u},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return c?s(this,e,t)||0:o(this,e,t)}})},9753:(e,t,r)=>{r(2109)({target:"Array",stat:!0},{isArray:r(3157)})},6992:(e,t,r)=>{"use strict";var n=r(5656),i=r(1223),o=r(7497),a=r(9909),s=r(3070).f,c=r(654),u=r(1913),l=r(9781),h="Array Iterator",f=a.set,d=a.getterFor(h);e.exports=c(Array,"Array",(function(e,t){f(this,{type:h,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 p=o.Arguments=o.Array;if(i("keys"),i("values"),i("entries"),!u&&l&&"values"!==p.name)try{s(p,"name",{value:"values"})}catch(e){}},9600:(e,t,r)=>{"use strict";var n=r(2109),i=r(1702),o=r(8361),a=r(5656),s=r(9341),c=i([].join),u=o!=Object,l=s("join",",");n({target:"Array",proto:!0,forced:u||!l},{join:function(e){return c(a(this),void 0===e?",":e)}})},1249:(e,t,r)=>{"use strict";var n=r(2109),i=r(2092).map;n({target:"Array",proto:!0,forced:!r(1194)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},5827:(e,t,r)=>{"use strict";var n=r(2109),i=r(3671).left,o=r(9341),a=r(7392),s=r(5268);n({target:"Array",proto:!0,forced:!o("reduce")||!s&&a>79&&a<83},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},7042:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(3157),a=r(4411),s=r(111),c=r(1400),u=r(6244),l=r(5656),h=r(6135),f=r(5112),d=r(1194),p=r(206),g=d("slice"),v=f("species"),A=i.Array,m=Math.max;n({target:"Array",proto:!0,forced:!g},{slice:function(e,t){var r,n,i,f=l(this),d=u(f),g=c(e,d),y=c(void 0===t?d:t,d);if(o(f)&&(r=f.constructor,(a(r)&&(r===A||o(r.prototype))||s(r)&&null===(r=r[v]))&&(r=void 0),r===A||void 0===r))return p(f,g,y);for(n=new(void 0===r?A:r)(m(y-g,0)),i=0;g<y;g++,i++)g in f&&h(n,i,f[g]);return n.length=i,n}})},2707:(e,t,r)=>{"use strict";var n=r(2109),i=r(1702),o=r(9662),a=r(7908),s=r(6244),c=r(1340),u=r(7293),l=r(4362),h=r(9341),f=r(8886),d=r(256),p=r(7392),g=r(8008),v=[],A=i(v.sort),m=i(v.push),y=u((function(){v.sort(void 0)})),_=u((function(){v.sort(null)})),b=h("sort"),E=!u((function(){if(p)return p<70;if(!(f&&f>3)){if(d)return!0;if(g)return g<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)v.push({k:t+n,v:r})}for(v.sort((function(e,t){return t.v-e.v})),n=0;n<v.length;n++)t=v[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));n({target:"Array",proto:!0,forced:y||!_||!b||!E},{sort:function(e){void 0!==e&&o(e);var t=a(this);if(E)return void 0===e?A(t):A(t,e);var r,n,i=[],u=s(t);for(n=0;n<u;n++)n in t&&m(i,t[n]);for(l(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:c(t)>c(r)?1:-1}}(e)),r=i.length,n=0;n<r;)t[n]=i[n++];for(;n<u;)delete t[n++];return t}})},561:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(1400),a=r(9303),s=r(6244),c=r(7908),u=r(5417),l=r(6135),h=r(1194)("splice"),f=i.TypeError,d=Math.max,p=Math.min,g=9007199254740991,v="Maximum allowed length exceeded";n({target:"Array",proto:!0,forced:!h},{splice:function(e,t){var r,n,i,h,A,m,y=c(this),_=s(y),b=o(e,_),E=arguments.length;if(0===E?r=n=0:1===E?(r=0,n=_-b):(r=E-2,n=p(d(a(t),0),_-b)),_+r-n>g)throw f(v);for(i=u(y,n),h=0;h<n;h++)(A=b+h)in y&&l(i,h,y[A]);if(i.length=n,r<n){for(h=b;h<_-n;h++)m=h+r,(A=h+n)in y?y[m]=y[A]:delete y[m];for(h=_;h>_-n+r;h--)delete y[h-1]}else if(r>n)for(h=_-n;h>b;h--)m=h+r-1,(A=h+n-1)in y?y[m]=y[A]:delete y[m];for(h=0;h<r;h++)y[h+b]=arguments[h+2];return y.length=_-n+r,i}})},3843:(e,t,r)=>{var n=r(2109),i=r(7854),o=r(1702),a=i.Date,s=o(a.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return s(new a)}})},3710:(e,t,r)=>{var n=r(1702),i=r(1320),o=Date.prototype,a="Invalid Date",s="toString",c=n(o.toString),u=n(o.getTime);String(new Date(NaN))!=a&&i(o,s,(function(){var e=u(this);return e==e?c(this):a}))},4812:(e,t,r)=>{r(2109)({target:"Function",proto:!0},{bind:r(7065)})},8309:(e,t,r)=>{var n=r(9781),i=r(6530).EXISTS,o=r(1702),a=r(3070).f,s=Function.prototype,c=o(s.toString),u=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,l=o(u.exec);n&&!i&&a(s,"name",{configurable:!0,get:function(){try{return l(u,c(this))[1]}catch(e){return""}}})},1532:(e,t,r)=>{"use strict";r(7710)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(5631))},9601:(e,t,r)=>{var n=r(2109),i=r(1574);n({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},3321:(e,t,r)=>{var n=r(2109),i=r(9781);n({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperties:r(6048)})},9070:(e,t,r)=>{var n=r(2109),i=r(9781);n({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperty:r(3070).f})},9720:(e,t,r)=>{var n=r(2109),i=r(4699).entries;n({target:"Object",stat:!0},{entries:function(e){return i(e)}})},3371:(e,t,r)=>{var n=r(2109),i=r(6677),o=r(7293),a=r(111),s=r(2423).onFreeze,c=Object.freeze;n({target:"Object",stat:!0,forced:o((function(){c(1)})),sham:!i},{freeze:function(e){return c&&a(e)?c(s(e)):e}})},5003:(e,t,r)=>{var n=r(2109),i=r(7293),o=r(5656),a=r(1236).f,s=r(9781),c=i((function(){a(1)}));n({target:"Object",stat:!0,forced:!s||c,sham:!s},{getOwnPropertyDescriptor:function(e,t){return a(o(e),t)}})},9337:(e,t,r)=>{var n=r(2109),i=r(9781),o=r(3887),a=r(5656),s=r(1236),c=r(6135);n({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,r,n=a(e),i=s.f,u=o(n),l={},h=0;u.length>h;)void 0!==(r=i(n,t=u[h++]))&&c(l,t,r);return l}})},6210:(e,t,r)=>{var n=r(2109),i=r(7293),o=r(1156).f;n({target:"Object",stat:!0,forced:i((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:o})},7941:(e,t,r)=>{var n=r(2109),i=r(7908),o=r(1956);n({target:"Object",stat:!0,forced:r(7293)((function(){o(1)}))},{keys:function(e){return o(i(e))}})},1539:(e,t,r)=>{var n=r(1694),i=r(1320),o=r(288);n||i(Object.prototype,"toString",o,{unsafe:!0})},2479:(e,t,r)=>{var n=r(2109),i=r(4699).values;n({target:"Object",stat:!0},{values:function(e){return i(e)}})},1058:(e,t,r)=>{var n=r(2109),i=r(3009);n({global:!0,forced:parseInt!=i},{parseInt:i})},7727:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(3366),a=r(7293),s=r(5005),c=r(614),u=r(6707),l=r(9478),h=r(1320);if(n({target:"Promise",proto:!0,real:!0,forced:!!o&&a((function(){o.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=u(this,s("Promise")),r=c(e);return this.then(r?function(r){return l(t,e()).then((function(){return r}))}:e,r?function(r){return l(t,e()).then((function(){throw r}))}:e)}}),!i&&c(o)){var f=s("Promise").prototype.finally;o.prototype.finally!==f&&h(o.prototype,"finally",f,{unsafe:!0})}},8674:(e,t,r)=>{"use strict";var n,i,o,a,s=r(2109),c=r(1913),u=r(7854),l=r(5005),h=r(6916),f=r(3366),d=r(1320),p=r(2248),g=r(7674),v=r(8003),A=r(6340),m=r(9662),y=r(614),_=r(111),b=r(5787),E=r(2788),w=r(408),I=r(7072),C=r(6707),S=r(261).set,T=r(5948),R=r(9478),k=r(842),O=r(8523),N=r(2534),x=r(8572),D=r(9909),L=r(4705),P=r(5112),B=r(7871),M=r(5268),j=r(7392),U=P("species"),F="Promise",Q=D.getterFor(F),q=D.set,G=D.getterFor(F),V=f&&f.prototype,K=f,H=V,z=u.TypeError,W=u.document,Y=u.process,J=O.f,X=J,Z=!!(W&&W.createEvent&&u.dispatchEvent),$=y(u.PromiseRejectionEvent),ee="unhandledrejection",te=!1,re=L(F,(function(){var e=E(K),t=e!==String(K);if(!t&&66===j)return!0;if(c&&!H.finally)return!0;if(j>=51&&/native code/.test(e))return!1;var r=new K((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[U]=n,!(te=r.then((function(){}))instanceof n)||!t&&B&&!$})),ne=re||!I((function(e){K.all(e).catch((function(){}))})),ie=function(e){var t;return!(!_(e)||!y(t=e.then))&&t},oe=function(e,t){var r,n,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(a||(2===t.rejection&&le(t),t.rejection=1),!0===s?r=o:(l&&l.enter(),r=s(o),l&&(l.exit(),i=!0)),r===e.promise?u(z("Promise-chain cycle")):(n=ie(r))?h(n,r,c,u):c(r)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},ae=function(e,t){e.notified||(e.notified=!0,T((function(){for(var r,n=e.reactions;r=n.get();)oe(r,e);e.notified=!1,t&&!e.rejection&&ce(e)})))},se=function(e,t,r){var n,i;Z?((n=W.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),u.dispatchEvent(n)):n={promise:t,reason:r},!$&&(i=u["on"+e])?i(n):e===ee&&k("Unhandled promise rejection",r)},ce=function(e){h(S,u,(function(){var t,r=e.facade,n=e.value;if(ue(e)&&(t=N((function(){M?Y.emit("unhandledRejection",n,r):se(ee,r,n)})),e.rejection=M||ue(e)?2:1,t.error))throw t.value}))},ue=function(e){return 1!==e.rejection&&!e.parent},le=function(e){h(S,u,(function(){var t=e.facade;M?Y.emit("rejectionHandled",t):se("rejectionhandled",t,e.value)}))},he=function(e,t,r){return function(n){e(t,n,r)}},fe=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,ae(e,!0))},de=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw z("Promise can't be resolved itself");var n=ie(t);n?T((function(){var r={done:!1};try{h(n,t,he(de,r,e),he(fe,r,e))}catch(t){fe(r,t,e)}})):(e.value=t,e.state=1,ae(e,!1))}catch(t){fe({done:!1},t,e)}}};if(re&&(H=(K=function(e){b(this,H),m(e),h(n,this);var t=Q(this);try{e(he(de,t),he(fe,t))}catch(e){fe(t,e)}}).prototype,(n=function(e){q(this,{type:F,done:!1,notified:!1,parent:!1,reactions:new x,rejection:!1,state:0,value:void 0})}).prototype=p(H,{then:function(e,t){var r=G(this),n=J(C(this,K));return r.parent=!0,n.ok=!y(e)||e,n.fail=y(t)&&t,n.domain=M?Y.domain:void 0,0==r.state?r.reactions.add(n):T((function(){oe(n,r)})),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new n,t=Q(e);this.promise=e,this.resolve=he(de,t),this.reject=he(fe,t)},O.f=J=function(e){return e===K||e===o?new i(e):X(e)},!c&&y(f)&&V!==Object.prototype)){a=V.then,te||(d(V,"then",(function(e,t){var r=this;return new K((function(e,t){h(a,r,e,t)})).then(e,t)}),{unsafe:!0}),d(V,"catch",H.catch,{unsafe:!0}));try{delete V.constructor}catch(e){}g&&g(V,H)}s({global:!0,wrap:!0,forced:re},{Promise:K}),v(K,F,!1,!0),A(F),o=l(F),s({target:F,stat:!0,forced:re},{reject:function(e){var t=J(this);return h(t.reject,void 0,e),t.promise}}),s({target:F,stat:!0,forced:c||re},{resolve:function(e){return R(c&&this===o?K:this,e)}}),s({target:F,stat:!0,forced:ne},{all:function(e){var t=this,r=J(t),n=r.resolve,i=r.reject,o=N((function(){var r=m(t.resolve),o=[],a=0,s=1;w(e,(function(e){var c=a++,u=!1;s++,h(r,t,e).then((function(e){u||(u=!0,o[c]=e,--s||n(o))}),i)})),--s||n(o)}));return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=J(t),n=r.reject,i=N((function(){var i=m(t.resolve);w(e,(function(e){h(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}})},2419:(e,t,r)=>{var n=r(2109),i=r(5005),o=r(2104),a=r(7065),s=r(9483),c=r(9670),u=r(111),l=r(30),h=r(7293),f=i("Reflect","construct"),d=Object.prototype,p=[].push,g=h((function(){function e(){}return!(f((function(){}),[],e)instanceof e)})),v=!h((function(){f((function(){}))})),A=g||v;n({target:"Reflect",stat:!0,forced:A,sham:A},{construct:function(e,t){s(e),c(t);var r=arguments.length<3?e:s(arguments[2]);if(v&&!g)return f(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 o(p,n,t),new(o(a,e,n))}var i=r.prototype,h=l(u(i)?i:d),A=o(e,h,t);return u(A)?A:h}})},4916:(e,t,r)=>{"use strict";var n=r(2109),i=r(2261);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},189:(e,t,r)=>{"use strict";r(7710)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(5631))},2023:(e,t,r)=>{"use strict";var n=r(2109),i=r(1702),o=r(3929),a=r(4488),s=r(1340),c=r(4964),u=i("".indexOf);n({target:"String",proto:!0,forced:!c("includes")},{includes:function(e){return!!~u(s(a(this)),s(o(e)),arguments.length>1?arguments[1]:void 0)}})},8783:(e,t,r)=>{"use strict";var n=r(8710).charAt,i=r(1340),o=r(9909),a=r(654),s="String Iterator",c=o.set,u=o.getterFor(s);a(String,"String",(function(e){c(this,{type:s,string:i(e),index:0})}),(function(){var e,t=u(this),r=t.string,i=t.index;return i>=r.length?{value:void 0,done:!0}:(e=n(r,i),t.index+=e.length,{value:e,done:!1})}))},3123:(e,t,r)=>{"use strict";var n=r(2104),i=r(6916),o=r(1702),a=r(7007),s=r(7850),c=r(9670),u=r(4488),l=r(6707),h=r(1530),f=r(7466),d=r(1340),p=r(8173),g=r(1589),v=r(7651),A=r(2261),m=r(2999),y=r(7293),_=m.UNSUPPORTED_Y,b=4294967295,E=Math.min,w=[].push,I=o(/./.exec),C=o(w),S=o("".slice),T=!y((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));a("split",(function(e,t,r){var o;return o="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var o=d(u(this)),a=void 0===r?b:r>>>0;if(0===a)return[];if(void 0===e)return[o];if(!s(e))return i(t,o,e,a);for(var c,l,h,f=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),v=0,m=new RegExp(e.source,p+"g");(c=i(A,m,o))&&!((l=m.lastIndex)>v&&(C(f,S(o,v,c.index)),c.length>1&&c.index<o.length&&n(w,f,g(c,1)),h=c[0].length,v=l,f.length>=a));)m.lastIndex===c.index&&m.lastIndex++;return v===o.length?!h&&I(m,"")||C(f,""):C(f,S(o,v)),f.length>a?g(f,0,a):f}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:i(t,this,e,r)}:t,[function(t,r){var n=u(this),a=null==t?void 0:p(t,e);return a?i(a,t,n,r):i(o,d(n),t,r)},function(e,n){var i=c(this),a=d(e),s=r(o,i,a,n,o!==t);if(s.done)return s.value;var u=l(i,RegExp),p=i.unicode,g=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(_?"g":"y"),A=new u(_?"^(?:"+i.source+")":i,g),m=void 0===n?b:n>>>0;if(0===m)return[];if(0===a.length)return null===v(A,a)?[a]:[];for(var y=0,w=0,I=[];w<a.length;){A.lastIndex=_?0:w;var T,R=v(A,_?S(a,w):a);if(null===R||(T=E(f(A.lastIndex+(_?w:0)),a.length))===y)w=h(a,w,p);else{if(C(I,S(a,y,w)),I.length===m)return I;for(var k=1;k<=R.length-1;k++)if(C(I,R[k]),I.length===m)return I;w=y=T}}return C(I,S(a,y)),I}]}),!T,_)},86:(e,t,r)=>{"use strict";var n=r(2109),i=r(4230);n({target:"String",proto:!0,forced:r(3429)("sub")},{sub:function(){return i(this,"sub","","")}})},1817:(e,t,r)=>{"use strict";var n=r(2109),i=r(9781),o=r(7854),a=r(1702),s=r(2597),c=r(614),u=r(7976),l=r(1340),h=r(3070).f,f=r(9920),d=o.Symbol,p=d&&d.prototype;if(i&&c(d)&&(!("description"in p)||void 0!==d().description)){var g={},v=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),t=u(p,this)?new d(e):void 0===e?d():d(e);return""===e&&(g[t]=!0),t};f(v,d),v.prototype=p,p.constructor=v;var A="Symbol(test)"==String(d("test")),m=a(p.toString),y=a(p.valueOf),_=/^Symbol\((.*)\)[^)]+$/,b=a("".replace),E=a("".slice);h(p,"description",{configurable:!0,get:function(){var e=y(this),t=m(e);if(s(g,e))return"";var r=A?E(t,7,-1):b(t,_,"$1");return""===r?void 0:r}}),n({global:!0,forced:!0},{Symbol:v})}},2165:(e,t,r)=>{r(7235)("iterator")},2526:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(5005),a=r(2104),s=r(6916),c=r(1702),u=r(1913),l=r(9781),h=r(133),f=r(7293),d=r(2597),p=r(3157),g=r(614),v=r(111),A=r(7976),m=r(2190),y=r(9670),_=r(7908),b=r(5656),E=r(4948),w=r(1340),I=r(9114),C=r(30),S=r(1956),T=r(8006),R=r(1156),k=r(5181),O=r(1236),N=r(3070),x=r(5296),D=r(206),L=r(1320),P=r(2309),B=r(6200),M=r(3501),j=r(9711),U=r(5112),F=r(6061),Q=r(7235),q=r(8003),G=r(9909),V=r(2092).forEach,K=B("hidden"),H="Symbol",z=U("toPrimitive"),W=G.set,Y=G.getterFor(H),J=Object.prototype,X=i.Symbol,Z=X&&X.prototype,$=i.TypeError,ee=i.QObject,te=o("JSON","stringify"),re=O.f,ne=N.f,ie=R.f,oe=x.f,ae=c([].push),se=P("symbols"),ce=P("op-symbols"),ue=P("string-to-symbol-registry"),le=P("symbol-to-string-registry"),he=P("wks"),fe=!ee||!ee.prototype||!ee.prototype.findChild,de=l&&f((function(){return 7!=C(ne({},"a",{get:function(){return ne(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=re(J,t);n&&delete J[t],ne(e,t,r),n&&e!==J&&ne(J,t,n)}:ne,pe=function(e,t){var r=se[e]=C(Z);return W(r,{type:H,tag:e,description:t}),l||(r.description=t),r},ge=function(e,t,r){e===J&&ge(ce,t,r),y(e);var n=E(t);return y(r),d(se,n)?(r.enumerable?(d(e,K)&&e[K][n]&&(e[K][n]=!1),r=C(r,{enumerable:I(0,!1)})):(d(e,K)||ne(e,K,I(1,{})),e[K][n]=!0),de(e,n,r)):ne(e,n,r)},ve=function(e,t){y(e);var r=b(t),n=S(r).concat(_e(r));return V(n,(function(t){l&&!s(Ae,r,t)||ge(e,t,r[t])})),e},Ae=function(e){var t=E(e),r=s(oe,this,t);return!(this===J&&d(se,t)&&!d(ce,t))&&(!(r||!d(this,t)||!d(se,t)||d(this,K)&&this[K][t])||r)},me=function(e,t){var r=b(e),n=E(t);if(r!==J||!d(se,n)||d(ce,n)){var i=re(r,n);return!i||!d(se,n)||d(r,K)&&r[K][n]||(i.enumerable=!0),i}},ye=function(e){var t=ie(b(e)),r=[];return V(t,(function(e){d(se,e)||d(M,e)||ae(r,e)})),r},_e=function(e){var t=e===J,r=ie(t?ce:b(e)),n=[];return V(r,(function(e){!d(se,e)||t&&!d(J,e)||ae(n,se[e])})),n};(h||(X=function(){if(A(Z,this))throw $("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?w(arguments[0]):void 0,t=j(e),r=function(e){this===J&&s(r,ce,e),d(this,K)&&d(this[K],t)&&(this[K][t]=!1),de(this,t,I(1,e))};return l&&fe&&de(J,t,{configurable:!0,set:r}),pe(t,e)},L(Z=X.prototype,"toString",(function(){return Y(this).tag})),L(X,"withoutSetter",(function(e){return pe(j(e),e)})),x.f=Ae,N.f=ge,O.f=me,T.f=R.f=ye,k.f=_e,F.f=function(e){return pe(U(e),e)},l&&(ne(Z,"description",{configurable:!0,get:function(){return Y(this).description}}),u||L(J,"propertyIsEnumerable",Ae,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!h,sham:!h},{Symbol:X}),V(S(he),(function(e){Q(e)})),n({target:H,stat:!0,forced:!h},{for:function(e){var t=w(e);if(d(ue,t))return ue[t];var r=X(t);return ue[t]=r,le[r]=t,r},keyFor:function(e){if(!m(e))throw $(e+" is not a symbol");if(d(le,e))return le[e]},useSetter:function(){fe=!0},useSimple:function(){fe=!1}}),n({target:"Object",stat:!0,forced:!h,sham:!l},{create:function(e,t){return void 0===t?C(e):ve(C(e),t)},defineProperty:ge,defineProperties:ve,getOwnPropertyDescriptor:me}),n({target:"Object",stat:!0,forced:!h},{getOwnPropertyNames:ye,getOwnPropertySymbols:_e}),n({target:"Object",stat:!0,forced:f((function(){k.f(1)}))},{getOwnPropertySymbols:function(e){return k.f(_(e))}}),te)&&n({target:"JSON",stat:!0,forced:!h||f((function(){var e=X();return"[null]"!=te([e])||"{}"!=te({a:e})||"{}"!=te(Object(e))}))},{stringify:function(e,t,r){var n=D(arguments),i=t;if((v(t)||void 0!==e)&&!m(e))return p(t)||(t=function(e,t){if(g(i)&&(t=s(i,this,e,t)),!m(t))return t}),n[1]=t,a(te,null,n)}});if(!Z[z]){var be=Z.valueOf;L(Z,z,(function(e){return s(be,this)}))}q(X,H),M[K]=!0},2990:(e,t,r)=>{"use strict";var n=r(1702),i=r(260),o=n(r(1048)),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("copyWithin",(function(e,t){return o(a(this),e,t,arguments.length>2?arguments[2]:void 0)}))},8927:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).every,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},3105:(e,t,r)=>{"use strict";var n=r(260),i=r(6916),o=r(1285),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("fill",(function(e){var t=arguments.length;return i(o,a(this),e,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}))},5035:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).filter,o=r(3074),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",(function(e){var t=i(a(this),e,arguments.length>1?arguments[1]:void 0);return o(this,t)}))},7174:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).findIndex,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},4345:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).find,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},4197:(e,t,r)=>{r(9843)("Float32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},2846:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).forEach,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",(function(e){i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},4731:(e,t,r)=>{"use strict";var n=r(260),i=r(1318).includes,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},7209:(e,t,r)=>{"use strict";var n=r(260),i=r(1318).indexOf,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},6319:(e,t,r)=>{"use strict";var n=r(7854),i=r(7293),o=r(1702),a=r(260),s=r(6992),c=r(5112)("iterator"),u=n.Uint8Array,l=o(s.values),h=o(s.keys),f=o(s.entries),d=a.aTypedArray,p=a.exportTypedArrayMethod,g=u&&u.prototype,v=!i((function(){g[c].call([1])})),A=!!g&&g.values&&g[c]===g.values&&"values"===g.values.name,m=function(){return l(d(this))};p("entries",(function(){return f(d(this))}),v),p("keys",(function(){return h(d(this))}),v),p("values",m,v||!A,{name:"values"}),p(c,m,v||!A,{name:"values"})},8867:(e,t,r)=>{"use strict";var n=r(260),i=r(1702),o=n.aTypedArray,a=n.exportTypedArrayMethod,s=i([].join);a("join",(function(e){return s(o(this),e)}))},7789:(e,t,r)=>{"use strict";var n=r(260),i=r(2104),o=r(6583),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return i(o,a(this),t>1?[e,arguments[1]]:[e])}))},3739:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).map,o=r(6304),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("map",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(o(e))(t)}))}))},4483:(e,t,r)=>{"use strict";var n=r(260),i=r(3671).right,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return i(o(this),e,t,t>1?arguments[1]:void 0)}))},9368:(e,t,r)=>{"use strict";var n=r(260),i=r(3671).left,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return i(o(this),e,t,t>1?arguments[1]:void 0)}))},2056:(e,t,r)=>{"use strict";var n=r(260),i=n.aTypedArray,o=n.exportTypedArrayMethod,a=Math.floor;o("reverse",(function(){for(var e,t=this,r=i(t).length,n=a(r/2),o=0;o<n;)e=t[o],t[o++]=t[--r],t[r]=e;return t}))},3462:(e,t,r)=>{"use strict";var n=r(7854),i=r(260),o=r(6244),a=r(4590),s=r(7908),c=r(7293),u=n.RangeError,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("set",(function(e){l(this);var t=a(arguments.length>1?arguments[1]:void 0,1),r=this.length,n=s(e),i=o(n),c=0;if(i+t>r)throw u("Wrong length");for(;c<i;)this[t+c]=n[c++]}),c((function(){new Int8Array(1).set({})})))},678:(e,t,r)=>{"use strict";var n=r(260),i=r(6304),o=r(7293),a=r(206),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("slice",(function(e,t){for(var r=a(s(this),e,t),n=i(this),o=0,c=r.length,u=new n(c);c>o;)u[o]=r[o++];return u}),o((function(){new Int8Array(1).slice()})))},7462:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).some,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},3824:(e,t,r)=>{"use strict";var n=r(7854),i=r(1702),o=r(7293),a=r(9662),s=r(4362),c=r(260),u=r(8886),l=r(256),h=r(7392),f=r(8008),d=n.Array,p=c.aTypedArray,g=c.exportTypedArrayMethod,v=n.Uint16Array,A=v&&i(v.prototype.sort),m=!(!A||o((function(){A(new v(2),null)}))&&o((function(){A(new v(2),{})}))),y=!!A&&!o((function(){if(h)return h<74;if(u)return u<67;if(l)return!0;if(f)return f<602;var e,t,r=new v(516),n=d(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(A(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));g("sort",(function(e){return void 0!==e&&a(e),y?A(this,e):s(p(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!y||m)},5021:(e,t,r)=>{"use strict";var n=r(260),i=r(7466),o=r(1400),a=r(6304),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("subarray",(function(e,t){var r=s(this),n=r.length,c=o(e,n);return new(a(r))(r.buffer,r.byteOffset+c*r.BYTES_PER_ELEMENT,i((void 0===t?n:o(t,n))-c))}))},2974:(e,t,r)=>{"use strict";var n=r(7854),i=r(2104),o=r(260),a=r(7293),s=r(206),c=n.Int8Array,u=o.aTypedArray,l=o.exportTypedArrayMethod,h=[].toLocaleString,f=!!c&&a((function(){h.call(new c(1))}));l("toLocaleString",(function(){return i(h,f?s(u(this)):u(this),s(arguments))}),a((function(){return[1,2].toLocaleString()!=new c([1,2]).toLocaleString()}))||!a((function(){c.prototype.toLocaleString.call([1,2])})))},5016:(e,t,r)=>{"use strict";var n=r(260).exportTypedArrayMethod,i=r(7293),o=r(7854),a=r(1702),s=o.Uint8Array,c=s&&s.prototype||{},u=[].toString,l=a([].join);i((function(){u.call({})}))&&(u=function(){return l(this)});var h=c.toString!=u;n("toString",u,h)},4129:(e,t,r)=>{"use strict";var n,i=r(7854),o=r(1702),a=r(2248),s=r(2423),c=r(7710),u=r(9320),l=r(111),h=r(2050),f=r(9909).enforce,d=r(8536),p=!i.ActiveXObject&&"ActiveXObject"in i,g=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},v=c("WeakMap",g,u);if(d&&p){n=u.getConstructor(g,"WeakMap",!0),s.enable();var A=v.prototype,m=o(A.delete),y=o(A.has),_=o(A.get),b=o(A.set);a(A,{delete:function(e){if(l(e)&&!h(e)){var t=f(this);return t.frozen||(t.frozen=new n),m(this,e)||t.frozen.delete(e)}return m(this,e)},has:function(e){if(l(e)&&!h(e)){var t=f(this);return t.frozen||(t.frozen=new n),y(this,e)||t.frozen.has(e)}return y(this,e)},get:function(e){if(l(e)&&!h(e)){var t=f(this);return t.frozen||(t.frozen=new n),y(this,e)?_(this,e):t.frozen.get(e)}return _(this,e)},set:function(e,t){if(l(e)&&!h(e)){var r=f(this);r.frozen||(r.frozen=new n),y(this,e)?b(this,e,t):r.frozen.set(e,t)}else b(this,e,t);return this}})}},8478:(e,t,r)=>{"use strict";r(7710)("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(9320))},72:(e,t,r)=>{"use strict";r(2109)({target:"Map",proto:!0,real:!0,forced:r(1913)},{deleteAll:r(4092)})},9137:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(4647),c=r(408);n({target:"Map",proto:!0,real:!0,forced:i},{every:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return!c(r,(function(e,r,i){if(!n(r,e,t))return i()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},1957:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(9974),s=r(6916),c=r(9662),u=r(9670),l=r(6707),h=r(4647),f=r(408);i({target:"Map",proto:!0,real:!0,forced:n},{filter:function(e){var t=u(this),r=h(t),n=a(e,arguments.length>1?arguments[1]:void 0),i=new(l(t,o("Map"))),d=c(i.set);return f(r,(function(e,r){n(r,e,t)&&s(d,i,e,r)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}})},103:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(4647),c=r(408);n({target:"Map",proto:!0,real:!0,forced:i},{findKey:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return c(r,(function(e,r,i){if(n(r,e,t))return i(e)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},6306:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(4647),c=r(408);n({target:"Map",proto:!0,real:!0,forced:i},{find:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return c(r,(function(e,r,i){if(n(r,e,t))return i(r)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},4592:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(9670),a=r(4647),s=r(6465),c=r(408);i({target:"Map",proto:!0,real:!0,forced:n},{includes:function(e){return c(a(o(this)),(function(t,r,n){if(s(r,e))return n()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},8276:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(4647),s=r(408);n({target:"Map",proto:!0,real:!0,forced:i},{keyOf:function(e){return s(a(o(this)),(function(t,r,n){if(r===e)return n(t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},5082:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(9974),s=r(6916),c=r(9662),u=r(9670),l=r(6707),h=r(4647),f=r(408);i({target:"Map",proto:!0,real:!0,forced:n},{mapKeys:function(e){var t=u(this),r=h(t),n=a(e,arguments.length>1?arguments[1]:void 0),i=new(l(t,o("Map"))),d=c(i.set);return f(r,(function(e,r){s(d,i,n(r,e,t),r)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}})},2813:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(9974),s=r(6916),c=r(9662),u=r(9670),l=r(6707),h=r(4647),f=r(408);i({target:"Map",proto:!0,real:!0,forced:n},{mapValues:function(e){var t=u(this),r=h(t),n=a(e,arguments.length>1?arguments[1]:void 0),i=new(l(t,o("Map"))),d=c(i.set);return f(r,(function(e,r){s(d,i,e,n(r,e,t))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}})},8222:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9662),a=r(9670),s=r(408);n({target:"Map",proto:!0,real:!0,forced:i},{merge:function(e){for(var t=a(this),r=o(t.set),n=arguments.length,i=0;i<n;)s(arguments[i++],r,{that:t,AS_ENTRIES:!0});return t}})},8563:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(1913),a=r(9670),s=r(9662),c=r(4647),u=r(408),l=i.TypeError;n({target:"Map",proto:!0,real:!0,forced:o},{reduce:function(e){var t=a(this),r=c(t),n=arguments.length<2,i=n?void 0:arguments[1];if(s(e),u(r,(function(r,o){n?(n=!1,i=o):i=e(i,o,r,t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),n)throw l("Reduce of empty map with no initial value");return i}})},336:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(4647),c=r(408);n({target:"Map",proto:!0,real:!0,forced:i},{some:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return c(r,(function(e,r,i){if(n(r,e,t))return i()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},7512:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(7854),a=r(6916),s=r(9670),c=r(9662),u=o.TypeError;i({target:"Map",proto:!0,real:!0,forced:n},{update:function(e,t){var r=s(this),n=c(r.get),i=c(r.has),o=c(r.set),l=arguments.length;c(t);var h=a(i,r,e);if(!h&&l<3)throw u("Updating absent value");var f=h?a(n,r,e):c(l>2?arguments[2]:void 0)(e,r);return a(o,r,e,t(f,e,r)),r}})},8921:(e,t,r)=>{"use strict";r(2109)({target:"Set",proto:!0,real:!0,forced:r(1913)},{addAll:r(1501)})},6248:(e,t,r)=>{"use strict";r(2109)({target:"Set",proto:!0,real:!0,forced:r(1913)},{deleteAll:r(4092)})},3599:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(6916),s=r(9662),c=r(9670),u=r(6707),l=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{difference:function(e){var t=c(this),r=new(u(t,o("Set")))(t),n=s(r.delete);return l(e,(function(e){a(n,r,e)})),r}})},1477:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(6767),c=r(408);n({target:"Set",proto:!0,real:!0,forced:i},{every:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return!c(r,(function(e,r){if(!n(e,e,t))return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},3066:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(6916),s=r(9662),c=r(9670),u=r(9974),l=r(6707),h=r(6767),f=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{filter:function(e){var t=c(this),r=h(t),n=u(e,arguments.length>1?arguments[1]:void 0),i=new(l(t,o("Set"))),d=s(i.add);return f(r,(function(e){n(e,e,t)&&a(d,i,e)}),{IS_ITERATOR:!0}),i}})},5389:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(6767),c=r(408);n({target:"Set",proto:!0,real:!0,forced:i},{find:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return c(r,(function(e,r){if(n(e,e,t))return r(e)}),{IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},401:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(6916),s=r(9662),c=r(9670),u=r(6707),l=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{intersection:function(e){var t=c(this),r=new(u(t,o("Set"))),n=s(t.has),i=s(r.add);return l(e,(function(e){a(n,t,e)&&a(i,r,e)})),r}})},5164:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(6916),a=r(9662),s=r(9670),c=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{isDisjointFrom:function(e){var t=s(this),r=a(t.has);return!c(e,(function(e,n){if(!0===o(r,t,e))return n()}),{INTERRUPTED:!0}).stopped}})},1238:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(6916),s=r(9662),c=r(614),u=r(9670),l=r(8554),h=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{isSubsetOf:function(e){var t=l(this),r=u(e),n=r.has;return c(n)||(r=new(o("Set"))(e),n=s(r.has)),!h(t,(function(e,t){if(!1===a(n,r,e))return t()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},4837:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(6916),a=r(9662),s=r(9670),c=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{isSupersetOf:function(e){var t=s(this),r=a(t.has);return!c(e,(function(e,n){if(!1===o(r,t,e))return n()}),{INTERRUPTED:!0}).stopped}})},7485:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(1702),a=r(9670),s=r(1340),c=r(6767),u=r(408),l=o([].join),h=[].push;i({target:"Set",proto:!0,real:!0,forced:n},{join:function(e){var t=a(this),r=c(t),n=void 0===e?",":s(e),i=[];return u(r,h,{that:i,IS_ITERATOR:!0}),l(i,n)}})},465:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(9974),s=r(6916),c=r(9662),u=r(9670),l=r(6707),h=r(6767),f=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{map:function(e){var t=u(this),r=h(t),n=a(e,arguments.length>1?arguments[1]:void 0),i=new(l(t,o("Set"))),d=c(i.add);return f(r,(function(e){s(d,i,n(e,e,t))}),{IS_ITERATOR:!0}),i}})},6651:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(1913),a=r(9662),s=r(9670),c=r(6767),u=r(408),l=i.TypeError;n({target:"Set",proto:!0,real:!0,forced:o},{reduce:function(e){var t=s(this),r=c(t),n=arguments.length<2,i=n?void 0:arguments[1];if(a(e),u(r,(function(r){n?(n=!1,i=r):i=e(i,r,r,t)}),{IS_ITERATOR:!0}),n)throw l("Reduce of empty set with no initial value");return i}})},1437:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(6767),c=r(408);n({target:"Set",proto:!0,real:!0,forced:i},{some:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return c(r,(function(e,r){if(n(e,e,t))return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},5285:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(6916),s=r(9662),c=r(9670),u=r(6707),l=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{symmetricDifference:function(e){var t=c(this),r=new(u(t,o("Set")))(t),n=s(r.delete),i=s(r.add);return l(e,(function(e){a(n,r,e)||a(i,r,e)})),r}})},9865:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(5005),a=r(9662),s=r(9670),c=r(6707),u=r(408);n({target:"Set",proto:!0,real:!0,forced:i},{union:function(e){var t=s(this),r=new(c(t,o("Set")))(t);return u(e,a(r.add),{that:r}),r}})},8206:(e,t,r)=>{"use strict";r(2109)({target:"WeakMap",proto:!0,real:!0,forced:r(1913)},{deleteAll:r(4092)})},3561:(e,t,r)=>{"use strict";r(2109)({target:"WeakSet",proto:!0,real:!0,forced:r(1913)},{addAll:r(1501)})},2049:(e,t,r)=>{"use strict";r(2109)({target:"WeakSet",proto:!0,real:!0,forced:r(1913)},{deleteAll:r(4092)})},4747:(e,t,r)=>{var n=r(7854),i=r(8324),o=r(8509),a=r(8533),s=r(8880),c=function(e){if(e&&e.forEach!==a)try{s(e,"forEach",a)}catch(t){e.forEach=a}};for(var u in i)i[u]&&c(n[u]&&n[u].prototype);c(o)},3948:(e,t,r)=>{var n=r(7854),i=r(8324),o=r(8509),a=r(6992),s=r(8880),c=r(5112),u=c("iterator"),l=c("toStringTag"),h=a.values,f=function(e,t){if(e){if(e[u]!==h)try{s(e,u,h)}catch(t){e[u]=h}if(e[l]||s(e,l,t),i[t])for(var r in a)if(e[r]!==a[r])try{s(e,r,a[r])}catch(t){e[r]=a[r]}}};for(var d in i)f(n[d]&&n[d].prototype,d);f(o,"DOMTokenList")},2564:(e,t,r)=>{var n=r(2109),i=r(7854),o=r(2104),a=r(614),s=r(8113),c=r(206),u=/MSIE .\./.test(s),l=i.Function,h=function(e){return function(t,r){var n=arguments.length>2,i=n?c(arguments,2):void 0;return e(n?function(){o(a(t)?t:l(t),this,i)}:t,r)}};n({global:!0,bind:!0,forced:u},{setTimeout:h(i.setTimeout),setInterval:h(i.setInterval)})},5455:e=>{"use strict";e.exports=require("agora-electron-sdk")},5760:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__5760__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.amdO={},__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),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})();var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AGError:()=>Pn,AGErrorWrapper:()=>Bn,AGEventEmitter:()=>y,AGMediaEncryptionMode:()=>_u,AGNetworkQuality:()=>vu,AGRenderMode:()=>Eu,AGRtcConnectionType:()=>uu,AGRteErrorCode:()=>kn,AGRteTrackErrorReason:()=>Au,AGScreenShareType:()=>bu,AbstractErrorCenter:()=>Ln,ActionWhenTaskFail:()=>Zu,AgoraChatMessage:()=>Cc,AgoraMediaControl:()=>$u,AgoraMediaControlEventType:()=>Yu,AgoraRCEventType:()=>Lh,AgoraRCRole:()=>Dh,AgoraRegion:()=>Dn,AgoraRoom:()=>Ic,AgoraRtcLocalVideoCanvas:()=>Ql,AgoraRtcVideoCanvas:()=>Fl,AgoraRteAudioSourceType:()=>tu,AgoraRteCameraVideoTrack:()=>hu,AgoraRteConnectionState:()=>Fu,AgoraRteEngine:()=>Gh,AgoraRteEngineConfig:()=>Fn,AgoraRteEventType:()=>_c,AgoraRteLogLevel:()=>On,AgoraRteMediaPublishState:()=>ru,AgoraRteMediaSourceState:()=>mu,AgoraRteMediaTrack:()=>lu,AgoraRteMicrophoneAudioTrack:()=>fu,AgoraRteRemoteStreamType:()=>Iu,AgoraRteRuntimePlatform:()=>Nn,AgoraRteScene:()=>Ju,AgoraRteScreenShareTrack:()=>du,AgoraRteThread:()=>_l,AgoraRteVideoSourceType:()=>eu,AgoraStream:()=>wc,AgoraUser:()=>Ec,ApiBase:()=>Vc,Duration:()=>nl,LighteningLevel:()=>wu,Lodash:()=>gu,Log:()=>Xn,Logger:()=>yn,RtcState:()=>yu,RteLanguage:()=>xn,Scheduler:()=>e,bound:()=>au,retryAttempt:()=>Du});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{Duration:()=>nl,createScheduler:()=>ol,shared:()=>al});__webpack_require__(2419);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function r(e,r){if(e){if("string"==typeof e)return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void 0}}function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}(e,t)||r(e,t)||function(){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 i(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function s(e){i(a,n,o,s,c,"next",e)}function c(e){i(a,n,o,s,c,"throw",e)}s(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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,n.key,n)}}function c(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function l(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&&u(e,t)}function h(e){return h="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},h(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}var g=__webpack_require__(7162),v=__webpack_require__.n(g);__webpack_require__(2222),__webpack_require__(7042),__webpack_require__(8309),__webpack_require__(1038),__webpack_require__(2526),__webpack_require__(1817),__webpack_require__(2165),__webpack_require__(9753),__webpack_require__(6992),__webpack_require__(1532),__webpack_require__(1539),__webpack_require__(8783),__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__(3948),__webpack_require__(7327);function A(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var y=function(){function e(){a(this,e),this._eventMap=new Map}return c(e,[{key:"once",value:function(e,t){var r=this;return this.on(e,(function n(){r.off(e,n),t.apply(void 0,arguments)})),this}},{key:"on",value:function(e,t){var r,n=null!==(r=this._eventMap.get(e))&&void 0!==r?r:[];return n.push(t),this._eventMap.set(e,n),this}},{key:"off",value:function(e,t){var r=this._eventMap.get(e);return r&&this._eventMap.set(e,r.filter((function(e){return e!==t}))),this}},{key:"removeAllEventListeners",value:function(){this._eventMap.clear()}},{key:"emit",value:function(e){for(var t,r=null!==(t=this._eventMap.get(e))&&void 0!==t?t:[],n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];var a,s=A(r);try{for(s.s();!(a=s.n()).done;){var c=a.value;try{c&&c.apply(void 0,i)}catch(t){var u=t,l=u.stack||u.message;console.error("[event] handling event ".concat(e," fail: ").concat(l))}}}catch(e){s.e(e)}finally{s.f()}return this}}]),e}();__webpack_require__(7941),__webpack_require__(5003),__webpack_require__(9554),__webpack_require__(4747),__webpack_require__(9337),__webpack_require__(3321),__webpack_require__(9070);function _(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}__webpack_require__(2772);function b(){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}}function E(e,t,r){return E=b()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&u(i,r.prototype),i},E.apply(null,arguments)}function w(e){var t="function"==typeof Map?new Map:void 0;return w=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return E(e,arguments,p(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)},w(e)}__webpack_require__(6699),__webpack_require__(2023),__webpack_require__(3843),__webpack_require__(3710),__webpack_require__(8674),__webpack_require__(9600);var I=__webpack_require__(5760),C=__webpack_require__.n(I),S=__webpack_require__(6635),T=__webpack_require__(1005),R=__webpack_require__.n(T);function k(){return R()('(()=>{var t={7162:(t,e,n)=>{t.exports=n(5047)},857:(t,e,n)=>{var r=n(7772).Symbol;t.exports=r},3366:(t,e,n)=>{var r=n(857),o=n(2107),i=n(7157),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},1704:(t,e,n)=>{var r=n(2153),o=/^\\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(o,""):t}},1242:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},2107:(t,e,n)=>{var r=n(857),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[u]=n:delete t[u]),o}},7157:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},7772:(t,e,n)=>{var r=n(1242),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},2153:t=>{var e=/\\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},4073:(t,e,n)=>{var r=n(9259),o=n(1100),i=n(7642),a=Math.max,u=Math.min;t.exports=function(t,e,n){var c,s,f,l,h,p,d=0,v=!1,y=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var n=c,r=s;return c=s=void 0,d=e,l=t.apply(r,n)}function b(t){return d=t,h=setTimeout(_,e),v?g(t):l}function w(t){var n=t-p;return void 0===p||n>=e||n<0||y&&t-d>=f}function _(){var t=o();if(w(t))return x(t);h=setTimeout(_,function(t){var n=e-(t-p);return y?u(n,f-(t-d)):n}(t))}function x(t){return h=void 0,m&&c?g(t):(c=s=void 0,l)}function k(){var t=o(),n=w(t);if(c=arguments,s=this,p=t,n){if(void 0===h)return b(p);if(y)return clearTimeout(h),h=setTimeout(_,e),g(p)}return void 0===h&&(h=setTimeout(_,e)),l}return e=i(e)||0,r(n)&&(v=!!n.leading,f=(y="maxWait"in n)?a(i(n.maxWait)||0,e):f,m="trailing"in n?!!n.trailing:m),k.cancel=function(){void 0!==h&&clearTimeout(h),d=0,c=p=s=h=void 0},k.flush=function(){return void 0===h?l:x(o())},k}},9259:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},5125:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},4795:(t,e,n)=>{var r=n(3366),o=n(5125);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},1100:(t,e,n)=>{var r=n(7772);t.exports=function(){return r.Date.now()}},7642:(t,e,n)=>{var r=n(1704),o=n(9259),i=n(4795),a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=u.test(t);return n||c.test(t)?s(t.slice(2),n?2:8):a.test(t)?NaN:+t}},5047:t=>{var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new S(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===d){if("throw"===o)throw i;return A()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=j(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=f(t,e,n);if("normal"===c.type){if(r=n.done?d:h,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=d,n.method="throw",n.arg=c.arg)}}}(t,n,a),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l="suspendedStart",h="suspendedYield",p="executing",d="completed",v={};function y(){}function m(){}function g(){}var b={};c(b,i,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==n&&r.call(_,i)&&(b=_);var x=g.prototype=y.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function j(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,j(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a \'throw\' method")}return v}var o=f(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function T(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:A}}function A(){return{value:e,done:!0}}return m.prototype=g,c(x,"constructor",g),c(g,"constructor",m),m.displayName=c(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},k(O.prototype),c(O.prototype,a,(function(){return this})),t.AsyncIterator=O,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new O(s(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(x),c(x,u,"Generator"),c(x,i,(function(){return this})),c(x,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=T,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return u.type="throw",u.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){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"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:T(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},9662:(t,e,n)=>{var r=n(7854),o=n(614),i=n(6330),a=r.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not a function")}},9483:(t,e,n)=>{var r=n(7854),o=n(4411),i=n(6330),a=r.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not a constructor")}},6077:(t,e,n)=>{var r=n(7854),o=n(614),i=r.String,a=r.TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw a("Can\'t set "+i(t)+" as a prototype")}},5787:(t,e,n)=>{var r=n(7854),o=n(7976),i=r.TypeError;t.exports=function(t,e){if(o(e,t))return t;throw i("Incorrect invocation")}},9670:(t,e,n)=>{var r=n(7854),o=n(111),i=r.String,a=r.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not an object")}},1318:(t,e,n)=>{var r=n(5656),o=n(1400),i=n(6244),a=function(t){return function(e,n,a){var u,c=r(e),s=i(c),f=o(a,s);if(t&&n!=n){for(;s>f;)if((u=c[f++])!=u)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},1194:(t,e,n)=>{var r=n(7293),o=n(5112),i=n(7392),a=o("species");t.exports=function(t){return i>=51||!r((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},206:(t,e,n)=>{var r=n(1702);t.exports=r([].slice)},7475:(t,e,n)=>{var r=n(7854),o=n(3157),i=n(4411),a=n(111),u=n(5112)("species"),c=r.Array;t.exports=function(t){var e;return o(t)&&(e=t.constructor,(i(e)&&(e===c||o(e.prototype))||a(e)&&null===(e=e[u]))&&(e=void 0)),void 0===e?c:e}},5417:(t,e,n)=>{var r=n(7475);t.exports=function(t,e){return new(r(t))(0===e?0:e)}},7072:(t,e,n)=>{var r=n(5112)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}},4326:(t,e,n)=>{var r=n(1702),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},648:(t,e,n)=>{var r=n(7854),o=n(1694),i=n(614),a=n(4326),u=n(5112)("toStringTag"),c=r.Object,s="Arguments"==a(function(){return arguments}());t.exports=o?a:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=c(t),u))?n:s?a(e):"Object"==(r=a(e))&&i(e.callee)?"Arguments":r}},9920:(t,e,n)=>{var r=n(2597),o=n(3887),i=n(1236),a=n(3070);t.exports=function(t,e,n){for(var u=o(e),c=a.f,s=i.f,f=0;f<u.length;f++){var l=u[f];r(t,l)||n&&r(n,l)||c(t,l,s(e,l))}}},8880:(t,e,n)=>{var r=n(9781),o=n(3070),i=n(9114);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},9114:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6135:(t,e,n)=>{"use strict";var r=n(4948),o=n(3070),i=n(9114);t.exports=function(t,e,n){var a=r(e);a in t?o.f(t,a,i(0,n)):t[a]=n}},9781:(t,e,n)=>{var r=n(7293);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(t,e,n)=>{var r=n(7854),o=n(111),i=r.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},7871:t=>{t.exports="object"==typeof window},1528:(t,e,n)=>{var r=n(8113),o=n(7854);t.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==o.Pebble},6833:(t,e,n)=>{var r=n(8113);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},5268:(t,e,n)=>{var r=n(4326),o=n(7854);t.exports="process"==r(o.process)},1036:(t,e,n)=>{var r=n(8113);t.exports=/web0s(?!.*chrome)/i.test(r)},8113:(t,e,n)=>{var r=n(5005);t.exports=r("navigator","userAgent")||""},7392:(t,e,n)=>{var r,o,i=n(7854),a=n(8113),u=i.process,c=i.Deno,s=u&&u.versions||c&&c.version,f=s&&s.v8;f&&(o=(r=f.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\\/(\\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\\/(\\d+)/))&&(o=+r[1]),t.exports=o},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(t,e,n)=>{var r=n(7854),o=n(1236).f,i=n(8880),a=n(1320),u=n(3505),c=n(9920),s=n(4705);t.exports=function(t,e){var n,f,l,h,p,d=t.target,v=t.global,y=t.stat;if(n=v?r:y?r[d]||u(d,{}):(r[d]||{}).prototype)for(f in e){if(h=e[f],l=t.noTargetGet?(p=o(n,f))&&p.value:n[f],!s(v?f:d+(y?".":"#")+f,t.forced)&&void 0!==l){if(typeof h==typeof l)continue;c(h,l)}(t.sham||l&&l.sham)&&i(h,"sham",!0),a(n,f,h,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},2104:t=>{var e=Function.prototype,n=e.apply,r=e.bind,o=e.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?o.bind(n):function(){return o.apply(n,arguments)})},9974:(t,e,n)=>{var r=n(1702),o=n(9662),i=r(r.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?i(t,e):function(){return t.apply(e,arguments)}}},7065:(t,e,n)=>{"use strict";var r=n(7854),o=n(1702),i=n(9662),a=n(111),u=n(2597),c=n(206),s=r.Function,f=o([].concat),l=o([].join),h={},p=function(t,e,n){if(!u(h,e)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";h[e]=s("C,a","return new C("+l(r,",")+")")}return h[e](t,n)};t.exports=s.bind||function(t){var e=i(this),n=e.prototype,r=c(arguments,1),o=function(){var n=f(r,c(arguments));return this instanceof o?p(e,n.length,n):e.apply(t,n)};return a(n)&&(o.prototype=n),o}},6916:t=>{var e=Function.prototype.call;t.exports=e.bind?e.bind(e):function(){return e.apply(e,arguments)}},6530:(t,e,n)=>{var r=n(9781),o=n(2597),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,u=o(i,"name"),c=u&&"something"===function(){}.name,s=u&&(!r||r&&a(i,"name").configurable);t.exports={EXISTS:u,PROPER:c,CONFIGURABLE:s}},1702:t=>{var e=Function.prototype,n=e.bind,r=e.call,o=n&&n.bind(r);t.exports=n?function(t){return t&&o(r,t)}:function(t){return t&&function(){return r.apply(t,arguments)}}},5005:(t,e,n)=>{var r=n(7854),o=n(614),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},1246:(t,e,n)=>{var r=n(648),o=n(8173),i=n(7497),a=n(5112)("iterator");t.exports=function(t){if(null!=t)return o(t,a)||o(t,"@@iterator")||i[r(t)]}},8554:(t,e,n)=>{var r=n(7854),o=n(6916),i=n(9662),a=n(9670),u=n(6330),c=n(1246),s=r.TypeError;t.exports=function(t,e){var n=arguments.length<2?c(t):e;if(i(n))return a(o(n,t));throw s(u(t)+" is not iterable")}},8173:(t,e,n)=>{var r=n(9662);t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},7854:(t,e,n)=>{var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},2597:(t,e,n)=>{var r=n(1702),o=n(7908),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},3501:t=>{t.exports={}},842:(t,e,n)=>{var r=n(7854);t.exports=function(t,e){var n=r.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))}},490:(t,e,n)=>{var r=n(5005);t.exports=r("document","documentElement")},4664:(t,e,n)=>{var r=n(9781),o=n(7293),i=n(317);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(t,e,n)=>{var r=n(7854),o=n(1702),i=n(7293),a=n(4326),u=r.Object,c=o("".split);t.exports=i((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?c(t,""):u(t)}:u},2788:(t,e,n)=>{var r=n(1702),o=n(614),i=n(5465),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},9909:(t,e,n)=>{var r,o,i,a=n(8536),u=n(7854),c=n(1702),s=n(111),f=n(8880),l=n(2597),h=n(5465),p=n(6200),d=n(3501),v="Object already initialized",y=u.TypeError,m=u.WeakMap;if(a||h.state){var g=h.state||(h.state=new m),b=c(g.get),w=c(g.has),_=c(g.set);r=function(t,e){if(w(g,t))throw new y(v);return e.facade=t,_(g,t,e),e},o=function(t){return b(g,t)||{}},i=function(t){return w(g,t)}}else{var x=p("state");d[x]=!0,r=function(t,e){if(l(t,x))throw new y(v);return e.facade=t,f(t,x,e),e},o=function(t){return l(t,x)?t[x]:{}},i=function(t){return l(t,x)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!s(e)||(n=o(e)).type!==t)throw y("Incompatible receiver, "+t+" required");return n}}}},7659:(t,e,n)=>{var r=n(5112),o=n(7497),i=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},3157:(t,e,n)=>{var r=n(4326);t.exports=Array.isArray||function(t){return"Array"==r(t)}},614:t=>{t.exports=function(t){return"function"==typeof t}},4411:(t,e,n)=>{var r=n(1702),o=n(7293),i=n(614),a=n(648),u=n(5005),c=n(2788),s=function(){},f=[],l=u("Reflect","construct"),h=/^\\s*(?:class|function)\\b/,p=r(h.exec),d=!h.exec(s),v=function(t){if(!i(t))return!1;try{return l(s,f,t),!0}catch(t){return!1}},y=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!p(h,c(t))}catch(t){return!0}};y.sham=!0,t.exports=!l||o((function(){var t;return v(v.call)||!v(Object)||!v((function(){t=!0}))||t}))?y:v},4705:(t,e,n)=>{var r=n(7293),o=n(614),i=/#|\\.prototype\\./,a=function(t,e){var n=c[u(t)];return n==f||n!=s&&(o(e)?r(e):!!e)},u=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=a.data={},s=a.NATIVE="N",f=a.POLYFILL="P";t.exports=a},111:(t,e,n)=>{var r=n(614);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},1913:t=>{t.exports=!1},2190:(t,e,n)=>{var r=n(7854),o=n(5005),i=n(614),a=n(7976),u=n(3307),c=r.Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return i(e)&&a(e.prototype,c(t))}},408:(t,e,n)=>{var r=n(7854),o=n(9974),i=n(6916),a=n(9670),u=n(6330),c=n(7659),s=n(6244),f=n(7976),l=n(8554),h=n(1246),p=n(9212),d=r.TypeError,v=function(t,e){this.stopped=t,this.result=e},y=v.prototype;t.exports=function(t,e,n){var r,m,g,b,w,_,x,k=n&&n.that,O=!(!n||!n.AS_ENTRIES),j=!(!n||!n.IS_ITERATOR),E=!(!n||!n.INTERRUPTED),P=o(e,k),S=function(t){return r&&p(r,"normal",t),new v(!0,t)},T=function(t){return O?(a(t),E?P(t[0],t[1],S):P(t[0],t[1])):E?P(t,S):P(t)};if(j)r=t;else{if(!(m=h(t)))throw d(u(t)+" is not iterable");if(c(m)){for(g=0,b=s(t);b>g;g++)if((w=T(t[g]))&&f(y,w))return w;return new v(!1)}r=l(t,m)}for(_=r.next;!(x=i(_,r)).done;){try{w=T(x.value)}catch(t){p(r,"throw",t)}if("object"==typeof w&&w&&f(y,w))return w}return new v(!1)}},9212:(t,e,n)=>{var r=n(6916),o=n(9670),i=n(8173);t.exports=function(t,e,n){var a,u;o(t);try{if(!(a=i(t,"return"))){if("throw"===e)throw n;return n}a=r(a,t)}catch(t){u=!0,a=t}if("throw"===e)throw n;if(u)throw a;return o(a),n}},7497:t=>{t.exports={}},6244:(t,e,n)=>{var r=n(7466);t.exports=function(t){return r(t.length)}},5948:(t,e,n)=>{var r,o,i,a,u,c,s,f,l=n(7854),h=n(9974),p=n(1236).f,d=n(261).set,v=n(6833),y=n(1528),m=n(1036),g=n(5268),b=l.MutationObserver||l.WebKitMutationObserver,w=l.document,_=l.process,x=l.Promise,k=p(l,"queueMicrotask"),O=k&&k.value;O||(r=function(){var t,e;for(g&&(t=_.domain)&&t.exit();o;){e=o.fn,o=o.next;try{e()}catch(t){throw o?a():i=void 0,t}}i=void 0,t&&t.enter()},v||g||m||!b||!w?!y&&x&&x.resolve?((s=x.resolve(void 0)).constructor=x,f=h(s.then,s),a=function(){f(r)}):g?a=function(){_.nextTick(r)}:(d=h(d,l),a=function(){d(r)}):(u=!0,c=w.createTextNode(""),new b(r).observe(c,{characterData:!0}),a=function(){c.data=u=!u})),t.exports=O||function(t){var e={fn:t,next:void 0};i&&(i.next=e),o||(o=e,a()),i=e}},1070:(t,e,n)=>{var r=n(7854);t.exports=r.Promise},133:(t,e,n)=>{var r=n(7392),o=n(7293);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8536:(t,e,n)=>{var r=n(7854),o=n(614),i=n(2788),a=r.WeakMap;t.exports=o(a)&&/native code/.test(i(a))},8523:(t,e,n)=>{"use strict";var r=n(9662),o=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},30:(t,e,n)=>{var r,o=n(9670),i=n(6048),a=n(748),u=n(3501),c=n(490),s=n(317),f=n(6200),l=f("IE_PROTO"),h=function(){},p=function(t){return"<script>"+t+"</"+"script>"},d=function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;v="undefined"!=typeof document?document.domain&&r?d(r):((e=s("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F):d(r);for(var n=a.length;n--;)delete v.prototype[a[n]];return v()};u[l]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h.prototype=o(t),n=new h,h.prototype=null,n[l]=t):n=v(),void 0===e?n:i(n,e)}},6048:(t,e,n)=>{var r=n(9781),o=n(3070),i=n(9670),a=n(5656),u=n(1956);t.exports=r?Object.defineProperties:function(t,e){i(t);for(var n,r=a(e),c=u(e),s=c.length,f=0;s>f;)o.f(t,n=c[f++],r[n]);return t}},3070:(t,e,n)=>{var r=n(7854),o=n(9781),i=n(4664),a=n(9670),u=n(4948),c=r.TypeError,s=Object.defineProperty;e.f=o?s:function(t,e,n){if(a(t),e=u(e),a(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},1236:(t,e,n)=>{var r=n(9781),o=n(6916),i=n(5296),a=n(9114),u=n(5656),c=n(4948),s=n(2597),f=n(4664),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=u(t),e=c(e),f)try{return l(t,e)}catch(t){}if(s(t,e))return a(!o(i.f,t,e),t[e])}},8006:(t,e,n)=>{var r=n(6324),o=n(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},5181:(t,e)=>{e.f=Object.getOwnPropertySymbols},7976:(t,e,n)=>{var r=n(1702);t.exports=r({}.isPrototypeOf)},6324:(t,e,n)=>{var r=n(1702),o=n(2597),i=n(5656),a=n(1318).indexOf,u=n(3501),c=r([].push);t.exports=function(t,e){var n,r=i(t),s=0,f=[];for(n in r)!o(u,n)&&o(r,n)&&c(f,n);for(;e.length>s;)o(r,n=e[s++])&&(~a(f,n)||c(f,n));return f}},1956:(t,e,n)=>{var r=n(6324),o=n(748);t.exports=Object.keys||function(t){return r(t,o)}},5296:(t,e)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},7674:(t,e,n)=>{var r=n(1702),o=n(9670),i=n(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return o(n),i(r),e?t(n,r):n.__proto__=r,n}}():void 0)},288:(t,e,n)=>{"use strict";var r=n(1694),o=n(648);t.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},2140:(t,e,n)=>{var r=n(7854),o=n(6916),i=n(614),a=n(111),u=r.TypeError;t.exports=function(t,e){var n,r;if("string"===e&&i(n=t.toString)&&!a(r=o(n,t)))return r;if(i(n=t.valueOf)&&!a(r=o(n,t)))return r;if("string"!==e&&i(n=t.toString)&&!a(r=o(n,t)))return r;throw u("Can\'t convert object to primitive value")}},3887:(t,e,n)=>{var r=n(5005),o=n(1702),i=n(8006),a=n(5181),u=n(9670),c=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(u(t)),n=a.f;return n?c(e,n(t)):e}},2534:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},9478:(t,e,n)=>{var r=n(9670),o=n(111),i=n(8523);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},8572:t=>{var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=e},2248:(t,e,n)=>{var r=n(1320);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},1320:(t,e,n)=>{var r=n(7854),o=n(614),i=n(2597),a=n(8880),u=n(3505),c=n(2788),s=n(9909),f=n(6530).CONFIGURABLE,l=s.get,h=s.enforce,p=String(String).split("String");(t.exports=function(t,e,n,c){var s,l=!!c&&!!c.unsafe,d=!!c&&!!c.enumerable,v=!!c&&!!c.noTargetGet,y=c&&void 0!==c.name?c.name:e;o(n)&&("Symbol("===String(y).slice(0,7)&&(y="["+String(y).replace(/^Symbol\\(([^)]*)\\)/,"$1")+"]"),(!i(n,"name")||f&&n.name!==y)&&a(n,"name",y),(s=h(n)).source||(s.source=p.join("string"==typeof y?y:""))),t!==r?(l?!v&&t[e]&&(d=!0):delete t[e],d?t[e]=n:a(t,e,n)):d?t[e]=n:u(e,n)})(Function.prototype,"toString",(function(){return o(this)&&l(this).source||c(this)}))},4488:(t,e,n)=>{var r=n(7854).TypeError;t.exports=function(t){if(null==t)throw r("Can\'t call method on "+t);return t}},3505:(t,e,n)=>{var r=n(7854),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},6340:(t,e,n)=>{"use strict";var r=n(5005),o=n(3070),i=n(5112),a=n(9781),u=i("species");t.exports=function(t){var e=r(t),n=o.f;a&&e&&!e[u]&&n(e,u,{configurable:!0,get:function(){return this}})}},8003:(t,e,n)=>{var r=n(3070).f,o=n(2597),i=n(5112)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&r(t,i,{configurable:!0,value:e})}},6200:(t,e,n)=>{var r=n(2309),o=n(9711),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:(t,e,n)=>{var r=n(7854),o=n(3505),i="__core-js_shared__",a=r[i]||o(i,{});t.exports=a},2309:(t,e,n)=>{var r=n(1913),o=n(5465);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.20.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},6707:(t,e,n)=>{var r=n(9670),o=n(9483),i=n(5112)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[i])?e:o(n)}},261:(t,e,n)=>{var r,o,i,a,u=n(7854),c=n(2104),s=n(9974),f=n(614),l=n(2597),h=n(7293),p=n(490),d=n(206),v=n(317),y=n(6833),m=n(5268),g=u.setImmediate,b=u.clearImmediate,w=u.process,_=u.Dispatch,x=u.Function,k=u.MessageChannel,O=u.String,j=0,E={},P="onreadystatechange";try{r=u.location}catch(t){}var S=function(t){if(l(E,t)){var e=E[t];delete E[t],e()}},T=function(t){return function(){S(t)}},A=function(t){S(t.data)},C=function(t){u.postMessage(O(t),r.protocol+"//"+r.host)};g&&b||(g=function(t){var e=d(arguments,1);return E[++j]=function(){c(f(t)?t:x(t),void 0,e)},o(j),j},b=function(t){delete E[t]},m?o=function(t){w.nextTick(T(t))}:_&&_.now?o=function(t){_.now(T(t))}:k&&!y?(a=(i=new k).port2,i.port1.onmessage=A,o=s(a.postMessage,a)):u.addEventListener&&f(u.postMessage)&&!u.importScripts&&r&&"file:"!==r.protocol&&!h(C)?(o=C,u.addEventListener("message",A,!1)):o=P in v("script")?function(t){p.appendChild(v("script")).onreadystatechange=function(){p.removeChild(this),S(t)}}:function(t){setTimeout(T(t),0)}),t.exports={set:g,clear:b}},1400:(t,e,n)=>{var r=n(9303),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},5656:(t,e,n)=>{var r=n(8361),o=n(4488);t.exports=function(t){return r(o(t))}},9303:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){var r=+t;return r!=r||0===r?0:(r>0?n:e)(r)}},7466:(t,e,n)=>{var r=n(9303),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},7908:(t,e,n)=>{var r=n(7854),o=n(4488),i=r.Object;t.exports=function(t){return i(o(t))}},7593:(t,e,n)=>{var r=n(7854),o=n(6916),i=n(111),a=n(2190),u=n(8173),c=n(2140),s=n(5112),f=r.TypeError,l=s("toPrimitive");t.exports=function(t,e){if(!i(t)||a(t))return t;var n,r=u(t,l);if(r){if(void 0===e&&(e="default"),n=o(r,t,e),!i(n)||a(n))return n;throw f("Can\'t convert object to primitive value")}return void 0===e&&(e="number"),c(t,e)}},4948:(t,e,n)=>{var r=n(7593),o=n(2190);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},1694:(t,e,n)=>{var r={};r[n(5112)("toStringTag")]="z",t.exports="[object z]"===String(r)},6330:(t,e,n)=>{var r=n(7854).String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},9711:(t,e,n)=>{var r=n(1702),o=0,i=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},3307:(t,e,n)=>{var r=n(133);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5112:(t,e,n)=>{var r=n(7854),o=n(2309),i=n(2597),a=n(9711),u=n(133),c=n(3307),s=o("wks"),f=r.Symbol,l=f&&f.for,h=c?f:f&&f.withoutSetter||a;t.exports=function(t){if(!i(s,t)||!u&&"string"!=typeof s[t]){var e="Symbol."+t;u&&i(f,t)?s[t]=f[t]:s[t]=c&&l?l(e):h(e)}return s[t]}},2222:(t,e,n)=>{"use strict";var r=n(2109),o=n(7854),i=n(7293),a=n(3157),u=n(111),c=n(7908),s=n(6244),f=n(6135),l=n(5417),h=n(1194),p=n(5112),d=n(7392),v=p("isConcatSpreadable"),y=9007199254740991,m="Maximum allowed index exceeded",g=o.TypeError,b=d>=51||!i((function(){var t=[];return t[v]=!1,t.concat()[0]!==t})),w=h("concat"),_=function(t){if(!u(t))return!1;var e=t[v];return void 0!==e?!!e:a(t)};r({target:"Array",proto:!0,forced:!b||!w},{concat:function(t){var e,n,r,o,i,a=c(this),u=l(a,0),h=0;for(e=-1,r=arguments.length;e<r;e++)if(_(i=-1===e?a:arguments[e])){if(h+(o=s(i))>y)throw g(m);for(n=0;n<o;n++,h++)n in i&&f(u,h,i[n])}else{if(h>=y)throw g(m);f(u,h++,i)}return u.length=h,u}})},5069:(t,e,n)=>{"use strict";var r=n(2109),o=n(1702),i=n(3157),a=o([].reverse),u=[1,2];r({target:"Array",proto:!0,forced:String(u)===String(u.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},3843:(t,e,n)=>{var r=n(2109),o=n(7854),i=n(1702),a=o.Date,u=i(a.prototype.getTime);r({target:"Date",stat:!0},{now:function(){return u(new a)}})},3710:(t,e,n)=>{var r=n(1702),o=n(1320),i=Date.prototype,a="Invalid Date",u="toString",c=r(i.toString),s=r(i.getTime);String(new Date(NaN))!=a&&o(i,u,(function(){var t=s(this);return t==t?c(this):a}))},1539:(t,e,n)=>{var r=n(1694),o=n(1320),i=n(288);r||o(Object.prototype,"toString",i,{unsafe:!0})},8674:(t,e,n)=>{"use strict";var r,o,i,a,u=n(2109),c=n(1913),s=n(7854),f=n(5005),l=n(6916),h=n(1070),p=n(1320),d=n(2248),v=n(7674),y=n(8003),m=n(6340),g=n(9662),b=n(614),w=n(111),_=n(5787),x=n(2788),k=n(408),O=n(7072),j=n(6707),E=n(261).set,P=n(5948),S=n(9478),T=n(842),A=n(8523),C=n(2534),K=n(8572),I=n(9909),D=n(4705),R=n(5112),F=n(7871),B=n(5268),N=n(7392),M=R("species"),q="Promise",L=I.getterFor(q),U=I.set,G=I.getterFor(q),W=h&&h.prototype,z=h,V=W,Y=s.TypeError,H=s.document,X=s.process,Q=A.f,$=Q,J=!!(H&&H.createEvent&&s.dispatchEvent),Z=b(s.PromiseRejectionEvent),tt="unhandledrejection",et=!1,nt=D(q,(function(){var t=x(z),e=t!==String(z);if(!e&&66===N)return!0;if(c&&!V.finally)return!0;if(N>=51&&/native code/.test(t))return!1;var n=new z((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))};return(n.constructor={})[M]=r,!(et=n.then((function(){}))instanceof r)||!e&&F&&!Z})),rt=nt||!O((function(t){z.all(t).catch((function(){}))})),ot=function(t){var e;return!(!w(t)||!b(e=t.then))&&e},it=function(t,e){var n,r,o,i=e.value,a=1==e.state,u=a?t.ok:t.fail,c=t.resolve,s=t.reject,f=t.domain;try{u?(a||(2===e.rejection&&ft(e),e.rejection=1),!0===u?n=i:(f&&f.enter(),n=u(i),f&&(f.exit(),o=!0)),n===t.promise?s(Y("Promise-chain cycle")):(r=ot(n))?l(r,n,c,s):c(n)):s(i)}catch(t){f&&!o&&f.exit(),s(t)}},at=function(t,e){t.notified||(t.notified=!0,P((function(){for(var n,r=t.reactions;n=r.get();)it(n,t);t.notified=!1,e&&!t.rejection&&ct(t)})))},ut=function(t,e,n){var r,o;J?((r=H.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),s.dispatchEvent(r)):r={promise:e,reason:n},!Z&&(o=s["on"+t])?o(r):t===tt&&T("Unhandled promise rejection",n)},ct=function(t){l(E,s,(function(){var e,n=t.facade,r=t.value;if(st(t)&&(e=C((function(){B?X.emit("unhandledRejection",r,n):ut(tt,n,r)})),t.rejection=B||st(t)?2:1,e.error))throw e.value}))},st=function(t){return 1!==t.rejection&&!t.parent},ft=function(t){l(E,s,(function(){var e=t.facade;B?X.emit("rejectionHandled",e):ut("rejectionhandled",e,t.value)}))},lt=function(t,e,n){return function(r){t(e,r,n)}},ht=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,at(t,!0))},pt=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw Y("Promise can\'t be resolved itself");var r=ot(e);r?P((function(){var n={done:!1};try{l(r,e,lt(pt,n,t),lt(ht,n,t))}catch(e){ht(n,e,t)}})):(t.value=e,t.state=1,at(t,!1))}catch(e){ht({done:!1},e,t)}}};if(nt&&(V=(z=function(t){_(this,V),g(t),l(r,this);var e=L(this);try{t(lt(pt,e),lt(ht,e))}catch(t){ht(e,t)}}).prototype,(r=function(t){U(this,{type:q,done:!1,notified:!1,parent:!1,reactions:new K,rejection:!1,state:0,value:void 0})}).prototype=d(V,{then:function(t,e){var n=G(this),r=Q(j(this,z));return n.parent=!0,r.ok=!b(t)||t,r.fail=b(e)&&e,r.domain=B?X.domain:void 0,0==n.state?n.reactions.add(r):P((function(){it(r,n)})),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r,e=L(t);this.promise=t,this.resolve=lt(pt,e),this.reject=lt(ht,e)},A.f=Q=function(t){return t===z||t===i?new o(t):$(t)},!c&&b(h)&&W!==Object.prototype)){a=W.then,et||(p(W,"then",(function(t,e){var n=this;return new z((function(t,e){l(a,n,t,e)})).then(t,e)}),{unsafe:!0}),p(W,"catch",V.catch,{unsafe:!0}));try{delete W.constructor}catch(t){}v&&v(W,V)}u({global:!0,wrap:!0,forced:nt},{Promise:z}),y(z,q,!1,!0),m(q),i=f(q),u({target:q,stat:!0,forced:nt},{reject:function(t){var e=Q(this);return l(e.reject,void 0,t),e.promise}}),u({target:q,stat:!0,forced:c||nt},{resolve:function(t){return S(c&&this===i?z:this,t)}}),u({target:q,stat:!0,forced:rt},{all:function(t){var e=this,n=Q(e),r=n.resolve,o=n.reject,i=C((function(){var n=g(e.resolve),i=[],a=0,u=1;k(t,(function(t){var c=a++,s=!1;u++,l(n,e,t).then((function(t){s||(s=!0,i[c]=t,--u||r(i))}),o)})),--u||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=Q(e),r=n.reject,o=C((function(){var o=g(e.resolve);k(t,(function(t){l(o,e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},2419:(t,e,n)=>{var r=n(2109),o=n(5005),i=n(2104),a=n(7065),u=n(9483),c=n(9670),s=n(111),f=n(30),l=n(7293),h=o("Reflect","construct"),p=Object.prototype,d=[].push,v=l((function(){function t(){}return!(h((function(){}),[],t)instanceof t)})),y=!l((function(){h((function(){}))})),m=v||y;r({target:"Reflect",stat:!0,forced:m,sham:m},{construct:function(t,e){u(t),c(e);var n=arguments.length<3?t:u(arguments[2]);if(y&&!v)return h(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return i(d,r,e),new(i(a,t,r))}var o=n.prototype,l=f(s(o)?o:p),m=i(t,l,e);return s(m)?m:l}})}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";function t(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function e(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function u(e){t(a,o,i,u,c,"next",e)}function c(e){t(a,o,i,u,c,"throw",e)}u(void 0)}))}}var r=n(7162),o=n.n(r),i=(n(3710),n(5069),n(2222),n(3843),n(4073)),a=n.n(i);n(2419);function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t,e){return f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},f(t,e)}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function h(t,e){if(e&&("object"===l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t)}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}var d=function(){return d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},d.apply(this,arguments)};function v(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}var y=Object.keys,m=Array.isArray,g="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function b(t,e){return"object"!=typeof e||y(e).forEach((function(n){t[n]=e[n]})),t}"undefined"==typeof Promise||g.Promise||(g.Promise=Promise);var w=Object.getPrototypeOf,_={}.hasOwnProperty;function x(t,e){return _.call(t,e)}function k(t,e){"function"==typeof e&&(e=e(w(t))),y(e).forEach((function(n){j(t,n,e[n])}))}var O=Object.defineProperty;function j(t,e,n,r){O(t,e,b(n&&x(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function E(t){return{from:function(e){return t.prototype=Object.create(e.prototype),j(t.prototype,"constructor",t),{extend:k.bind(null,t.prototype)}}}}var P=Object.getOwnPropertyDescriptor;function S(t,e){var n;return P(t,e)||(n=w(t))&&S(n,e)}var T=[].slice;function A(t,e,n){return T.call(t,e,n)}function C(t,e){return e(t)}function K(t){if(!t)throw new Error("Assertion Failed")}function I(t){g.setImmediate?setImmediate(t):setTimeout(t,0)}function D(t,e){return t.reduce((function(t,n,r){var o=e(n,r);return o&&(t[o[0]]=o[1]),t}),{})}function R(t,e){if(x(t,e))return t[e];if(!e)return t;if("string"!=typeof e){for(var n=[],r=0,o=e.length;r<o;++r){var i=R(t,e[r]);n.push(i)}return n}var a=e.indexOf(".");if(-1!==a){var u=t[e.substr(0,a)];return void 0===u?void 0:R(u,e.substr(a+1))}}function F(t,e,n){if(t&&void 0!==e&&(!("isFrozen"in Object)||!Object.isFrozen(t)))if("string"!=typeof e&&"length"in e){K("string"!=typeof n&&"length"in n);for(var r=0,o=e.length;r<o;++r)F(t,e[r],n[r])}else{var i=e.indexOf(".");if(-1!==i){var a=e.substr(0,i),u=e.substr(i+1);if(""===u)void 0===n?m(t)&&!isNaN(parseInt(a))?t.splice(a,1):delete t[a]:t[a]=n;else{var c=t[a];c||(c=t[a]={}),F(c,u,n)}}else void 0===n?m(t)&&!isNaN(parseInt(e))?t.splice(e,1):delete t[e]:t[e]=n}}function B(t,e){"string"==typeof e?F(t,e,void 0):"length"in e&&[].map.call(e,(function(e){F(t,e,void 0)}))}function N(t){var e={};for(var n in t)x(t,n)&&(e[n]=t[n]);return e}var M=[].concat;function q(t){return M.apply([],t)}var L="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(q([8,16,32,64].map((function(t){return["Int","Uint","Float"].map((function(e){return e+t+"Array"}))})))).filter((function(t){return g[t]})),U=L.map((function(t){return g[t]})),G=D(L,(function(t){return[t,!0]}));function W(t){if(!t||"object"!=typeof t)return t;var e;if(m(t)){e=[];for(var n=0,r=t.length;n<r;++n)e.push(W(t[n]))}else if(U.indexOf(t.constructor)>=0)e=t;else for(var o in e=t.constructor?Object.create(t.constructor.prototype):{},t)x(t,o)&&(e[o]=W(t[o]));return e}var z={}.toString;function V(t){return z.call(t).slice(8,-1)}var Y=function(t,e){return"Array"===e?""+t.map((function(t){return Y(t,V(t))})):"ArrayBuffer"===e?""+new Uint8Array(t):"Date"===e?t.getTime():ArrayBuffer.isView(t)?""+new Uint8Array(t.buffer):t};function H(t,e,n,r){return n=n||{},r=r||"",y(t).forEach((function(o){if(x(e,o)){var i=t[o],a=e[o];if("object"==typeof i&&"object"==typeof a&&i&&a){var u=V(i),c=V(a);u===c?G[u]?Y(i,u)!==Y(a,c)&&(n[r+o]=e[o]):H(i,a,n,r+o+"."):n[r+o]=e[o]}else i!==a&&(n[r+o]=e[o])}else n[r+o]=void 0})),y(e).forEach((function(o){x(t,o)||(n[r+o]=e[o])})),n}var X="undefined"!=typeof Symbol&&Symbol.iterator,Q=X?function(t){var e;return null!=t&&(e=t[X])&&e.apply(t)}:function(){return null},$={};function J(t){var e,n,r,o;if(1===arguments.length){if(m(t))return t.slice();if(this===$&&"string"==typeof t)return[t];if(o=Q(t)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==t)return[t];if("number"==typeof(e=t.length)){for(n=new Array(e);e--;)n[e]=t[e];return n}return[t]}for(e=arguments.length,n=new Array(e);e--;)n[e]=arguments[e];return n}var Z="undefined"!=typeof Symbol?function(t){return"AsyncFunction"===t[Symbol.toStringTag]}:function(){return!1},tt="undefined"!=typeof location&&/^(http|https):\\/\\/(localhost|127\\.0\\.0\\.1)/.test(location.href);function et(t,e){tt=t,nt=e}var nt=function(){return!0},rt=!new Error("").stack;function ot(){if(rt)try{throw new Error}catch(t){return t}return new Error}function it(t,e){var n=t.stack;return n?(e=e||0,0===n.indexOf(t.name)&&(e+=(t.name+t.message).split("\\n").length),n.split("\\n").slice(e).filter(nt).map((function(t){return"\\n"+t})).join("")):""}var at=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ut=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(at),ct={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function st(t,e){this._e=ot(),this.name=t,this.message=e}function ft(t,e){return t+". Errors: "+Object.keys(e).map((function(t){return e[t].toString()})).filter((function(t,e,n){return n.indexOf(t)===e})).join("\\n")}function lt(t,e,n,r){this._e=ot(),this.failures=e,this.failedKeys=r,this.successCount=n,this.message=ft(t,e)}function ht(t,e){this._e=ot(),this.name="BulkError",this.failures=e,this.message=ft(t,e)}E(st).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+it(this._e,2))}},toString:function(){return this.name+": "+this.message}}),E(lt).from(st),E(ht).from(st);var pt=ut.reduce((function(t,e){return t[e]=e+"Error",t}),{}),dt=st,vt=ut.reduce((function(t,e){var n=e+"Error";function r(t,r){this._e=ot(),this.name=n,t?"string"==typeof t?(this.message=t+(r?"\\n "+r:""),this.inner=r||null):"object"==typeof t&&(this.message=t.name+" "+t.message,this.inner=t):(this.message=ct[e]||n,this.inner=null)}return E(r).from(dt),t[e]=r,t}),{});vt.Syntax=SyntaxError,vt.Type=TypeError,vt.Range=RangeError;var yt=at.reduce((function(t,e){return t[e+"Error"]=vt[e],t}),{});var mt=ut.reduce((function(t,e){return-1===["Syntax","Type","Range"].indexOf(e)&&(t[e+"Error"]=vt[e]),t}),{});function gt(){}function bt(t){return t}function wt(t,e){return null==t||t===bt?e:function(n){return e(t(n))}}function _t(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function xt(t,e){return t===gt?e:function(){var n=t.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=e.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?_t(r,this.onsuccess):r),o&&(this.onerror=this.onerror?_t(o,this.onerror):o),void 0!==i?i:n}}function kt(t,e){return t===gt?e:function(){t.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,e.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?_t(n,this.onsuccess):n),r&&(this.onerror=this.onerror?_t(r,this.onerror):r)}}function Ot(t,e){return t===gt?e:function(n){var r=t.apply(this,arguments);b(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=e.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?_t(o,this.onsuccess):o),i&&(this.onerror=this.onerror?_t(i,this.onerror):i),void 0===r?void 0===a?void 0:a:b(r,a)}}function jt(t,e){return t===gt?e:function(){return!1!==e.apply(this,arguments)&&t.apply(this,arguments)}}function Et(t,e){return t===gt?e:function(){var n=t.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return n.then((function(){return e.apply(r,i)}))}return e.apply(this,arguments)}}mt.ModifyError=lt,mt.DexieError=st,mt.BulkError=ht;var Pt={},St="undefined"==typeof Promise?[]:function(){var t=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[t,t.__proto__,t];var e=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[e,e.__proto__,t]}(),Tt=St[0],At=St[1],Ct=St[2],Kt=At&&At.then,It=Tt&&Tt.constructor,Dt=!!Ct,Rt=!1,Ft=Ct?function(){Ct.then(ie)}:g.setImmediate?setImmediate.bind(null,ie):g.MutationObserver?function(){var t=document.createElement("div");new MutationObserver((function(){ie(),t=null})).observe(t,{attributes:!0}),t.setAttribute("i","1")}:function(){setTimeout(ie,0)},Bt=function(t,e){Vt.push([t,e]),Mt&&(Ft(),Mt=!1)},Nt=!0,Mt=!0,qt=[],Lt=[],Ut=null,Gt=bt,Wt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Ae,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(t){try{Ae(t[0],t[1])}catch(t){}}))}},zt=Wt,Vt=[],Yt=0,Ht=[];function Xt(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=gt,this._lib=!1;var e=this._PSD=zt;if(tt&&(this._stackHolder=ot(),this._prev=null,this._numPrev=0),"function"!=typeof t){if(t!==Pt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Zt(this,this._value))}this._state=null,this._value=null,++e.ref,Jt(this,t)}var Qt={get:function(){var t=zt,e=ve;function n(n,r){var o=this,i=!t.global&&(t!==zt||e!==ve),a=i&&!be(),u=new Xt((function(e,u){ee(o,new $t(Pe(n,t,i,a),Pe(r,t,i,a),e,u,t))}));return tt&&oe(u,this),u}return n.prototype=Pt,n},set:function(t){j(this,"then",t&&t.prototype===Pt?Qt:{get:function(){return t},set:Qt.set})}};function $t(t,e,n,r,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r,this.psd=o}function Jt(t,e){try{e((function(e){if(null===t._state){if(e===t)throw new TypeError("A promise cannot be resolved with itself.");var n=t._lib&&ae();e&&"function"==typeof e.then?Jt(t,(function(t,n){e instanceof Xt?e._then(t,n):e.then(t,n)})):(t._state=!0,t._value=e,te(t)),n&&ue()}}),Zt.bind(null,t))}catch(e){Zt(t,e)}}function Zt(t,e){if(Lt.push(e),null===t._state){var n=t._lib&&ae();e=Gt(e),t._state=!1,t._value=e,tt&&null!==e&&"object"==typeof e&&!e._promise&&function(t,e,n){try{t.apply(null,n)}catch(t){e&&e(t)}}((function(){var n=S(e,"stack");e._promise=t,j(e,"stack",{get:function(){return Rt?n&&(n.get?n.get.apply(e):n.value):t.stack}})})),function(t){qt.some((function(e){return e._value===t._value}))||qt.push(t)}(t),te(t),n&&ue()}}function te(t){var e=t._listeners;t._listeners=[];for(var n=0,r=e.length;n<r;++n)ee(t,e[n]);var o=t._PSD;--o.ref||o.finalize(),0===Yt&&(++Yt,Bt((function(){0==--Yt&&ce()}),[]))}function ee(t,e){if(null!==t._state){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return(t._state?e.resolve:e.reject)(t._value);++e.psd.ref,++Yt,Bt(ne,[n,t,e])}else t._listeners.push(e)}function ne(t,e,n){try{Ut=e;var r,o=e._value;e._state?r=t(o):(Lt.length&&(Lt=[]),r=t(o),-1===Lt.indexOf(o)&&function(t){var e=qt.length;for(;e;)if(qt[--e]._value===t._value)return void qt.splice(e,1)}(e)),n.resolve(r)}catch(t){n.reject(t)}finally{Ut=null,0==--Yt&&ce(),--n.psd.ref||n.psd.finalize()}}function re(t,e,n){if(e.length===n)return e;var r="";if(!1===t._state){var o,i,a=t._value;null!=a?(o=a.name||"Error",i=a.message||a,r=it(a,0)):(o=a,i=""),e.push(o+(i?": "+i:"")+r)}return tt&&((r=it(t._stackHolder,2))&&-1===e.indexOf(r)&&e.push(r),t._prev&&re(t._prev,e,n)),e}function oe(t,e){var n=e?e._numPrev+1:0;n<100&&(t._prev=e,t._numPrev=n)}function ie(){ae()&&ue()}function ae(){var t=Nt;return Nt=!1,Mt=!1,t}function ue(){var t,e,n;do{for(;Vt.length>0;)for(t=Vt,Vt=[],n=t.length,e=0;e<n;++e){var r=t[e];r[0].apply(null,r[1])}}while(Vt.length>0);Nt=!0,Mt=!0}function ce(){var t=qt;qt=[],t.forEach((function(t){t._PSD.onunhandled.call(null,t._value,t)}));for(var e=Ht.slice(0),n=e.length;n;)e[--n]()}function se(t){return new Xt(Pt,!1,t)}function fe(t,e){var n=zt;return function(){var r=ae(),o=zt;try{return ke(n,!0),t.apply(this,arguments)}catch(t){e&&e(t)}finally{ke(o,!1),r&&ue()}}}k(Xt.prototype,{then:Qt,_then:function(t,e){ee(this,new $t(null,null,t,e,zt))},catch:function(t){if(1===arguments.length)return this.then(null,t);var e=arguments[0],n=arguments[1];return"function"==typeof e?this.then(null,(function(t){return t instanceof e?n(t):se(t)})):this.then(null,(function(t){return t&&t.name===e?n(t):se(t)}))},finally:function(t){return this.then((function(e){return t(),e}),(function(e){return t(),se(e)}))},stack:{get:function(){if(this._stack)return this._stack;try{Rt=!0;var t=re(this,[],20).join("\\nFrom previous: ");return null!==this._state&&(this._stack=t),t}finally{Rt=!1}}},timeout:function(t,e){var n=this;return t<1/0?new Xt((function(r,o){var i=setTimeout((function(){return o(new vt.Timeout(e))}),t);n.then(r,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&j(Xt.prototype,Symbol.toStringTag,"Dexie.Promise"),Wt.env=Oe(),k(Xt,{all:function(){var t=J.apply(null,arguments).map(we);return new Xt((function(e,n){0===t.length&&e([]);var r=t.length;t.forEach((function(o,i){return Xt.resolve(o).then((function(n){t[i]=n,--r||e(t)}),n)}))}))},resolve:function(t){if(t instanceof Xt)return t;if(t&&"function"==typeof t.then)return new Xt((function(e,n){t.then(e,n)}));var e=new Xt(Pt,!0,t);return oe(e,Ut),e},reject:se,race:function(){var t=J.apply(null,arguments).map(we);return new Xt((function(e,n){t.map((function(t){return Xt.resolve(t).then(e,n)}))}))},PSD:{get:function(){return zt},set:function(t){return zt=t}},totalEchoes:{get:function(){return ve}},newPSD:me,usePSD:je,scheduler:{get:function(){return Bt},set:function(t){Bt=t}},rejectionMapper:{get:function(){return Gt},set:function(t){Gt=t}},follow:function(t,e){return new Xt((function(n,r){return me((function(e,n){var r=zt;r.unhandleds=[],r.onunhandled=n,r.finalize=_t((function(){var t=this;!function(t){function e(){t(),Ht.splice(Ht.indexOf(e),1)}Ht.push(e),++Yt,Bt((function(){0==--Yt&&ce()}),[])}((function(){0===t.unhandleds.length?e():n(t.unhandleds[0])}))}),r.finalize),t()}),e,n,r)}))}}),It&&(It.allSettled&&j(Xt,"allSettled",(function(){var t=J.apply(null,arguments).map(we);return new Xt((function(e){0===t.length&&e([]);var n=t.length,r=new Array(n);t.forEach((function(t,o){return Xt.resolve(t).then((function(t){return r[o]={status:"fulfilled",value:t}}),(function(t){return r[o]={status:"rejected",reason:t}})).then((function(){return--n||e(r)}))}))}))})),It.any&&"undefined"!=typeof AggregateError&&j(Xt,"any",(function(){var t=J.apply(null,arguments).map(we);return new Xt((function(e,n){0===t.length&&n(new AggregateError([]));var r=t.length,o=new Array(r);t.forEach((function(t,i){return Xt.resolve(t).then((function(t){return e(t)}),(function(t){o[i]=t,--r||n(new AggregateError(o))}))}))}))})));var le={awaits:0,echoes:0,id:0},he=0,pe=[],de=0,ve=0,ye=0;function me(t,e,n,r){var o=zt,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++ye;var a=Wt.env;i.env=Dt?{Promise:Xt,PromiseProp:{value:Xt,configurable:!0,writable:!0},all:Xt.all,race:Xt.race,allSettled:Xt.allSettled,any:Xt.any,resolve:Xt.resolve,reject:Xt.reject,nthen:Se(a.nthen,i),gthen:Se(a.gthen,i)}:{},e&&b(i,e),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=je(i,t,n,r);return 0===i.ref&&i.finalize(),u}function ge(){return le.id||(le.id=++he),++le.awaits,le.echoes+=100,le.id}function be(){return!!le.awaits&&(0==--le.awaits&&(le.id=0),le.echoes=100*le.awaits,!0)}function we(t){return le.echoes&&t&&t.constructor===It?(ge(),t.then((function(t){return be(),t}),(function(t){return be(),Ce(t)}))):t}function _e(t){++ve,le.echoes&&0!=--le.echoes||(le.echoes=le.id=0),pe.push(zt),ke(t,!0)}function xe(){var t=pe[pe.length-1];pe.pop(),ke(t,!1)}function ke(t,e){var n=zt;if((e?!le.echoes||de++&&t===zt:!de||--de&&t===zt)||Ee(e?_e.bind(null,t):xe),t!==zt&&(zt=t,n===Wt&&(Wt.env=Oe()),Dt)){var r=Wt.env.Promise,o=t.env;At.then=o.nthen,r.prototype.then=o.gthen,(n.global||t.global)&&(Object.defineProperty(g,"Promise",o.PromiseProp),r.all=o.all,r.race=o.race,r.resolve=o.resolve,r.reject=o.reject,o.allSettled&&(r.allSettled=o.allSettled),o.any&&(r.any=o.any))}}function Oe(){var t=g.Promise;return Dt?{Promise:t,PromiseProp:Object.getOwnPropertyDescriptor(g,"Promise"),all:t.all,race:t.race,allSettled:t.allSettled,any:t.any,resolve:t.resolve,reject:t.reject,nthen:At.then,gthen:t.prototype.then}:{}}function je(t,e,n,r,o){var i=zt;try{return ke(t,!0),e(n,r,o)}finally{ke(i,!1)}}function Ee(t){Kt.call(Tt,t)}function Pe(t,e,n,r){return"function"!=typeof t?t:function(){var o=zt;n&&ge(),ke(e,!0);try{return t.apply(this,arguments)}finally{ke(o,!1),r&&Ee(be)}}}function Se(t,e){return function(n,r){return t.call(this,Pe(n,e),Pe(r,e))}}-1===(""+Kt).indexOf("[native code]")&&(ge=be=gt);var Te="unhandledrejection";function Ae(t,e){var n;try{n=e.onuncatched(t)}catch(t){}if(!1!==n)try{var r,o={promise:e,reason:t};if(g.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(Te,!0,!0),b(r,o)):g.CustomEvent&&b(r=new CustomEvent(Te,{detail:o}),o),r&&g.dispatchEvent&&(dispatchEvent(r),!g.PromiseRejectionEvent&&g.onunhandledrejection))try{g.onunhandledrejection(r)}catch(t){}tt&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: "+(t.stack||t))}catch(t){}}var Ce=Xt.reject;function Ke(t,e,n,r){if(t._state.openComplete||zt.letThrough){var o=t._createTransaction(e,n,t._dbSchema);try{o.create()}catch(t){return Ce(t)}return o._promise(e,(function(t,e){return me((function(){return zt.trans=o,r(t,e,o)}))})).then((function(t){return o._completion.then((function(){return t}))}))}if(!t._state.isBeingOpened){if(!t._options.autoOpen)return Ce(new vt.DatabaseClosed);t.open().catch(gt)}return t._state.dbReadyPromise.then((function(){return Ke(t,e,n,r)}))}var Ie="3.0.3",De=String.fromCharCode(65535),Re=-1/0,Fe="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Be="String expected.",Ne=[],Me="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),qe=Me,Le=Me,Ue=function(t){return!/(dexie\\.js|dexie\\.min\\.js)/.test(t)},Ge="__dbnames",We="readonly",ze="readwrite";function Ve(t,e){return t?e?function(){return t.apply(this,arguments)&&e.apply(this,arguments)}:t:e}var Ye={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function He(t){return function(e){return void 0===R(e,t)&&B(e=W(e),t),e}}var Xe=function(){function t(){}return t.prototype._trans=function(t,e,n){var r=this._tx||zt.trans,o=this.name;function i(t,n,r){if(!r.schema[o])throw new vt.NotFound("Table "+o+" not part of transaction");return e(r.idbtrans,r)}var a=ae();try{return r&&r.db===this.db?r===zt.trans?r._promise(t,i,n):me((function(){return r._promise(t,i,n)}),{trans:r,transless:zt.transless||zt}):Ke(this.db,t,[this.name],i)}finally{a&&ue()}},t.prototype.get=function(t,e){var n=this;return t&&t.constructor===Object?this.where(t).first(e):this._trans("readonly",(function(e){return n.core.get({trans:e,key:t}).then((function(t){return n.hook.reading.fire(t)}))})).then(e)},t.prototype.where=function(t){if("string"==typeof t)return new this.db.WhereClause(this,t);if(m(t))return new this.db.WhereClause(this,"["+t.join("+")+"]");var e=y(t);if(1===e.length)return this.where(e[0]).equals(t[e[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(t){return t.compound&&e.every((function(e){return t.keyPath.indexOf(e)>=0}))&&t.keyPath.every((function(t){return e.indexOf(t)>=0}))}))[0];if(n&&this.db._maxKey!==De)return this.where(n.name).equals(n.keyPath.map((function(e){return t[e]})));!n&&tt&&console.warn("The query "+JSON.stringify(t)+" on "+this.name+" would benefit of a compound index ["+e.join("+")+"]");var r=this.schema.idxByName,o=this.db._deps.indexedDB;function i(t,e){try{return 0===o.cmp(t,e)}catch(t){return!1}}var a=e.reduce((function(e,n){var o=e[0],a=e[1],u=r[n],c=t[n];return[o||u,o||!u?Ve(a,u&&u.multi?function(t){var e=R(t,n);return m(e)&&e.some((function(t){return i(c,t)}))}:function(t){return i(c,R(t,n))}):a]}),[null,null]),u=a[0],c=a[1];return u?this.where(u.name).equals(t[u.keyPath]).filter(c):n?this.filter(c):this.where(e).equals("")},t.prototype.filter=function(t){return this.toCollection().and(t)},t.prototype.count=function(t){return this.toCollection().count(t)},t.prototype.offset=function(t){return this.toCollection().offset(t)},t.prototype.limit=function(t){return this.toCollection().limit(t)},t.prototype.each=function(t){return this.toCollection().each(t)},t.prototype.toArray=function(t){return this.toCollection().toArray(t)},t.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},t.prototype.orderBy=function(t){return new this.db.Collection(new this.db.WhereClause(this,m(t)?"["+t.join("+")+"]":t))},t.prototype.reverse=function(){return this.toCollection().reverse()},t.prototype.mapToClass=function(t){this.schema.mappedClass=t;var e=function(e){if(!e)return e;var n=Object.create(t.prototype);for(var r in e)if(x(e,r))try{n[r]=e[r]}catch(t){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=e,this.hook("reading",e),t},t.prototype.defineClass=function(){return this.mapToClass((function(t){b(this,t)}))},t.prototype.add=function(t,e){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=t;return i&&o&&(a=He(i)(t)),this._trans("readwrite",(function(t){return n.core.mutate({trans:t,type:"add",keys:null!=e?[e]:null,values:[a]})})).then((function(t){return t.numFailures?Xt.reject(t.failures[0]):t.lastResult})).then((function(e){if(i)try{F(t,i,e)}catch(t){}return e}))},t.prototype.update=function(t,e){if("object"!=typeof e||m(e))throw new vt.InvalidArgument("Modifications must be an object.");if("object"!=typeof t||m(t))return this.where(":id").equals(t).modify(e);y(e).forEach((function(n){F(t,n,e[n])}));var n=R(t,this.schema.primKey.keyPath);return void 0===n?Ce(new vt.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(e)},t.prototype.put=function(t,e){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=t;return i&&o&&(a=He(i)(t)),this._trans("readwrite",(function(t){return n.core.mutate({trans:t,type:"put",values:[a],keys:null!=e?[e]:null})})).then((function(t){return t.numFailures?Xt.reject(t.failures[0]):t.lastResult})).then((function(e){if(i)try{F(t,i,e)}catch(t){}return e}))},t.prototype.delete=function(t){var e=this;return this._trans("readwrite",(function(n){return e.core.mutate({trans:n,type:"delete",keys:[t]})})).then((function(t){return t.numFailures?Xt.reject(t.failures[0]):void 0}))},t.prototype.clear=function(){var t=this;return this._trans("readwrite",(function(e){return t.core.mutate({trans:e,type:"deleteRange",range:Ye})})).then((function(t){return t.numFailures?Xt.reject(t.failures[0]):void 0}))},t.prototype.bulkGet=function(t){var e=this;return this._trans("readonly",(function(n){return e.core.getMany({keys:t,trans:n}).then((function(t){return t.map((function(t){return e.hook.reading.fire(t)}))}))}))},t.prototype.bulkAdd=function(t,e,n){var r=this,o=Array.isArray(e)?e:void 0,i=(n=n||(o?void 0:e))?n.allKeys:void 0;return this._trans("readwrite",(function(e){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new vt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==t.length)throw new vt.InvalidArgument("Arguments objects and keys must have the same length");var c=t.length,s=u&&a?t.map(He(u)):t;return r.core.mutate({trans:e,type:"add",keys:o,values:s,wantResults:i}).then((function(t){var e=t.numFailures,n=t.results,o=t.lastResult,a=t.failures;if(0===e)return i?n:o;throw new ht(r.name+".bulkAdd(): "+e+" of "+c+" operations failed",Object.keys(a).map((function(t){return a[t]})))}))}))},t.prototype.bulkPut=function(t,e,n){var r=this,o=Array.isArray(e)?e:void 0,i=(n=n||(o?void 0:e))?n.allKeys:void 0;return this._trans("readwrite",(function(e){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new vt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==t.length)throw new vt.InvalidArgument("Arguments objects and keys must have the same length");var c=t.length,s=u&&a?t.map(He(u)):t;return r.core.mutate({trans:e,type:"put",keys:o,values:s,wantResults:i}).then((function(t){var e=t.numFailures,n=t.results,o=t.lastResult,a=t.failures;if(0===e)return i?n:o;throw new ht(r.name+".bulkPut(): "+e+" of "+c+" operations failed",Object.keys(a).map((function(t){return a[t]})))}))}))},t.prototype.bulkDelete=function(t){var e=this,n=t.length;return this._trans("readwrite",(function(n){return e.core.mutate({trans:n,type:"delete",keys:t})})).then((function(t){var r=t.numFailures,o=t.lastResult,i=t.failures;if(0===r)return o;throw new ht(e.name+".bulkDelete(): "+r+" of "+n+" operations failed",i)}))},t}();function Qe(t){var e={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return e[n].subscribe.apply(null,i),t}if("string"==typeof n)return e[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(t,r,o){if("object"==typeof t)return a(t);r||(r=jt),o||(o=gt);var i={subscribers:[],fire:o,subscribe:function(t){-1===i.subscribers.indexOf(t)&&(i.subscribers.push(t),i.fire=r(i.fire,t))},unsubscribe:function(t){i.subscribers=i.subscribers.filter((function(e){return e!==t})),i.fire=i.subscribers.reduce(r,o)}};return e[t]=n[t]=i,i}function a(t){y(t).forEach((function(e){var n=t[e];if(m(n))i(e,t[e][0],t[e][1]);else{if("asap"!==n)throw new vt.InvalidArgument("Invalid event config");var r=i(e,bt,(function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];r.subscribers.forEach((function(t){I((function(){t.apply(null,e)}))}))}))}}))}}function $e(t,e){return E(e).from({prototype:t}),e}function Je(t,e){return!(t.filter||t.algorithm||t.or)&&(e?t.justLimit:!t.replayFilter)}function Ze(t,e){t.filter=Ve(t.filter,e)}function tn(t,e,n){var r=t.replayFilter;t.replayFilter=r?function(){return Ve(r(),e())}:e,t.justLimit=n&&!r}function en(t,e){if(t.isPrimKey)return e.primaryKey;var n=e.getIndexByKeyPath(t.index);if(!n)throw new vt.Schema("KeyPath "+t.index+" on object store "+e.name+" is not indexed");return n}function nn(t,e,n){var r=en(t,e.schema);return e.openCursor({trans:n,values:!t.keysOnly,reverse:"prev"===t.dir,unique:!!t.unique,query:{index:r,range:t.range}})}function rn(t,e,n,r){var o=t.replayFilter?Ve(t.filter,t.replayFilter()):t.filter;if(t.or){var i={},a=function(t,n,r){if(!o||o(n,r,(function(t){return n.stop(t)}),(function(t){return n.fail(t)}))){var a=n.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),x(i,u)||(i[u]=!0,e(t,n,r))}};return Promise.all([t.or._iterate(a,n),on(nn(t,r,n),t.algorithm,a,!t.keysOnly&&t.valueMapper)])}return on(nn(t,r,n),Ve(t.algorithm,o),e,!t.keysOnly&&t.valueMapper)}function on(t,e,n,r){var o=fe(r?function(t,e,o){return n(r(t),e,o)}:n);return t.then((function(t){if(t)return t.start((function(){var n=function(){return t.continue()};e&&!e(t,(function(t){return n=t}),(function(e){t.stop(e),n=gt}),(function(e){t.fail(e),n=gt}))||o(t.value,t,(function(t){return n=t})),n()}))}))}var an=function(){function t(){}return t.prototype._read=function(t,e){var n=this._ctx;return n.error?n.table._trans(null,Ce.bind(null,n.error)):n.table._trans("readonly",t).then(e)},t.prototype._write=function(t){var e=this._ctx;return e.error?e.table._trans(null,Ce.bind(null,e.error)):e.table._trans("readwrite",t,"locked")},t.prototype._addAlgorithm=function(t){var e=this._ctx;e.algorithm=Ve(e.algorithm,t)},t.prototype._iterate=function(t,e){return rn(this._ctx,t,e,this._ctx.table.core)},t.prototype.clone=function(t){var e=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return t&&b(n,t),e._ctx=n,e},t.prototype.raw=function(){return this._ctx.valueMapper=null,this},t.prototype.each=function(t){var e=this._ctx;return this._read((function(n){return rn(e,t,n,e.table.core)}))},t.prototype.count=function(t){var e=this;return this._read((function(t){var n=e._ctx,r=n.table.core;if(Je(n,!0))return r.count({trans:t,query:{index:en(n,r.schema),range:n.range}}).then((function(t){return Math.min(t,n.limit)}));var o=0;return rn(n,(function(){return++o,!1}),t,r).then((function(){return o}))})).then(t)},t.prototype.sortBy=function(t,e){var n=t.split(".").reverse(),r=n[0],o=n.length-1;function i(t,e){return e?i(t[n[e]],e-1):t[r]}var a="next"===this._ctx.dir?1:-1;function u(t,e){var n=i(t,o),r=i(e,o);return n<r?-a:n>r?a:0}return this.toArray((function(t){return t.sort(u)})).then(e)},t.prototype.toArray=function(t){var e=this;return this._read((function(t){var n=e._ctx;if("next"===n.dir&&Je(n,!0)&&n.limit>0){var r=n.valueMapper,o=en(n,n.table.core.schema);return n.table.core.query({trans:t,limit:n.limit,values:!0,query:{index:o,range:n.range}}).then((function(t){var e=t.result;return r?e.map(r):e}))}var i=[];return rn(n,(function(t){return i.push(t)}),t,n.table.core).then((function(){return i}))}),t)},t.prototype.offset=function(t){var e=this._ctx;return t<=0||(e.offset+=t,Je(e)?tn(e,(function(){var e=t;return function(t,n){return 0===e||(1===e?(--e,!1):(n((function(){t.advance(e),e=0})),!1))}})):tn(e,(function(){var e=t;return function(){return--e<0}}))),this},t.prototype.limit=function(t){return this._ctx.limit=Math.min(this._ctx.limit,t),tn(this._ctx,(function(){var e=t;return function(t,n,r){return--e<=0&&n(r),e>=0}}),!0),this},t.prototype.until=function(t,e){return Ze(this._ctx,(function(n,r,o){return!t(n.value)||(r(o),e)})),this},t.prototype.first=function(t){return this.limit(1).toArray((function(t){return t[0]})).then(t)},t.prototype.last=function(t){return this.reverse().first(t)},t.prototype.filter=function(t){return Ze(this._ctx,(function(e){return t(e.value)})),function(t,e){t.isMatch=Ve(t.isMatch,e)}(this._ctx,t),this},t.prototype.and=function(t){return this.filter(t)},t.prototype.or=function(t){return new this.db.WhereClause(this._ctx.table,t,this)},t.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},t.prototype.desc=function(){return this.reverse()},t.prototype.eachKey=function(t){var e=this._ctx;return e.keysOnly=!e.isMatch,this.each((function(e,n){t(n.key,n)}))},t.prototype.eachUniqueKey=function(t){return this._ctx.unique="unique",this.eachKey(t)},t.prototype.eachPrimaryKey=function(t){var e=this._ctx;return e.keysOnly=!e.isMatch,this.each((function(e,n){t(n.primaryKey,n)}))},t.prototype.keys=function(t){var e=this._ctx;e.keysOnly=!e.isMatch;var n=[];return this.each((function(t,e){n.push(e.key)})).then((function(){return n})).then(t)},t.prototype.primaryKeys=function(t){var e=this._ctx;if("next"===e.dir&&Je(e,!0)&&e.limit>0)return this._read((function(t){var n=en(e,e.table.core.schema);return e.table.core.query({trans:t,values:!1,limit:e.limit,query:{index:n,range:e.range}})})).then((function(t){return t.result})).then(t);e.keysOnly=!e.isMatch;var n=[];return this.each((function(t,e){n.push(e.primaryKey)})).then((function(){return n})).then(t)},t.prototype.uniqueKeys=function(t){return this._ctx.unique="unique",this.keys(t)},t.prototype.firstKey=function(t){return this.limit(1).keys((function(t){return t[0]})).then(t)},t.prototype.lastKey=function(t){return this.reverse().firstKey(t)},t.prototype.distinct=function(){var t=this._ctx,e=t.index&&t.table.schema.idxByName[t.index];if(!e||!e.multi)return this;var n={};return Ze(this._ctx,(function(t){var e=t.primaryKey.toString(),r=x(n,e);return n[e]=!0,!r})),this},t.prototype.modify=function(t){var e=this,n=this._ctx;return this._write((function(r){var o;if("function"==typeof t)o=t;else{var i=y(t),a=i.length;o=function(e){for(var n=!1,r=0;r<a;++r){var o=i[r],u=t[o];R(e,o)!==u&&(F(e,o,u),n=!0)}return n}}var u=n.table.core,c=u.schema.primaryKey,s=c.outbound,f=c.extractKey,l="testmode"in $n?1:2e3,h=e.db.core.cmp,p=[],d=0,v=[],m=function(t,e){var n=e.failures,r=e.numFailures;d+=t-r;for(var o=0,i=y(n);o<i.length;o++){var a=i[o];p.push(n[a])}};return e.clone().primaryKeys().then((function(t){var e=function(n){var i=Math.min(l,t.length-n);return u.getMany({trans:r,keys:t.slice(n,n+i)}).then((function(a){for(var c=[],p=[],d=s?[]:null,v=[],y=0;y<i;++y){var g=a[y],b={value:W(g),primKey:t[n+y]};!1!==o.call(b,b.value,b)&&(null==b.value?v.push(t[n+y]):s||0===h(f(g),f(b.value))?(p.push(b.value),s&&d.push(t[n+y])):(v.push(t[n+y]),c.push(b.value)))}return Promise.resolve(c.length>0&&u.mutate({trans:r,type:"add",values:c}).then((function(t){for(var e in t.failures)v.splice(parseInt(e),1);m(c.length,t)}))).then((function(t){return p.length>0&&u.mutate({trans:r,type:"put",keys:d,values:p}).then((function(t){return m(p.length,t)}))})).then((function(){return v.length>0&&u.mutate({trans:r,type:"delete",keys:v}).then((function(t){return m(v.length,t)}))})).then((function(){return t.length>n+i&&e(n+l)}))}))};return e(0).then((function(){if(p.length>0)throw new lt("Error modifying one or more objects",p,d,v);return t.length}))}))}))},t.prototype.delete=function(){var t=this._ctx,e=t.range;return Je(t)&&(t.isPrimKey&&!Le||3===e.type)?this._write((function(n){var r=t.table.core.schema.primaryKey,o=e;return t.table.core.count({trans:n,query:{index:r,range:o}}).then((function(e){return t.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((function(t){var n=t.failures,r=(t.lastResult,t.results,t.numFailures);if(r)throw new lt("Could not delete some values",Object.keys(n).map((function(t){return n[t]})),e-r);return e-r}))}))})):this.modify((function(t,e){return e.value=null}))},t}();function un(t,e){return t<e?-1:t===e?0:1}function cn(t,e){return t>e?-1:t===e?0:1}function sn(t,e,n){var r=t instanceof vn?new t.Collection(t):t;return r._ctx.error=n?new n(e):new TypeError(e),r}function fn(t){return new t.Collection(t,(function(){return dn("")})).limit(0)}function ln(t,e,n,r,o,i){for(var a=Math.min(t.length,r.length),u=-1,c=0;c<a;++c){var s=e[c];if(s!==r[c])return o(t[c],n[c])<0?t.substr(0,c)+n[c]+n.substr(c+1):o(t[c],r[c])<0?t.substr(0,c)+r[c]+n.substr(c+1):u>=0?t.substr(0,u)+e[u]+n.substr(u+1):null;o(t[c],s)<0&&(u=c)}return a<r.length&&"next"===i?t+n.substr(t.length):a<t.length&&"prev"===i?t.substr(0,n.length):u<0?null:t.substr(0,u)+r[u]+n.substr(u+1)}function hn(t,e,n,r){var o,i,a,u,c,s,f,l=n.length;if(!n.every((function(t){return"string"==typeof t})))return sn(t,Be);function h(t){o=function(t){return"next"===t?function(t){return t.toUpperCase()}:function(t){return t.toLowerCase()}}(t),i=function(t){return"next"===t?function(t){return t.toLowerCase()}:function(t){return t.toUpperCase()}}(t),a="next"===t?un:cn;var e=n.map((function(t){return{lower:i(t),upper:o(t)}})).sort((function(t,e){return a(t.lower,e.lower)}));u=e.map((function(t){return t.upper})),c=e.map((function(t){return t.lower})),s=t,f="next"===t?"":r}h("next");var p=new t.Collection(t,(function(){return pn(u[0],c[l-1]+r)}));p._ondirectionchange=function(t){h(t)};var d=0;return p._addAlgorithm((function(t,n,r){var o=t.key;if("string"!=typeof o)return!1;var h=i(o);if(e(h,c,d))return!0;for(var p=null,v=d;v<l;++v){var y=ln(o,h,u[v],c[v],a,s);null===y&&null===p?d=v+1:(null===p||a(p,y)>0)&&(p=y)}return n(null!==p?function(){t.continue(p+f)}:r),!1})),p}function pn(t,e,n,r){return{type:2,lower:t,upper:e,lowerOpen:n,upperOpen:r}}function dn(t){return{type:1,lower:t,upper:t}}var vn=function(){function t(){}return Object.defineProperty(t.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),t.prototype.between=function(t,e,n,r){n=!1!==n,r=!0===r;try{return this._cmp(t,e)>0||0===this._cmp(t,e)&&(n||r)&&(!n||!r)?fn(this):new this.Collection(this,(function(){return pn(t,e,!n,!r)}))}catch(t){return sn(this,Fe)}},t.prototype.equals=function(t){return null==t?sn(this,Fe):new this.Collection(this,(function(){return dn(t)}))},t.prototype.above=function(t){return null==t?sn(this,Fe):new this.Collection(this,(function(){return pn(t,void 0,!0)}))},t.prototype.aboveOrEqual=function(t){return null==t?sn(this,Fe):new this.Collection(this,(function(){return pn(t,void 0,!1)}))},t.prototype.below=function(t){return null==t?sn(this,Fe):new this.Collection(this,(function(){return pn(void 0,t,!1,!0)}))},t.prototype.belowOrEqual=function(t){return null==t?sn(this,Fe):new this.Collection(this,(function(){return pn(void 0,t)}))},t.prototype.startsWith=function(t){return"string"!=typeof t?sn(this,Be):this.between(t,t+De,!0,!0)},t.prototype.startsWithIgnoreCase=function(t){return""===t?this.startsWith(t):hn(this,(function(t,e){return 0===t.indexOf(e[0])}),[t],De)},t.prototype.equalsIgnoreCase=function(t){return hn(this,(function(t,e){return t===e[0]}),[t],"")},t.prototype.anyOfIgnoreCase=function(){var t=J.apply($,arguments);return 0===t.length?fn(this):hn(this,(function(t,e){return-1!==e.indexOf(t)}),t,"")},t.prototype.startsWithAnyOfIgnoreCase=function(){var t=J.apply($,arguments);return 0===t.length?fn(this):hn(this,(function(t,e){return e.some((function(e){return 0===t.indexOf(e)}))}),t,De)},t.prototype.anyOf=function(){var t=this,e=J.apply($,arguments),n=this._cmp;try{e.sort(n)}catch(t){return sn(this,Fe)}if(0===e.length)return fn(this);var r=new this.Collection(this,(function(){return pn(e[0],e[e.length-1])}));r._ondirectionchange=function(r){n="next"===r?t._ascending:t._descending,e.sort(n)};var o=0;return r._addAlgorithm((function(t,r,i){for(var a=t.key;n(a,e[o])>0;)if(++o===e.length)return r(i),!1;return 0===n(a,e[o])||(r((function(){t.continue(e[o])})),!1)})),r},t.prototype.notEqual=function(t){return this.inAnyRange([[Re,t],[t,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},t.prototype.noneOf=function(){var t=J.apply($,arguments);if(0===t.length)return new this.Collection(this);try{t.sort(this._ascending)}catch(t){return sn(this,Fe)}var e=t.reduce((function(t,e){return t?t.concat([[t[t.length-1][1],e]]):[[Re,e]]}),null);return e.push([t[t.length-1],this.db._maxKey]),this.inAnyRange(e,{includeLowers:!1,includeUppers:!1})},t.prototype.inAnyRange=function(t,e){var n=this,r=this._cmp,o=this._ascending,i=this._descending,a=this._min,u=this._max;if(0===t.length)return fn(this);if(!t.every((function(t){return void 0!==t[0]&&void 0!==t[1]&&o(t[0],t[1])<=0})))return sn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",vt.InvalidArgument);var c=!e||!1!==e.includeLowers,s=e&&!0===e.includeUppers;var f,l=o;function h(t,e){return l(t[0],e[0])}try{f=t.reduce((function(t,e){for(var n=0,o=t.length;n<o;++n){var i=t[n];if(r(e[0],i[1])<0&&r(e[1],i[0])>0){i[0]=a(i[0],e[0]),i[1]=u(i[1],e[1]);break}}return n===o&&t.push(e),t}),[]),f.sort(h)}catch(t){return sn(this,Fe)}var p=0,d=s?function(t){return o(t,f[p][1])>0}:function(t){return o(t,f[p][1])>=0},v=c?function(t){return i(t,f[p][0])>0}:function(t){return i(t,f[p][0])>=0};var y=d,m=new this.Collection(this,(function(){return pn(f[0][0],f[f.length-1][1],!c,!s)}));return m._ondirectionchange=function(t){"next"===t?(y=d,l=o):(y=v,l=i),f.sort(h)},m._addAlgorithm((function(t,e,r){for(var i=t.key;y(i);)if(++p===f.length)return e(r),!1;return!!function(t){return!d(t)&&!v(t)}(i)||(0===n._cmp(i,f[p][1])||0===n._cmp(i,f[p][0])||e((function(){l===o?t.continue(f[p][0]):t.continue(f[p][1])})),!1)})),m},t.prototype.startsWithAnyOf=function(){var t=J.apply($,arguments);return t.every((function(t){return"string"==typeof t}))?0===t.length?fn(this):this.inAnyRange(t.map((function(t){return[t,t+De]}))):sn(this,"startsWithAnyOf() only works with strings")},t}();function yn(t){return 1===t.length?t[0]:t}function mn(t){try{return t.only([[]]),[[]]}catch(t){return De}}function gn(t){return fe((function(e){return bn(e),t(e.target.error),!1}))}function bn(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault()}var wn=function(){function t(){}return t.prototype._lock=function(){return K(!zt.global),++this._reculock,1!==this._reculock||zt.global||(zt.lockOwnerFor=this),this},t.prototype._unlock=function(){if(K(!zt.global),0==--this._reculock)for(zt.global||(zt.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var t=this._blockedFuncs.shift();try{je(t[1],t[0])}catch(t){}}return this},t.prototype._locked=function(){return this._reculock&&zt.lockOwnerFor!==this},t.prototype.create=function(t){var e=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(K(!this.idbtrans),!t&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new vt.DatabaseClosed(r);case"MissingAPIError":throw new vt.MissingAPI(r.message,r);default:throw new vt.OpenFailed(r)}if(!this.active)throw new vt.TransactionInactive;return K(null===this._completion._state),(t=this.idbtrans=t||n.transaction(yn(this.storeNames),this.mode)).onerror=fe((function(n){bn(n),e._reject(t.error)})),t.onabort=fe((function(n){bn(n),e.active&&e._reject(new vt.Abort(t.error)),e.active=!1,e.on("abort").fire(n)})),t.oncomplete=fe((function(){e.active=!1,e._resolve()})),this},t.prototype._promise=function(t,e,n){var r=this;if("readwrite"===t&&"readwrite"!==this.mode)return Ce(new vt.ReadOnly("Transaction is readonly"));if(!this.active)return Ce(new vt.TransactionInactive);if(this._locked())return new Xt((function(o,i){r._blockedFuncs.push([function(){r._promise(t,e,n).then(o,i)},zt])}));if(n)return me((function(){var t=new Xt((function(t,n){r._lock();var o=e(t,n,r);o&&o.then&&o.then(t,n)}));return t.finally((function(){return r._unlock()})),t._lib=!0,t}));var o=new Xt((function(t,n){var o=e(t,n,r);o&&o.then&&o.then(t,n)}));return o._lib=!0,o},t.prototype._root=function(){return this.parent?this.parent._root():this},t.prototype.waitFor=function(t){var e=this._root(),n=Xt.resolve(t);if(e._waitingFor)e._waitingFor=e._waitingFor.then((function(){return n}));else{e._waitingFor=n,e._waitingQueue=[];var r=e.idbtrans.objectStore(e.storeNames[0]);!function t(){for(++e._spinCount;e._waitingQueue.length;)e._waitingQueue.shift()();e._waitingFor&&(r.get(-1/0).onsuccess=t)}()}var o=e._waitingFor;return new Xt((function(t,r){n.then((function(n){return e._waitingQueue.push(fe(t.bind(null,n)))}),(function(t){return e._waitingQueue.push(fe(r.bind(null,t)))})).finally((function(){e._waitingFor===o&&(e._waitingFor=null)}))}))},t.prototype.abort=function(){this.active&&this._reject(new vt.Abort),this.active=!1},t.prototype.table=function(t){var e=this._memoizedTables||(this._memoizedTables={});if(x(e,t))return e[t];var n=this.schema[t];if(!n)throw new vt.NotFound("Table "+t+" not part of transaction");var r=new this.db.Table(t,n,this);return r.core=this.db.core.table(t),e[t]=r,r},t}();function _n(t,e,n,r,o,i,a){return{name:t,keyPath:e,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+xn(e)}}function xn(t){return"string"==typeof t?t:t?"["+[].join.call(t,"+")+"]":""}function kn(t,e,n){return{name:t,primKey:e,indexes:n,mappedClass:null,idxByName:D(n,(function(t){return[t.name,t]}))}}function On(t){return null==t?function(){}:"string"==typeof t?function(t){return 1===t.split(".").length?function(e){return e[t]}:function(e){return R(e,t)}}(t):function(e){return R(e,t)}}function jn(t,e){return"delete"===e.type?e.keys:e.keys||e.values.map(t.extractKey)}function En(t){return[].slice.call(t)}var Pn=0;function Sn(t){return null==t?":id":"string"==typeof t?t:"["+t.join("+")+"]"}function Tn(t,e,n,r){var o=e.cmp.bind(e);function i(t){if(3===t.type)return null;if(4===t.type)throw new Error("Cannot convert never type to IDBKeyRange");var e=t.lower,r=t.upper,o=t.lowerOpen,i=t.upperOpen;return void 0===e?void 0===r?null:n.upperBound(r,!!i):void 0===r?n.lowerBound(e,!!o):n.bound(e,r,!!o,!!i)}var a=function(t,e){var n=En(t.objectStoreNames);return{schema:{name:t.name,tables:n.map((function(t){return e.objectStore(t)})).map((function(t){var e=t.keyPath,n=t.autoIncrement,r=m(e),o=null==e,i={},a={name:t.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:e,autoIncrement:n,unique:!0,extractKey:On(e)},indexes:En(t.indexNames).map((function(e){return t.index(e)})).map((function(t){var e=t.name,n=t.unique,r=t.multiEntry,o=t.keyPath,a={name:e,compound:m(o),keyPath:o,unique:n,multiEntry:r,extractKey:On(o)};return i[Sn(o)]=a,a})),getIndexByKeyPath:function(t){return i[Sn(t)]}};return i[":id"]=a.primaryKey,null!=e&&(i[Sn(e)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in e.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\\/|Edge\\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\\/(\\d*)/))[1]<604)}}(t,r),u=a.schema,c=a.hasGetAll,s=u.tables.map((function(t){return function(t){var e=t.name;return{name:e,schema:t,mutate:function(n){var r=n.trans,o=n.type,a=n.keys,u=n.values,c=n.range,s=n.wantResults;return new Promise((function(n,f){n=fe(n);var l=r.objectStore(e),h=null==l.keyPath,p="put"===o||"add"===o;if(!p&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var d=(a||u||{length:1}).length;if(a&&u&&a.length!==u.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return n({numFailures:0,failures:{},results:[],lastResult:void 0});var y,m=s&&v(a||jn(t.primaryKey,{type:o,keys:a,values:u})),g=[],b=0,w=function(t){++b,bn(t),m&&(m[t.target._reqno]=void 0),g[t.target._reqno]=t.target.error},_=function(t){var e=t.target;m[e._reqno]=e.result};if("deleteRange"===o){if(4===c.type)return n({numFailures:b,failures:g,results:m,lastResult:void 0});y=3===c.type?l.clear():l.delete(i(c))}else{var x=p?h?[u,a]:[u,null]:[a,null],k=x[0],O=x[1];if(p)for(var j=0;j<d;++j)(y=O&&void 0!==O[j]?l[o](k[j],O[j]):l[o](k[j]))._reqno=j,m&&void 0===m[j]&&(y.onsuccess=_),y.onerror=w;else for(j=0;j<d;++j)(y=l[o](k[j]))._reqno=j,y.onerror=w}var E=function(t){var e=t.target.result;m&&(m[d-1]=e),n({numFailures:b,failures:g,results:m,lastResult:e})};y.onerror=function(t){w(t),E(t)},y.onsuccess=E}))},getMany:function(t){var n=t.trans,r=t.keys;return new Promise((function(t,o){t=fe(t);for(var i,a=n.objectStore(e),u=r.length,c=new Array(u),s=0,f=0,l=function(e){var n=e.target;c[n._pos]=n.result,++f===s&&t(c)},h=gn(o),p=0;p<u;++p)null!=r[p]&&((i=a.get(r[p]))._pos=p,i.onsuccess=l,i.onerror=h,++s);0===s&&t(c)}))},get:function(t){var n=t.trans,r=t.key;return new Promise((function(t,o){t=fe(t);var i=n.objectStore(e).get(r);i.onsuccess=function(e){return t(e.target.result)},i.onerror=gn(o)}))},query:function(t){return function(n){return new Promise((function(r,o){r=fe(r);var a=n.trans,u=n.values,c=n.limit,s=n.query,f=c===1/0?void 0:c,l=s.index,h=s.range,p=a.objectStore(e),d=l.isPrimaryKey?p:p.index(l.name),v=i(h);if(0===c)return r({result:[]});if(t){var y=u?d.getAll(v,f):d.getAllKeys(v,f);y.onsuccess=function(t){return r({result:t.target.result})},y.onerror=gn(o)}else{var m=0,g=u||!("openKeyCursor"in d)?d.openCursor(v):d.openKeyCursor(v),b=[];g.onsuccess=function(t){var e=g.result;return e?(b.push(u?e.value:e.primaryKey),++m===c?r({result:b}):void e.continue()):r({result:b})},g.onerror=gn(o)}}))}}(c),openCursor:function(t){var n=t.trans,r=t.values,o=t.query,a=t.reverse,u=t.unique;return new Promise((function(t,c){t=fe(t);var s=o.index,f=o.range,l=n.objectStore(e),h=s.isPrimaryKey?l:l.index(s.name),p=a?u?"prevunique":"prev":u?"nextunique":"next",d=r||!("openKeyCursor"in h)?h.openCursor(i(f),p):h.openKeyCursor(i(f),p);d.onerror=gn(c),d.onsuccess=fe((function(e){var r=d.result;if(r){r.___id=++Pn,r.done=!1;var o=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));var a=r.advance.bind(r),u=function(){throw new Error("Cursor not stopped")};r.trans=n,r.stop=r.continue=r.continuePrimaryKey=r.advance=function(){throw new Error("Cursor not started")},r.fail=fe(c),r.next=function(){var t=this,e=1;return this.start((function(){return e--?t.continue():t.stop()})).then((function(){return t}))},r.start=function(t){var e=new Promise((function(t,e){t=fe(t),d.onerror=gn(e),r.fail=e,r.stop=function(e){r.stop=r.continue=r.continuePrimaryKey=r.advance=u,t(e)}})),n=function(){if(d.result)try{t()}catch(t){r.fail(t)}else r.done=!0,r.start=function(){throw new Error("Cursor behind last entry")},r.stop()};return d.onsuccess=fe((function(t){d.onsuccess=n,n()})),r.continue=o,r.continuePrimaryKey=i,r.advance=a,n(),e},t(r)}else t(null)}),c)}))},count:function(t){var n=t.query,r=t.trans,o=n.index,a=n.range;return new Promise((function(t,n){var u=r.objectStore(e),c=o.isPrimaryKey?u:u.index(o.name),s=i(a),f=s?c.count(s):c.count();f.onsuccess=fe((function(e){return t(e.target.result)})),f.onerror=gn(n)}))}}}(t)})),f={};return s.forEach((function(t){return f[t.name]=t})),{stack:"dbcore",transaction:t.transaction.bind(t),table:function(t){if(!f[t])throw new Error("Table \'"+t+"\' not found");return f[t]},cmp:o,MIN_KEY:-1/0,MAX_KEY:mn(n),schema:u}}function An(t,e,n,r){var o=n.IDBKeyRange,i=function(t,e){return e.reduce((function(t,e){var n=e.create;return d(d({},t),n(t))}),t)}(Tn(e,n.indexedDB,o,r),t.dbcore);return{dbcore:i}}function Cn(t,e){var n=e.db,r=An(t._middlewares,n,t._deps,e);t.core=r.dbcore,t.tables.forEach((function(e){var n=e.name;t.core.schema.tables.some((function(t){return t.name===n}))&&(e.core=t.core.table(n),t[n]instanceof t.Table&&(t[n].core=e.core))}))}function Kn(t,e,n,r){n.forEach((function(n){var o=r[n];e.forEach((function(e){var r=S(e,n);(!r||"value"in r&&void 0===r.value)&&(e===t.Transaction.prototype||e instanceof t.Transaction?j(e,n,{get:function(){return this.table(n)},set:function(t){O(this,n,{value:t,writable:!0,configurable:!0,enumerable:!0})}}):e[n]=new t.Table(n,o))}))}))}function In(t,e){e.forEach((function(e){for(var n in e)e[n]instanceof t.Table&&delete e[n]}))}function Dn(t,e){return t._cfg.version-e._cfg.version}function Rn(t,e,n,r){var o=t._dbSchema,i=t._createTransaction("readwrite",t._storeNames,o);i.create(n),i._completion.catch(r);var a=i._reject.bind(i),u=zt.transless||zt;me((function(){zt.trans=i,zt.transless=u,0===e?(y(o).forEach((function(t){Bn(n,t,o[t].primKey,o[t].indexes)})),Cn(t,n),Xt.follow((function(){return t.on.populate.fire(i)})).catch(a)):function(t,e,n,r){var o=[],i=t._versions,a=t._dbSchema=Mn(t,t.idbdb,r),u=!1;function c(){return o.length?Xt.resolve(o.shift()(n.idbtrans)).then(c):Xt.resolve()}return i.filter((function(t){return t._cfg.version>=e})).forEach((function(i){o.push((function(){var o=a,c=i._cfg.dbschema;qn(t,o,r),qn(t,c,r),a=t._dbSchema=c;var s=Fn(o,c);s.add.forEach((function(t){Bn(r,t[0],t[1].primKey,t[1].indexes)})),s.change.forEach((function(t){if(t.recreate)throw new vt.Upgrade("Not yet support for changing primary key");var e=r.objectStore(t.name);t.add.forEach((function(t){return Nn(e,t)})),t.change.forEach((function(t){e.deleteIndex(t.name),Nn(e,t)})),t.del.forEach((function(t){return e.deleteIndex(t)}))}));var f=i._cfg.contentUpgrade;if(f&&i._cfg.version>e){Cn(t,r),n._memoizedTables={},u=!0;var l=N(c);s.del.forEach((function(t){l[t]=o[t]})),In(t,[t.Transaction.prototype]),Kn(t,[t.Transaction.prototype],y(l),l),n.schema=l;var h,p=Z(f);p&&ge();var d=Xt.follow((function(){if((h=f(n))&&p){var t=be.bind(null,null);h.then(t,t)}}));return h&&"function"==typeof h.then?Xt.resolve(h):d.then((function(){return h}))}})),o.push((function(e){u&&qe||function(t,e){for(var n=0;n<e.db.objectStoreNames.length;++n){var r=e.db.objectStoreNames[n];null==t[r]&&e.db.deleteObjectStore(r)}}(i._cfg.dbschema,e);In(t,[t.Transaction.prototype]),Kn(t,[t.Transaction.prototype],t._storeNames,t._dbSchema),n.schema=t._dbSchema}))})),c().then((function(){var t,e;e=r,y(t=a).forEach((function(n){e.db.objectStoreNames.contains(n)||Bn(e,n,t[n].primKey,t[n].indexes)}))}))}(t,e,i,n).catch(a)}))}function Fn(t,e){var n,r={del:[],add:[],change:[]};for(n in t)e[n]||r.del.push(n);for(n in e){var o=t[n],i=e[n];if(o){var a={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!Me)a.recreate=!0,r.change.push(a);else{var u=o.idxByName,c=i.idxByName,s=void 0;for(s in u)c[s]||a.del.push(s);for(s in c){var f=u[s],l=c[s];f?f.src!==l.src&&a.change.push(l):a.add.push(l)}(a.del.length>0||a.add.length>0||a.change.length>0)&&r.change.push(a)}}else r.add.push([n,i])}return r}function Bn(t,e,n,r){var o=t.db.createObjectStore(e,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(t){return Nn(o,t)})),o}function Nn(t,e){t.createIndex(e.name,e.keyPath,{unique:e.unique,multiEntry:e.multi})}function Mn(t,e,n){var r={};return A(e.objectStoreNames,0).forEach((function(t){for(var e=n.objectStore(t),o=e.keyPath,i=_n(xn(o),o||"",!1,!1,!!e.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<e.indexNames.length;++u){var c=e.index(e.indexNames[u]);o=c.keyPath;var s=_n(c.name,o,!!c.unique,!!c.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(s)}r[t]=kn(t,i,a)})),r}function qn(t,e,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var i=r[o],a=n.objectStore(i);t._hasGetAll="getAll"in a;for(var u=0;u<a.indexNames.length;++u){var c=a.indexNames[u],s=a.index(c).keyPath,f="string"==typeof s?s:"["+A(s).join("+")+"]";if(e[i]){var l=e[i].idxByName[f];l&&(l.name=c,delete e[i].idxByName[f],e[i].idxByName[c]=l)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\\/|Edge\\/)/.test(navigator.userAgent)&&g.WorkerGlobalScope&&g instanceof g.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\\/(\\d*)/))[1]<604&&(t._hasGetAll=!1)}var Ln,Un=function(){function t(){}return t.prototype._parseStoresSpec=function(t,e){y(t).forEach((function(n){if(null!==t[n]){var r=t[n].split(",").map((function(t,e){var n=(t=t.trim()).replace(/([&*]|\\+\\+)/g,""),r=/^\\[/.test(n)?n.match(/^\\[(.*)\\]$/)[1].split("+"):n;return _n(n,r||null,/\\&/.test(t),/\\*/.test(t),/\\+\\+/.test(t),m(r),0===e)})),o=r.shift();if(o.multi)throw new vt.Schema("Primary key cannot be multi-valued");r.forEach((function(t){if(t.auto)throw new vt.Schema("Only primary key can be marked as autoIncrement (++)");if(!t.keyPath)throw new vt.Schema("Index must have a name and cannot be an empty string")})),e[n]=kn(n,o,r)}}))},t.prototype.stores=function(t){var e=this.db;this._cfg.storesSource=this._cfg.storesSource?b(this._cfg.storesSource,t):t;var n=e._versions,r={},o={};return n.forEach((function(t){b(r,t._cfg.storesSource),o=t._cfg.dbschema={},t._parseStoresSpec(r,o)})),e._dbSchema=o,In(e,[e._allTables,e,e.Transaction.prototype]),Kn(e,[e._allTables,e,e.Transaction.prototype,this._cfg.tables],y(o),o),e._storeNames=y(o),this},t.prototype.upgrade=function(t){return this._cfg.contentUpgrade=t,this},t}();function Gn(t){return me((function(){return zt.letThrough=!0,t()}))}function Wn(t){var e=t._state,n=t._deps.indexedDB;if(e.isBeingOpened||t.idbdb)return e.dbReadyPromise.then((function(){return e.dbOpenError?Ce(e.dbOpenError):t}));tt&&(e.openCanceller._stackHolder=ot()),e.isBeingOpened=!0,e.dbOpenError=null,e.openComplete=!1;var r=e.dbReadyResolve,o=null;return Xt.race([e.openCanceller,new Xt((function(r,i){if(!n)throw new vt.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 a=t.name,u=e.autoSchema?n.open(a):n.open(a,Math.round(10*t.verno));if(!u)throw new vt.MissingAPI("IndexedDB API not available");u.onerror=gn(i),u.onblocked=fe(t._fireOnBlocked),u.onupgradeneeded=fe((function(r){if(o=u.transaction,e.autoSchema&&!t._options.allowEmptyDB){u.onerror=bn,o.abort(),u.result.close();var c=n.deleteDatabase(a);c.onsuccess=c.onerror=fe((function(){i(new vt.NoSuchDatabase("Database "+a+" doesnt exist"))}))}else{o.onerror=gn(i);var s=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;t.idbdb=u.result,Rn(t,s/10,o,i)}}),i),u.onsuccess=fe((function(){o=null;var n=t.idbdb=u.result,i=A(n.objectStoreNames);if(i.length>0)try{var c=n.transaction(yn(i),"readonly");e.autoSchema?function(t,e,n){t.verno=e.version/10;var r=t._dbSchema=Mn(0,e,n);t._storeNames=A(e.objectStoreNames,0),Kn(t,[t._allTables],y(r),r)}(t,n,c):(qn(t,t._dbSchema,c),function(t,e){var n=Fn(Mn(0,t.idbdb,e),t._dbSchema);return!(n.add.length||n.change.some((function(t){return t.add.length||t.change.length})))}(t,c)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Cn(t,c)}catch(t){}Ne.push(t),n.onversionchange=fe((function(n){e.vcFired=!0,t.on("versionchange").fire(n)})),Ln.add(a),r()}),i)}))]).then((function(){return e.onReadyBeingFired=[],Xt.resolve(Gn(t.on.ready.fire)).then((function t(){if(e.onReadyBeingFired.length>0){var n=e.onReadyBeingFired.reduce(Et,gt);return e.onReadyBeingFired=[],Xt.resolve(Gn(n)).then(t)}}))})).finally((function(){e.onReadyBeingFired=null})).then((function(){return e.isBeingOpened=!1,t})).catch((function(n){try{o&&o.abort()}catch(t){}return e.isBeingOpened=!1,t.close(),e.dbOpenError=n,Ce(e.dbOpenError)})).finally((function(){e.openComplete=!0,r()}))}function zn(t){var e=function(e){return t.next(e)},n=o(e),r=o((function(e){return t.throw(e)}));function o(t){return function(e){var o=t(e),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):m(i)?Promise.all(i).then(n,r):n(i)}}return o(e)()}function Vn(t,e,n){var r=arguments.length;if(r<2)throw new vt.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];n=o.pop();var i=q(o);return[t,i,n]}function Yn(t,e,n,r,o){return Xt.resolve().then((function(){var i=zt.transless||zt,a=t._createTransaction(e,n,t._dbSchema,r),u={trans:a,transless:i};r?a.idbtrans=r.idbtrans:a.create();var c,s=Z(o);s&&ge();var f=Xt.follow((function(){if(c=o.call(a,a))if(s){var t=be.bind(null,null);c.then(t,t)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=zn(c))}),u);return(c&&"function"==typeof c.then?Xt.resolve(c).then((function(t){return a.active?t:Ce(new vt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):f.then((function(){return c}))).then((function(t){return r&&a._resolve(),a._completion.then((function(){return t}))})).catch((function(t){return a._reject(t),Ce(t)}))}))}function Hn(t,e,n){for(var r=m(t)?t.slice():[t],o=0;o<n;++o)r.push(e);return r}var Xn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(t){return d(d({},t),{table:function(e){var n=t.table(e),r=n.schema,o={},i=[];function a(t,e,n){var r=Sn(t),u=o[r]=o[r]||[],c=null==t?0:"string"==typeof t?1:t.length,s=e>0,f=d(d({},n),{isVirtual:s,isPrimaryKey:!s&&n.isPrimaryKey,keyTail:e,keyLength:c,extractKey:On(t),unique:!s&&n.unique});(u.push(f),f.isPrimaryKey||i.push(f),c>1)&&a(2===c?t[0]:t.slice(0,c-1),e+1,n);return u.sort((function(t,e){return t.keyTail-e.keyTail})),f}var u=a(r.primaryKey.keyPath,0,r.primaryKey);o[":id"]=[u];for(var c=0,s=r.indexes;c<s.length;c++){var f=s[c];a(f.keyPath,0,f)}function l(e){var n,r,o=e.query.index;return o.isVirtual?d(d({},e),{query:{index:o,range:(n=e.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:Hn(n.lower,n.lowerOpen?t.MAX_KEY:t.MIN_KEY,r),lowerOpen:!0,upper:Hn(n.upper,n.upperOpen?t.MIN_KEY:t.MAX_KEY,r),upperOpen:!0})}}):e}var h=d(d({},n),{schema:d(d({},r),{primaryKey:u,indexes:i,getIndexByKeyPath:function(t){var e=o[Sn(t)];return e&&e[0]}}),count:function(t){return n.count(l(t))},query:function(t){return n.query(l(t))},openCursor:function(e){var r=e.query.index,o=r.keyTail,i=r.isVirtual,a=r.keyLength;if(!i)return n.openCursor(e);return n.openCursor(l(e)).then((function(n){return n&&function(n){var r=Object.create(n,{continue:{value:function(r){null!=r?n.continue(Hn(r,e.reverse?t.MAX_KEY:t.MIN_KEY,o)):e.unique?n.continue(Hn(n.key,e.reverse?t.MIN_KEY:t.MAX_KEY,o)):n.continue()}},continuePrimaryKey:{value:function(e,r){n.continuePrimaryKey(Hn(e,t.MAX_KEY,o),r)}},key:{get:function(){var t=n.key;return 1===a?t[0]:t.slice(0,a)}},value:{get:function(){return n.value}}});return r}(n)}))}});return h}})}},Qn={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(t){return d(d({},t),{table:function(e){var n=t.table(e),r=n.schema.primaryKey,o=d(d({},n),{mutate:function(t){var o=zt.trans,i=o.table(e).hook,a=i.deleting,u=i.creating,c=i.updating;switch(t.type){case"add":if(u.fire===gt)break;return o._promise("readwrite",(function(){return s(t)}),!0);case"put":if(u.fire===gt&&c.fire===gt)break;return o._promise("readwrite",(function(){return s(t)}),!0);case"delete":if(a.fire===gt)break;return o._promise("readwrite",(function(){return s(t)}),!0);case"deleteRange":if(a.fire===gt)break;return o._promise("readwrite",(function(){return function(t){return f(t.trans,t.range,1e4)}(t)}),!0)}return n.mutate(t);function s(t){var e=zt.trans,o=t.keys||jn(r,t);if(!o)throw new Error("Keys missing");return"delete"!==(t="add"===t.type||"put"===t.type?d(d({},t),{keys:o,wantResults:!0}):d({},t)).type&&(t.values=v(t.values)),t.keys&&(t.keys=v(t.keys)),function(t,e,n){return"add"===e.type?Promise.resolve(new Array(e.values.length)):t.getMany({trans:e.trans,keys:n})}(n,t,o).then((function(i){var s=o.map((function(n,o){var s=i[o],f={onerror:null,onsuccess:null};if("delete"===t.type)a.fire.call(f,n,s,e);else if("add"===t.type||void 0===s){var l=u.fire.call(f,n,t.values[o],e);null==n&&null!=l&&(n=l,t.keys[o]=n,r.outbound||F(t.values[o],r.keyPath,n))}else{var h=H(s,t.values[o]),p=c.fire.call(f,h,n,s,e);if(p){var d=t.values[o];Object.keys(p).forEach((function(t){x(d,t)?d[t]=p[t]:F(d,t,p[t])}))}}return f}));return n.mutate(t).then((function(e){for(var n=e.failures,r=e.results,a=e.numFailures,u=e.lastResult,c=0;c<o.length;++c){var f=r?r[c]:o[c],l=s[c];null==f?l.onerror&&l.onerror(n[c]):l.onsuccess&&l.onsuccess("put"===t.type&&i[c]?t.values[c]:f)}return{failures:n,results:r,numFailures:a,lastResult:u}})).catch((function(t){return s.forEach((function(e){return e.onerror&&e.onerror(t)})),Promise.reject(t)}))}))}function f(t,e,o){return n.query({trans:t,values:!1,query:{index:r,range:e},limit:o}).then((function(n){var r=n.result;return s({type:"delete",keys:r,trans:t}).then((function(n){return n.numFailures>0?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:f(t,d(d({},e),{lower:r[r.length-1],lowerOpen:!0}),o)}))}))}}});return o}})}},$n=function(){function t(e,n){var r=this;this._middlewares={},this.verno=0;var o=t.dependencies;this._options=n=d({addons:t.addons,autoOpen:!0,indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var i=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null;var a={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:gt,dbReadyPromise:null,cancelOpen:gt,openCanceller:null,autoSchema:!0};a.dbReadyPromise=new Xt((function(t){a.dbReadyResolve=t})),a.openCanceller=new Xt((function(t,e){a.cancelOpen=e})),this._state=a,this.name=e,this.on=Qe(this,"populate","blocked","versionchange",{ready:[Et,gt]}),this.on.ready.subscribe=C(this.on.ready.subscribe,(function(e){return function(n,o){t.vip((function(){var t=r._state;if(t.openComplete)t.dbOpenError||Xt.resolve().then(n),o&&e(n);else if(t.onReadyBeingFired)t.onReadyBeingFired.push(n),o&&e(n);else{e(n);var i=r;o||e((function t(){i.on.ready.unsubscribe(n),i.on.ready.unsubscribe(t)}))}}))}})),this.Collection=function(t){return $e(an.prototype,(function(e,n){this.db=t;var r=Ye,o=null;if(n)try{r=n()}catch(t){o=t}var i=e._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:r,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!==bt?u:null}}))}(this),this.Table=function(t){return $e(Xe.prototype,(function(e,n,r){this.db=t,this._tx=r,this.name=e,this.schema=n,this.hook=t._allTables[e]?t._allTables[e].hook:Qe(null,{creating:[xt,gt],reading:[wt,bt],updating:[Ot,gt],deleting:[kt,gt]})}))}(this),this.Transaction=function(t){return $e(wn.prototype,(function(e,n,r,o){var i=this;this.db=t,this.mode=e,this.storeNames=n,this.schema=r,this.idbtrans=null,this.on=Qe(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 Xt((function(t,e){i._resolve=t,i._reject=e})),this._completion.then((function(){i.active=!1,i.on.complete.fire()}),(function(t){var e=i.active;return i.active=!1,i.on.error.fire(t),i.parent?i.parent._reject(t):e&&i.idbtrans&&i.idbtrans.abort(),Ce(t)}))}))}(this),this.Version=function(t){return $e(Un.prototype,(function(e){this.db=t,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(t){return $e(vn.prototype,(function(e,n,r){this.db=t,this._ctx={table:e,index:":id"===n?null:n,or:r};var o=t._deps.indexedDB;if(!o)throw new vt.MissingAPI("indexedDB API missing");this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(t,e){return o.cmp(e,t)},this._max=function(t,e){return o.cmp(t,e)>0?t:e},this._min=function(t,e){return o.cmp(t,e)<0?t:e},this._IDBKeyRange=t._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(t){t.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(t){!t.newVersion||t.newVersion<t.oldVersion?console.warn("Dexie.delete(\'"+r.name+"\') was blocked"):console.warn("Upgrade \'"+r.name+"\' blocked by other connection holding version "+t.oldVersion/10)})),this._maxKey=mn(n.IDBKeyRange),this._createTransaction=function(t,e,n,o){return new r.Transaction(t,e,n,o)},this._fireOnBlocked=function(t){r.on("blocked").fire(t),Ne.filter((function(t){return t.name===r.name&&t!==r&&!t._state.vcFired})).map((function(e){return e.on("versionchange").fire(t)}))},this.use(Xn),this.use(Qn),i.forEach((function(t){return t(r)}))}return t.prototype.version=function(t){if(isNaN(t)||t<.1)throw new vt.Type("Given version is not a positive number");if(t=Math.round(10*t)/10,this.idbdb||this._state.isBeingOpened)throw new vt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,t);var e=this._versions,n=e.filter((function(e){return e._cfg.version===t}))[0];return n||(n=new this.Version(t),e.push(n),e.sort(Dn),n.stores({}),this._state.autoSchema=!1,n)},t.prototype._whenReady=function(t){var e=this;return this._state.openComplete||zt.letThrough?t():new Xt((function(t,n){if(!e._state.isBeingOpened){if(!e._options.autoOpen)return void n(new vt.DatabaseClosed);e.open().catch(gt)}e._state.dbReadyPromise.then(t,n)})).then(t)},t.prototype.use=function(t){var e=t.stack,n=t.create,r=t.level,o=t.name;o&&this.unuse({stack:e,name:o});var i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:n,level:null==r?10:r,name:o}),i.sort((function(t,e){return t.level-e.level})),this},t.prototype.unuse=function(t){var e=t.stack,n=t.name,r=t.create;return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((function(t){return r?t.create!==r:!!n&&t.name!==n}))),this},t.prototype.open=function(){return Wn(this)},t.prototype.close=function(){var t=Ne.indexOf(this),e=this._state;if(t>=0&&Ne.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(t){}this.idbdb=null}this._options.autoOpen=!1,e.dbOpenError=new vt.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError),e.dbReadyPromise=new Xt((function(t){e.dbReadyResolve=t})),e.openCanceller=new Xt((function(t,n){e.cancelOpen=n}))},t.prototype.delete=function(){var t=this,e=arguments.length>0,n=this._state;return new Xt((function(r,o){var i=function(){t.close();var e=t._deps.indexedDB.deleteDatabase(t.name);e.onsuccess=fe((function(){Ln.remove(t.name),r()})),e.onerror=gn(o),e.onblocked=t._fireOnBlocked};if(e)throw new vt.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(i):i()}))},t.prototype.backendDB=function(){return this.idbdb},t.prototype.isOpen=function(){return null!==this.idbdb},t.prototype.hasBeenClosed=function(){var t=this._state.dbOpenError;return t&&"DatabaseClosed"===t.name},t.prototype.hasFailed=function(){return null!==this._state.dbOpenError},t.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(t.prototype,"tables",{get:function(){var t=this;return y(this._allTables).map((function(e){return t._allTables[e]}))},enumerable:!0,configurable:!0}),t.prototype.transaction=function(){var t=Vn.apply(this,arguments);return this._transaction.apply(this,t)},t.prototype._transaction=function(t,e,n){var r=this,o=zt.trans;o&&o.db===this&&-1===t.indexOf("!")||(o=null);var i,a,u=-1!==t.indexOf("?");t=t.replace("!","").replace("?","");try{if(a=e.map((function(t){var e=t instanceof r.Table?t.name:t;if("string"!=typeof e)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e})),"r"==t||t===We)i=We;else{if("rw"!=t&&t!=ze)throw new vt.InvalidArgument("Invalid transaction mode: "+t);i=ze}if(o){if(o.mode===We&&i===ze){if(!u)throw new vt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach((function(t){if(o&&-1===o.storeNames.indexOf(t)){if(!u)throw new vt.SubTransaction("Table "+t+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(t){return o?o._promise(null,(function(e,n){n(t)})):Ce(t)}var c=Yn.bind(null,this,i,a,o,n);return o?o._promise(i,c,"lock"):zt.trans?je(zt.transless,(function(){return r._whenReady(c)})):this._whenReady(c)},t.prototype.table=function(t){if(!x(this._allTables,t))throw new vt.InvalidTable("Table "+t+" does not exist");return this._allTables[t]},t}(),Jn=$n;k(Jn,d(d({},mt),{delete:function(t){return new Jn(t).delete()},exists:function(t){return new Jn(t,{addons:[]}).open().then((function(t){return t.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(t){return Ln?Ln.getDatabaseNames().then(t):Xt.resolve([])},defineClass:function(){return function(t){b(this,t)}},ignoreTransaction:function(t){return zt.trans?je(zt.transless,t):t()},vip:Gn,async:function(t){return function(){try{var e=zn(t.apply(this,arguments));return e&&"function"==typeof e.then?e:Xt.resolve(e)}catch(t){return Ce(t)}}},spawn:function(t,e,n){try{var r=zn(t.apply(n,e||[]));return r&&"function"==typeof r.then?r:Xt.resolve(r)}catch(t){return Ce(t)}},currentTransaction:{get:function(){return zt.trans||null}},waitFor:function(t,e){var n=Xt.resolve("function"==typeof t?Jn.ignoreTransaction(t):t).timeout(e||6e4);return zt.trans?zt.trans.waitFor(n):n},Promise:Xt,debug:{get:function(){return tt},set:function(t){et(t,"dexie"===t?function(){return!0}:Ue)}},derive:E,extend:b,props:k,override:C,Events:Qe,getByKeyPath:R,setByKeyPath:F,delByKeyPath:B,shallowClone:N,deepClone:W,getObjectDiff:H,asap:I,minKey:Re,addons:[],connections:Ne,errnames:pt,dependencies:function(){try{return{indexedDB:g.indexedDB||g.mozIndexedDB||g.webkitIndexedDB||g.msIndexedDB,IDBKeyRange:g.IDBKeyRange||g.webkitIDBKeyRange}}catch(t){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:Ie,version:Ie.split(".").map((function(t){return parseInt(t)})).reduce((function(t,e,n){return t+e/Math.pow(10,2*n)})),default:Jn,Dexie:Jn})),Jn.maxKey=mn(Jn.dependencies.IDBKeyRange),function(t){try{Ln=function(t){var e,n=t&&"function"==typeof t.databases;if(!n){var r=new $n(Ge,{addons:[]});r.version(1).stores({dbnames:"name"}),e=r.table("dbnames")}return{getDatabaseNames:function(){return n?Xt.resolve(t.databases()).then((function(t){return t.map((function(t){return t.name})).filter((function(t){return t!==Ge}))})):e.toCollection().primaryKeys()},add:function(t){return!n&&t!==Ge&&e.put({name:t}).catch(gt)},remove:function(t){return!n&&t!==Ge&&e.delete(t).catch(gt)}}}(t)}catch(t){}}($n.dependencies.indexedDB),Xt.rejectionMapper=function(t,e){if(!t||t instanceof st||t instanceof TypeError||t instanceof SyntaxError||!t.name||!yt[t.name])return t;var n=new yt[t.name](e||t.message,t);return"stack"in t&&j(n,"stack",{get:function(){return this.inner.stack}}),n},et(tt,Ue);function Zn(t){var e=function(){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(t){return!1}}();return function(){var n,r=p(t);if(e){var o=p(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}var tr=new(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(n,t);var e=Zn(n);function n(){var t;return u(this,n),(t=e.call(this,"AgoraLogger")).logs=void 0,t.openDatabase(),t.logs=t.table("logs"),t}return s(n,[{key:"openDatabase",value:function(){this.version(1).stores({logs:"++id, content, created_at"})}}]),n}($n)),er=(n(1539),n(8674),function(){function t(){u(this,t),this.mutex=Promise.resolve()}var n;return s(t,[{key:"lock",value:function(){var t=function(t){};return this.mutex=this.mutex.then((function(){return new Promise(t)})),new Promise((function(e){t=e}))}},{key:"dispatch",value:(n=e(o().mark((function t(e){var n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.lock();case 2:return n=t.sent,t.prev=3,t.next=6,Promise.resolve(e());case 6:return t.abrupt("return",t.sent);case 7:return t.prev=7,n(),t.finish(7);case 10:case"end":return t.stop()}}),t,this,[[3,,7,10]])}))),function(t){return n.apply(this,arguments)})}]),t}());console.log("[log worker] log worker initialzied");var nr=self,rr=new er,or=[],ir=function(){var t;(t=console).debug.apply(t,arguments)},ar=a()((function(){rr.dispatch(e(o().mark((function t(){var e,n,r,i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=(new Date).getTime(),n=or,or=[],t.prev=3,t.next=6,tr.logs.count();case 6:if(r=t.sent,!((i=n.length+r-5e4)>0)){t.next=12;break}return t.next=11,tr.logs.orderBy(":id").reverse().limit(i).delete();case 11:console.debug("[log worker] clear ".concat(i," records"));case 12:t.next=17;break;case 14:t.prev=14,t.t0=t.catch(3),console.error("[log worker] clear db failed");case 17:return t.prev=17,t.next=20,tr.logs.bulkPut(n);case 20:t.next=25;break;case 22:t.prev=22,t.t1=t.catch(17),console.error("[log worker] bulkPut ".concat(n.length," failed"));case 25:a=(new Date).getTime(),ir("[log worker] done writing ".concat(n.length," records in ").concat(a-e,"ms"));case 27:case"end":return t.stop()}}),t,null,[[3,14],[17,22]])}))))}),2e3,{maxWait:3e4});nr.onmessage=function(){var t=e(o().mark((function t(e){var n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.data&&"log"===e.data.type&&(n=new Date,or.push({content:e.data.data,created_at:+Date.now(),timestamp:"".concat(n)}),ar());case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})()})();',"Worker",void 0,__webpack_require__.p+"index.worker.js")}var O=function(){return O=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},O.apply(this,arguments)};function N(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}var x=Object.keys,D=Array.isArray,L="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function P(e,t){return"object"!=typeof t||x(t).forEach((function(r){e[r]=t[r]})),e}"undefined"==typeof Promise||L.Promise||(L.Promise=Promise);var B=Object.getPrototypeOf,M={}.hasOwnProperty;function j(e,t){return M.call(e,t)}function U(e,t){"function"==typeof t&&(t=t(B(e))),x(t).forEach((function(r){Q(e,r,t[r])}))}var F=Object.defineProperty;function Q(e,t,r,n){F(e,t,P(r&&j(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function q(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Q(e.prototype,"constructor",e),{extend:U.bind(null,e.prototype)}}}}var G=Object.getOwnPropertyDescriptor;function V(e,t){var r;return G(e,t)||(r=B(e))&&V(r,t)}var K=[].slice;function H(e,t,r){return K.call(e,t,r)}function z(e,t){return t(e)}function W(e){if(!e)throw new Error("Assertion Failed")}function Y(e){L.setImmediate?setImmediate(e):setTimeout(e,0)}function J(e,t){return e.reduce((function(e,r,n){var i=t(r,n);return i&&(e[i[0]]=i[1]),e}),{})}function X(e,t){if(j(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,i=t.length;n<i;++n){var o=X(e,t[n]);r.push(o)}return r}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return void 0===s?void 0:X(s,t.substr(a+1))}}function Z(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){W("string"!=typeof r&&"length"in r);for(var n=0,i=t.length;n<i;++n)Z(e,t[n],r[n])}else{var o=t.indexOf(".");if(-1!==o){var a=t.substr(0,o),s=t.substr(o+1);if(""===s)void 0===r?D(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=r;else{var c=e[a];c||(c=e[a]={}),Z(c,s,r)}}else void 0===r?D(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function $(e,t){"string"==typeof t?Z(e,t,void 0):"length"in t&&[].map.call(t,(function(t){Z(e,t,void 0)}))}function ee(e){var t={};for(var r in e)j(e,r)&&(t[r]=e[r]);return t}var te=[].concat;function re(e){return te.apply([],e)}var ne="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(re([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return L[e]})),ie=ne.map((function(e){return L[e]})),oe=J(ne,(function(e){return[e,!0]}));function ae(e){if(!e||"object"!=typeof e)return e;var t;if(D(e)){t=[];for(var r=0,n=e.length;r<n;++r)t.push(ae(e[r]))}else if(ie.indexOf(e.constructor)>=0)t=e;else for(var i in t=e.constructor?Object.create(e.constructor.prototype):{},e)j(e,i)&&(t[i]=ae(e[i]));return t}var se={}.toString;function ce(e){return se.call(e).slice(8,-1)}var ue=function(e,t){return"Array"===t?""+e.map((function(e){return ue(e,ce(e))})):"ArrayBuffer"===t?""+new Uint8Array(e):"Date"===t?e.getTime():ArrayBuffer.isView(e)?""+new Uint8Array(e.buffer):e};function le(e,t,r,n){return r=r||{},n=n||"",x(e).forEach((function(i){if(j(t,i)){var o=e[i],a=t[i];if("object"==typeof o&&"object"==typeof a&&o&&a){var s=ce(o),c=ce(a);s===c?oe[s]?ue(o,s)!==ue(a,c)&&(r[n+i]=t[i]):le(o,a,r,n+i+"."):r[n+i]=t[i]}else o!==a&&(r[n+i]=t[i])}else r[n+i]=void 0})),x(t).forEach((function(i){j(e,i)||(r[n+i]=t[i])})),r}var he="undefined"!=typeof Symbol&&Symbol.iterator,fe=he?function(e){var t;return null!=e&&(t=e[he])&&t.apply(e)}:function(){return null},de={};function pe(e){var t,r,n,i;if(1===arguments.length){if(D(e))return e.slice();if(this===de&&"string"==typeof e)return[e];if(i=fe(e)){for(r=[];!(n=i.next()).done;)r.push(n.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 ge="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},ve="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Ae(e,t){ve=e,me=t}var me=function(){return!0},ye=!new Error("").stack;function _e(){if(ye)try{throw new Error}catch(e){return e}return new Error}function be(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(me).map((function(e){return"\n"+e})).join("")):""}var Ee=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],we=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ee),Ie={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function Ce(e,t){this._e=_e(),this.name=e,this.message=t}function Se(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 Te(e,t,r,n){this._e=_e(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=Se(e,t)}function Re(e,t){this._e=_e(),this.name="BulkError",this.failures=t,this.message=Se(e,t)}q(Ce).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+be(this._e,2))}},toString:function(){return this.name+": "+this.message}}),q(Te).from(Ce),q(Re).from(Ce);var ke=we.reduce((function(e,t){return e[t]=t+"Error",e}),{}),Oe=Ce,Ne=we.reduce((function(e,t){var r=t+"Error";function n(e,n){this._e=_e(),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=Ie[t]||r,this.inner=null)}return q(n).from(Oe),e[t]=n,e}),{});Ne.Syntax=SyntaxError,Ne.Type=TypeError,Ne.Range=RangeError;var xe=Ee.reduce((function(e,t){return e[t+"Error"]=Ne[t],e}),{});var De=we.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Ne[t]),e}),{});function Le(){}function Pe(e){return e}function Be(e,t){return null==e||e===Pe?t:function(r){return t(e(r))}}function Me(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function je(e,t){return e===Le?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?Me(n,this.onsuccess):n),i&&(this.onerror=this.onerror?Me(i,this.onerror):i),void 0!==o?o:r}}function Ue(e,t){return e===Le?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?Me(r,this.onsuccess):r),n&&(this.onerror=this.onerror?Me(n,this.onerror):n)}}function Fe(e,t){return e===Le?t:function(r){var n=e.apply(this,arguments);P(r,n);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?Me(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Me(o,this.onerror):o),void 0===n?void 0===a?void 0:a:P(n,a)}}function Qe(e,t){return e===Le?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function qe(e,t){return e===Le?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return r.then((function(){return t.apply(n,o)}))}return t.apply(this,arguments)}}De.ModifyError=Te,De.DexieError=Ce,De.BulkError=Re;var Ge={},Ve="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]}(),Ke=Ve[0],He=Ve[1],ze=Ve[2],We=He&&He.then,Ye=Ke&&Ke.constructor,Je=!!ze,Xe=!1,Ze=ze?function(){ze.then(bt)}:L.setImmediate?setImmediate.bind(null,bt):L.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){bt(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(bt,0)},$e=function(e,t){ct.push([e,t]),tt&&(Ze(),tt=!1)},et=!0,tt=!0,rt=[],nt=[],it=null,ot=Pe,at={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Ht,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{Ht(e[0],e[1])}catch(e){}}))}},st=at,ct=[],ut=0,lt=[];function ht(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=Le,this._lib=!1;var t=this._PSD=st;if(ve&&(this._stackHolder=_e(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Ge)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&>(this,this._value))}this._state=null,this._value=null,++t.ref,pt(this,e)}var ft={get:function(){var e=st,t=Nt;function r(r,n){var i=this,o=!e.global&&(e!==st||t!==Nt),a=o&&!Pt(),s=new ht((function(t,s){At(i,new dt(Gt(r,e,o,a),Gt(n,e,o,a),t,s,e))}));return ve&&_t(s,this),s}return r.prototype=Ge,r},set:function(e){Q(this,"then",e&&e.prototype===Ge?ft:{get:function(){return e},set:ft.set})}};function dt(e,t,r,n,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=i}function pt(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&&Et();t&&"function"==typeof t.then?pt(e,(function(e,r){t instanceof ht?t._then(e,r):t.then(e,r)})):(e._state=!0,e._value=t,vt(e)),r&&wt()}}),gt.bind(null,e))}catch(t){gt(e,t)}}function gt(e,t){if(nt.push(t),null===e._state){var r=e._lib&&Et();t=ot(t),e._state=!1,e._value=t,ve&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,r){try{e.apply(null,r)}catch(e){t&&t(e)}}((function(){var r=V(t,"stack");t._promise=e,Q(t,"stack",{get:function(){return Xe?r&&(r.get?r.get.apply(t):r.value):e.stack}})})),function(e){rt.some((function(t){return t._value===e._value}))||rt.push(e)}(e),vt(e),r&&wt()}}function vt(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)At(e,t[r]);var i=e._PSD;--i.ref||i.finalize(),0===ut&&(++ut,$e((function(){0==--ut&&It()}),[]))}function At(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,++ut,$e(mt,[r,e,t])}else e._listeners.push(t)}function mt(e,t,r){try{it=t;var n,i=t._value;t._state?n=e(i):(nt.length&&(nt=[]),n=e(i),-1===nt.indexOf(i)&&function(e){var t=rt.length;for(;t;)if(rt[--t]._value===e._value)return void rt.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{it=null,0==--ut&&It(),--r.psd.ref||r.psd.finalize()}}function yt(e,t,r){if(t.length===r)return t;var n="";if(!1===e._state){var i,o,a=e._value;null!=a?(i=a.name||"Error",o=a.message||a,n=be(a,0)):(i=a,o=""),t.push(i+(o?": "+o:"")+n)}return ve&&((n=be(e._stackHolder,2))&&-1===t.indexOf(n)&&t.push(n),e._prev&&yt(e._prev,t,r)),t}function _t(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function bt(){Et()&&wt()}function Et(){var e=et;return et=!1,tt=!1,e}function wt(){var e,t,r;do{for(;ct.length>0;)for(e=ct,ct=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}}while(ct.length>0);et=!0,tt=!0}function It(){var e=rt;rt=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=lt.slice(0),r=t.length;r;)t[--r]()}function Ct(e){return new ht(Ge,!1,e)}function St(e,t){var r=st;return function(){var n=Et(),i=st;try{return Ut(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Ut(i,!1),n&&wt()}}}U(ht.prototype,{then:ft,_then:function(e,t){At(this,new dt(null,null,e,t,st))},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):Ct(e)})):this.then(null,(function(e){return e&&e.name===t?r(e):Ct(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),Ct(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{Xe=!0;var e=yt(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Xe=!1}}},timeout:function(e,t){var r=this;return e<1/0?new ht((function(n,i){var o=setTimeout((function(){return i(new Ne.Timeout(t))}),e);r.then(n,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&Q(ht.prototype,Symbol.toStringTag,"Dexie.Promise"),at.env=Ft(),U(ht,{all:function(){var e=pe.apply(null,arguments).map(Bt);return new ht((function(t,r){0===e.length&&t([]);var n=e.length;e.forEach((function(i,o){return ht.resolve(i).then((function(r){e[o]=r,--n||t(e)}),r)}))}))},resolve:function(e){if(e instanceof ht)return e;if(e&&"function"==typeof e.then)return new ht((function(t,r){e.then(t,r)}));var t=new ht(Ge,!0,e);return _t(t,it),t},reject:Ct,race:function(){var e=pe.apply(null,arguments).map(Bt);return new ht((function(t,r){e.map((function(e){return ht.resolve(e).then(t,r)}))}))},PSD:{get:function(){return st},set:function(e){return st=e}},totalEchoes:{get:function(){return Nt}},newPSD:Dt,usePSD:Qt,scheduler:{get:function(){return $e},set:function(e){$e=e}},rejectionMapper:{get:function(){return ot},set:function(e){ot=e}},follow:function(e,t){return new ht((function(r,n){return Dt((function(t,r){var n=st;n.unhandleds=[],n.onunhandled=r,n.finalize=Me((function(){var e=this;!function(e){function t(){e(),lt.splice(lt.indexOf(t),1)}lt.push(t),++ut,$e((function(){0==--ut&&It()}),[])}((function(){0===e.unhandleds.length?t():r(e.unhandleds[0])}))}),n.finalize),e()}),t,r,n)}))}}),Ye&&(Ye.allSettled&&Q(ht,"allSettled",(function(){var e=pe.apply(null,arguments).map(Bt);return new ht((function(t){0===e.length&&t([]);var r=e.length,n=new Array(r);e.forEach((function(e,i){return ht.resolve(e).then((function(e){return n[i]={status:"fulfilled",value:e}}),(function(e){return n[i]={status:"rejected",reason:e}})).then((function(){return--r||t(n)}))}))}))})),Ye.any&&"undefined"!=typeof AggregateError&&Q(ht,"any",(function(){var e=pe.apply(null,arguments).map(Bt);return new ht((function(t,r){0===e.length&&r(new AggregateError([]));var n=e.length,i=new Array(n);e.forEach((function(e,o){return ht.resolve(e).then((function(e){return t(e)}),(function(e){i[o]=e,--n||r(new AggregateError(i))}))}))}))})));var Tt={awaits:0,echoes:0,id:0},Rt=0,kt=[],Ot=0,Nt=0,xt=0;function Dt(e,t,r,n){var i=st,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++xt;var a=at.env;o.env=Je?{Promise:ht,PromiseProp:{value:ht,configurable:!0,writable:!0},all:ht.all,race:ht.race,allSettled:ht.allSettled,any:ht.any,resolve:ht.resolve,reject:ht.reject,nthen:Vt(a.nthen,o),gthen:Vt(a.gthen,o)}:{},t&&P(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=Qt(o,e,r,n);return 0===o.ref&&o.finalize(),s}function Lt(){return Tt.id||(Tt.id=++Rt),++Tt.awaits,Tt.echoes+=100,Tt.id}function Pt(){return!!Tt.awaits&&(0==--Tt.awaits&&(Tt.id=0),Tt.echoes=100*Tt.awaits,!0)}function Bt(e){return Tt.echoes&&e&&e.constructor===Ye?(Lt(),e.then((function(e){return Pt(),e}),(function(e){return Pt(),zt(e)}))):e}function Mt(e){++Nt,Tt.echoes&&0!=--Tt.echoes||(Tt.echoes=Tt.id=0),kt.push(st),Ut(e,!0)}function jt(){var e=kt[kt.length-1];kt.pop(),Ut(e,!1)}function Ut(e,t){var r=st;if((t?!Tt.echoes||Ot++&&e===st:!Ot||--Ot&&e===st)||qt(t?Mt.bind(null,e):jt),e!==st&&(st=e,r===at&&(at.env=Ft()),Je)){var n=at.env.Promise,i=e.env;He.then=i.nthen,n.prototype.then=i.gthen,(r.global||e.global)&&(Object.defineProperty(L,"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 Ft(){var e=L.Promise;return Je?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(L,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:He.then,gthen:e.prototype.then}:{}}function Qt(e,t,r,n,i){var o=st;try{return Ut(e,!0),t(r,n,i)}finally{Ut(o,!1)}}function qt(e){We.call(Ke,e)}function Gt(e,t,r,n){return"function"!=typeof e?e:function(){var i=st;r&&Lt(),Ut(t,!0);try{return e.apply(this,arguments)}finally{Ut(i,!1),n&&qt(Pt)}}}function Vt(e,t){return function(r,n){return e.call(this,Gt(r,t),Gt(n,t))}}-1===(""+We).indexOf("[native code]")&&(Lt=Pt=Le);var Kt="unhandledrejection";function Ht(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,i={promise:t,reason:e};if(L.document&&document.createEvent?((n=document.createEvent("Event")).initEvent(Kt,!0,!0),P(n,i)):L.CustomEvent&&P(n=new CustomEvent(Kt,{detail:i}),i),n&&L.dispatchEvent&&(dispatchEvent(n),!L.PromiseRejectionEvent&&L.onunhandledrejection))try{L.onunhandledrejection(n)}catch(e){}ve&&n&&!n.defaultPrevented&&console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var zt=ht.reject;function Wt(e,t,r,n){if(e._state.openComplete||st.letThrough){var i=e._createTransaction(t,r,e._dbSchema);try{i.create()}catch(e){return zt(e)}return i._promise(t,(function(e,t){return Dt((function(){return st.trans=i,n(e,t,i)}))})).then((function(e){return i._completion.then((function(){return e}))}))}if(!e._state.isBeingOpened){if(!e._options.autoOpen)return zt(new Ne.DatabaseClosed);e.open().catch(Le)}return e._state.dbReadyPromise.then((function(){return Wt(e,t,r,n)}))}var Yt="3.0.3",Jt=String.fromCharCode(65535),Xt=-1/0,Zt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",$t="String expected.",er=[],tr="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),rr=tr,nr=tr,ir=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},or="__dbnames",ar="readonly",sr="readwrite";function cr(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var ur={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function lr(e){return function(t){return void 0===X(t,e)&&$(t=ae(t),e),t}}var hr=function(){function e(){}return e.prototype._trans=function(e,t,r){var n=this._tx||st.trans,i=this.name;function o(e,r,n){if(!n.schema[i])throw new Ne.NotFound("Table "+i+" not part of transaction");return t(n.idbtrans,n)}var a=Et();try{return n&&n.db===this.db?n===st.trans?n._promise(e,o,r):Dt((function(){return n._promise(e,o,r)}),{trans:n,transless:st.transless||st}):Wt(this.db,e,[this.name],o)}finally{a&&wt()}},e.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)},e.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(D(e))return new this.db.WhereClause(this,"["+e.join("+")+"]");var t=x(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var r=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(r&&this.db._maxKey!==Jt)return this.where(r.name).equals(r.keyPath.map((function(t){return e[t]})));!r&&ve&&console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var n=this.schema.idxByName,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}var a=t.reduce((function(t,r){var i=t[0],a=t[1],s=n[r],c=e[r];return[i||s,i||!s?cr(a,s&&s.multi?function(e){var t=X(e,r);return D(t)&&t.some((function(e){return o(c,e)}))}:function(e){return o(c,X(e,r))}):a]}),[null,null]),s=a[0],c=a[1];return s?this.where(s.name).equals(e[s.keyPath]).filter(c):r?this.filter(c):this.where(t).equals("")},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,D(e)?"["+e.join("+")+"]":e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var r=Object.create(e.prototype);for(var n in t)if(j(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=t,this.hook("reading",t),e},e.prototype.defineClass=function(){return this.mapToClass((function(e){P(this,e)}))},e.prototype.add=function(e,t){var r=this,n=this.schema.primKey,i=n.auto,o=n.keyPath,a=e;return o&&i&&(a=lr(o)(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?ht.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{Z(e,o,t)}catch(e){}return t}))},e.prototype.update=function(e,t){if("object"!=typeof t||D(t))throw new Ne.InvalidArgument("Modifications must be an object.");if("object"!=typeof e||D(e))return this.where(":id").equals(e).modify(t);x(t).forEach((function(r){Z(e,r,t[r])}));var r=X(e,this.schema.primKey.keyPath);return void 0===r?zt(new Ne.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(t)},e.prototype.put=function(e,t){var r=this,n=this.schema.primKey,i=n.auto,o=n.keyPath,a=e;return o&&i&&(a=lr(o)(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?ht.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{Z(e,o,t)}catch(e){}return t}))},e.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?ht.reject(e.failures[0]):void 0}))},e.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:ur})})).then((function(e){return e.numFailures?ht.reject(e.failures[0]):void 0}))},e.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)}))}))}))},e.prototype.bulkAdd=function(e,t,r){var n=this,i=Array.isArray(t)?t:void 0,o=(r=r||(i?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(function(t){var r=n.schema.primKey,a=r.auto,s=r.keyPath;if(s&&i)throw new Ne.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new Ne.InvalidArgument("Arguments objects and keys must have the same length");var c=e.length,u=s&&a?e.map(lr(s)):e;return n.core.mutate({trans:t,type:"add",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,r=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?r:i;throw new Re(n.name+".bulkAdd(): "+t+" of "+c+" operations failed",Object.keys(a).map((function(e){return a[e]})))}))}))},e.prototype.bulkPut=function(e,t,r){var n=this,i=Array.isArray(t)?t:void 0,o=(r=r||(i?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(function(t){var r=n.schema.primKey,a=r.auto,s=r.keyPath;if(s&&i)throw new Ne.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new Ne.InvalidArgument("Arguments objects and keys must have the same length");var c=e.length,u=s&&a?e.map(lr(s)):e;return n.core.mutate({trans:t,type:"put",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,r=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?r:i;throw new Re(n.name+".bulkPut(): "+t+" of "+c+" operations failed",Object.keys(a).map((function(e){return a[e]})))}))}))},e.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,i=e.lastResult,o=e.failures;if(0===n)return i;throw new Re(t.name+".bulkDelete(): "+n+" of "+r+" operations failed",o)}))},e}();function fr(e){var t={},r=function(r,n){if(n){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return t[r].subscribe.apply(null,o),e}if("string"==typeof r)return t[r]};r.addEventType=o;for(var n=1,i=arguments.length;n<i;++n)o(arguments[n]);return r;function o(e,n,i){if("object"==typeof e)return a(e);n||(n=Qe),i||(i=Le);var o={subscribers:[],fire:i,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=n(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(n,i)}};return t[e]=r[e]=o,o}function a(e){x(e).forEach((function(t){var r=e[t];if(D(r))o(t,e[t][0],e[t][1]);else{if("asap"!==r)throw new Ne.InvalidArgument("Invalid event config");var n=o(t,Pe,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach((function(e){Y((function(){e.apply(null,t)}))}))}))}}))}}function dr(e,t){return q(t).from({prototype:e}),t}function pr(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function gr(e,t){e.filter=cr(e.filter,t)}function vr(e,t,r){var n=e.replayFilter;e.replayFilter=n?function(){return cr(n(),t())}:t,e.justLimit=r&&!n}function Ar(e,t){if(e.isPrimKey)return t.primaryKey;var r=t.getIndexByKeyPath(e.index);if(!r)throw new Ne.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function mr(e,t,r){var n=Ar(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 yr(e,t,r,n){var i=e.replayFilter?cr(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},a=function(e,r,n){if(!i||i(r,n,(function(e){return r.stop(e)}),(function(e){return r.fail(e)}))){var a=r.primaryKey,s=""+a;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(a)),j(o,s)||(o[s]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(a,r),_r(mr(e,n,r),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return _r(mr(e,n,r),cr(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function _r(e,t,r,n){var i=St(n?function(e,t,i){return r(n(e),t,i)}:r);return e.then((function(e){if(e)return e.start((function(){var r=function(){return e.continue()};t&&!t(e,(function(e){return r=e}),(function(t){e.stop(t),r=Le}),(function(t){e.fail(t),r=Le}))||i(e.value,e,(function(e){return r=e})),r()}))}))}var br=function(){function e(){}return e.prototype._read=function(e,t){var r=this._ctx;return r.error?r.table._trans(null,zt.bind(null,r.error)):r.table._trans("readonly",e).then(t)},e.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,zt.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},e.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=cr(t.algorithm,e)},e.prototype._iterate=function(e,t){return yr(this._ctx,e,t,this._ctx.table.core)},e.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&P(r,e),t._ctx=r,t},e.prototype.raw=function(){return this._ctx.valueMapper=null,this},e.prototype.each=function(e){var t=this._ctx;return this._read((function(r){return yr(t,e,r,t.table.core)}))},e.prototype.count=function(e){var t=this;return this._read((function(e){var r=t._ctx,n=r.table.core;if(pr(r,!0))return n.count({trans:e,query:{index:Ar(r,n.schema),range:r.range}}).then((function(e){return Math.min(e,r.limit)}));var i=0;return yr(r,(function(){return++i,!1}),e,n).then((function(){return i}))})).then(e)},e.prototype.sortBy=function(e,t){var r=e.split(".").reverse(),n=r[0],i=r.length-1;function o(e,t){return t?o(e[r[t]],t-1):e[n]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var r=o(e,i),n=o(t,i);return r<n?-a:r>n?a:0}return this.toArray((function(e){return e.sort(s)})).then(t)},e.prototype.toArray=function(e){var t=this;return this._read((function(e){var r=t._ctx;if("next"===r.dir&&pr(r,!0)&&r.limit>0){var n=r.valueMapper,i=Ar(r,r.table.core.schema);return r.table.core.query({trans:e,limit:r.limit,values:!0,query:{index:i,range:r.range}}).then((function(e){var t=e.result;return n?t.map(n):t}))}var o=[];return yr(r,(function(e){return o.push(e)}),e,r.table.core).then((function(){return o}))}),e)},e.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,pr(t)?vr(t,(function(){var t=e;return function(e,r){return 0===t||(1===t?(--t,!1):(r((function(){e.advance(t),t=0})),!1))}})):vr(t,(function(){var t=e;return function(){return--t<0}}))),this},e.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),vr(this._ctx,(function(){var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}}),!0),this},e.prototype.until=function(e,t){return gr(this._ctx,(function(r,n,i){return!e(r.value)||(n(i),t)})),this},e.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){var t,r;return gr(this._ctx,(function(t){return e(t.value)})),t=this._ctx,r=e,t.isMatch=cr(t.isMatch,r),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.key,r)}))},e.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.primaryKey,r)}))},e.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)},e.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&pr(t,!0)&&t.limit>0)return this._read((function(e){var r=Ar(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)},e.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.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 gr(this._ctx,(function(e){var t=e.primaryKey.toString(),n=j(r,t);return r[t]=!0,!n})),this},e.prototype.modify=function(e){var t=this,r=this._ctx;return this._write((function(n){var i;if("function"==typeof e)i=e;else{var o=x(e),a=o.length;i=function(t){for(var r=!1,n=0;n<a;++n){var i=o[n],s=e[i];X(t,i)!==s&&(Z(t,i,s),r=!0)}return r}}var s=r.table.core,c=s.schema.primaryKey,u=c.outbound,l=c.extractKey,h="testmode"in dn?1:2e3,f=t.db.core.cmp,d=[],p=0,g=[],v=function(e,t){var r=t.failures,n=t.numFailures;p+=e-n;for(var i=0,o=x(r);i<o.length;i++){var a=o[i];d.push(r[a])}};return t.clone().primaryKeys().then((function(e){var t=function(r){var o=Math.min(h,e.length-r);return s.getMany({trans:n,keys:e.slice(r,r+o)}).then((function(a){for(var c=[],d=[],p=u?[]:null,g=[],A=0;A<o;++A){var m=a[A],y={value:ae(m),primKey:e[r+A]};!1!==i.call(y,y.value,y)&&(null==y.value?g.push(e[r+A]):u||0===f(l(m),l(y.value))?(d.push(y.value),u&&p.push(e[r+A])):(g.push(e[r+A]),c.push(y.value)))}return Promise.resolve(c.length>0&&s.mutate({trans:n,type:"add",values:c}).then((function(e){for(var t in e.failures)g.splice(parseInt(t),1);v(c.length,e)}))).then((function(e){return d.length>0&&s.mutate({trans:n,type:"put",keys:p,values:d}).then((function(e){return v(d.length,e)}))})).then((function(){return g.length>0&&s.mutate({trans:n,type:"delete",keys:g}).then((function(e){return v(g.length,e)}))})).then((function(){return e.length>r+o&&t(r+h)}))}))};return t(0).then((function(){if(d.length>0)throw new Te("Error modifying one or more objects",d,p,g);return e.length}))}))}))},e.prototype.delete=function(){var e=this._ctx,t=e.range;return pr(e)&&(e.isPrimKey&&!nr||3===t.type)?this._write((function(r){var n=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:r,query:{index:n,range:i}}).then((function(t){return e.table.core.mutate({trans:r,type:"deleteRange",range:i}).then((function(e){var r=e.failures,n=(e.lastResult,e.results,e.numFailures);if(n)throw new Te("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}))},e}();function Er(e,t){return e<t?-1:e===t?0:1}function wr(e,t){return e>t?-1:e===t?0:1}function Ir(e,t,r){var n=e instanceof Or?new e.Collection(e):e;return n._ctx.error=r?new r(t):new TypeError(t),n}function Cr(e){return new e.Collection(e,(function(){return kr("")})).limit(0)}function Sr(e,t,r,n,i,o){for(var a=Math.min(e.length,n.length),s=-1,c=0;c<a;++c){var u=t[c];if(u!==n[c])return i(e[c],r[c])<0?e.substr(0,c)+r[c]+r.substr(c+1):i(e[c],n[c])<0?e.substr(0,c)+n[c]+r.substr(c+1):s>=0?e.substr(0,s)+t[s]+r.substr(s+1):null;i(e[c],u)<0&&(s=c)}return a<n.length&&"next"===o?e+r.substr(e.length):a<e.length&&"prev"===o?e.substr(0,r.length):s<0?null:e.substr(0,s)+n[s]+r.substr(s+1)}function Tr(e,t,r,n){var i,o,a,s,c,u,l,h=r.length;if(!r.every((function(e){return"string"==typeof e})))return Ir(e,$t);function f(e){i=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),o=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),a="next"===e?Er:wr;var t=r.map((function(e){return{lower:o(e),upper:i(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));s=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),u=e,l="next"===e?"":n}f("next");var d=new e.Collection(e,(function(){return Rr(s[0],c[h-1]+n)}));d._ondirectionchange=function(e){f(e)};var p=0;return d._addAlgorithm((function(e,r,n){var i=e.key;if("string"!=typeof i)return!1;var f=o(i);if(t(f,c,p))return!0;for(var d=null,g=p;g<h;++g){var v=Sr(i,f,s[g],c[g],a,u);null===v&&null===d?p=g+1:(null===d||a(d,v)>0)&&(d=v)}return r(null!==d?function(){e.continue(d+l)}:n),!1})),d}function Rr(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function kr(e){return{type:1,lower:e,upper:e}}var Or=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),e.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)?Cr(this):new this.Collection(this,(function(){return Rr(e,t,!r,!n)}))}catch(e){return Ir(this,Zt)}},e.prototype.equals=function(e){return null==e?Ir(this,Zt):new this.Collection(this,(function(){return kr(e)}))},e.prototype.above=function(e){return null==e?Ir(this,Zt):new this.Collection(this,(function(){return Rr(e,void 0,!0)}))},e.prototype.aboveOrEqual=function(e){return null==e?Ir(this,Zt):new this.Collection(this,(function(){return Rr(e,void 0,!1)}))},e.prototype.below=function(e){return null==e?Ir(this,Zt):new this.Collection(this,(function(){return Rr(void 0,e,!1,!0)}))},e.prototype.belowOrEqual=function(e){return null==e?Ir(this,Zt):new this.Collection(this,(function(){return Rr(void 0,e)}))},e.prototype.startsWith=function(e){return"string"!=typeof e?Ir(this,$t):this.between(e,e+Jt,!0,!0)},e.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Tr(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Jt)},e.prototype.equalsIgnoreCase=function(e){return Tr(this,(function(e,t){return e===t[0]}),[e],"")},e.prototype.anyOfIgnoreCase=function(){var e=pe.apply(de,arguments);return 0===e.length?Cr(this):Tr(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=pe.apply(de,arguments);return 0===e.length?Cr(this):Tr(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,Jt)},e.prototype.anyOf=function(){var e=this,t=pe.apply(de,arguments),r=this._cmp;try{t.sort(r)}catch(e){return Ir(this,Zt)}if(0===t.length)return Cr(this);var n=new this.Collection(this,(function(){return Rr(t[0],t[t.length-1])}));n._ondirectionchange=function(n){r="next"===n?e._ascending:e._descending,t.sort(r)};var i=0;return n._addAlgorithm((function(e,n,o){for(var a=e.key;r(a,t[i])>0;)if(++i===t.length)return n(o),!1;return 0===r(a,t[i])||(n((function(){e.continue(t[i])})),!1)})),n},e.prototype.notEqual=function(e){return this.inAnyRange([[Xt,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=pe.apply(de,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Ir(this,Zt)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[Xt,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){var r=this,n=this._cmp,i=this._ascending,o=this._descending,a=this._min,s=this._max;if(0===e.length)return Cr(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0})))return Ir(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ne.InvalidArgument);var c=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;var l,h=i;function f(e,t){return h(e[0],t[0])}try{l=e.reduce((function(e,t){for(var r=0,i=e.length;r<i;++r){var o=e[r];if(n(t[0],o[1])<0&&n(t[1],o[0])>0){o[0]=a(o[0],t[0]),o[1]=s(o[1],t[1]);break}}return r===i&&e.push(t),e}),[]),l.sort(f)}catch(e){return Ir(this,Zt)}var d=0,p=u?function(e){return i(e,l[d][1])>0}:function(e){return i(e,l[d][1])>=0},g=c?function(e){return o(e,l[d][0])>0}:function(e){return o(e,l[d][0])>=0};var v=p,A=new this.Collection(this,(function(){return Rr(l[0][0],l[l.length-1][1],!c,!u)}));return A._ondirectionchange=function(e){"next"===e?(v=p,h=i):(v=g,h=o),l.sort(f)},A._addAlgorithm((function(e,t,n){for(var o=e.key;v(o);)if(++d===l.length)return t(n),!1;return!!function(e){return!p(e)&&!g(e)}(o)||(0===r._cmp(o,l[d][1])||0===r._cmp(o,l[d][0])||t((function(){h===i?e.continue(l[d][0]):e.continue(l[d][1])})),!1)})),A},e.prototype.startsWithAnyOf=function(){var e=pe.apply(de,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Cr(this):this.inAnyRange(e.map((function(e){return[e,e+Jt]}))):Ir(this,"startsWithAnyOf() only works with strings")},e}();function Nr(e){return 1===e.length?e[0]:e}function xr(e){try{return e.only([[]]),[[]]}catch(e){return Jt}}function Dr(e){return St((function(t){return Lr(t),e(t.target.error),!1}))}function Lr(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Pr=function(){function e(){}return e.prototype._lock=function(){return W(!st.global),++this._reculock,1!==this._reculock||st.global||(st.lockOwnerFor=this),this},e.prototype._unlock=function(){if(W(!st.global),0==--this._reculock)for(st.global||(st.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Qt(e[1],e[0])}catch(e){}}return this},e.prototype._locked=function(){return this._reculock&&st.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var r=this.db.idbdb,n=this.db._state.dbOpenError;if(W(!this.idbtrans),!e&&!r)switch(n&&n.name){case"DatabaseClosedError":throw new Ne.DatabaseClosed(n);case"MissingAPIError":throw new Ne.MissingAPI(n.message,n);default:throw new Ne.OpenFailed(n)}if(!this.active)throw new Ne.TransactionInactive;return W(null===this._completion._state),(e=this.idbtrans=e||r.transaction(Nr(this.storeNames),this.mode)).onerror=St((function(r){Lr(r),t._reject(e.error)})),e.onabort=St((function(r){Lr(r),t.active&&t._reject(new Ne.Abort(e.error)),t.active=!1,t.on("abort").fire(r)})),e.oncomplete=St((function(){t.active=!1,t._resolve()})),this},e.prototype._promise=function(e,t,r){var n=this;if("readwrite"===e&&"readwrite"!==this.mode)return zt(new Ne.ReadOnly("Transaction is readonly"));if(!this.active)return zt(new Ne.TransactionInactive);if(this._locked())return new ht((function(i,o){n._blockedFuncs.push([function(){n._promise(e,t,r).then(i,o)},st])}));if(r)return Dt((function(){var e=new ht((function(e,r){n._lock();var i=t(e,r,n);i&&i.then&&i.then(e,r)}));return e.finally((function(){return n._unlock()})),e._lib=!0,e}));var i=new ht((function(e,r){var i=t(e,r,n);i&&i.then&&i.then(e,r)}));return i._lib=!0,i},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),r=ht.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 e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new ht((function(e,n){r.then((function(r){return t._waitingQueue.push(St(e.bind(null,r)))}),(function(e){return t._waitingQueue.push(St(n.bind(null,e)))})).finally((function(){t._waitingFor===i&&(t._waitingFor=null)}))}))},e.prototype.abort=function(){this.active&&this._reject(new Ne.Abort),this.active=!1},e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(j(t,e))return t[e];var r=this.schema[e];if(!r)throw new Ne.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},e}();function Br(e,t,r,n,i,o,a){return{name:e,keyPath:t,unique:r,multi:n,auto:i,compound:o,src:(r&&!a?"&":"")+(n?"*":"")+(i?"++":"")+Mr(t)}}function Mr(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function jr(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:J(r,(function(e){return[e.name,e]}))}}function Ur(e){return null==e?function(){}:"string"==typeof e?function(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return X(t,e)}}(e):function(t){return X(t,e)}}function Fr(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}function Qr(e){return[].slice.call(e)}var qr=0;function Gr(e){return null==e?":id":"string"==typeof e?e:"["+e.join("+")+"]"}function Vr(e,t,r,n){var i=t.cmp.bind(t);function o(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,i=e.lowerOpen,o=e.upperOpen;return void 0===t?void 0===n?null:r.upperBound(n,!!o):void 0===n?r.lowerBound(t,!!i):r.bound(t,n,!!i,!!o)}var a=function(e,t){var r=Qr(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,n=D(t),i=null==t,o={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:n,keyPath:t,autoIncrement:r,unique:!0,extractKey:Ur(t)},indexes:Qr(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,r=e.unique,n=e.multiEntry,i=e.keyPath,a={name:t,compound:D(i),keyPath:i,unique:r,multiEntry:n,extractKey:Ur(i)};return o[Gr(i)]=a,a})),getIndexByKeyPath:function(e){return o[Gr(e)]}};return o[":id"]=a.primaryKey,null!=t&&(o[Gr(t)]=a.primaryKey),a}))},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,n),s=a.schema,c=a.hasGetAll,u=s.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(r){var n=r.trans,i=r.type,a=r.keys,s=r.values,c=r.range,u=r.wantResults;return new Promise((function(r,l){r=St(r);var h=n.objectStore(t),f=null==h.keyPath,d="put"===i||"add"===i;if(!d&&"delete"!==i&&"deleteRange"!==i)throw new Error("Invalid operation type: "+i);var p=(a||s||{length:1}).length;if(a&&s&&a.length!==s.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return r({numFailures:0,failures:{},results:[],lastResult:void 0});var g,v=u&&N(a||Fr(e.primaryKey,{type:i,keys:a,values:s})),A=[],m=0,y=function(e){++m,Lr(e),v&&(v[e.target._reqno]=void 0),A[e.target._reqno]=e.target.error},_=function(e){var t=e.target;v[t._reqno]=t.result};if("deleteRange"===i){if(4===c.type)return r({numFailures:m,failures:A,results:v,lastResult:void 0});g=3===c.type?h.clear():h.delete(o(c))}else{var b=d?f?[s,a]:[s,null]:[a,null],E=b[0],w=b[1];if(d)for(var I=0;I<p;++I)(g=w&&void 0!==w[I]?h[i](E[I],w[I]):h[i](E[I]))._reqno=I,v&&void 0===v[I]&&(g.onsuccess=_),g.onerror=y;else for(I=0;I<p;++I)(g=h[i](E[I]))._reqno=I,g.onerror=y}var C=function(e){var t=e.target.result;v&&(v[p-1]=t),r({numFailures:m,failures:A,results:v,lastResult:t})};g.onerror=function(e){y(e),C(e)},g.onsuccess=C}))},getMany:function(e){var r=e.trans,n=e.keys;return new Promise((function(e,i){e=St(e);for(var o,a=r.objectStore(t),s=n.length,c=new Array(s),u=0,l=0,h=function(t){var r=t.target;c[r._pos]=r.result,++l===u&&e(c)},f=Dr(i),d=0;d<s;++d)null!=n[d]&&((o=a.get(n[d]))._pos=d,o.onsuccess=h,o.onerror=f,++u);0===u&&e(c)}))},get:function(e){var r=e.trans,n=e.key;return new Promise((function(e,i){e=St(e);var o=r.objectStore(t).get(n);o.onsuccess=function(t){return e(t.target.result)},o.onerror=Dr(i)}))},query:function(e){return function(r){return new Promise((function(n,i){n=St(n);var a=r.trans,s=r.values,c=r.limit,u=r.query,l=c===1/0?void 0:c,h=u.index,f=u.range,d=a.objectStore(t),p=h.isPrimaryKey?d:d.index(h.name),g=o(f);if(0===c)return n({result:[]});if(e){var v=s?p.getAll(g,l):p.getAllKeys(g,l);v.onsuccess=function(e){return n({result:e.target.result})},v.onerror=Dr(i)}else{var A=0,m=s||!("openKeyCursor"in p)?p.openCursor(g):p.openKeyCursor(g),y=[];m.onsuccess=function(e){var t=m.result;return t?(y.push(s?t.value:t.primaryKey),++A===c?n({result:y}):void t.continue()):n({result:y})},m.onerror=Dr(i)}}))}}(c),openCursor:function(e){var r=e.trans,n=e.values,i=e.query,a=e.reverse,s=e.unique;return new Promise((function(e,c){e=St(e);var u=i.index,l=i.range,h=r.objectStore(t),f=u.isPrimaryKey?h:h.index(u.name),d=a?s?"prevunique":"prev":s?"nextunique":"next",p=n||!("openKeyCursor"in f)?f.openCursor(o(l),d):f.openKeyCursor(o(l),d);p.onerror=Dr(c),p.onsuccess=St((function(t){var n=p.result;if(n){n.___id=++qr,n.done=!1;var i=n.continue.bind(n),o=n.continuePrimaryKey;o&&(o=o.bind(n));var a=n.advance.bind(n),s=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=St(c),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=St(e),p.onerror=Dr(t),n.fail=t,n.stop=function(t){n.stop=n.continue=n.continuePrimaryKey=n.advance=s,e(t)}})),r=function(){if(p.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 p.onsuccess=St((function(e){p.onsuccess=r,r()})),n.continue=i,n.continuePrimaryKey=o,n.advance=a,r(),t},e(n)}else e(null)}),c)}))},count:function(e){var r=e.query,n=e.trans,i=r.index,a=r.range;return new Promise((function(e,r){var s=n.objectStore(t),c=i.isPrimaryKey?s:s.index(i.name),u=o(a),l=u?c.count(u):c.count();l.onsuccess=St((function(t){return e(t.target.result)})),l.onerror=Dr(r)}))}}}(e)})),l={};return u.forEach((function(e){return l[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!l[e])throw new Error("Table '"+e+"' not found");return l[e]},cmp:i,MIN_KEY:-1/0,MAX_KEY:xr(r),schema:s}}function Kr(e,t,r,n){var i=r.IDBKeyRange,o=function(e,t){return t.reduce((function(e,t){var r=t.create;return O(O({},e),r(e))}),e)}(Vr(t,r.indexedDB,i,n),e.dbcore);return{dbcore:o}}function Hr(e,t){var r=t.db,n=Kr(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 zr(e,t,r,n){r.forEach((function(r){var i=n[r];t.forEach((function(t){var n=V(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?Q(t,r,{get:function(){return this.table(r)},set:function(e){F(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,i))}))}))}function Wr(e,t){t.forEach((function(t){for(var r in t)t[r]instanceof e.Table&&delete t[r]}))}function Yr(e,t){return e._cfg.version-t._cfg.version}function Jr(e,t,r,n){var i=e._dbSchema,o=e._createTransaction("readwrite",e._storeNames,i);o.create(r),o._completion.catch(n);var a=o._reject.bind(o),s=st.transless||st;Dt((function(){st.trans=o,st.transless=s,0===t?(x(i).forEach((function(e){Zr(r,e,i[e].primKey,i[e].indexes)})),Hr(e,r),ht.follow((function(){return e.on.populate.fire(o)})).catch(a)):function(e,t,r,n){var i=[],o=e._versions,a=e._dbSchema=en(e,e.idbdb,n),s=!1;function c(){return i.length?ht.resolve(i.shift()(r.idbtrans)).then(c):ht.resolve()}return o.filter((function(e){return e._cfg.version>=t})).forEach((function(o){i.push((function(){var i=a,c=o._cfg.dbschema;tn(e,i,n),tn(e,c,n),a=e._dbSchema=c;var u=Xr(i,c);u.add.forEach((function(e){Zr(n,e[0],e[1].primKey,e[1].indexes)})),u.change.forEach((function(e){if(e.recreate)throw new Ne.Upgrade("Not yet support for changing primary key");var t=n.objectStore(e.name);e.add.forEach((function(e){return $r(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),$r(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var l=o._cfg.contentUpgrade;if(l&&o._cfg.version>t){Hr(e,n),r._memoizedTables={},s=!0;var h=ee(c);u.del.forEach((function(e){h[e]=i[e]})),Wr(e,[e.Transaction.prototype]),zr(e,[e.Transaction.prototype],x(h),h),r.schema=h;var f,d=ge(l);d&&Lt();var p=ht.follow((function(){if((f=l(r))&&d){var e=Pt.bind(null,null);f.then(e,e)}}));return f&&"function"==typeof f.then?ht.resolve(f):p.then((function(){return f}))}})),i.push((function(t){s&&rr||function(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)}}(o._cfg.dbschema,t);Wr(e,[e.Transaction.prototype]),zr(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema}))})),c().then((function(){var e,t;t=n,x(e=a).forEach((function(r){t.db.objectStoreNames.contains(r)||Zr(t,r,e[r].primKey,e[r].indexes)}))}))}(e,t,o,r).catch(a)}))}function Xr(e,t){var r,n={del:[],add:[],change:[]};for(r in e)t[r]||n.del.push(r);for(r in t){var i=e[r],o=t[r];if(i){var a={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto&&!tr)a.recreate=!0,n.change.push(a);else{var s=i.idxByName,c=o.idxByName,u=void 0;for(u in s)c[u]||a.del.push(u);for(u in c){var l=s[u],h=c[u];l?l.src!==h.src&&a.change.push(h):a.add.push(h)}(a.del.length>0||a.add.length>0||a.change.length>0)&&n.change.push(a)}}else n.add.push([r,o])}return n}function Zr(e,t,r,n){var i=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach((function(e){return $r(i,e)})),i}function $r(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function en(e,t,r){var n={};return H(t.objectStoreNames,0).forEach((function(e){for(var t=r.objectStore(e),i=t.keyPath,o=Br(Mr(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),a=[],s=0;s<t.indexNames.length;++s){var c=t.index(t.indexNames[s]);i=c.keyPath;var u=Br(c.name,i,!!c.unique,!!c.multiEntry,!1,i&&"string"!=typeof i,!1);a.push(u)}n[e]=jr(e,o,a)})),n}function tn(e,t,r){for(var n=r.db.objectStoreNames,i=0;i<n.length;++i){var o=n[i],a=r.objectStore(o);e._hasGetAll="getAll"in a;for(var s=0;s<a.indexNames.length;++s){var c=a.indexNames[s],u=a.index(c).keyPath,l="string"==typeof u?u:"["+H(u).join("+")+"]";if(t[o]){var h=t[o].idxByName[l];h&&(h.name=c,delete t[o].idxByName[l],t[o].idxByName[c]=h)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&L.WorkerGlobalScope&&L instanceof L.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}var rn,nn=function(){function e(){}return e.prototype._parseStoresSpec=function(e,t){x(e).forEach((function(r){if(null!==e[r]){var n=e[r].split(",").map((function(e,t){var r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return Br(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),D(n),0===t)})),i=n.shift();if(i.multi)throw new Ne.Schema("Primary key cannot be multi-valued");n.forEach((function(e){if(e.auto)throw new Ne.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Ne.Schema("Index must have a name and cannot be an empty string")})),t[r]=jr(r,i,n)}}))},e.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?P(this._cfg.storesSource,e):e;var r=t._versions,n={},i={};return r.forEach((function(e){P(n,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(n,i)})),t._dbSchema=i,Wr(t,[t._allTables,t,t.Transaction.prototype]),zr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],x(i),i),t._storeNames=x(i),this},e.prototype.upgrade=function(e){return this._cfg.contentUpgrade=e,this},e}();function on(e){return Dt((function(){return st.letThrough=!0,e()}))}function an(e){var t=e._state,r=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?zt(t.dbOpenError):e}));ve&&(t.openCanceller._stackHolder=_e()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var n=t.dbReadyResolve,i=null;return ht.race([t.openCanceller,new ht((function(n,o){if(!r)throw new Ne.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 a=e.name,s=t.autoSchema?r.open(a):r.open(a,Math.round(10*e.verno));if(!s)throw new Ne.MissingAPI("IndexedDB API not available");s.onerror=Dr(o),s.onblocked=St(e._fireOnBlocked),s.onupgradeneeded=St((function(n){if(i=s.transaction,t.autoSchema&&!e._options.allowEmptyDB){s.onerror=Lr,i.abort(),s.result.close();var c=r.deleteDatabase(a);c.onsuccess=c.onerror=St((function(){o(new Ne.NoSuchDatabase("Database "+a+" doesnt exist"))}))}else{i.onerror=Dr(o);var u=n.oldVersion>Math.pow(2,62)?0:n.oldVersion;e.idbdb=s.result,Jr(e,u/10,i,o)}}),o),s.onsuccess=St((function(){i=null;var r=e.idbdb=s.result,o=H(r.objectStoreNames);if(o.length>0)try{var c=r.transaction(Nr(o),"readonly");t.autoSchema?function(e,t,r){e.verno=t.version/10;var n=e._dbSchema=en(0,t,r);e._storeNames=H(t.objectStoreNames,0),zr(e,[e._allTables],x(n),n)}(e,r,c):(tn(e,e._dbSchema,c),function(e,t){var r=Xr(en(0,e.idbdb,t),e._dbSchema);return!(r.add.length||r.change.some((function(e){return e.add.length||e.change.length})))}(e,c)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Hr(e,c)}catch(e){}er.push(e),r.onversionchange=St((function(r){t.vcFired=!0,e.on("versionchange").fire(r)})),rn.add(a),n()}),o)}))]).then((function(){return t.onReadyBeingFired=[],ht.resolve(on(e.on.ready.fire)).then((function e(){if(t.onReadyBeingFired.length>0){var r=t.onReadyBeingFired.reduce(qe,Le);return t.onReadyBeingFired=[],ht.resolve(on(r)).then(e)}}))})).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,zt(t.dbOpenError)})).finally((function(){t.openComplete=!0,n()}))}function sn(e){var t=function(t){return e.next(t)},r=i(t),n=i((function(t){return e.throw(t)}));function i(e){return function(t){var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(r,n):D(o)?Promise.all(o).then(r,n):r(o)}}return i(t)()}function cn(e,t,r){var n=arguments.length;if(n<2)throw new Ne.InvalidArgument("Too few arguments");for(var i=new Array(n-1);--n;)i[n-1]=arguments[n];r=i.pop();var o=re(i);return[e,o,r]}function un(e,t,r,n,i){return ht.resolve().then((function(){var o=st.transless||st,a=e._createTransaction(t,r,e._dbSchema,n),s={trans:a,transless:o};n?a.idbtrans=n.idbtrans:a.create();var c,u=ge(i);u&&Lt();var l=ht.follow((function(){if(c=i.call(a,a))if(u){var e=Pt.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=sn(c))}),s);return(c&&"function"==typeof c.then?ht.resolve(c).then((function(e){return a.active?e:zt(new Ne.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return c}))).then((function(e){return n&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),zt(e)}))}))}function ln(e,t,r){for(var n=D(e)?e.slice():[e],i=0;i<r;++i)n.push(t);return n}var hn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return O(O({},e),{table:function(t){var r=e.table(t),n=r.schema,i={},o=[];function a(e,t,r){var n=Gr(e),s=i[n]=i[n]||[],c=null==e?0:"string"==typeof e?1:e.length,u=t>0,l=O(O({},r),{isVirtual:u,isPrimaryKey:!u&&r.isPrimaryKey,keyTail:t,keyLength:c,extractKey:Ur(e),unique:!u&&r.unique});(s.push(l),l.isPrimaryKey||o.push(l),c>1)&&a(2===c?e[0]:e.slice(0,c-1),t+1,r);return s.sort((function(e,t){return e.keyTail-t.keyTail})),l}var s=a(n.primaryKey.keyPath,0,n.primaryKey);i[":id"]=[s];for(var c=0,u=n.indexes;c<u.length;c++){var l=u[c];a(l.keyPath,0,l)}function h(t){var r,n,i=t.query.index;return i.isVirtual?O(O({},t),{query:{index:i,range:(r=t.query.range,n=i.keyTail,{type:1===r.type?2:r.type,lower:ln(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:ln(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0})}}):t}var f=O(O({},r),{schema:O(O({},n),{primaryKey:s,indexes:o,getIndexByKeyPath:function(e){var t=i[Gr(e)];return t&&t[0]}}),count:function(e){return r.count(h(e))},query:function(e){return r.query(h(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,o=n.isVirtual,a=n.keyLength;if(!o)return r.openCursor(t);return r.openCursor(h(t)).then((function(r){return r&&function(r){var n=Object.create(r,{continue:{value:function(n){null!=n?r.continue(ln(n,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?r.continue(ln(r.key,t.reverse?e.MIN_KEY:e.MAX_KEY,i)):r.continue()}},continuePrimaryKey:{value:function(t,n){r.continuePrimaryKey(ln(t,e.MAX_KEY,i),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}})}},fn={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return O(O({},e),{table:function(t){var r=e.table(t),n=r.schema.primaryKey,i=O(O({},r),{mutate:function(e){var i=st.trans,o=i.table(t).hook,a=o.deleting,s=o.creating,c=o.updating;switch(e.type){case"add":if(s.fire===Le)break;return i._promise("readwrite",(function(){return u(e)}),!0);case"put":if(s.fire===Le&&c.fire===Le)break;return i._promise("readwrite",(function(){return u(e)}),!0);case"delete":if(a.fire===Le)break;return i._promise("readwrite",(function(){return u(e)}),!0);case"deleteRange":if(a.fire===Le)break;return i._promise("readwrite",(function(){return function(e){return l(e.trans,e.range,1e4)}(e)}),!0)}return r.mutate(e);function u(e){var t=st.trans,i=e.keys||Fr(n,e);if(!i)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?O(O({},e),{keys:i,wantResults:!0}):O({},e)).type&&(e.values=N(e.values)),e.keys&&(e.keys=N(e.keys)),function(e,t,r){return"add"===t.type?Promise.resolve(new Array(t.values.length)):e.getMany({trans:t.trans,keys:r})}(r,e,i).then((function(o){var u=i.map((function(r,i){var u=o[i],l={onerror:null,onsuccess:null};if("delete"===e.type)a.fire.call(l,r,u,t);else if("add"===e.type||void 0===u){var h=s.fire.call(l,r,e.values[i],t);null==r&&null!=h&&(r=h,e.keys[i]=r,n.outbound||Z(e.values[i],n.keyPath,r))}else{var f=le(u,e.values[i]),d=c.fire.call(l,f,r,u,t);if(d){var p=e.values[i];Object.keys(d).forEach((function(e){j(p,e)?p[e]=d[e]:Z(p,e,d[e])}))}}return l}));return r.mutate(e).then((function(t){for(var r=t.failures,n=t.results,a=t.numFailures,s=t.lastResult,c=0;c<i.length;++c){var l=n?n[c]:i[c],h=u[c];null==l?h.onerror&&h.onerror(r[c]):h.onsuccess&&h.onsuccess("put"===e.type&&o[c]?e.values[c]:l)}return{failures:r,results:n,numFailures:a,lastResult:s}})).catch((function(e){return u.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}function l(e,t,i){return r.query({trans:e,values:!1,query:{index:n,range:t},limit:i}).then((function(r){var n=r.result;return u({type:"delete",keys:n,trans:e}).then((function(r){return r.numFailures>0?Promise.reject(r.failures[0]):n.length<i?{failures:[],numFailures:0,lastResult:void 0}:l(e,O(O({},t),{lower:n[n.length-1],lowerOpen:!0}),i)}))}))}}});return i}})}},dn=function(){function e(t,r){var n=this;this._middlewares={},this.verno=0;var i=e.dependencies;this._options=r=O({addons:e.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},r),this._deps={indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange};var o=r.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null;var a={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Le,dbReadyPromise:null,cancelOpen:Le,openCanceller:null,autoSchema:!0};a.dbReadyPromise=new ht((function(e){a.dbReadyResolve=e})),a.openCanceller=new ht((function(e,t){a.cancelOpen=t})),this._state=a,this.name=t,this.on=fr(this,"populate","blocked","versionchange",{ready:[qe,Le]}),this.on.ready.subscribe=z(this.on.ready.subscribe,(function(t){return function(r,i){e.vip((function(){var e=n._state;if(e.openComplete)e.dbOpenError||ht.resolve().then(r),i&&t(r);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(r),i&&t(r);else{t(r);var o=n;i||t((function e(){o.on.ready.unsubscribe(r),o.on.ready.unsubscribe(e)}))}}))}})),this.Collection=function(e){return dr(br.prototype,(function(t,r){this.db=e;var n=ur,i=null;if(r)try{n=r()}catch(e){i=e}var o=t._ctx,a=o.table,s=a.hook.reading.fire;this._ctx={table:a,index:o.index,isPrimKey:!o.index||a.schema.primKey.keyPath&&o.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:i,or:o.or,valueMapper:s!==Pe?s:null}}))}(this),this.Table=function(e){return dr(hr.prototype,(function(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:fr(null,{creating:[je,Le],reading:[Be,Pe],updating:[Fe,Le],deleting:[Ue,Le]})}))}(this),this.Transaction=function(e){return dr(Pr.prototype,(function(t,r,n,i){var o=this;this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.idbtrans=null,this.on=fr(this,"complete","error","abort"),this.parent=i||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 ht((function(e,t){o._resolve=e,o._reject=t})),this._completion.then((function(){o.active=!1,o.on.complete.fire()}),(function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),zt(e)}))}))}(this),this.Version=function(e){return dr(nn.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return dr(Or.prototype,(function(t,r,n){this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n};var i=e._deps.indexedDB;if(!i)throw new Ne.MissingAPI("indexedDB API missing");this._cmp=this._ascending=i.cmp.bind(i),this._descending=function(e,t){return i.cmp(t,e)},this._max=function(e,t){return i.cmp(e,t)>0?e:t},this._min=function(e,t){return i.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 '"+n.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+n.name+"'. Closing db now to resume the delete request."),n.close()})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('"+n.name+"') was blocked"):console.warn("Upgrade '"+n.name+"' blocked by other connection holding version "+e.oldVersion/10)})),this._maxKey=xr(r.IDBKeyRange),this._createTransaction=function(e,t,r,i){return new n.Transaction(e,t,r,i)},this._fireOnBlocked=function(e){n.on("blocked").fire(e),er.filter((function(e){return e.name===n.name&&e!==n&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(hn),this.use(fn),o.forEach((function(e){return e(n)}))}return e.prototype.version=function(e){if(isNaN(e)||e<.1)throw new Ne.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Ne.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(Yr),r.stores({}),this._state.autoSchema=!1,r)},e.prototype._whenReady=function(e){var t=this;return this._state.openComplete||st.letThrough?e():new ht((function(e,r){if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void r(new Ne.DatabaseClosed);t.open().catch(Le)}t._state.dbReadyPromise.then(e,r)})).then(e)},e.prototype.use=function(e){var t=e.stack,r=e.create,n=e.level,i=e.name;i&&this.unuse({stack:t,name:i});var o=this._middlewares[t]||(this._middlewares[t]=[]);return o.push({stack:t,create:r,level:null==n?10:n,name:i}),o.sort((function(e,t){return e.level-t.level})),this},e.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},e.prototype.open=function(){return an(this)},e.prototype.close=function(){var e=er.indexOf(this),t=this._state;if(e>=0&&er.splice(e,1),this.idbdb){try{this.idbdb.close()}catch(e){}this.idbdb=null}this._options.autoOpen=!1,t.dbOpenError=new Ne.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError),t.dbReadyPromise=new ht((function(e){t.dbReadyResolve=e})),t.openCanceller=new ht((function(e,r){t.cancelOpen=r}))},e.prototype.delete=function(){var e=this,t=arguments.length>0,r=this._state;return new ht((function(n,i){var o=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=St((function(){rn.remove(e.name),n()})),t.onerror=Dr(i),t.onblocked=e._fireOnBlocked};if(t)throw new Ne.InvalidArgument("Arguments not allowed in db.delete()");r.isBeingOpened?r.dbReadyPromise.then(o):o()}))},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return null!==this.idbdb},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},e.prototype.hasFailed=function(){return null!==this._state.dbOpenError},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return x(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!0,configurable:!0}),e.prototype.transaction=function(){var e=cn.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,r){var n=this,i=st.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,a,s=-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===ar)o=ar;else{if("rw"!=e&&e!=sr)throw new Ne.InvalidArgument("Invalid transaction mode: "+e);o=sr}if(i){if(i.mode===ar&&o===sr){if(!s)throw new Ne.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&a.forEach((function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!s)throw new Ne.SubTransaction("Table "+e+" not included in parent transaction.");i=null}})),s&&i&&!i.active&&(i=null)}}catch(e){return i?i._promise(null,(function(t,r){r(e)})):zt(e)}var c=un.bind(null,this,o,a,i,r);return i?i._promise(o,c,"lock"):st.trans?Qt(st.transless,(function(){return n._whenReady(c)})):this._whenReady(c)},e.prototype.table=function(e){if(!j(this._allTables,e))throw new Ne.InvalidTable("Table "+e+" does not exist");return this._allTables[e]},e}(),pn=dn;U(pn,O(O({},De),{delete:function(e){return new pn(e).delete()},exists:function(e){return new pn(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){return rn?rn.getDatabaseNames().then(e):ht.resolve([])},defineClass:function(){return function(e){P(this,e)}},ignoreTransaction:function(e){return st.trans?Qt(st.transless,e):e()},vip:on,async:function(e){return function(){try{var t=sn(e.apply(this,arguments));return t&&"function"==typeof t.then?t:ht.resolve(t)}catch(e){return zt(e)}}},spawn:function(e,t,r){try{var n=sn(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:ht.resolve(n)}catch(e){return zt(e)}},currentTransaction:{get:function(){return st.trans||null}},waitFor:function(e,t){var r=ht.resolve("function"==typeof e?pn.ignoreTransaction(e):e).timeout(t||6e4);return st.trans?st.trans.waitFor(r):r},Promise:ht,debug:{get:function(){return ve},set:function(e){Ae(e,"dexie"===e?function(){return!0}:ir)}},derive:q,extend:P,props:U,override:z,Events:fr,getByKeyPath:X,setByKeyPath:Z,delByKeyPath:$,shallowClone:ee,deepClone:ae,getObjectDiff:le,asap:Y,minKey:Xt,addons:[],connections:er,errnames:ke,dependencies:function(){try{return{indexedDB:L.indexedDB||L.mozIndexedDB||L.webkitIndexedDB||L.msIndexedDB,IDBKeyRange:L.IDBKeyRange||L.webkitIDBKeyRange}}catch(e){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:Yt,version:Yt.split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,r){return e+t/Math.pow(10,2*r)})),default:pn,Dexie:pn})),pn.maxKey=xr(pn.dependencies.IDBKeyRange),function(e){try{rn=function(e){var t,r=e&&"function"==typeof e.databases;if(!r){var n=new dn(or,{addons:[]});n.version(1).stores({dbnames:"name"}),t=n.table("dbnames")}return{getDatabaseNames:function(){return r?ht.resolve(e.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==or}))})):t.toCollection().primaryKeys()},add:function(e){return!r&&e!==or&&t.put({name:e}).catch(Le)},remove:function(e){return!r&&e!==or&&t.delete(e).catch(Le)}}}(e)}catch(e){}}(dn.dependencies.indexedDB),ht.rejectionMapper=function(e,t){if(!e||e instanceof Ce||e instanceof TypeError||e instanceof SyntaxError||!e.name||!xe[e.name])return e;var r=new xe[e.name](t||e.message,e);return"stack"in e&&Q(r,"stack",{get:function(){return this.inner.stack}}),r},Ae(ve,ir);function gn(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var vn=new(function(e){l(r,e);var t=gn(r);function r(){var e;return a(this,r),(e=t.call(this,"AgoraLogger")).logs=void 0,e.openDatabase(),e.logs=e.table("logs"),e}return c(r,[{key:"openDatabase",value:function(){this.version(1).stores({logs:"++id, content, created_at"})}}]),r}(dn));function An(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var mn,yn=function(){function e(){a(this,e),this._lastObjectIndex=-1,this.thread=new k}var t,r,n;return c(e,[{key:"collectConsoleLogs",value:(n=o(v().mark((function e(){var t,r,n,i=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="",e.next=3,vn.logs.each((function(e){t+=e.content+"\n",i._lastObjectIndex=e.id}));case 3:return r=+Date.now(),n=new File([t],"".concat(r)),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"cleanupConsoleLogs",value:(r=o(v().mark((function e(){var t;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,vn.logs.where("id").belowOrEqual(this._lastObjectIndex).delete();case 2:t=e.sent,console.log("[logger] delete ".concat(t," logs"));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"_addLocalFolderAsync",value:function(e,t){return new Promise((function(r,n){e.addLocalFolderAsync(t,(function(e,t){if(t)return n(t);r()}))}))}},{key:"_readFile",value:function(e){return new Promise((function(t,r){window.require("fs").readFile(e,(function(e,n){return e?r(e):t(n)}))}))}},{key:"collectElectronLogs",value:(t=o(v().mark((function e(t,r){var n,i,o,a,s,c;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=+Date.now(),i=window.require("adm-zip"),o=window.require("path"),a=new i,e.next=6,this._addLocalFolderAsync(a,r);case 6:return s=o.resolve(t,"logs.zip"),a.writeZip(s),e.next=10,this._readFile(s);case 10:return c=e.sent,e.abrupt("return",new File([c],"".concat(n)));case 12:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}],[{key:"warn",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.log.apply(e,[On.WARN].concat(r))}},{key:"debug",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.log.apply(e,[On.DEBUG].concat(r))}},{key:"info",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.log.apply(e,[On.INFO].concat(r))}},{key:"error",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.log.apply(e,[On.ERROR].concat(r))}},{key:"log",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=Fn.logLevel;if(!(e>o)){var a="AgoraEdu-SDK [".concat(e,"]: "),s=[],c=(_(t={},"".concat(On.WARN),{call:function(){s=[a].concat(n),console.warn.apply(console,s)}}),_(t,"".concat(On.DEBUG),{call:function(){s=[a].concat(n),console.debug.apply(console,s)}}),_(t,"".concat(On.INFO),{call:function(){s=[a].concat(n),console.info.apply(console,s)}}),_(t,"".concat(On.ERROR),{call:function(){s=[a].concat(n),console.error.apply(console,s)}}),t),u="".concat(e);c.hasOwnProperty(u)?c[u].call():(s=[a].concat(n),console.log.apply(console,s))}}},{key:"setupConsoleHijack",value:function(){var t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?An(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):An(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e.originConsole);if(t.__hijackSetup)t.log("[logger] hijack already setup!");else{t.log("[logger] setup hijack..");var r=this.logger.thread,n=function(e,t){return"".concat(C()().format("YYYY-MM-DD HH:mm:ss")," ").concat((0,S.upperCase)(e||"unknown")," ").concat((0,S.escape)(t))};Object.keys(t).filter((function(e){return["info","error","warn","log","debug"].indexOf(e)>=0})).forEach((function(e,i){t[e]=function(e,t){return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=n(t.name,o.join(" "));r.postMessage({type:"log",data:s}),t.apply(e,o)}}(t,t[e])})),t.__hijackSetup=!0,window.console=t}}},{key:"restoreConsoleHijack",value:function(){console.log("[logger] restore hijack.."),window.console=e.originConsole,console.__hijackSetup=!1}}]),e}();yn.logger=new yn,yn.originConsole=window.console;var _n=new Uint8Array(16);function bn(){if(!mn&&!(mn="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 mn(_n)}const En=/^(?:[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 wn=function(e){return"string"==typeof e&&En.test(e)};for(var In=[],Cn=0;Cn<256;++Cn)In.push((Cn+256).toString(16).substr(1));const Sn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(In[e[t+0]]+In[e[t+1]]+In[e[t+2]]+In[e[t+3]]+"-"+In[e[t+4]]+In[e[t+5]]+"-"+In[e[t+6]]+In[e[t+7]]+"-"+In[e[t+8]]+In[e[t+9]]+"-"+In[e[t+10]]+In[e[t+11]]+In[e[t+12]]+In[e[t+13]]+In[e[t+14]]+In[e[t+15]]).toLowerCase();if(!wn(r))throw TypeError("Stringified UUID is invalid");return r};const Tn=function(e,t,r){var n=(e=e||{}).random||(e.rng||bn)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return Sn(n)};function Rn(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var kn,On,Nn,xn,Dn,Ln=function(e){l(r,e);var t=Rn(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r)}(y),Pn=function(e){l(r,e);var t=Rn(r);function r(e,n,i){var o;return a(this,r),(o=t.call(this))._extra=i,o.id=Tn(),o.original=void 0,o.codeList=void 0,o.message=n.message,o.original=n,o.codeList=[e],o.stack=n.stack,o}return c(r,[{key:"servCode",get:function(){var e;return null===(e=this._extra)||void 0===e?void 0:e.servCode}}],[{key:"isOf",value:function(e){if(!(e instanceof r))return!1;for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return n.includes(e.servCode)}}]),r}(w(Error)),Bn=function(e,t){return t instanceof Pn?(t.codeList.push(e),t):new Pn(e,t)},Mn=function(e){l(r,e);var t=Rn(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r,[{key:"_handleError",value:function(e,t){var r=(null==t?void 0:t.stack)||(null==t?void 0:t.message);yn.error("[RteErrorCenter] error ".concat(e,": ").concat(r))}},{key:"handleThrowableError",value:function(e,t){var r=Bn(e,t);throw this._handleError(e,r),r}},{key:"handleNonThrowableError",value:function(e,t){var r=Bn(e,t);this._handleError(e,r)}}]),r}(Ln);function jn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Un(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jn(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Mn.shared=new Mn,function(e){e.RTE_ERR_MISSING_PARAMS="100000",e.RTE_ERR_SCENE_NOT_READY="100001",e.RTE_ERR_INVALID_DATA_STRUCT="100002",e.RTE_ERR_LOG_UPLOAD_FAIL="100003",e.RTE_ERR_RESTFUL_SERVICE_ERR="100004",e.RTE_ERR_RESTFUL_HTTP_CLIENT_ERR="100005",e.RTE_ERR_AGORA_FETCH_ERR="100006",e.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR="100007",e.RTE_ERR_WEB_LOG_UPLOAD_ERR="100008",e.RTE_ERR_JOIN_SCENE_FAILED="100009",e.RTE_ERR_LEAVE_SCENE_FAIL="100010",e.RTE_ERR_EVENT_CALLBACK_ERR="100011",e.RTE_ERR_SCENE_ALREADY_JOINED="100012",e.RTE_ERR_ENGINE_NOT_READY="100013",e.RTE_ERR_CONFIG_NOT_READY="100014",e.RTE_ERR_RESTFUL_NETWORK_ERR="100015",e.RTE_ERR_RESTFUL_NETWORK_TIMEOUT_ERR="100016",e.RTE_ERR_LOCAL_USER_NOT_EXIST="100017",e.RTM_ERR_LOGGED_IN_ALREADY="200000",e.RTM_ERR_JOIN_FAILED="200001",e.RTM_ERR_LEAVE_FAILED="200002",e.RTM_ERR_DESTROY_FAILED="200003",e.RTM_ERR_LOGIN_FAIL="200004",e.RTM_ERR_REGION_NOT_SPECIFIED="200005",e.RTC_ERR_CAM_ERR="300000",e.RTC_ERR_MIC_ERR="300001",e.RTC_ERR_TRACK_PUBLISH_FAIL="300002",e.RTC_ERR_TRACK_UNPUBLISH_FAIL="300003",e.RTC_ERR_TRACK_SUBSCRIBE_FAIL="300004",e.RTC_ERR_TRACK_UNSUBSCRIBE_FAIL="300005",e.RTC_ERR_NO_CHANNEL_EXISTS="300006",e.RTC_ERR_INVALID_CANVAS="300007",e.RTC_ERR_SCREEN_SHARE_ERR="300008",e.RTC_ERR_CLIENT_LEAVE_CHANNEL_FAIL="300009",e.RTC_ERR_LEAVE_MAIN_CHANNEL_FAIL="300010",e.RTC_ERR_LEAVE_SUB_CHANNEL_FAIL="300011",e.RTC_ERR_LEAVE_CHANNEL_FAIL="300012",e.RTC_ERR_VDM_GET_DEVICES_FAIL="300013",e.RTC_ERR_ADM_GET_RECORD_DEVICES_FAIL="300014",e.RTC_ERR_ADM_GET_PLAYBACK_DEVICES_FAIL="300015",e.RTC_ERR_REGION_NOT_SPECIFIED="300016",e.RTC_ERR_RTC_ENGINE_INITIALZIE_FAILED="300017",e.RTC_ERR_RTC_VDM_NOT_READY="300018",e.RTC_ERR_RTC_ADM_NOT_READY="300019"}(kn||(kn={})),function(e){e[e.OFF=0]="OFF",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e[e.VERBOSE=5]="VERBOSE"}(On||(On={})),function(e){e[e.Electron=0]="Electron",e[e.Web=1]="Web"}(Nn||(Nn={})),function(e){e.zh="zh",e.en="en"}(xn||(xn={})),function(e){e.CN="CN",e.AP="AP",e.EU="EU",e.NA="NA"}(Dn||(Dn={}));var Fn=function(){function e(t,r){a(this,e),this.appId=void 0,this.service={},this.rtcConfigs={},this.logFilePath=void 0,this.rtcSDKParameters=[],this.userId="",this.token="",this.ignoreUrlRegionPrefix=!1,this.language=xn.zh,this.debugI18n=!1,this.region=Dn.CN,this.SCENE_JOIN_RETRY_ATTEMPTS=3,this.appId=t,r&&(r.language&&(this.language=r.language),r.region&&(this.region=r.region),r.rtcConfigs&&(this.rtcConfigs=Un(Un({},this.rtcConfigs),r.rtcConfigs)),r.rtcSDKParameters&&(this.rtcSDKParameters=r.rtcSDKParameters))}return c(e,null,[{key:"shared",get:function(){return this._config?this._config:Mn.shared.handleThrowableError(kn.RTE_ERR_CONFIG_NOT_READY,new Error("classroom config not ready"))}},{key:"setConfig",value:function(e){this._config=e}},{key:"platform",get:function(){return navigator.userAgent.toLowerCase().indexOf(" electron/")>-1?Nn.Electron:Nn.Web}},{key:"version",get:function(){return"2.5.1"}}]),e}();Fn._config=void 0,Fn.logLevel=On.DEBUG;__webpack_require__(4812),__webpack_require__(1249),__webpack_require__(9826),__webpack_require__(2707),__webpack_require__(2564);var Qn,qn,Gn=function(e,t){var r=e.__$$ignoreMethods||[];r=r.concat(t),e.__$$ignoreMethods=r};__webpack_require__(7727),__webpack_require__(6210);function Vn(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}!function(e){e[e.pre=0]="pre",e[e.post=1]="post"}(Qn||(Qn={})),qn||(qn={});var Kn=function(e,t,r){if(!r)try{return e.apply(null,t)}catch(e){}},Hn=function(e,t,r,n,i,o,a){var s=function(e,t){return e.__$$ignoreMethods&&e.__$$ignoreMethods.indexOf(t)>-1}(r,n);Kn(o,[{type:Qn.pre,arguments:i,method:n,class:r.constructor.name,context:a}],s);var c,u,l=t.apply(e,i),h=function(e,t){Kn(o,[{type:Qn.post,arguments:i,return:e,method:n,class:r.constructor.name,context:a,error:t}],s)};l&&!!l.then?l.then((function(e){c=e})).catch((function(e){u=e})).finally((function(){h(c,u)})):h(l);return l},zn=function(e,t,r,n,i){return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return Hn(this,e,t,r,a,n,i)}},Wn=function(e){return Object.getOwnPropertyNames(e).filter((function(t){return"function"==typeof e[t]}))},Yn=function(){},Jn=function(e){var t=yn[e]||Yn;return function(e){if(e.type===Qn.pre){var r;e.context.start=(new Date).getTime();var n=["[".concat(e.class,"] >>> [").concat(e.method,"]")];(null===(r=e.arguments)||void 0===r?void 0:r.length)&&n.push(", args:",e.arguments),t.apply(void 0,n)}else{var i=(new Date).getTime()-e.context.start,o=["[".concat(e.class,"] <<< [").concat(e.method,"]")];e.return&&o.push(", return:",e.return),e.error&&o.push(", err:",e.error),o.push(", Time elapsed: ".concat(i,"ms")),t.apply(void 0,o)}}},Xn=(__webpack_require__(3371),{info:function(e,t,r){var n=Jn("info"),i=e[t],o=zn(i,e,t,n,{});return{configurable:!0,enumerable:!1,get:function(){return o.bind(this)}}},warn:function(e,t,r){var n=Jn("warn"),i=e[t],o=zn(i,e,t,n,{});return{configurable:!0,enumerable:!1,get:function(){return o.bind(this)}}},error:function(e,t,r){var n=Jn("error"),i=e[t],o=zn(i,e,t,n,{});return{configurable:!0,enumerable:!1,get:function(){return o.bind(this)}}},attach:function(e){var t=e.level,r=void 0===t?On.INFO:t,n=e.proxyMethods,i=void 0===n||n;return function(e){var t=Jn([,"error","warn","info","info","info"][r]),n=function(e){return Object.freeze({info:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];yn.info.apply(yn,["[".concat(e.name,"]")].concat(r))},warn:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];yn.warn.apply(yn,["[".concat(e.name,"]")].concat(r))},error:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];yn.error.apply(yn,["[".concat(e.name,"]")].concat(r))},debug:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];yn.debug.apply(yn,["[".concat(e.name,"]")].concat(r))}})}(e);return function(e,t,r,n,i){var o=e.prototype;return function(e){l(u,e);var s=Vn(u);function u(){var e;a(this,u);for(var c=arguments.length,l=new Array(c),h=0;h<c;h++)l[h]=arguments[h];(e=s.call.apply(s,[this].concat(l)),Gn(o,[]),i)&&Wn(o).forEach((function(n){var i=o[n];e[n]=zn(i,o,n,t,r).bind(f(e))}));return Object.keys(n).forEach((function(t){e[t]=n[t]})),e}return c(u)}(e)}(e,t,{},{logger:n},i)}},silence:function(e,t){Gn(e,[t])}});function Zn(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||r(e)||function(){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__(4916),__webpack_require__(3123),__webpack_require__(561),__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__(5827);var $n=32,ei=31,ti={};function ri(e){e&&(e.value=!0)}function ni(){}function ii(e){return void 0===e.size&&(e.size=e.__iterate(ai)),e.size}function oi(e,t){if("number"!=typeof t){var r=t>>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?ii(e)+t:t}function ai(){return!0}function si(e,t,r){return(0===e&&!hi(e)||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function ci(e,t){return li(e,t,0)}function ui(e,t){return li(e,t,t)}function li(e,t,r){return void 0===e?r:hi(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function hi(e){return e<0||0===e&&1/e==-1/0}var fi="@@__IMMUTABLE_ITERABLE__@@";function di(e){return Boolean(e&&e[fi])}var pi="@@__IMMUTABLE_KEYED__@@";function gi(e){return Boolean(e&&e[pi])}var vi="@@__IMMUTABLE_INDEXED__@@";function Ai(e){return Boolean(e&&e[vi])}function mi(e){return gi(e)||Ai(e)}var yi=function(e){return di(e)?e:qi(e)},_i=function(e){function t(e){return gi(e)?e:Gi(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(yi),bi=function(e){function t(e){return Ai(e)?e:Vi(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(yi),Ei=function(e){function t(e){return di(e)&&!mi(e)?e:Ki(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(yi);yi.Keyed=_i,yi.Indexed=bi,yi.Set=Ei;var wi="@@__IMMUTABLE_SEQ__@@";function Ii(e){return Boolean(e&&e[wi])}var Ci="@@__IMMUTABLE_RECORD__@@";function Si(e){return Boolean(e&&e[Ci])}function Ti(e){return di(e)||Si(e)}var Ri="@@__IMMUTABLE_ORDERED__@@";function ki(e){return Boolean(e&&e[Ri])}var Oi="function"==typeof Symbol&&Symbol.iterator,Ni="@@iterator",xi=Oi||Ni,Di=function(e){this.next=e};function Li(e,t,r,n){var i=0===e?t:1===e?r:[t,r];return n?n.value=i:n={value:i,done:!1},n}function Pi(){return{value:void 0,done:!0}}function Bi(e){return!!Array.isArray(e)||!!Ui(e)}function Mi(e){return e&&"function"==typeof e.next}function ji(e){var t=Ui(e);return t&&t.call(e)}function Ui(e){var t=e&&(Oi&&e[Oi]||e["@@iterator"]);if("function"==typeof t)return t}Di.prototype.toString=function(){return"[Iterator]"},Di.KEYS=0,Di.VALUES=1,Di.ENTRIES=2,Di.prototype.inspect=Di.prototype.toSource=function(){return this.toString()},Di.prototype[xi]=function(){return this};var Fi=Object.prototype.hasOwnProperty;function Qi(e){return!(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var qi=function(e){function t(e){return null==e?Ji():Ti(e)?e.toSeq():function(e){var t=$i(e);if(t)return(n=Ui(r=e))&&n===r.entries?t.fromEntrySeq():function(e){var t=Ui(e);return t&&t===e.keys}(e)?t.toSetSeq():t;var r,n;if("object"==typeof e)return new zi(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(e,t){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[t?n-++i:i++];if(!1===e(o[1],o[0],this))break}return i}return this.__iterateUncached(e,t)},t.prototype.__iterator=function(e,t){var r=this._cache;if(r){var n=r.length,i=0;return new Di((function(){if(i===n)return{value:void 0,done:!0};var o=r[t?n-++i:i++];return Li(e,o[0],o[1])}))}return this.__iteratorUncached(e,t)},t}(yi),Gi=function(e){function t(e){return null==e?Ji().toKeyedSeq():di(e)?gi(e)?e.toSeq():e.fromEntrySeq():Si(e)?e.toSeq():Xi(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(qi),Vi=function(e){function t(e){return null==e?Ji():di(e)?gi(e)?e.entrySeq():e.toIndexedSeq():Si(e)?e.toSeq().entrySeq():Zi(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(qi),Ki=function(e){function t(e){return(di(e)&&!mi(e)?e:Vi(e)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(qi);qi.isSeq=Ii,qi.Keyed=Gi,qi.Set=Ki,qi.Indexed=Vi,qi.prototype[wi]=!0;var Hi=function(e){function t(e){this._array=e,this.size=e.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this.has(e)?this._array[oi(this,e)]:t},t.prototype.__iterate=function(e,t){for(var r=this._array,n=r.length,i=0;i!==n;){var o=t?n-++i:i++;if(!1===e(r[o],o,this))break}return i},t.prototype.__iterator=function(e,t){var r=this._array,n=r.length,i=0;return new Di((function(){if(i===n)return{value:void 0,done:!0};var o=t?n-++i:i++;return Li(e,o,r[o])}))},t}(Vi),zi=function(e){function t(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},t.prototype.has=function(e){return Fi.call(this._object,e)},t.prototype.__iterate=function(e,t){for(var r=this._object,n=this._keys,i=n.length,o=0;o!==i;){var a=n[t?i-++o:o++];if(!1===e(r[a],a,this))break}return o},t.prototype.__iterator=function(e,t){var r=this._object,n=this._keys,i=n.length,o=0;return new Di((function(){if(o===i)return{value:void 0,done:!0};var a=n[t?i-++o:o++];return Li(e,a,r[a])}))},t}(Gi);zi.prototype[Ri]=!0;var Wi,Yi=function(e){function t(e){this._collection=e,this.size=e.length||e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var r=ji(this._collection),n=0;if(Mi(r))for(var i;!(i=r.next()).done&&!1!==e(i.value,n++,this););return n},t.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=ji(this._collection);if(!Mi(r))return new Di(Pi);var n=0;return new Di((function(){var t=r.next();return t.done?t:Li(e,n++,t.value)}))},t}(Vi);function Ji(){return Wi||(Wi=new Hi([]))}function Xi(e){var t=$i(e);if(t)return t.fromEntrySeq();if("object"==typeof e)return new zi(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function Zi(e){var t=$i(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function $i(e){return Qi(e)?new Hi(e):Bi(e)?new Yi(e):void 0}var eo="@@__IMMUTABLE_MAP__@@";function to(e){return Boolean(e&&e[eo])}function ro(e){return to(e)&&ki(e)}function no(e){return Boolean(e&&"function"==typeof e.equals&&"function"==typeof e.hashCode)}function io(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!!(no(e)&&no(t)&&e.equals(t))}var oo="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var r=65535&(e|=0),n=65535&(t|=0);return r*n+((e>>>16)*n+r*(t>>>16)<<16>>>0)|0};function ao(e){return e>>>1&1073741824|3221225471&e}var so=Object.prototype.valueOf;function co(e){if(null==e)return uo(e);if("function"==typeof e.hashCode)return ao(e.hashCode(e));var t,r=(t=e).valueOf!==so&&"function"==typeof t.valueOf?t.valueOf(t):t;if(null==r)return uo(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(e){if(e!=e||e===1/0)return 0;var t=0|e;t!==e&&(t^=4294967295*e);for(;e>4294967295;)t^=e/=4294967295;return ao(t)}(r);case"string":return r.length>_o?function(e){var t=wo[e];void 0===t&&(t=lo(e),Eo===bo&&(Eo=0,wo={}),Eo++,wo[e]=t);return t}(r):lo(r);case"object":case"function":return function(e){var t;if(vo&&void 0!==(t=go.get(e)))return t;if(void 0!==(t=e[yo]))return t;if(!fo){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[yo]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=po(),vo)go.set(e,t);else{if(void 0!==ho&&!1===ho(e))throw new Error("Non-extensible objects are not allowed as keys.");if(fo)Object.defineProperty(e,yo,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[yo]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[yo]=t}}return t}(r);case"symbol":return function(e){var t=Ao[e];if(void 0!==t)return t;return t=po(),Ao[e]=t,t}(r);default:if("function"==typeof r.toString)return lo(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function uo(e){return null===e?1108378658:1108378659}function lo(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return ao(t)}var ho=Object.isExtensible,fo=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();function po(){var e=++mo;return 1073741824&mo&&(mo=0),e}var go,vo="function"==typeof WeakMap;vo&&(go=new WeakMap);var Ao=Object.create(null),mo=0,yo="__immutablehash__";"function"==typeof Symbol&&(yo=Symbol(yo));var _o=16,bo=255,Eo=0,wo={},Io=function(e){function t(e,t){this._iter=e,this._useKeys=t,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this._iter.get(e,t)},t.prototype.has=function(e){return this._iter.has(e)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var e=this,t=Oo(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},t.prototype.map=function(e,t){var r=this,n=ko(this,e,t);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(e,t)}),n},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t,n){return e(t,n,r)}),t)},t.prototype.__iterator=function(e,t){return this._iter.__iterator(e,t)},t}(Gi);Io.prototype[Ri]=!0;var Co=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(e){return this._iter.includes(e)},t.prototype.__iterate=function(e,t){var r=this,n=0;return t&&ii(this),this._iter.__iterate((function(i){return e(i,t?r.size-++n:n++,r)}),t)},t.prototype.__iterator=function(e,t){var r=this,n=this._iter.__iterator(1,t),i=0;return t&&ii(this),new Di((function(){var o=n.next();return o.done?o:Li(e,t?r.size-++i:i++,o.value,o)}))},t}(Vi),So=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(e){return this._iter.includes(e)},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){return e(t,t,r)}),t)},t.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new Di((function(){var t=r.next();return t.done?t:Li(e,t.value,t.value,t)}))},t}(Ki),To=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){if(t){Qo(t);var n=di(t);return e(n?t.get(1):t[1],n?t.get(0):t[0],r)}}),t)},t.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new Di((function(){for(;;){var t=r.next();if(t.done)return t;var n=t.value;if(n){Qo(n);var i=di(n);return Li(e,i?n.get(0):n[0],i?n.get(1):n[1],t)}}}))},t}(Gi);function Ro(e){var t=Go(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Vo,t.__iterateUncached=function(t,r){var n=this;return e.__iterate((function(e,r){return!1!==t(r,e,n)}),r)},t.__iteratorUncached=function(t,r){if(2===t){var n=e.__iterator(t,r);return new Di((function(){var e=n.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,r)},t}function ko(e,t,r){var n=Go(e);return n.size=e.size,n.has=function(t){return e.has(t)},n.get=function(n,i){var o=e.get(n,ti);return o===ti?i:t.call(r,o,n,e)},n.__iterateUncached=function(n,i){var o=this;return e.__iterate((function(e,i,a){return!1!==n(t.call(r,e,i,a),i,o)}),i)},n.__iteratorUncached=function(n,i){var o=e.__iterator(2,i);return new Di((function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return Li(n,s,t.call(r,a[1],s,e),i)}))},n}function Oo(e,t){var r=this,n=Go(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Ro(e);return t.reverse=function(){return e.flip()},t}),n.get=function(r,n){return e.get(t?r:-1-r,n)},n.has=function(r){return e.has(t?r:-1-r)},n.includes=function(t){return e.includes(t)},n.cacheResult=Vo,n.__iterate=function(r,n){var i=this,o=0;return n&&ii(e),e.__iterate((function(e,a){return r(e,t?a:n?i.size-++o:o++,i)}),!n)},n.__iterator=function(n,i){var o=0;i&&ii(e);var a=e.__iterator(2,!i);return new Di((function(){var e=a.next();if(e.done)return e;var s=e.value;return Li(n,t?s[0]:i?r.size-++o:o++,s[1],e)}))},n}function No(e,t,r,n){var i=Go(e);return n&&(i.has=function(n){var i=e.get(n,ti);return i!==ti&&!!t.call(r,i,n,e)},i.get=function(n,i){var o=e.get(n,ti);return o!==ti&&t.call(r,o,n,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate((function(e,o,c){if(t.call(r,e,o,c))return s++,i(e,n?o:s-1,a)}),o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(2,o),s=0;return new Di((function(){for(;;){var o=a.next();if(o.done)return o;var c=o.value,u=c[0],l=c[1];if(t.call(r,l,u,e))return Li(i,n?u:s++,l,o)}}))},i}function xo(e,t,r,n){var i=e.size;if(si(t,r,i))return e;var o=ci(t,i),a=ui(r,i);if(o!=o||a!=a)return xo(e.toSeq().cacheResult(),t,r,n);var s,c=a-o;c==c&&(s=c<0?0:c);var u=Go(e);return u.size=0===s?s:e.size&&s||void 0,!n&&Ii(e)&&s>=0&&(u.get=function(t,r){return(t=oi(this,t))>=0&&t<s?e.get(t+o,r):r}),u.__iterateUncached=function(t,r){var i=this;if(0===s)return 0;if(r)return this.cacheResult().__iterate(t,r);var a=0,c=!0,u=0;return e.__iterate((function(e,r){if(!c||!(c=a++<o))return u++,!1!==t(e,n?r:u-1,i)&&u!==s})),u},u.__iteratorUncached=function(t,r){if(0!==s&&r)return this.cacheResult().__iterator(t,r);if(0===s)return new Di(Pi);var i=e.__iterator(t,r),a=0,c=0;return new Di((function(){for(;a++<o;)i.next();if(++c>s)return{value:void 0,done:!0};var e=i.next();return n||1===t||e.done?e:Li(t,c-1,0===t?void 0:e.value[1],e)}))},u}function Do(e,t,r,n){var i=Go(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,c=0;return e.__iterate((function(e,o,u){if(!s||!(s=t.call(r,e,o,u)))return c++,i(e,n?o:c-1,a)})),c},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(2,o),c=!0,u=0;return new Di((function(){var e,o,l;do{if((e=s.next()).done)return n||1===i?e:Li(i,u++,0===i?void 0:e.value[1],e);var h=e.value;o=h[0],l=h[1],c&&(c=t.call(r,l,o,a))}while(c);return 2===i?e:Li(i,o,l,e)}))},i}function Lo(e,t){var r=gi(e),n=[e].concat(t).map((function(e){return di(e)?r&&(e=_i(e)):e=r?Xi(e):Zi(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===n.length)return e;if(1===n.length){var i=n[0];if(i===e||r&&gi(i)||Ai(e)&&Ai(i))return i}var o=new Hi(n);return r?o=o.toKeyedSeq():Ai(e)||(o=o.toSetSeq()),(o=o.flatten(!0)).size=n.reduce((function(e,t){if(void 0!==e){var r=t.size;if(void 0!==r)return e+r}}),0),o}function Po(e,t,r){var n=Go(e);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var a=0,s=!1;return function e(c,u){c.__iterate((function(o,c){return(!t||u<t)&&di(o)?e(o,u+1):(a++,!1===i(o,r?c:a-1,n)&&(s=!0)),!s}),o)}(e,0),a},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var o=e.__iterator(n,i),a=[],s=0;return new Di((function(){for(;o;){var e=o.next();if(!1===e.done){var c=e.value;if(2===n&&(c=c[1]),t&&!(a.length<t)||!di(c))return r?e:Li(n,s++,c,e);a.push(o),o=c.__iterator(n,i)}else o=a.pop()}return{value:void 0,done:!0}}))},n}function Bo(e,t,r){t||(t=Ko);var n=gi(e),i=0,o=e.toSeq().map((function(t,n){return[n,t,i++,r?r(t,n,e):t]})).valueSeq().toArray();return o.sort((function(e,r){return t(e[3],r[3])||e[2]-r[2]})).forEach(n?function(e,t){o[t].length=2}:function(e,t){o[t]=e[1]}),n?Gi(o):Ai(e)?Vi(o):Ki(o)}function Mo(e,t,r){if(t||(t=Ko),r){var n=e.toSeq().map((function(t,n){return[t,r(t,n,e)]})).reduce((function(e,r){return jo(t,e[1],r[1])?r:e}));return n&&n[0]}return e.reduce((function(e,r){return jo(t,e,r)?r:e}))}function jo(e,t,r){var n=e(r,t);return 0===n&&r!==t&&(null==r||r!=r)||n>0}function Uo(e,t,r,n){var i=Go(e),o=new Hi(r).map((function(e){return e.size}));return i.size=n?o.max():o.min(),i.__iterate=function(e,t){for(var r,n=this.__iterator(1,t),i=0;!(r=n.next()).done&&!1!==e(r.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map((function(e){return e=yi(e),ji(i?e.reverse():e)})),a=0,s=!1;return new Di((function(){var r;return s||(r=o.map((function(e){return e.next()})),s=n?r.every((function(e){return e.done})):r.some((function(e){return e.done}))),s?{value:void 0,done:!0}:Li(e,a++,t.apply(null,r.map((function(e){return e.value}))))}))},i}function Fo(e,t){return e===t?e:Ii(e)?t:e.constructor(t)}function Qo(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function qo(e){return gi(e)?_i:Ai(e)?bi:Ei}function Go(e){return Object.create((gi(e)?Gi:Ai(e)?Vi:Ki).prototype)}function Vo(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):qi.prototype.cacheResult.call(this)}function Ko(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e<t?-1:0}function Ho(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),i=0;i<r;i++)n[i]=e[i+t];return n}function zo(e,t){if(!e)throw new Error(t)}function Wo(e){zo(e!==1/0,"Cannot perform this action with an infinite size.")}function Yo(e){if(Qi(e)&&"string"!=typeof e)return e;if(ki(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}Co.prototype.cacheResult=Io.prototype.cacheResult=So.prototype.cacheResult=To.prototype.cacheResult=Vo;var Jo=Object.prototype.toString;function Xo(e){if(!e||"object"!=typeof e||"[object Object]"!==Jo.call(e))return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var r=t,n=Object.getPrototypeOf(t);null!==n;)r=n,n=Object.getPrototypeOf(r);return r===t}function Zo(e){return"object"==typeof e&&(Ti(e)||Array.isArray(e)||Xo(e))}function $o(e){try{return"string"==typeof e?JSON.stringify(e):String(e)}catch(t){return JSON.stringify(e)}}function ea(e,t){return Ti(e)?e.has(t):Zo(e)&&Fi.call(e,t)}function ta(e,t,r){return Ti(e)?e.get(t,r):ea(e,t)?"function"==typeof e.get?e.get(t):e[t]:r}function ra(e){if(Array.isArray(e))return Ho(e);var t={};for(var r in e)Fi.call(e,r)&&(t[r]=e[r]);return t}function na(e,t){if(!Zo(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Ti(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!Fi.call(e,t))return e;var r=ra(e);return Array.isArray(r)?r.splice(t,1):delete r[t],r}function ia(e,t,r){if(!Zo(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Ti(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,r)}if(Fi.call(e,t)&&r===e[t])return e;var n=ra(e);return n[t]=r,n}function oa(e,t,r,n){n||(n=r,r=void 0);var i=aa(Ti(e),e,Yo(t),0,r,n);return i===ti?r:i}function aa(e,t,r,n,i,o){var a=t===ti;if(n===r.length){var s=a?i:t,c=o(s);return c===s?t:c}if(!a&&!Zo(t))throw new TypeError("Cannot update within non-data-structure value in path ["+r.slice(0,n).map($o)+"]: "+t);var u=r[n],l=a?ti:ta(t,u,ti),h=aa(l===ti?e:Ti(l),l,r,n+1,i,o);return h===l?t:h===ti?na(t,u):ia(a?e?Ua():{}:t,u,h)}function sa(e,t,r){return oa(e,t,ti,(function(){return r}))}function ca(e,t){return sa(this,e,t)}function ua(e,t){return oa(e,t,(function(){return ti}))}function la(e){return ua(this,e)}function ha(e,t,r,n){return oa(e,[t],r,n)}function fa(e,t,r){return 1===arguments.length?e(this):ha(this,e,t,r)}function da(e,t,r){return oa(this,e,t,r)}function pa(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return va(this,e)}function ga(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return va(this,t,e)}function va(e,t,r){for(var n=[],i=0;i<t.length;i++){var o=_i(t[i]);0!==o.size&&n.push(o)}return 0===n.length?e:0!==e.toSeq().size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var t=r?function(t,n){ha(e,n,ti,(function(e){return e===ti?t:r(e,t,n)}))}:function(t,r){e.set(r,t)},i=0;i<n.length;i++)n[i].forEach(t)})):e.constructor(n[0])}function Aa(e,t,r){return ma(e,t,function(e){function t(r,n,i){return Zo(r)&&Zo(n)&&(o=n,a=qi(r),s=qi(o),Ai(a)===Ai(s)&&gi(a)===gi(s))?ma(r,[n],t):e?e(r,n,i):n;var o,a,s}return t}(r))}function ma(e,t,r){if(!Zo(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(Ti(e))return"function"==typeof r&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),i=e,o=n?bi:_i,a=n?function(t){i===e&&(i=ra(i)),i.push(t)}:function(t,n){var o=Fi.call(i,n),a=o&&r?r(i[n],t,n):t;o&&a===i[n]||(i===e&&(i=ra(i)),i[n]=a)},s=0;s<t.length;s++)o(t[s]).forEach(a);return i}function ya(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Aa(this,e)}function _a(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Aa(this,t,e)}function ba(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return oa(this,e,Ua(),(function(e){return ma(e,t)}))}function Ea(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return oa(this,e,Ua(),(function(e){return Aa(e,t)}))}function wa(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function Ia(){return this.__ownerID?this:this.__ensureOwner(new ni)}function Ca(){return this.__ensureOwner()}function Sa(){return this.__altered}var Ta=function(e){function t(t){return null==t?Ua():to(t)&&!ki(t)?t:Ua().withMutations((function(r){var n=e(t);Wo(n.size),n.forEach((function(e,t){return r.set(t,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Ua().withMutations((function(t){for(var r=0;r<e.length;r+=2){if(r+1>=e.length)throw new Error("Missing value for key: "+e[r]);t.set(e[r],e[r+1])}}))},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},t.prototype.set=function(e,t){return Fa(this,e,t)},t.prototype.remove=function(e){return Fa(this,e,ti)},t.prototype.deleteAll=function(e){var t=yi(e);return 0===t.size?this:this.withMutations((function(e){t.forEach((function(t){return e.remove(t)}))}))},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Ua()},t.prototype.sort=function(e){return hs(Bo(this,e))},t.prototype.sortBy=function(e,t){return hs(Bo(this,t,e))},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){n.forEach((function(i,o){n.set(o,e.call(t,i,o,r))}))}))},t.prototype.__iterator=function(e,t){return new Pa(this,e,t)},t.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate((function(t){return n++,e(t[1],t[0],r)}),t),n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?ja(this.size,this._root,e,this.__hash):0===this.size?Ua():(this.__ownerID=e,this.__altered=!1,this)},t}(_i);Ta.isMap=to;var Ra=Ta.prototype;Ra[eo]=!0,Ra.delete=Ra.remove,Ra.removeAll=Ra.deleteAll,Ra.setIn=ca,Ra.removeIn=Ra.deleteIn=la,Ra.update=fa,Ra.updateIn=da,Ra.merge=Ra.concat=pa,Ra.mergeWith=ga,Ra.mergeDeep=ya,Ra.mergeDeepWith=_a,Ra.mergeIn=ba,Ra.mergeDeepIn=Ea,Ra.withMutations=wa,Ra.wasAltered=Sa,Ra.asImmutable=Ca,Ra["@@transducer/init"]=Ra.asMutable=Ia,Ra["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},Ra["@@transducer/result"]=function(e){return e.asImmutable()};var ka=function(e,t){this.ownerID=e,this.entries=t};ka.prototype.get=function(e,t,r,n){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(io(r,i[o][0]))return i[o][1];return n},ka.prototype.update=function(e,t,r,n,i,o,a){for(var s=i===ti,c=this.entries,u=0,l=c.length;u<l&&!io(n,c[u][0]);u++);var h=u<l;if(h?c[u][1]===i:s)return this;if(ri(a),(s||!h)&&ri(o),!s||1!==c.length){if(!h&&!s&&c.length>=Ha)return function(e,t,r,n){e||(e=new ni);for(var i=new Da(e,co(r),[r,n]),o=0;o<t.length;o++){var a=t[o];i=i.update(e,0,void 0,a[0],a[1])}return i}(e,c,n,i);var f=e&&e===this.ownerID,d=f?c:Ho(c);return h?s?u===l-1?d.pop():d[u]=d.pop():d[u]=[n,i]:d.push([n,i]),f?(this.entries=d,this):new ka(e,d)}};var Oa=function(e,t,r){this.ownerID=e,this.bitmap=t,this.nodes=r};Oa.prototype.get=function(e,t,r,n){void 0===t&&(t=co(r));var i=1<<((0===e?t:t>>>e)&ei),o=this.bitmap;return 0==(o&i)?n:this.nodes[Va(o&i-1)].get(e+5,t,r,n)},Oa.prototype.update=function(e,t,r,n,i,o,a){void 0===r&&(r=co(n));var s=(0===t?r:r>>>t)&ei,c=1<<s,u=this.bitmap,l=0!=(u&c);if(!l&&i===ti)return this;var h=Va(u&c-1),f=this.nodes,d=l?f[h]:void 0,p=Qa(d,e,t+5,r,n,i,o,a);if(p===d)return this;if(!l&&p&&f.length>=za)return function(e,t,r,n,i){for(var o=0,a=new Array($n),s=0;0!==r;s++,r>>>=1)a[s]=1&r?t[o++]:void 0;return a[n]=i,new Na(e,o+1,a)}(e,f,u,s,p);if(l&&!p&&2===f.length&&qa(f[1^h]))return f[1^h];if(l&&p&&1===f.length&&qa(p))return p;var g=e&&e===this.ownerID,v=l?p?u:u^c:u|c,A=l?p?Ka(f,h,p,g):function(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var i=new Array(n),o=0,a=0;a<n;a++)a===t&&(o=1),i[a]=e[a+o];return i}(f,h,g):function(e,t,r,n){var i=e.length+1;if(n&&t+1===i)return e[t]=r,e;for(var o=new Array(i),a=0,s=0;s<i;s++)s===t?(o[s]=r,a=-1):o[s]=e[s+a];return o}(f,h,p,g);return g?(this.bitmap=v,this.nodes=A,this):new Oa(e,v,A)};var Na=function(e,t,r){this.ownerID=e,this.count=t,this.nodes=r};Na.prototype.get=function(e,t,r,n){void 0===t&&(t=co(r));var i=(0===e?t:t>>>e)&ei,o=this.nodes[i];return o?o.get(e+5,t,r,n):n},Na.prototype.update=function(e,t,r,n,i,o,a){void 0===r&&(r=co(n));var s=(0===t?r:r>>>t)&ei,c=i===ti,u=this.nodes,l=u[s];if(c&&!l)return this;var h=Qa(l,e,t+5,r,n,i,o,a);if(h===l)return this;var f=this.count;if(l){if(!h&&--f<Wa)return function(e,t,r,n){for(var i=0,o=0,a=new Array(r),s=0,c=1,u=t.length;s<u;s++,c<<=1){var l=t[s];void 0!==l&&s!==n&&(i|=c,a[o++]=l)}return new Oa(e,i,a)}(e,u,f,s)}else f++;var d=e&&e===this.ownerID,p=Ka(u,s,h,d);return d?(this.count=f,this.nodes=p,this):new Na(e,f,p)};var xa=function(e,t,r){this.ownerID=e,this.keyHash=t,this.entries=r};xa.prototype.get=function(e,t,r,n){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(io(r,i[o][0]))return i[o][1];return n},xa.prototype.update=function(e,t,r,n,i,o,a){void 0===r&&(r=co(n));var s=i===ti;if(r!==this.keyHash)return s?this:(ri(a),ri(o),Ga(this,e,t,r,[n,i]));for(var c=this.entries,u=0,l=c.length;u<l&&!io(n,c[u][0]);u++);var h=u<l;if(h?c[u][1]===i:s)return this;if(ri(a),(s||!h)&&ri(o),s&&2===l)return new Da(e,this.keyHash,c[1^u]);var f=e&&e===this.ownerID,d=f?c:Ho(c);return h?s?u===l-1?d.pop():d[u]=d.pop():d[u]=[n,i]:d.push([n,i]),f?(this.entries=d,this):new xa(e,this.keyHash,d)};var Da=function(e,t,r){this.ownerID=e,this.keyHash=t,this.entry=r};Da.prototype.get=function(e,t,r,n){return io(r,this.entry[0])?this.entry[1]:n},Da.prototype.update=function(e,t,r,n,i,o,a){var s=i===ti,c=io(n,this.entry[0]);return(c?i===this.entry[1]:s)?this:(ri(a),s?void ri(o):c?e&&e===this.ownerID?(this.entry[1]=i,this):new Da(e,this.keyHash,[n,i]):(ri(o),Ga(this,e,t,co(n),[n,i])))},ka.prototype.iterate=xa.prototype.iterate=function(e,t){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(!1===e(r[t?i-n:n]))return!1},Oa.prototype.iterate=Na.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[t?i-n:n];if(o&&!1===o.iterate(e,t))return!1}},Da.prototype.iterate=function(e,t){return e(this.entry)};var La,Pa=function(e){function t(e,t,r){this._type=t,this._reverse=r,this._stack=e._root&&Ma(e._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var r=t.node,n=t.index++,i=void 0;if(r.entry){if(0===n)return Ba(e,r.entry)}else if(r.entries){if(n<=(i=r.entries.length-1))return Ba(e,r.entries[this._reverse?i-n:n])}else if(n<=(i=r.nodes.length-1)){var o=r.nodes[this._reverse?i-n:n];if(o){if(o.entry)return Ba(e,o.entry);t=this._stack=Ma(o,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}},t}(Di);function Ba(e,t){return Li(e,t[0],t[1])}function Ma(e,t){return{node:e,index:0,__prev:t}}function ja(e,t,r,n){var i=Object.create(Ra);return i.size=e,i._root=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Ua(){return La||(La=ja(0))}function Fa(e,t,r){var n,i;if(e._root){var o={value:!1},a={value:!1};if(n=Qa(e._root,e.__ownerID,0,void 0,t,r,o,a),!a.value)return e;i=e.size+(o.value?r===ti?-1:1:0)}else{if(r===ti)return e;i=1,n=new ka(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=i,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?ja(i,n):Ua()}function Qa(e,t,r,n,i,o,a,s){return e?e.update(t,r,n,i,o,a,s):o===ti?e:(ri(s),ri(a),new Da(t,n,[i,o]))}function qa(e){return e.constructor===Da||e.constructor===xa}function Ga(e,t,r,n,i){if(e.keyHash===n)return new xa(t,n,[e.entry,i]);var o,a=(0===r?e.keyHash:e.keyHash>>>r)&ei,s=(0===r?n:n>>>r)&ei,c=a===s?[Ga(e,t,r+5,n,i)]:(o=new Da(t,n,i),a<s?[e,o]:[o,e]);return new Oa(t,1<<a|1<<s,c)}function Va(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function Ka(e,t,r,n){var i=n?e:Ho(e);return i[t]=r,i}var Ha=8,za=16,Wa=8,Ya="@@__IMMUTABLE_LIST__@@";function Ja(e){return Boolean(e&&e[Ya])}var Xa=function(e){function t(t){var r=is();if(null==t)return r;if(Ja(t))return t;var n=e(t),i=n.size;return 0===i?r:(Wo(i),i>0&&i<$n?ns(0,i,5,null,new $a(n.toArray())):r.withMutations((function(e){e.setSize(i),n.forEach((function(t,r){return e.set(r,t)}))})))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(e,t){if((e=oi(this,e))>=0&&e<this.size){var r=ss(this,e+=this._origin);return r&&r.array[e&ei]}return t},t.prototype.set=function(e,t){return function(e,t,r){if((t=oi(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?cs(e,t).set(0,r):cs(e,0,t+1).set(t,r)}));t+=e._origin;var n=e._tail,i=e._root,o={value:!1};t>=us(e._capacity)?n=os(n,e.__ownerID,0,t,r,o):i=os(i,e.__ownerID,e._level,t,r,o);if(!o.value)return e;if(e.__ownerID)return e._root=i,e._tail=n,e.__hash=void 0,e.__altered=!0,e;return ns(e._origin,e._capacity,e._level,i,n)}(this,e,t)},t.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},t.prototype.insert=function(e,t){return this.splice(e,0,t)},t.prototype.clear=function(){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):is()},t.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(r){cs(r,0,t+e.length);for(var n=0;n<e.length;n++)r.set(t+n,e[n])}))},t.prototype.pop=function(){return cs(this,0,-1)},t.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){cs(t,-e.length);for(var r=0;r<e.length;r++)t.set(r,e[r])}))},t.prototype.shift=function(){return cs(this,1)},t.prototype.concat=function(){for(var t=arguments,r=[],n=0;n<arguments.length;n++){var i=t[n],o=e("string"!=typeof i&&Bi(i)?i:[i]);0!==o.size&&r.push(o)}return 0===r.length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations((function(e){r.forEach((function(t){return t.forEach((function(t){return e.push(t)}))}))})):this.constructor(r[0])},t.prototype.setSize=function(e){return cs(this,0,e)},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){for(var i=0;i<r.size;i++)n.set(i,e.call(t,n.get(i),i,r))}))},t.prototype.slice=function(e,t){var r=this.size;return si(e,t,r)?this:cs(this,ci(e,r),ui(t,r))},t.prototype.__iterator=function(e,t){var r=t?this.size:0,n=rs(this,t);return new Di((function(){var i=n();return i===ts?{value:void 0,done:!0}:Li(e,t?--r:r++,i)}))},t.prototype.__iterate=function(e,t){for(var r,n=t?this.size:0,i=rs(this,t);(r=i())!==ts&&!1!==e(r,t?--n:n++,this););return n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?ns(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):0===this.size?is():(this.__ownerID=e,this.__altered=!1,this)},t}(bi);Xa.isList=Ja;var Za=Xa.prototype;Za[Ya]=!0,Za.delete=Za.remove,Za.merge=Za.concat,Za.setIn=ca,Za.deleteIn=Za.removeIn=la,Za.update=fa,Za.updateIn=da,Za.mergeIn=ba,Za.mergeDeepIn=Ea,Za.withMutations=wa,Za.wasAltered=Sa,Za.asImmutable=Ca,Za["@@transducer/init"]=Za.asMutable=Ia,Za["@@transducer/step"]=function(e,t){return e.push(t)},Za["@@transducer/result"]=function(e){return e.asImmutable()};var $a=function(e,t){this.array=e,this.ownerID=t};$a.prototype.removeBefore=function(e,t,r){if(r===t?1<<t:0===this.array.length)return this;var n=r>>>t&ei;if(n>=this.array.length)return new $a([],e);var i,o=0===n;if(t>0){var a=this.array[n];if((i=a&&a.removeBefore(e,t-5,r))===a&&o)return this}if(o&&!i)return this;var s=as(this,e);if(!o)for(var c=0;c<n;c++)s.array[c]=void 0;return i&&(s.array[n]=i),s},$a.prototype.removeAfter=function(e,t,r){if(r===(t?1<<t:0)||0===this.array.length)return this;var n,i=r-1>>>t&ei;if(i>=this.array.length)return this;if(t>0){var o=this.array[i];if((n=o&&o.removeAfter(e,t-5,r))===o&&i===this.array.length-1)return this}var a=as(this,e);return a.array.splice(i+1),n&&(a.array[i]=n),a};var es,ts={};function rs(e,t){var r=e._origin,n=e._capacity,i=us(n),o=e._tail;return a(e._root,e._level,0);function a(e,s,c){return 0===s?function(e,a){var s=a===i?o&&o.array:e&&e.array,c=a>r?0:r-a,u=n-a;u>$n&&(u=$n);return function(){if(c===u)return ts;var e=t?--u:c++;return s&&s[e]}}(e,c):function(e,i,o){var s,c=e&&e.array,u=o>r?0:r-o>>i,l=1+(n-o>>i);l>$n&&(l=$n);return function(){for(;;){if(s){var e=s();if(e!==ts)return e;s=null}if(u===l)return ts;var r=t?--l:u++;s=a(c&&c[r],i-5,o+(r<<i))}}}(e,s,c)}}function ns(e,t,r,n,i,o,a){var s=Object.create(Za);return s.size=t-e,s._origin=e,s._capacity=t,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}function is(){return es||(es=ns(0,0,5))}function os(e,t,r,n,i,o){var a,s=n>>>r&ei,c=e&&s<e.array.length;if(!c&&void 0===i)return e;if(r>0){var u=e&&e.array[s],l=os(u,t,r-5,n,i,o);return l===u?e:((a=as(e,t)).array[s]=l,a)}return c&&e.array[s]===i?e:(o&&ri(o),a=as(e,t),void 0===i&&s===a.array.length-1?a.array.pop():a.array[s]=i,a)}function as(e,t){return t&&e&&t===e.ownerID?e:new $a(e?e.array.slice():[],t)}function ss(e,t){if(t>=us(e._capacity))return e._tail;if(t<1<<e._level+5){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&ei],n-=5;return r}}function cs(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new ni,i=e._origin,o=e._capacity,a=i+t,s=void 0===r?o:r<0?o+r:i+r;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var c=e._level,u=e._root,l=0;a+l<0;)u=new $a(u&&u.array.length?[void 0,u]:[],n),l+=1<<(c+=5);l&&(a+=l,i+=l,s+=l,o+=l);for(var h=us(o),f=us(s);f>=1<<c+5;)u=new $a(u&&u.array.length?[u]:[],n),c+=5;var d=e._tail,p=f<h?ss(e,s-1):f>h?new $a([],n):d;if(d&&f>h&&a<o&&d.array.length){for(var g=u=as(u,n),v=c;v>5;v-=5){var A=h>>>v&ei;g=g.array[A]=as(g.array[A],n)}g.array[h>>>5&ei]=d}if(s<o&&(p=p&&p.removeAfter(n,0,s)),a>=f)a-=f,s-=f,c=5,u=null,p=p&&p.removeBefore(n,0,a);else if(a>i||f<h){for(l=0;u;){var m=a>>>c&ei;if(m!==f>>>c&ei)break;m&&(l+=(1<<c)*m),c-=5,u=u.array[m]}u&&a>i&&(u=u.removeBefore(n,c,a-l)),u&&f<h&&(u=u.removeAfter(n,c,f-l)),l&&(a-=l,s-=l)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=c,e._root=u,e._tail=p,e.__hash=void 0,e.__altered=!0,e):ns(a,s,c,u,p)}function us(e){return e<$n?0:e-1>>>5<<5}var ls,hs=function(e){function t(e){return null==e?ds():ro(e)?e:ds().withMutations((function(t){var r=_i(e);Wo(r.size),r.forEach((function(e,r){return t.set(r,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(e,t){var r=this._map.get(e);return void 0!==r?this._list.get(r)[1]:t},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):ds()},t.prototype.set=function(e,t){return ps(this,e,t)},t.prototype.remove=function(e){return ps(this,e,ti)},t.prototype.__iterate=function(e,t){var r=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],r)}),t)},t.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),r=this._list.__ensureOwner(e);return e?fs(t,r,e,this.__hash):0===this.size?ds():(this.__ownerID=e,this.__altered=!1,this._map=t,this._list=r,this)},t}(Ta);function fs(e,t,r,n){var i=Object.create(hs.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function ds(){return ls||(ls=fs(Ua(),is()))}function ps(e,t,r){var n,i,o=e._map,a=e._list,s=o.get(t),c=void 0!==s;if(r===ti){if(!c)return e;a.size>=$n&&a.size>=2*o.size?(n=(i=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(n.__ownerID=i.__ownerID=e.__ownerID)):(n=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(c){if(r===a.get(s)[1])return e;n=o,i=a.set(s,[t,r])}else n=o.set(t,a.size),i=a.set(a.size,[t,r]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=i,e.__hash=void 0,e.__altered=!0,e):fs(n,i)}hs.isOrderedMap=ro,hs.prototype[Ri]=!0,hs.prototype.delete=hs.prototype.remove;var gs="@@__IMMUTABLE_STACK__@@";function vs(e){return Boolean(e&&e[gs])}var As=function(e){function t(e){return null==e?bs():vs(e)?e:bs().pushAll(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(e,t){var r=this._head;for(e=oi(this,e);r&&e--;)r=r.next;return r?r.value:t},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var e=arguments;if(0===arguments.length)return this;for(var t=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:e[n],next:r};return this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):_s(t,r)},t.prototype.pushAll=function(t){if(0===(t=e(t)).size)return this;if(0===this.size&&vs(t))return t;Wo(t.size);var r=this.size,n=this._head;return t.__iterate((function(e){r++,n={value:e,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):_s(r,n)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):bs()},t.prototype.slice=function(t,r){if(si(t,r,this.size))return this;var n=ci(t,this.size);if(ui(r,this.size)!==this.size)return e.prototype.slice.call(this,t,r);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):_s(i,o)},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?_s(this.size,this._head,e,this.__hash):0===this.size?bs():(this.__ownerID=e,this.__altered=!1,this)},t.prototype.__iterate=function(e,t){var r=this;if(t)return new Hi(this.toArray()).__iterate((function(t,n){return e(t,n,r)}),t);for(var n=0,i=this._head;i&&!1!==e(i.value,n++,this);)i=i.next;return n},t.prototype.__iterator=function(e,t){if(t)return new Hi(this.toArray()).__iterator(e,t);var r=0,n=this._head;return new Di((function(){if(n){var t=n.value;return n=n.next,Li(e,r++,t)}return{value:void 0,done:!0}}))},t}(bi);As.isStack=vs;var ms,ys=As.prototype;function _s(e,t,r,n){var i=Object.create(ys);return i.size=e,i._head=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function bs(){return ms||(ms=_s(0))}ys[gs]=!0,ys.shift=ys.pop,ys.unshift=ys.push,ys.unshiftAll=ys.pushAll,ys.withMutations=wa,ys.wasAltered=Sa,ys.asImmutable=Ca,ys["@@transducer/init"]=ys.asMutable=Ia,ys["@@transducer/step"]=function(e,t){return e.unshift(t)},ys["@@transducer/result"]=function(e){return e.asImmutable()};var Es="@@__IMMUTABLE_SET__@@";function ws(e){return Boolean(e&&e[Es])}function Is(e){return ws(e)&&ki(e)}function Cs(e,t){if(e===t)return!0;if(!di(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||gi(e)!==gi(t)||Ai(e)!==Ai(t)||ki(e)!==ki(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!mi(e);if(ki(e)){var n=e.entries();return t.every((function(e,t){var i=n.next().value;return i&&io(i[1],e)&&(r||io(i[0],t))}))&&n.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var a=!0,s=t.__iterate((function(t,n){if(r?!e.has(t):i?!io(t,e.get(n,ti)):!io(e.get(n,ti),t))return a=!1,!1}));return a&&e.size===s}function Ss(e,t){var r=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function Ts(e){if(!e||"object"!=typeof e)return e;if(!di(e)){if(!Zo(e))return e;e=qi(e)}if(gi(e)){var t={};return e.__iterate((function(e,r){t[r]=Ts(e)})),t}var r=[];return e.__iterate((function(e){r.push(Ts(e))})),r}var Rs=function(e){function t(t){return null==t?Ds():ws(t)&&!ki(t)?t:Ds().withMutations((function(r){var n=e(t);Wo(n.size),n.forEach((function(e){return r.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(_i(e).keySeq())},t.intersect=function(e){return(e=yi(e).toArray()).length?Os.intersect.apply(t(e.pop()),e):Ds()},t.union=function(e){return(e=yi(e).toArray()).length?Os.union.apply(t(e.pop()),e):Ds()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(e){return this._map.has(e)},t.prototype.add=function(e){return Ns(this,this._map.set(e,e))},t.prototype.remove=function(e){return Ns(this,this._map.remove(e))},t.prototype.clear=function(){return Ns(this,this._map.clear())},t.prototype.map=function(e,t){var r=this,n=!1,i=Ns(this,this._map.mapEntries((function(i){var o=i[1],a=e.call(t,o,o,r);return a!==o&&(n=!0),[a,a]}),t));return n?i:this},t.prototype.union=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(r){for(var n=0;n<t.length;n++)e(t[n]).forEach((function(e){return r.add(e)}))})):this.constructor(t[0])},t.prototype.intersect=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(0===t.length)return this;t=t.map((function(t){return e(t)}));var n=[];return this.forEach((function(e){t.every((function(t){return t.includes(e)}))||n.push(e)})),this.withMutations((function(e){n.forEach((function(t){e.remove(t)}))}))},t.prototype.subtract=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(0===t.length)return this;t=t.map((function(t){return e(t)}));var n=[];return this.forEach((function(e){t.some((function(t){return t.includes(e)}))&&n.push(e)})),this.withMutations((function(e){n.forEach((function(t){e.remove(t)}))}))},t.prototype.sort=function(e){return Zs(Bo(this,e))},t.prototype.sortBy=function(e,t){return Zs(Bo(this,t,e))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(e,t){var r=this;return this._map.__iterate((function(t){return e(t,t,r)}),t)},t.prototype.__iterator=function(e,t){return this._map.__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):0===this.size?this.__empty():(this.__ownerID=e,this._map=t,this)},t}(Ei);Rs.isSet=ws;var ks,Os=Rs.prototype;function Ns(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function xs(e,t){var r=Object.create(Os);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function Ds(){return ks||(ks=xs(Ua()))}Os[Es]=!0,Os.delete=Os.remove,Os.merge=Os.concat=Os.union,Os.withMutations=wa,Os.asImmutable=Ca,Os["@@transducer/init"]=Os.asMutable=Ia,Os["@@transducer/step"]=function(e,t){return e.add(t)},Os["@@transducer/result"]=function(e){return e.asImmutable()},Os.__empty=Ds,Os.__make=xs;var Ls,Ps=function(e){function t(e,r,n){if(!(this instanceof t))return new t(e,r,n);if(zo(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===r&&(r=1/0),n=void 0===n?1:Math.abs(n),r<e&&(n=-n),this._start=e,this._end=r,this._step=n,this.size=Math.max(0,Math.ceil((r-e)/n-1)+1),0===this.size){if(Ls)return Ls;Ls=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},t.prototype.get=function(e,t){return this.has(e)?this._start+oi(this,e)*this._step:t},t.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},t.prototype.slice=function(e,r){return si(e,r,this.size)?this:(e=ci(e,this.size),(r=ui(r,this.size))<=e?new t(0,0):new t(this.get(e,this._end),this.get(r,this._end),this._step))},t.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var r=t/this._step;if(r>=0&&r<this.size)return r}return-1},t.prototype.lastIndexOf=function(e){return this.indexOf(e)},t.prototype.__iterate=function(e,t){for(var r=this.size,n=this._step,i=t?this._start+(r-1)*n:this._start,o=0;o!==r&&!1!==e(i,t?r-++o:o++,this);)i+=t?-n:n;return o},t.prototype.__iterator=function(e,t){var r=this.size,n=this._step,i=t?this._start+(r-1)*n:this._start,o=0;return new Di((function(){if(o===r)return{value:void 0,done:!0};var a=i;return i+=t?-n:n,Li(e,t?r-++o:o++,a)}))},t.prototype.equals=function(e){return e instanceof t?this._start===e._start&&this._end===e._end&&this._step===e._step:Cs(this,e)},t}(Vi);function Bs(e,t,r){for(var n=Yo(t),i=0;i!==n.length;)if((e=ta(e,n[i++],ti))===ti)return r;return e}function Ms(e,t){return Bs(this,e,t)}function js(e,t){return Bs(e,t,ti)!==ti}function Us(){Wo(this.size);var e={};return this.__iterate((function(t,r){e[r]=t})),e}yi.isIterable=di,yi.isKeyed=gi,yi.isIndexed=Ai,yi.isAssociative=mi,yi.isOrdered=ki,yi.Iterator=Di,Ss(yi,{toArray:function(){Wo(this.size);var e=new Array(this.size||0),t=gi(this),r=0;return this.__iterate((function(n,i){e[r++]=t?[i,n]:n})),e},toIndexedSeq:function(){return new Co(this)},toJS:function(){return Ts(this)},toKeyedSeq:function(){return new Io(this,!0)},toMap:function(){return Ta(this.toKeyedSeq())},toObject:Us,toOrderedMap:function(){return hs(this.toKeyedSeq())},toOrderedSet:function(){return Zs(gi(this)?this.valueSeq():this)},toSet:function(){return Rs(gi(this)?this.valueSeq():this)},toSetSeq:function(){return new So(this)},toSeq:function(){return Ai(this)?this.toIndexedSeq():gi(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return As(gi(this)?this.valueSeq():this)},toList:function(){return Xa(gi(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Fo(this,Lo(this,e))},includes:function(e){return this.some((function(t){return io(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){Wo(this.size);var r=!0;return this.__iterate((function(n,i,o){if(!e.call(t,n,i,o))return r=!1,!1})),r},filter:function(e,t){return Fo(this,No(this,e,t,!0))},find:function(e,t,r){var n=this.findEntry(e,t);return n?n[1]:r},forEach:function(e,t){return Wo(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Wo(this.size),e=void 0!==e?""+e:",";var t="",r=!0;return this.__iterate((function(n){r?r=!1:t+=e,t+=null!=n?n.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return Fo(this,ko(this,e,t))},reduce:function(e,t,r){return Vs(this,e,t,r,arguments.length<2,!1)},reduceRight:function(e,t,r){return Vs(this,e,t,r,arguments.length<2,!0)},reverse:function(){return Fo(this,Oo(this,!0))},slice:function(e,t){return Fo(this,xo(this,e,t,!0))},some:function(e,t){return!this.every(zs(e),t)},sort:function(e){return Fo(this,Bo(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return ii(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,r){var n=Ta().asMutable();return e.__iterate((function(i,o){n.update(t.call(r,i,o,e),0,(function(e){return e+1}))})),n.asImmutable()}(this,e,t)},equals:function(e){return Cs(this,e)},entrySeq:function(){var e=this;if(e._cache)return new Hi(e._cache);var t=e.toSeq().map(Hs).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(zs(e),t)},findEntry:function(e,t,r){var n=r;return this.__iterate((function(r,i,o){if(e.call(t,r,i,o))return n=[i,r],!1})),n},findKey:function(e,t){var r=this.findEntry(e,t);return r&&r[0]},findLast:function(e,t,r){return this.toKeyedSeq().reverse().find(e,t,r)},findLastEntry:function(e,t,r){return this.toKeyedSeq().reverse().findEntry(e,t,r)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(e){return this.find(ai,null,e)},flatMap:function(e,t){return Fo(this,function(e,t,r){var n=qo(e);return e.toSeq().map((function(i,o){return n(t.call(r,i,o,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Fo(this,Po(this,e,!0))},fromEntrySeq:function(){return new To(this)},get:function(e,t){return this.find((function(t,r){return io(r,e)}),void 0,t)},getIn:Ms,groupBy:function(e,t){return function(e,t,r){var n=gi(e),i=(ki(e)?hs():Ta()).asMutable();e.__iterate((function(o,a){i.update(t.call(r,o,a,e),(function(e){return(e=e||[]).push(n?[a,o]:o),e}))}));var o=qo(e);return i.map((function(t){return Fo(e,o(t))})).asImmutable()}(this,e,t)},has:function(e){return this.get(e,ti)!==ti},hasIn:function(e){return js(this,e)},isSubset:function(e){return e="function"==typeof e.includes?e:yi(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:yi(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return io(t,e)}))},keySeq:function(){return this.toSeq().map(Ks).toIndexedSeq()},last:function(e){return this.toSeq().reverse().first(e)},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Mo(this,e)},maxBy:function(e,t){return Mo(this,t,e)},min:function(e){return Mo(this,e?Ws(e):Js)},minBy:function(e,t){return Mo(this,t?Ws(t):Js,e)},rest:function(){return this.slice(1)},skip:function(e){return 0===e?this:this.slice(Math.max(0,e))},skipLast:function(e){return 0===e?this:this.slice(0,-Math.max(0,e))},skipWhile:function(e,t){return Fo(this,Do(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(zs(e),t)},sortBy:function(e,t){return Fo(this,Bo(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return this.slice(-Math.max(0,e))},takeWhile:function(e,t){return Fo(this,function(e,t,r){var n=Go(e);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var a=0;return e.__iterate((function(e,i,s){return t.call(r,e,i,s)&&++a&&n(e,i,o)})),a},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var a=e.__iterator(2,i),s=!0;return new Di((function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var i=e.value,c=i[0],u=i[1];return t.call(r,u,c,o)?2===n?e:Li(n,c,u,e):(s=!1,{value:void 0,done:!0})}))},n}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(zs(e),t)},update:function(e){return e(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=ki(e),r=gi(e),n=t?1:0;return function(e,t){return t=oo(t,3432918353),t=oo(t<<15|t>>>-15,461845907),t=oo(t<<13|t>>>-13,5),t=oo((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=ao((t=oo(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(r?t?function(e,t){n=31*n+Xs(co(e),co(t))|0}:function(e,t){n=n+Xs(co(e),co(t))|0}:t?function(e){n=31*n+co(e)|0}:function(e){n=n+co(e)|0}),n)}(this))}});var Fs=yi.prototype;Fs[fi]=!0,Fs[xi]=Fs.values,Fs.toJSON=Fs.toArray,Fs.__toStringMapper=$o,Fs.inspect=Fs.toSource=function(){return this.toString()},Fs.chain=Fs.flatMap,Fs.contains=Fs.includes,Ss(_i,{flip:function(){return Fo(this,Ro(this))},mapEntries:function(e,t){var r=this,n=0;return Fo(this,this.toSeq().map((function(i,o){return e.call(t,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(e,t){var r=this;return Fo(this,this.toSeq().flip().map((function(n,i){return e.call(t,n,i,r)})).flip())}});var Qs=_i.prototype;Qs[pi]=!0,Qs[xi]=Fs.entries,Qs.toJSON=Us,Qs.__toStringMapper=function(e,t){return $o(t)+": "+$o(e)},Ss(bi,{toKeyedSeq:function(){return new Io(this,!1)},filter:function(e,t){return Fo(this,No(this,e,t,!1))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Fo(this,Oo(this,!1))},slice:function(e,t){return Fo(this,xo(this,e,t,!1))},splice:function(e,t){var r=arguments.length;if(t=Math.max(t||0,0),0===r||2===r&&!t)return this;e=ci(e,e<0?this.count():this.size);var n=this.slice(0,e);return Fo(this,1===r?n:n.concat(Ho(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.findLastEntry(e,t);return r?r[0]:-1},first:function(e){return this.get(0,e)},flatten:function(e){return Fo(this,Po(this,e,!1))},get:function(e,t){return(e=oi(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,r){return r===e}),void 0,t)},has:function(e){return(e=oi(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Fo(this,function(e,t){var r=Go(e);return r.size=e.size&&2*e.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return e.__iterate((function(e){return(!o||!1!==r(t,o++,i))&&!1!==r(e,o++,i)}),n),o},r.__iteratorUncached=function(r,n){var i,o=e.__iterator(1,n),a=0;return new Di((function(){return(!i||a%2)&&(i=o.next()).done?i:a%2?Li(r,a++,t):Li(r,a++,i.value,i)}))},r}(this,e))},interleave:function(){var e=[this].concat(Ho(arguments)),t=Uo(this.toSeq(),Vi.of,e),r=t.flatten(!0);return t.size&&(r.size=t.size*e.length),Fo(this,r)},keySeq:function(){return Ps(0,this.size)},last:function(e){return this.get(-1,e)},skipWhile:function(e,t){return Fo(this,Do(this,e,t,!1))},zip:function(){var e=[this].concat(Ho(arguments));return Fo(this,Uo(this,Ys,e))},zipAll:function(){var e=[this].concat(Ho(arguments));return Fo(this,Uo(this,Ys,e,!0))},zipWith:function(e){var t=Ho(arguments);return t[0]=this,Fo(this,Uo(this,e,t))}});var qs=bi.prototype;qs[vi]=!0,qs[Ri]=!0,Ss(Ei,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}});var Gs=Ei.prototype;function Vs(e,t,r,n,i,o){return Wo(e.size),e.__iterate((function(e,o,a){i?(i=!1,r=e):r=t.call(n,r,e,o,a)}),o),r}function Ks(e,t){return t}function Hs(e,t){return[t,e]}function zs(e){return function(){return!e.apply(this,arguments)}}function Ws(e){return function(){return-e.apply(this,arguments)}}function Ys(){return Ho(arguments)}function Js(e,t){return e<t?1:e>t?-1:0}function Xs(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}Gs.has=Fs.includes,Gs.contains=Gs.includes,Gs.keys=Gs.values,Ss(Gi,Qs),Ss(Vi,qs),Ss(Ki,Gs);var Zs=function(e){function t(e){return null==e?rc():Is(e)?e:rc().withMutations((function(t){var r=Ei(e);Wo(r.size),r.forEach((function(e){return t.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(_i(e).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(Rs);Zs.isOrderedSet=Is;var $s,ec=Zs.prototype;function tc(e,t){var r=Object.create(ec);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function rc(){return $s||($s=tc(ds()))}ec[Ri]=!0,ec.zip=qs.zip,ec.zipWith=qs.zipWith,ec.zipAll=qs.zipAll,ec.__empty=rc,ec.__make=tc;var nc=function(e,t){var r;!function(e){if(Si(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Ti(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===e||"object"!=typeof e)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(e);var n=function(o){var a=this;if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var s=Object.keys(e),c=i._indices={};i._name=t,i._keys=s,i._defaultValues=e;for(var u=0;u<s.length;u++){var l=s[u];c[l]=u,i[l]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+ac(this)+' with property "'+l+'" since that property name is part of the Record API.'):cc(i,l)}}return this.__ownerID=void 0,this._values=Xa().withMutations((function(e){e.setSize(a._keys.length),_i(o).forEach((function(t,r){e.set(a._indices[r],t===a._defaultValues[r]?void 0:t)}))})),this},i=n.prototype=Object.create(ic);return i.constructor=n,t&&(n.displayName=t),n};nc.prototype.toString=function(){for(var e,t=ac(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)t+=(n?", ":"")+(e=r[n])+": "+$o(this.get(e));return t+" }"},nc.prototype.equals=function(e){return this===e||e&&sc(this).equals(sc(e))},nc.prototype.hashCode=function(){return sc(this).hashCode()},nc.prototype.has=function(e){return this._indices.hasOwnProperty(e)},nc.prototype.get=function(e,t){if(!this.has(e))return t;var r=this._indices[e],n=this._values.get(r);return void 0===n?this._defaultValues[e]:n},nc.prototype.set=function(e,t){if(this.has(e)){var r=this._values.set(this._indices[e],t===this._defaultValues[e]?void 0:t);if(r!==this._values&&!this.__ownerID)return oc(this,r)}return this},nc.prototype.remove=function(e){return this.set(e)},nc.prototype.clear=function(){var e=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:oc(this,e)},nc.prototype.wasAltered=function(){return this._values.wasAltered()},nc.prototype.toSeq=function(){return sc(this)},nc.prototype.toJS=function(){return Ts(this)},nc.prototype.entries=function(){return this.__iterator(2)},nc.prototype.__iterator=function(e,t){return sc(this).__iterator(e,t)},nc.prototype.__iterate=function(e,t){return sc(this).__iterate(e,t)},nc.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._values.__ensureOwner(e);return e?oc(this,t,e):(this.__ownerID=e,this._values=t,this)},nc.isRecord=Si,nc.getDescriptiveName=ac;var ic=nc.prototype;function oc(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._values=t,n.__ownerID=r,n}function ac(e){return e.constructor.displayName||e.constructor.name||"Record"}function sc(e){return Xi(e._keys.map((function(t){return[t,e.get(t)]})))}function cc(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){zo(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}catch(e){}}ic[Ci]=!0,ic.delete=ic.remove,ic.deleteIn=ic.removeIn=la,ic.getIn=Ms,ic.hasIn=Fs.hasIn,ic.merge=pa,ic.mergeWith=ga,ic.mergeIn=ba,ic.mergeDeep=ya,ic.mergeDeepWith=_a,ic.mergeDeepIn=Ea,ic.setIn=ca,ic.update=fa,ic.updateIn=da,ic.withMutations=wa,ic.asMutable=Ia,ic.asImmutable=Ca,ic[xi]=ic.entries,ic.toJSON=ic.toObject=Fs.toObject,ic.inspect=ic.toSource=function(){return this.toString()};var uc,lc=function(e){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this._value=e,this.size=void 0===r?1/0:Math.max(0,r),0===this.size){if(uc)return uc;uc=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},t.prototype.get=function(e,t){return this.has(e)?this._value:t},t.prototype.includes=function(e){return io(this._value,e)},t.prototype.slice=function(e,r){var n=this.size;return si(e,r,n)?this:new t(this._value,ui(r,n)-ci(e,n))},t.prototype.reverse=function(){return this},t.prototype.indexOf=function(e){return io(this._value,e)?0:-1},t.prototype.lastIndexOf=function(e){return io(this._value,e)?this.size:-1},t.prototype.__iterate=function(e,t){for(var r=this.size,n=0;n!==r&&!1!==e(this._value,t?r-++n:n++,this););return n},t.prototype.__iterator=function(e,t){var r=this,n=this.size,i=0;return new Di((function(){return i===n?{value:void 0,done:!0}:Li(e,t?n-++i:i++,r._value)}))},t.prototype.equals=function(e){return e instanceof t?io(this._value,e._value):Cs(e)},t}(Vi);function hc(e,t,r,n,i,o){if("string"!=typeof r&&!Ti(r)&&(Qi(r)||Bi(r)||Xo(r))){if(~e.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");e.push(r),i&&""!==n&&i.push(n);var a=t.call(o,n,qi(r).map((function(n,o){return hc(e,t,n,o,i,r)})),i&&i.slice());return e.pop(),i&&i.pop(),a}return r}function fc(e,t){return Ai(t)?t.toList():gi(t)?t.toMap():t.toSet()}var dc={version:"4.0.0",Collection:yi,Iterable:yi,Seq:qi,Map:Ta,OrderedMap:hs,List:Xa,Stack:As,Set:Rs,OrderedSet:Zs,Record:nc,Range:Ps,Repeat:lc,is:io,fromJS:function(e,t){return hc([],t||fc,e,"",t&&t.length>2?[]:void 0,{"":e})},hash:co,isImmutable:Ti,isCollection:di,isKeyed:gi,isIndexed:Ai,isAssociative:mi,isOrdered:ki,isValueObject:no,isPlainObject:Xo,isSeq:Ii,isList:Ja,isMap:to,isOrderedMap:ro,isStack:vs,isSet:ws,isOrderedSet:Is,isRecord:Si,get:ta,getIn:Bs,has:ea,hasIn:js,merge:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return ma(e,t)},mergeDeep:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Aa(e,t)},mergeWith:function(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return ma(t,r,e)},mergeDeepWith:function(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return Aa(t,r,e)},remove:na,removeIn:ua,set:ia,setIn:sa,update:ha,updateIn:oa};const pc=dc;function gc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gc(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ac,mc,yc,_c,bc=function(){function e(t){var r=this;a(this,e),this.sequence=void 0,this.users=new Map,this.streams=new Map,this.roomProperties=pc.Map(),this.room=void 0;var n=t.seq,i=t.users,o=t.roomProperties,s=t.roomInfo;this.sequence=n,i.forEach((function(e){var t=Ec.fromData(e),n=e.streams;(void 0===n?[]:n).forEach((function(e){r.streams.set(e.streamUuid,wc.fromData(vc(vc({},e),{},{fromUser:{userName:t.userName,role:t.userRole,userUuid:t.userUuid}})))})),r.users.set(e.userUuid,t)})),this.roomProperties=pc.Map(o),this.room=Ic.fromData(s)}return c(e,null,[{key:"fromData",value:function(t){return new e(t)}}]),e}(),Ec=function(){function e(t){a(this,e),this.userUuid=void 0,this.userName=void 0,this.userRole=void 0,this.userProperties=void 0,this.userName=t.userName,this.userRole=t.role,this.userUuid=t.userUuid,this.userProperties=pc.Map(t.userProperties)}return c(e,[{key:"setUserProperties",value:function(e){this.userProperties=pc.Map(e)}},{key:"toString",value:function(){return this.userUuid}}],[{key:"fromData",value:function(t){return new e(t)}}]),e}(),wc=function(){function e(t){a(this,e),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.previous=void 0,this.streamUuid=t.streamUuid,this.streamName=t.streamName,this.fromUser=t.fromUser,this.videoSourceType=t.videoSourceType,this.audioSourceType=t.audioSourceType,this.videoState=t.videoState,this.audioState=t.audioState,this.videoSourceState=t.videoSourceState,this.audioSourceState=t.audioSourceState,["streamUuid","fromUser","videoSourceType","audioSourceType","videoState","audioState","videoSourceState","audioSourceState"].forEach((function(e){void 0===t[e]&&yn.warn("stream key ".concat(e," is unexpectedly undefined"))})),this.fromUser||(yn.error("[stream-data-struct] stream must has owner info"),Mn.shared.handleThrowableError(kn.RTE_ERR_INVALID_DATA_STRUCT,new Error("invalid stream data")))}return c(e,[{key:"toString",value:function(){return this.streamUuid}}],[{key:"fromData",value:function(t){return new e(t)}}]),e}(),Ic=function(){function e(t){a(this,e),this.roomName=void 0,this.roomUuid=void 0,this.roomScenario=void 0,this.roomName=t.roomName,this.roomUuid=t.roomUuid,this.roomScenario=t.roomScenario}return c(e,null,[{key:"fromData",value:function(t){return new e(t)}}]),e}(),Cc=function(){function e(t){a(this,e),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=t.fromUser,this.message=t.message,this.type=t.type,this.sendTime=t.sendTime,this.sensitiveWords=t.sensitiveWords,this.messageId=t.messageId||t.peerMessageId,this.ext=t.ext}return c(e,[{key:"toString",value:function(){return"".concat(this.fromUser.userName,": ").concat(this.message)}}],[{key:"fromData",value:function(t){return new e(t)}}]),e}(),Sc=__webpack_require__(9850),Tc=__webpack_require__.n(Sc),Rc=__webpack_require__(2579),kc=__webpack_require__.n(Rc);function Oc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Oc(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xc(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Dc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dc(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Dc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lc(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}!function(e){e[e.Chat=3]="Chat",e[e.RoomProperty=4]="RoomProperty",e[e.RoomProperties=5]="RoomProperties",e[e.UserInOut=20]="UserInOut",e[e.UserInfo=21]="UserInfo",e[e.UserProperty=22]="UserProperty",e[e.UserProperties=23]="UserProperties",e[e.UserSubscribeInOut=24]="UserSubscribeInOut",e[e.StreamInOut=40]="StreamInOut",e[e.StreamsInOut=41]="StreamsInOut",e[e.MessageExtension=99]="MessageExtension",e[e.BatchUserProperties=25]="BatchUserProperties"}(mc||(mc={})),function(e){e[e.PeerChat=1]="PeerChat"}(yc||(yc={})),function(e){e.SnapshotUpdated="snapshot-updated",e.ChatReceived="chat-received",e.UserAdded="user-added",e.UserUpdated="user-updated",e.UserRemoved="user-removed",e.RoomPropertyUpdated="room-property-updated",e.UserPropertyUpdated="user-property-updated",e.BatchUserPropertyUpdated="batch-user-property-updated",e.LocalStreamAdded="local-stream-added",e.LocalStreamUpdate="local-stream-update",e.LocalStreamRemove="local-stream-removed",e.RemoteStreamAdded="remote-stream-added",e.RemoteStreamUpdate="remote-stream-update",e.RemoteStreamRemove="remote-stream-removed",e.ChatUserMessage="user-chat-message",e.ChatRoomMessage="room-chat-message",e.NetworkStats="network-stats",e.LocalAudioVolume="local-audio-volume",e.AudioVolumes="audio-volumes",e.LocalVideoCameraListChanged="local-video-camera-list-changed",e.LocalAudioRecordingListChanged="local-audio-recording-list-changed",e.LocalAudioPlaybackListChanged="local-audio-playback-list-changed",e.LocalVideoTrackStateChanged="local-video-track-state-changed",e.LocalAudioTrackStateChanged="local-audio-track-state-changed",e.RtcConnectionStateChanged="rtc-connection-state-changed",e.RtmConnectionStateChanged="rtm-connection-state-changed",e.RteConnectionStateChanged="rte-connection-state-changed",e.TimeStampGapUpdate="timestamp-gap-update"}(_c||(_c={}));var Pc,Bc=Xn.attach({proxyMethods:!1})(Ac=function(e){l(r,e);var t=Lc(r);function r(e,n){var i,o=n.sceneId,s=n.userUuid,c=n.streamUuid;return a(this,r),(i=t.call(this)).logger=void 0,i._dataStore=void 0,i._timestampGap=0,i.sceneId=void 0,i.userUuid=void 0,i.streamUuid=void 0,i.sceneId=o,i.userUuid=s,i.streamUuid=c,i._dataStore=e,i}return c(r,[{key:"handleSnapshot",value:function(e){this._dataStore.setUsers(e.users),this._dataStore.setStreams(e.streams),this._dataStore.setRoomProperties(e.roomProperties),this._dataStore.setRoomInfo(e.room),this.emit(_c.SnapshotUpdated,e)}},{key:"handleMessage",value:function(e){switch(e.sequence.cmd){case mc.Chat:this._handleChat(e);break;case mc.RoomProperty:case mc.RoomProperties:this._handleRoomProperties(e);break;case mc.UserInOut:this._handleUserInOut(e);break;case mc.UserInfo:this._handleUserInfo(e);break;case mc.UserProperty:this._handleUserProperty(e);break;case mc.UserProperties:this._handleUserProperties(e);break;case mc.BatchUserProperties:this._handleBatchUserProperties(e);break;case mc.UserSubscribeInOut:this._handleUserSubscribe(e);break;case mc.StreamInOut:this._handleStreamInOut(e);break;case mc.StreamsInOut:this._handleStreamsInOut(e);break;case mc.MessageExtension:this._handleMessageExtension(e)}this._syncTsGapWithServerAndLocal(e)}},{key:"handlePeerMessage",value:function(e){if(e.cmd===yc.PeerChat)this._handlePeerChat(e)}},{key:"_handlePeerChat",value:function(e){var t=e.data,r=Cc.fromData(t);this._dataStore.addMessage(r),this.emit(_c.ChatUserMessage,r)}},{key:"_handleChat",value:function(e){var t=e.sequence.data,r=Cc.fromData(t);this._dataStore.addMessage(r),this.emit(_c.ChatReceived,r)}},{key:"_mergeProperties",value:function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r],o=i.split(".");if(0!==o.length){var a,s=o.filter((function(e){return e})),c=e,u=xc(s);try{for(u.s();!(a=u.n()).done;){var l=a.value;c[l]=c[l]||{},c=c[l]}}catch(e){u.e(e)}finally{u.f()}var h=1===s.length?e:kc()(e,Zn(s).splice(0,s.length-1).join("."),{}),f=Tc()(t[i]);"deleted"===f?delete h[Zn(s).pop()]:h[Zn(s).pop()]=f}else this.logger.error("invalid key when batch set room properties ".concat(i))}return e}},{key:"_handleRoomProperties",value:function(e){var t=e.sequence.data,r=t.changeProperties,n=t.cause,i=t.operator;this._dataStore.setRoomProperties(this._mergeProperties(this._dataStore.roomProperties.toJS(),r));var o=Array.from(new Set(Object.keys(r).map((function(e){return e.split(".")[0]}))));this.emit(_c.RoomPropertyUpdated,o,this._dataStore.roomProperties,i,n)}},{key:"_handleUserSubscribe",value:function(e){var t=this,r=e.sequence.data.users,n=[],i=[];r.forEach((function(e){var r=Ec.fromData(e);if(1===e.subscribe){t._dataStore.setUser(r.userUuid,r);var o=e.streams;(void 0===o?[]:o).forEach((function(e){var n=wc.fromData(Nc(Nc({},e),{},{fromUser:{userUuid:r.userUuid,role:r.userRole,userName:r.userName}}));t._dataStore.setStream(n.streamUuid,n)})),n.push(r)}else 0===e.subscribe&&(t._dataStore.deleteStream(e.streamUuid),t._dataStore.deleteUser(e.userUuid),i.push(r))})),n.length>0&&this.emit(_c.UserAdded,n),i.length>0&&this.emit(_c.UserRemoved,i)}},{key:"_handleUserInOut",value:function(e){var t=this,r=e.sequence.data,n=r.offlineUsers,i=r.onlineUsers,o=n.map((function(e){var r=Ec.fromData(e);return t._dataStore.deleteStream(e.streamUuid),t._dataStore.deleteUser(e.userUuid),r})),a=i.map((function(e){var r=Ec.fromData(e);t._dataStore.setUser(r.userUuid,r);var n=e.streams;return(void 0===n?[]:n).forEach((function(e){var n=wc.fromData(Nc(Nc({},e),{},{fromUser:{userUuid:r.userUuid,role:r.userRole,userName:r.userName}}));t._dataStore.setStream(n.streamUuid,n)})),r}));if(a.length>0&&this.emit(_c.UserAdded,a),o.length>0){var s=n.length?n[0].type:void 0;this.emit(_c.UserRemoved,o,s)}}},{key:"_handleUserInfo",value:function(e){var t=e.sequence.data,r=t.userUuid,n=t.userName,i=t.role,o=this._dataStore.findUser(r);if(!o)return this.logger.warn("user ".concat(r," not exists, update info failed"));o.userName=n,o.userRole=i,this.emit(_c.UserUpdated,o)}},{key:"_handleUserProperty",value:function(e){throw"not_implemented"}},{key:"_handleUserProperties",value:function(e){var t=e.sequence.data,r=t.changeProperties,n=t.cause,i=t.fromUser,o=t.operator,a=i.userUuid,s=this._dataStore.findUser(a);if(!s)return this.logger.warn("user ".concat(a," not exists, update property failed"));s.setUserProperties(this._mergeProperties(s.userProperties.toJS(),r)),this.emit(_c.UserPropertyUpdated,a,s.userProperties.toObject(),o,n)}},{key:"_handleBatchUserProperties",value:function(e){var t=this,r=e.sequence.data,n=r.users,i=r.operator,o=r.cause,a=n.reduce((function(e,r){var n=r.fromUser,i=r.operator,o=r.cause,a=r.changeProperties,s=n.userUuid,c=t._dataStore.findUser(s);if(c){c.setUserProperties(t._mergeProperties(c.userProperties.toJS(),a));var u={userUuid:s,userProperties:c.userProperties.toObject(),operator:i,cause:o};e.push(u)}else t.logger.warn("user ".concat(s," not exists, update property failed"));return e}),[]);if(!a.length)return this.logger.warn("no user properties have changed");this.emit(_c.BatchUserPropertyUpdated,a,i,o)}},{key:"_processStreamEvent",value:function(e,t){var r=t.fromUser.userUuid===this.userUuid;if(3===e){var n=this._dataStore.findStream(t.streamUuid);return this._dataStore.deleteStream(t.streamUuid),t.previous=n,r?_c.LocalStreamRemove:_c.RemoteStreamRemove}if(2===e){var i=this._dataStore.findStream(t.streamUuid);return this._dataStore.setStream(t.streamUuid,t),t.previous=i,r?_c.LocalStreamUpdate:_c.RemoteStreamUpdate}return t.previous=void 0,this._dataStore.setStream(t.streamUuid,t),r?_c.LocalStreamAdded:_c.RemoteStreamAdded}},{key:"_handleStreamInOut",value:function(e){var t=e.sequence.data,r=t.action,n=t.fromUser,i=t.streamUuid,o=t.streamName,a=t.videoSourceType,s=t.audioSourceType,c=t.videoSourceState,u=t.audioSourceState,l=t.videoState,h=t.audioState,f=t.operator,d=wc.fromData({streamName:o,streamUuid:i,fromUser:n,videoSourceType:a,audioSourceType:s,videoState:l,audioState:h,videoSourceState:c,audioSourceState:u}),p=this._processStreamEvent(r,d);this.emit(p,[d],f)}},{key:"_handleStreamsInOut",value:function(e){var t=this,r=e.sequence.data,n=r.streams,i=r.operator,o=(r.cause,new Map);n.forEach((function(e){var r=e.action,n=wc.fromData(e),i=t._processStreamEvent(r,n);o.has(i)?o.set(i,o.get(i).concat([n])):o.set(i,[n])})),o.forEach((function(e,r){t.emit(r,e,i)}))}},{key:"_handleMessageExtension",value:function(e){}},{key:"_syncTsGapWithServerAndLocal",value:function(e){var t=e.sequence.timestamp-Date.now();this._timestampGap!==t&&Math.abs(this._timestampGap-t)>800&&(this._timestampGap=t,this.emit(_c.TimeStampGapUpdate,this._timestampGap))}}]),r}(y))||Ac,Mc=Xn.attach({proxyMethods:!1})(Pc=function(){function e(t,r){var n=this,i=r.scene,o=r.userUuid,s=r.streamUuid,c=r.channelObserver,u=r.rtm;a(this,e),this.logger=void 0,this._scene=void 0,this.userUuid=void 0,this.streamUuid=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(n._currentTask)n.logger.debug("Task Running");else{var e=n.dequeueTask();e?(n._currentTask=e,n.processTask(n._currentTask).then((function(){n._currentTask=void 0,n.notifyTaskQueueUpdate()})).catch((function(e){n.logger.error("message handle failed: ".concat(e)),n._currentTask=void 0,n.notifyTaskQueueUpdate()}))):n.logger.debug("message handle queue clear")}},this._scene=i,this.streamUuid=s,this.userUuid=o,this._handleChannelMessage=this.handleChannelMessage.bind(this),this._handlePeerMessage=this.handlePeerMessage.bind(this),this._channelObserver=c,this._channelObserver.on("ChannelMessage",this._handleChannelMessage),u.on("MessageFromPeer",this._handlePeerMessage),this.handle=new Bc(t,{sceneId:i.sceneId,userUuid:o,streamUuid:s})}var t,r;return c(e,[{key:"handlePeerMessage",value:function(e){var t=e.message;if("server"===e.peerId){this.logger.debug("peer message",t);try{var r=JSON.parse(t);this.handle.handlePeerMessage(r)}catch(e){this.logger.error("".concat(e.message," original: ").concat(t))}}}},{key:"handleChannelMessage",value:function(e){var t=e.message;if("server"===e.memberId){this.logger.debug("channel message sceneId:".concat(this._scene.sceneId),t.text);try{var r=JSON.parse(t.text);this.addTask({sequence:r})}catch(e){this.logger.error("".concat(e.message," original: ").concat(t.text))}}}},{key:"syncSnapshot",value:function(e){this._snapshot=e,this.handle.handleSnapshot(e),this._lastSeq=e.sequence,this.notifyTaskQueueUpdate()}},{key:"findSequenceGap",value:function(){if(0===this._queueTasks.length)return null;var e=this._queueTasks[0].sequence.sequence;return e-this._lastSeq>1?{seq:this._lastSeq+1,count:e-this._lastSeq-1,queueHeadSeq:e}:null}},{key:"sortTasks",value:function(){this._queueTasks=this._queueTasks.sort((function(e,t){return e.sequence.sequence-t.sequence.sequence}))}},{key:"addTask",value:function(e){this._queueTasks.push(e),this.sortTasks(),this.notifyTaskQueueUpdate()}},{key:"prependTasks",value:function(e){this._queueTasks=e.concat(this._queueTasks),this.sortTasks()}},{key:"notifyTaskQueueUpdate",value:function(){if(this._snapshot){var e=this.findSequenceGap();if(e){var t=e.seq,r=e.count,n=e.queueHeadSeq;return this.logger.warn("gap ".concat(this._lastSeq," - ").concat(n," exists, need fill ").concat(t," ").concat(r,". stop task processing before gap is resolved")),void this.syncSequenceUntilSuccess(t,r)}this.runNextTask()}else this.logger.warn("Snapshot not ready yet..wait")}},{key:"dequeueTask",value:function(){return 0===this._queueTasks.length?null:this._queueTasks.shift()}},{key:"processTask",value:(r=o(v().mark((function e(t){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._snapshot){e.next=2;break}return e.abrupt("return");case 2:if(!(t.sequence.sequence<=this._lastSeq)){e.next=5;break}return this.logger.debug("skip sequence ".concat(t.sequence.sequence,", snapshot ").concat(this._snapshot.sequence)),e.abrupt("return");case 5:return this.logger.debug("process sequence ".concat(t.sequence.sequence,", snapshot ").concat(this._snapshot.sequence,", last ").concat(this._lastSeq)),this.handle.handleMessage(t),this._lastSeq=t.sequence.sequence,e.next=10,new Promise((function(e){return setTimeout(e,0)}));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"syncSequenceUntilSuccess",value:(t=o(v().mark((function e(t,r){var n,i,o,a,s;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._requestingGap){e.next=2;break}return e.abrupt("return");case 2:this._requestingGap=!0,n=!1,this.logger.info("begin resolve gap ".concat(t," - ").concat(r));case 5:return e.prev=5,e.next=8,this._scene.getApiService().syncSequence(this._scene.sceneId,t,r);case 8:i=e.sent,o=i.list,a=Math.min(r,o.length),s=o.slice(0,a).map((function(e){return{sequence:e}})),this.prependTasks(s),n=!0,this.logger.info("gap resolved, new ".concat(s.length," tasks prepended ")),this.notifyTaskQueueUpdate(),e.next=23;break;case 18:return e.prev=18,e.t0=e.catch(5),this.logger.error("syncSequence failed: ".concat(e.t0)),e.next=23,new Promise((function(e){return setTimeout(e,3e3)}));case 23:if(!n){e.next=5;break}case 24:this._requestingGap=!1;case 25:case"end":return e.stop()}}),e,this,[[5,18]])}))),function(e,r){return t.apply(this,arguments)})},{key:"reset",value:function(){this._channelObserver.off("ChannelMessage",this._handleChannelMessage)}}]),e}())||Pc,jc=__webpack_require__(2699),Uc=__webpack_require__(3136),Fc=__webpack_require__.n(Uc);__webpack_require__(9601),__webpack_require__(9720);function Qc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qc(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Gc=function(){var e=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var i=new AbortController,o=setTimeout((function(){return i.abort()}),1e4);fetch(t,qc(qc({},r),{},{signal:i.signal})).then((function(t){return e(t)})).catch((function(e){n(e)})).finally((function(){clearTimeout(o)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Vc=function(){function e(){a(this,e),this.host=void 0,this.pathPrefix=void 0,this.headers=void 0}var t;return c(e,[{key:"fetch",value:(t=o(v().mark((function e(t){var r,i,o,a,s,c,u,l,h,f,d,p,g,A,m,y;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.method,i=t.data,o=t.full_url,a=t.path,s=t.query,c=void 0===s?{}:s,u=Fn.shared.service,l=u.host,h=u.pathPrefix,f={method:r,headers:Object.assign({},Fn.shared.service.headers,this.headers,t.headers)},d=Object.entries(c).filter((function(e){return!!n(e,2)[1]})).map((function(e){var t=n(e,2),r=t[0],i=t[1];return"".concat(r,"=").concat(i)})),p=d.length>0?"?".concat(d.join("&")):"",i&&(f.body=JSON.stringify(i)),e.prev=6,!o){e.next=13;break}return e.next=10,Gc("".concat(o),f);case 10:g=e.sent,e.next=16;break;case 13:return e.next=15,Gc("".concat(t.host||this.host||l).concat(t.pathPrefix||this.pathPrefix||h||"").concat(a).concat(p),f);case 15:g=e.sent;case 16:e.next=24;break;case 18:if(e.prev=18,e.t0=e.catch(6),20!==(A=e.t0).code){e.next=23;break}return e.abrupt("return",Mn.shared.handleThrowableError(kn.RTE_ERR_RESTFUL_NETWORK_TIMEOUT_ERR,A));case 23:return e.abrupt("return",Mn.shared.handleThrowableError(kn.RTE_ERR_RESTFUL_NETWORK_ERR,A));case 24:return e.next=26,g.json();case 26:if(m=e.sent,0==(y=+m.code)){e.next=34;break}if(!isNaN(y)){e.next=33;break}return e.abrupt("return",Mn.shared.handleThrowableError(kn.RTE_ERR_RESTFUL_SERVICE_ERR,new Pn(kn.RTE_ERR_RESTFUL_SERVICE_ERR,new Error(m.msg),{servCode:-1})));case 33:return e.abrupt("return",Mn.shared.handleThrowableError(kn.RTE_ERR_RESTFUL_SERVICE_ERR,new Pn(kn.RTE_ERR_RESTFUL_SERVICE_ERR,new Error(m.msg),{servCode:y})));case 34:return e.abrupt("return",m);case 35:case"end":return e.stop()}}),e,this,[[6,18]])}))),function(e){return t.apply(this,arguments)})}]),e}(),Kc=__webpack_require__(2775),Hc=__webpack_require__.n(Kc);function zc(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Wc,Yc=function(e){l(h,e);var t,r,n,i,s,u=zc(h);function h(){var e;a(this,h);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=u.call.apply(u,[this].concat(r))).tickerMap=new Map,e.timer=void 0,e}return c(h,[{key:"guardParams",value:function(){var e=Fn.shared.appId,t=Fn.shared.userId;if(e&&t)return!0;Mn.shared.handleThrowableError(kn.RTE_ERR_MISSING_PARAMS,new Error("invalid params"))}},{key:"platform",get:function(){return Fn.platform===Nn.Electron?"electron":"web"}},{key:"buildBaseParams",value:function(e,t,r,n,i,o,a){var s=(new Date).getTime(),c=Hc()("src=".concat(t,"&ts=").concat(s)),u=i.result,l=i.errCode,h=i.httpCode,f=i.api;return{pts:[{m:r,ls:{ctype:e,platform:this.platform,version:Gh.getVersion(),appId:Fn.shared.appId,event:o,category:a,result:void 0===u?void 0:"".concat(+u),errCode:l,httpCode:h,api:f},vs:n}],sign:c,src:t,ts:s}}},{key:"buildEventParams",value:function(e,t,r,n){return this.buildBaseParams("flexibleClass","rte","event",r,n,e,t)}},{key:"buildHBParams",value:function(){return this.buildBaseParams("flexibleClass","rte","online_user",{count:1},{})}},{key:"reportHB",value:(s=o(v().mark((function e(){var t;return v().wrap((function(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 t=e.sent,e.abrupt("return",t.data);case 6:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"report",value:(i=o(v().mark((function e(t,r,n,i){var o;return v().wrap((function(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.buildEventParams(t,r,n,i||{})});case 4:return o=e.sent,e.abrupt("return",o.data);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return i.apply(this,arguments)})},{key:"tickerKey",value:function(e,t,r){return"".concat(e,"/").concat(t,"/").concat(r||"")}},{key:"startTick",value:function(e,t,r){this.tickerMap.set(this.tickerKey(e,t,r),(new Date).getTime())}},{key:"startHB",value:function(){}},{key:"stopHB",value:function(){clearTimeout(this.timer),this.timer=null}},{key:"getElapse",value:function(e,t,r){var n=this.tickerKey(e,t,r);return this.tickerMap.has(n)?(new Date).getTime()-this.tickerMap.get(n):0}},{key:"reportEC",value:(n=o(v().mark((function e(t,r,n){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.report(t,r,{count:1},n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"reportElapse",value:(r=o(v().mark((function e(t,r,n){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.report(t,r,{elapse:this.getElapse(t,r,null==n?void 0:n.api)},n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"reportHttp",value:(t=o(v().mark((function e(t,r,n,i,o,a){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.report(t,r,{elapse:this.getElapse(t,r,n)},{api:n,httpCode:i,result:o,errCode:a}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r,n,i,o,a){return t.apply(this,arguments)})}]),h}(Vc);function Jc(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}Yc.shared=new Yc,function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.RECONNECTING="RECONNECTING",e.ABORTED="ABORTED"}(Wc||(Wc={}));var Xc=function(e){return void 0!==e.text},Zc=function(e){l(h,e);var t,r,n,i,s,u=Jc(h);function h(){var e;return a(this,h),(e=u.call(this)).connectionState=Wc.DISCONNECTED,e.prevConnectionState=Wc.DISCONNECTED,e.channels={},e._client=void 0,e.connectionState=Wc.DISCONNECTED,e.prevConnectionState=Wc.DISCONNECTED,e.channels={},e._client=void 0,e}return c(h,[{key:"client",get:function(){return this._client}},{key:"sessionId",get:function(){return this.client.context.sid}},{key:"logFilter",get:function(){var e=Fc().LOG_FILTER_INFO;switch(Fn.logLevel){case On.WARN:e=Fc().LOG_FILTER_WARNING;break;case On.OFF:e=Fc().LOG_FILTER_OFF;break;case On.ERROR:e=Fc().LOG_FILTER_ERROR}return e}},{key:"_region",get:function(){switch(Fn.shared.region){case Dn.CN:return"GLOBAL";case Dn.AP:return"ASIA";case Dn.EU:return"EUROPE";case Dn.NA:return"NORTH_AMERICA"}}},{key:"login",value:(s=o(v().mark((function e(t,r,n){var i,o=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Fc().setArea({areaCodes:[this._region]}),i=Fc().createInstance(Fn.shared.appId,{enableLogUpload:n.uploadLog,logFilter:this.logFilter}),yn.info("[rtm] wrapper init"),i.on("ConnectionStateChanged",(function(e,t){yn.info("[rtm] [Wrapper] ConnectionStateChanged",e,t),o.prevConnectionState=o.connectionState,o.connectionState=e,o.emit(_c.RtmConnectionStateChanged,{newState:e,reason:t})})),i.on("MessageFromPeer",(function(e,t,r){Xc(e)&&(yn.debug("[rtm] [Wrapper] MessageFromPeer ".concat(e.text)),o.emit("MessageFromPeer",{message:e.text,peerId:t,props:r}))})),e.next=8,i.login({uid:r,token:t});case 8:this._client=i,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),this._destroyRtm(i),Mn.shared.handleThrowableError(kn.RTM_ERR_LOGIN_FAIL,e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,11]])}))),function(e,t,r){return s.apply(this,arguments)})},{key:"createObserverChannel",value:function(e){return[this.client.createChannel(e),new jc.EventEmitter]}},{key:"join",value:(i=o(v().mark((function e(t,r,n){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,Yc.shared.startTick("joinRoom","rtm","joinChannel"),this.channels[n]!==t){e.next=4;break}return e.abrupt("return",yn.warn("[rtm] skip channel ".concat(n," join as the channel is already joined")));case 4:return t.on("ChannelMessage",(function(e,t,i){r.emit("ChannelMessage",{channelName:n,message:e,memberId:t,messagePros:i})})),t.on("MemberJoined",(function(e){r.emit("MemberJoined",{channelName:n,memberId:e})})),t.on("MemberLeft",(function(e){r.emit("MemberLeft",{channelName:n,memberId:e})})),t.on("MemberCountUpdated",(function(e){r.emit("MemberCountUpdated",{channelName:n,memberCount:e})})),e.next=10,t.join();case 10:this.channels[n]=t,Yc.shared.reportElapse("joinRoom","rtm",{api:"joinChannel",result:!0}),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),Yc.shared.reportElapse("joinRoom","rtm",{api:"joinChannel",result:!1,errCode:"".concat(e.t0.message)}),Mn.shared.handleThrowableError(kn.RTM_ERR_JOIN_FAILED,e.t0);case 18:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(e,t,r){return i.apply(this,arguments)})},{key:"leave",value:(n=o(v().mark((function e(t){var r;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(r=this.channels[t])){e.next=7;break}return e.next=5,r.leave();case 5:r.removeAllListeners(),delete this.channels[t];case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),Mn.shared.handleNonThrowableError(kn.RTM_ERR_LEAVE_FAILED,e.t0);case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e){return n.apply(this,arguments)})},{key:"releaseChannels",value:function(){for(var e=0,t=Object.keys(this.channels);e<t.length;e++){var r=t[e];this.channels[r]&&this.release(this.channels[r]),this.channels[r]=void 0}}},{key:"releaseClient",value:function(){this._client&&this.release(this._client)}},{key:"release",value:function(e){e.removeAllListeners(),yn.info("[AGRtmManager] eventClient removeAllListeners ")}},{key:"reset",value:function(){this.connectionState=Wc.DISCONNECTED,this.prevConnectionState=Wc.DISCONNECTED,this.releaseClient(),this.releaseChannels(),this.channels={},this.client&&(this.client.removeAllListeners(),yn.info("[AGRtmManager] removeAllListeners")),this._client=void 0,this.removeAllListeners(),yn.info("[AGRtmManager] self removeAllListeners")}},{key:"_destroyRtm",value:function(e){try{null==e||e.logout()}catch(e){Mn.shared.handleNonThrowableError(kn.RTM_ERR_DESTROY_FAILED,e)}}},{key:"destroyRtm",value:function(){this._destroyRtm(this._client),this._client=void 0}},{key:"sendChannelMessage",value:(r=o(v().mark((function e(t,r,n){var i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.channels[t],e.next=3,i.sendMessage(r,{enableHistoricalMessaging:n.enableHistoricalMessaging});case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"sendPeerMessage",value:(t=o(v().mark((function e(t,r,n){var i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.sendMessageToPeer(r,t,{enableHistoricalMessaging:n.enableHistoricalMessaging});case 2:return i=e.sent,e.abrupt("return",i.hasPeerReceived);case 4:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),h}(jc.EventEmitter);function $c(e,t,r,n,i){var o={};return Object.keys(n).forEach((function(e){o[e]=n[e]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce((function(r,n){return n(e,t,r)||r}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}__webpack_require__(86);var eu,tu,ru,nu=__webpack_require__(4073),iu=__webpack_require__.n(nu),ou=(__webpack_require__(4129),__webpack_require__(8206),new Set),au=function(e,t,r){var n=r.value;return{configurable:!0,enumerable:!1,get:function(){var e=this.__cacheMap;return e||(e=new WeakMap,this.__cacheMap=e,ou.add(this)),e.has(n)||e.set(n,n.bind(this)),e.get(n)},set:function(e){var t=this.__cacheMap;t||(t=new WeakMap,this.__cacheMap=t,ou.add(this)),t.set(e,e.bind(this))}}};function su(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}!function(e){e[e.None=0]="None",e[e.Camera=1]="Camera",e[e.ScreenShare=2]="ScreenShare"}(eu||(eu={})),function(e){e[e.None=0]="None",e[e.Mic=1]="Mic",e[e.Mix=2]="Mix"}(tu||(tu={})),function(e){e[e.Unpublished=0]="Unpublished",e[e.Published=1]="Published"}(ru||(ru={}));var cu,uu,lu=c((function e(t,r){var n=r.videoSourceType,i=r.audioSourceType;a(this,e),this.videoSourceType=eu.None,this.audioSourceType=tu.None,this.rtc=void 0,this.rtc=t,n&&(this.videoSourceType=n),i&&(this.audioSourceType=i)})),hu=function(e){l(r,e);var t=su(r);function r(e){var n;return a(this,r),(n=t.call(this,e,{videoSourceType:eu.Camera})).state=mu.stopped,e.onLocalVideoTrackStateChanged((function(e,t){t===eu.Camera&&(n.state=e)})),n}return c(r,[{key:"setView",value:function(e){this.rtc.setupLocalVideo(e,eu.Camera)}},{key:"setDeviceId",value:function(e){this.rtc.setVideoCameraDevice(e)}},{key:"setVideoEncoderConfiguration",value:function(){}},{key:"start",value:function(){return this.rtc.enableLocalVideo(!0)}},{key:"stop",value:function(){return this.rtc.enableLocalVideo(!1)}}]),r}(lu),fu=function(e){l(r,e);var t=su(r);function r(e){var n;return a(this,r),(n=t.call(this,e,{audioSourceType:tu.Mic})).state=mu.stopped,e.onLocalAudioTrackStateChanged((function(e,t){t===tu.Mic&&(n.state=e)})),n}return c(r,[{key:"setRecordingDevice",value:function(e){return this.rtc.setAudioRecordingDevice(e)}},{key:"setPlaybackDevice",value:function(e){return this.rtc.setAudioPlaybackDevice(e)}},{key:"start",value:function(){return this.rtc.enableLocalAudio(!0)}},{key:"stop",value:function(){return this.rtc.enableLocalAudio(!1)}}]),r}(lu),du=function(e){l(r,e);var t=su(r);function r(e){return a(this,r),t.call(this,e,{videoSourceType:eu.ScreenShare})}return c(r,[{key:"setView",value:function(e){this.rtc.setupLocalVideo(e,eu.ScreenShare)}},{key:"start",value:function(){return this.rtc.startScreenCapture()}},{key:"startWithParams",value:function(e,t){return this.rtc.startScreenCapture(e,t)}},{key:"stop",value:function(){return this.rtc.stopScreenCapture()}}]),r}(lu),pu=new Set,gu={debounced:function(e,t){return function(r,n,i){var o=i.value;return{configurable:!0,enumerable:!1,get:function(){var r=this.__cacheMap;return r||(r=new WeakMap,this.__cacheMap=r,pu.add(this)),r.has(o)||r.set(o,(0,S.debounce)(o,e,t).bind(this)),r.get(o)},set:function(e){var t=this.__cacheMap;t||(t=new WeakMap,this.__cacheMap=t,pu.add(this)),t.set(e,e.bind(this))}}}},throttled:function(e,t){return function(r,n,i){var o=i.value;return{configurable:!0,enumerable:!1,get:function(){var r=this.__cacheMap;return r||(r=new WeakMap,this.__cacheMap=r,pu.add(this)),r.has(o)||r.set(o,(0,S.throttle)(o,e,t).bind(this)),r.get(o)},set:function(e){var t=this.__cacheMap;t||(t=new WeakMap,this.__cacheMap=t,pu.add(this)),t.set(e,e.bind(this))}}}}};!function(e){e[e.main=0]="main",e[e.sub=1]="sub"}(uu||(uu={}));var vu,Au,mu,yu,_u,bu,Eu,wu,Iu,Cu,Su=Xn.attach({level:On.DEBUG})(cu=function(){function e(t,r){a(this,e),this.channelName=void 0,this._adapter=void 0,this._adapter=r,this.channelName=t}return c(e,[{key:"connectionType",value:function(e){return void 0===e?uu.main:e}},{key:"enableDualStream",value:function(e,t){return this._adapter.enableDualStream(e,this.connectionType(t))}},{key:"setLowStreamParameter",value:function(e,t){return this._adapter.setLowStreamParameter(e,this.connectionType(t))}},{key:"setRemoteVideoStreamType",value:function(e,t,r){return this._adapter.setRemoteVideoStreamType(e,t,this.connectionType(r))}},{key:"getRtcSid",value:function(){return this._adapter.getSessionId()}},{key:"join",value:function(e,t,r){return this._adapter.join(e,t,this.connectionType(r))}},{key:"leave",value:function(e){return this._adapter.leave(e)}},{key:"setClientRole",value:function(e){return this._adapter.setClientRole(e)}},{key:"muteLocalVideoStream",value:function(e,t){return this._adapter.muteLocalVideo(e,this.connectionType(t))}},{key:"muteLocalAudioStream",value:function(e,t){return this._adapter.muteLocalAudio(e,this.connectionType(t))}},{key:"muteLocalScreenStream",value:function(e,t){return this._adapter.muteLocalScreenShare(e,this.connectionType(t))}},{key:"muteRemoteVideoStream",value:function(e,t){return this._adapter.muteRemoteVideo(e,t)}},{key:"muteRemoteAudioStream",value:function(e,t){return this._adapter.muteRemoteAudio(e,t)}},{key:"onNetworkStats",value:function(e){return this._adapter.onNetworkStats(e)}},{key:"onAudioVolumeIndication",value:function(e){return this._adapter.onAudioVolumeIndication(e)}},{key:"onConnectionStageChanged",value:function(e){return this._adapter.onConnectionStateChanged(e)}}]),e}())||cu;__webpack_require__(3290);!function(e){e[e.unknown=99]="unknown",e[e.bad=1]="bad",e[e.poor=2]="poor",e[e.good=3]="good",e[e.great=4]="great",e[e.down=5]="down"}(vu||(vu={})),function(e){e[e.Unknown=0]="Unknown",e[e.PermissionDenied=1]="PermissionDenied"}(Au||(Au={})),function(e){e[e.stopped=0]="stopped",e[e.starting=2]="starting",e[e.started=1]="started",e[e.error=-1]="error"}(mu||(mu={})),function(e){e[e.Idle=0]="Idle",e[e.Connecting=1]="Connecting",e[e.Connected=2]="Connected",e[e.Reconnecting=3]="Reconnecting"}(yu||(yu={})),function(e){e[e.AES_128_XTS=1]="AES_128_XTS",e[e.AES_128_ECB=2]="AES_128_ECB",e[e.AES_256_XTS=3]="AES_256_XTS",e[e.SM4_128_ECB=4]="SM4_128_ECB",e[e.AES_128_GCM=5]="AES_128_GCM",e[e.AES_256_GCM=6]="AES_256_GCM"}(_u||(_u={})),function(e){e[e.Window=0]="Window",e[e.Screen=1]="Screen"}(bu||(bu={})),function(e){e[e.fit=0]="fit",e[e.fill=1]="fill"}(Eu||(Eu={})),function(e){e[e.low=0]="low",e[e.normal=1]="normal",e[e.height=2]="height"}(wu||(wu={})),function(e){e[e.HIGH_STREAM=0]="HIGH_STREAM",e[e.LOW_STREAM=1]="LOW_STREAM"}(Iu||(Iu={}));var Tu=(Cu=function(){function e(t,r){var n=r.userUuid,i=r.userName,o=r.userRole,s=r.streamUuid,c=r.sceneId,u=r.rtcToken,l=r.rtc,h=r.userProperties;a(this,e),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=iu()(this._syncVideoSourceState,500),this._debouncedSyncAudio=iu()(this._syncAudioSourceState,500),this.subStream=void 0,this.userUuid=n,this.userName=i,this.userRole=o,this.userProperties=h,this.streamUuid=s,this.sceneId=c,this.rtcToken=u,this._rtc=l,this._scene=t,this._addEventHandler()}var t,r,n,i,s,u,l,h,f,d;return c(e,[{key:"toData",value:function(){var e=this.userName,t=this.userUuid,r=this.userRole,n=this.userProperties;return Ec.fromData({userName:e,userUuid:t,role:r,userProperties:n})}},{key:"destroy",value:function(){Gh.engine.getAgoraMediaControl().off(Yu.localVideoTrackChanged,this._handleVideoTrackStateChange),Gh.engine.getAgoraMediaControl().off(Yu.localAudioTrackChanged,this._handleAudioTrackStateChange)}},{key:"_addEventHandler",value:function(){Gh.engine.getAgoraMediaControl().on(Yu.localVideoTrackChanged,this._handleVideoTrackStateChange),Gh.engine.getAgoraMediaControl().on(Yu.localAudioTrackChanged,this._handleAudioTrackStateChange)}},{key:"_handleVideoTrackStateChange",value:function(e,t){t===eu.Camera&&e!==mu.starting&&this._debouncedSyncVideo(e)}},{key:"_handleAudioTrackStateChange",value:function(e,t){t===tu.Mic&&e!==mu.starting&&this._debouncedSyncAudio(e)}},{key:"_syncVideoSourceState",value:function(e){yn.info("sync video state ".concat(e)),this.updateLocalMediaState({videoSourceState:e})}},{key:"_syncAudioSourceState",value:function(e){yn.info("sync audio state ".concat(e)),this.updateLocalMediaState({audioSourceState:e})}},{key:"setSceneProperties",value:(d=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._scene.getApiService().updateRoomProperties({roomUuid:this.sceneId,properties:t,cause:r});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"deleteSceneProperties",value:(f=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._scene.getApiService().deleteRoomProperties({roomUuid:this.sceneId,properties:t,cause:r});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"setUserProperties",value:(h=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._scene.getApiService().updateUserProperties({userUuid:this.userUuid,roomUuid:this.sceneId,properties:t,cause:r});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"deleteUserProperties",value:(l=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._scene.getApiService().deleteUserProperties({userUuid:this.userUuid,roomUuid:this.sceneId,properties:t,cause:r});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"updateLocalMediaState",value:(u=o(v().mark((function e(t,r){var n,i,o;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.videoSourceState,o=t.audioSourceState,e.next=3,this._scene.getApiService().updateDeviceState(this.sceneId,this.userUuid,r&&r===uu.sub?(null===(n=this.subStream)||void 0===n?void 0:n.streamUuid)||"0":this.streamUuid,{videoSourceState:i,audioSourceState:o});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"updateLocalMediaStream",value:(s=o(v().mark((function e(t,r){var n,i,o;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.publishVideo,o=t.publishAudio,e.next=3,this._scene.getApiService().upsertStream(this.sceneId,this.userUuid,r&&r===uu.sub?(null===(n=this.subStream)||void 0===n?void 0:n.streamUuid)||"0":this.streamUuid,{publishVideo:i,publishAudio:o});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"updateRemoteMediaStream",value:(i=o(v().mark((function e(t,r,n,i){var o,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.publishVideo,a=n.publishAudio,e.next=3,this._scene.getApiService().upsertStream(this.sceneId,t,r,{publishVideo:o,publishAudio:a});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return i.apply(this,arguments)})},{key:"deleteLocalMediaStream",value:(n=o(v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._scene.getApiService().deleteStream(this.sceneId,this.userUuid,this.streamUuid);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"deleteLocalScreenStream",value:(r=o(v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.subStream){e.next=4;break}return e.next=3,this._scene.getApiService().deleteStream(this.sceneId,this.userUuid,this.subStream.streamUuid);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"sendRoomMessage",value:(t=o(v().mark((function e(t){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._scene.getApiService().sendRoomChatMessage(t,this.sceneId);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setupRemoteVideo",value:function(e){this._rtc.setupRemoteVideo(e)}}]),e}(),$c(Cu.prototype,"_handleVideoTrackStateChange",[au],Object.getOwnPropertyDescriptor(Cu.prototype,"_handleVideoTrackStateChange"),Cu.prototype),$c(Cu.prototype,"_handleAudioTrackStateChange",[au],Object.getOwnPropertyDescriptor(Cu.prototype,"_handleAudioTrackStateChange"),Cu.prototype),$c(Cu.prototype,"_syncVideoSourceState",[au],Object.getOwnPropertyDescriptor(Cu.prototype,"_syncVideoSourceState"),Cu.prototype),$c(Cu.prototype,"_syncAudioSourceState",[au],Object.getOwnPropertyDescriptor(Cu.prototype,"_syncAudioSourceState"),Cu.prototype),Cu),Ru=__webpack_require__(8640),ku=__webpack_require__.n(Ru);function Ou(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ou(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ou(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xu=function(){function e(t,r,n){a(this,e),this.fn=void 0,this.args=void 0,this.onRetryAttemptFail=void 0,this.onRetryAbort=void 0,this.opts=void 0,this.fn=t,this.args=r,this.opts=n}var t;return c(e,[{key:"fail",value:function(e){return this.onRetryAttemptFail=e,this}},{key:"abort",value:function(e){return this.onRetryAbort=e,this}},{key:"exec",value:(t=o(v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ku()(this.fn,this.args,Nu(Nu({retriesMax:3},this.opts),{},{onAttemptFail:this.onRetryAttemptFail}));case 3:e.next=12;break;case 5:if(e.prev=5,e.t0=e.catch(0),e.t1=this.onRetryAbort,!e.t1){e.next=11;break}return e.next=11,this.onRetryAbort(e.t0);case 11:throw e.t0;case 12:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return t.apply(this,arguments)})}]),e}(),Du=function(e,t,r){return new xu(e,t,r)},Lu=function(e){try{return JSON.stringify(e)}catch(e){}return"invalid json"},Pu=function(e){return new Promise((function(t){setTimeout(t,e)}))},Bu=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Promise.race([e,new Promise((function(e,n){setTimeout(r?n:e,t)}))])},Mu=function(){function e(){a(this,e),this._users=pc.Map(),this._roomProperties=pc.Map({}),this._streams=pc.Map(),this._roomInfo=pc.Map(),this._messages=pc.List([])}return c(e,[{key:"users",get:function(){return this._users}},{key:"setUsers",value:function(e){this._users=pc.Map(e)}},{key:"setUser",value:function(e,t){this._users=this._users.set(e,t)}},{key:"deleteUser",value:function(e){this._users=this._users.delete(e)}},{key:"findUser",value:function(e){return this._users.get(e)}},{key:"roomProperties",get:function(){return this._roomProperties}},{key:"setRoomProperties",value:function(e){this._roomProperties=pc.Map(e)}},{key:"streams",get:function(){return this._streams}},{key:"setStreams",value:function(e){this._streams=pc.Map(e)}},{key:"findUserStreams",value:function(e){return Array.from(this._streams.values()).filter((function(t){return t.fromUser.userUuid===e}))}},{key:"setStream",value:function(e,t){this._streams=this._streams.set(e,t)}},{key:"deleteStream",value:function(e){this._streams=this._streams.delete(e)}},{key:"findStream",value:function(e){return this._streams.get(e)}},{key:"roomInfo",get:function(){return this._roomInfo}},{key:"setRoomInfo",value:function(e){this._roomInfo=pc.Map(e)}},{key:"messages",get:function(){return this._messages}},{key:"addMessage",value:function(e){this._messages.push(e)}}]),e}();function ju(e,t){return e.then((function(e){return[null,e]})).catch((function(e){return t&&Object.assign(e,t),[e,void 0]}))}const Uu=ju;var Fu,Qu,qu;function Gu(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}!function(e){e[e.Idle=0]="Idle",e[e.Connecting=1]="Connecting",e[e.Connected=2]="Connected",e[e.Reconnecting=3]="Reconnecting",e[e.Error=4]="Error"}(Fu||(Fu={})),function(e){e[e.Communication=0]="Communication",e[e.LiveBroadcasting=1]="LiveBroadcasting"}(Qu||(Qu={})),function(e){e[e.Host=0]="Host",e[e.Audience=1]="Audience"}(qu||(qu={}));var Vu,Ku=function(e){l(y,e);var t,r,n,i,s,u,h,f,d,p,g,A,m=Gu(y);function y(){return a(this,y),m.call(this)}return c(y,[{key:"checkIn",value:(A=o(v().mark((function e(t,r,n,i,o){var a,s;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch({path:"/v2/rooms/".concat(t,"/users/").concat(r),pathPrefix:"/edu/apps/".concat(Fn.shared.appId),method:"PUT",data:{boardRegion:"cn-hz",duration:18e3,role:o,roomName:n,roomType:4,userName:i,userProperties:{}}});case 2:return a=e.sent,s=a.data,e.abrupt("return",s);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,i){return A.apply(this,arguments)})},{key:"entryRoom",value:(g=o(v().mark((function e(t){var r,n,i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Yc.shared.startTick("joinRoom","http","entry"),e.next=3,this.fetch({path:"/v1/rooms/".concat(t.roomUuid,"/users/").concat(t.userUuid,"/entry"),method:"POST",data:t});case 3:return r=e.sent,n=r.__status,i=r.code,Yc.shared.reportHttp("joinRoom","http","entry",n,200===n,i),e.abrupt("return",r.data);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"syncSnapShot",value:(p=o(v().mark((function e(t){var r,n,i,o,a,s,c,u;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch({path:"/v1/rooms/".concat(t,"/snapshot"),method:"GET"});case 2:return n=e.sent,i=n.data,o=null!==(r=i.sequence)&&void 0!==r?r:0,a=kc()(i,"snapshot.room.roomInfo",null),s=kc()(i,"snapshot.room.roomProperties",null),c=kc()(i,"snapshot.room.roomState"),u=kc()(i,"snapshot.users",[]),e.abrupt("return",{seq:o,roomInfo:a,roomState:c,roomProperties:s,users:u});case 10:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"syncSequence",value:(d=o(v().mark((function e(t,r,n){var i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch({path:"/v1/rooms/".concat(t,"/sequences?nextId=").concat(r,"&count=").concat(n),method:"GET"});case 2:return i=e.sent,e.abrupt("return",i.data);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return d.apply(this,arguments)})},{key:"updateRoomProperties",value:(f=o(v().mark((function e(t){var r,n,i,o,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.roomUuid,n=t.properties,i=t.cause,o={properties:n},i&&(o.cause=i),e.next=5,this.fetch({path:"/v1/rooms/".concat(r,"/properties"),method:"PUT",data:o});case 5:return a=e.sent,e.abrupt("return",a.data);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"deleteRoomProperties",value:(h=o(v().mark((function e(t){var r,n,i,o,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.roomUuid,n=t.properties,i=t.cause,o={properties:n},i&&(o.cause=i),e.next=5,this.fetch({path:"/v1/rooms/".concat(r,"/properties"),method:"DELETE",data:o});case 5:return a=e.sent,e.abrupt("return",a.data);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"updateUserProperties",value:(u=o(v().mark((function e(t){var r,n,i,o,a,s;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.roomUuid,n=t.userUuid,i=t.properties,o=t.cause,a={properties:i,cause:void 0===o?void 0:o},e.next=4,this.fetch({path:"/v1/rooms/".concat(r,"/users/").concat(n,"/properties"),method:"PUT",data:a});case 4:return s=e.sent,e.abrupt("return",s.data);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"deleteUserProperties",value:(s=o(v().mark((function e(t){var r,n,i,o,a,s,c;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.roomUuid,n=t.userUuid,i=t.properties,o=t.cause,s={properties:i},(a=void 0===o?void 0:o)&&(s.cause=a),e.next=5,this.fetch({path:"/v1/rooms/".concat(r,"/users/").concat(n,"/properties"),method:"DELETE",data:s});case 5:return c=e.sent,e.abrupt("return",c.data);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"upsertStream",value:(i=o(v().mark((function e(t,r,n,i){var o,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.publishVideo,a=i.publishAudio,e.next=3,this.fetch({path:"/v1/rooms/".concat(t,"/users/").concat(r,"/streams/").concat(n),method:"PUT",data:{videoState:o,audioState:a}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return i.apply(this,arguments)})},{key:"deleteStream",value:(n=o(v().mark((function e(t,r,n){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch({path:"/v1/rooms/".concat(t,"/users/").concat(r,"/streams/").concat(n),method:"DELETE"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"updateDeviceState",value:(r=o(v().mark((function e(t,r,n,i){var o,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.videoSourceState,a=i.audioSourceState,e.next=3,this.fetch({path:"/v1/rooms/".concat(t,"/users/").concat(r,"/streams/").concat(n),method:"PATCH",data:{videoSourceState:o,audioSourceState:a}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"sendRoomChatMessage",value:(t=o(v().mark((function e(t,r){var n;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch({path:"/v1/rooms/".concat(r,"/chat/channel"),method:"POST",data:{message:t,type:1}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),y}(Vc);function Hu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hu(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Wu(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Yu,Ju=Xn.attach({proxyMethods:!1})(Vu=function(e){l(h,e);var t,r,i,s,u=Wu(h);function h(e,t){var r;a(this,h),(r=u.call(this)).logger=void 0,r.sceneId=void 0,r._localUser=void 0,r._sceneState=Fu.Idle,r._initialSync=!1,r._apiService=void 0,r.dataStore=void 0,r._rtmManager=void 0,r._rtcManager=void 0,r._rtmChannel=void 0,r._rtcChannel=void 0,r._rtmChannelObserver=void 0,r._synchronizer=void 0,r._timestampGap=0,r.createTs=void 0,r.sceneId=e,r._rtmManager=t.rtm,r._rtcManager=t.rtc,r._rtmChannel=t.rtmChannel,r._rtmChannelObserver=t.rtmChannelObserver,r._rtcChannel=t.rtcChannel,r._apiService=new Ku,r._apiService.pathPrefix=Gh.engine.apiServicePathPrefix,r.dataStore=new Mu;var n=r._rtcChannel,i=r._rtmManager;return n.onNetworkStats((function(e){r.emit(_c.NetworkStats,e)})),n.onAudioVolumeIndication((function(e){r.emit(_c.AudioVolumes,e)})),n.onConnectionStageChanged((function(e,t){r.emit(_c.RtcConnectionStateChanged,e,t)})),i.on(_c.RtmConnectionStateChanged,r._handleRtmStateChange=r._handleRtmStateChange.bind(f(r))),r}return c(h,[{key:"getApiService",value:function(){return this._apiService}},{key:"localUser",get:function(){return this._localUser}},{key:"rtcSid",get:function(){return this._rtcChannel.getRtcSid()}},{key:"rtmSid",get:function(){return this._rtmManager.sessionId}},{key:"rtcChannel",get:function(){return this._rtcChannel}},{key:"timestampServerLocalGap",get:function(){return this._timestampGap}},{key:"enableDualStream",value:function(e,t){return this._rtcChannel.enableDualStream(e,t)}},{key:"setLowStreamParameter",value:function(e,t){return this._rtcChannel.setLowStreamParameter(e,t)}},{key:"setRemoteVideoStreamType",value:function(e,t){return this._rtcChannel.setRemoteVideoStreamType(e,t)}},{key:"joinScene",value:(s=o(v().mark((function e(t){var r,n,i,o,a,s,c,u,l,h,f,d,p,g,A;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._sceneState===Fu.Idle){e.next=3;break}return yn.warn("scene not idle"),e.abrupt("return");case 3:return e.prev=3,this._setRteConnectionState(Fu.Connecting),r=Gh.engine.getAgoraMediaControl(),e.next=8,this.getApiService().entryRoom({userUuid:Fn.shared.userId,roomUuid:this.sceneId,userName:t.userName,streamUuid:t.streamId,role:t.userRole,stream:{videoSourceState:r.createCameraVideoTrack().state,audioSourceState:r.createMicrophoneAudioTrack().state}});case 8:return n=e.sent,i=n.user,o=n.room,this.createTs=o.roomState.createTime,this._apiService.headers=zu(zu({},Fn.shared.service.headers),{},{token:i.userToken}),e.next=15,this._rtmManager.join(this._rtmChannel,this._rtmChannelObserver,this.sceneId);case 15:return a=i.streamUuid,s=i.userName,c=i.userUuid,u=i.role,l=i.rtcToken,h=i.streams,f=void 0===h?[]:h,d=i.userProperties,p=f.map((function(e){return wc.fromData({streamUuid:e.streamUuid,streamName:e.streamName,fromUser:{userName:s,userUuid:c,role:u},videoSourceState:e.videoSourceState,audioSourceState:e.audioSourceState,videoSourceType:e.videoSourceType,audioSourceType:e.audioSourceType,videoState:e.videoState,audioState:e.audioState})})),this.dataStore.setStreams(p),this._localUser=new Tu(this,{userUuid:Fn.shared.userId,userName:s,userRole:u,streamUuid:a,sceneId:this.sceneId,rtcToken:l,rtc:this._rtcManager,userProperties:d}),2===f.length&&(g=f.find((function(e){return e.streamUuid!==a})),this._localUser.subStream=g),this._synchronizer=new Mc(this.dataStore,{scene:this,userUuid:Fn.shared.userId,streamUuid:a,channelObserver:this._rtmChannelObserver,rtm:this._rtmManager}),this._addEventListeners(this._synchronizer.handle),e.next=24,this.getApiService().syncSnapShot(this.sceneId);case 24:A=e.sent,this._synchronizer.syncSnapshot(bc.fromData(A)),e.next=32;break;case 28:return e.prev=28,e.t0=e.catch(3),this._cleanup(),e.abrupt("return",Mn.shared.handleThrowableError(kn.RTE_ERR_JOIN_SCENE_FAILED,e.t0));case 32:case"end":return e.stop()}}),e,this,[[3,28]])}))),function(e){return s.apply(this,arguments)})},{key:"leaveScene",value:(i=o(v().mark((function e(){var t,r,i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Uu(this._rtmManager.leave(this.sceneId));case 2:t=e.sent,r=n(t,1),(i=r[0])&&Mn.shared.handleNonThrowableError(kn.RTE_ERR_LEAVE_SCENE_FAIL,i),this._rtmManager.off(_c.RtmConnectionStateChanged,this._handleRtmStateChange),this._cleanup();case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"joinRTC",value:(r=o(v().mark((function e(t){var r;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._initialSync&&this.localUser){e.next=2;break}return e.abrupt("return",Mn.shared.handleThrowableError(kn.RTE_ERR_SCENE_NOT_READY,new Error("try to join rtc before scene is ready ".concat(!!this._initialSync," ").concat(!!this.localUser))));case 2:if(!t){e.next=8;break}return e.next=5,this._rtcChannel.join(t.token,t.streamUuid,t.connectionType);case 5:case 10:return e.abrupt("return",e.sent);case 8:return e.next=10,this._rtcChannel.join(this.localUser.rtcToken,null===(r=this.localUser)||void 0===r?void 0:r.streamUuid);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"leaveRTC",value:(t=o(v().mark((function e(t){var r,i,o;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Uu(this._rtcChannel.leave(t));case 2:r=e.sent,i=n(r,1),(o=i[0])&&Mn.shared.handleNonThrowableError(kn.RTC_ERR_LEAVE_CHANNEL_FAIL,o);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_cleanup",value:function(){var e;null===(e=this._localUser)||void 0===e||e.destroy(),this._localUser=void 0,this._synchronizer=void 0,this._initialSync=!1}},{key:"_setRteConnectionState",value:function(e,t){var r=this._sceneState;this._sceneState=e,this._sceneState!==r&&this.emit(_c.RteConnectionStateChanged,e,t)}},{key:"_setInitialSnapshotSync",value:function(e){this._initialSync=e,this._recalculateRteState()}},{key:"_recalculateRteState",value:function(e){var t=this._rtmManager.connectionState,r=this._initialSync;return t===Wc.DISCONNECTED?this._setRteConnectionState(Fu.Idle):t===Wc.CONNECTING?this._setRteConnectionState(Fu.Connecting):t===Wc.CONNECTED?r?this._setRteConnectionState(Fu.Connected):this._setRteConnectionState(Fu.Connecting):t===Wc.RECONNECTING?r?this._setRteConnectionState(Fu.Reconnecting):this._setRteConnectionState(Fu.Connecting):t===Wc.ABORTED?this._setRteConnectionState(Fu.Error,e):void yn.warn("unhandled rte connection state: rtm: ".concat(t,", snapshot: ").concat(r))}},{key:"_handleUserAdded",value:function(e){var t=this,r=[],n=[];e.forEach((function(e){var i;if(t.logger.info("check streams with user",e),(null===(i=t.localUser)||void 0===i?void 0:i.userUuid)===e.userUuid){var o=t.dataStore.findUserStreams(e.userUuid);o.length?(t.logger.info("local streams come with user",o),r=r.concat(o)):t.logger.info("no local streams come with user",o)}else{var a=t.dataStore.findUserStreams(e.userUuid);a.length?(t.logger.info("remote streams come with user",a),n=n.concat(a)):t.logger.info("no remote streams come with user",a)}})),this.emit(_c.LocalStreamAdded,r),this.emit(_c.RemoteStreamAdded,n),this.emit(_c.UserAdded,e)}},{key:"_handleUserRemoved",value:function(e,t){var r=this,n=[],i=[];e.forEach((function(e){var t;if((null===(t=r.localUser)||void 0===t?void 0:t.userUuid)===e.userUuid){var o=r.dataStore.findUserStreams(e.userUuid);o.length&&(n=n.concat(o))}else{var a=r.dataStore.findUserStreams(e.userUuid);a.length&&(i=i.concat(a))}})),this._handleLocalStreamRemoved(n),this._handleRemoteStreamsRemoved(i),this.emit(_c.UserRemoved,e,t)}},{key:"_handleLocalStreamRemoved",value:function(e,t){0!==e.length&&(this.logger.info("_handleLocalStreamRemoved [".concat(e.join(","),"]")),this.emit(_c.LocalStreamRemove,e,t))}},{key:"_handleRemoteStreamsRemoved",value:function(e,t){0!==e.length&&(this.logger.info("_handleRemoteStreamsRemoved [".concat(e.join(","),"]")),this.emit(_c.RemoteStreamRemove,e,t))}},{key:"_addEventListeners",value:function(e){var t=this;e.on(_c.SnapshotUpdated,(function(){if(t.logger.info("sceneId:".concat(t.sceneId," snapshot updated")),t._setInitialSnapshotSync(!0),!t.localUser)return Mn.shared.handleThrowableError(kn.RTE_ERR_LOCAL_USER_NOT_EXIST,new Error("local user not exist"));var e=t.localUser.toData();t.dataStore.setUser(t.localUser.userUuid,Ec.fromData(e));var r=Array.from(t.dataStore.users.values()).filter((function(e){return e.userUuid!==t.localUser.userUuid}));r.push(e),r.length>0&&t._handleUserAdded(r),t._handleRoomPropertyChange(Array.from(t.dataStore.roomProperties.keys()),t.dataStore.roomProperties,{},{})})),e.on(_c.ChatReceived,(function(e){t.emit(_c.ChatReceived,e)})),e.on(_c.UserAdded,(function(e){t.logger.info("sceneId:".concat(t.sceneId," user-added [").concat(e.join(","),"]")),t._handleUserAdded(e)})),e.on(_c.UserUpdated,(function(e){t.logger.info("sceneId:".concat(t.sceneId," user-updated ").concat(e))})),e.on(_c.UserRemoved,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," user-removed [").concat(e.join(","),"]")),t._handleUserRemoved(e,r)})),e.on(_c.RoomPropertyUpdated,(function(e,r,n,i){t.logger.debug("sceneId:".concat(t.sceneId," room-property-updated ").concat(Lu(r)," ").concat(Lu(n)," ").concat(Lu(i))),t._handleRoomPropertyChange(e,r,n,i)})),e.on(_c.UserPropertyUpdated,(function(e,r,n,i){t.logger.debug("sceneId:".concat(t.sceneId," user-property-updated ").concat(e," ").concat(Lu(r)," ").concat(Lu(n)," ").concat(Lu(i))),t.emit(_c.UserPropertyUpdated,e,r,n,i)})),e.on(_c.BatchUserPropertyUpdated,(function(e,r,n){t.logger.debug("batch-user-property-updated ".concat(Lu(e)," ").concat(Lu(r)," ").concat(Lu(n))),t.emit(_c.BatchUserPropertyUpdated,e,r,n)})),e.on(_c.LocalStreamAdded,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," local-stream-added [").concat(e.join(","),"]")),0!==e.length&&t.emit(_c.LocalStreamAdded,e,r)})),e.on(_c.LocalStreamUpdate,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," local-stream-upsert [").concat(e.join(","),"]")),0!==e.length&&t.emit(_c.LocalStreamUpdate,e,r)})),e.on(_c.LocalStreamRemove,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," local-stream-removed [").concat(e.join(","),"]")),0!==e.length&&t.emit(_c.LocalStreamRemove,e,r)})),e.on(_c.RemoteStreamAdded,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," remote-stream-added [").concat(e.join(","),"]")),0!==e.length&&t.emit(_c.RemoteStreamAdded,e,r)})),e.on(_c.RemoteStreamUpdate,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," remote-stream-upsert [").concat(e.join(","),"]")),0!==e.length&&t.emit(_c.RemoteStreamUpdate,e,r)})),e.on(_c.RemoteStreamRemove,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," remote-stream-removed [").concat(e.join(","),"]")),0!==e.length&&t.emit(_c.RemoteStreamRemove,e,r)})),e.on(_c.ChatUserMessage,(function(e){t.emit(_c.ChatUserMessage,e)})),e.on(_c.TimeStampGapUpdate,(function(e){t._timestampGap=e,t.emit(_c.TimeStampGapUpdate,e)}))}},{key:"_handleRoomPropertyChange",value:function(e,t,r,n){this.emit(_c.RoomPropertyUpdated,e,t.toObject(),r,n)}},{key:"_handleRtmStateChange",value:function(e){this._recalculateRteState(e.reason)}}]),h}(jc.EventEmitter))||Vu;function Xu(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}!function(e){e.cameraListChanged="camera-list-changed",e.localAudioVolume="local-audio-volume",e.localAudioRecordingListChanged="local-audio-recording-list-changed",e.localVideoTrackChanged="local-video-track-changed",e.localAudioTrackChanged="local-audio-track-changed",e.trackStateChanged="track-state-changed",e.playbackDeviceListChanged="playback-device-list-changed",e.recordingDeviceListChanged="recording-device-list-changed",e.localAudioPlaybackVolumeIndicator="start-test-audio-playback-volume-indicator",e.audioPlaybackStateChanged="audio-playback-state-changed",e.localAudioFrame="local-audio-frame"}(Yu||(Yu={}));var Zu,$u=function(e){l(r,e);var t=Xu(r);function r(e){var n;return a(this,r),(n=t.call(this)).camera=void 0,n.microphone=void 0,n.screen=void 0,n._rtc=void 0,n._rtc=e,n._addEventListener(e),n}return c(r,[{key:"_addEventListener",value:function(e){var t=this;e.getVideoDeviceManager().onLocalCameraListChanged((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.emit.apply(t,[Yu.cameraListChanged].concat(r))})),e.getAudioDeviceManager().onLocalRecordingDeviceListChanged((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.emit.apply(t,[Yu.recordingDeviceListChanged].concat(r))})),e.getAudioDeviceManager().onLocalPlaybackDeviceListChanged((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.emit.apply(t,[Yu.playbackDeviceListChanged].concat(r))})),e.getVideoDeviceManager().onLocalVideoTrackStateChanged((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.emit.apply(t,[Yu.localVideoTrackChanged].concat(r))})),e.getAudioDeviceManager().onLocalAudioTrackStateChanged((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.emit.apply(t,[Yu.localAudioTrackChanged].concat(r))})),e.getAudioDeviceManager().onLocalAudioVolume((function(e){t.emit(Yu.localAudioVolume,e)})),e.getAudioDeviceManager().onLocalAudioPlaybackTestVolumeChanged((function(e){t.emit(Yu.localAudioPlaybackVolumeIndicator,e)})),e.getAudioDeviceManager().onAudioFrame((function(e){t.emit(Yu.localAudioFrame,e)})),e.onLocalScreenShareTrackStateChanged((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.emit.apply(t,[Yu.localVideoTrackChanged].concat(r))}))}},{key:"createCameraVideoTrack",value:function(){return this.camera||(this.camera=new hu(this._rtc)),this.camera}},{key:"createMicrophoneAudioTrack",value:function(){return this.microphone||(this.microphone=new fu(this._rtc)),this.microphone}},{key:"createScreenShareTrack",value:function(){return this.screen||(this.screen=new du(this._rtc)),this.screen}},{key:"getVideoCameraList",value:function(){return this._rtc.getVideoDeviceManager().getVideoCameraDevices()}},{key:"getAudioRecordingList",value:function(){return this._rtc.getAudioDeviceManager().getAudioRecordingDevices()}},{key:"getAudioPlaybackList",value:function(){return this._rtc.getAudioDeviceManager().getAudioPlaybackDevices()}},{key:"isScreenDeviceEnumerateSupported",value:function(){return this._rtc.isScreenDeviceEnumerateSupported()}},{key:"hasScreenSharePermission",value:function(){return this._rtc.hasScreenSharePermission()}},{key:"getWindowDevices",value:function(){return this._rtc.getWindowDevices()}},{key:"getDisplayDevices",value:function(){return this._rtc.getDisplayDevices()}},{key:"startAudioRecordingDeviceTest",value:function(e){return this._rtc.startAudioRecordingDeviceTest(e)}},{key:"stopAudioRecordingDeviceTest",value:function(){return this._rtc.stopAudioRecordingDeviceTest()}},{key:"startAudioPlaybackDeviceTest",value:function(e){return this._rtc.startAudioPlaybackDeviceTest(e)}},{key:"stopAudioPlaybackDeviceTest",value:function(){return this._rtc.stopAudioPlaybackDeviceTest()}},{key:"setAudioFrameCallback",value:function(){return this._rtc.setAudioFrameCallback()}},{key:"stopAudioFrameCallback",value:function(){return this._rtc.stopAudioFrameCallback()}},{key:"setBeautyEffectOptions",value:function(e,t){return this._rtc.setBeautyEffectOptions(e,t)}},{key:"setAudioRawDataConfig",value:function(e){return this._rtc.setAudioRawDataConfig(e)}}]),r}(y);__webpack_require__(8478),__webpack_require__(3561),__webpack_require__(2049);!function(e){e[e.continue=0]="continue",e[e.exit=1]="exit"}(Zu||(Zu={}));var el=function(e){return new Promise(function(){var t=o(v().mark((function t(r,n){var i;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e();case 3:i=t.sent,r(i),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),n(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,r){return t.apply(this,arguments)}}())},tl=function(){function e(t){a(this,e),this.__arguments=t,this.__timer=void 0,this.__running=!1}return c(e,[{key:"start",value:function(){var e=this;if(this.__running)throw new Error("Task is already running");this.__running=!0,this.__arguments.immediate?el(this.__arguments.runnable).then((function(){e.poll()})):this.poll()}},{key:"poll",value:function(){var e=this;if(!this.__running)return this.stop();this.__timer=setTimeout(o(v().mark((function t(){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,el(e.__arguments.runnable).catch((function(t){e.__arguments.onFail(t)===Zu.exit&&(e.__running=!1)}));case 2:!e.__arguments.once&&e.poll();case 3:case"end":return t.stop()}}),t)}))),this.__arguments.interval)}},{key:"stop",value:function(){clearTimeout(this.__timer),this.__running=!1}},{key:"isStopped",get:function(){return!this.__running}}]),e}(),rl=function(){function e(t){a(this,e),this.__arguments=t,this.__timer=void 0,this.__running=!1}return c(e,[{key:"start",value:function(){var e=this;if(this.__running)throw new Error("Task is already running");this.__running=!0;var t=this.__arguments,r=t.immediate,n=t.interval;r&&this.poll(),this.__timer=setInterval((function(){e.poll()}),n)}},{key:"poll",value:function(){var e=this;if(!this.__running)return this.stop();var t=this.__arguments.runnable;el(t).catch((function(t){e.__arguments.onFail(t)===Zu.exit&&(e.__running=!1)}))}},{key:"stop",value:function(){clearInterval(this.__timer),this.__running=!1}},{key:"isStopped",get:function(){return!this.__running}}]),e}(),nl=function(){function e(){a(this,e)}return c(e,null,[{key:"second",value:function(e){return this._factors.second*e}},{key:"minute",value:function(e){return this._factors.minute*e}},{key:"hour",value:function(e){return this._factors.hour*e}}]),e}();nl._factors={hour:36e5,minute:6e4,second:1e3};var il=function(){function e(){a(this,e),this._tasks=new WeakSet}return c(e,[{key:"addPollingTask",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return Zu.continue},i=new tl({runnable:e,interval:t,immediate:r,onFail:n});return i.start(),this._tasks.add(i),i}},{key:"addDelayTask",value:function(e,t){var r=this,n=new tl({runnable:e,interval:t,once:!0,onFail:function(){return Zu.exit},onComplete:function(){r._tasks.delete(n)}});return n.start(),this._tasks.add(n),n}},{key:"addIntervalTask",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return Zu.continue},i=new rl({runnable:e,interval:t,immediate:r,onFail:n});return i.start(),this._tasks.add(i),i}}]),e}(),ol=function(){return new il},al=ol();function sl(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var cl=function(e){l(r,e);var t=sl(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r)}(y),ul=function(e){l(r,e);var t=sl(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r)}(y),ll=function(e){l(r,e);var t=sl(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r)}(y),hl=function(e){l(r,e);var t=sl(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r,null,[{key:"getRtcVersion",value:function(){return""}}]),r}(y);function fl(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var dl,pl=function(e){l(r,e);var t=fl(r);function r(e){var n;return a(this,r),(n=t.call(this)).adapter=e,n._deviceInfo=new Map,n._deviceIds=new Set,n._initializeDeviceList(),n}return c(r,[{key:"onLocalVideoTrackStateChanged",value:function(e){return this.adapter.onLocalVideoTrackStateChanged(e),0}},{key:"onLocalCameraListChanged",value:function(e){return this.on(Yu.cameraListChanged,e),0}},{key:"getVideoCameraDevices",value:function(){return this.cameraList}},{key:"cameraList",get:function(){var e=this,t=[];return this._deviceIds.forEach((function(r){var n=e._deviceInfo.get(r);n&&t.push({deviceid:n.deviceid,devicename:n.devicename})})),t}},{key:"_emitCameraListChanged",value:function(e,t,r){this.emit(Yu.cameraListChanged,e,t,r)}},{key:"_initializeDeviceList",value:function(){var e=this;this.fetchDeviceList(),this.adapter.rtcEngine.on("videoDeviceStateChanged",(function(){e.fetchDeviceList()}))}},{key:"fetchDeviceList",value:function(){var e=this,t=this.adapter.rtcEngine.getVideoDevices(),r=[];this._deviceIds.clear(),this._deviceInfo.clear(),t.forEach((function(t){e._deviceInfo.set(t.deviceid,t),e._deviceIds.add(t.deviceid),r.push(t)})),this._emitCameraListChanged(!0,r,this.cameraList)}}]),r}(cl),gl=function(e){l(r,e);var t=fl(r);function r(e){var n;return a(this,r),(n=t.call(this)).adapter=e,n._recordingDeviceInfo=new Map,n._recordingDeviceIds=new Set,n._playbackDeviceInfo=new Map,n._playbackDeviceIds=new Set,n._initializeDeviceList(),n}return c(r,[{key:"_initializeDeviceList",value:function(){var e=this;this._fetchRecordingDeviceList(),this._fetchPlaybackDeviceList(),this.adapter.rtcEngine.on("audioDeviceStateChanged",(function(){e._fetchRecordingDeviceList(),e._fetchPlaybackDeviceList()}))}},{key:"onLocalAudioPlaybackTestVolumeChanged",value:function(e){return this.adapter.onLocalAudioPlaybackTestVolumeChanged(e)}},{key:"onLocalAudioTrackStateChanged",value:function(e){return this.adapter.onLocalAudioTrackStateChanged(e)}},{key:"onLocalAudioVolume",value:function(e){return this.adapter.onLocalAudioVolume(e)}},{key:"onLocalRecordingDeviceListChanged",value:function(e){return this.on(Yu.recordingDeviceListChanged,e),0}},{key:"onLocalPlaybackDeviceListChanged",value:function(e){return this.on(Yu.playbackDeviceListChanged,e),0}},{key:"getAudioPlaybackDevices",value:function(){return this.speakerList}},{key:"getAudioRecordingDevices",value:function(){return this.microphoneList}},{key:"microphoneList",get:function(){var e=this,t=[];return this._recordingDeviceIds.forEach((function(r){var n=e._recordingDeviceInfo.get(r);n&&t.push({deviceid:n.deviceid,devicename:n.devicename})})),t}},{key:"speakerList",get:function(){var e=this,t=[];return this._playbackDeviceIds.forEach((function(r){var n=e._playbackDeviceInfo.get(r);n&&t.push({deviceid:n.deviceid,devicename:n.devicename})})),t}},{key:"_emitPlaybackListChanged",value:function(e,t,r){this.emit(Yu.playbackDeviceListChanged,e,t,r)}},{key:"_emitRecordingListChanged",value:function(e,t,r){this.emit(Yu.recordingDeviceListChanged,e,t,r)}},{key:"_fetchPlaybackDeviceList",value:function(){var e=this,t=this.adapter.rtcEngine.getAudioPlaybackDevices(),r=[];this._playbackDeviceInfo.clear(),this._playbackDeviceIds.clear(),t.forEach((function(t){e._playbackDeviceInfo.set(t.deviceid,t),e._playbackDeviceIds.add(t.deviceid),r.push(t)})),this._emitPlaybackListChanged(!0,r,this.speakerList)}},{key:"_fetchRecordingDeviceList",value:function(){var e=this,t=this.adapter.rtcEngine.getAudioRecordingDevices(),r=[];this._recordingDeviceInfo.clear(),this._recordingDeviceIds.clear(),t.forEach((function(t){e._recordingDeviceInfo.set(t.deviceid,t),e._recordingDeviceIds.add(t.deviceid),r.push(t)})),this._emitRecordingListChanged(!0,r,this.microphoneList)}},{key:"onAudioFrame",value:function(e){return 0}}]),r}(ul),vl=function(){function e(){a(this,e),this.quality=vu.good,this.qualities=[]}return c(e,[{key:"_updateQualities",value:function(t){this.qualities.push(t),this.qualities.length>e.MAX_QUALITY_NUMBER&&this.qualities.shift()}},{key:"_resetQualities",value:function(){this.qualities=[]}},{key:"toAGQuality",value:function(t){return void 0===t?this.quality:0===t||8===t||7===t?(this._resetQualities(),this.quality):6===t?(this._resetQualities(),this.quality=vu.down,this.quality):(this._updateQualities(t),this.qualities.length<e.MAX_QUALITY_NUMBER||(this.qualities.reduce((function(e,t){return e+t}))>=e.QUALITY_THRESHOLD?this.quality=vu.bad:this.quality=vu.good),this.quality)}}]),e}();vl.MAX_QUALITY_NUMBER=3,vl.QUALITY_THRESHOLD=10;var Al=Xn.attach({proxyMethods:!1})(dl=function(){function e(){a(this,e),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 vl,this._uplinkNetworkQualityClacInstance=new vl}return c(e,[{key:"networkStats",value:function(){var e={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 e}}]),e}())||dl;function ml(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var yl,_l=function(e){l(n,e);var t,r=ml(n);function n(){var e;a(this,n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=r.call.apply(r,[this].concat(i))).logger=void 0,e.running=!1,e.runnable=!0,e}return c(n,[{key:"run",value:function(){var e=this;if(!this.running&&this.runnable){this.running=!0;var t=setTimeout(o(v().mark((function r(){return v().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return clearTimeout(t),r.next=3,e.onExecution();case 3:e.running=!1;case 4:case"end":return r.stop()}}),r)}))),0)}}},{key:"onExecution",value:(t=o(v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"stop",value:function(){this.running=!1}}]),n}(y);function bl(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var El,wl,Il,Cl=Xn.attach({proxyMethods:!1})(yl=function(e){l(n,e);var t,r=bl(n);function n(e){var t;return a(this,n),(t=r.call(this)).logger=void 0,t.canvas=void 0,t.trackState=mu.stopped,t.cameraEnable=!1,t._rtcEngine=void 0,t.currentCanvas=void 0,t.videoStreamState=0,t._rtcEngine=e.rtcEngine,t}return c(n,[{key:"setCameraTrackState",value:function(e,t){this.trackState!==e&&(this.trackState=e,this.emit(Yu.trackStateChanged,e,eu.Camera,t))}},{key:"onExecution",value:(t=o(v().mark((function e(){var t,r=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.debug("thread notify start..."),!this.cameraEnable){e.next=17;break}if(0!==(t=this.videoStreamState)&&3!==t){e.next=10;break}return e.delegateYield(v().mark((function e(){var n;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.logger.debug("starting camera..."),r.setCameraTrackState(mu.starting),n=void 0,e.prev=3,0!==t){e.next=7;break}return e.next=7,new Promise((function(e){n=function(t){1!==t&&2!==t||e()},r._rtcEngine.on("localVideoStateChanged",n),r._rtcEngine.enableLocalVideo(!0);var t=Fn.shared.rtcConfigs.defaultCameraEncoderConfigurations,i=t?{width:t.width,height:t.height,frameRate:t.frameRate,bitrate:t.bitrate,minFrameRate:0,orientationMode:0,minBitrate:0,mirrorMode:0,degradationPreference:1}:void 0;i&&(r._rtcEngine.setVideoEncoderConfiguration(i),r._rtcEngine.setVideoRenderFPS(i.frameRate))}));case 7:r.setCameraTrackState(mu.started),n&&r._rtcEngine.off("localVideoStateChanged",n),r.logger.debug("camera started."),e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(3),r.setCameraTrackState(mu.error),n&&r._rtcEngine.off("localVideoStateChanged",n),e.abrupt("return","break");case 17:case"end":return e.stop()}}),e,null,[[3,12]])}))(),"t0",5);case 5:if("break"!==e.t0){e.next=8;break}return e.abrupt("break",23);case 8:e.next=11;break;case 10:this.trackState!==mu.started&&this.setCameraTrackState(mu.started);case 11:if(this.trackState!==mu.started){e.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,e.abrupt("break",23);case 15:e.next=20;break;case 17:if(this.trackState!==mu.stopped&&(this.logger.debug("stopping camera..."),this._rtcEngine.enableLocalVideo(!1),this.currentCanvas&&this.currentCanvas.view,this.setCameraTrackState(mu.stopped),this.logger.debug("camera stopped")),this.trackState!==mu.stopped){e.next=20;break}return e.abrupt("break",23);case 20:return e.next=22,new Promise((function(e){return setTimeout(e,500)}));case 22:if(this.running){e.next=0;break}case 23:this.logger.debug("thread sleep...");case 24:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),n}(_l))||yl;function Sl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Tl(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Rl=c((function e(){a(this,e)}));try{Rl=__webpack_require__(5455).default}catch(e){Fn.platform===Nn.Electron&&yn.warn("load electron sdk failed: ".concat(e))}var kl=Xn.attach({proxyMethods:!1})((wl=function(e){l(r,e);var t=Tl(r);function r(){var e;a(this,r),(e=t.call(this)).logger=void 0,e._vdm=void 0,e._adm=void 0,e._engine=void 0,e._channels=new Map,e._configs={},e._screenEventBus=new y,e.cameraThread=void 0,e._localVideoEnabled=!1,e._localAudioEnabled=!1,e.screenShareId=void 0,e.screenShareType=void 0,r.rtcEngine||(r.rtcEngine=new Rl),e._engine=r.rtcEngine;var n=r.logPath,i=0;if(n){yn.info("[RtcAdapterElectron] sdk log path: ".concat(n));window.require("path");i=e.rtcEngine.initialize(Fn.shared.appId,e._region,{filePath:n,fileSize:1024,level:1})}else yn.warn("[RtcAdapterElectron] no log path found, sdk logs will be put in default folder"),i=e.rtcEngine.initialize(Fn.shared.appId,e._region);return 0!==i&&Mn.shared.handleThrowableError(kn.RTC_ERR_RTC_ENGINE_INITIALZIE_FAILED,new Error("rtc engine initialize failed ".concat(i))),Fn.shared.rtcSDKParameters&&Fn.shared.rtcSDKParameters.forEach((function(t){e.rtcEngine.setParameters(JSON.stringify(t))})),e._adm=new gl(f(e)),e._vdm=new pl(f(e)),e.cameraThread=new Cl(f(e)),e._addEventListeners(),e}return c(r,[{key:"configs",get:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sl(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},this._configs)}},{key:"rtcEngine",get:function(){return this._engine}},{key:"createRtcChannel",value:function(e,t){var r=this._channels.get(e);return r||(r=new Ol(e,this.configs,t),this._channels.set(e,r)),r}},{key:"getVideoDeviceManager",value:function(){return this._vdm}},{key:"getAudioDeviceManager",value:function(){return this._adm}},{key:"getWindowDevices",value:function(){return this.rtcEngine.getScreenWindowsInfo().map((function(e){return{id:e.windowId,type:bu.Window,title:e.name||e.ownerName,image:e.image,isCurrent:"".concat(e.processId)===window.main_pid}}))}},{key:"getDiaplayDevices",value:function(){return this.rtcEngine.getScreenDisplaysInfo().map((function(e){return{id:e.displayId,type:bu.Screen,title:"Display",image:e.image}}))}},{key:"isScreenDeviceEnumerateSupported",value:function(){return!0}},{key:"setVideoCameraDevice",value:function(e){return this.rtcEngine.setVideoDevice(e)}},{key:"setAudioRecordingDevice",value:function(e){return this.rtcEngine.setAudioRecordingDevice(e)}},{key:"setAudioPlaybackDevice",value:function(e){return this.rtcEngine.setAudioPlaybackDevice(e)}},{key:"enableLocalVideo",value:function(e){return this._localVideoEnabled=e,this.updateRole(),this.cameraThread.cameraEnable=e,this.cameraThread.run(),0}},{key:"enableLocalAudio",value:function(e){return this._localAudioEnabled=e,this.updateRole(),this.rtcEngine.enableLocalAudio(e)}},{key:"setupLocalVideo",value:function(e,t){return t===eu.Camera?(this.cameraThread.canvas=e,this.cameraThread.run()):t===eu.ScreenShare&&this.rtcEngine.setupLocalVideoSource(e.view),0}},{key:"setupRemoteVideo",value:function(e){return this.rtcEngine.setupRemoteVideo(+e.streamUuid,e.view),this.rtcEngine.setupViewContentMode(+e.streamUuid,e.renderMode===Eu.fill?0:1,void 0),0}},{key:"startAudioRecordingDeviceTest",value:function(e){return this.rtcEngine.startAudioRecordingDeviceTest(e)}},{key:"stopAudioRecordingDeviceTest",value:function(){return this.rtcEngine.stopAudioRecordingDeviceTest()}},{key:"startAudioPlaybackDeviceTest",value:function(e){return this.rtcEngine.startAudioPlaybackDeviceTest(e)}},{key:"stopAudioPlaybackDeviceTest",value:function(){return this.rtcEngine.stopAudioPlaybackDeviceTest()}},{key:"startScreenCapture",value:function(e,t){return this.rtcEngine.videoSourceInitialize(Fn.shared.appId),void 0!==e&&(this.screenShareId=e,this.screenShareType=t,this._screenEventBus.emit(Yu.trackStateChanged,mu.started,eu.ScreenShare)),0}},{key:"stopScreenCapture",value:function(){return this.screenShareId=void 0,this.screenShareType=void 0,this.rtcEngine.stopScreenCapture2(),this._screenEventBus.emit(Yu.trackStateChanged,mu.stopped,eu.ScreenShare),0}},{key:"onLocalAudioPlaybackTestVolumeChanged",value:function(e){return this.on(Yu.localAudioPlaybackVolumeIndicator,e),0}},{key:"onLocalVideoTrackStateChanged",value:function(e){return this.cameraThread.on(Yu.trackStateChanged,e),0}},{key:"onLocalAudioTrackStateChanged",value:function(e){return this.on(Yu.localAudioTrackChanged,e),0}},{key:"onLocalAudioVolume",value:function(e){return this.on(Yu.localAudioVolume,e),0}},{key:"onLocalScreenShareTrackStateChanged",value:function(e){return this._screenEventBus.on(Yu.trackStateChanged,e),0}},{key:"onAudioFrame",value:function(e){return this.logger.warn("electron platform does not support this for now"),0}},{key:"setBeautyEffectOptions",value:function(e,t){return this.rtcEngine.setBeautyEffectOptions(e,t)}},{key:"setAudioFrameCallback",value:function(){return this.logger.warn("electron platform does not support this for now"),0}},{key:"stopAudioFrameCallback",value:function(){return this.logger.warn("electron platform does not support this for now"),0}},{key:"setAudioRawDataConfig",value:function(e){return this.logger.warn("electron platform does not support this for now"),0}},{key:"hasScreenSharePermission",value:function(){return!r.remote||"denied"!==r.remote.systemPreferences.getMediaAccessStatus("screen")}},{key:"destroy",value:function(){var e=this.rtcEngine.release();return r.rtcEngine=void 0,e}},{key:"_region",get:function(){switch(Fn.shared.region){case Dn.CN:return 4294967295;case Dn.AP:return 8;case Dn.EU:return 4;case Dn.NA:return 2}}},{key:"_addEventListeners",value:function(){var e=this;this.rtcEngine.on("localVideoStateChanged",(function(t,r){e.logger.info("[rtc] video state changed ".concat(t," ").concat(r)),e.cameraThread.videoStreamState=t})),this.rtcEngine.on("localAudioStateChanged",(function(t){0===t&&e.emit(Yu.localAudioTrackChanged,mu.stopped,tu.Mic),2!==t&&1!==t||e.emit(Yu.localAudioTrackChanged,mu.started,tu.Mic)})),this.rtcEngine.on("groupAudioVolumeIndication",(function(t){var r=t.find((function(e){return 0===e.uid})),n=t.find((function(e){return 1===e.uid}));r&&e.emit(Yu.localAudioVolume,r.volume/255),n&&e.emit(Yu.localAudioPlaybackVolumeIndicator,n.volume/255)}))}},{key:"updateRole",value:function(){this._localVideoEnabled||this._localAudioEnabled?(this.logger.info("update rtc role to host"),this.rtcEngine.setClientRole(1)):(this.logger.info("update rtc role to audience"),this.rtcEngine.setClientRole(2))}}],[{key:"remote",get:function(){var e=window.require("electron").remote;if(e)return e;yn.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:"getRtcVersion",value:function(){if(!this.version){var e=this.rtcEngine;e||(e=new Rl),this.version=e.getVersion(),this.rtcEngine||e.release()}var t=this.version,r=t.version,n=t.build;return"".concat(r,".").concat(n)}},{key:"logBasePath",get:function(){if(r.remote)return r.remote.app.getPath("logs")}},{key:"logFolderPath",get:function(){if(this.logBasePath)return window.require("path").resolve(this.logBasePath,"logs")}},{key:"logPath",get:function(){var e=this.logFolderPath;if(e)return window.require("path").resolve(e,"sdk.log")}}]),r}(hl),wl.rtcEngine=void 0,wl.version=void 0,El=wl))||El,Ol=Xn.attach({proxyMethods:!1})(Il=function(e){l(r,e);var t=Tl(r);function r(e,n,i){var o;return a(this,r),(o=t.call(this)).logger=void 0,o.channelName=void 0,o.base=void 0,o._networkStats=new Al,o.channelName=e,o.base=i,al.addPollingTask((function(){o.emit(_c.NetworkStats,o._networkStats.networkStats())}),nl.second(2)),o._addEventListeners(),o}return c(r,[{key:"_channelProfile",get:function(){var e;return null!==(e=Fn.shared.rtcConfigs.channelProfile)&&void 0!==e?e:Qu.LiveBroadcasting}},{key:"getSessionId",value:function(){return this.base.rtcEngine.getCallId()}},{key:"enableDualStream",value:function(e){return 0===this.base.rtcEngine.enableDualStreamMode(e)?Promise.resolve():Promise.reject()}},{key:"setLowStreamParameter",value:function(e){return 0}},{key:"setRemoteVideoStreamType",value:function(e,t){return 0===this.base.rtcEngine.setRemoteVideoStreamType(+e,t)?Promise.resolve():Promise.reject()}},{key:"onConnectionStateChanged",value:function(e){return this.on(_c.RtcConnectionStateChanged,e),0}},{key:"leave",value:function(e){return(null!=e?e:uu.main)===uu.main?this.base.rtcEngine.leaveChannel():this.base.rtcEngine.videoSourceLeave(),Promise.resolve()}},{key:"setChannelProfile",value:function(e){return this.base.rtcEngine.setChannelProfile(e===Qu.Communication?0:1)}},{key:"setClientRole",value:function(e){return this.base.rtcEngine.setClientRole(e===qu.Host?1:2)}},{key:"onNetworkStats",value:function(e){return this.on(_c.NetworkStats,e),0}},{key:"onAudioVolumeIndication",value:function(e){return this.on(_c.AudioVolumes,e),0}},{key:"muteRemoteVideo",value:function(e,t){return this.base.rtcEngine.muteRemoteVideoStream(+e,t)}},{key:"muteRemoteAudio",value:function(e,t){return this.base.rtcEngine.muteRemoteAudioStream(+e,t)}},{key:"_startScreenCapture",value:function(){var e=this.base.screenShareType,t=this.base.screenShareId;void 0!==t&&void 0!==e&&(e===bu.Screen?this.base.rtcEngine.videoSourceStartScreenCaptureByScreen(t,{width:0,height:0,x:0,y:0},{width:0,height:0,frameRate:10,captureMouseCursor:!0,windowFocus:!0,bitrate:0,excludeWindowCount:0,excludeWindowList:[]}):e===bu.Window&&this.base.rtcEngine.videoSourceStartScreenCaptureByWindow(t,{width:0,height:0,x:0,y:0},{width:0,height:0,frameRate:10,captureMouseCursor:!0,windowFocus:!0,bitrate:0,excludeWindowCount:0,excludeWindowList:[]}))}},{key:"join",value:function(e,t,r){var n=this;return new Promise((function(i,o){var a=n.base.rtcEngine;if(r===uu.main)a.once("joinedChannel",(function(){i()})),a.setChannelProfile(n._channelProfile),a.enableAudioVolumeIndication(500,3),a.joinChannel(e,n.channelName,"",+t);else if(r===uu.sub){a.once("videoSourceJoinedSuccess",(function(){n._startScreenCapture(),i()})),a.videoSourceSetChannelProfile(n._channelProfile);var s=a.videoSourceJoin(e,n.channelName,"",+t);n.logger.info("[rtc] videosource join ".concat(s))}}))}},{key:"muteLocalVideo",value:function(e,t){return this.base.rtcEngine.muteLocalVideoStream(e)}},{key:"muteLocalAudio",value:function(e,t){return this.base.rtcEngine.muteLocalAudioStream(e)}},{key:"muteLocalScreenShare",value:function(e,t){return 0}},{key:"_getRtcState",value:function(e){switch(e){case 1:case 5:return yu.Idle;case 2:return yu.Connecting;case 3:return yu.Connected;case 4:return yu.Reconnecting}}},{key:"_addEventListeners",value:function(){var e=this,t=this.base.rtcEngine;t.on("networkQuality",(function(t,r,n){0===t&&(e._networkStats.downlinkNetworkQuality=n,e._networkStats.uplinkNetworkQuality=r)})),t.on("rtcStats",(function(t){var r=t.txPacketLossRate,n=t.rxPacketLossRate,i=t.cpuAppUsage,o=t.cpuTotalUsage,a=t.lastmileDelay,s=t.gatewayRtt;e._networkStats.txVideoPacketLoss=r/100,e._networkStats.rxVideoPacketLoss=n/100,e._networkStats.rtt=s,e._networkStats.end2EndDelay=a,e._networkStats.cpu=i/100,e._networkStats.cpuTotal=o/100})),t.on("groupAudioVolumeIndication",(function(t){var r=new Map;t.forEach((function(e){return r.set(""+e.uid,e.volume)})),e.emit(_c.AudioVolumes,r)})),t.on("connectionStateChanged",(function(t){e.emit(_c.RtcConnectionStateChanged,e._getRtcState(t))})),t.on("videoSourceJoinedSuccess",(function(){e.emit(_c.RtcConnectionStateChanged,yu.Connected,uu.sub)})),t.on("videoSourceLeaveChannel",(function(){e.emit(_c.RtcConnectionStateChanged,yu.Idle,uu.sub)}))}}]),r}(ll))||Il,Nl=__webpack_require__(5904),xl=__webpack_require__.n(Nl);function Dl(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Ll,Pl,Bl,Ml,jl,Ul,Fl=function(){function e(t,r,n,i,o){a(this,e),this.streamUuid=void 0,this.channelName=void 0,this.view=void 0,this.mirror=!1,this.renderMode=Eu.fill,this.streamUuid=t,this.channelName=r,this.view=n,this.mirror=i,o&&void 0!==o.renderMode&&(this.renderMode=o.renderMode)}return c(e,null,[{key:"key",value:function(e,t){return"".concat(e,"-").concat(t)}}]),e}(),Ql=function(e){l(r,e);var t=Dl(r);function r(e,n){return a(this,r),t.call(this,"0","",e,n)}return c(r)}(Fl);function ql(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ql(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ql(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vl(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Kl=function(e){l(r,e);var t=Vl(r);function r(){var e;a(this,r);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).track=void 0,e}return c(r)}(_l),Hl=Xn.attach({proxyMethods:!1})(Ll=function(e){l(n,e);var t,r=Vl(n);function n(){var e;a(this,n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=r.call.apply(r,[this].concat(i))).canvas=void 0,e.trackState=mu.stopped,e.cameraEnable=!1,e._deviceId=void 0,e._deviceChanged=!1,e}return c(n,[{key:"setCameraTrackState",value:function(e,t){this.trackState!==e&&(this.trackState=e,this.emit(Yu.trackStateChanged,e,eu.Camera,t))}},{key:"setDevice",value:function(e){this._deviceId=e,this._deviceChanged=!0}},{key:"onExecution",value:(t=o(v().mark((function e(){var t,r,n,i=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.debug("thread notify start...");case 1:if(!this.cameraEnable){e.next=40;break}if(!this._deviceChanged){e.next=15;break}if(!this.track){e.next=14;break}if(e.prev=4,!this._deviceId){e.next=8;break}return e.next=8,this.track.setDevice(this._deviceId);case 8:e.next=14;break;case 10:return e.prev=10,e.t0=e.catch(4),Mn.shared.handleNonThrowableError(kn.RTC_ERR_CAM_ERR,e.t0),e.abrupt("break",46);case 14:this._deviceChanged=!1;case 15:if(this.track){e.next=35;break}return this.logger.debug("starting camera..."),this.setCameraTrackState(mu.starting),e.prev=18,t=Fn.shared.rtcConfigs,r=t.defaultCameraEncoderConfigurations,n=r?{width:r.width,height:r.height,frameRate:r.frameRate,bitrateMax:r.bitrate}:void 0,e.next=24,xl().createCameraVideoTrack({cameraId:this._deviceId,encoderConfig:n});case 24:this.track=e.sent,this.track.on("track-ended",(function(){var e;i.logger.warn("camera track ended"),null===(e=i.track)||void 0===e||e.close(),i.track=void 0,i.setCameraTrackState(mu.stopped)})),this.setCameraTrackState(mu.started),e.next=34;break;case 29:return e.prev=29,e.t1=e.catch(18),Mn.shared.handleNonThrowableError(kn.RTC_ERR_CAM_ERR,e.t1),this.setCameraTrackState(mu.error),e.abrupt("break",46);case 34:this.logger.debug("camera started.");case 35:if(this.track&&this.canvas&&this.canvas.view&&(this.track.play(this.canvas.view),this.setCameraTrackState(mu.started)),!this.track||!(this.canvas&&this.canvas.view&&this.track.isPlaying)&&this.canvas&&this.canvas.view){e.next=38;break}return e.abrupt("break",46);case 38:e.next=43;break;case 40:if(this.track&&(this.logger.debug("stopping camera..."),this.track.stop(),this.track.close(),this.track=void 0,this.setCameraTrackState(mu.stopped),this.logger.debug("camera stopped")),this.track){e.next=43;break}return e.abrupt("break",46);case 43:return e.next=45,new Promise((function(e){return setTimeout(e,500)}));case 45:if(this.running){e.next=1;break}case 46:this.logger.debug("thread sleep...");case 47:case"end":return e.stop()}}),e,this,[[4,10],[18,29]])}))),function(){return t.apply(this,arguments)})}]),n}(Kl))||Ll,zl=Xn.attach({proxyMethods:!1})(Pl=function(e){l(n,e);var t,r=Vl(n);function n(){var e;a(this,n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=r.call.apply(r,[this].concat(i))).micEnable=!1,e._recordingDeviceId=void 0,e._recordingDeviceChanged=!1,e.trackState=mu.stopped,e._volumePollingTask=void 0,e._audioRawConfig={frameSize:1024},e}return c(n,[{key:"setMicTrackState",value:function(e,t){var r,n=this;this.trackState!==e&&(this.trackState=e,this.emit(Yu.trackStateChanged,e,tu.Mic,t),e===mu.started?this._volumePollingTask||(this._volumePollingTask=al.addPollingTask((function(){if(n.track){var e=n.track.getVolumeLevel();e=Math.min(3*e,1),n.emit(Yu.localAudioVolume,e)}}),nl.second(.5))):(null===(r=this._volumePollingTask)||void 0===r||r.stop(),this._volumePollingTask=void 0))}},{key:"setRecordingDevice",value:function(e){this._recordingDeviceId=e,this._recordingDeviceChanged=!0}},{key:"setAudioRawDataConfig",value:function(e){this._audioRawConfig=Gl(Gl({},this._audioRawConfig),e)}},{key:"setAudioFrameCallback",value:function(){var e=this;this.track&&this.track.setAudioFrameCallback((function(t){e.logger.info("setAudioFrameCallback start..."),e.emit(Yu.localAudioFrame,t)}),this._audioRawConfig.frameSize)}},{key:"stopAudioFrameCallback",value:function(){this.logger.info("stopAudioFrameCallback"),this.track&&this.track.setAudioFrameCallback(null)}},{key:"onExecution",value:(t=o(v().mark((function e(){var t=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.info("thread notify start...");case 1:if(!this.micEnable){e.next=37;break}if(!this._recordingDeviceChanged){e.next=16;break}if(!this.track){e.next=15;break}if(e.prev=4,!this._recordingDeviceId){e.next=8;break}return e.next=8,this.track.setDevice(this._recordingDeviceId);case 8:e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(4),Mn.shared.handleNonThrowableError(kn.RTC_ERR_MIC_ERR,e.t0),this.setMicTrackState(mu.error),e.abrupt("break",43);case 15:this._recordingDeviceChanged=!1;case 16:if(this.track){e.next=33;break}return this.logger.debug("starting mic..."),this.setMicTrackState(mu.starting),e.prev=19,e.next=22,xl().createMicrophoneAudioTrack({microphoneId:this._recordingDeviceId});case 22:this.track=e.sent,this.track.on("track-ended",(function(){var e;t.logger.warn("mic track ended"),null===(e=t.track)||void 0===e||e.close(),t.track=void 0,t.setMicTrackState(mu.stopped)})),this.setMicTrackState(mu.started),e.next=32;break;case 27:return e.prev=27,e.t1=e.catch(19),Mn.shared.handleNonThrowableError(kn.RTC_ERR_MIC_ERR,e.t1),this.setMicTrackState(mu.error),e.abrupt("break",43);case 32:this.logger.debug("mic started.");case 33:if(!this.track){e.next=35;break}return e.abrupt("break",43);case 35:e.next=40;break;case 37:if(this.track&&(this.track.stop(),this.track.close(),this.track=void 0,this.setMicTrackState(mu.stopped)),this.track){e.next=40;break}return e.abrupt("break",43);case 40:return e.next=42,new Promise((function(e){return setTimeout(e,500)}));case 42:if(this.running){e.next=1;break}case 43:this.logger.debug("thread sleep...");case 44:case"end":return e.stop()}}),e,this,[[4,10],[19,27]])}))),function(){return t.apply(this,arguments)})}]),n}(Kl))||Pl,Wl=Xn.attach({proxyMethods:!1})(Bl=function(e){l(n,e);var t,r=Vl(n);function n(){var e;a(this,n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=r.call.apply(r,[this].concat(i))).canvas=void 0,e.audioTrack=void 0,e.withAudio=!1,e.screenEnable=!1,e.trackState=mu.stopped,e}return c(n,[{key:"playing",get:function(){return this.track&&this.track.isPlaying&&(!this.audioTrack||this.audioTrack&&this.audioTrack.isPlaying)}},{key:"setScreenShareTrackState",value:function(e,t){this.trackState!==e&&(this.trackState=e,this.emit(Yu.trackStateChanged,e,eu.ScreenShare,t))}},{key:"onExecution",value:(t=o(v().mark((function e(){var t,r,n,i,o=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.debug("thread notify start...");case 1:if(!this.screenEnable){e.next=37;break}if(this.track){e.next=32;break}if(this.logger.debug("starting screenshare..."),this.setScreenShareTrackState(mu.starting),e.prev=5,t=Fn.shared.rtcConfigs,r=t.defaultScreenEncoderConfigurations,n=r?{width:r.width,height:r.height,frameRate:r.frameRate,bitrateMax:r.bitrate}:void 0,!this.withAudio){e.next=17;break}return e.next=12,xl().createScreenVideoTrack({encoderConfig:n},"enable");case 12:i=e.sent,this.track=i[0],this.audioTrack=i[1],e.next=20;break;case 17:return e.next=19,xl().createScreenVideoTrack({encoderConfig:n},"disable");case 19:this.track=e.sent;case 20:this.track.on("track-ended",(function(){var e;o.logger.warn("camera track ended"),null===(e=o.track)||void 0===e||e.close(),o.track=void 0,o.setScreenShareTrackState(mu.stopped)})),this.setScreenShareTrackState(mu.started),e.next=31;break;case 24:if(e.prev=24,e.t0=e.catch(5),"PERMISSION_DENIED"!==e.t0.code||/system/.test(e.t0.message)){e.next=28;break}return e.abrupt("break",44);case 28:return this.setScreenShareTrackState(mu.error,"PERMISSION_DENIED"===e.t0.code?Au.PermissionDenied:Au.Unknown),Mn.shared.handleNonThrowableError(kn.RTC_ERR_SCREEN_SHARE_ERR,e.t0),e.abrupt("break",44);case 31:this.logger.debug("screenshare started.");case 32:if(this.track&&this.canvas&&this.canvas.view&&this.track.play(this.canvas.view),!(!this.canvas||this.canvas&&this.playing)){e.next=35;break}return e.abrupt("break",44);case 35:e.next=41;break;case 37:if(this.track&&(this.logger.debug("stopping screenshare..."),this.track.stop(),this.track.close(),this.track=void 0,this.logger.debug("screenshare stopped"),this.setScreenShareTrackState(mu.stopped)),this.audioTrack&&(this.logger.debug("stopping screenshare audio..."),this.audioTrack.stop(),this.audioTrack.close(),this.audioTrack=void 0,this.logger.debug("screenshare audio stopped")),this.track||this.audioTrack){e.next=41;break}return e.abrupt("break",44);case 41:return e.next=43,new Promise((function(e){return setTimeout(e,500)}));case 43:if(this.running){e.next=1;break}case 44:this.logger.debug("thread sleep...");case 45:case"end":return e.stop()}}),e,this,[[5,24]])}))),function(){return t.apply(this,arguments)})}]),n}(Kl))||Bl,Yl=Xn.attach({proxyMethods:!1})((jl=function(e){l(n,e);var t,r=Vl(n);function n(e){var t;return a(this,n),(t=r.call(this))._client=void 0,t.mute=!1,t._trackThread=void 0,t._client=e,t}return c(n,[{key:"track",get:function(){var e;return null===(e=this._trackThread)||void 0===e?void 0:e.track}},{key:"setTrackThread",value:function(e){var t;null===(t=this._trackThread)||void 0===t||t.off(Yu.trackStateChanged,this.handleTrackStateChanged),this._trackThread=e,e.on(Yu.trackStateChanged,this.handleTrackStateChanged)}},{key:"handleTrackStateChanged",value:function(e){e===mu.started&&this.run()}},{key:"isTrackPublished",value:function(e){return void 0!==this._client.localTracks.find((function(t){return t===e}))}},{key:"onExecution",value:(t=o(v().mark((function e(){var t,r,n=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.debug("thread notify start..."),t=0;case 2:if(this.mute){e.next=25;break}if(!this.track||this.isTrackPublished(this.track)){e.next=21;break}return this.logger.debug("publishing..."),e.prev=5,e.next=8,this._client.setClientRole("host");case 8:if(!(r=this._client.localTracks.find((function(e){var t,r;return e.trackMediaType===(null===(t=n._trackThread)||void 0===t||null===(r=t.track)||void 0===r?void 0:r.trackMediaType)})))){e.next=13;break}return this.logger.warn("unpublishing old ".concat(r.trackMediaType," track...")),e.next=13,this._client.unpublish(r);case 13:return e.next=15,this._client.publish(this.track);case 15:this.logger.debug("published."),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(5),Mn.shared.handleNonThrowableError(kn.RTC_ERR_TRACK_PUBLISH_FAIL,e.t0);case 21:if(!this.track||!this.isTrackPublished(this.track)){e.next=23;break}return e.abrupt("break",48);case 23:e.next=43;break;case 25:if(!this.track||!this.isTrackPublished(this.track)){e.next=41;break}return this.logger.debug("unpublishing..."),e.prev=27,e.next=30,this._client.unpublish(this.track);case 30:if(0!==this._client.localTracks.length){e.next=33;break}return e.next=33,this._client.setClientRole("audience");case 33:e.next=40;break;case 35:return e.prev=35,e.t1=e.catch(27),Mn.shared.handleNonThrowableError(kn.RTC_ERR_TRACK_UNPUBLISH_FAIL,e.t1),this.emit("trackUnpublishErr",e.t1),e.abrupt("break",48);case 40:this.logger.debug("unpublished.");case 41:if(!this.track||this.isTrackPublished(this.track)){e.next=43;break}return e.abrupt("break",48);case 43:return e.next=45,new Promise((function(e){return setTimeout(e,500)}));case 45:++t%10==0&&this.logger.debug("thread running...");case 47:if(this.running){e.next=2;break}case 48:this.logger.debug("thread sleep...");case 49:case"end":return e.stop()}}),e,this,[[5,18],[27,35]])}))),function(){return t.apply(this,arguments)})}]),n}(_l),$c(jl.prototype,"handleTrackStateChanged",[au],Object.getOwnPropertyDescriptor(jl.prototype,"handleTrackStateChanged"),jl.prototype),Ml=jl))||Ml,Jl=Xn.attach({proxyMethods:!1})(Ul=function(e){l(n,e);var t,r=Vl(n);function n(e,t,i){var o,s=i.channelName,c=i.muteMap,u=i.canvasMap,l=i.mediaType;return a(this,n),(o=r.call(this))._client=void 0,o._user=void 0,o._channelName=void 0,o._muteMap=void 0,o._canvasMap=void 0,o._mediaType=void 0,o._volumePollingTask=void 0,o._client=e,o._user=t,o._muteMap=c,o._mediaType=l,o._canvasMap=u,o._channelName=s,o}return c(n,[{key:"mute",get:function(){return!!this._muteMap.has(this.streamUuid)&&this._muteMap.get(this.streamUuid)}},{key:"streamUuid",get:function(){return"".concat(this._user.uid)}},{key:"canvas",get:function(){if("audio"!==this._mediaType&&this._canvasMap){var e=Fl.key(this.streamUuid,this._channelName);return this._canvasMap.get(e)}}},{key:"isTrackSubscribed",value:function(){return"video"===this._mediaType?!!this._user.videoTrack:!!this._user.audioTrack}},{key:"track",get:function(){return"video"===this._mediaType?this._user.videoTrack:this._user.audioTrack}},{key:"onExecution",value:(t=o(v().mark((function e(){var t,r=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.debug("thread notify start..."),t=0;case 2:if(this.mute){e.next=19;break}if(this.isTrackSubscribed()){e.next=14;break}return this.logger.debug("[".concat(this._user.uid,"] subscribing ").concat(this._mediaType,"...")),e.prev=5,e.next=8,this._client.subscribe(this._user,this._mediaType);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),Mn.shared.handleNonThrowableError(kn.RTC_ERR_TRACK_SUBSCRIBE_FAIL,e.t0);case 13:this.logger.debug("[".concat(this._user.uid,"] subscribed."));case 14:if("video"===this._mediaType?this.track&&this.canvas&&this.canvas.view&&this.track.play(this.canvas.view,{fit:this.canvas.renderMode===Eu.fill?"cover":"contain"}):this.track&&(this._volumePollingTask||(this._volumePollingTask=al.addPollingTask((function(){var e=r.track.getVolumeLevel();e=Math.min(3*e,1),r.emit("audio-volume-indication",e)}),nl.second(.5))),this.track.play()),!this.isTrackSubscribed()){e.next=17;break}return e.abrupt("break",40);case 17:e.next=35;break;case 19:if(!this.isTrackSubscribed()){e.next=32;break}return this.logger.debug("[".concat(this._user.uid,"] unpublishing...")),e.prev=21,e.next=24,this._client.unsubscribe(this._user,this._mediaType);case 24:e.next=31;break;case 26:return e.prev=26,e.t1=e.catch(21),Mn.shared.handleNonThrowableError(kn.RTC_ERR_TRACK_UNSUBSCRIBE_FAIL,e.t1),this.emit("trackPublishErr",e.t1),e.abrupt("break",40);case 31:this.logger.debug("[".concat(this._user.uid,"] unpublished."));case 32:if(this.track&&(this.logger.debug("[".concat(this._user.uid,"] stopping track...")),this.track.stop(),this._volumePollingTask&&this._volumePollingTask.stop(),this.logger.debug("[".concat(this._user.uid,"] track stopped"))),this.isTrackSubscribed()){e.next=35;break}return e.abrupt("break",40);case 35:return e.next=37,new Promise((function(e){return setTimeout(e,500)}));case 37:++t%10==0&&this.logger.info("thread running...");case 39:if(this.running){e.next=2;break}case 40:this.logger.info("thread sleep...");case 41:case"end":return e.stop()}}),e,this,[[5,10],[21,26]])}))),function(){return t.apply(this,arguments)})}]),n}(_l))||Ul;function Xl(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}function Zl(){return Zl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Xl(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Zl.apply(this,arguments)}__webpack_require__(2479);var $l,eh,th,rh=Xn.attach({proxyMethods:!1})($l=function(){function e(){a(this,e),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 vl,this._uplinkNetworkQualityClacInstance=new vl}return c(e,[{key:"networkStats",value:function(){var e={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 e}}]),e}())||$l;function nh(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var ih=Xn.attach({proxyMethods:!1})(eh=function(e){l(s,e);var t,r,i=nh(s);function s(e,t,r,n){var o;a(this,s),(o=i.call(this)).logger=void 0,o._client=void 0,o._base=void 0,o._videoPublishThread=void 0,o._audioPublishThread=void 0,o._screenPublishThread=void 0,o.configs=void 0,o._connectionState=yu.Idle,o.channelName=void 0,o.connectionType=void 0,o._networkStats=new rh,o._recentLocalPacketStats=[],o._recentRemotePacketStats=[],o.channelName=e,o.configs=t,o._base=r,o.connectionType=n,xl().setArea({areaCode:[o._rtcRegion()]}),Fn.shared.rtcSDKParameters&&Fn.shared.rtcSDKParameters.forEach((function(e){xl().setParameter(e)})),o._client=xl().createClient({codec:o.configs.codec,mode:o.configs.mode});var c=Fn.shared.rtcConfigs.encryption;return c&&o._client.setEncryptionConfig(o._getEncryptionMode(c.mode),c.key),o._videoPublishThread=new Yl(o._client),o._audioPublishThread=new Yl(o._client),o._screenPublishThread=new Yl(o._client),o._videoPublishThread.runnable=!1,o._audioPublishThread.runnable=!1,o._screenPublishThread.runnable=!1,o._client.on("connection-state-change",(function(e){o.setConnectionState(o._getRtcState(e))})),o._client.on("network-quality",(function(e){o._networkStats.uplinkNetworkQuality=e.uplinkNetworkQuality,o._networkStats.downlinkNetworkQuality=e.downlinkNetworkQuality;var t=o._client.getLocalVideoStats(),r=o._client.getRemoteVideoStats(),n=o._client.getRTCStats();o._networkStats.rtt=n.RTT;var i={lossPackets:t.sendPacketsLost,totalPackets:t.sendPackets};o._recentLocalPacketStats.unshift(i),o._recentLocalPacketStats=o._recentLocalPacketStats.slice(0,10);for(var a=0,s=0,c=0,u=Object.values(r),l=0,h=u;l<h.length;l++){var f=h[l];a+=f.receivePacketsLost,s+=f.receivePackets,c+=f.end2EndDelay}var d={lossPackets:a,totalPackets:s};o._recentRemotePacketStats.unshift(d),o._recentRemotePacketStats=o._recentRemotePacketStats.slice(0,10),u.length>0&&(o._networkStats.end2EndDelay=0===u.length?0:c/u.length);var p=o._getRecentPacketLoss(),g=p.rx,v=p.tx;o._networkStats.rxVideoPacketLoss=g,o._networkStats.txVideoPacketLoss=v,o.emit("network-stats-changed",o._networkStats.networkStats(),o.connectionType)})),o}return c(s,[{key:"base",get:function(){return this._base}},{key:"_getRecentPacketLoss",value:function(){var e=this._recentLocalPacketStats[0],t=this._recentLocalPacketStats[this._recentLocalPacketStats.length-1],r=e.lossPackets-t.lossPackets,n=e.totalPackets-t.totalPackets,i=this._recentRemotePacketStats[0],o=this._recentRemotePacketStats[this._recentRemotePacketStats.length-1],a=i.lossPackets-o.lossPackets,s=i.totalPackets-o.totalPackets;return{rx:Math.abs(n>0?r/n:0),tx:Math.abs(s>0?a/s:0)}}},{key:"ready",get:function(){return this._connectionState===yu.Connected}},{key:"setConnectionState",value:function(e){this._connectionState=e,e===yu.Connected&&(this._videoPublishThread.runnable=!0,this._audioPublishThread.runnable=!0,this._screenPublishThread.runnable=!0,this._videoPublishThread.run(),this._audioPublishThread.run(),this._screenPublishThread.run()),e===yu.Idle&&(this._videoPublishThread.runnable=!1,this._audioPublishThread.runnable=!1,this._screenPublishThread.runnable=!1),this.emit("rtc-connection-state-changed",e,this.connectionType)}},{key:"getClientSessionId",value:function(){return this._client._sessionId}},{key:"join",value:(r=o(v().mark((function e(t,r,n){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._client.join(t,this.channelName,r,+n);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"leave",value:(t=o(v().mark((function e(){var t,r,i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._videoPublishThread.stop(),this._audioPublishThread.stop(),this._screenPublishThread.stop(),e.next=5,Uu(this._client.leave());case 5:t=e.sent,r=n(t,1),(i=r[0])&&Mn.shared.handleNonThrowableError(kn.RTC_ERR_CLIENT_LEAVE_CHANNEL_FAIL,i);case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"muteLocalVideo",value:function(e){return this.logger.info("muteLocalVideo ".concat(e)),this.base.cameraThread?(this._videoPublishThread.mute=e,this._videoPublishThread.setTrackThread(this.base.cameraThread),this._videoPublishThread.run(),0):-1}},{key:"muteLocalAudio",value:function(e){return this.logger.info("muteLocalAudio ".concat(e)),this.base.micThread?(this._audioPublishThread.mute=e,this._audioPublishThread.setTrackThread(this.base.micThread),this._audioPublishThread.run(),0):-1}},{key:"muteLocalScreenShare",value:function(e){return this.logger.info("muteLocalScreenShare ".concat(e)),this.base.screenThread?(this._screenPublishThread.mute=e,this._screenPublishThread.setTrackThread(this.base.screenThread),this._screenPublishThread.run(),0):-1}},{key:"_rtcRegion",value:function(){switch(Fn.shared.region){case Dn.CN:return"GLOBAL";case Dn.AP:return"ASIA";case Dn.EU:return"EUROPE";case Dn.NA:return"NORTH_AMERICA"}}},{key:"_getRtcState",value:function(e){switch(e){case"CONNECTED":return yu.Connected;case"CONNECTING":return yu.Connecting;case"DISCONNECTING":case"DISCONNECTED":return yu.Idle;case"RECONNECTING":return yu.Reconnecting}}},{key:"_getEncryptionMode",value:function(e){switch(e){case _u.AES_128_ECB:return"aes-128-ecb";case _u.AES_128_GCM:return"aes-128-gcm";case _u.AES_128_XTS:return"aes-128-xts";case _u.AES_256_XTS:return"aes-256-xts";case _u.AES_256_GCM:return"aes-256-gcm";case _u.AES_256_XTS:return"aes-256-xts"}return"none"}}]),s}(y))||eh,oh=(th=function(e){l(n,e);var t,r=nh(n);function n(e,t,i,o){var s;a(this,n),(s=r.call(this,e,t,i,o))._remoteRtcUsers=new Map,s._muteRemoteVideo=new Map,s._muteRemoteAudio=new Map,s._audioVolumes=new Map,s._subscribeVideoThreads=new Map,s._subscribeAudioThreads=new Map;var c=(0,S.throttle)(s._notifyStreamVolumes,500);return s._client.on("user-published",(function(e,t){var r="".concat(e.uid);if(s._remoteRtcUsers.set(r,e),"video"===t){var n=new Jl(s._client,e,{channelName:s.channelName,muteMap:s._muteRemoteVideo,mediaType:"video",canvasMap:s.base.remoteCanvas});s._subscribeVideoThreads.set(r,n),n.runnable=s.ready}else{var i=new Jl(s._client,e,{channelName:s.channelName,muteMap:s._muteRemoteAudio,mediaType:"audio"});i.on("audio-volume-indication",(function(e){s._audioVolumes.set(r,e),c()})),s._subscribeAudioThreads.set(r,i),i.runnable=s.ready}s._notifySubscribeThreads(r,t)})),s._client.on("user-unpublished",(function(e){if(!e.hasAudio&&!e.hasVideo){var t="".concat(e.uid);s._remoteRtcUsers.delete(t);var r=s._subscribeVideoThreads.get(t),n=s._subscribeAudioThreads.get(t);r&&(r.stop(),s._subscribeVideoThreads.delete(t)),n&&(n.stop(),s._audioVolumes.delete(t),s._subscribeAudioThreads.delete(t))}})),s._client.on("user-left",(function(e){var t="".concat(e.uid);s._remoteRtcUsers.delete(t);var r=s._subscribeVideoThreads.get(t),n=s._subscribeAudioThreads.get(t);r&&(r.stop(),s._subscribeVideoThreads.delete(t)),n&&(n.stop(),s._audioVolumes.delete(t),s._subscribeAudioThreads.delete(t))})),s}return c(n,[{key:"videoSubscribeThread",value:function(e){return this._subscribeVideoThreads.get(e)}},{key:"_notifyStreamVolumes",value:function(){this.emit("audio-volume-indication",this._audioVolumes)}},{key:"_notifySubscribeThreads",value:function(e,t){var r="video"===t?this._subscribeVideoThreads.get(e):this._subscribeAudioThreads.get(e);r&&r.run()}},{key:"setConnectionState",value:function(e){e===yu.Connected&&(this._subscribeVideoThreads.forEach((function(e){e.runnable=!0,e.run()})),this._subscribeAudioThreads.forEach((function(e){e.runnable=!0,e.run()}))),e===yu.Idle&&(this._subscribeVideoThreads.forEach((function(e){e.runnable=!1})),this._subscribeAudioThreads.forEach((function(e){e.runnable=!1,e.run()}))),Zl(p(n.prototype),"setConnectionState",this).call(this,e)}},{key:"muteRemoteVideo",value:function(e,t){return this.logger.info("muteRemoteVideo ".concat(e," ").concat(t)),this._muteRemoteVideo.set(e,t),this._notifySubscribeThreads(e,"video"),0}},{key:"muteRemoteAudio",value:function(e,t){return this.logger.info("muteRemoteAudio ".concat(e," ").concat(t)),this._muteRemoteAudio.set(e,t),this._notifySubscribeThreads(e,"audio"),0}},{key:"enableDualStream",value:function(e){return e?this._client.enableDualStream():this._client.disableDualStream()}},{key:"setLowStreamParameter",value:function(e){return this._client.setLowStreamParameter(e),0}},{key:"setRemoteVideoStreamType",value:function(e,t){return this._client.setRemoteVideoStreamType(+e,t)}},{key:"leave",value:(t=o(v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zl(p(n.prototype),"leave",this).call(this);case 2:this._remoteRtcUsers.clear(),this._subscribeVideoThreads.forEach((function(e){e.stop()})),this._subscribeVideoThreads.clear(),this._subscribeAudioThreads.forEach((function(e){e.stop()})),this._subscribeAudioThreads.clear(),this._remoteRtcUsers.clear();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),n}(ih),$c(th.prototype,"_notifyStreamVolumes",[au],Object.getOwnPropertyDescriptor(th.prototype,"_notifyStreamVolumes"),th.prototype),th),ah=function(e){l(r,e);var t=nh(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r,[{key:"setLowStreamParameter",value:function(e){return this._client.setLowStreamParameter(e),0}},{key:"setRemoteVideoStreamType",value:function(e,t){return this._client.setRemoteVideoStreamType(+e,t)}},{key:"enableDualStream",value:function(e){return e?this._client.enableDualStream():this._client.disableDualStream()}}]),r}(ih);function sh(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var ch=function(e){l(i,e);var t,r=sh(i);function i(e,t){var n;return a(this,i),(n=r.call(this)).adapter=e,n._deviceInfo=new Map,n._deviceIds=new Set,n._initializeDeviceList(t),n}return c(i,[{key:"onLocalVideoTrackStateChanged",value:function(e){return this.adapter.onLocalVideoTrackStateChanged(e),0}},{key:"onLocalCameraListChanged",value:function(e){return this.on(Yu.cameraListChanged,e),0}},{key:"getVideoCameraDevices",value:function(){return this.cameraList}},{key:"cameraList",get:function(){var e=this,t=[];return this._deviceIds.forEach((function(r){var n=e._deviceInfo.get(r);n&&t.push({deviceid:n.deviceid,devicename:n.devicename})})),t}},{key:"_emitCameraListChanged",value:function(e,t,r){this.emit(Yu.cameraListChanged,e,t,r)}},{key:"_initializeDeviceList",value:(t=o(v().mark((function e(t){var r,i,o,a,s,c=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Uu(xl().getCameras(t));case 2:r=e.sent,i=n(r,2),o=i[0],a=i[1],o&&Mn.shared.handleThrowableError(kn.RTC_ERR_VDM_GET_DEVICES_FAIL,o),a&&(s=[],a.forEach((function(e){if("default"!==e.deviceId){var t={deviceid:e.deviceId,devicename:e.label};c._deviceInfo.set(e.deviceId,t),c._deviceIds.add(e.deviceId),s.push(t)}})),this._emitCameraListChanged(!0,s,this.cameraList)),xl().onCameraChanged=function(e){var t={deviceid:e.device.deviceId,devicename:e.device.label};"ACTIVE"===e.state?(c._deviceInfo.set(e.device.deviceId,t),c._deviceIds.add(e.device.deviceId),c._emitCameraListChanged(!0,[t],c.cameraList)):"INACTIVE"===e.state&&(c._deviceInfo.delete(e.device.deviceId),c._deviceIds.delete(e.device.deviceId),c._emitCameraListChanged(!1,[t],c.cameraList))};case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),i}(cl),uh=function(e){l(s,e);var t,r,i=sh(s);function s(e,t){var r;return a(this,s),(r=i.call(this)).adapter=e,r._recordingDeviceInfo=new Map,r._recordingDeviceIds=new Set,r._playbackDeviceInfo=new Map,r._playbackDeviceIds=new Set,r._initializeDeviceList(t),r._initializePlaybackDeviceList(t),r}return c(s,[{key:"onLocalAudioPlaybackTestVolumeChanged",value:function(e){return this.adapter.onLocalAudioPlaybackTestVolumeChanged(e)}},{key:"onAudioFrame",value:function(e){return this.adapter.onAudioFrame(e)}},{key:"onLocalAudioTrackStateChanged",value:function(e){return this.adapter.onLocalAudioTrackStateChanged(e)}},{key:"onLocalAudioVolume",value:function(e){return this.adapter.onLocalAudioVolume(e)}},{key:"onLocalRecordingDeviceListChanged",value:function(e){return this.on(Yu.recordingDeviceListChanged,e),0}},{key:"onLocalPlaybackDeviceListChanged",value:function(e){return this.on(Yu.playbackDeviceListChanged,e),0}},{key:"microphoneList",get:function(){var e=this,t=[];return this._recordingDeviceIds.forEach((function(r){var n=e._recordingDeviceInfo.get(r);n&&t.push({deviceid:n.deviceid,devicename:n.devicename})})),t}},{key:"speakerList",get:function(){var e=this,t=[];return this._playbackDeviceIds.forEach((function(r){var n=e._playbackDeviceInfo.get(r);n&&t.push({deviceid:n.deviceid,devicename:n.devicename})})),t}},{key:"_emitPlaybackListChanged",value:function(e,t,r){this.emit(Yu.playbackDeviceListChanged,e,t,r)}},{key:"_emitRecordingListChanged",value:function(e,t,r){this.emit(Yu.recordingDeviceListChanged,e,t,r)}},{key:"_initializePlaybackDeviceList",value:(r=o(v().mark((function e(t){var r,i,o,a,s,c=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Uu(xl().getPlaybackDevices(t));case 2:r=e.sent,i=n(r,2),o=i[0],a=i[1],o&&Mn.shared.handleThrowableError(kn.RTC_ERR_ADM_GET_PLAYBACK_DEVICES_FAIL,o),a&&(s=[],a.forEach((function(e){if("default"!==e.deviceId){var t={deviceid:e.deviceId,devicename:e.label};c._playbackDeviceInfo.set(e.deviceId,t),c._playbackDeviceIds.add(e.deviceId),s.push(t)}})),this._emitPlaybackListChanged(!0,s,this.speakerList)),xl().onPlaybackDeviceChanged=function(e){var t={deviceid:e.device.deviceId,devicename:e.device.label};"ACTIVE"===e.state?(c._playbackDeviceInfo.set(e.device.deviceId,t),c._playbackDeviceIds.add(e.device.deviceId),c._emitPlaybackListChanged(!0,[t],c.speakerList)):"INACTIVE"===e.state&&(c._playbackDeviceInfo.delete(e.device.deviceId),c._playbackDeviceIds.delete(e.device.deviceId),c._emitPlaybackListChanged(!1,[t],c.speakerList))};case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_initializeDeviceList",value:(t=o(v().mark((function e(t){var r,i,o,a,s,c=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Uu(xl().getMicrophones(t));case 2:r=e.sent,i=n(r,2),o=i[0],a=i[1],o&&Mn.shared.handleThrowableError(kn.RTC_ERR_ADM_GET_RECORD_DEVICES_FAIL,o),a&&(s=[],a.forEach((function(e){if("default"!==e.deviceId){var t={deviceid:e.deviceId,devicename:e.label};c._recordingDeviceInfo.set(e.deviceId,t),c._recordingDeviceIds.add(e.deviceId),s.push(t)}})),this._emitRecordingListChanged(!0,s,this.microphoneList)),xl().onMicrophoneChanged=function(e){var t={deviceid:e.device.deviceId,devicename:e.device.label};"ACTIVE"===e.state?(c._recordingDeviceInfo.set(e.device.deviceId,t),c._recordingDeviceIds.add(e.device.deviceId),c._emitRecordingListChanged(!0,[t],c.microphoneList)):"INACTIVE"===e.state&&(c._recordingDeviceInfo.delete(e.device.deviceId),c._recordingDeviceIds.delete(e.device.deviceId),c._emitRecordingListChanged(!1,[t],c.microphoneList))};case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"getAudioPlaybackDevices",value:function(){return this.speakerList}},{key:"getAudioRecordingDevices",value:function(){return this.microphoneList}}]),s}(ul);__webpack_require__(9575),__webpack_require__(4197),__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);function lh(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return hh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hh(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function hh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fh(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var dh,ph,gh,vh=function(e){l(r,e);var t=fh(r);function r(){var e;a(this,r),(e=t.call(this)).logger=void 0,e._audioContext=void 0,e._audioTagId=Tn(),e._playingSourceNode=void 0,e._analyserNode=void 0,e._volumePollingTask=void 0;try{window.AudioContext=window.AudioContext||window.webkitAudioContext,e._audioContext=new AudioContext,e._analyserNode=e._audioContext.createAnalyser(),e._analyserNode.smoothingTimeConstant=.3,e._analyserNode.fftSize=1024}catch(e){yn.error("[audio player] initialize audio context failed ".concat(e,"."))}return e}return c(r,[{key:"_getAudioVirtualDom",value:function(){if(document){var e=document.getElementById(this._audioTagId);if(!e){var t=document.createElement("audio");t.id=this._audioTagId,t.hidden=!0,document.body.appendChild(t),e=t}return e}yn.error("[audio player] audio element creation failed.")}},{key:"play",value:function(e){var t=this;this.stop();var r=this._audioContext,n=this._getAudioVirtualDom();if(n&&r){var i=r.createMediaElementSource(n);if(i.connect(r.destination),n.src=e,this._analyserNode){var o=this._analyserNode;i.connect(o);var a=new Float32Array(o.fftSize);this._volumePollingTask=al.addPollingTask((function(){o.getFloatTimeDomainData(a);var e,r=0,n=lh(a);try{for(n.s();!(e=n.n()).done;){var i=e.value;r+=i*i}}catch(e){n.e(e)}finally{n.f()}var s=Math.sqrt(r/a.length);t.emit(Yu.localAudioPlaybackVolumeIndicator,Math.min(s,1))}),nl.second(.2))}n.addEventListener("ended",(function(){t.stop()})),this._playingSourceNode=i,n.play()}else yn.error("[audio player] start audio playback test failed.")}},{key:"stop",value:function(){var e=this._audioContext,t=this._getAudioVirtualDom();if(t&&e){var r;if(t.pause(),t.currentTime=0,this._analyserNode)try{var n;null===(n=this._playingSourceNode)||void 0===n||n.disconnect(this._analyserNode)}catch(e){yn.warn("[audio player] failed to detach analyser node")}if(this._audioContext)try{var i;null===(i=this._playingSourceNode)||void 0===i||i.disconnect(e.destination)}catch(e){yn.warn("[audio player] failed to detach audio context")}null===(r=this._volumePollingTask)||void 0===r||r.stop(),this._volumePollingTask=void 0,t.remove(),this.emit(Yu.localAudioPlaybackVolumeIndicator,0)}}}]),r}(y);function Ah(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ah(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ah(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function yh(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var _h,bh=Xn.attach({proxyMethods:!1})((ph=function(e){l(r,e);var t=yh(r);function r(e){var n;return a(this,r),(n=t.call(this)).logger=void 0,n._channels=new Map,n._vdm=new ch(f(n),Fn.shared.rtcConfigs.noDevicePermission),n._adm=new uh(f(n),Fn.shared.rtcConfigs.noDevicePermission),n.cameraThread=new Hl,n.micThread=new zl,n.screenThread=new Wl,n.remoteCanvas=new Map,n._audioPlayer=new vh,n._configs=void 0,n._configs=e,n}return c(r,[{key:"configs",get:function(){return mh(mh({},r.defaultConfigs),this._configs)}},{key:"createRtcChannel",value:function(e,t){var r=this._channels.get(e);return r||(r=new Eh(e,this.configs,t),this._channels.set(e,r)),r}},{key:"getVideoDeviceManager",value:function(){return this._vdm}},{key:"setVideoCameraDevice",value:function(e){return this.cameraThread.setDevice(e),this.cameraThread.run(),0}},{key:"setAudioRecordingDevice",value:function(e){return this.micThread.setRecordingDevice(e),this.micThread.run(),0}},{key:"setAudioPlaybackDevice",value:function(e){throw new Error("Method not implemented.")}},{key:"getAudioDeviceManager",value:function(){return this._adm}},{key:"getWindowDevices",value:function(){throw new Error("Method not supported.")}},{key:"getDiaplayDevices",value:function(){throw new Error("Method not supported.")}},{key:"isScreenDeviceEnumerateSupported",value:function(){return!1}},{key:"enableLocalVideo",value:function(e){return this.cameraThread.cameraEnable=e,this.cameraThread.run(),0}},{key:"enableLocalAudio",value:function(e){return this.micThread.micEnable=e,this.micThread.run(),0}},{key:"setupLocalVideo",value:function(e,t){return t===eu.Camera?(this.cameraThread.canvas=e,this.cameraThread.run()):(this.screenThread.canvas=e,this.screenThread.run()),0}},{key:"setupRemoteVideo",value:function(e){if(!e.channelName)return Mn.shared.handleThrowableError(kn.RTC_ERR_NO_CHANNEL_EXISTS,new Error("invalid canvas w/o canvas name")),-1;this.remoteCanvas.set("".concat(e.streamUuid,"-").concat(e.channelName),e);var t=this._channels.get(e.channelName),r=null==t?void 0:t.main.videoSubscribeThread(e.streamUuid);return r&&r.run(),0}},{key:"startAudioRecordingDeviceTest",value:function(e){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(){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(e){return this._audioPlayer.play(e),0}},{key:"stopAudioPlaybackDeviceTest",value:function(){return this._audioPlayer.stop(),0}},{key:"startScreenCapture",value:function(e,t){return this.screenThread.screenEnable=!0,this.screenThread.run(),0}},{key:"stopScreenCapture",value:function(){return this.screenThread.screenEnable=!1,this.screenThread.run(),0}},{key:"onLocalAudioPlaybackTestVolumeChanged",value:function(e){return this._audioPlayer.on(Yu.localAudioPlaybackVolumeIndicator,e),0}},{key:"onLocalVideoTrackStateChanged",value:function(e){return this.cameraThread.on(Yu.trackStateChanged,e),0}},{key:"onLocalAudioTrackStateChanged",value:function(e){return this.micThread.on(Yu.trackStateChanged,e),0}},{key:"onLocalScreenShareTrackStateChanged",value:function(e){return this.screenThread.on(Yu.trackStateChanged,e),0}},{key:"onLocalAudioVolume",value:function(e){return this.micThread.on(Yu.localAudioVolume,e),0}},{key:"onAudioFrame",value:function(e){return this.micThread.on(Yu.localAudioFrame,e),0}},{key:"setBeautyEffectOptions",value:function(e,t){return this.logger.warn("web platform does not support this"),0}},{key:"setAudioFrameCallback",value:function(){return this.micThread.setAudioFrameCallback(),0}},{key:"stopAudioFrameCallback",value:function(){return this.micThread.stopAudioFrameCallback(),0}},{key:"setAudioRawDataConfig",value:function(e){return this.micThread.setAudioRawDataConfig(e),0}},{key:"hasScreenSharePermission",value:function(){return!0}},{key:"destroy",value:function(){return this._channels.forEach((function(e){return e.leave()})),this._channels.clear(),this.enableLocalVideo(!1),this.enableLocalAudio(!1),this.stopScreenCapture(),0}}],[{key:"getRtcVersion",value:function(){return xl().VERSION}}]),r}(hl),ph.defaultConfigs={codec:"vp8",mode:"live"},dh=ph))||dh,Eh=Xn.attach({proxyMethods:!1})(gh=function(e){l(s,e);var t,r,i=yh(s);function s(e,t,r){var n;return a(this,s),(n=i.call(this)).logger=void 0,n.main=void 0,n.sub=void 0,n.channelName=void 0,n.channelName=e,n.main=new oh(e,t,r,uu.main),n.sub=new ah(e,t,r,uu.sub),n}return c(s,[{key:"getSessionId",value:function(){return this.main.getClientSessionId()}},{key:"client",value:function(e){return e===uu.main?this.main:this.sub}},{key:"join",value:(r=o(v().mark((function e(t,r,n){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client(n).join(Fn.shared.appId,t,r);case 2:n===uu.sub&&(this.main.muteRemoteVideo(r,!0),this.main.muteRemoteAudio(r,!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"leave",value:(t=o(v().mark((function e(t){var r,i,o,a,s;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.sub.ready){e.next=7;break}return e.next=3,Uu(this.sub.leave());case 3:i=e.sent,o=n(i,1),(r=o[0])&&Mn.shared.handleNonThrowableError(kn.RTC_ERR_LEAVE_SUB_CHANNEL_FAIL,r);case 7:if(t===uu.sub){e.next=14;break}return e.next=10,Uu(this.main.leave());case 10:a=e.sent,s=n(a,1),(r=s[0])&&Mn.shared.handleNonThrowableError(kn.RTC_ERR_LEAVE_MAIN_CHANNEL_FAIL,r);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"enableDualStream",value:function(e,t){return this.client(t).enableDualStream(e)}},{key:"setLowStreamParameter",value:function(e,t){return this.client(t).setLowStreamParameter(e),0}},{key:"setRemoteVideoStreamType",value:function(e,t,r){return this.client(r).setRemoteVideoStreamType(e,t)}},{key:"setClientRole",value:function(e){return 0}},{key:"muteLocalVideo",value:function(e,t){return this.logger.info("muteLocalVideo ".concat(e)),this.client(t).muteLocalVideo(e)}},{key:"muteLocalAudio",value:function(e,t){return this.logger.info("muteLocalAudio ".concat(e)),this.client(t).muteLocalAudio(e)}},{key:"muteLocalScreenShare",value:function(e,t){return this.logger.info("muteLocalScreenShare ".concat(e)),this.client(t).muteLocalScreenShare(e)}},{key:"muteRemoteVideo",value:function(e,t){return this.logger.info("muteRemoteVideo ".concat(e," ").concat(t)),this.main.muteRemoteVideo(e,t)}},{key:"muteRemoteAudio",value:function(e,t){return this.logger.info("muteRemoteAudio ".concat(e," ").concat(t)),this.main.muteRemoteAudio(e,t)}},{key:"onNetworkStats",value:function(e){return this.main.on("network-stats-changed",e),0}},{key:"onAudioVolumeIndication",value:function(e){return this.main.on("audio-volume-indication",e),0}},{key:"onConnectionStateChanged",value:function(e){return this.main.on("rtc-connection-state-changed",e),this.sub.on("rtc-connection-state-changed",e),0}}]),s}(ll))||gh,wh=function(){function e(){a(this,e)}return c(e,null,[{key:"getAdapter",value:function(e,t){switch(e){case Nn.Electron:return new kl;case Nn.Web:return new bh(null==t?void 0:t.web)}}}]),e}(),Ih=Xn.attach({level:On.DEBUG})(_h=function(){function e(t){a(this,e),this._adapter=void 0,this._channels=new Map,this._adapter=wh.getAdapter(Fn.platform,t)}return c(e,[{key:"getRtcChannel",value:function(e){var t=this._channels.get(e);if(!t){var r=this._adapter.createRtcChannel(e,this._adapter);t=new Su(e,r),this._channels.set(e,t)}return t}},{key:"getVideoDeviceManager",value:function(){return this._adapter.getVideoDeviceManager()}},{key:"getAudioDeviceManager",value:function(){return this._adapter.getAudioDeviceManager()}},{key:"getWindowDevices",value:function(){return this._adapter.getWindowDevices()}},{key:"getDisplayDevices",value:function(){return this._adapter.getDiaplayDevices()}},{key:"isScreenDeviceEnumerateSupported",value:function(){return this._adapter.isScreenDeviceEnumerateSupported()}},{key:"setVideoCameraDevice",value:function(e){return this._adapter.setVideoCameraDevice(e)}},{key:"setAudioRecordingDevice",value:function(e){return this._adapter.setAudioRecordingDevice(e)}},{key:"setAudioPlaybackDevice",value:function(e){return this._adapter.setAudioPlaybackDevice(e)}},{key:"enableLocalVideo",value:function(e){return this._adapter.enableLocalVideo(e)}},{key:"setupLocalVideo",value:function(e,t){return e.view.style.setProperty("transform",e.mirror?"rotateY(180deg)":""),this._adapter.setupLocalVideo(e,t)}},{key:"setupRemoteVideo",value:function(e){return e.view.style.setProperty("transform",e.mirror?"rotateY(180deg)":""),this._adapter.setupRemoteVideo(e)}},{key:"enableLocalAudio",value:function(e){return this._adapter.enableLocalAudio(e)}},{key:"startScreenCapture",value:function(e,t){return this._adapter.startScreenCapture(e,t)}},{key:"stopScreenCapture",value:function(){return this._adapter.stopScreenCapture()}},{key:"onLocalScreenShareTrackStateChanged",value:function(e){return this._adapter.onLocalScreenShareTrackStateChanged(e)}},{key:"startAudioRecordingDeviceTest",value:function(e){return this._adapter.startAudioRecordingDeviceTest(e)}},{key:"stopAudioRecordingDeviceTest",value:function(){return this._adapter.stopAudioRecordingDeviceTest()}},{key:"startAudioPlaybackDeviceTest",value:function(e){return this._adapter.startAudioPlaybackDeviceTest(e)}},{key:"stopAudioPlaybackDeviceTest",value:function(){return this._adapter.stopAudioPlaybackDeviceTest()}},{key:"setAudioFrameCallback",value:function(){return this._adapter.setAudioFrameCallback()}},{key:"stopAudioFrameCallback",value:function(){return this._adapter.stopAudioFrameCallback()}},{key:"onLocalCameraListChanged",value:function(e){return this._adapter.getVideoDeviceManager().onLocalCameraListChanged(e)}},{key:"onLocalRecordingDeviceListChanged",value:function(e){return this._adapter.getAudioDeviceManager().onLocalRecordingDeviceListChanged(e)}},{key:"onLocalPlaybackListChanged",value:function(e){return this._adapter.getAudioDeviceManager().onLocalPlaybackDeviceListChanged(e)}},{key:"onLocalVideoTrackStateChanged",value:function(e){return this._adapter.getVideoDeviceManager().onLocalVideoTrackStateChanged(e)}},{key:"onLocalAudioTrackStateChanged",value:function(e){return this._adapter.getAudioDeviceManager().onLocalAudioTrackStateChanged(e)}},{key:"onLocalAudioVolume",value:function(e){return this._adapter.getAudioDeviceManager().onLocalAudioVolume(e)}},{key:"setBeautyEffectOptions",value:function(e,t){return this._adapter.setBeautyEffectOptions(e,t)}},{key:"setAudioRawDataConfig",value:function(e){return this._adapter.setAudioRawDataConfig(e)}},{key:"hasScreenSharePermission",value:function(){return this._adapter.hasScreenSharePermission()}},{key:"destroy",value:function(){return this._adapter.destroy()}}]),e}())||_h,Ch=__webpack_require__(3977),Sh=__webpack_require__.n(Ch),Th=__webpack_require__(9644),Rh=__webpack_require__.n(Th),kh=(new(__webpack_require__(6353).UAParser)).getResult(),Oh=function(){function e(t,r){a(this,e),this._appId=t,this._tagInfo=r,this._adapter=void 0,this._adapter=new Nh(this._appId,this._tagInfo)}var t;return c(e,[{key:"upload",value:(t=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._adapter.upload(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}(),Nh=function(){function e(t,r){a(this,e),this._appId=t,this._tagInfo=r,this._apiService=new Vc,this._checkpoints=new Map}var t,r,n,i;return c(e,[{key:"_uploadByAli",value:(i=o(v().mark((function e(t,r,n,i){var o,a,s,c,u,l,h,f,d,p,g,A,m,y,_=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.ossKey,a=n.accessKeyId,s=n.accessKeySecret,c=n.bucketName,u=n.ossEndpoint,l=n.securityToken,h=i.callbackHost,f=i.callbackBody,d=i.callbackContentType,p=new(Sh())({accessKeyId:a,accessKeySecret:s,bucket:c,endpoint:u,secure:!0,stsToken:l}),g=this._checkpoints.get(r),A="".concat(h,"/monitor/apps/").concat(this._appId,"/v1/log/oss/callback"),e.next=7,p.multipartUpload(o,t,{progress:function(e,t){_._checkpoints.set(r,t)},callback:{url:A,body:f,contentType:d},checkpoint:g});case 7:if(m=e.sent,200===(y=m.res).status){e.next=11;break}throw new Error("upload to ali oss error, status is ".concat(y.status));case 11:this._checkpoints.delete(r),p.generateObjectUrl(o);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return i.apply(this,arguments)})},{key:"_uploadByAws",value:(n=o(v().mark((function e(t,r,n,i){var o,a,s,c,u,l;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.preSignedUrl,a=i.callbackHost,s=i.callbackBody,c=i.callbackContentType,u="".concat(a,"/monitor/apps/").concat(this._appId,"/v1/log/oss/callback"),e.next=5,Rh().put(o,t,{headers:{"Content-Type":t.type}});case 5:return e.next=7,Rh().post(u,JSON.parse(s),{headers:_({},"content-type",c)});case 7:if(200===(l=e.sent).status){e.next=10;break}throw new Error("upload to aws oss error, status is ".concat(l.status));case 10:this._checkpoints.delete(r);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,r,i){return n.apply(this,arguments)})},{key:"_fetchStsToken",value:(r=o(v().mark((function e(t,r){var n,i,o,a,s,c,u;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),i={appId:Fn.shared.appId,appVersion:Fn.version,deviceName:kh.os.name,deviceVersion:kh.os.version,fileExt:r,platform:"web",tag:t},o=JSON.stringify(i),a="7AIsPeMJgQAppO0Z"+o+n,s=Hc()(a),e.next=8,this._apiService.fetch({host:"https://api.sd-rtn.com",path:"/monitor/v1/log/oss/policy",data:i,method:"POST",headers:{sign:s,timestamp:n}});case 8:return c=e.sent,u=c.data,e.abrupt("return",{bucketName:u.bucketName,callbackBody:u.callbackBody,callbackContentType:u.callbackContentType,accessKeyId:u.accessKeyId,accessKeySecret:u.accessKeySecret,securityToken:u.securityToken,ossKey:u.ossKey,callbackHost:u.callbackHost,preSignedUrl:u.preSignedUrl,vendor:u.vendor,ossEndpoint:u.ossEndpoint});case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"upload",value:(t=o(v().mark((function e(t,r){var n,i,o,a,s,c,u,l,h,f,d,p,g,A,m,y,_;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchStsToken(this._tagInfo,r);case 2:if(n=e.sent,i=n.vendor,1!==(o=void 0===i?-1:i)){e.next=10;break}return a=n.ossKey,s=n.callbackBody,c=n.callbackContentType,u=n.callbackHost,l=n.preSignedUrl,e.next=8,this._uploadByAws(t,a,{preSignedUrl:l},{callbackBody:s,callbackContentType:c,callbackHost:u});case 8:case 14:e.next=17;break;case 10:if(2!==o){e.next=16;break}return h=n.accessKeyId,f=n.accessKeySecret,d=n.bucketName,p=n.ossEndpoint,g=n.securityToken,A=n.ossKey,m=n.callbackBody,y=n.callbackContentType,_=n.callbackHost,e.next=14,this._uploadByAli(t,A,{accessKeyId:h,accessKeySecret:f,bucketName:d,ossEndpoint:p,securityToken:g,ossKey:A},{callbackBody:m,callbackContentType:y,callbackHost:_});case 16:throw new Error("vendor ".concat(o," is not supported"));case 17:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function xh(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Dh,Lh,Ph,Bh,Mh,jh=function(e){l(u,e);var t,r,n,i,s=xh(u);function u(){return a(this,u),s.apply(this,arguments)}return c(u,[{key:"uploadZipLogFile",value:(i=o(v().mark((function e(t,r){var n;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.uploadToOss(t,r,"zip");case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"uploadLogFile",value:(n=o(v().mark((function e(t,r){var n;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.uploadToOss(t,r,"log");case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"uploadToOss",value:(r=o(v().mark((function e(t,r,n){var i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i=new Oh(Fn.shared.appId,t),e.next=4,i.upload(r,n);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),Mn.shared.handleThrowableError(kn.RTE_ERR_LOG_UPLOAD_FAIL,e.t0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])}))),function(e,t,n){return r.apply(this,arguments)})},{key:"uploadElectronLog",value:(t=o(v().mark((function e(t){var r,n;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!window.doGzip){e.next=8;break}return e.next=3,window.doGzip();case 3:return r=e.sent,e.next=6,this.uploadZipLogFile(t,r);case 6:return n=e.sent,e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),u}(Vc);__webpack_require__(1058);function Uh(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}!function(e){e[e.Host=1]="Host",e[e.Controlled=2]="Controlled"}(Dh||(Dh={})),function(e){e.RequestControl="request-control",e.QuitControl="quit-control",e.RequestAuthorized="request-authorized",e.RequestUnauthorized="request-unauthorized"}(Lh||(Lh={}));try{var Fh=__webpack_require__(1709).AgoraRemoteDesktopControl;Mh=Fh}catch(e){Fn.platform===Nn.Electron&&yn.warn("load electron rc sdk failed: ".concat(e))}var Qh=Xn.attach({proxyMethods:!1})((Bh=function(e){l(p,e);var t,r,n,i,s,u,h,f,d=Uh(p);function p(e,t){var r;return a(this,p),(r=d.call(this))._rtcChannel=e,r._role=t,r.logger=void 0,r._rdcEngine=void 0,r._displays=[],r._streamId=void 0,r.handleRDCStateChange=function(e,t){var n;(n=r.logger).info.apply(n,["RDC state changed to",e].concat(Zn(t?["with message",t]:[])))},r.handleRDCRequestControl=function(e){r.logger.info("RequestControl fired with args",e),r.emit(Lh.RequestControl,e)},r.handleRDCQuitControl=function(e){r.logger.info("QuitControl fired with args",e),r.emit(Lh.QuitControl,e)},r.handleRDCRequestControlAuthorized=function(e){r.logger.info("RequestAuthorized fired with args",e),r.emit(Lh.RequestAuthorized,e)},r.handleRDCRequestControlUnauthorized=function(e){r.logger.info("RequestUnauthorized fired with args",e),r.emit(Lh.RequestUnauthorized,e)},r._checkPlatform(),r._initialize(),r._addListeners(),r}return c(p,[{key:"_checkPlatform",value:function(){if(!(Fn.platform===Nn.Electron))throw new Error("Remote Control currently not supported in web browser")}},{key:"rdcEngine",get:function(){if(!this._rdcEngine)throw new Error("RCEngine not ready");return this._rdcEngine}},{key:"_initialize",value:function(){this._rdcEngine=new Mh(kl.rtcEngine,{appId:Fn.shared.appId,role:this._role})}},{key:"_addListeners",value:function(){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(){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:(f=o(v().mark((function e(t){var r,n,i,o;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.userId,n=t.userToken,i=t.streamId,o=t.streamToken,this.logger.info("join rc channel [".concat(this._rtcChannel.channelName,"] with params"),t),this._streamId=i,e.next=5,this.rdcEngine.join(r,n,this._rtcChannel.channelName,parseInt(i),o);case 5:this.logger.info("rc channel joined");case 6:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"_waitForUserJoin",value:(h=o(v().mark((function e(t){var r,n,i=this,a=arguments;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.length>1&&void 0!==a[1]?a[1]:1e4,(n=function(){return p._channelUsers.has(t)})()){e.next=7;break}return e.next=5,Bu(new Promise(function(){var e=o(v().mark((function e(o){var a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=Date.now()+r;case 1:if(!(Date.now()<a)){e.next=11;break}if(i.logger.info("wait for user joining rc channel"),!n()){e.next=7;break}return i.logger.info("user [".concat(t,"] joined the rc channel!")),o(),e.abrupt("break",11);case 7:return e.next=9,Pu(100);case 9:e.next=1;break;case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),r,!1);case 5:e.next=8;break;case 7:this.logger.info("user [".concat(t,"] has already joined the rc channel!"));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"requestControl",value:(u=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("request user ".concat(t," for remote controlling")),e.next=3,this._waitForUserJoin(r.streamId,r.timeout);case 3:this.rdcEngine.requestControl(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"takeControl",value:(s=o(v().mark((function e(t,r,n,i){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.info("take control of the remote device of user ".concat(t)),this.rdcEngine.takeControl(t,parseInt(r),n);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return s.apply(this,arguments)})},{key:"unauthorizeControl",value:(i=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.info("unauthorize user ".concat(t," for remote controlling")),this.rdcEngine.unauthorizeControl(t);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"authorizeControl",value:(n=o(v().mark((function e(t,r,n){var i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.info("authorize user ".concat(t," for remote controlling")),i=this._displays.find((function(e){return e.id===r.id}))){e.next=4;break}throw new Error("Invalid display obj, display with id ".concat(JSON.stringify(r.id)," not exist"));case 4:this.logger.info("display with id ".concat(r.id," is going to be controled")),this.rdcEngine.authorizeControl(t,i);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"quitControl",value:function(e,t,r){this.logger.info("role ".concat(t," is quit control from ").concat(e," and streamId ").concat(r)),r?this.rdcEngine.quitControl(e,t,r):this.rdcEngine.quitControl(e,t)}},{key:"leave",value:(r=o(v().mark((function e(){var t,r,n=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.info("leave rc channel [".concat(this._rtcChannel.channelName,"],streamId is [").concat(this._streamId,"]")),kl.rtcEngine.stopScreenCapture2(),kl.rtcEngine.videoSourceLeave(),t=1e4,r=this._streamId){e.next=8;break}return this.logger.info("user not joined yet, no op"),e.abrupt("return");case 8:return e.next=10,Bu(new Promise(function(){var e=o(v().mark((function e(i){var o;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=Date.now()+t;case 1:if(!(Date.now()<o)){e.next=10;break}if(p._channelUsers.has(r)){e.next=6;break}return n.logger.info("user not in rc channel, stop loop"),i(),e.abrupt("break",10);case 6:return e.next=8,Pu(100);case 8:e.next=1;break;case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t);case 10:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"dispose",value:function(){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:(t=o(v().mark((function e(){var t;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.rdcEngine.getDisplays();case 2:return this._displays=e.sent,t=this._displays.map((function(e){return{id:e.id,size:{width:e.width,height:e.height},thumbnail:e.thumbnail}})),this.logger.info("get rc displays",t),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"initialize",value:function(){kl.rtcEngine.on("userJoined",p.handleRTCUserJoined),kl.rtcEngine.on("removeStream",p.handleRTCUserLeft)}},{key:"cleanup",value:function(){p._channelUsers.clear(),kl.rtcEngine.off("userJoined",p.handleRTCUserJoined),kl.rtcEngine.off("removeStream",p.handleRTCUserLeft)}}]),p}(y),Bh._channelUsers=new Set,Bh.handleRTCUserJoined=function(e){yn.info("RC user joined channel",e),Bh._channelUsers.add("".concat(e))},Bh.handleRTCUserLeft=function(e){yn.info("RC user left channel",e),Bh._channelUsers.delete("".concat(e))},Ph=Bh))||Ph;function qh(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Gh=function(e){l(s,e);var t,r,i=qh(s);function s(e){var t;return a(this,s),(t=i.call(this))._mediaControl=void 0,t._logService=void 0,t._rtmManager=void 0,t._rtcManager=void 0,t._apiServicePathPrefix="",Fn.setConfig(e),yn.setupConsoleHijack(),t._logService=new jh,t._rtmManager=new Zc,t._rtcManager=new Ih(e.rtcConfigs),t._mediaControl=new $u(t._rtcManager),Fn.platform===Nn.Electron&&Qh.initialize(),t}return c(s,[{key:"apiServicePathPrefix",get:function(){return this._apiServicePathPrefix}},{key:"login",value:(r=o(v().mark((function e(t,r){var n;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Yc.shared.host="https://api.sd-rtn.com",Yc.shared.pathPrefix="/cn/v1.0/projects/".concat(Fn.shared.appId,"/app-dev-report"),n=Fn.shared.ignoreUrlRegionPrefix,this._apiServicePathPrefix="".concat(n?"":"/"+Fn.shared.region.toLowerCase(),"/scene/apps/").concat(Fn.shared.appId),Fn.shared.token=t,Fn.shared.userId=r,Fn.shared.service.headers={"Content-Type":"application/json","x-agora-token":t,"x-agora-uid":r},e.next=9,this._rtmManager.login(t,r,{uploadLog:!1});case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"logout",value:function(){this._rtcManager.destroy(),this._rtmManager.destroyRtm()}},{key:"createAgoraRteScene",value:function(e){var t=n(this._rtmManager.createObserverChannel(e),2),r=t[0],i=t[1],o=this._rtcManager.getRtcChannel(e);return new Ju(e,{rtc:this._rtcManager,rtcChannel:o,rtm:this._rtmManager,rtmChannel:r,rtmChannelObserver:i})}},{key:"createRemoteControlContext",value:function(e,t){return new Qh(e.rtcChannel,t)}},{key:"getAgoraMediaControl",value:function(){return this._mediaControl}},{key:"uploadSDKLogToAgoraService",value:(t=o(v().mark((function e(t){var r,i,o,a,s,c,u,l,h,f,d;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ju(yn.logger.collectConsoleLogs());case 2:if(a=e.sent,s=n(a,2),r=s[0],i=s[1],r){e.next=20;break}return e.next=9,ju(this._logService.uploadLogFile(t,i));case 9:if(c=e.sent,u=n(c,1),!(r=u[0])){e.next=16;break}Mn.shared.handleNonThrowableError(kn.RTE_ERR_WEB_LOG_UPLOAD_ERR,r),e.next=18;break;case 16:return e.next=18,ju(yn.logger.cleanupConsoleLogs());case 18:e.next=21;break;case 20:Mn.shared.handleNonThrowableError(kn.RTE_ERR_WEB_LOG_UPLOAD_ERR,r);case 21:if(Fn.platform!==Nn.Electron){e.next=38;break}return e.next=24,ju(yn.logger.collectElectronLogs(kl.logBasePath,kl.logFolderPath));case 24:if(l=e.sent,h=n(l,2),r=h[0],o=h[1],r){e.next=37;break}return e.next=31,ju(this._logService.uploadZipLogFile(t,o));case 31:f=e.sent,d=n(f,1),(r=d[0])&&Mn.shared.handleNonThrowableError(kn.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR,r),e.next=38;break;case 37:Mn.shared.handleNonThrowableError(kn.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR,r);case 38:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}],[{key:"engine",get:function(){return this._engine?this._engine:Mn.shared.handleThrowableError(kn.RTE_ERR_ENGINE_NOT_READY,new Error("engine not ready"))}},{key:"createWithConfig",value:function(e){return this._engine||(this._engine=new s(e)),this._engine}},{key:"destroy",value:function(){var e,t,r,n;yn.info("rte engine destroy"),null===(e=this._engine)||void 0===e||e.getAgoraMediaControl().createCameraVideoTrack().stop(),null===(t=this._engine)||void 0===t||t.getAgoraMediaControl().createMicrophoneAudioTrack().stop(),null===(r=this._engine)||void 0===r||r.getAgoraMediaControl().createScreenShareTrack().stop(),Fn.platform===Nn.Electron&&Qh.cleanup(),null===(n=this._engine)||void 0===n||n.logout(),this._engine=void 0,yn.restoreConsoleHijack(),ou.forEach((function(e){delete e.__cacheMap})),ou=new Set,pu.forEach((function(e){delete e.__cacheMap})),pu=new Set}},{key:"getVersion",value:function(){return Fn.version}},{key:"getRtcVersion",value:function(){return Fn.platform===Nn.Electron?kl.getRtcVersion():bh.getRtcVersion()}}]),s}(y);Gh._engine=void 0})(),__webpack_exports__})()}));
|
|
90
|
+
*/!function(i,o){"use strict";var a="function",s="undefined",c="object",u="model",l="name",h="type",f="vendor",d="version",p="architecture",g="console",v="mobile",A="tablet",m="smarttv",y="wearable",_={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:o},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},b={rgx:function(e,t){for(var r,n,i,s,u,l,h=0;h<t.length&&!u;){var f=t[h],d=t[h+1];for(r=n=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(i=0;i<d.length;i++)l=u[++n],typeof(s=d[i])===c&&s.length>0?2==s.length?typeof s[1]==a?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):o:this[s[0]]=l?s[1].call(this,l,s[2]):o:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):o):this[s]=l||o;h+=2}},str:function(e,t){for(var r in t)if(typeof t[r]===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(_.has(t[r][n],e))return"?"===r?o:r}else if(_.has(t[r],e))return"?"===r?o:r;return e}},E={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"}}}},w={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6}).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[l,d],[/(opios)[\/\s]+([\w\.]+)/i],[[l,"Opera Mini"],d],[/\s(opr)\/([\w\.]+)/i],[[l,"Opera"],d],[/(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],[l,d],[/(konqueror)\/([\w\.]+)/i],[[l,"Konqueror"],d],[/(trident).+rv[:\s]([\w\.]{1,9}).+like\sgecko/i],[[l,"IE"],d],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[l,"Edge"],d],[/(yabrowser)\/([\w\.]+)/i],[[l,"Yandex"],d],[/(Avast)\/([\w\.]+)/i],[[l,"Avast Secure Browser"],d],[/(AVG)\/([\w\.]+)/i],[[l,"AVG Secure Browser"],d],[/(puffin)\/([\w\.]+)/i],[[l,"Puffin"],d],[/(focus)\/([\w\.]+)/i],[[l,"Firefox Focus"],d],[/(opt)\/([\w\.]+)/i],[[l,"Opera Touch"],d],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[l,"UCBrowser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],d],[/(windowswechat qbcore)\/([\w\.]+)/i],[[l,"WeChat(Win) Desktop"],d],[/(micromessenger)\/([\w\.]+)/i],[[l,"WeChat"],d],[/(brave)\/([\w\.]+)/i],[[l,"Brave"],d],[/(whale)\/([\w\.]+)/i],[[l,"Whale"],d],[/(qqbrowserlite)\/([\w\.]+)/i],[l,d],[/(QQ)\/([\d\.]+)/i],[l,d],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[l,d],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[l,d],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[l,d],[/(MetaSr)[\/\s]?([\w\.]+)/i],[l],[/(LBBROWSER)/i],[l],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[l,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[d,[l,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[l,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[l,d],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[l,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[l,/(.+)/,"$1 WebView"],d],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[l,/(.+(?:g|us))(.+)/,"$1 $2"],d],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[d,[l,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[l,"Sailfish Browser"],d],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[l,d],[/(dolfin)\/([\w\.]+)/i],[[l,"Dolphin"],d],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[l,"360 Browser"]],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[l,"Chrome"],d],[/(coast)\/([\w\.]+)/i],[[l,"Opera Coast"],d],[/fxios\/([\w\.-]+)/i],[d,[l,"Firefox"]],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[d,[l,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[d,l],[/webkit.+?(gsa)\/([\w\.]+)\s.*(mobile\s?safari|safari)(\/[\w\.]+)/i],[[l,"GSA"],d],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[l,[d,b.str,E.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[l,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[l,"Netscape"],d],[/(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],[l,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,_.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[p,/ower/,"",_.lowerize]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[p,_.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[u,f,[h,A]],[/applecoremedia\/[\w\.]+ \((ipad)/],[u,[f,"Apple"],[h,A]],[/(apple\s{0,1}tv)/i],[[u,"Apple TV"],[f,"Apple"],[h,m]],[/(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],[f,u,[h,A]],[/(kf[A-z]+)(\sbuild\/|\)).+silk\//i],[u,[f,"Amazon"],[h,A]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[u,b.str,E.device.amazon.model],[f,"Amazon"],[h,v]],[/android.+aft([bms])\sbuild/i],[u,[f,"Amazon"],[h,m]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[u,f,[h,v]],[/\((ip[honed|\s\w*]+);/i],[u,[f,"Apple"],[h,v]],[/(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],[f,u,[h,v]],[/\(bb10;\s(\w+)/i],[u,[f,"BlackBerry"],[h,v]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[u,[f,"Asus"],[h,A]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[f,"Sony"],[u,"Xperia Tablet"],[h,A]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[f,"Sony"],[h,v]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[f,u,[h,g]],[/android.+;\s(shield)\sbuild/i],[u,[f,"Nvidia"],[h,g]],[/(playstation\s[34portablevi]+)/i],[u,[f,"Sony"],[h,g]],[/(sprint\s(\w+))/i],[[f,b.str,E.device.sprint.vendor],[u,b.str,E.device.sprint.model],[h,v]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[u,/_/g," "],[h,v]],[/(nexus\s9)/i],[u,[f,"HTC"],[h,A]],[/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],[u,[f,"Huawei"],[h,v]],[/android.+(bah2?-a?[lw]\d{2})/i],[u,[f,"Huawei"],[h,A]],[/(microsoft);\s(lumia[\s\w]+)/i],[f,u,[h,v]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[u,[f,"Microsoft"],[h,g]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,"Microsoft"],[h,v]],[/\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],[u,[f,"Motorola"],[h,v]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[u,[f,"Motorola"],[h,A]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,_.trim],[u,_.trim],[h,m]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,"Samsung"],[h,m]],[/\(dtv[\);].+(aquos)/i],[u,[f,"Sharp"],[h,m]],[/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],[[f,"Samsung"],u,[h,A]],[/smart-tv.+(samsung)/i],[f,[h,m],u],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[f,"Samsung"],u,[h,v]],[/sie-(\w*)/i],[u,[f,"Siemens"],[h,v]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[f,"Nokia"],u,[h,v]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[u,[f,"Acer"],[h,A]],[/android.+([vl]k\-?\d{3})\s+build/i],[u,[f,"LG"],[h,A]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[f,"LG"],u,[h,A]],[/linux;\snetcast.+smarttv/i,/lg\snetcast\.tv-201\d/i],[[f,"LG"],u,[h,m]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[u,[f,"LG"],[h,v]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[f,u,[h,A]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[u,[f,"Lenovo"],[h,A]],[/(lenovo)[_\s-]?([\w-]+)/i],[f,u,[h,v]],[/linux;.+((jolla));/i],[f,u,[h,v]],[/((pebble))app\/[\d\.]+\s/i],[f,u,[h,y]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,u,[h,v]],[/crkey/i],[[u,"Chromecast"],[f,"Google"],[h,m]],[/android.+;\s(glass)\s\d/i],[u,[f,"Google"],[h,y]],[/android.+;\s(pixel c)[\s)]/i],[u,[f,"Google"],[h,A]],[/android.+;\s(pixel( [2-9]a?)?( xl)?)[\s)]/i],[u,[f,"Google"],[h,v]],[/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],[[u,/_/g," "],[f,"Xiaomi"],[h,v]],[/android.+(mi[\s\-_]?(?:pad)(?:[\s_]?[\w\s]+))(?:\sbuild|\))/i],[[u,/_/g," "],[f,"Xiaomi"],[h,A]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[u,[f,"Meizu"],[h,v]],[/(mz)-([\w-]{2,})/i],[[f,"Meizu"],u,[h,v]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[u,[f,"OnePlus"],[h,v]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[u,[f,"RCA"],[h,A]],[/android.+[;\/\s](Venue[\d\s]{2,7})\s+build/i],[u,[f,"Dell"],[h,A]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[u,[f,"Verizon"],[h,A]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[f,"Barnes & Noble"],u,[h,A]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[u,[f,"NuVision"],[h,A]],[/android.+;\s(k88)\sbuild/i],[u,[f,"ZTE"],[h,A]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[u,[f,"Swiss"],[h,v]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[u,[f,"Swiss"],[h,A]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[u,[f,"Zeki"],[h,A]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[f,"Dragon Touch"],u,[h,A]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[u,[f,"Insignia"],[h,A]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[u,[f,"NextBook"],[h,A]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[f,"Voice"],u,[h,v]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[f,"LvTel"],u,[h,v]],[/android.+;\s(PH-1)\s/i],[u,[f,"Essential"],[h,v]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[u,[f,"Envizen"],[h,A]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[f,u,[h,A]],[/android.+[;\/]\s*(Trio[\s\w\-\.]+)\s+build/i],[u,[f,"MachSpeed"],[h,A]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[f,u,[h,A]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[u,[f,"Rotor"],[h,A]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[f,u,[h,A]],[/android .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[u,[h,v]],[/android .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[u,[h,A]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[h,_.lowerize],f,u],[/[\s\/\(](smart-?tv)[;\)]/i],[[h,m]],[/(android[\w\.\s\-]{0,9});.+build/i],[u,[f,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[d,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[l,"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],[l,d],[/rv\:([\w\.]{1,9}).+(gecko)/i],[d,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,d],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[d,b.str,E.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[d,b.str,E.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],d],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[l,d],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[l,"Symbian"],d],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],d],[/crkey\/([\d\.]+)/i],[d,[l,"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],[l,d],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],d],[/(sunos)\s?([\w\.\d]*)/i],[[l,"Solaris"],d],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[l,d],[/(haiku)\s(\w+)/i],[l,d],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[d,/_/g,"."],[l,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[l,"Mac OS"],[d,/_/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],[l,d]]},I=function(e,t){if("object"==typeof e&&(t=e,e=o),!(this instanceof I))return new I(e,t).getResult();var r=e||(i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),n=t?_.extend(w,t):w;return this.getBrowser=function(){var e={name:o,version:o};return b.rgx.call(e,r,n.browser),e.major=_.major(e.version),e},this.getCPU=function(){var e={architecture:o};return b.rgx.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:o,model:o,type:o};return b.rgx.call(e,r,n.device),e},this.getEngine=function(){var e={name:o,version:o};return b.rgx.call(e,r,n.engine),e},this.getOS=function(){var e={name:o,version:o};return b.rgx.call(e,r,n.os),e},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 r},this.setUA=function(e){return r=e,this},this};I.VERSION="0.7.23",I.BROWSER={NAME:l,MAJOR:"major",VERSION:d},I.CPU={ARCHITECTURE:p},I.DEVICE={MODEL:u,VENDOR:f,TYPE:h,CONSOLE:g,MOBILE:v,SMARTTV:m,TABLET:A,WEARABLE:y,EMBEDDED:"embedded"},I.ENGINE={NAME:l,VERSION:d},I.OS={NAME:l,VERSION:d},typeof t!==s?(e.exports&&(t=e.exports=I),t.UAParser=I):(n=function(){return I}.call(t,r,t,e))===o||(e.exports=n);var C=i&&(i.jQuery||i.Zepto);if(C&&!C.ua){var S=new I;C.ua=S.getResult(),C.ua.get=function(){return S.getUA()},C.ua.set=function(e){S.setUA(e);var t=S.getResult();for(var r in t)C.ua[r]=t[r]}}}("object"==typeof window?window:this)},1005:e=>{"use strict";e.exports=function(e,t,r,n){var i=self||window;try{try{var o;try{o=new i.Blob([e])}catch(t){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(e),o=o.getBlob()}var a=i.URL||i.webkitURL,s=a.createObjectURL(o),c=new i[t](s,r);return a.revokeObjectURL(s),c}catch(n){return new i[t]("data:application/javascript,".concat(encodeURIComponent(e)),r)}}catch(e){if(!n)throw Error("Inline worker is not supported");return new i[t](n,r)}}},9662:(e,t,r)=>{var n=r(7854),i=r(614),o=r(6330),a=n.TypeError;e.exports=function(e){if(i(e))return e;throw a(o(e)+" is not a function")}},9483:(e,t,r)=>{var n=r(7854),i=r(4411),o=r(6330),a=n.TypeError;e.exports=function(e){if(i(e))return e;throw a(o(e)+" is not a constructor")}},6077:(e,t,r)=>{var n=r(7854),i=r(614),o=n.String,a=n.TypeError;e.exports=function(e){if("object"==typeof e||i(e))return e;throw a("Can't set "+o(e)+" as a prototype")}},1223:(e,t,r)=>{var n=r(5112),i=r(30),o=r(3070),a=n("unscopables"),s=Array.prototype;null==s[a]&&o.f(s,a,{configurable:!0,value:i(null)}),e.exports=function(e){s[a][e]=!0}},1530:(e,t,r)=>{"use strict";var n=r(8710).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},5787:(e,t,r)=>{var n=r(7854),i=r(7976),o=n.TypeError;e.exports=function(e,t){if(i(t,e))return e;throw o("Incorrect invocation")}},9670:(e,t,r)=>{var n=r(7854),i=r(111),o=n.String,a=n.TypeError;e.exports=function(e){if(i(e))return e;throw a(o(e)+" is not an object")}},5381:e=>{e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7556:(e,t,r)=>{var n=r(7293);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},260:(e,t,r)=>{"use strict";var n,i,o,a=r(5381),s=r(9781),c=r(7854),u=r(614),l=r(111),h=r(2597),f=r(648),d=r(6330),p=r(8880),g=r(1320),v=r(3070).f,A=r(7976),m=r(9518),y=r(7674),_=r(5112),b=r(9711),E=c.Int8Array,w=E&&E.prototype,I=c.Uint8ClampedArray,C=I&&I.prototype,S=E&&m(E),T=w&&m(w),R=Object.prototype,k=c.TypeError,O=_("toStringTag"),N=b("TYPED_ARRAY_TAG"),x=b("TYPED_ARRAY_CONSTRUCTOR"),D=a&&!!y&&"Opera"!==f(c.opera),L=!1,P={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},B={BigInt64Array:8,BigUint64Array:8},M=function(e){if(!l(e))return!1;var t=f(e);return h(P,t)||h(B,t)};for(n in P)(o=(i=c[n])&&i.prototype)?p(o,x,i):D=!1;for(n in B)(o=(i=c[n])&&i.prototype)&&p(o,x,i);if((!D||!u(S)||S===Function.prototype)&&(S=function(){throw k("Incorrect invocation")},D))for(n in P)c[n]&&y(c[n],S);if((!D||!T||T===R)&&(T=S.prototype,D))for(n in P)c[n]&&y(c[n].prototype,T);if(D&&m(C)!==T&&y(C,T),s&&!h(T,O))for(n in L=!0,v(T,O,{get:function(){return l(this)?this[N]:void 0}}),P)c[n]&&p(c[n],N,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:D,TYPED_ARRAY_CONSTRUCTOR:x,TYPED_ARRAY_TAG:L&&N,aTypedArray:function(e){if(M(e))return e;throw k("Target is not a typed array")},aTypedArrayConstructor:function(e){if(u(e)&&(!y||A(S,e)))return e;throw k(d(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(s){if(r)for(var i in P){var o=c[i];if(o&&h(o.prototype,e))try{delete o.prototype[e]}catch(e){}}T[e]&&!r||g(T,e,r?t:D&&w[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(s){if(y){if(r)for(n in P)if((i=c[n])&&h(i,e))try{delete i[e]}catch(e){}if(S[e]&&!r)return;try{return g(S,e,r?t:D&&S[e]||t)}catch(e){}}for(n in P)!(i=c[n])||i[e]&&!r||g(i,e,t)}},isView:function(e){if(!l(e))return!1;var t=f(e);return"DataView"===t||h(P,t)||h(B,t)},isTypedArray:M,TypedArray:S,TypedArrayPrototype:T}},3331:(e,t,r)=>{"use strict";var n=r(7854),i=r(1702),o=r(9781),a=r(5381),s=r(6530),c=r(8880),u=r(2248),l=r(7293),h=r(5787),f=r(9303),d=r(7466),p=r(7067),g=r(1179),v=r(9518),A=r(7674),m=r(8006).f,y=r(3070).f,_=r(1285),b=r(1589),E=r(8003),w=r(9909),I=s.PROPER,C=s.CONFIGURABLE,S=w.get,T=w.set,R="ArrayBuffer",k="DataView",O="Wrong index",N=n.ArrayBuffer,x=N,D=x&&x.prototype,L=n.DataView,P=L&&L.prototype,B=Object.prototype,M=n.Array,j=n.RangeError,U=i(_),F=i([].reverse),Q=g.pack,q=g.unpack,G=function(e){return[255&e]},V=function(e){return[255&e,e>>8&255]},K=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},H=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},z=function(e){return Q(e,23,4)},W=function(e){return Q(e,52,8)},Y=function(e,t){y(e.prototype,t,{get:function(){return S(this)[t]}})},J=function(e,t,r,n){var i=p(r),o=S(e);if(i+t>o.byteLength)throw j(O);var a=S(o.buffer).bytes,s=i+o.byteOffset,c=b(a,s,s+t);return n?c:F(c)},X=function(e,t,r,n,i,o){var a=p(r),s=S(e);if(a+t>s.byteLength)throw j(O);for(var c=S(s.buffer).bytes,u=a+s.byteOffset,l=n(+i),h=0;h<t;h++)c[u+h]=l[o?h:t-h-1]};if(a){var Z=I&&N.name!==R;if(l((function(){N(1)}))&&l((function(){new N(-1)}))&&!l((function(){return new N,new N(1.5),new N(NaN),Z&&!C})))Z&&C&&c(N,"name",R);else{(x=function(e){return h(this,D),new N(p(e))}).prototype=D;for(var $,ee=m(N),te=0;ee.length>te;)($=ee[te++])in x||c(x,$,N[$]);D.constructor=x}A&&v(P)!==B&&A(P,B);var re=new L(new x(2)),ne=i(P.setInt8);re.setInt8(0,2147483648),re.setInt8(1,2147483649),!re.getInt8(0)&&re.getInt8(1)||u(P,{setInt8:function(e,t){ne(this,e,t<<24>>24)},setUint8:function(e,t){ne(this,e,t<<24>>24)}},{unsafe:!0})}else D=(x=function(e){h(this,D);var t=p(e);T(this,{bytes:U(M(t),0),byteLength:t}),o||(this.byteLength=t)}).prototype,P=(L=function(e,t,r){h(this,P),h(e,D);var n=S(e).byteLength,i=f(t);if(i<0||i>n)throw j("Wrong offset");if(i+(r=void 0===r?n-i:d(r))>n)throw j("Wrong length");T(this,{buffer:e,byteLength:r,byteOffset:i}),o||(this.buffer=e,this.byteLength=r,this.byteOffset=i)}).prototype,o&&(Y(x,"byteLength"),Y(L,"buffer"),Y(L,"byteLength"),Y(L,"byteOffset")),u(P,{getInt8:function(e){return J(this,1,e)[0]<<24>>24},getUint8:function(e){return J(this,1,e)[0]},getInt16:function(e){var t=J(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=J(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return H(J(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return H(J(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return q(J(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return q(J(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){X(this,1,e,G,t)},setUint8:function(e,t){X(this,1,e,G,t)},setInt16:function(e,t){X(this,2,e,V,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){X(this,2,e,V,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){X(this,4,e,K,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){X(this,4,e,K,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){X(this,4,e,z,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){X(this,8,e,W,t,arguments.length>2?arguments[2]:void 0)}});E(x,R),E(L,k),e.exports={ArrayBuffer:x,DataView:L}},1048:(e,t,r)=>{"use strict";var n=r(7908),i=r(1400),o=r(6244),a=Math.min;e.exports=[].copyWithin||function(e,t){var r=n(this),s=o(r),c=i(e,s),u=i(t,s),l=arguments.length>2?arguments[2]:void 0,h=a((void 0===l?s:i(l,s))-u,s-c),f=1;for(u<c&&c<u+h&&(f=-1,u+=h-1,c+=h-1);h-- >0;)u in r?r[c]=r[u]:delete r[c],c+=f,u+=f;return r}},1285:(e,t,r)=>{"use strict";var n=r(7908),i=r(1400),o=r(6244);e.exports=function(e){for(var t=n(this),r=o(t),a=arguments.length,s=i(a>1?arguments[1]:void 0,r),c=a>2?arguments[2]:void 0,u=void 0===c?r:i(c,r);u>s;)t[s++]=e;return t}},8533:(e,t,r)=>{"use strict";var n=r(2092).forEach,i=r(9341)("forEach");e.exports=i?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},7745:(e,t,r)=>{var n=r(6244);e.exports=function(e,t){for(var r=0,i=n(t),o=new e(i);i>r;)o[r]=t[r++];return o}},8457:(e,t,r)=>{"use strict";var n=r(7854),i=r(9974),o=r(6916),a=r(7908),s=r(3411),c=r(7659),u=r(4411),l=r(6244),h=r(6135),f=r(8554),d=r(1246),p=n.Array;e.exports=function(e){var t=a(e),r=u(this),n=arguments.length,g=n>1?arguments[1]:void 0,v=void 0!==g;v&&(g=i(g,n>2?arguments[2]:void 0));var A,m,y,_,b,E,w=d(t),I=0;if(!w||this==p&&c(w))for(A=l(t),m=r?new this(A):p(A);A>I;I++)E=v?g(t[I],I):t[I],h(m,I,E);else for(b=(_=f(t,w)).next,m=r?new this:[];!(y=o(b,_)).done;I++)E=v?s(_,g,[y.value,I],!0):y.value,h(m,I,E);return m.length=I,m}},1318:(e,t,r)=>{var n=r(5656),i=r(1400),o=r(6244),a=function(e){return function(t,r,a){var s,c=n(t),u=o(c),l=i(a,u);if(e&&r!=r){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===r)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},2092:(e,t,r)=>{var n=r(9974),i=r(1702),o=r(8361),a=r(7908),s=r(6244),c=r(5417),u=i([].push),l=function(e){var t=1==e,r=2==e,i=3==e,l=4==e,h=6==e,f=7==e,d=5==e||h;return function(p,g,v,A){for(var m,y,_=a(p),b=o(_),E=n(g,v),w=s(b),I=0,C=A||c,S=t?C(p,w):r||f?C(p,0):void 0;w>I;I++)if((d||I in b)&&(y=E(m=b[I],I,_),e))if(t)S[I]=y;else if(y)switch(e){case 3:return!0;case 5:return m;case 6:return I;case 2:u(S,m)}else switch(e){case 4:return!1;case 7:u(S,m)}return h?-1:i||l?l:S}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},6583:(e,t,r)=>{"use strict";var n=r(2104),i=r(5656),o=r(9303),a=r(6244),s=r(9341),c=Math.min,u=[].lastIndexOf,l=!!u&&1/[1].lastIndexOf(1,-0)<0,h=s("lastIndexOf"),f=l||!h;e.exports=f?function(e){if(l)return n(u,this,arguments)||0;var t=i(this),r=a(t),s=r-1;for(arguments.length>1&&(s=c(s,o(arguments[1]))),s<0&&(s=r+s);s>=0;s--)if(s in t&&t[s]===e)return s||0;return-1}:u},1194:(e,t,r)=>{var n=r(7293),i=r(5112),o=r(7392),a=i("species");e.exports=function(e){return o>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},9341:(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)}))}},3671:(e,t,r)=>{var n=r(7854),i=r(9662),o=r(7908),a=r(8361),s=r(6244),c=n.TypeError,u=function(e){return function(t,r,n,u){i(r);var l=o(t),h=a(l),f=s(l),d=e?f-1:0,p=e?-1:1;if(n<2)for(;;){if(d in h){u=h[d],d+=p;break}if(d+=p,e?d<0:f<=d)throw c("Reduce of empty array with no initial value")}for(;e?d>=0:f>d;d+=p)d in h&&(u=r(u,h[d],d,l));return u}};e.exports={left:u(!1),right:u(!0)}},1589:(e,t,r)=>{var n=r(7854),i=r(1400),o=r(6244),a=r(6135),s=n.Array,c=Math.max;e.exports=function(e,t,r){for(var n=o(e),u=i(t,n),l=i(void 0===r?n:r,n),h=s(c(l-u,0)),f=0;u<l;u++,f++)a(h,f,e[u]);return h.length=f,h}},206:(e,t,r)=>{var n=r(1702);e.exports=n([].slice)},4362:(e,t,r)=>{var n=r(1589),i=Math.floor,o=function(e,t){var r=e.length,c=i(r/2);return r<8?a(e,t):s(e,o(n(e,0,c),t),o(n(e,c),t),t)},a=function(e,t){for(var r,n,i=e.length,o=1;o<i;){for(n=o,r=e[o];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==o++&&(e[n]=r)}return e},s=function(e,t,r,n){for(var i=t.length,o=r.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?n(t[a],r[s])<=0?t[a++]:r[s++]:a<i?t[a++]:r[s++];return e};e.exports=o},7475:(e,t,r)=>{var n=r(7854),i=r(3157),o=r(4411),a=r(111),s=r(5112)("species"),c=n.Array;e.exports=function(e){var t;return i(e)&&(t=e.constructor,(o(t)&&(t===c||i(t.prototype))||a(t)&&null===(t=t[s]))&&(t=void 0)),void 0===t?c:t}},5417:(e,t,r)=>{var n=r(7475);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},3411:(e,t,r)=>{var n=r(9670),i=r(9212);e.exports=function(e,t,r,o){try{return o?t(n(r)[0],r[1]):t(r)}catch(t){i(e,"throw",t)}}},7072:(e,t,r)=>{var n=r(5112)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},e(o)}catch(e){}return r}},4326:(e,t,r)=>{var n=r(1702),i=n({}.toString),o=n("".slice);e.exports=function(e){return o(i(e),8,-1)}},648:(e,t,r)=>{var n=r(7854),i=r(1694),o=r(614),a=r(4326),s=r(5112)("toStringTag"),c=n.Object,u="Arguments"==a(function(){return arguments}());e.exports=i?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=c(e),s))?r:u?a(t):"Object"==(n=a(t))&&o(t.callee)?"Arguments":n}},1501:(e,t,r)=>{"use strict";var n=r(6916),i=r(9662),o=r(9670);e.exports=function(){for(var e=o(this),t=i(e.add),r=0,a=arguments.length;r<a;r++)n(t,e,arguments[r]);return e}},4092:(e,t,r)=>{"use strict";var n=r(6916),i=r(9662),o=r(9670);e.exports=function(){for(var e,t=o(this),r=i(t.delete),a=!0,s=0,c=arguments.length;s<c;s++)e=n(r,t,arguments[s]),a=a&&e;return!!a}},5631:(e,t,r)=>{"use strict";var n=r(3070).f,i=r(30),o=r(2248),a=r(9974),s=r(5787),c=r(408),u=r(654),l=r(6340),h=r(9781),f=r(2423).fastKey,d=r(9909),p=d.set,g=d.getterFor;e.exports={getConstructor:function(e,t,r,u){var l=e((function(e,n){s(e,d),p(e,{type:t,index:i(null),first:void 0,last:void 0,size:0}),h||(e.size=0),null!=n&&c(n,e[u],{that:e,AS_ENTRIES:r})})),d=l.prototype,v=g(t),A=function(e,t,r){var n,i,o=v(e),a=m(e,t);return a?a.value=r:(o.last=a={index:i=f(t,!0),key:t,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=a),n&&(n.next=a),h?o.size++:e.size++,"F"!==i&&(o.index[i]=a)),e},m=function(e,t){var r,n=v(e),i=f(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return o(d,{clear:function(){for(var e=v(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,h?e.size=0:this.size=0},delete:function(e){var t=this,r=v(t),n=m(t,e);if(n){var i=n.next,o=n.previous;delete r.index[n.index],n.removed=!0,o&&(o.next=i),i&&(i.previous=o),r.first==n&&(r.first=i),r.last==n&&(r.last=o),h?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=v(this),n=a(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!m(this,e)}}),o(d,r?{get:function(e){var t=m(this,e);return t&&t.value},set:function(e,t){return A(this,0===e?0:e,t)}}:{add:function(e){return A(this,e=0===e?0:e,e)}}),h&&n(d,"size",{get:function(){return v(this).size}}),l},setStrong:function(e,t,r){var n=t+" Iterator",i=g(t),o=g(n);u(e,t,(function(e,t){p(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),l(t)}}},9320:(e,t,r)=>{"use strict";var n=r(1702),i=r(2248),o=r(2423).getWeakData,a=r(9670),s=r(111),c=r(5787),u=r(408),l=r(2092),h=r(2597),f=r(9909),d=f.set,p=f.getterFor,g=l.find,v=l.findIndex,A=n([].splice),m=0,y=function(e){return e.frozen||(e.frozen=new _)},_=function(){this.entries=[]},b=function(e,t){return g(e.entries,(function(e){return e[0]===t}))};_.prototype={get:function(e){var t=b(this,e);if(t)return t[1]},has:function(e){return!!b(this,e)},set:function(e,t){var r=b(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=v(this.entries,(function(t){return t[0]===e}));return~t&&A(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,r,n){var l=e((function(e,i){c(e,f),d(e,{type:t,id:m++,frozen:void 0}),null!=i&&u(i,e[n],{that:e,AS_ENTRIES:r})})),f=l.prototype,g=p(t),v=function(e,t,r){var n=g(e),i=o(a(t),!0);return!0===i?y(n).set(t,r):i[n.id]=r,e};return i(f,{delete:function(e){var t=g(this);if(!s(e))return!1;var r=o(e);return!0===r?y(t).delete(e):r&&h(r,t.id)&&delete r[t.id]},has:function(e){var t=g(this);if(!s(e))return!1;var r=o(e);return!0===r?y(t).has(e):r&&h(r,t.id)}}),i(f,r?{get:function(e){var t=g(this);if(s(e)){var r=o(e);return!0===r?y(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return v(this,e,t)}}:{add:function(e){return v(this,e,!0)}}),l}}},7710:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(1702),a=r(4705),s=r(1320),c=r(2423),u=r(408),l=r(5787),h=r(614),f=r(111),d=r(7293),p=r(7072),g=r(8003),v=r(9587);e.exports=function(e,t,r){var A=-1!==e.indexOf("Map"),m=-1!==e.indexOf("Weak"),y=A?"set":"add",_=i[e],b=_&&_.prototype,E=_,w={},I=function(e){var t=o(b[e]);s(b,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(m&&!f(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return m&&!f(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(m&&!f(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(a(e,!h(_)||!(m||b.forEach&&!d((function(){(new _).entries().next()})))))E=r.getConstructor(t,e,A,y),c.enable();else if(a(e,!0)){var C=new E,S=C[y](m?{}:-0,1)!=C,T=d((function(){C.has(1)})),R=p((function(e){new _(e)})),k=!m&&d((function(){for(var e=new _,t=5;t--;)e[y](t,t);return!e.has(-0)}));R||((E=t((function(e,t){l(e,b);var r=v(new _,e,E);return null!=t&&u(t,r[y],{that:r,AS_ENTRIES:A}),r}))).prototype=b,b.constructor=E),(T||k)&&(I("delete"),I("has"),A&&I("get")),(k||S)&&I(y),m&&b.clear&&delete b.clear}return w[e]=E,n({global:!0,forced:E!=_},w),g(E,e),m||r.setStrong(E,e,A),E}},9920:(e,t,r)=>{var n=r(2597),i=r(3887),o=r(1236),a=r(3070);e.exports=function(e,t,r){for(var s=i(t),c=a.f,u=o.f,l=0;l<s.length;l++){var h=s[l];n(e,h)||r&&n(r,h)||c(e,h,u(t,h))}}},4964:(e,t,r)=>{var n=r(5112)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},8544:(e,t,r)=>{var n=r(7293);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},4230:(e,t,r)=>{var n=r(1702),i=r(4488),o=r(1340),a=/"/g,s=n("".replace);e.exports=function(e,t,r,n){var c=o(i(e)),u="<"+t;return""!==r&&(u+=" "+r+'="'+s(o(n),a,""")+'"'),u+">"+c+"</"+t+">"}},4994:(e,t,r)=>{"use strict";var n=r(3383).IteratorPrototype,i=r(30),o=r(9114),a=r(8003),s=r(7497),c=function(){return this};e.exports=function(e,t,r,u){var l=t+" Iterator";return e.prototype=i(n,{next:o(+!u,r)}),a(e,l,!1,!0),s[l]=c,e}},8880:(e,t,r)=>{var n=r(9781),i=r(3070),o=r(9114);e.exports=n?function(e,t,r){return i.f(e,t,o(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),i=r(3070),o=r(9114);e.exports=function(e,t,r){var a=n(t);a in e?i.f(e,a,o(0,r)):e[a]=r}},654:(e,t,r)=>{"use strict";var n=r(2109),i=r(6916),o=r(1913),a=r(6530),s=r(614),c=r(4994),u=r(9518),l=r(7674),h=r(8003),f=r(8880),d=r(1320),p=r(5112),g=r(7497),v=r(3383),A=a.PROPER,m=a.CONFIGURABLE,y=v.IteratorPrototype,_=v.BUGGY_SAFARI_ITERATORS,b=p("iterator"),E="keys",w="values",I="entries",C=function(){return this};e.exports=function(e,t,r,a,p,v,S){c(r,t,a);var T,R,k,O=function(e){if(e===p&&P)return P;if(!_&&e in D)return D[e];switch(e){case E:case w:case I:return function(){return new r(this,e)}}return function(){return new r(this)}},N=t+" Iterator",x=!1,D=e.prototype,L=D[b]||D["@@iterator"]||p&&D[p],P=!_&&L||O(p),B="Array"==t&&D.entries||L;if(B&&(T=u(B.call(new e)))!==Object.prototype&&T.next&&(o||u(T)===y||(l?l(T,y):s(T[b])||d(T,b,C)),h(T,N,!0,!0),o&&(g[N]=C)),A&&p==w&&L&&L.name!==w&&(!o&&m?f(D,"name",w):(x=!0,P=function(){return i(L,this)})),p)if(R={values:O(w),keys:v?P:O(E),entries:O(I)},S)for(k in R)(_||x||!(k in D))&&d(D,k,R[k]);else n({target:t,proto:!0,forced:_||x},R);return o&&!S||D[b]===P||d(D,b,P,{name:p}),g[t]=P,R}},7235:(e,t,r)=>{var n=r(857),i=r(2597),o=r(6061),a=r(3070).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});i(t,e)||a(t,e,{value:o.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),i=r(111),o=n.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.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,i=n&&n.constructor&&n.constructor.prototype;e.exports=i===Object.prototype?void 0:i},8886:(e,t,r)=>{var n=r(8113).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},7871:e=>{e.exports="object"==typeof window},256:(e,t,r)=>{var n=r(8113);e.exports=/MSIE|Trident/.test(n)},1528:(e,t,r)=>{var n=r(8113),i=r(7854);e.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==i.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),i=r(7854);e.exports="process"==n(i.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,i,o=r(7854),a=r(8113),s=o.process,c=o.Deno,u=s&&s.versions||c&&c.version,l=u&&u.v8;l&&(i=(n=l.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},8008:(e,t,r)=>{var n=r(8113).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},748:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(e,t,r)=>{var n=r(7854),i=r(1236).f,o=r(8880),a=r(1320),s=r(3505),c=r(9920),u=r(4705);e.exports=function(e,t){var r,l,h,f,d,p=e.target,g=e.global,v=e.stat;if(r=g?n:v?n[p]||s(p,{}):(n[p]||{}).prototype)for(l in t){if(f=t[l],h=e.noTargetGet?(d=i(r,l))&&d.value:r[l],!u(g?l:p+(v?".":"#")+l,e.forced)&&void 0!==h){if(typeof f==typeof h)continue;c(f,h)}(e.sham||h&&h.sham)&&o(f,"sham",!0),a(r,l,f,e)}}},7293:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},7007:(e,t,r)=>{"use strict";r(4916);var n=r(1702),i=r(1320),o=r(2261),a=r(7293),s=r(5112),c=r(8880),u=s("species"),l=RegExp.prototype;e.exports=function(e,t,r,h){var f=s(e),d=!a((function(){var t={};return t[f]=function(){return 7},7!=""[e](t)})),p=d&&!a((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[u]=function(){return r},r.flags="",r[f]=/./[f]),r.exec=function(){return t=!0,null},r[f](""),!t}));if(!d||!p||r){var g=n(/./[f]),v=t(f,""[e],(function(e,t,r,i,a){var s=n(e),c=t.exec;return c===o||c===l.exec?d&&!a?{done:!0,value:g(t,r,i)}:{done:!0,value:s(r,t,i)}:{done:!1}}));i(String.prototype,e,v[0]),i(l,f,v[1])}h&&c(l[f],"sham",!0)}},6677:(e,t,r)=>{var n=r(7293);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},2104:e=>{var t=Function.prototype,r=t.apply,n=t.bind,i=t.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?i.bind(r):function(){return i.apply(r,arguments)})},9974:(e,t,r)=>{var n=r(1702),i=r(9662),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?o(e,t):function(){return e.apply(t,arguments)}}},7065:(e,t,r)=>{"use strict";var n=r(7854),i=r(1702),o=r(9662),a=r(111),s=r(2597),c=r(206),u=n.Function,l=i([].concat),h=i([].join),f={},d=function(e,t,r){if(!s(f,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";f[t]=u("C,a","return new C("+h(n,",")+")")}return f[t](e,r)};e.exports=u.bind||function(e){var t=o(this),r=t.prototype,n=c(arguments,1),i=function(){var r=l(n,c(arguments));return this instanceof i?d(t,r.length,r):t.apply(e,r)};return a(r)&&(i.prototype=r),i}},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),i=r(2597),o=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=i(o,"name"),c=s&&"something"===function(){}.name,u=s&&(!n||n&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:u}},1702:e=>{var t=Function.prototype,r=t.bind,n=t.call,i=r&&r.bind(n);e.exports=r?function(e){return e&&i(n,e)}:function(e){return e&&function(){return n.apply(e,arguments)}}},5005:(e,t,r)=>{var n=r(7854),i=r(614),o=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e]):n[e]&&n[e][t]}},1246:(e,t,r)=>{var n=r(648),i=r(8173),o=r(7497),a=r(5112)("iterator");e.exports=function(e){if(null!=e)return i(e,a)||i(e,"@@iterator")||o[n(e)]}},8554:(e,t,r)=>{var n=r(7854),i=r(6916),o=r(9662),a=r(9670),s=r(6330),c=r(1246),u=n.TypeError;e.exports=function(e,t){var r=arguments.length<2?c(e):t;if(o(r))return a(i(r,e));throw u(s(e)+" is not iterable")}},4647:(e,t,r)=>{var n=r(6916);e.exports=function(e){return n(Map.prototype.entries,e)}},8173:(e,t,r)=>{var n=r(9662);e.exports=function(e,t){var r=e[t];return null==r?void 0:n(r)}},6767:(e,t,r)=>{var n=r(6916);e.exports=function(e){return n(Set.prototype.values,e)}},7854:(e,t,r)=>{var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2597:(e,t,r)=>{var n=r(1702),i=r(7908),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(i(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),i=r(7293),o=r(317);e.exports=!n&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},1179:(e,t,r)=>{var n=r(7854).Array,i=Math.abs,o=Math.pow,a=Math.floor,s=Math.log,c=Math.LN2;e.exports={pack:function(e,t,r){var u,l,h,f=n(r),d=8*r-t-1,p=(1<<d)-1,g=p>>1,v=23===t?o(2,-24)-o(2,-77):0,A=e<0||0===e&&1/e<0?1:0,m=0;for((e=i(e))!=e||e===1/0?(l=e!=e?1:0,u=p):(u=a(s(e)/c),e*(h=o(2,-u))<1&&(u--,h*=2),(e+=u+g>=1?v/h:v*o(2,1-g))*h>=2&&(u++,h/=2),u+g>=p?(l=0,u=p):u+g>=1?(l=(e*h-1)*o(2,t),u+=g):(l=e*o(2,g-1)*o(2,t),u=0));t>=8;)f[m++]=255&l,l/=256,t-=8;for(u=u<<t|l,d+=t;d>0;)f[m++]=255&u,u/=256,d-=8;return f[--m]|=128*A,f},unpack:function(e,t){var r,n=e.length,i=8*n-t-1,a=(1<<i)-1,s=a>>1,c=i-7,u=n-1,l=e[u--],h=127&l;for(l>>=7;c>0;)h=256*h+e[u--],c-=8;for(r=h&(1<<-c)-1,h>>=-c,c+=t;c>0;)r=256*r+e[u--],c-=8;if(0===h)h=1-s;else{if(h===a)return r?NaN:l?-1/0:1/0;r+=o(2,t),h-=s}return(l?-1:1)*r*o(2,h-t)}}},8361:(e,t,r)=>{var n=r(7854),i=r(1702),o=r(7293),a=r(4326),s=n.Object,c=i("".split);e.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?c(e,""):s(e)}:s},9587:(e,t,r)=>{var n=r(614),i=r(111),o=r(7674);e.exports=function(e,t,r){var a,s;return o&&n(a=t.constructor)&&a!==r&&i(s=a.prototype)&&s!==r.prototype&&o(e,s),e}},2788:(e,t,r)=>{var n=r(1702),i=r(614),o=r(5465),a=n(Function.toString);i(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},2423:(e,t,r)=>{var n=r(2109),i=r(1702),o=r(3501),a=r(111),s=r(2597),c=r(3070).f,u=r(8006),l=r(1156),h=r(2050),f=r(9711),d=r(6677),p=!1,g=f("meta"),v=0,A=function(e){c(e,g,{value:{objectID:"O"+v++,weakData:{}}})},m=e.exports={enable:function(){m.enable=function(){},p=!0;var e=u.f,t=i([].splice),r={};r[g]=1,e(r).length&&(u.f=function(r){for(var n=e(r),i=0,o=n.length;i<o;i++)if(n[i]===g){t(n,i,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,g)){if(!h(e))return"F";if(!t)return"E";A(e)}return e[g].objectID},getWeakData:function(e,t){if(!s(e,g)){if(!h(e))return!0;if(!t)return!1;A(e)}return e[g].weakData},onFreeze:function(e){return d&&p&&h(e)&&!s(e,g)&&A(e),e}};o[g]=!0},9909:(e,t,r)=>{var n,i,o,a=r(8536),s=r(7854),c=r(1702),u=r(111),l=r(8880),h=r(2597),f=r(5465),d=r(6200),p=r(3501),g="Object already initialized",v=s.TypeError,A=s.WeakMap;if(a||f.state){var m=f.state||(f.state=new A),y=c(m.get),_=c(m.has),b=c(m.set);n=function(e,t){if(_(m,e))throw new v(g);return t.facade=e,b(m,e,t),t},i=function(e){return y(m,e)||{}},o=function(e){return _(m,e)}}else{var E=d("state");p[E]=!0,n=function(e,t){if(h(e,E))throw new v(g);return t.facade=e,l(e,E,t),t},i=function(e){return h(e,E)?e[E]:{}},o=function(e){return h(e,E)}}e.exports={set:n,get:i,has:o,enforce:function(e){return o(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=i(t)).type!==e)throw v("Incompatible receiver, "+e+" required");return r}}}},7659:(e,t,r)=>{var n=r(5112),i=r(7497),o=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[o]===e)}},3157:(e,t,r)=>{var n=r(4326);e.exports=Array.isArray||function(e){return"Array"==n(e)}},614:e=>{e.exports=function(e){return"function"==typeof e}},4411:(e,t,r)=>{var n=r(1702),i=r(7293),o=r(614),a=r(648),s=r(5005),c=r(2788),u=function(){},l=[],h=s("Reflect","construct"),f=/^\s*(?:class|function)\b/,d=n(f.exec),p=!f.exec(u),g=function(e){if(!o(e))return!1;try{return h(u,l,e),!0}catch(e){return!1}},v=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!d(f,c(e))}catch(e){return!0}};v.sham=!0,e.exports=!h||i((function(){var e;return g(g.call)||!g(Object)||!g((function(){e=!0}))||e}))?v:g},4705:(e,t,r)=>{var n=r(7293),i=r(614),o=/#|\.prototype\./,a=function(e,t){var r=c[s(e)];return r==l||r!=u&&(i(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=a.data={},u=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},5988:(e,t,r)=>{var n=r(111),i=Math.floor;e.exports=Number.isInteger||function(e){return!n(e)&&isFinite(e)&&i(e)===e}},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},7850:(e,t,r)=>{var n=r(111),i=r(4326),o=r(5112)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},2190:(e,t,r)=>{var n=r(7854),i=r(5005),o=r(614),a=r(7976),s=r(3307),c=n.Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=i("Symbol");return o(t)&&a(t.prototype,c(e))}},408:(e,t,r)=>{var n=r(7854),i=r(9974),o=r(6916),a=r(9670),s=r(6330),c=r(7659),u=r(6244),l=r(7976),h=r(8554),f=r(1246),d=r(9212),p=n.TypeError,g=function(e,t){this.stopped=e,this.result=t},v=g.prototype;e.exports=function(e,t,r){var n,A,m,y,_,b,E,w=r&&r.that,I=!(!r||!r.AS_ENTRIES),C=!(!r||!r.IS_ITERATOR),S=!(!r||!r.INTERRUPTED),T=i(t,w),R=function(e){return n&&d(n,"normal",e),new g(!0,e)},k=function(e){return I?(a(e),S?T(e[0],e[1],R):T(e[0],e[1])):S?T(e,R):T(e)};if(C)n=e;else{if(!(A=f(e)))throw p(s(e)+" is not iterable");if(c(A)){for(m=0,y=u(e);y>m;m++)if((_=k(e[m]))&&l(v,_))return _;return new g(!1)}n=h(e,A)}for(b=n.next;!(E=o(b,n)).done;){try{_=k(E.value)}catch(e){d(n,"throw",e)}if("object"==typeof _&&_&&l(v,_))return _}return new g(!1)}},9212:(e,t,r)=>{var n=r(6916),i=r(9670),o=r(8173);e.exports=function(e,t,r){var a,s;i(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw r;if(s)throw a;return i(a),r}},3383:(e,t,r)=>{"use strict";var n,i,o,a=r(7293),s=r(614),c=r(30),u=r(9518),l=r(1320),h=r(5112),f=r(1913),d=h("iterator"),p=!1;[].keys&&("next"in(o=[].keys())?(i=u(u(o)))!==Object.prototype&&(n=i):p=!0),null==n||a((function(){var e={};return n[d].call(e)!==e}))?n={}:f&&(n=c(n)),s(n[d])||l(n,d,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}},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,i,o,a,s,c,u,l,h=r(7854),f=r(9974),d=r(1236).f,p=r(261).set,g=r(6833),v=r(1528),A=r(1036),m=r(5268),y=h.MutationObserver||h.WebKitMutationObserver,_=h.document,b=h.process,E=h.Promise,w=d(h,"queueMicrotask"),I=w&&w.value;I||(n=function(){var e,t;for(m&&(e=b.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?a():o=void 0,e}}o=void 0,e&&e.enter()},g||m||A||!y||!_?!v&&E&&E.resolve?((u=E.resolve(void 0)).constructor=E,l=f(u.then,u),a=function(){l(n)}):m?a=function(){b.nextTick(n)}:(p=f(p,h),a=function(){p(n)}):(s=!0,c=_.createTextNode(""),new y(n).observe(c,{characterData:!0}),a=function(){c.data=s=!s})),e.exports=I||function(e){var t={fn:e,next:void 0};o&&(o.next=t),i||(i=t,a()),o=t}},3366:(e,t,r)=>{var n=r(7854);e.exports=n.Promise},133:(e,t,r)=>{var n=r(7392),i=r(7293);e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8536:(e,t,r)=>{var n=r(7854),i=r(614),o=r(2788),a=n.WeakMap;e.exports=i(a)&&/native code/.test(o(a))},8523:(e,t,r)=>{"use strict";var n=r(9662),i=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 i(e)}},3929:(e,t,r)=>{var n=r(7854),i=r(7850),o=n.TypeError;e.exports=function(e){if(i(e))throw o("The method doesn't accept regular expressions");return e}},3009:(e,t,r)=>{var n=r(7854),i=r(7293),o=r(1702),a=r(1340),s=r(3111).trim,c=r(1361),u=n.parseInt,l=n.Symbol,h=l&&l.iterator,f=/^[+-]?0x/i,d=o(f.exec),p=8!==u(c+"08")||22!==u(c+"0x16")||h&&!i((function(){u(Object(h))}));e.exports=p?function(e,t){var r=s(a(e));return u(r,t>>>0||(d(f,r)?16:10))}:u},1574:(e,t,r)=>{"use strict";var n=r(9781),i=r(1702),o=r(6916),a=r(7293),s=r(1956),c=r(5181),u=r(5296),l=r(7908),h=r(8361),f=Object.assign,d=Object.defineProperty,p=i([].concat);e.exports=!f||a((function(){if(n&&1!==f({b:1},f(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach((function(e){t[e]=e})),7!=f({},e)[r]||s(f({},t)).join("")!=i}))?function(e,t){for(var r=l(e),i=arguments.length,a=1,f=c.f,d=u.f;i>a;)for(var g,v=h(arguments[a++]),A=f?p(s(v),f(v)):s(v),m=A.length,y=0;m>y;)g=A[y++],n&&!o(d,v,g)||(r[g]=v[g]);return r}:f},30:(e,t,r)=>{var n,i=r(9670),o=r(6048),a=r(748),s=r(3501),c=r(490),u=r(317),l=r(6200),h=l("IE_PROTO"),f=function(){},d=function(e){return"<script>"+e+"</"+"script>"},p=function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t;g="undefined"!=typeof document?document.domain&&n?p(n):((t=u("iframe")).style.display="none",c.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F):p(n);for(var r=a.length;r--;)delete g.prototype[a[r]];return g()};s[h]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f.prototype=i(e),r=new f,f.prototype=null,r[h]=e):r=g(),void 0===t?r:o(r,t)}},6048:(e,t,r)=>{var n=r(9781),i=r(3070),o=r(9670),a=r(5656),s=r(1956);e.exports=n?Object.defineProperties:function(e,t){o(e);for(var r,n=a(t),c=s(t),u=c.length,l=0;u>l;)i.f(e,r=c[l++],n[r]);return e}},3070:(e,t,r)=>{var n=r(7854),i=r(9781),o=r(4664),a=r(9670),s=r(4948),c=n.TypeError,u=Object.defineProperty;t.f=i?u:function(e,t,r){if(a(e),t=s(t),a(r),o)try{return u(e,t,r)}catch(e){}if("get"in r||"set"in r)throw c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},1236:(e,t,r)=>{var n=r(9781),i=r(6916),o=r(5296),a=r(9114),s=r(5656),c=r(4948),u=r(2597),l=r(4664),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=s(e),t=c(t),l)try{return h(e,t)}catch(e){}if(u(e,t))return a(!i(o.f,e,t),e[t])}},1156:(e,t,r)=>{var n=r(4326),i=r(5656),o=r(8006).f,a=r(1589),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"==n(e)?function(e){try{return o(e)}catch(e){return a(s)}}(e):o(i(e))}},8006:(e,t,r)=>{var n=r(6324),i=r(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},5181:(e,t)=>{t.f=Object.getOwnPropertySymbols},9518:(e,t,r)=>{var n=r(7854),i=r(2597),o=r(614),a=r(7908),s=r(6200),c=r(8544),u=s("IE_PROTO"),l=n.Object,h=l.prototype;e.exports=c?l.getPrototypeOf:function(e){var t=a(e);if(i(t,u))return t[u];var r=t.constructor;return o(r)&&t instanceof r?r.prototype:t instanceof l?h:null}},2050:(e,t,r)=>{var n=r(7293),i=r(111),o=r(4326),a=r(7556),s=Object.isExtensible,c=n((function(){s(1)}));e.exports=c||a?function(e){return!!i(e)&&((!a||"ArrayBuffer"!=o(e))&&(!s||s(e)))}:s},7976:(e,t,r)=>{var n=r(1702);e.exports=n({}.isPrototypeOf)},6324:(e,t,r)=>{var n=r(1702),i=r(2597),o=r(5656),a=r(1318).indexOf,s=r(3501),c=n([].push);e.exports=function(e,t){var r,n=o(e),u=0,l=[];for(r in n)!i(s,r)&&i(n,r)&&c(l,r);for(;t.length>u;)i(n,r=t[u++])&&(~a(l,r)||c(l,r));return l}},1956:(e,t,r)=>{var n=r(6324),i=r(748);e.exports=Object.keys||function(e){return n(e,i)}},5296:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},7674:(e,t,r)=>{var n=r(1702),i=r(9670),o=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(r,n){return i(r),o(n),t?e(r,n):r.__proto__=n,r}}():void 0)},4699:(e,t,r)=>{var n=r(9781),i=r(1702),o=r(1956),a=r(5656),s=i(r(5296).f),c=i([].push),u=function(e){return function(t){for(var r,i=a(t),u=o(i),l=u.length,h=0,f=[];l>h;)r=u[h++],n&&!s(i,r)||c(f,e?[r,i[r]]:i[r]);return f}};e.exports={entries:u(!0),values:u(!1)}},288:(e,t,r)=>{"use strict";var n=r(1694),i=r(648);e.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},2140:(e,t,r)=>{var n=r(7854),i=r(6916),o=r(614),a=r(111),s=n.TypeError;e.exports=function(e,t){var r,n;if("string"===t&&o(r=e.toString)&&!a(n=i(r,e)))return n;if(o(r=e.valueOf)&&!a(n=i(r,e)))return n;if("string"!==t&&o(r=e.toString)&&!a(n=i(r,e)))return n;throw s("Can't convert object to primitive value")}},3887:(e,t,r)=>{var n=r(5005),i=r(1702),o=r(8006),a=r(5181),s=r(9670),c=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(s(e)),r=a.f;return r?c(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),i=r(111),o=r(8523);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=o.f(e);return(0,r.resolve)(t),r.promise}},8572:e=>{var t=function(){this.head=null,this.tail=null};t.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=t},2248:(e,t,r)=>{var n=r(1320);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},1320:(e,t,r)=>{var n=r(7854),i=r(614),o=r(2597),a=r(8880),s=r(3505),c=r(2788),u=r(9909),l=r(6530).CONFIGURABLE,h=u.get,f=u.enforce,d=String(String).split("String");(e.exports=function(e,t,r,c){var u,h=!!c&&!!c.unsafe,p=!!c&&!!c.enumerable,g=!!c&&!!c.noTargetGet,v=c&&void 0!==c.name?c.name:t;i(r)&&("Symbol("===String(v).slice(0,7)&&(v="["+String(v).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!o(r,"name")||l&&r.name!==v)&&a(r,"name",v),(u=f(r)).source||(u.source=d.join("string"==typeof v?v:""))),e!==n?(h?!g&&e[t]&&(p=!0):delete e[t],p?e[t]=r:a(e,t,r)):p?e[t]=r:s(t,r)})(Function.prototype,"toString",(function(){return i(this)&&h(this).source||c(this)}))},7651:(e,t,r)=>{var n=r(7854),i=r(6916),o=r(9670),a=r(614),s=r(4326),c=r(2261),u=n.TypeError;e.exports=function(e,t){var r=e.exec;if(a(r)){var n=i(r,e,t);return null!==n&&o(n),n}if("RegExp"===s(e))return i(c,e,t);throw u("RegExp#exec called on incompatible receiver")}},2261:(e,t,r)=>{"use strict";var n,i,o=r(6916),a=r(1702),s=r(1340),c=r(7066),u=r(2999),l=r(2309),h=r(30),f=r(9909).get,d=r(9441),p=r(7168),g=l("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,A=v,m=a("".charAt),y=a("".indexOf),_=a("".replace),b=a("".slice),E=(i=/b*/g,o(v,n=/a/,"a"),o(v,i,"a"),0!==n.lastIndex||0!==i.lastIndex),w=u.BROKEN_CARET,I=void 0!==/()??/.exec("")[1];(E||I||w||d||p)&&(A=function(e){var t,r,n,i,a,u,l,d=this,p=f(d),C=s(e),S=p.raw;if(S)return S.lastIndex=d.lastIndex,t=o(A,S,C),d.lastIndex=S.lastIndex,t;var T=p.groups,R=w&&d.sticky,k=o(c,d),O=d.source,N=0,x=C;if(R&&(k=_(k,"y",""),-1===y(k,"g")&&(k+="g"),x=b(C,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==m(C,d.lastIndex-1))&&(O="(?: "+O+")",x=" "+x,N++),r=new RegExp("^(?:"+O+")",k)),I&&(r=new RegExp("^"+O+"$(?!\\s)",k)),E&&(n=d.lastIndex),i=o(v,R?r:d,x),R?i?(i.input=b(i.input,N),i[0]=b(i[0],N),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:E&&i&&(d.lastIndex=d.global?i.index+i[0].length:n),I&&i&&i.length>1&&o(g,i[0],r,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&T)for(i.groups=u=h(null),a=0;a<T.length;a++)u[(l=T[a])[0]]=i[l[1]];return i}),e.exports=A},7066:(e,t,r)=>{"use strict";var n=r(9670);e.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},2999:(e,t,r)=>{var n=r(7293),i=r(7854).RegExp,o=n((function(){var e=i("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),a=o||n((function(){return!i("a","y").sticky})),s=o||n((function(){var e=i("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},9441:(e,t,r)=>{var n=r(7293),i=r(7854).RegExp;e.exports=n((function(){var e=i(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},7168:(e,t,r)=>{var n=r(7293),i=r(7854).RegExp;e.exports=n((function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},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}},6465:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},3505:(e,t,r)=>{var n=r(7854),i=Object.defineProperty;e.exports=function(e,t){try{i(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),i=r(3070),o=r(5112),a=r(9781),s=o("species");e.exports=function(e){var t=n(e),r=i.f;a&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}},8003:(e,t,r)=>{var n=r(3070).f,i=r(2597),o=r(5112)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!i(e,o)&&n(e,o,{configurable:!0,value:t})}},6200:(e,t,r)=>{var n=r(2309),i=r(9711),o=n("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},5465:(e,t,r)=>{var n=r(7854),i=r(3505),o="__core-js_shared__",a=n[o]||i(o,{});e.exports=a},2309:(e,t,r)=>{var n=r(1913),i=r(5465);(e.exports=function(e,t){return i[e]||(i[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),i=r(9483),o=r(5112)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||null==(r=n(a)[o])?t:i(r)}},3429:(e,t,r)=>{var n=r(7293);e.exports=function(e){return n((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},8710:(e,t,r)=>{var n=r(1702),i=r(9303),o=r(1340),a=r(4488),s=n("".charAt),c=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,r){var n,l,h=o(a(t)),f=i(r),d=h.length;return f<0||f>=d?e?"":void 0:(n=c(h,f))<55296||n>56319||f+1===d||(l=c(h,f+1))<56320||l>57343?e?s(h,f):n:e?u(h,f,f+2):l-56320+(n-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},3111:(e,t,r)=>{var n=r(1702),i=r(4488),o=r(1340),a=r(1361),s=n("".replace),c="["+a+"]",u=RegExp("^"+c+c+"*"),l=RegExp(c+c+"*$"),h=function(e){return function(t){var r=o(i(t));return 1&e&&(r=s(r,u,"")),2&e&&(r=s(r,l,"")),r}};e.exports={start:h(1),end:h(2),trim:h(3)}},261:(e,t,r)=>{var n,i,o,a,s=r(7854),c=r(2104),u=r(9974),l=r(614),h=r(2597),f=r(7293),d=r(490),p=r(206),g=r(317),v=r(6833),A=r(5268),m=s.setImmediate,y=s.clearImmediate,_=s.process,b=s.Dispatch,E=s.Function,w=s.MessageChannel,I=s.String,C=0,S={},T="onreadystatechange";try{n=s.location}catch(e){}var R=function(e){if(h(S,e)){var t=S[e];delete S[e],t()}},k=function(e){return function(){R(e)}},O=function(e){R(e.data)},N=function(e){s.postMessage(I(e),n.protocol+"//"+n.host)};m&&y||(m=function(e){var t=p(arguments,1);return S[++C]=function(){c(l(e)?e:E(e),void 0,t)},i(C),C},y=function(e){delete S[e]},A?i=function(e){_.nextTick(k(e))}:b&&b.now?i=function(e){b.now(k(e))}:w&&!v?(a=(o=new w).port2,o.port1.onmessage=O,i=u(a.postMessage,a)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!f(N)?(i=N,s.addEventListener("message",O,!1)):i=T in g("script")?function(e){d.appendChild(g("script")).onreadystatechange=function(){d.removeChild(this),R(e)}}:function(e){setTimeout(k(e),0)}),e.exports={set:m,clear:y}},1400:(e,t,r)=>{var n=r(9303),i=Math.max,o=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):o(r,t)}},7067:(e,t,r)=>{var n=r(7854),i=r(9303),o=r(7466),a=n.RangeError;e.exports=function(e){if(void 0===e)return 0;var t=i(e),r=o(t);if(t!==r)throw a("Wrong length or index");return r}},5656:(e,t,r)=>{var n=r(8361),i=r(4488);e.exports=function(e){return n(i(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),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},7908:(e,t,r)=>{var n=r(7854),i=r(4488),o=n.Object;e.exports=function(e){return o(i(e))}},4590:(e,t,r)=>{var n=r(7854),i=r(3002),o=n.RangeError;e.exports=function(e,t){var r=i(e);if(r%t)throw o("Wrong offset");return r}},3002:(e,t,r)=>{var n=r(7854),i=r(9303),o=n.RangeError;e.exports=function(e){var t=i(e);if(t<0)throw o("The argument can't be less than 0");return t}},7593:(e,t,r)=>{var n=r(7854),i=r(6916),o=r(111),a=r(2190),s=r(8173),c=r(2140),u=r(5112),l=n.TypeError,h=u("toPrimitive");e.exports=function(e,t){if(!o(e)||a(e))return e;var r,n=s(e,h);if(n){if(void 0===t&&(t="default"),r=i(n,e,t),!o(r)||a(r))return r;throw l("Can't convert object to primitive value")}return void 0===t&&(t="number"),c(e,t)}},4948:(e,t,r)=>{var n=r(7593),i=r(2190);e.exports=function(e){var t=n(e,"string");return i(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),i=r(648),o=n.String;e.exports=function(e){if("Symbol"===i(e))throw TypeError("Cannot convert a Symbol value to a string");return o(e)}},6330:(e,t,r)=>{var n=r(7854).String;e.exports=function(e){try{return n(e)}catch(e){return"Object"}}},9843:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(6916),a=r(9781),s=r(3832),c=r(260),u=r(3331),l=r(5787),h=r(9114),f=r(8880),d=r(5988),p=r(7466),g=r(7067),v=r(4590),A=r(4948),m=r(2597),y=r(648),_=r(111),b=r(2190),E=r(30),w=r(7976),I=r(7674),C=r(8006).f,S=r(7321),T=r(2092).forEach,R=r(6340),k=r(3070),O=r(1236),N=r(9909),x=r(9587),D=N.get,L=N.set,P=k.f,B=O.f,M=Math.round,j=i.RangeError,U=u.ArrayBuffer,F=U.prototype,Q=u.DataView,q=c.NATIVE_ARRAY_BUFFER_VIEWS,G=c.TYPED_ARRAY_CONSTRUCTOR,V=c.TYPED_ARRAY_TAG,K=c.TypedArray,H=c.TypedArrayPrototype,z=c.aTypedArrayConstructor,W=c.isTypedArray,Y="BYTES_PER_ELEMENT",J="Wrong length",X=function(e,t){z(e);for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i},Z=function(e,t){P(e,t,{get:function(){return D(this)[t]}})},$=function(e){var t;return w(F,e)||"ArrayBuffer"==(t=y(e))||"SharedArrayBuffer"==t},ee=function(e,t){return W(e)&&!b(t)&&t in e&&d(+t)&&t>=0},te=function(e,t){return t=A(t),ee(e,t)?h(2,e[t]):B(e,t)},re=function(e,t,r){return t=A(t),!(ee(e,t)&&_(r)&&m(r,"value"))||m(r,"get")||m(r,"set")||r.configurable||m(r,"writable")&&!r.writable||m(r,"enumerable")&&!r.enumerable?P(e,t,r):(e[t]=r.value,e)};a?(q||(O.f=te,k.f=re,Z(H,"buffer"),Z(H,"byteOffset"),Z(H,"byteLength"),Z(H,"length")),n({target:"Object",stat:!0,forced:!q},{getOwnPropertyDescriptor:te,defineProperty:re}),e.exports=function(e,t,r){var a=e.match(/\d+$/)[0]/8,c=e+(r?"Clamped":"")+"Array",u="get"+e,h="set"+e,d=i[c],A=d,m=A&&A.prototype,y={},b=function(e,t){P(e,t,{get:function(){return function(e,t){var r=D(e);return r.view[u](t*a+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var i=D(e);r&&(n=(n=M(n))<0?0:n>255?255:255&n),i.view[h](t*a+i.byteOffset,n,!0)}(this,t,e)},enumerable:!0})};q?s&&(A=t((function(e,t,r,n){return l(e,m),x(_(t)?$(t)?void 0!==n?new d(t,v(r,a),n):void 0!==r?new d(t,v(r,a)):new d(t):W(t)?X(A,t):o(S,A,t):new d(g(t)),e,A)})),I&&I(A,K),T(C(d),(function(e){e in A||f(A,e,d[e])})),A.prototype=m):(A=t((function(e,t,r,n){l(e,m);var i,s,c,u=0,h=0;if(_(t)){if(!$(t))return W(t)?X(A,t):o(S,A,t);i=t,h=v(r,a);var f=t.byteLength;if(void 0===n){if(f%a)throw j(J);if((s=f-h)<0)throw j(J)}else if((s=p(n)*a)+h>f)throw j(J);c=s/a}else c=g(t),i=new U(s=c*a);for(L(e,{buffer:i,byteOffset:h,byteLength:s,length:c,view:new Q(i)});u<c;)b(e,u++)})),I&&I(A,K),m=A.prototype=E(H)),m.constructor!==A&&f(m,"constructor",A),f(m,G,A),V&&f(m,V,c),y[c]=A,n({global:!0,forced:A!=d,sham:!q},y),Y in A||f(A,Y,a),Y in m||f(m,Y,a),R(c)}):e.exports=function(){}},3832:(e,t,r)=>{var n=r(7854),i=r(7293),o=r(7072),a=r(260).NATIVE_ARRAY_BUFFER_VIEWS,s=n.ArrayBuffer,c=n.Int8Array;e.exports=!a||!i((function(){c(1)}))||!i((function(){new c(-1)}))||!o((function(e){new c,new c(null),new c(1.5),new c(e)}),!0)||i((function(){return 1!==new c(new s(2),1,void 0).length}))},3074:(e,t,r)=>{var n=r(7745),i=r(6304);e.exports=function(e,t){return n(i(e),t)}},7321:(e,t,r)=>{var n=r(9974),i=r(6916),o=r(9483),a=r(7908),s=r(6244),c=r(8554),u=r(1246),l=r(7659),h=r(260).aTypedArrayConstructor;e.exports=function(e){var t,r,f,d,p,g,v=o(this),A=a(e),m=arguments.length,y=m>1?arguments[1]:void 0,_=void 0!==y,b=u(A);if(b&&!l(b))for(g=(p=c(A,b)).next,A=[];!(d=i(g,p)).done;)A.push(d.value);for(_&&m>2&&(y=n(y,arguments[2])),r=s(A),f=new(h(v))(r),t=0;r>t;t++)f[t]=_?y(A[t],t):A[t];return f}},6304:(e,t,r)=>{var n=r(260),i=r(6707),o=n.TYPED_ARRAY_CONSTRUCTOR,a=n.aTypedArrayConstructor;e.exports=function(e){return a(i(e,e[o]))}},9711:(e,t,r)=>{var n=r(1702),i=0,o=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+o,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),i=r(2309),o=r(2597),a=r(9711),s=r(133),c=r(3307),u=i("wks"),l=n.Symbol,h=l&&l.for,f=c?l:l&&l.withoutSetter||a;e.exports=function(e){if(!o(u,e)||!s&&"string"!=typeof u[e]){var t="Symbol."+e;s&&o(l,e)?u[e]=l[e]:u[e]=c&&h?h(t):f(t)}return u[e]}},1361:e=>{e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},9575:(e,t,r)=>{"use strict";var n=r(2109),i=r(1702),o=r(7293),a=r(3331),s=r(9670),c=r(1400),u=r(7466),l=r(6707),h=a.ArrayBuffer,f=a.DataView,d=f.prototype,p=i(h.prototype.slice),g=i(d.getUint8),v=i(d.setUint8);n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:o((function(){return!new h(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(p&&void 0===t)return p(s(this),e);for(var r=s(this).byteLength,n=c(e,r),i=c(void 0===t?r:t,r),o=new(l(this,h))(u(i-n)),a=new f(this),d=new f(o),A=0;n<i;)v(d,A++,g(a,n++));return o}})},2222:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(7293),a=r(3157),s=r(111),c=r(7908),u=r(6244),l=r(6135),h=r(5417),f=r(1194),d=r(5112),p=r(7392),g=d("isConcatSpreadable"),v=9007199254740991,A="Maximum allowed index exceeded",m=i.TypeError,y=p>=51||!o((function(){var e=[];return e[g]=!1,e.concat()[0]!==e})),_=f("concat"),b=function(e){if(!s(e))return!1;var t=e[g];return void 0!==t?!!t:a(e)};n({target:"Array",proto:!0,forced:!y||!_},{concat:function(e){var t,r,n,i,o,a=c(this),s=h(a,0),f=0;for(t=-1,n=arguments.length;t<n;t++)if(b(o=-1===t?a:arguments[t])){if(f+(i=u(o))>v)throw m(A);for(r=0;r<i;r++,f++)r in o&&l(s,f,o[r])}else{if(f>=v)throw m(A);l(s,f++,o)}return s.length=f,s}})},3290:(e,t,r)=>{var n=r(2109),i=r(1285),o=r(1223);n({target:"Array",proto:!0},{fill:i}),o("fill")},7327:(e,t,r)=>{"use strict";var n=r(2109),i=r(2092).filter;n({target:"Array",proto:!0,forced:!r(1194)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},9826:(e,t,r)=>{"use strict";var n=r(2109),i=r(2092).find,o=r(1223),a="find",s=!0;a in[]&&Array(1).find((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o(a)},9554:(e,t,r)=>{"use strict";var n=r(2109),i=r(8533);n({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},1038:(e,t,r)=>{var n=r(2109),i=r(8457);n({target:"Array",stat:!0,forced:!r(7072)((function(e){Array.from(e)}))},{from:i})},6699:(e,t,r)=>{"use strict";var n=r(2109),i=r(1318).includes,o=r(1223);n({target:"Array",proto:!0},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},2772:(e,t,r)=>{"use strict";var n=r(2109),i=r(1702),o=r(1318).indexOf,a=r(9341),s=i([].indexOf),c=!!s&&1/s([1],1,-0)<0,u=a("indexOf");n({target:"Array",proto:!0,forced:c||!u},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return c?s(this,e,t)||0:o(this,e,t)}})},9753:(e,t,r)=>{r(2109)({target:"Array",stat:!0},{isArray:r(3157)})},6992:(e,t,r)=>{"use strict";var n=r(5656),i=r(1223),o=r(7497),a=r(9909),s=r(3070).f,c=r(654),u=r(1913),l=r(9781),h="Array Iterator",f=a.set,d=a.getterFor(h);e.exports=c(Array,"Array",(function(e,t){f(this,{type:h,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 p=o.Arguments=o.Array;if(i("keys"),i("values"),i("entries"),!u&&l&&"values"!==p.name)try{s(p,"name",{value:"values"})}catch(e){}},9600:(e,t,r)=>{"use strict";var n=r(2109),i=r(1702),o=r(8361),a=r(5656),s=r(9341),c=i([].join),u=o!=Object,l=s("join",",");n({target:"Array",proto:!0,forced:u||!l},{join:function(e){return c(a(this),void 0===e?",":e)}})},1249:(e,t,r)=>{"use strict";var n=r(2109),i=r(2092).map;n({target:"Array",proto:!0,forced:!r(1194)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},5827:(e,t,r)=>{"use strict";var n=r(2109),i=r(3671).left,o=r(9341),a=r(7392),s=r(5268);n({target:"Array",proto:!0,forced:!o("reduce")||!s&&a>79&&a<83},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},7042:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(3157),a=r(4411),s=r(111),c=r(1400),u=r(6244),l=r(5656),h=r(6135),f=r(5112),d=r(1194),p=r(206),g=d("slice"),v=f("species"),A=i.Array,m=Math.max;n({target:"Array",proto:!0,forced:!g},{slice:function(e,t){var r,n,i,f=l(this),d=u(f),g=c(e,d),y=c(void 0===t?d:t,d);if(o(f)&&(r=f.constructor,(a(r)&&(r===A||o(r.prototype))||s(r)&&null===(r=r[v]))&&(r=void 0),r===A||void 0===r))return p(f,g,y);for(n=new(void 0===r?A:r)(m(y-g,0)),i=0;g<y;g++,i++)g in f&&h(n,i,f[g]);return n.length=i,n}})},2707:(e,t,r)=>{"use strict";var n=r(2109),i=r(1702),o=r(9662),a=r(7908),s=r(6244),c=r(1340),u=r(7293),l=r(4362),h=r(9341),f=r(8886),d=r(256),p=r(7392),g=r(8008),v=[],A=i(v.sort),m=i(v.push),y=u((function(){v.sort(void 0)})),_=u((function(){v.sort(null)})),b=h("sort"),E=!u((function(){if(p)return p<70;if(!(f&&f>3)){if(d)return!0;if(g)return g<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)v.push({k:t+n,v:r})}for(v.sort((function(e,t){return t.v-e.v})),n=0;n<v.length;n++)t=v[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));n({target:"Array",proto:!0,forced:y||!_||!b||!E},{sort:function(e){void 0!==e&&o(e);var t=a(this);if(E)return void 0===e?A(t):A(t,e);var r,n,i=[],u=s(t);for(n=0;n<u;n++)n in t&&m(i,t[n]);for(l(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:c(t)>c(r)?1:-1}}(e)),r=i.length,n=0;n<r;)t[n]=i[n++];for(;n<u;)delete t[n++];return t}})},561:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(1400),a=r(9303),s=r(6244),c=r(7908),u=r(5417),l=r(6135),h=r(1194)("splice"),f=i.TypeError,d=Math.max,p=Math.min,g=9007199254740991,v="Maximum allowed length exceeded";n({target:"Array",proto:!0,forced:!h},{splice:function(e,t){var r,n,i,h,A,m,y=c(this),_=s(y),b=o(e,_),E=arguments.length;if(0===E?r=n=0:1===E?(r=0,n=_-b):(r=E-2,n=p(d(a(t),0),_-b)),_+r-n>g)throw f(v);for(i=u(y,n),h=0;h<n;h++)(A=b+h)in y&&l(i,h,y[A]);if(i.length=n,r<n){for(h=b;h<_-n;h++)m=h+r,(A=h+n)in y?y[m]=y[A]:delete y[m];for(h=_;h>_-n+r;h--)delete y[h-1]}else if(r>n)for(h=_-n;h>b;h--)m=h+r-1,(A=h+n-1)in y?y[m]=y[A]:delete y[m];for(h=0;h<r;h++)y[h+b]=arguments[h+2];return y.length=_-n+r,i}})},3843:(e,t,r)=>{var n=r(2109),i=r(7854),o=r(1702),a=i.Date,s=o(a.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return s(new a)}})},3710:(e,t,r)=>{var n=r(1702),i=r(1320),o=Date.prototype,a="Invalid Date",s="toString",c=n(o.toString),u=n(o.getTime);String(new Date(NaN))!=a&&i(o,s,(function(){var e=u(this);return e==e?c(this):a}))},4812:(e,t,r)=>{r(2109)({target:"Function",proto:!0},{bind:r(7065)})},8309:(e,t,r)=>{var n=r(9781),i=r(6530).EXISTS,o=r(1702),a=r(3070).f,s=Function.prototype,c=o(s.toString),u=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,l=o(u.exec);n&&!i&&a(s,"name",{configurable:!0,get:function(){try{return l(u,c(this))[1]}catch(e){return""}}})},1532:(e,t,r)=>{"use strict";r(7710)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(5631))},9601:(e,t,r)=>{var n=r(2109),i=r(1574);n({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},3321:(e,t,r)=>{var n=r(2109),i=r(9781);n({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperties:r(6048)})},9070:(e,t,r)=>{var n=r(2109),i=r(9781);n({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperty:r(3070).f})},9720:(e,t,r)=>{var n=r(2109),i=r(4699).entries;n({target:"Object",stat:!0},{entries:function(e){return i(e)}})},3371:(e,t,r)=>{var n=r(2109),i=r(6677),o=r(7293),a=r(111),s=r(2423).onFreeze,c=Object.freeze;n({target:"Object",stat:!0,forced:o((function(){c(1)})),sham:!i},{freeze:function(e){return c&&a(e)?c(s(e)):e}})},5003:(e,t,r)=>{var n=r(2109),i=r(7293),o=r(5656),a=r(1236).f,s=r(9781),c=i((function(){a(1)}));n({target:"Object",stat:!0,forced:!s||c,sham:!s},{getOwnPropertyDescriptor:function(e,t){return a(o(e),t)}})},9337:(e,t,r)=>{var n=r(2109),i=r(9781),o=r(3887),a=r(5656),s=r(1236),c=r(6135);n({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,r,n=a(e),i=s.f,u=o(n),l={},h=0;u.length>h;)void 0!==(r=i(n,t=u[h++]))&&c(l,t,r);return l}})},6210:(e,t,r)=>{var n=r(2109),i=r(7293),o=r(1156).f;n({target:"Object",stat:!0,forced:i((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:o})},7941:(e,t,r)=>{var n=r(2109),i=r(7908),o=r(1956);n({target:"Object",stat:!0,forced:r(7293)((function(){o(1)}))},{keys:function(e){return o(i(e))}})},1539:(e,t,r)=>{var n=r(1694),i=r(1320),o=r(288);n||i(Object.prototype,"toString",o,{unsafe:!0})},2479:(e,t,r)=>{var n=r(2109),i=r(4699).values;n({target:"Object",stat:!0},{values:function(e){return i(e)}})},1058:(e,t,r)=>{var n=r(2109),i=r(3009);n({global:!0,forced:parseInt!=i},{parseInt:i})},7727:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(3366),a=r(7293),s=r(5005),c=r(614),u=r(6707),l=r(9478),h=r(1320);if(n({target:"Promise",proto:!0,real:!0,forced:!!o&&a((function(){o.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=u(this,s("Promise")),r=c(e);return this.then(r?function(r){return l(t,e()).then((function(){return r}))}:e,r?function(r){return l(t,e()).then((function(){throw r}))}:e)}}),!i&&c(o)){var f=s("Promise").prototype.finally;o.prototype.finally!==f&&h(o.prototype,"finally",f,{unsafe:!0})}},8674:(e,t,r)=>{"use strict";var n,i,o,a,s=r(2109),c=r(1913),u=r(7854),l=r(5005),h=r(6916),f=r(3366),d=r(1320),p=r(2248),g=r(7674),v=r(8003),A=r(6340),m=r(9662),y=r(614),_=r(111),b=r(5787),E=r(2788),w=r(408),I=r(7072),C=r(6707),S=r(261).set,T=r(5948),R=r(9478),k=r(842),O=r(8523),N=r(2534),x=r(8572),D=r(9909),L=r(4705),P=r(5112),B=r(7871),M=r(5268),j=r(7392),U=P("species"),F="Promise",Q=D.getterFor(F),q=D.set,G=D.getterFor(F),V=f&&f.prototype,K=f,H=V,z=u.TypeError,W=u.document,Y=u.process,J=O.f,X=J,Z=!!(W&&W.createEvent&&u.dispatchEvent),$=y(u.PromiseRejectionEvent),ee="unhandledrejection",te=!1,re=L(F,(function(){var e=E(K),t=e!==String(K);if(!t&&66===j)return!0;if(c&&!H.finally)return!0;if(j>=51&&/native code/.test(e))return!1;var r=new K((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[U]=n,!(te=r.then((function(){}))instanceof n)||!t&&B&&!$})),ne=re||!I((function(e){K.all(e).catch((function(){}))})),ie=function(e){var t;return!(!_(e)||!y(t=e.then))&&t},oe=function(e,t){var r,n,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(a||(2===t.rejection&&le(t),t.rejection=1),!0===s?r=o:(l&&l.enter(),r=s(o),l&&(l.exit(),i=!0)),r===e.promise?u(z("Promise-chain cycle")):(n=ie(r))?h(n,r,c,u):c(r)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},ae=function(e,t){e.notified||(e.notified=!0,T((function(){for(var r,n=e.reactions;r=n.get();)oe(r,e);e.notified=!1,t&&!e.rejection&&ce(e)})))},se=function(e,t,r){var n,i;Z?((n=W.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),u.dispatchEvent(n)):n={promise:t,reason:r},!$&&(i=u["on"+e])?i(n):e===ee&&k("Unhandled promise rejection",r)},ce=function(e){h(S,u,(function(){var t,r=e.facade,n=e.value;if(ue(e)&&(t=N((function(){M?Y.emit("unhandledRejection",n,r):se(ee,r,n)})),e.rejection=M||ue(e)?2:1,t.error))throw t.value}))},ue=function(e){return 1!==e.rejection&&!e.parent},le=function(e){h(S,u,(function(){var t=e.facade;M?Y.emit("rejectionHandled",t):se("rejectionhandled",t,e.value)}))},he=function(e,t,r){return function(n){e(t,n,r)}},fe=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,ae(e,!0))},de=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw z("Promise can't be resolved itself");var n=ie(t);n?T((function(){var r={done:!1};try{h(n,t,he(de,r,e),he(fe,r,e))}catch(t){fe(r,t,e)}})):(e.value=t,e.state=1,ae(e,!1))}catch(t){fe({done:!1},t,e)}}};if(re&&(H=(K=function(e){b(this,H),m(e),h(n,this);var t=Q(this);try{e(he(de,t),he(fe,t))}catch(e){fe(t,e)}}).prototype,(n=function(e){q(this,{type:F,done:!1,notified:!1,parent:!1,reactions:new x,rejection:!1,state:0,value:void 0})}).prototype=p(H,{then:function(e,t){var r=G(this),n=J(C(this,K));return r.parent=!0,n.ok=!y(e)||e,n.fail=y(t)&&t,n.domain=M?Y.domain:void 0,0==r.state?r.reactions.add(n):T((function(){oe(n,r)})),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new n,t=Q(e);this.promise=e,this.resolve=he(de,t),this.reject=he(fe,t)},O.f=J=function(e){return e===K||e===o?new i(e):X(e)},!c&&y(f)&&V!==Object.prototype)){a=V.then,te||(d(V,"then",(function(e,t){var r=this;return new K((function(e,t){h(a,r,e,t)})).then(e,t)}),{unsafe:!0}),d(V,"catch",H.catch,{unsafe:!0}));try{delete V.constructor}catch(e){}g&&g(V,H)}s({global:!0,wrap:!0,forced:re},{Promise:K}),v(K,F,!1,!0),A(F),o=l(F),s({target:F,stat:!0,forced:re},{reject:function(e){var t=J(this);return h(t.reject,void 0,e),t.promise}}),s({target:F,stat:!0,forced:c||re},{resolve:function(e){return R(c&&this===o?K:this,e)}}),s({target:F,stat:!0,forced:ne},{all:function(e){var t=this,r=J(t),n=r.resolve,i=r.reject,o=N((function(){var r=m(t.resolve),o=[],a=0,s=1;w(e,(function(e){var c=a++,u=!1;s++,h(r,t,e).then((function(e){u||(u=!0,o[c]=e,--s||n(o))}),i)})),--s||n(o)}));return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=J(t),n=r.reject,i=N((function(){var i=m(t.resolve);w(e,(function(e){h(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}})},2419:(e,t,r)=>{var n=r(2109),i=r(5005),o=r(2104),a=r(7065),s=r(9483),c=r(9670),u=r(111),l=r(30),h=r(7293),f=i("Reflect","construct"),d=Object.prototype,p=[].push,g=h((function(){function e(){}return!(f((function(){}),[],e)instanceof e)})),v=!h((function(){f((function(){}))})),A=g||v;n({target:"Reflect",stat:!0,forced:A,sham:A},{construct:function(e,t){s(e),c(t);var r=arguments.length<3?e:s(arguments[2]);if(v&&!g)return f(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 o(p,n,t),new(o(a,e,n))}var i=r.prototype,h=l(u(i)?i:d),A=o(e,h,t);return u(A)?A:h}})},4916:(e,t,r)=>{"use strict";var n=r(2109),i=r(2261);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},189:(e,t,r)=>{"use strict";r(7710)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(5631))},2023:(e,t,r)=>{"use strict";var n=r(2109),i=r(1702),o=r(3929),a=r(4488),s=r(1340),c=r(4964),u=i("".indexOf);n({target:"String",proto:!0,forced:!c("includes")},{includes:function(e){return!!~u(s(a(this)),s(o(e)),arguments.length>1?arguments[1]:void 0)}})},8783:(e,t,r)=>{"use strict";var n=r(8710).charAt,i=r(1340),o=r(9909),a=r(654),s="String Iterator",c=o.set,u=o.getterFor(s);a(String,"String",(function(e){c(this,{type:s,string:i(e),index:0})}),(function(){var e,t=u(this),r=t.string,i=t.index;return i>=r.length?{value:void 0,done:!0}:(e=n(r,i),t.index+=e.length,{value:e,done:!1})}))},3123:(e,t,r)=>{"use strict";var n=r(2104),i=r(6916),o=r(1702),a=r(7007),s=r(7850),c=r(9670),u=r(4488),l=r(6707),h=r(1530),f=r(7466),d=r(1340),p=r(8173),g=r(1589),v=r(7651),A=r(2261),m=r(2999),y=r(7293),_=m.UNSUPPORTED_Y,b=4294967295,E=Math.min,w=[].push,I=o(/./.exec),C=o(w),S=o("".slice),T=!y((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));a("split",(function(e,t,r){var o;return o="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var o=d(u(this)),a=void 0===r?b:r>>>0;if(0===a)return[];if(void 0===e)return[o];if(!s(e))return i(t,o,e,a);for(var c,l,h,f=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),v=0,m=new RegExp(e.source,p+"g");(c=i(A,m,o))&&!((l=m.lastIndex)>v&&(C(f,S(o,v,c.index)),c.length>1&&c.index<o.length&&n(w,f,g(c,1)),h=c[0].length,v=l,f.length>=a));)m.lastIndex===c.index&&m.lastIndex++;return v===o.length?!h&&I(m,"")||C(f,""):C(f,S(o,v)),f.length>a?g(f,0,a):f}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:i(t,this,e,r)}:t,[function(t,r){var n=u(this),a=null==t?void 0:p(t,e);return a?i(a,t,n,r):i(o,d(n),t,r)},function(e,n){var i=c(this),a=d(e),s=r(o,i,a,n,o!==t);if(s.done)return s.value;var u=l(i,RegExp),p=i.unicode,g=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(_?"g":"y"),A=new u(_?"^(?:"+i.source+")":i,g),m=void 0===n?b:n>>>0;if(0===m)return[];if(0===a.length)return null===v(A,a)?[a]:[];for(var y=0,w=0,I=[];w<a.length;){A.lastIndex=_?0:w;var T,R=v(A,_?S(a,w):a);if(null===R||(T=E(f(A.lastIndex+(_?w:0)),a.length))===y)w=h(a,w,p);else{if(C(I,S(a,y,w)),I.length===m)return I;for(var k=1;k<=R.length-1;k++)if(C(I,R[k]),I.length===m)return I;w=y=T}}return C(I,S(a,y)),I}]}),!T,_)},86:(e,t,r)=>{"use strict";var n=r(2109),i=r(4230);n({target:"String",proto:!0,forced:r(3429)("sub")},{sub:function(){return i(this,"sub","","")}})},1817:(e,t,r)=>{"use strict";var n=r(2109),i=r(9781),o=r(7854),a=r(1702),s=r(2597),c=r(614),u=r(7976),l=r(1340),h=r(3070).f,f=r(9920),d=o.Symbol,p=d&&d.prototype;if(i&&c(d)&&(!("description"in p)||void 0!==d().description)){var g={},v=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),t=u(p,this)?new d(e):void 0===e?d():d(e);return""===e&&(g[t]=!0),t};f(v,d),v.prototype=p,p.constructor=v;var A="Symbol(test)"==String(d("test")),m=a(p.toString),y=a(p.valueOf),_=/^Symbol\((.*)\)[^)]+$/,b=a("".replace),E=a("".slice);h(p,"description",{configurable:!0,get:function(){var e=y(this),t=m(e);if(s(g,e))return"";var r=A?E(t,7,-1):b(t,_,"$1");return""===r?void 0:r}}),n({global:!0,forced:!0},{Symbol:v})}},2165:(e,t,r)=>{r(7235)("iterator")},2526:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(5005),a=r(2104),s=r(6916),c=r(1702),u=r(1913),l=r(9781),h=r(133),f=r(7293),d=r(2597),p=r(3157),g=r(614),v=r(111),A=r(7976),m=r(2190),y=r(9670),_=r(7908),b=r(5656),E=r(4948),w=r(1340),I=r(9114),C=r(30),S=r(1956),T=r(8006),R=r(1156),k=r(5181),O=r(1236),N=r(3070),x=r(5296),D=r(206),L=r(1320),P=r(2309),B=r(6200),M=r(3501),j=r(9711),U=r(5112),F=r(6061),Q=r(7235),q=r(8003),G=r(9909),V=r(2092).forEach,K=B("hidden"),H="Symbol",z=U("toPrimitive"),W=G.set,Y=G.getterFor(H),J=Object.prototype,X=i.Symbol,Z=X&&X.prototype,$=i.TypeError,ee=i.QObject,te=o("JSON","stringify"),re=O.f,ne=N.f,ie=R.f,oe=x.f,ae=c([].push),se=P("symbols"),ce=P("op-symbols"),ue=P("string-to-symbol-registry"),le=P("symbol-to-string-registry"),he=P("wks"),fe=!ee||!ee.prototype||!ee.prototype.findChild,de=l&&f((function(){return 7!=C(ne({},"a",{get:function(){return ne(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=re(J,t);n&&delete J[t],ne(e,t,r),n&&e!==J&&ne(J,t,n)}:ne,pe=function(e,t){var r=se[e]=C(Z);return W(r,{type:H,tag:e,description:t}),l||(r.description=t),r},ge=function(e,t,r){e===J&&ge(ce,t,r),y(e);var n=E(t);return y(r),d(se,n)?(r.enumerable?(d(e,K)&&e[K][n]&&(e[K][n]=!1),r=C(r,{enumerable:I(0,!1)})):(d(e,K)||ne(e,K,I(1,{})),e[K][n]=!0),de(e,n,r)):ne(e,n,r)},ve=function(e,t){y(e);var r=b(t),n=S(r).concat(_e(r));return V(n,(function(t){l&&!s(Ae,r,t)||ge(e,t,r[t])})),e},Ae=function(e){var t=E(e),r=s(oe,this,t);return!(this===J&&d(se,t)&&!d(ce,t))&&(!(r||!d(this,t)||!d(se,t)||d(this,K)&&this[K][t])||r)},me=function(e,t){var r=b(e),n=E(t);if(r!==J||!d(se,n)||d(ce,n)){var i=re(r,n);return!i||!d(se,n)||d(r,K)&&r[K][n]||(i.enumerable=!0),i}},ye=function(e){var t=ie(b(e)),r=[];return V(t,(function(e){d(se,e)||d(M,e)||ae(r,e)})),r},_e=function(e){var t=e===J,r=ie(t?ce:b(e)),n=[];return V(r,(function(e){!d(se,e)||t&&!d(J,e)||ae(n,se[e])})),n};(h||(X=function(){if(A(Z,this))throw $("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?w(arguments[0]):void 0,t=j(e),r=function(e){this===J&&s(r,ce,e),d(this,K)&&d(this[K],t)&&(this[K][t]=!1),de(this,t,I(1,e))};return l&&fe&&de(J,t,{configurable:!0,set:r}),pe(t,e)},L(Z=X.prototype,"toString",(function(){return Y(this).tag})),L(X,"withoutSetter",(function(e){return pe(j(e),e)})),x.f=Ae,N.f=ge,O.f=me,T.f=R.f=ye,k.f=_e,F.f=function(e){return pe(U(e),e)},l&&(ne(Z,"description",{configurable:!0,get:function(){return Y(this).description}}),u||L(J,"propertyIsEnumerable",Ae,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!h,sham:!h},{Symbol:X}),V(S(he),(function(e){Q(e)})),n({target:H,stat:!0,forced:!h},{for:function(e){var t=w(e);if(d(ue,t))return ue[t];var r=X(t);return ue[t]=r,le[r]=t,r},keyFor:function(e){if(!m(e))throw $(e+" is not a symbol");if(d(le,e))return le[e]},useSetter:function(){fe=!0},useSimple:function(){fe=!1}}),n({target:"Object",stat:!0,forced:!h,sham:!l},{create:function(e,t){return void 0===t?C(e):ve(C(e),t)},defineProperty:ge,defineProperties:ve,getOwnPropertyDescriptor:me}),n({target:"Object",stat:!0,forced:!h},{getOwnPropertyNames:ye,getOwnPropertySymbols:_e}),n({target:"Object",stat:!0,forced:f((function(){k.f(1)}))},{getOwnPropertySymbols:function(e){return k.f(_(e))}}),te)&&n({target:"JSON",stat:!0,forced:!h||f((function(){var e=X();return"[null]"!=te([e])||"{}"!=te({a:e})||"{}"!=te(Object(e))}))},{stringify:function(e,t,r){var n=D(arguments),i=t;if((v(t)||void 0!==e)&&!m(e))return p(t)||(t=function(e,t){if(g(i)&&(t=s(i,this,e,t)),!m(t))return t}),n[1]=t,a(te,null,n)}});if(!Z[z]){var be=Z.valueOf;L(Z,z,(function(e){return s(be,this)}))}q(X,H),M[K]=!0},2990:(e,t,r)=>{"use strict";var n=r(1702),i=r(260),o=n(r(1048)),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("copyWithin",(function(e,t){return o(a(this),e,t,arguments.length>2?arguments[2]:void 0)}))},8927:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).every,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},3105:(e,t,r)=>{"use strict";var n=r(260),i=r(6916),o=r(1285),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("fill",(function(e){var t=arguments.length;return i(o,a(this),e,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}))},5035:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).filter,o=r(3074),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",(function(e){var t=i(a(this),e,arguments.length>1?arguments[1]:void 0);return o(this,t)}))},7174:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).findIndex,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},4345:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).find,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},4197:(e,t,r)=>{r(9843)("Float32",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},2846:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).forEach,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",(function(e){i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},4731:(e,t,r)=>{"use strict";var n=r(260),i=r(1318).includes,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},7209:(e,t,r)=>{"use strict";var n=r(260),i=r(1318).indexOf,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},6319:(e,t,r)=>{"use strict";var n=r(7854),i=r(7293),o=r(1702),a=r(260),s=r(6992),c=r(5112)("iterator"),u=n.Uint8Array,l=o(s.values),h=o(s.keys),f=o(s.entries),d=a.aTypedArray,p=a.exportTypedArrayMethod,g=u&&u.prototype,v=!i((function(){g[c].call([1])})),A=!!g&&g.values&&g[c]===g.values&&"values"===g.values.name,m=function(){return l(d(this))};p("entries",(function(){return f(d(this))}),v),p("keys",(function(){return h(d(this))}),v),p("values",m,v||!A,{name:"values"}),p(c,m,v||!A,{name:"values"})},8867:(e,t,r)=>{"use strict";var n=r(260),i=r(1702),o=n.aTypedArray,a=n.exportTypedArrayMethod,s=i([].join);a("join",(function(e){return s(o(this),e)}))},7789:(e,t,r)=>{"use strict";var n=r(260),i=r(2104),o=r(6583),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return i(o,a(this),t>1?[e,arguments[1]]:[e])}))},3739:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).map,o=r(6304),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("map",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(o(e))(t)}))}))},4483:(e,t,r)=>{"use strict";var n=r(260),i=r(3671).right,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return i(o(this),e,t,t>1?arguments[1]:void 0)}))},9368:(e,t,r)=>{"use strict";var n=r(260),i=r(3671).left,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return i(o(this),e,t,t>1?arguments[1]:void 0)}))},2056:(e,t,r)=>{"use strict";var n=r(260),i=n.aTypedArray,o=n.exportTypedArrayMethod,a=Math.floor;o("reverse",(function(){for(var e,t=this,r=i(t).length,n=a(r/2),o=0;o<n;)e=t[o],t[o++]=t[--r],t[r]=e;return t}))},3462:(e,t,r)=>{"use strict";var n=r(7854),i=r(260),o=r(6244),a=r(4590),s=r(7908),c=r(7293),u=n.RangeError,l=i.aTypedArray;(0,i.exportTypedArrayMethod)("set",(function(e){l(this);var t=a(arguments.length>1?arguments[1]:void 0,1),r=this.length,n=s(e),i=o(n),c=0;if(i+t>r)throw u("Wrong length");for(;c<i;)this[t+c]=n[c++]}),c((function(){new Int8Array(1).set({})})))},678:(e,t,r)=>{"use strict";var n=r(260),i=r(6304),o=r(7293),a=r(206),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("slice",(function(e,t){for(var r=a(s(this),e,t),n=i(this),o=0,c=r.length,u=new n(c);c>o;)u[o]=r[o++];return u}),o((function(){new Int8Array(1).slice()})))},7462:(e,t,r)=>{"use strict";var n=r(260),i=r(2092).some,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}))},3824:(e,t,r)=>{"use strict";var n=r(7854),i=r(1702),o=r(7293),a=r(9662),s=r(4362),c=r(260),u=r(8886),l=r(256),h=r(7392),f=r(8008),d=n.Array,p=c.aTypedArray,g=c.exportTypedArrayMethod,v=n.Uint16Array,A=v&&i(v.prototype.sort),m=!(!A||o((function(){A(new v(2),null)}))&&o((function(){A(new v(2),{})}))),y=!!A&&!o((function(){if(h)return h<74;if(u)return u<67;if(l)return!0;if(f)return f<602;var e,t,r=new v(516),n=d(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(A(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));g("sort",(function(e){return void 0!==e&&a(e),y?A(this,e):s(p(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!y||m)},5021:(e,t,r)=>{"use strict";var n=r(260),i=r(7466),o=r(1400),a=r(6304),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("subarray",(function(e,t){var r=s(this),n=r.length,c=o(e,n);return new(a(r))(r.buffer,r.byteOffset+c*r.BYTES_PER_ELEMENT,i((void 0===t?n:o(t,n))-c))}))},2974:(e,t,r)=>{"use strict";var n=r(7854),i=r(2104),o=r(260),a=r(7293),s=r(206),c=n.Int8Array,u=o.aTypedArray,l=o.exportTypedArrayMethod,h=[].toLocaleString,f=!!c&&a((function(){h.call(new c(1))}));l("toLocaleString",(function(){return i(h,f?s(u(this)):u(this),s(arguments))}),a((function(){return[1,2].toLocaleString()!=new c([1,2]).toLocaleString()}))||!a((function(){c.prototype.toLocaleString.call([1,2])})))},5016:(e,t,r)=>{"use strict";var n=r(260).exportTypedArrayMethod,i=r(7293),o=r(7854),a=r(1702),s=o.Uint8Array,c=s&&s.prototype||{},u=[].toString,l=a([].join);i((function(){u.call({})}))&&(u=function(){return l(this)});var h=c.toString!=u;n("toString",u,h)},4129:(e,t,r)=>{"use strict";var n,i=r(7854),o=r(1702),a=r(2248),s=r(2423),c=r(7710),u=r(9320),l=r(111),h=r(2050),f=r(9909).enforce,d=r(8536),p=!i.ActiveXObject&&"ActiveXObject"in i,g=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},v=c("WeakMap",g,u);if(d&&p){n=u.getConstructor(g,"WeakMap",!0),s.enable();var A=v.prototype,m=o(A.delete),y=o(A.has),_=o(A.get),b=o(A.set);a(A,{delete:function(e){if(l(e)&&!h(e)){var t=f(this);return t.frozen||(t.frozen=new n),m(this,e)||t.frozen.delete(e)}return m(this,e)},has:function(e){if(l(e)&&!h(e)){var t=f(this);return t.frozen||(t.frozen=new n),y(this,e)||t.frozen.has(e)}return y(this,e)},get:function(e){if(l(e)&&!h(e)){var t=f(this);return t.frozen||(t.frozen=new n),y(this,e)?_(this,e):t.frozen.get(e)}return _(this,e)},set:function(e,t){if(l(e)&&!h(e)){var r=f(this);r.frozen||(r.frozen=new n),y(this,e)?b(this,e,t):r.frozen.set(e,t)}else b(this,e,t);return this}})}},8478:(e,t,r)=>{"use strict";r(7710)("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(9320))},72:(e,t,r)=>{"use strict";r(2109)({target:"Map",proto:!0,real:!0,forced:r(1913)},{deleteAll:r(4092)})},9137:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(4647),c=r(408);n({target:"Map",proto:!0,real:!0,forced:i},{every:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return!c(r,(function(e,r,i){if(!n(r,e,t))return i()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},1957:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(9974),s=r(6916),c=r(9662),u=r(9670),l=r(6707),h=r(4647),f=r(408);i({target:"Map",proto:!0,real:!0,forced:n},{filter:function(e){var t=u(this),r=h(t),n=a(e,arguments.length>1?arguments[1]:void 0),i=new(l(t,o("Map"))),d=c(i.set);return f(r,(function(e,r){n(r,e,t)&&s(d,i,e,r)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}})},103:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(4647),c=r(408);n({target:"Map",proto:!0,real:!0,forced:i},{findKey:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return c(r,(function(e,r,i){if(n(r,e,t))return i(e)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},6306:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(4647),c=r(408);n({target:"Map",proto:!0,real:!0,forced:i},{find:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return c(r,(function(e,r,i){if(n(r,e,t))return i(r)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},4592:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(9670),a=r(4647),s=r(6465),c=r(408);i({target:"Map",proto:!0,real:!0,forced:n},{includes:function(e){return c(a(o(this)),(function(t,r,n){if(s(r,e))return n()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},8276:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(4647),s=r(408);n({target:"Map",proto:!0,real:!0,forced:i},{keyOf:function(e){return s(a(o(this)),(function(t,r,n){if(r===e)return n(t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},5082:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(9974),s=r(6916),c=r(9662),u=r(9670),l=r(6707),h=r(4647),f=r(408);i({target:"Map",proto:!0,real:!0,forced:n},{mapKeys:function(e){var t=u(this),r=h(t),n=a(e,arguments.length>1?arguments[1]:void 0),i=new(l(t,o("Map"))),d=c(i.set);return f(r,(function(e,r){s(d,i,n(r,e,t),r)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}})},2813:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(9974),s=r(6916),c=r(9662),u=r(9670),l=r(6707),h=r(4647),f=r(408);i({target:"Map",proto:!0,real:!0,forced:n},{mapValues:function(e){var t=u(this),r=h(t),n=a(e,arguments.length>1?arguments[1]:void 0),i=new(l(t,o("Map"))),d=c(i.set);return f(r,(function(e,r){s(d,i,e,n(r,e,t))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}})},8222:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9662),a=r(9670),s=r(408);n({target:"Map",proto:!0,real:!0,forced:i},{merge:function(e){for(var t=a(this),r=o(t.set),n=arguments.length,i=0;i<n;)s(arguments[i++],r,{that:t,AS_ENTRIES:!0});return t}})},8563:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(1913),a=r(9670),s=r(9662),c=r(4647),u=r(408),l=i.TypeError;n({target:"Map",proto:!0,real:!0,forced:o},{reduce:function(e){var t=a(this),r=c(t),n=arguments.length<2,i=n?void 0:arguments[1];if(s(e),u(r,(function(r,o){n?(n=!1,i=o):i=e(i,o,r,t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),n)throw l("Reduce of empty map with no initial value");return i}})},336:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(4647),c=r(408);n({target:"Map",proto:!0,real:!0,forced:i},{some:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return c(r,(function(e,r,i){if(n(r,e,t))return i()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},7512:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(7854),a=r(6916),s=r(9670),c=r(9662),u=o.TypeError;i({target:"Map",proto:!0,real:!0,forced:n},{update:function(e,t){var r=s(this),n=c(r.get),i=c(r.has),o=c(r.set),l=arguments.length;c(t);var h=a(i,r,e);if(!h&&l<3)throw u("Updating absent value");var f=h?a(n,r,e):c(l>2?arguments[2]:void 0)(e,r);return a(o,r,e,t(f,e,r)),r}})},8921:(e,t,r)=>{"use strict";r(2109)({target:"Set",proto:!0,real:!0,forced:r(1913)},{addAll:r(1501)})},6248:(e,t,r)=>{"use strict";r(2109)({target:"Set",proto:!0,real:!0,forced:r(1913)},{deleteAll:r(4092)})},3599:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(6916),s=r(9662),c=r(9670),u=r(6707),l=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{difference:function(e){var t=c(this),r=new(u(t,o("Set")))(t),n=s(r.delete);return l(e,(function(e){a(n,r,e)})),r}})},1477:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(6767),c=r(408);n({target:"Set",proto:!0,real:!0,forced:i},{every:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return!c(r,(function(e,r){if(!n(e,e,t))return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},3066:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(6916),s=r(9662),c=r(9670),u=r(9974),l=r(6707),h=r(6767),f=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{filter:function(e){var t=c(this),r=h(t),n=u(e,arguments.length>1?arguments[1]:void 0),i=new(l(t,o("Set"))),d=s(i.add);return f(r,(function(e){n(e,e,t)&&a(d,i,e)}),{IS_ITERATOR:!0}),i}})},5389:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(6767),c=r(408);n({target:"Set",proto:!0,real:!0,forced:i},{find:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return c(r,(function(e,r){if(n(e,e,t))return r(e)}),{IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},401:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(6916),s=r(9662),c=r(9670),u=r(6707),l=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{intersection:function(e){var t=c(this),r=new(u(t,o("Set"))),n=s(t.has),i=s(r.add);return l(e,(function(e){a(n,t,e)&&a(i,r,e)})),r}})},5164:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(6916),a=r(9662),s=r(9670),c=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{isDisjointFrom:function(e){var t=s(this),r=a(t.has);return!c(e,(function(e,n){if(!0===o(r,t,e))return n()}),{INTERRUPTED:!0}).stopped}})},1238:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(6916),s=r(9662),c=r(614),u=r(9670),l=r(8554),h=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{isSubsetOf:function(e){var t=l(this),r=u(e),n=r.has;return c(n)||(r=new(o("Set"))(e),n=s(r.has)),!h(t,(function(e,t){if(!1===a(n,r,e))return t()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},4837:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(6916),a=r(9662),s=r(9670),c=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{isSupersetOf:function(e){var t=s(this),r=a(t.has);return!c(e,(function(e,n){if(!1===o(r,t,e))return n()}),{INTERRUPTED:!0}).stopped}})},7485:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(1702),a=r(9670),s=r(1340),c=r(6767),u=r(408),l=o([].join),h=[].push;i({target:"Set",proto:!0,real:!0,forced:n},{join:function(e){var t=a(this),r=c(t),n=void 0===e?",":s(e),i=[];return u(r,h,{that:i,IS_ITERATOR:!0}),l(i,n)}})},465:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(9974),s=r(6916),c=r(9662),u=r(9670),l=r(6707),h=r(6767),f=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{map:function(e){var t=u(this),r=h(t),n=a(e,arguments.length>1?arguments[1]:void 0),i=new(l(t,o("Set"))),d=c(i.add);return f(r,(function(e){s(d,i,n(e,e,t))}),{IS_ITERATOR:!0}),i}})},6651:(e,t,r)=>{"use strict";var n=r(2109),i=r(7854),o=r(1913),a=r(9662),s=r(9670),c=r(6767),u=r(408),l=i.TypeError;n({target:"Set",proto:!0,real:!0,forced:o},{reduce:function(e){var t=s(this),r=c(t),n=arguments.length<2,i=n?void 0:arguments[1];if(a(e),u(r,(function(r){n?(n=!1,i=r):i=e(i,r,r,t)}),{IS_ITERATOR:!0}),n)throw l("Reduce of empty set with no initial value");return i}})},1437:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(9670),a=r(9974),s=r(6767),c=r(408);n({target:"Set",proto:!0,real:!0,forced:i},{some:function(e){var t=o(this),r=s(t),n=a(e,arguments.length>1?arguments[1]:void 0);return c(r,(function(e,r){if(n(e,e,t))return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},5285:(e,t,r)=>{"use strict";var n=r(1913),i=r(2109),o=r(5005),a=r(6916),s=r(9662),c=r(9670),u=r(6707),l=r(408);i({target:"Set",proto:!0,real:!0,forced:n},{symmetricDifference:function(e){var t=c(this),r=new(u(t,o("Set")))(t),n=s(r.delete),i=s(r.add);return l(e,(function(e){a(n,r,e)||a(i,r,e)})),r}})},9865:(e,t,r)=>{"use strict";var n=r(2109),i=r(1913),o=r(5005),a=r(9662),s=r(9670),c=r(6707),u=r(408);n({target:"Set",proto:!0,real:!0,forced:i},{union:function(e){var t=s(this),r=new(c(t,o("Set")))(t);return u(e,a(r.add),{that:r}),r}})},8206:(e,t,r)=>{"use strict";r(2109)({target:"WeakMap",proto:!0,real:!0,forced:r(1913)},{deleteAll:r(4092)})},3561:(e,t,r)=>{"use strict";r(2109)({target:"WeakSet",proto:!0,real:!0,forced:r(1913)},{addAll:r(1501)})},2049:(e,t,r)=>{"use strict";r(2109)({target:"WeakSet",proto:!0,real:!0,forced:r(1913)},{deleteAll:r(4092)})},4747:(e,t,r)=>{var n=r(7854),i=r(8324),o=r(8509),a=r(8533),s=r(8880),c=function(e){if(e&&e.forEach!==a)try{s(e,"forEach",a)}catch(t){e.forEach=a}};for(var u in i)i[u]&&c(n[u]&&n[u].prototype);c(o)},3948:(e,t,r)=>{var n=r(7854),i=r(8324),o=r(8509),a=r(6992),s=r(8880),c=r(5112),u=c("iterator"),l=c("toStringTag"),h=a.values,f=function(e,t){if(e){if(e[u]!==h)try{s(e,u,h)}catch(t){e[u]=h}if(e[l]||s(e,l,t),i[t])for(var r in a)if(e[r]!==a[r])try{s(e,r,a[r])}catch(t){e[r]=a[r]}}};for(var d in i)f(n[d]&&n[d].prototype,d);f(o,"DOMTokenList")},2564:(e,t,r)=>{var n=r(2109),i=r(7854),o=r(2104),a=r(614),s=r(8113),c=r(206),u=/MSIE .\./.test(s),l=i.Function,h=function(e){return function(t,r){var n=arguments.length>2,i=n?c(arguments,2):void 0;return e(n?function(){o(a(t)?t:l(t),this,i)}:t,r)}};n({global:!0,bind:!0,forced:u},{setTimeout:h(i.setTimeout),setInterval:h(i.setInterval)})},5455:e=>{"use strict";e.exports=require("agora-electron-sdk")},5760:e=>{"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__5760__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.amdO={},__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),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})();var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AGError:()=>Bn,AGErrorWrapper:()=>Mn,AGEventEmitter:()=>y,AGMediaEncryptionMode:()=>bu,AGNetworkQuality:()=>Au,AGRenderMode:()=>wu,AGRtcConnectionType:()=>lu,AGRteErrorCode:()=>kn,AGRteTrackErrorReason:()=>mu,AGScreenShareType:()=>Eu,AbstractErrorCenter:()=>Pn,ActionWhenTaskFail:()=>$u,AgoraChatMessage:()=>Sc,AgoraMediaControl:()=>el,AgoraMediaControlEventType:()=>Ju,AgoraRCEventType:()=>Ph,AgoraRCRole:()=>Lh,AgoraRegion:()=>Dn,AgoraRoom:()=>Cc,AgoraRtcLocalVideoCanvas:()=>ql,AgoraRtcVideoCanvas:()=>Ql,AgoraRteAudioSourceType:()=>ru,AgoraRteCameraVideoTrack:()=>fu,AgoraRteConnectionState:()=>Qu,AgoraRteEngine:()=>Vh,AgoraRteEngineConfig:()=>Qn,AgoraRteEventType:()=>bc,AgoraRteLogLevel:()=>On,AgoraRteMediaPublishState:()=>nu,AgoraRteMediaSourceState:()=>yu,AgoraRteMediaTrack:()=>hu,AgoraRteMicrophoneAudioTrack:()=>du,AgoraRteRemoteStreamType:()=>Cu,AgoraRteRuntimePlatform:()=>Nn,AgoraRteScene:()=>Xu,AgoraRteScreenShareTrack:()=>pu,AgoraRteThread:()=>bl,AgoraRteVideoSourceType:()=>tu,AgoraStream:()=>Ic,AgoraUser:()=>wc,ApiBase:()=>Kc,Duration:()=>il,LighteningLevel:()=>Iu,Lodash:()=>vu,Log:()=>Zn,Logger:()=>yn,RtcState:()=>_u,RteLanguage:()=>xn,Scheduler:()=>e,bound:()=>su,retryAttempt:()=>Lu});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{Duration:()=>il,createScheduler:()=>al,shared:()=>sl});__webpack_require__(2419);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function r(e,r){if(e){if("string"==typeof e)return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void 0}}function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}(e,t)||r(e,t)||function(){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 i(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function s(e){i(a,n,o,s,c,"next",e)}function c(e){i(a,n,o,s,c,"throw",e)}s(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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,n.key,n)}}function c(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function l(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&&u(e,t)}function h(e){return h="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},h(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}var g=__webpack_require__(7162),v=__webpack_require__.n(g);__webpack_require__(2222),__webpack_require__(7042),__webpack_require__(8309),__webpack_require__(1038),__webpack_require__(2526),__webpack_require__(1817),__webpack_require__(2165),__webpack_require__(9753),__webpack_require__(6992),__webpack_require__(1532),__webpack_require__(1539),__webpack_require__(8783),__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__(3948),__webpack_require__(7327);function A(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var y=function(){function e(){a(this,e),this._eventMap=new Map}return c(e,[{key:"once",value:function(e,t){var r=this;return this.on(e,(function n(){r.off(e,n),t.apply(void 0,arguments)})),this}},{key:"on",value:function(e,t){var r,n=null!==(r=this._eventMap.get(e))&&void 0!==r?r:[];return n.push(t),this._eventMap.set(e,n),this}},{key:"off",value:function(e,t){var r=this._eventMap.get(e);return r&&this._eventMap.set(e,r.filter((function(e){return e!==t}))),this}},{key:"removeAllEventListeners",value:function(){this._eventMap.clear()}},{key:"emit",value:function(e){for(var t,r=null!==(t=this._eventMap.get(e))&&void 0!==t?t:[],n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];var a,s=A(r);try{for(s.s();!(a=s.n()).done;){var c=a.value;try{c&&c.apply(void 0,i)}catch(t){var u=t,l=u.stack||u.message;console.error("[event] handling event ".concat(e," fail: ").concat(l))}}}catch(e){s.e(e)}finally{s.f()}return this}}]),e}();__webpack_require__(7941),__webpack_require__(5003),__webpack_require__(9554),__webpack_require__(4747),__webpack_require__(9337),__webpack_require__(3321),__webpack_require__(9070);function _(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}__webpack_require__(2772);function b(){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}}function E(e,t,r){return E=b()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&u(i,r.prototype),i},E.apply(null,arguments)}function w(e){var t="function"==typeof Map?new Map:void 0;return w=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return E(e,arguments,p(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)},w(e)}__webpack_require__(6699),__webpack_require__(2023),__webpack_require__(3843),__webpack_require__(3710),__webpack_require__(8674),__webpack_require__(9600);var I=__webpack_require__(5760),C=__webpack_require__.n(I),S=__webpack_require__(6635),T=__webpack_require__(1005),R=__webpack_require__.n(T);function k(){return R()('(()=>{var t={7162:(t,e,n)=>{t.exports=n(5047)},857:(t,e,n)=>{var r=n(7772).Symbol;t.exports=r},3366:(t,e,n)=>{var r=n(857),o=n(2107),i=n(7157),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},1704:(t,e,n)=>{var r=n(2153),o=/^\\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(o,""):t}},1242:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},2107:(t,e,n)=>{var r=n(857),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[u]=n:delete t[u]),o}},7157:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},7772:(t,e,n)=>{var r=n(1242),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},2153:t=>{var e=/\\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},4073:(t,e,n)=>{var r=n(9259),o=n(1100),i=n(7642),a=Math.max,u=Math.min;t.exports=function(t,e,n){var c,s,f,l,h,p,d=0,v=!1,y=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var n=c,r=s;return c=s=void 0,d=e,l=t.apply(r,n)}function b(t){return d=t,h=setTimeout(_,e),v?g(t):l}function w(t){var n=t-p;return void 0===p||n>=e||n<0||y&&t-d>=f}function _(){var t=o();if(w(t))return x(t);h=setTimeout(_,function(t){var n=e-(t-p);return y?u(n,f-(t-d)):n}(t))}function x(t){return h=void 0,m&&c?g(t):(c=s=void 0,l)}function k(){var t=o(),n=w(t);if(c=arguments,s=this,p=t,n){if(void 0===h)return b(p);if(y)return clearTimeout(h),h=setTimeout(_,e),g(p)}return void 0===h&&(h=setTimeout(_,e)),l}return e=i(e)||0,r(n)&&(v=!!n.leading,f=(y="maxWait"in n)?a(i(n.maxWait)||0,e):f,m="trailing"in n?!!n.trailing:m),k.cancel=function(){void 0!==h&&clearTimeout(h),d=0,c=p=s=h=void 0},k.flush=function(){return void 0===h?l:x(o())},k}},9259:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},5125:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},4795:(t,e,n)=>{var r=n(3366),o=n(5125);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},1100:(t,e,n)=>{var r=n(7772);t.exports=function(){return r.Date.now()}},7642:(t,e,n)=>{var r=n(1704),o=n(9259),i=n(4795),a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=u.test(t);return n||c.test(t)?s(t.slice(2),n?2:8):a.test(t)?NaN:+t}},5047:t=>{var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new S(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===d){if("throw"===o)throw i;return A()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=j(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=f(t,e,n);if("normal"===c.type){if(r=n.done?d:h,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=d,n.method="throw",n.arg=c.arg)}}}(t,n,a),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l="suspendedStart",h="suspendedYield",p="executing",d="completed",v={};function y(){}function m(){}function g(){}var b={};c(b,i,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(T([])));_&&_!==n&&r.call(_,i)&&(b=_);var x=g.prototype=y.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function j(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,j(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a \'throw\' method")}return v}var o=f(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function T(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:A}}function A(){return{value:e,done:!0}}return m.prototype=g,c(x,"constructor",g),c(g,"constructor",m),m.displayName=c(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},k(O.prototype),c(O.prototype,a,(function(){return this})),t.AsyncIterator=O,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new O(s(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(x),c(x,u,"Generator"),c(x,i,(function(){return this})),c(x,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=T,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return u.type="throw",u.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){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"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:T(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},9662:(t,e,n)=>{var r=n(7854),o=n(614),i=n(6330),a=r.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not a function")}},9483:(t,e,n)=>{var r=n(7854),o=n(4411),i=n(6330),a=r.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not a constructor")}},6077:(t,e,n)=>{var r=n(7854),o=n(614),i=r.String,a=r.TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw a("Can\'t set "+i(t)+" as a prototype")}},5787:(t,e,n)=>{var r=n(7854),o=n(7976),i=r.TypeError;t.exports=function(t,e){if(o(e,t))return t;throw i("Incorrect invocation")}},9670:(t,e,n)=>{var r=n(7854),o=n(111),i=r.String,a=r.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not an object")}},1318:(t,e,n)=>{var r=n(5656),o=n(1400),i=n(6244),a=function(t){return function(e,n,a){var u,c=r(e),s=i(c),f=o(a,s);if(t&&n!=n){for(;s>f;)if((u=c[f++])!=u)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},1194:(t,e,n)=>{var r=n(7293),o=n(5112),i=n(7392),a=o("species");t.exports=function(t){return i>=51||!r((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},206:(t,e,n)=>{var r=n(1702);t.exports=r([].slice)},7475:(t,e,n)=>{var r=n(7854),o=n(3157),i=n(4411),a=n(111),u=n(5112)("species"),c=r.Array;t.exports=function(t){var e;return o(t)&&(e=t.constructor,(i(e)&&(e===c||o(e.prototype))||a(e)&&null===(e=e[u]))&&(e=void 0)),void 0===e?c:e}},5417:(t,e,n)=>{var r=n(7475);t.exports=function(t,e){return new(r(t))(0===e?0:e)}},7072:(t,e,n)=>{var r=n(5112)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}},4326:(t,e,n)=>{var r=n(1702),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},648:(t,e,n)=>{var r=n(7854),o=n(1694),i=n(614),a=n(4326),u=n(5112)("toStringTag"),c=r.Object,s="Arguments"==a(function(){return arguments}());t.exports=o?a:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=c(t),u))?n:s?a(e):"Object"==(r=a(e))&&i(e.callee)?"Arguments":r}},9920:(t,e,n)=>{var r=n(2597),o=n(3887),i=n(1236),a=n(3070);t.exports=function(t,e,n){for(var u=o(e),c=a.f,s=i.f,f=0;f<u.length;f++){var l=u[f];r(t,l)||n&&r(n,l)||c(t,l,s(e,l))}}},8880:(t,e,n)=>{var r=n(9781),o=n(3070),i=n(9114);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},9114:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6135:(t,e,n)=>{"use strict";var r=n(4948),o=n(3070),i=n(9114);t.exports=function(t,e,n){var a=r(e);a in t?o.f(t,a,i(0,n)):t[a]=n}},9781:(t,e,n)=>{var r=n(7293);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(t,e,n)=>{var r=n(7854),o=n(111),i=r.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},7871:t=>{t.exports="object"==typeof window},1528:(t,e,n)=>{var r=n(8113),o=n(7854);t.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==o.Pebble},6833:(t,e,n)=>{var r=n(8113);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},5268:(t,e,n)=>{var r=n(4326),o=n(7854);t.exports="process"==r(o.process)},1036:(t,e,n)=>{var r=n(8113);t.exports=/web0s(?!.*chrome)/i.test(r)},8113:(t,e,n)=>{var r=n(5005);t.exports=r("navigator","userAgent")||""},7392:(t,e,n)=>{var r,o,i=n(7854),a=n(8113),u=i.process,c=i.Deno,s=u&&u.versions||c&&c.version,f=s&&s.v8;f&&(o=(r=f.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\\/(\\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\\/(\\d+)/))&&(o=+r[1]),t.exports=o},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(t,e,n)=>{var r=n(7854),o=n(1236).f,i=n(8880),a=n(1320),u=n(3505),c=n(9920),s=n(4705);t.exports=function(t,e){var n,f,l,h,p,d=t.target,v=t.global,y=t.stat;if(n=v?r:y?r[d]||u(d,{}):(r[d]||{}).prototype)for(f in e){if(h=e[f],l=t.noTargetGet?(p=o(n,f))&&p.value:n[f],!s(v?f:d+(y?".":"#")+f,t.forced)&&void 0!==l){if(typeof h==typeof l)continue;c(h,l)}(t.sham||l&&l.sham)&&i(h,"sham",!0),a(n,f,h,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},2104:t=>{var e=Function.prototype,n=e.apply,r=e.bind,o=e.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?o.bind(n):function(){return o.apply(n,arguments)})},9974:(t,e,n)=>{var r=n(1702),o=n(9662),i=r(r.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?i(t,e):function(){return t.apply(e,arguments)}}},7065:(t,e,n)=>{"use strict";var r=n(7854),o=n(1702),i=n(9662),a=n(111),u=n(2597),c=n(206),s=r.Function,f=o([].concat),l=o([].join),h={},p=function(t,e,n){if(!u(h,e)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";h[e]=s("C,a","return new C("+l(r,",")+")")}return h[e](t,n)};t.exports=s.bind||function(t){var e=i(this),n=e.prototype,r=c(arguments,1),o=function(){var n=f(r,c(arguments));return this instanceof o?p(e,n.length,n):e.apply(t,n)};return a(n)&&(o.prototype=n),o}},6916:t=>{var e=Function.prototype.call;t.exports=e.bind?e.bind(e):function(){return e.apply(e,arguments)}},6530:(t,e,n)=>{var r=n(9781),o=n(2597),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,u=o(i,"name"),c=u&&"something"===function(){}.name,s=u&&(!r||r&&a(i,"name").configurable);t.exports={EXISTS:u,PROPER:c,CONFIGURABLE:s}},1702:t=>{var e=Function.prototype,n=e.bind,r=e.call,o=n&&n.bind(r);t.exports=n?function(t){return t&&o(r,t)}:function(t){return t&&function(){return r.apply(t,arguments)}}},5005:(t,e,n)=>{var r=n(7854),o=n(614),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},1246:(t,e,n)=>{var r=n(648),o=n(8173),i=n(7497),a=n(5112)("iterator");t.exports=function(t){if(null!=t)return o(t,a)||o(t,"@@iterator")||i[r(t)]}},8554:(t,e,n)=>{var r=n(7854),o=n(6916),i=n(9662),a=n(9670),u=n(6330),c=n(1246),s=r.TypeError;t.exports=function(t,e){var n=arguments.length<2?c(t):e;if(i(n))return a(o(n,t));throw s(u(t)+" is not iterable")}},8173:(t,e,n)=>{var r=n(9662);t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},7854:(t,e,n)=>{var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},2597:(t,e,n)=>{var r=n(1702),o=n(7908),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},3501:t=>{t.exports={}},842:(t,e,n)=>{var r=n(7854);t.exports=function(t,e){var n=r.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))}},490:(t,e,n)=>{var r=n(5005);t.exports=r("document","documentElement")},4664:(t,e,n)=>{var r=n(9781),o=n(7293),i=n(317);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(t,e,n)=>{var r=n(7854),o=n(1702),i=n(7293),a=n(4326),u=r.Object,c=o("".split);t.exports=i((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?c(t,""):u(t)}:u},2788:(t,e,n)=>{var r=n(1702),o=n(614),i=n(5465),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},9909:(t,e,n)=>{var r,o,i,a=n(8536),u=n(7854),c=n(1702),s=n(111),f=n(8880),l=n(2597),h=n(5465),p=n(6200),d=n(3501),v="Object already initialized",y=u.TypeError,m=u.WeakMap;if(a||h.state){var g=h.state||(h.state=new m),b=c(g.get),w=c(g.has),_=c(g.set);r=function(t,e){if(w(g,t))throw new y(v);return e.facade=t,_(g,t,e),e},o=function(t){return b(g,t)||{}},i=function(t){return w(g,t)}}else{var x=p("state");d[x]=!0,r=function(t,e){if(l(t,x))throw new y(v);return e.facade=t,f(t,x,e),e},o=function(t){return l(t,x)?t[x]:{}},i=function(t){return l(t,x)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!s(e)||(n=o(e)).type!==t)throw y("Incompatible receiver, "+t+" required");return n}}}},7659:(t,e,n)=>{var r=n(5112),o=n(7497),i=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},3157:(t,e,n)=>{var r=n(4326);t.exports=Array.isArray||function(t){return"Array"==r(t)}},614:t=>{t.exports=function(t){return"function"==typeof t}},4411:(t,e,n)=>{var r=n(1702),o=n(7293),i=n(614),a=n(648),u=n(5005),c=n(2788),s=function(){},f=[],l=u("Reflect","construct"),h=/^\\s*(?:class|function)\\b/,p=r(h.exec),d=!h.exec(s),v=function(t){if(!i(t))return!1;try{return l(s,f,t),!0}catch(t){return!1}},y=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!p(h,c(t))}catch(t){return!0}};y.sham=!0,t.exports=!l||o((function(){var t;return v(v.call)||!v(Object)||!v((function(){t=!0}))||t}))?y:v},4705:(t,e,n)=>{var r=n(7293),o=n(614),i=/#|\\.prototype\\./,a=function(t,e){var n=c[u(t)];return n==f||n!=s&&(o(e)?r(e):!!e)},u=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=a.data={},s=a.NATIVE="N",f=a.POLYFILL="P";t.exports=a},111:(t,e,n)=>{var r=n(614);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},1913:t=>{t.exports=!1},2190:(t,e,n)=>{var r=n(7854),o=n(5005),i=n(614),a=n(7976),u=n(3307),c=r.Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return i(e)&&a(e.prototype,c(t))}},408:(t,e,n)=>{var r=n(7854),o=n(9974),i=n(6916),a=n(9670),u=n(6330),c=n(7659),s=n(6244),f=n(7976),l=n(8554),h=n(1246),p=n(9212),d=r.TypeError,v=function(t,e){this.stopped=t,this.result=e},y=v.prototype;t.exports=function(t,e,n){var r,m,g,b,w,_,x,k=n&&n.that,O=!(!n||!n.AS_ENTRIES),j=!(!n||!n.IS_ITERATOR),E=!(!n||!n.INTERRUPTED),P=o(e,k),S=function(t){return r&&p(r,"normal",t),new v(!0,t)},T=function(t){return O?(a(t),E?P(t[0],t[1],S):P(t[0],t[1])):E?P(t,S):P(t)};if(j)r=t;else{if(!(m=h(t)))throw d(u(t)+" is not iterable");if(c(m)){for(g=0,b=s(t);b>g;g++)if((w=T(t[g]))&&f(y,w))return w;return new v(!1)}r=l(t,m)}for(_=r.next;!(x=i(_,r)).done;){try{w=T(x.value)}catch(t){p(r,"throw",t)}if("object"==typeof w&&w&&f(y,w))return w}return new v(!1)}},9212:(t,e,n)=>{var r=n(6916),o=n(9670),i=n(8173);t.exports=function(t,e,n){var a,u;o(t);try{if(!(a=i(t,"return"))){if("throw"===e)throw n;return n}a=r(a,t)}catch(t){u=!0,a=t}if("throw"===e)throw n;if(u)throw a;return o(a),n}},7497:t=>{t.exports={}},6244:(t,e,n)=>{var r=n(7466);t.exports=function(t){return r(t.length)}},5948:(t,e,n)=>{var r,o,i,a,u,c,s,f,l=n(7854),h=n(9974),p=n(1236).f,d=n(261).set,v=n(6833),y=n(1528),m=n(1036),g=n(5268),b=l.MutationObserver||l.WebKitMutationObserver,w=l.document,_=l.process,x=l.Promise,k=p(l,"queueMicrotask"),O=k&&k.value;O||(r=function(){var t,e;for(g&&(t=_.domain)&&t.exit();o;){e=o.fn,o=o.next;try{e()}catch(t){throw o?a():i=void 0,t}}i=void 0,t&&t.enter()},v||g||m||!b||!w?!y&&x&&x.resolve?((s=x.resolve(void 0)).constructor=x,f=h(s.then,s),a=function(){f(r)}):g?a=function(){_.nextTick(r)}:(d=h(d,l),a=function(){d(r)}):(u=!0,c=w.createTextNode(""),new b(r).observe(c,{characterData:!0}),a=function(){c.data=u=!u})),t.exports=O||function(t){var e={fn:t,next:void 0};i&&(i.next=e),o||(o=e,a()),i=e}},1070:(t,e,n)=>{var r=n(7854);t.exports=r.Promise},133:(t,e,n)=>{var r=n(7392),o=n(7293);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8536:(t,e,n)=>{var r=n(7854),o=n(614),i=n(2788),a=r.WeakMap;t.exports=o(a)&&/native code/.test(i(a))},8523:(t,e,n)=>{"use strict";var r=n(9662),o=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},30:(t,e,n)=>{var r,o=n(9670),i=n(6048),a=n(748),u=n(3501),c=n(490),s=n(317),f=n(6200),l=f("IE_PROTO"),h=function(){},p=function(t){return"<script>"+t+"</"+"script>"},d=function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;v="undefined"!=typeof document?document.domain&&r?d(r):((e=s("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F):d(r);for(var n=a.length;n--;)delete v.prototype[a[n]];return v()};u[l]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h.prototype=o(t),n=new h,h.prototype=null,n[l]=t):n=v(),void 0===e?n:i(n,e)}},6048:(t,e,n)=>{var r=n(9781),o=n(3070),i=n(9670),a=n(5656),u=n(1956);t.exports=r?Object.defineProperties:function(t,e){i(t);for(var n,r=a(e),c=u(e),s=c.length,f=0;s>f;)o.f(t,n=c[f++],r[n]);return t}},3070:(t,e,n)=>{var r=n(7854),o=n(9781),i=n(4664),a=n(9670),u=n(4948),c=r.TypeError,s=Object.defineProperty;e.f=o?s:function(t,e,n){if(a(t),e=u(e),a(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},1236:(t,e,n)=>{var r=n(9781),o=n(6916),i=n(5296),a=n(9114),u=n(5656),c=n(4948),s=n(2597),f=n(4664),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=u(t),e=c(e),f)try{return l(t,e)}catch(t){}if(s(t,e))return a(!o(i.f,t,e),t[e])}},8006:(t,e,n)=>{var r=n(6324),o=n(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},5181:(t,e)=>{e.f=Object.getOwnPropertySymbols},7976:(t,e,n)=>{var r=n(1702);t.exports=r({}.isPrototypeOf)},6324:(t,e,n)=>{var r=n(1702),o=n(2597),i=n(5656),a=n(1318).indexOf,u=n(3501),c=r([].push);t.exports=function(t,e){var n,r=i(t),s=0,f=[];for(n in r)!o(u,n)&&o(r,n)&&c(f,n);for(;e.length>s;)o(r,n=e[s++])&&(~a(f,n)||c(f,n));return f}},1956:(t,e,n)=>{var r=n(6324),o=n(748);t.exports=Object.keys||function(t){return r(t,o)}},5296:(t,e)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},7674:(t,e,n)=>{var r=n(1702),o=n(9670),i=n(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return o(n),i(r),e?t(n,r):n.__proto__=r,n}}():void 0)},288:(t,e,n)=>{"use strict";var r=n(1694),o=n(648);t.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},2140:(t,e,n)=>{var r=n(7854),o=n(6916),i=n(614),a=n(111),u=r.TypeError;t.exports=function(t,e){var n,r;if("string"===e&&i(n=t.toString)&&!a(r=o(n,t)))return r;if(i(n=t.valueOf)&&!a(r=o(n,t)))return r;if("string"!==e&&i(n=t.toString)&&!a(r=o(n,t)))return r;throw u("Can\'t convert object to primitive value")}},3887:(t,e,n)=>{var r=n(5005),o=n(1702),i=n(8006),a=n(5181),u=n(9670),c=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(u(t)),n=a.f;return n?c(e,n(t)):e}},2534:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},9478:(t,e,n)=>{var r=n(9670),o=n(111),i=n(8523);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},8572:t=>{var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=e},2248:(t,e,n)=>{var r=n(1320);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},1320:(t,e,n)=>{var r=n(7854),o=n(614),i=n(2597),a=n(8880),u=n(3505),c=n(2788),s=n(9909),f=n(6530).CONFIGURABLE,l=s.get,h=s.enforce,p=String(String).split("String");(t.exports=function(t,e,n,c){var s,l=!!c&&!!c.unsafe,d=!!c&&!!c.enumerable,v=!!c&&!!c.noTargetGet,y=c&&void 0!==c.name?c.name:e;o(n)&&("Symbol("===String(y).slice(0,7)&&(y="["+String(y).replace(/^Symbol\\(([^)]*)\\)/,"$1")+"]"),(!i(n,"name")||f&&n.name!==y)&&a(n,"name",y),(s=h(n)).source||(s.source=p.join("string"==typeof y?y:""))),t!==r?(l?!v&&t[e]&&(d=!0):delete t[e],d?t[e]=n:a(t,e,n)):d?t[e]=n:u(e,n)})(Function.prototype,"toString",(function(){return o(this)&&l(this).source||c(this)}))},4488:(t,e,n)=>{var r=n(7854).TypeError;t.exports=function(t){if(null==t)throw r("Can\'t call method on "+t);return t}},3505:(t,e,n)=>{var r=n(7854),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},6340:(t,e,n)=>{"use strict";var r=n(5005),o=n(3070),i=n(5112),a=n(9781),u=i("species");t.exports=function(t){var e=r(t),n=o.f;a&&e&&!e[u]&&n(e,u,{configurable:!0,get:function(){return this}})}},8003:(t,e,n)=>{var r=n(3070).f,o=n(2597),i=n(5112)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&r(t,i,{configurable:!0,value:e})}},6200:(t,e,n)=>{var r=n(2309),o=n(9711),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:(t,e,n)=>{var r=n(7854),o=n(3505),i="__core-js_shared__",a=r[i]||o(i,{});t.exports=a},2309:(t,e,n)=>{var r=n(1913),o=n(5465);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.20.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},6707:(t,e,n)=>{var r=n(9670),o=n(9483),i=n(5112)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[i])?e:o(n)}},261:(t,e,n)=>{var r,o,i,a,u=n(7854),c=n(2104),s=n(9974),f=n(614),l=n(2597),h=n(7293),p=n(490),d=n(206),v=n(317),y=n(6833),m=n(5268),g=u.setImmediate,b=u.clearImmediate,w=u.process,_=u.Dispatch,x=u.Function,k=u.MessageChannel,O=u.String,j=0,E={},P="onreadystatechange";try{r=u.location}catch(t){}var S=function(t){if(l(E,t)){var e=E[t];delete E[t],e()}},T=function(t){return function(){S(t)}},A=function(t){S(t.data)},C=function(t){u.postMessage(O(t),r.protocol+"//"+r.host)};g&&b||(g=function(t){var e=d(arguments,1);return E[++j]=function(){c(f(t)?t:x(t),void 0,e)},o(j),j},b=function(t){delete E[t]},m?o=function(t){w.nextTick(T(t))}:_&&_.now?o=function(t){_.now(T(t))}:k&&!y?(a=(i=new k).port2,i.port1.onmessage=A,o=s(a.postMessage,a)):u.addEventListener&&f(u.postMessage)&&!u.importScripts&&r&&"file:"!==r.protocol&&!h(C)?(o=C,u.addEventListener("message",A,!1)):o=P in v("script")?function(t){p.appendChild(v("script")).onreadystatechange=function(){p.removeChild(this),S(t)}}:function(t){setTimeout(T(t),0)}),t.exports={set:g,clear:b}},1400:(t,e,n)=>{var r=n(9303),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},5656:(t,e,n)=>{var r=n(8361),o=n(4488);t.exports=function(t){return r(o(t))}},9303:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){var r=+t;return r!=r||0===r?0:(r>0?n:e)(r)}},7466:(t,e,n)=>{var r=n(9303),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},7908:(t,e,n)=>{var r=n(7854),o=n(4488),i=r.Object;t.exports=function(t){return i(o(t))}},7593:(t,e,n)=>{var r=n(7854),o=n(6916),i=n(111),a=n(2190),u=n(8173),c=n(2140),s=n(5112),f=r.TypeError,l=s("toPrimitive");t.exports=function(t,e){if(!i(t)||a(t))return t;var n,r=u(t,l);if(r){if(void 0===e&&(e="default"),n=o(r,t,e),!i(n)||a(n))return n;throw f("Can\'t convert object to primitive value")}return void 0===e&&(e="number"),c(t,e)}},4948:(t,e,n)=>{var r=n(7593),o=n(2190);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},1694:(t,e,n)=>{var r={};r[n(5112)("toStringTag")]="z",t.exports="[object z]"===String(r)},6330:(t,e,n)=>{var r=n(7854).String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},9711:(t,e,n)=>{var r=n(1702),o=0,i=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},3307:(t,e,n)=>{var r=n(133);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5112:(t,e,n)=>{var r=n(7854),o=n(2309),i=n(2597),a=n(9711),u=n(133),c=n(3307),s=o("wks"),f=r.Symbol,l=f&&f.for,h=c?f:f&&f.withoutSetter||a;t.exports=function(t){if(!i(s,t)||!u&&"string"!=typeof s[t]){var e="Symbol."+t;u&&i(f,t)?s[t]=f[t]:s[t]=c&&l?l(e):h(e)}return s[t]}},2222:(t,e,n)=>{"use strict";var r=n(2109),o=n(7854),i=n(7293),a=n(3157),u=n(111),c=n(7908),s=n(6244),f=n(6135),l=n(5417),h=n(1194),p=n(5112),d=n(7392),v=p("isConcatSpreadable"),y=9007199254740991,m="Maximum allowed index exceeded",g=o.TypeError,b=d>=51||!i((function(){var t=[];return t[v]=!1,t.concat()[0]!==t})),w=h("concat"),_=function(t){if(!u(t))return!1;var e=t[v];return void 0!==e?!!e:a(t)};r({target:"Array",proto:!0,forced:!b||!w},{concat:function(t){var e,n,r,o,i,a=c(this),u=l(a,0),h=0;for(e=-1,r=arguments.length;e<r;e++)if(_(i=-1===e?a:arguments[e])){if(h+(o=s(i))>y)throw g(m);for(n=0;n<o;n++,h++)n in i&&f(u,h,i[n])}else{if(h>=y)throw g(m);f(u,h++,i)}return u.length=h,u}})},5069:(t,e,n)=>{"use strict";var r=n(2109),o=n(1702),i=n(3157),a=o([].reverse),u=[1,2];r({target:"Array",proto:!0,forced:String(u)===String(u.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},3843:(t,e,n)=>{var r=n(2109),o=n(7854),i=n(1702),a=o.Date,u=i(a.prototype.getTime);r({target:"Date",stat:!0},{now:function(){return u(new a)}})},3710:(t,e,n)=>{var r=n(1702),o=n(1320),i=Date.prototype,a="Invalid Date",u="toString",c=r(i.toString),s=r(i.getTime);String(new Date(NaN))!=a&&o(i,u,(function(){var t=s(this);return t==t?c(this):a}))},1539:(t,e,n)=>{var r=n(1694),o=n(1320),i=n(288);r||o(Object.prototype,"toString",i,{unsafe:!0})},8674:(t,e,n)=>{"use strict";var r,o,i,a,u=n(2109),c=n(1913),s=n(7854),f=n(5005),l=n(6916),h=n(1070),p=n(1320),d=n(2248),v=n(7674),y=n(8003),m=n(6340),g=n(9662),b=n(614),w=n(111),_=n(5787),x=n(2788),k=n(408),O=n(7072),j=n(6707),E=n(261).set,P=n(5948),S=n(9478),T=n(842),A=n(8523),C=n(2534),K=n(8572),I=n(9909),D=n(4705),R=n(5112),F=n(7871),B=n(5268),N=n(7392),M=R("species"),q="Promise",L=I.getterFor(q),U=I.set,G=I.getterFor(q),W=h&&h.prototype,z=h,V=W,Y=s.TypeError,H=s.document,X=s.process,Q=A.f,$=Q,J=!!(H&&H.createEvent&&s.dispatchEvent),Z=b(s.PromiseRejectionEvent),tt="unhandledrejection",et=!1,nt=D(q,(function(){var t=x(z),e=t!==String(z);if(!e&&66===N)return!0;if(c&&!V.finally)return!0;if(N>=51&&/native code/.test(t))return!1;var n=new z((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))};return(n.constructor={})[M]=r,!(et=n.then((function(){}))instanceof r)||!e&&F&&!Z})),rt=nt||!O((function(t){z.all(t).catch((function(){}))})),ot=function(t){var e;return!(!w(t)||!b(e=t.then))&&e},it=function(t,e){var n,r,o,i=e.value,a=1==e.state,u=a?t.ok:t.fail,c=t.resolve,s=t.reject,f=t.domain;try{u?(a||(2===e.rejection&&ft(e),e.rejection=1),!0===u?n=i:(f&&f.enter(),n=u(i),f&&(f.exit(),o=!0)),n===t.promise?s(Y("Promise-chain cycle")):(r=ot(n))?l(r,n,c,s):c(n)):s(i)}catch(t){f&&!o&&f.exit(),s(t)}},at=function(t,e){t.notified||(t.notified=!0,P((function(){for(var n,r=t.reactions;n=r.get();)it(n,t);t.notified=!1,e&&!t.rejection&&ct(t)})))},ut=function(t,e,n){var r,o;J?((r=H.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),s.dispatchEvent(r)):r={promise:e,reason:n},!Z&&(o=s["on"+t])?o(r):t===tt&&T("Unhandled promise rejection",n)},ct=function(t){l(E,s,(function(){var e,n=t.facade,r=t.value;if(st(t)&&(e=C((function(){B?X.emit("unhandledRejection",r,n):ut(tt,n,r)})),t.rejection=B||st(t)?2:1,e.error))throw e.value}))},st=function(t){return 1!==t.rejection&&!t.parent},ft=function(t){l(E,s,(function(){var e=t.facade;B?X.emit("rejectionHandled",e):ut("rejectionhandled",e,t.value)}))},lt=function(t,e,n){return function(r){t(e,r,n)}},ht=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,at(t,!0))},pt=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw Y("Promise can\'t be resolved itself");var r=ot(e);r?P((function(){var n={done:!1};try{l(r,e,lt(pt,n,t),lt(ht,n,t))}catch(e){ht(n,e,t)}})):(t.value=e,t.state=1,at(t,!1))}catch(e){ht({done:!1},e,t)}}};if(nt&&(V=(z=function(t){_(this,V),g(t),l(r,this);var e=L(this);try{t(lt(pt,e),lt(ht,e))}catch(t){ht(e,t)}}).prototype,(r=function(t){U(this,{type:q,done:!1,notified:!1,parent:!1,reactions:new K,rejection:!1,state:0,value:void 0})}).prototype=d(V,{then:function(t,e){var n=G(this),r=Q(j(this,z));return n.parent=!0,r.ok=!b(t)||t,r.fail=b(e)&&e,r.domain=B?X.domain:void 0,0==n.state?n.reactions.add(r):P((function(){it(r,n)})),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r,e=L(t);this.promise=t,this.resolve=lt(pt,e),this.reject=lt(ht,e)},A.f=Q=function(t){return t===z||t===i?new o(t):$(t)},!c&&b(h)&&W!==Object.prototype)){a=W.then,et||(p(W,"then",(function(t,e){var n=this;return new z((function(t,e){l(a,n,t,e)})).then(t,e)}),{unsafe:!0}),p(W,"catch",V.catch,{unsafe:!0}));try{delete W.constructor}catch(t){}v&&v(W,V)}u({global:!0,wrap:!0,forced:nt},{Promise:z}),y(z,q,!1,!0),m(q),i=f(q),u({target:q,stat:!0,forced:nt},{reject:function(t){var e=Q(this);return l(e.reject,void 0,t),e.promise}}),u({target:q,stat:!0,forced:c||nt},{resolve:function(t){return S(c&&this===i?z:this,t)}}),u({target:q,stat:!0,forced:rt},{all:function(t){var e=this,n=Q(e),r=n.resolve,o=n.reject,i=C((function(){var n=g(e.resolve),i=[],a=0,u=1;k(t,(function(t){var c=a++,s=!1;u++,l(n,e,t).then((function(t){s||(s=!0,i[c]=t,--u||r(i))}),o)})),--u||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=Q(e),r=n.reject,o=C((function(){var o=g(e.resolve);k(t,(function(t){l(o,e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},2419:(t,e,n)=>{var r=n(2109),o=n(5005),i=n(2104),a=n(7065),u=n(9483),c=n(9670),s=n(111),f=n(30),l=n(7293),h=o("Reflect","construct"),p=Object.prototype,d=[].push,v=l((function(){function t(){}return!(h((function(){}),[],t)instanceof t)})),y=!l((function(){h((function(){}))})),m=v||y;r({target:"Reflect",stat:!0,forced:m,sham:m},{construct:function(t,e){u(t),c(e);var n=arguments.length<3?t:u(arguments[2]);if(y&&!v)return h(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return i(d,r,e),new(i(a,t,r))}var o=n.prototype,l=f(s(o)?o:p),m=i(t,l,e);return s(m)?m:l}})}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";function t(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function e(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function u(e){t(a,o,i,u,c,"next",e)}function c(e){t(a,o,i,u,c,"throw",e)}u(void 0)}))}}var r=n(7162),o=n.n(r),i=(n(3710),n(5069),n(2222),n(3843),n(4073)),a=n.n(i);n(2419);function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t,e){return f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},f(t,e)}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function h(t,e){if(e&&("object"===l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t)}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}var d=function(){return d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},d.apply(this,arguments)};function v(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}var y=Object.keys,m=Array.isArray,g="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function b(t,e){return"object"!=typeof e||y(e).forEach((function(n){t[n]=e[n]})),t}"undefined"==typeof Promise||g.Promise||(g.Promise=Promise);var w=Object.getPrototypeOf,_={}.hasOwnProperty;function x(t,e){return _.call(t,e)}function k(t,e){"function"==typeof e&&(e=e(w(t))),y(e).forEach((function(n){j(t,n,e[n])}))}var O=Object.defineProperty;function j(t,e,n,r){O(t,e,b(n&&x(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function E(t){return{from:function(e){return t.prototype=Object.create(e.prototype),j(t.prototype,"constructor",t),{extend:k.bind(null,t.prototype)}}}}var P=Object.getOwnPropertyDescriptor;function S(t,e){var n;return P(t,e)||(n=w(t))&&S(n,e)}var T=[].slice;function A(t,e,n){return T.call(t,e,n)}function C(t,e){return e(t)}function K(t){if(!t)throw new Error("Assertion Failed")}function I(t){g.setImmediate?setImmediate(t):setTimeout(t,0)}function D(t,e){return t.reduce((function(t,n,r){var o=e(n,r);return o&&(t[o[0]]=o[1]),t}),{})}function R(t,e){if(x(t,e))return t[e];if(!e)return t;if("string"!=typeof e){for(var n=[],r=0,o=e.length;r<o;++r){var i=R(t,e[r]);n.push(i)}return n}var a=e.indexOf(".");if(-1!==a){var u=t[e.substr(0,a)];return void 0===u?void 0:R(u,e.substr(a+1))}}function F(t,e,n){if(t&&void 0!==e&&(!("isFrozen"in Object)||!Object.isFrozen(t)))if("string"!=typeof e&&"length"in e){K("string"!=typeof n&&"length"in n);for(var r=0,o=e.length;r<o;++r)F(t,e[r],n[r])}else{var i=e.indexOf(".");if(-1!==i){var a=e.substr(0,i),u=e.substr(i+1);if(""===u)void 0===n?m(t)&&!isNaN(parseInt(a))?t.splice(a,1):delete t[a]:t[a]=n;else{var c=t[a];c||(c=t[a]={}),F(c,u,n)}}else void 0===n?m(t)&&!isNaN(parseInt(e))?t.splice(e,1):delete t[e]:t[e]=n}}function B(t,e){"string"==typeof e?F(t,e,void 0):"length"in e&&[].map.call(e,(function(e){F(t,e,void 0)}))}function N(t){var e={};for(var n in t)x(t,n)&&(e[n]=t[n]);return e}var M=[].concat;function q(t){return M.apply([],t)}var L="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(q([8,16,32,64].map((function(t){return["Int","Uint","Float"].map((function(e){return e+t+"Array"}))})))).filter((function(t){return g[t]})),U=L.map((function(t){return g[t]})),G=D(L,(function(t){return[t,!0]}));function W(t){if(!t||"object"!=typeof t)return t;var e;if(m(t)){e=[];for(var n=0,r=t.length;n<r;++n)e.push(W(t[n]))}else if(U.indexOf(t.constructor)>=0)e=t;else for(var o in e=t.constructor?Object.create(t.constructor.prototype):{},t)x(t,o)&&(e[o]=W(t[o]));return e}var z={}.toString;function V(t){return z.call(t).slice(8,-1)}var Y=function(t,e){return"Array"===e?""+t.map((function(t){return Y(t,V(t))})):"ArrayBuffer"===e?""+new Uint8Array(t):"Date"===e?t.getTime():ArrayBuffer.isView(t)?""+new Uint8Array(t.buffer):t};function H(t,e,n,r){return n=n||{},r=r||"",y(t).forEach((function(o){if(x(e,o)){var i=t[o],a=e[o];if("object"==typeof i&&"object"==typeof a&&i&&a){var u=V(i),c=V(a);u===c?G[u]?Y(i,u)!==Y(a,c)&&(n[r+o]=e[o]):H(i,a,n,r+o+"."):n[r+o]=e[o]}else i!==a&&(n[r+o]=e[o])}else n[r+o]=void 0})),y(e).forEach((function(o){x(t,o)||(n[r+o]=e[o])})),n}var X="undefined"!=typeof Symbol&&Symbol.iterator,Q=X?function(t){var e;return null!=t&&(e=t[X])&&e.apply(t)}:function(){return null},$={};function J(t){var e,n,r,o;if(1===arguments.length){if(m(t))return t.slice();if(this===$&&"string"==typeof t)return[t];if(o=Q(t)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==t)return[t];if("number"==typeof(e=t.length)){for(n=new Array(e);e--;)n[e]=t[e];return n}return[t]}for(e=arguments.length,n=new Array(e);e--;)n[e]=arguments[e];return n}var Z="undefined"!=typeof Symbol?function(t){return"AsyncFunction"===t[Symbol.toStringTag]}:function(){return!1},tt="undefined"!=typeof location&&/^(http|https):\\/\\/(localhost|127\\.0\\.0\\.1)/.test(location.href);function et(t,e){tt=t,nt=e}var nt=function(){return!0},rt=!new Error("").stack;function ot(){if(rt)try{throw new Error}catch(t){return t}return new Error}function it(t,e){var n=t.stack;return n?(e=e||0,0===n.indexOf(t.name)&&(e+=(t.name+t.message).split("\\n").length),n.split("\\n").slice(e).filter(nt).map((function(t){return"\\n"+t})).join("")):""}var at=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ut=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(at),ct={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function st(t,e){this._e=ot(),this.name=t,this.message=e}function ft(t,e){return t+". Errors: "+Object.keys(e).map((function(t){return e[t].toString()})).filter((function(t,e,n){return n.indexOf(t)===e})).join("\\n")}function lt(t,e,n,r){this._e=ot(),this.failures=e,this.failedKeys=r,this.successCount=n,this.message=ft(t,e)}function ht(t,e){this._e=ot(),this.name="BulkError",this.failures=e,this.message=ft(t,e)}E(st).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+it(this._e,2))}},toString:function(){return this.name+": "+this.message}}),E(lt).from(st),E(ht).from(st);var pt=ut.reduce((function(t,e){return t[e]=e+"Error",t}),{}),dt=st,vt=ut.reduce((function(t,e){var n=e+"Error";function r(t,r){this._e=ot(),this.name=n,t?"string"==typeof t?(this.message=t+(r?"\\n "+r:""),this.inner=r||null):"object"==typeof t&&(this.message=t.name+" "+t.message,this.inner=t):(this.message=ct[e]||n,this.inner=null)}return E(r).from(dt),t[e]=r,t}),{});vt.Syntax=SyntaxError,vt.Type=TypeError,vt.Range=RangeError;var yt=at.reduce((function(t,e){return t[e+"Error"]=vt[e],t}),{});var mt=ut.reduce((function(t,e){return-1===["Syntax","Type","Range"].indexOf(e)&&(t[e+"Error"]=vt[e]),t}),{});function gt(){}function bt(t){return t}function wt(t,e){return null==t||t===bt?e:function(n){return e(t(n))}}function _t(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function xt(t,e){return t===gt?e:function(){var n=t.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=e.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?_t(r,this.onsuccess):r),o&&(this.onerror=this.onerror?_t(o,this.onerror):o),void 0!==i?i:n}}function kt(t,e){return t===gt?e:function(){t.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,e.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?_t(n,this.onsuccess):n),r&&(this.onerror=this.onerror?_t(r,this.onerror):r)}}function Ot(t,e){return t===gt?e:function(n){var r=t.apply(this,arguments);b(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=e.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?_t(o,this.onsuccess):o),i&&(this.onerror=this.onerror?_t(i,this.onerror):i),void 0===r?void 0===a?void 0:a:b(r,a)}}function jt(t,e){return t===gt?e:function(){return!1!==e.apply(this,arguments)&&t.apply(this,arguments)}}function Et(t,e){return t===gt?e:function(){var n=t.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return n.then((function(){return e.apply(r,i)}))}return e.apply(this,arguments)}}mt.ModifyError=lt,mt.DexieError=st,mt.BulkError=ht;var Pt={},St="undefined"==typeof Promise?[]:function(){var t=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[t,t.__proto__,t];var e=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[e,e.__proto__,t]}(),Tt=St[0],At=St[1],Ct=St[2],Kt=At&&At.then,It=Tt&&Tt.constructor,Dt=!!Ct,Rt=!1,Ft=Ct?function(){Ct.then(ie)}:g.setImmediate?setImmediate.bind(null,ie):g.MutationObserver?function(){var t=document.createElement("div");new MutationObserver((function(){ie(),t=null})).observe(t,{attributes:!0}),t.setAttribute("i","1")}:function(){setTimeout(ie,0)},Bt=function(t,e){Vt.push([t,e]),Mt&&(Ft(),Mt=!1)},Nt=!0,Mt=!0,qt=[],Lt=[],Ut=null,Gt=bt,Wt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Ae,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(t){try{Ae(t[0],t[1])}catch(t){}}))}},zt=Wt,Vt=[],Yt=0,Ht=[];function Xt(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=gt,this._lib=!1;var e=this._PSD=zt;if(tt&&(this._stackHolder=ot(),this._prev=null,this._numPrev=0),"function"!=typeof t){if(t!==Pt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Zt(this,this._value))}this._state=null,this._value=null,++e.ref,Jt(this,t)}var Qt={get:function(){var t=zt,e=ve;function n(n,r){var o=this,i=!t.global&&(t!==zt||e!==ve),a=i&&!be(),u=new Xt((function(e,u){ee(o,new $t(Pe(n,t,i,a),Pe(r,t,i,a),e,u,t))}));return tt&&oe(u,this),u}return n.prototype=Pt,n},set:function(t){j(this,"then",t&&t.prototype===Pt?Qt:{get:function(){return t},set:Qt.set})}};function $t(t,e,n,r,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r,this.psd=o}function Jt(t,e){try{e((function(e){if(null===t._state){if(e===t)throw new TypeError("A promise cannot be resolved with itself.");var n=t._lib&&ae();e&&"function"==typeof e.then?Jt(t,(function(t,n){e instanceof Xt?e._then(t,n):e.then(t,n)})):(t._state=!0,t._value=e,te(t)),n&&ue()}}),Zt.bind(null,t))}catch(e){Zt(t,e)}}function Zt(t,e){if(Lt.push(e),null===t._state){var n=t._lib&&ae();e=Gt(e),t._state=!1,t._value=e,tt&&null!==e&&"object"==typeof e&&!e._promise&&function(t,e,n){try{t.apply(null,n)}catch(t){e&&e(t)}}((function(){var n=S(e,"stack");e._promise=t,j(e,"stack",{get:function(){return Rt?n&&(n.get?n.get.apply(e):n.value):t.stack}})})),function(t){qt.some((function(e){return e._value===t._value}))||qt.push(t)}(t),te(t),n&&ue()}}function te(t){var e=t._listeners;t._listeners=[];for(var n=0,r=e.length;n<r;++n)ee(t,e[n]);var o=t._PSD;--o.ref||o.finalize(),0===Yt&&(++Yt,Bt((function(){0==--Yt&&ce()}),[]))}function ee(t,e){if(null!==t._state){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return(t._state?e.resolve:e.reject)(t._value);++e.psd.ref,++Yt,Bt(ne,[n,t,e])}else t._listeners.push(e)}function ne(t,e,n){try{Ut=e;var r,o=e._value;e._state?r=t(o):(Lt.length&&(Lt=[]),r=t(o),-1===Lt.indexOf(o)&&function(t){var e=qt.length;for(;e;)if(qt[--e]._value===t._value)return void qt.splice(e,1)}(e)),n.resolve(r)}catch(t){n.reject(t)}finally{Ut=null,0==--Yt&&ce(),--n.psd.ref||n.psd.finalize()}}function re(t,e,n){if(e.length===n)return e;var r="";if(!1===t._state){var o,i,a=t._value;null!=a?(o=a.name||"Error",i=a.message||a,r=it(a,0)):(o=a,i=""),e.push(o+(i?": "+i:"")+r)}return tt&&((r=it(t._stackHolder,2))&&-1===e.indexOf(r)&&e.push(r),t._prev&&re(t._prev,e,n)),e}function oe(t,e){var n=e?e._numPrev+1:0;n<100&&(t._prev=e,t._numPrev=n)}function ie(){ae()&&ue()}function ae(){var t=Nt;return Nt=!1,Mt=!1,t}function ue(){var t,e,n;do{for(;Vt.length>0;)for(t=Vt,Vt=[],n=t.length,e=0;e<n;++e){var r=t[e];r[0].apply(null,r[1])}}while(Vt.length>0);Nt=!0,Mt=!0}function ce(){var t=qt;qt=[],t.forEach((function(t){t._PSD.onunhandled.call(null,t._value,t)}));for(var e=Ht.slice(0),n=e.length;n;)e[--n]()}function se(t){return new Xt(Pt,!1,t)}function fe(t,e){var n=zt;return function(){var r=ae(),o=zt;try{return ke(n,!0),t.apply(this,arguments)}catch(t){e&&e(t)}finally{ke(o,!1),r&&ue()}}}k(Xt.prototype,{then:Qt,_then:function(t,e){ee(this,new $t(null,null,t,e,zt))},catch:function(t){if(1===arguments.length)return this.then(null,t);var e=arguments[0],n=arguments[1];return"function"==typeof e?this.then(null,(function(t){return t instanceof e?n(t):se(t)})):this.then(null,(function(t){return t&&t.name===e?n(t):se(t)}))},finally:function(t){return this.then((function(e){return t(),e}),(function(e){return t(),se(e)}))},stack:{get:function(){if(this._stack)return this._stack;try{Rt=!0;var t=re(this,[],20).join("\\nFrom previous: ");return null!==this._state&&(this._stack=t),t}finally{Rt=!1}}},timeout:function(t,e){var n=this;return t<1/0?new Xt((function(r,o){var i=setTimeout((function(){return o(new vt.Timeout(e))}),t);n.then(r,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&j(Xt.prototype,Symbol.toStringTag,"Dexie.Promise"),Wt.env=Oe(),k(Xt,{all:function(){var t=J.apply(null,arguments).map(we);return new Xt((function(e,n){0===t.length&&e([]);var r=t.length;t.forEach((function(o,i){return Xt.resolve(o).then((function(n){t[i]=n,--r||e(t)}),n)}))}))},resolve:function(t){if(t instanceof Xt)return t;if(t&&"function"==typeof t.then)return new Xt((function(e,n){t.then(e,n)}));var e=new Xt(Pt,!0,t);return oe(e,Ut),e},reject:se,race:function(){var t=J.apply(null,arguments).map(we);return new Xt((function(e,n){t.map((function(t){return Xt.resolve(t).then(e,n)}))}))},PSD:{get:function(){return zt},set:function(t){return zt=t}},totalEchoes:{get:function(){return ve}},newPSD:me,usePSD:je,scheduler:{get:function(){return Bt},set:function(t){Bt=t}},rejectionMapper:{get:function(){return Gt},set:function(t){Gt=t}},follow:function(t,e){return new Xt((function(n,r){return me((function(e,n){var r=zt;r.unhandleds=[],r.onunhandled=n,r.finalize=_t((function(){var t=this;!function(t){function e(){t(),Ht.splice(Ht.indexOf(e),1)}Ht.push(e),++Yt,Bt((function(){0==--Yt&&ce()}),[])}((function(){0===t.unhandleds.length?e():n(t.unhandleds[0])}))}),r.finalize),t()}),e,n,r)}))}}),It&&(It.allSettled&&j(Xt,"allSettled",(function(){var t=J.apply(null,arguments).map(we);return new Xt((function(e){0===t.length&&e([]);var n=t.length,r=new Array(n);t.forEach((function(t,o){return Xt.resolve(t).then((function(t){return r[o]={status:"fulfilled",value:t}}),(function(t){return r[o]={status:"rejected",reason:t}})).then((function(){return--n||e(r)}))}))}))})),It.any&&"undefined"!=typeof AggregateError&&j(Xt,"any",(function(){var t=J.apply(null,arguments).map(we);return new Xt((function(e,n){0===t.length&&n(new AggregateError([]));var r=t.length,o=new Array(r);t.forEach((function(t,i){return Xt.resolve(t).then((function(t){return e(t)}),(function(t){o[i]=t,--r||n(new AggregateError(o))}))}))}))})));var le={awaits:0,echoes:0,id:0},he=0,pe=[],de=0,ve=0,ye=0;function me(t,e,n,r){var o=zt,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++ye;var a=Wt.env;i.env=Dt?{Promise:Xt,PromiseProp:{value:Xt,configurable:!0,writable:!0},all:Xt.all,race:Xt.race,allSettled:Xt.allSettled,any:Xt.any,resolve:Xt.resolve,reject:Xt.reject,nthen:Se(a.nthen,i),gthen:Se(a.gthen,i)}:{},e&&b(i,e),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=je(i,t,n,r);return 0===i.ref&&i.finalize(),u}function ge(){return le.id||(le.id=++he),++le.awaits,le.echoes+=100,le.id}function be(){return!!le.awaits&&(0==--le.awaits&&(le.id=0),le.echoes=100*le.awaits,!0)}function we(t){return le.echoes&&t&&t.constructor===It?(ge(),t.then((function(t){return be(),t}),(function(t){return be(),Ce(t)}))):t}function _e(t){++ve,le.echoes&&0!=--le.echoes||(le.echoes=le.id=0),pe.push(zt),ke(t,!0)}function xe(){var t=pe[pe.length-1];pe.pop(),ke(t,!1)}function ke(t,e){var n=zt;if((e?!le.echoes||de++&&t===zt:!de||--de&&t===zt)||Ee(e?_e.bind(null,t):xe),t!==zt&&(zt=t,n===Wt&&(Wt.env=Oe()),Dt)){var r=Wt.env.Promise,o=t.env;At.then=o.nthen,r.prototype.then=o.gthen,(n.global||t.global)&&(Object.defineProperty(g,"Promise",o.PromiseProp),r.all=o.all,r.race=o.race,r.resolve=o.resolve,r.reject=o.reject,o.allSettled&&(r.allSettled=o.allSettled),o.any&&(r.any=o.any))}}function Oe(){var t=g.Promise;return Dt?{Promise:t,PromiseProp:Object.getOwnPropertyDescriptor(g,"Promise"),all:t.all,race:t.race,allSettled:t.allSettled,any:t.any,resolve:t.resolve,reject:t.reject,nthen:At.then,gthen:t.prototype.then}:{}}function je(t,e,n,r,o){var i=zt;try{return ke(t,!0),e(n,r,o)}finally{ke(i,!1)}}function Ee(t){Kt.call(Tt,t)}function Pe(t,e,n,r){return"function"!=typeof t?t:function(){var o=zt;n&&ge(),ke(e,!0);try{return t.apply(this,arguments)}finally{ke(o,!1),r&&Ee(be)}}}function Se(t,e){return function(n,r){return t.call(this,Pe(n,e),Pe(r,e))}}-1===(""+Kt).indexOf("[native code]")&&(ge=be=gt);var Te="unhandledrejection";function Ae(t,e){var n;try{n=e.onuncatched(t)}catch(t){}if(!1!==n)try{var r,o={promise:e,reason:t};if(g.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(Te,!0,!0),b(r,o)):g.CustomEvent&&b(r=new CustomEvent(Te,{detail:o}),o),r&&g.dispatchEvent&&(dispatchEvent(r),!g.PromiseRejectionEvent&&g.onunhandledrejection))try{g.onunhandledrejection(r)}catch(t){}tt&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: "+(t.stack||t))}catch(t){}}var Ce=Xt.reject;function Ke(t,e,n,r){if(t._state.openComplete||zt.letThrough){var o=t._createTransaction(e,n,t._dbSchema);try{o.create()}catch(t){return Ce(t)}return o._promise(e,(function(t,e){return me((function(){return zt.trans=o,r(t,e,o)}))})).then((function(t){return o._completion.then((function(){return t}))}))}if(!t._state.isBeingOpened){if(!t._options.autoOpen)return Ce(new vt.DatabaseClosed);t.open().catch(gt)}return t._state.dbReadyPromise.then((function(){return Ke(t,e,n,r)}))}var Ie="3.0.3",De=String.fromCharCode(65535),Re=-1/0,Fe="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Be="String expected.",Ne=[],Me="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),qe=Me,Le=Me,Ue=function(t){return!/(dexie\\.js|dexie\\.min\\.js)/.test(t)},Ge="__dbnames",We="readonly",ze="readwrite";function Ve(t,e){return t?e?function(){return t.apply(this,arguments)&&e.apply(this,arguments)}:t:e}var Ye={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function He(t){return function(e){return void 0===R(e,t)&&B(e=W(e),t),e}}var Xe=function(){function t(){}return t.prototype._trans=function(t,e,n){var r=this._tx||zt.trans,o=this.name;function i(t,n,r){if(!r.schema[o])throw new vt.NotFound("Table "+o+" not part of transaction");return e(r.idbtrans,r)}var a=ae();try{return r&&r.db===this.db?r===zt.trans?r._promise(t,i,n):me((function(){return r._promise(t,i,n)}),{trans:r,transless:zt.transless||zt}):Ke(this.db,t,[this.name],i)}finally{a&&ue()}},t.prototype.get=function(t,e){var n=this;return t&&t.constructor===Object?this.where(t).first(e):this._trans("readonly",(function(e){return n.core.get({trans:e,key:t}).then((function(t){return n.hook.reading.fire(t)}))})).then(e)},t.prototype.where=function(t){if("string"==typeof t)return new this.db.WhereClause(this,t);if(m(t))return new this.db.WhereClause(this,"["+t.join("+")+"]");var e=y(t);if(1===e.length)return this.where(e[0]).equals(t[e[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(t){return t.compound&&e.every((function(e){return t.keyPath.indexOf(e)>=0}))&&t.keyPath.every((function(t){return e.indexOf(t)>=0}))}))[0];if(n&&this.db._maxKey!==De)return this.where(n.name).equals(n.keyPath.map((function(e){return t[e]})));!n&&tt&&console.warn("The query "+JSON.stringify(t)+" on "+this.name+" would benefit of a compound index ["+e.join("+")+"]");var r=this.schema.idxByName,o=this.db._deps.indexedDB;function i(t,e){try{return 0===o.cmp(t,e)}catch(t){return!1}}var a=e.reduce((function(e,n){var o=e[0],a=e[1],u=r[n],c=t[n];return[o||u,o||!u?Ve(a,u&&u.multi?function(t){var e=R(t,n);return m(e)&&e.some((function(t){return i(c,t)}))}:function(t){return i(c,R(t,n))}):a]}),[null,null]),u=a[0],c=a[1];return u?this.where(u.name).equals(t[u.keyPath]).filter(c):n?this.filter(c):this.where(e).equals("")},t.prototype.filter=function(t){return this.toCollection().and(t)},t.prototype.count=function(t){return this.toCollection().count(t)},t.prototype.offset=function(t){return this.toCollection().offset(t)},t.prototype.limit=function(t){return this.toCollection().limit(t)},t.prototype.each=function(t){return this.toCollection().each(t)},t.prototype.toArray=function(t){return this.toCollection().toArray(t)},t.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},t.prototype.orderBy=function(t){return new this.db.Collection(new this.db.WhereClause(this,m(t)?"["+t.join("+")+"]":t))},t.prototype.reverse=function(){return this.toCollection().reverse()},t.prototype.mapToClass=function(t){this.schema.mappedClass=t;var e=function(e){if(!e)return e;var n=Object.create(t.prototype);for(var r in e)if(x(e,r))try{n[r]=e[r]}catch(t){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=e,this.hook("reading",e),t},t.prototype.defineClass=function(){return this.mapToClass((function(t){b(this,t)}))},t.prototype.add=function(t,e){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=t;return i&&o&&(a=He(i)(t)),this._trans("readwrite",(function(t){return n.core.mutate({trans:t,type:"add",keys:null!=e?[e]:null,values:[a]})})).then((function(t){return t.numFailures?Xt.reject(t.failures[0]):t.lastResult})).then((function(e){if(i)try{F(t,i,e)}catch(t){}return e}))},t.prototype.update=function(t,e){if("object"!=typeof e||m(e))throw new vt.InvalidArgument("Modifications must be an object.");if("object"!=typeof t||m(t))return this.where(":id").equals(t).modify(e);y(e).forEach((function(n){F(t,n,e[n])}));var n=R(t,this.schema.primKey.keyPath);return void 0===n?Ce(new vt.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(e)},t.prototype.put=function(t,e){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=t;return i&&o&&(a=He(i)(t)),this._trans("readwrite",(function(t){return n.core.mutate({trans:t,type:"put",values:[a],keys:null!=e?[e]:null})})).then((function(t){return t.numFailures?Xt.reject(t.failures[0]):t.lastResult})).then((function(e){if(i)try{F(t,i,e)}catch(t){}return e}))},t.prototype.delete=function(t){var e=this;return this._trans("readwrite",(function(n){return e.core.mutate({trans:n,type:"delete",keys:[t]})})).then((function(t){return t.numFailures?Xt.reject(t.failures[0]):void 0}))},t.prototype.clear=function(){var t=this;return this._trans("readwrite",(function(e){return t.core.mutate({trans:e,type:"deleteRange",range:Ye})})).then((function(t){return t.numFailures?Xt.reject(t.failures[0]):void 0}))},t.prototype.bulkGet=function(t){var e=this;return this._trans("readonly",(function(n){return e.core.getMany({keys:t,trans:n}).then((function(t){return t.map((function(t){return e.hook.reading.fire(t)}))}))}))},t.prototype.bulkAdd=function(t,e,n){var r=this,o=Array.isArray(e)?e:void 0,i=(n=n||(o?void 0:e))?n.allKeys:void 0;return this._trans("readwrite",(function(e){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new vt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==t.length)throw new vt.InvalidArgument("Arguments objects and keys must have the same length");var c=t.length,s=u&&a?t.map(He(u)):t;return r.core.mutate({trans:e,type:"add",keys:o,values:s,wantResults:i}).then((function(t){var e=t.numFailures,n=t.results,o=t.lastResult,a=t.failures;if(0===e)return i?n:o;throw new ht(r.name+".bulkAdd(): "+e+" of "+c+" operations failed",Object.keys(a).map((function(t){return a[t]})))}))}))},t.prototype.bulkPut=function(t,e,n){var r=this,o=Array.isArray(e)?e:void 0,i=(n=n||(o?void 0:e))?n.allKeys:void 0;return this._trans("readwrite",(function(e){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new vt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==t.length)throw new vt.InvalidArgument("Arguments objects and keys must have the same length");var c=t.length,s=u&&a?t.map(He(u)):t;return r.core.mutate({trans:e,type:"put",keys:o,values:s,wantResults:i}).then((function(t){var e=t.numFailures,n=t.results,o=t.lastResult,a=t.failures;if(0===e)return i?n:o;throw new ht(r.name+".bulkPut(): "+e+" of "+c+" operations failed",Object.keys(a).map((function(t){return a[t]})))}))}))},t.prototype.bulkDelete=function(t){var e=this,n=t.length;return this._trans("readwrite",(function(n){return e.core.mutate({trans:n,type:"delete",keys:t})})).then((function(t){var r=t.numFailures,o=t.lastResult,i=t.failures;if(0===r)return o;throw new ht(e.name+".bulkDelete(): "+r+" of "+n+" operations failed",i)}))},t}();function Qe(t){var e={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return e[n].subscribe.apply(null,i),t}if("string"==typeof n)return e[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(t,r,o){if("object"==typeof t)return a(t);r||(r=jt),o||(o=gt);var i={subscribers:[],fire:o,subscribe:function(t){-1===i.subscribers.indexOf(t)&&(i.subscribers.push(t),i.fire=r(i.fire,t))},unsubscribe:function(t){i.subscribers=i.subscribers.filter((function(e){return e!==t})),i.fire=i.subscribers.reduce(r,o)}};return e[t]=n[t]=i,i}function a(t){y(t).forEach((function(e){var n=t[e];if(m(n))i(e,t[e][0],t[e][1]);else{if("asap"!==n)throw new vt.InvalidArgument("Invalid event config");var r=i(e,bt,(function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];r.subscribers.forEach((function(t){I((function(){t.apply(null,e)}))}))}))}}))}}function $e(t,e){return E(e).from({prototype:t}),e}function Je(t,e){return!(t.filter||t.algorithm||t.or)&&(e?t.justLimit:!t.replayFilter)}function Ze(t,e){t.filter=Ve(t.filter,e)}function tn(t,e,n){var r=t.replayFilter;t.replayFilter=r?function(){return Ve(r(),e())}:e,t.justLimit=n&&!r}function en(t,e){if(t.isPrimKey)return e.primaryKey;var n=e.getIndexByKeyPath(t.index);if(!n)throw new vt.Schema("KeyPath "+t.index+" on object store "+e.name+" is not indexed");return n}function nn(t,e,n){var r=en(t,e.schema);return e.openCursor({trans:n,values:!t.keysOnly,reverse:"prev"===t.dir,unique:!!t.unique,query:{index:r,range:t.range}})}function rn(t,e,n,r){var o=t.replayFilter?Ve(t.filter,t.replayFilter()):t.filter;if(t.or){var i={},a=function(t,n,r){if(!o||o(n,r,(function(t){return n.stop(t)}),(function(t){return n.fail(t)}))){var a=n.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),x(i,u)||(i[u]=!0,e(t,n,r))}};return Promise.all([t.or._iterate(a,n),on(nn(t,r,n),t.algorithm,a,!t.keysOnly&&t.valueMapper)])}return on(nn(t,r,n),Ve(t.algorithm,o),e,!t.keysOnly&&t.valueMapper)}function on(t,e,n,r){var o=fe(r?function(t,e,o){return n(r(t),e,o)}:n);return t.then((function(t){if(t)return t.start((function(){var n=function(){return t.continue()};e&&!e(t,(function(t){return n=t}),(function(e){t.stop(e),n=gt}),(function(e){t.fail(e),n=gt}))||o(t.value,t,(function(t){return n=t})),n()}))}))}var an=function(){function t(){}return t.prototype._read=function(t,e){var n=this._ctx;return n.error?n.table._trans(null,Ce.bind(null,n.error)):n.table._trans("readonly",t).then(e)},t.prototype._write=function(t){var e=this._ctx;return e.error?e.table._trans(null,Ce.bind(null,e.error)):e.table._trans("readwrite",t,"locked")},t.prototype._addAlgorithm=function(t){var e=this._ctx;e.algorithm=Ve(e.algorithm,t)},t.prototype._iterate=function(t,e){return rn(this._ctx,t,e,this._ctx.table.core)},t.prototype.clone=function(t){var e=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return t&&b(n,t),e._ctx=n,e},t.prototype.raw=function(){return this._ctx.valueMapper=null,this},t.prototype.each=function(t){var e=this._ctx;return this._read((function(n){return rn(e,t,n,e.table.core)}))},t.prototype.count=function(t){var e=this;return this._read((function(t){var n=e._ctx,r=n.table.core;if(Je(n,!0))return r.count({trans:t,query:{index:en(n,r.schema),range:n.range}}).then((function(t){return Math.min(t,n.limit)}));var o=0;return rn(n,(function(){return++o,!1}),t,r).then((function(){return o}))})).then(t)},t.prototype.sortBy=function(t,e){var n=t.split(".").reverse(),r=n[0],o=n.length-1;function i(t,e){return e?i(t[n[e]],e-1):t[r]}var a="next"===this._ctx.dir?1:-1;function u(t,e){var n=i(t,o),r=i(e,o);return n<r?-a:n>r?a:0}return this.toArray((function(t){return t.sort(u)})).then(e)},t.prototype.toArray=function(t){var e=this;return this._read((function(t){var n=e._ctx;if("next"===n.dir&&Je(n,!0)&&n.limit>0){var r=n.valueMapper,o=en(n,n.table.core.schema);return n.table.core.query({trans:t,limit:n.limit,values:!0,query:{index:o,range:n.range}}).then((function(t){var e=t.result;return r?e.map(r):e}))}var i=[];return rn(n,(function(t){return i.push(t)}),t,n.table.core).then((function(){return i}))}),t)},t.prototype.offset=function(t){var e=this._ctx;return t<=0||(e.offset+=t,Je(e)?tn(e,(function(){var e=t;return function(t,n){return 0===e||(1===e?(--e,!1):(n((function(){t.advance(e),e=0})),!1))}})):tn(e,(function(){var e=t;return function(){return--e<0}}))),this},t.prototype.limit=function(t){return this._ctx.limit=Math.min(this._ctx.limit,t),tn(this._ctx,(function(){var e=t;return function(t,n,r){return--e<=0&&n(r),e>=0}}),!0),this},t.prototype.until=function(t,e){return Ze(this._ctx,(function(n,r,o){return!t(n.value)||(r(o),e)})),this},t.prototype.first=function(t){return this.limit(1).toArray((function(t){return t[0]})).then(t)},t.prototype.last=function(t){return this.reverse().first(t)},t.prototype.filter=function(t){return Ze(this._ctx,(function(e){return t(e.value)})),function(t,e){t.isMatch=Ve(t.isMatch,e)}(this._ctx,t),this},t.prototype.and=function(t){return this.filter(t)},t.prototype.or=function(t){return new this.db.WhereClause(this._ctx.table,t,this)},t.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},t.prototype.desc=function(){return this.reverse()},t.prototype.eachKey=function(t){var e=this._ctx;return e.keysOnly=!e.isMatch,this.each((function(e,n){t(n.key,n)}))},t.prototype.eachUniqueKey=function(t){return this._ctx.unique="unique",this.eachKey(t)},t.prototype.eachPrimaryKey=function(t){var e=this._ctx;return e.keysOnly=!e.isMatch,this.each((function(e,n){t(n.primaryKey,n)}))},t.prototype.keys=function(t){var e=this._ctx;e.keysOnly=!e.isMatch;var n=[];return this.each((function(t,e){n.push(e.key)})).then((function(){return n})).then(t)},t.prototype.primaryKeys=function(t){var e=this._ctx;if("next"===e.dir&&Je(e,!0)&&e.limit>0)return this._read((function(t){var n=en(e,e.table.core.schema);return e.table.core.query({trans:t,values:!1,limit:e.limit,query:{index:n,range:e.range}})})).then((function(t){return t.result})).then(t);e.keysOnly=!e.isMatch;var n=[];return this.each((function(t,e){n.push(e.primaryKey)})).then((function(){return n})).then(t)},t.prototype.uniqueKeys=function(t){return this._ctx.unique="unique",this.keys(t)},t.prototype.firstKey=function(t){return this.limit(1).keys((function(t){return t[0]})).then(t)},t.prototype.lastKey=function(t){return this.reverse().firstKey(t)},t.prototype.distinct=function(){var t=this._ctx,e=t.index&&t.table.schema.idxByName[t.index];if(!e||!e.multi)return this;var n={};return Ze(this._ctx,(function(t){var e=t.primaryKey.toString(),r=x(n,e);return n[e]=!0,!r})),this},t.prototype.modify=function(t){var e=this,n=this._ctx;return this._write((function(r){var o;if("function"==typeof t)o=t;else{var i=y(t),a=i.length;o=function(e){for(var n=!1,r=0;r<a;++r){var o=i[r],u=t[o];R(e,o)!==u&&(F(e,o,u),n=!0)}return n}}var u=n.table.core,c=u.schema.primaryKey,s=c.outbound,f=c.extractKey,l="testmode"in $n?1:2e3,h=e.db.core.cmp,p=[],d=0,v=[],m=function(t,e){var n=e.failures,r=e.numFailures;d+=t-r;for(var o=0,i=y(n);o<i.length;o++){var a=i[o];p.push(n[a])}};return e.clone().primaryKeys().then((function(t){var e=function(n){var i=Math.min(l,t.length-n);return u.getMany({trans:r,keys:t.slice(n,n+i)}).then((function(a){for(var c=[],p=[],d=s?[]:null,v=[],y=0;y<i;++y){var g=a[y],b={value:W(g),primKey:t[n+y]};!1!==o.call(b,b.value,b)&&(null==b.value?v.push(t[n+y]):s||0===h(f(g),f(b.value))?(p.push(b.value),s&&d.push(t[n+y])):(v.push(t[n+y]),c.push(b.value)))}return Promise.resolve(c.length>0&&u.mutate({trans:r,type:"add",values:c}).then((function(t){for(var e in t.failures)v.splice(parseInt(e),1);m(c.length,t)}))).then((function(t){return p.length>0&&u.mutate({trans:r,type:"put",keys:d,values:p}).then((function(t){return m(p.length,t)}))})).then((function(){return v.length>0&&u.mutate({trans:r,type:"delete",keys:v}).then((function(t){return m(v.length,t)}))})).then((function(){return t.length>n+i&&e(n+l)}))}))};return e(0).then((function(){if(p.length>0)throw new lt("Error modifying one or more objects",p,d,v);return t.length}))}))}))},t.prototype.delete=function(){var t=this._ctx,e=t.range;return Je(t)&&(t.isPrimKey&&!Le||3===e.type)?this._write((function(n){var r=t.table.core.schema.primaryKey,o=e;return t.table.core.count({trans:n,query:{index:r,range:o}}).then((function(e){return t.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((function(t){var n=t.failures,r=(t.lastResult,t.results,t.numFailures);if(r)throw new lt("Could not delete some values",Object.keys(n).map((function(t){return n[t]})),e-r);return e-r}))}))})):this.modify((function(t,e){return e.value=null}))},t}();function un(t,e){return t<e?-1:t===e?0:1}function cn(t,e){return t>e?-1:t===e?0:1}function sn(t,e,n){var r=t instanceof vn?new t.Collection(t):t;return r._ctx.error=n?new n(e):new TypeError(e),r}function fn(t){return new t.Collection(t,(function(){return dn("")})).limit(0)}function ln(t,e,n,r,o,i){for(var a=Math.min(t.length,r.length),u=-1,c=0;c<a;++c){var s=e[c];if(s!==r[c])return o(t[c],n[c])<0?t.substr(0,c)+n[c]+n.substr(c+1):o(t[c],r[c])<0?t.substr(0,c)+r[c]+n.substr(c+1):u>=0?t.substr(0,u)+e[u]+n.substr(u+1):null;o(t[c],s)<0&&(u=c)}return a<r.length&&"next"===i?t+n.substr(t.length):a<t.length&&"prev"===i?t.substr(0,n.length):u<0?null:t.substr(0,u)+r[u]+n.substr(u+1)}function hn(t,e,n,r){var o,i,a,u,c,s,f,l=n.length;if(!n.every((function(t){return"string"==typeof t})))return sn(t,Be);function h(t){o=function(t){return"next"===t?function(t){return t.toUpperCase()}:function(t){return t.toLowerCase()}}(t),i=function(t){return"next"===t?function(t){return t.toLowerCase()}:function(t){return t.toUpperCase()}}(t),a="next"===t?un:cn;var e=n.map((function(t){return{lower:i(t),upper:o(t)}})).sort((function(t,e){return a(t.lower,e.lower)}));u=e.map((function(t){return t.upper})),c=e.map((function(t){return t.lower})),s=t,f="next"===t?"":r}h("next");var p=new t.Collection(t,(function(){return pn(u[0],c[l-1]+r)}));p._ondirectionchange=function(t){h(t)};var d=0;return p._addAlgorithm((function(t,n,r){var o=t.key;if("string"!=typeof o)return!1;var h=i(o);if(e(h,c,d))return!0;for(var p=null,v=d;v<l;++v){var y=ln(o,h,u[v],c[v],a,s);null===y&&null===p?d=v+1:(null===p||a(p,y)>0)&&(p=y)}return n(null!==p?function(){t.continue(p+f)}:r),!1})),p}function pn(t,e,n,r){return{type:2,lower:t,upper:e,lowerOpen:n,upperOpen:r}}function dn(t){return{type:1,lower:t,upper:t}}var vn=function(){function t(){}return Object.defineProperty(t.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),t.prototype.between=function(t,e,n,r){n=!1!==n,r=!0===r;try{return this._cmp(t,e)>0||0===this._cmp(t,e)&&(n||r)&&(!n||!r)?fn(this):new this.Collection(this,(function(){return pn(t,e,!n,!r)}))}catch(t){return sn(this,Fe)}},t.prototype.equals=function(t){return null==t?sn(this,Fe):new this.Collection(this,(function(){return dn(t)}))},t.prototype.above=function(t){return null==t?sn(this,Fe):new this.Collection(this,(function(){return pn(t,void 0,!0)}))},t.prototype.aboveOrEqual=function(t){return null==t?sn(this,Fe):new this.Collection(this,(function(){return pn(t,void 0,!1)}))},t.prototype.below=function(t){return null==t?sn(this,Fe):new this.Collection(this,(function(){return pn(void 0,t,!1,!0)}))},t.prototype.belowOrEqual=function(t){return null==t?sn(this,Fe):new this.Collection(this,(function(){return pn(void 0,t)}))},t.prototype.startsWith=function(t){return"string"!=typeof t?sn(this,Be):this.between(t,t+De,!0,!0)},t.prototype.startsWithIgnoreCase=function(t){return""===t?this.startsWith(t):hn(this,(function(t,e){return 0===t.indexOf(e[0])}),[t],De)},t.prototype.equalsIgnoreCase=function(t){return hn(this,(function(t,e){return t===e[0]}),[t],"")},t.prototype.anyOfIgnoreCase=function(){var t=J.apply($,arguments);return 0===t.length?fn(this):hn(this,(function(t,e){return-1!==e.indexOf(t)}),t,"")},t.prototype.startsWithAnyOfIgnoreCase=function(){var t=J.apply($,arguments);return 0===t.length?fn(this):hn(this,(function(t,e){return e.some((function(e){return 0===t.indexOf(e)}))}),t,De)},t.prototype.anyOf=function(){var t=this,e=J.apply($,arguments),n=this._cmp;try{e.sort(n)}catch(t){return sn(this,Fe)}if(0===e.length)return fn(this);var r=new this.Collection(this,(function(){return pn(e[0],e[e.length-1])}));r._ondirectionchange=function(r){n="next"===r?t._ascending:t._descending,e.sort(n)};var o=0;return r._addAlgorithm((function(t,r,i){for(var a=t.key;n(a,e[o])>0;)if(++o===e.length)return r(i),!1;return 0===n(a,e[o])||(r((function(){t.continue(e[o])})),!1)})),r},t.prototype.notEqual=function(t){return this.inAnyRange([[Re,t],[t,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},t.prototype.noneOf=function(){var t=J.apply($,arguments);if(0===t.length)return new this.Collection(this);try{t.sort(this._ascending)}catch(t){return sn(this,Fe)}var e=t.reduce((function(t,e){return t?t.concat([[t[t.length-1][1],e]]):[[Re,e]]}),null);return e.push([t[t.length-1],this.db._maxKey]),this.inAnyRange(e,{includeLowers:!1,includeUppers:!1})},t.prototype.inAnyRange=function(t,e){var n=this,r=this._cmp,o=this._ascending,i=this._descending,a=this._min,u=this._max;if(0===t.length)return fn(this);if(!t.every((function(t){return void 0!==t[0]&&void 0!==t[1]&&o(t[0],t[1])<=0})))return sn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",vt.InvalidArgument);var c=!e||!1!==e.includeLowers,s=e&&!0===e.includeUppers;var f,l=o;function h(t,e){return l(t[0],e[0])}try{f=t.reduce((function(t,e){for(var n=0,o=t.length;n<o;++n){var i=t[n];if(r(e[0],i[1])<0&&r(e[1],i[0])>0){i[0]=a(i[0],e[0]),i[1]=u(i[1],e[1]);break}}return n===o&&t.push(e),t}),[]),f.sort(h)}catch(t){return sn(this,Fe)}var p=0,d=s?function(t){return o(t,f[p][1])>0}:function(t){return o(t,f[p][1])>=0},v=c?function(t){return i(t,f[p][0])>0}:function(t){return i(t,f[p][0])>=0};var y=d,m=new this.Collection(this,(function(){return pn(f[0][0],f[f.length-1][1],!c,!s)}));return m._ondirectionchange=function(t){"next"===t?(y=d,l=o):(y=v,l=i),f.sort(h)},m._addAlgorithm((function(t,e,r){for(var i=t.key;y(i);)if(++p===f.length)return e(r),!1;return!!function(t){return!d(t)&&!v(t)}(i)||(0===n._cmp(i,f[p][1])||0===n._cmp(i,f[p][0])||e((function(){l===o?t.continue(f[p][0]):t.continue(f[p][1])})),!1)})),m},t.prototype.startsWithAnyOf=function(){var t=J.apply($,arguments);return t.every((function(t){return"string"==typeof t}))?0===t.length?fn(this):this.inAnyRange(t.map((function(t){return[t,t+De]}))):sn(this,"startsWithAnyOf() only works with strings")},t}();function yn(t){return 1===t.length?t[0]:t}function mn(t){try{return t.only([[]]),[[]]}catch(t){return De}}function gn(t){return fe((function(e){return bn(e),t(e.target.error),!1}))}function bn(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault()}var wn=function(){function t(){}return t.prototype._lock=function(){return K(!zt.global),++this._reculock,1!==this._reculock||zt.global||(zt.lockOwnerFor=this),this},t.prototype._unlock=function(){if(K(!zt.global),0==--this._reculock)for(zt.global||(zt.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var t=this._blockedFuncs.shift();try{je(t[1],t[0])}catch(t){}}return this},t.prototype._locked=function(){return this._reculock&&zt.lockOwnerFor!==this},t.prototype.create=function(t){var e=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(K(!this.idbtrans),!t&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new vt.DatabaseClosed(r);case"MissingAPIError":throw new vt.MissingAPI(r.message,r);default:throw new vt.OpenFailed(r)}if(!this.active)throw new vt.TransactionInactive;return K(null===this._completion._state),(t=this.idbtrans=t||n.transaction(yn(this.storeNames),this.mode)).onerror=fe((function(n){bn(n),e._reject(t.error)})),t.onabort=fe((function(n){bn(n),e.active&&e._reject(new vt.Abort(t.error)),e.active=!1,e.on("abort").fire(n)})),t.oncomplete=fe((function(){e.active=!1,e._resolve()})),this},t.prototype._promise=function(t,e,n){var r=this;if("readwrite"===t&&"readwrite"!==this.mode)return Ce(new vt.ReadOnly("Transaction is readonly"));if(!this.active)return Ce(new vt.TransactionInactive);if(this._locked())return new Xt((function(o,i){r._blockedFuncs.push([function(){r._promise(t,e,n).then(o,i)},zt])}));if(n)return me((function(){var t=new Xt((function(t,n){r._lock();var o=e(t,n,r);o&&o.then&&o.then(t,n)}));return t.finally((function(){return r._unlock()})),t._lib=!0,t}));var o=new Xt((function(t,n){var o=e(t,n,r);o&&o.then&&o.then(t,n)}));return o._lib=!0,o},t.prototype._root=function(){return this.parent?this.parent._root():this},t.prototype.waitFor=function(t){var e=this._root(),n=Xt.resolve(t);if(e._waitingFor)e._waitingFor=e._waitingFor.then((function(){return n}));else{e._waitingFor=n,e._waitingQueue=[];var r=e.idbtrans.objectStore(e.storeNames[0]);!function t(){for(++e._spinCount;e._waitingQueue.length;)e._waitingQueue.shift()();e._waitingFor&&(r.get(-1/0).onsuccess=t)}()}var o=e._waitingFor;return new Xt((function(t,r){n.then((function(n){return e._waitingQueue.push(fe(t.bind(null,n)))}),(function(t){return e._waitingQueue.push(fe(r.bind(null,t)))})).finally((function(){e._waitingFor===o&&(e._waitingFor=null)}))}))},t.prototype.abort=function(){this.active&&this._reject(new vt.Abort),this.active=!1},t.prototype.table=function(t){var e=this._memoizedTables||(this._memoizedTables={});if(x(e,t))return e[t];var n=this.schema[t];if(!n)throw new vt.NotFound("Table "+t+" not part of transaction");var r=new this.db.Table(t,n,this);return r.core=this.db.core.table(t),e[t]=r,r},t}();function _n(t,e,n,r,o,i,a){return{name:t,keyPath:e,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+xn(e)}}function xn(t){return"string"==typeof t?t:t?"["+[].join.call(t,"+")+"]":""}function kn(t,e,n){return{name:t,primKey:e,indexes:n,mappedClass:null,idxByName:D(n,(function(t){return[t.name,t]}))}}function On(t){return null==t?function(){}:"string"==typeof t?function(t){return 1===t.split(".").length?function(e){return e[t]}:function(e){return R(e,t)}}(t):function(e){return R(e,t)}}function jn(t,e){return"delete"===e.type?e.keys:e.keys||e.values.map(t.extractKey)}function En(t){return[].slice.call(t)}var Pn=0;function Sn(t){return null==t?":id":"string"==typeof t?t:"["+t.join("+")+"]"}function Tn(t,e,n,r){var o=e.cmp.bind(e);function i(t){if(3===t.type)return null;if(4===t.type)throw new Error("Cannot convert never type to IDBKeyRange");var e=t.lower,r=t.upper,o=t.lowerOpen,i=t.upperOpen;return void 0===e?void 0===r?null:n.upperBound(r,!!i):void 0===r?n.lowerBound(e,!!o):n.bound(e,r,!!o,!!i)}var a=function(t,e){var n=En(t.objectStoreNames);return{schema:{name:t.name,tables:n.map((function(t){return e.objectStore(t)})).map((function(t){var e=t.keyPath,n=t.autoIncrement,r=m(e),o=null==e,i={},a={name:t.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:e,autoIncrement:n,unique:!0,extractKey:On(e)},indexes:En(t.indexNames).map((function(e){return t.index(e)})).map((function(t){var e=t.name,n=t.unique,r=t.multiEntry,o=t.keyPath,a={name:e,compound:m(o),keyPath:o,unique:n,multiEntry:r,extractKey:On(o)};return i[Sn(o)]=a,a})),getIndexByKeyPath:function(t){return i[Sn(t)]}};return i[":id"]=a.primaryKey,null!=e&&(i[Sn(e)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in e.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\\/|Edge\\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\\/(\\d*)/))[1]<604)}}(t,r),u=a.schema,c=a.hasGetAll,s=u.tables.map((function(t){return function(t){var e=t.name;return{name:e,schema:t,mutate:function(n){var r=n.trans,o=n.type,a=n.keys,u=n.values,c=n.range,s=n.wantResults;return new Promise((function(n,f){n=fe(n);var l=r.objectStore(e),h=null==l.keyPath,p="put"===o||"add"===o;if(!p&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var d=(a||u||{length:1}).length;if(a&&u&&a.length!==u.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return n({numFailures:0,failures:{},results:[],lastResult:void 0});var y,m=s&&v(a||jn(t.primaryKey,{type:o,keys:a,values:u})),g=[],b=0,w=function(t){++b,bn(t),m&&(m[t.target._reqno]=void 0),g[t.target._reqno]=t.target.error},_=function(t){var e=t.target;m[e._reqno]=e.result};if("deleteRange"===o){if(4===c.type)return n({numFailures:b,failures:g,results:m,lastResult:void 0});y=3===c.type?l.clear():l.delete(i(c))}else{var x=p?h?[u,a]:[u,null]:[a,null],k=x[0],O=x[1];if(p)for(var j=0;j<d;++j)(y=O&&void 0!==O[j]?l[o](k[j],O[j]):l[o](k[j]))._reqno=j,m&&void 0===m[j]&&(y.onsuccess=_),y.onerror=w;else for(j=0;j<d;++j)(y=l[o](k[j]))._reqno=j,y.onerror=w}var E=function(t){var e=t.target.result;m&&(m[d-1]=e),n({numFailures:b,failures:g,results:m,lastResult:e})};y.onerror=function(t){w(t),E(t)},y.onsuccess=E}))},getMany:function(t){var n=t.trans,r=t.keys;return new Promise((function(t,o){t=fe(t);for(var i,a=n.objectStore(e),u=r.length,c=new Array(u),s=0,f=0,l=function(e){var n=e.target;c[n._pos]=n.result,++f===s&&t(c)},h=gn(o),p=0;p<u;++p)null!=r[p]&&((i=a.get(r[p]))._pos=p,i.onsuccess=l,i.onerror=h,++s);0===s&&t(c)}))},get:function(t){var n=t.trans,r=t.key;return new Promise((function(t,o){t=fe(t);var i=n.objectStore(e).get(r);i.onsuccess=function(e){return t(e.target.result)},i.onerror=gn(o)}))},query:function(t){return function(n){return new Promise((function(r,o){r=fe(r);var a=n.trans,u=n.values,c=n.limit,s=n.query,f=c===1/0?void 0:c,l=s.index,h=s.range,p=a.objectStore(e),d=l.isPrimaryKey?p:p.index(l.name),v=i(h);if(0===c)return r({result:[]});if(t){var y=u?d.getAll(v,f):d.getAllKeys(v,f);y.onsuccess=function(t){return r({result:t.target.result})},y.onerror=gn(o)}else{var m=0,g=u||!("openKeyCursor"in d)?d.openCursor(v):d.openKeyCursor(v),b=[];g.onsuccess=function(t){var e=g.result;return e?(b.push(u?e.value:e.primaryKey),++m===c?r({result:b}):void e.continue()):r({result:b})},g.onerror=gn(o)}}))}}(c),openCursor:function(t){var n=t.trans,r=t.values,o=t.query,a=t.reverse,u=t.unique;return new Promise((function(t,c){t=fe(t);var s=o.index,f=o.range,l=n.objectStore(e),h=s.isPrimaryKey?l:l.index(s.name),p=a?u?"prevunique":"prev":u?"nextunique":"next",d=r||!("openKeyCursor"in h)?h.openCursor(i(f),p):h.openKeyCursor(i(f),p);d.onerror=gn(c),d.onsuccess=fe((function(e){var r=d.result;if(r){r.___id=++Pn,r.done=!1;var o=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));var a=r.advance.bind(r),u=function(){throw new Error("Cursor not stopped")};r.trans=n,r.stop=r.continue=r.continuePrimaryKey=r.advance=function(){throw new Error("Cursor not started")},r.fail=fe(c),r.next=function(){var t=this,e=1;return this.start((function(){return e--?t.continue():t.stop()})).then((function(){return t}))},r.start=function(t){var e=new Promise((function(t,e){t=fe(t),d.onerror=gn(e),r.fail=e,r.stop=function(e){r.stop=r.continue=r.continuePrimaryKey=r.advance=u,t(e)}})),n=function(){if(d.result)try{t()}catch(t){r.fail(t)}else r.done=!0,r.start=function(){throw new Error("Cursor behind last entry")},r.stop()};return d.onsuccess=fe((function(t){d.onsuccess=n,n()})),r.continue=o,r.continuePrimaryKey=i,r.advance=a,n(),e},t(r)}else t(null)}),c)}))},count:function(t){var n=t.query,r=t.trans,o=n.index,a=n.range;return new Promise((function(t,n){var u=r.objectStore(e),c=o.isPrimaryKey?u:u.index(o.name),s=i(a),f=s?c.count(s):c.count();f.onsuccess=fe((function(e){return t(e.target.result)})),f.onerror=gn(n)}))}}}(t)})),f={};return s.forEach((function(t){return f[t.name]=t})),{stack:"dbcore",transaction:t.transaction.bind(t),table:function(t){if(!f[t])throw new Error("Table \'"+t+"\' not found");return f[t]},cmp:o,MIN_KEY:-1/0,MAX_KEY:mn(n),schema:u}}function An(t,e,n,r){var o=n.IDBKeyRange,i=function(t,e){return e.reduce((function(t,e){var n=e.create;return d(d({},t),n(t))}),t)}(Tn(e,n.indexedDB,o,r),t.dbcore);return{dbcore:i}}function Cn(t,e){var n=e.db,r=An(t._middlewares,n,t._deps,e);t.core=r.dbcore,t.tables.forEach((function(e){var n=e.name;t.core.schema.tables.some((function(t){return t.name===n}))&&(e.core=t.core.table(n),t[n]instanceof t.Table&&(t[n].core=e.core))}))}function Kn(t,e,n,r){n.forEach((function(n){var o=r[n];e.forEach((function(e){var r=S(e,n);(!r||"value"in r&&void 0===r.value)&&(e===t.Transaction.prototype||e instanceof t.Transaction?j(e,n,{get:function(){return this.table(n)},set:function(t){O(this,n,{value:t,writable:!0,configurable:!0,enumerable:!0})}}):e[n]=new t.Table(n,o))}))}))}function In(t,e){e.forEach((function(e){for(var n in e)e[n]instanceof t.Table&&delete e[n]}))}function Dn(t,e){return t._cfg.version-e._cfg.version}function Rn(t,e,n,r){var o=t._dbSchema,i=t._createTransaction("readwrite",t._storeNames,o);i.create(n),i._completion.catch(r);var a=i._reject.bind(i),u=zt.transless||zt;me((function(){zt.trans=i,zt.transless=u,0===e?(y(o).forEach((function(t){Bn(n,t,o[t].primKey,o[t].indexes)})),Cn(t,n),Xt.follow((function(){return t.on.populate.fire(i)})).catch(a)):function(t,e,n,r){var o=[],i=t._versions,a=t._dbSchema=Mn(t,t.idbdb,r),u=!1;function c(){return o.length?Xt.resolve(o.shift()(n.idbtrans)).then(c):Xt.resolve()}return i.filter((function(t){return t._cfg.version>=e})).forEach((function(i){o.push((function(){var o=a,c=i._cfg.dbschema;qn(t,o,r),qn(t,c,r),a=t._dbSchema=c;var s=Fn(o,c);s.add.forEach((function(t){Bn(r,t[0],t[1].primKey,t[1].indexes)})),s.change.forEach((function(t){if(t.recreate)throw new vt.Upgrade("Not yet support for changing primary key");var e=r.objectStore(t.name);t.add.forEach((function(t){return Nn(e,t)})),t.change.forEach((function(t){e.deleteIndex(t.name),Nn(e,t)})),t.del.forEach((function(t){return e.deleteIndex(t)}))}));var f=i._cfg.contentUpgrade;if(f&&i._cfg.version>e){Cn(t,r),n._memoizedTables={},u=!0;var l=N(c);s.del.forEach((function(t){l[t]=o[t]})),In(t,[t.Transaction.prototype]),Kn(t,[t.Transaction.prototype],y(l),l),n.schema=l;var h,p=Z(f);p&&ge();var d=Xt.follow((function(){if((h=f(n))&&p){var t=be.bind(null,null);h.then(t,t)}}));return h&&"function"==typeof h.then?Xt.resolve(h):d.then((function(){return h}))}})),o.push((function(e){u&&qe||function(t,e){for(var n=0;n<e.db.objectStoreNames.length;++n){var r=e.db.objectStoreNames[n];null==t[r]&&e.db.deleteObjectStore(r)}}(i._cfg.dbschema,e);In(t,[t.Transaction.prototype]),Kn(t,[t.Transaction.prototype],t._storeNames,t._dbSchema),n.schema=t._dbSchema}))})),c().then((function(){var t,e;e=r,y(t=a).forEach((function(n){e.db.objectStoreNames.contains(n)||Bn(e,n,t[n].primKey,t[n].indexes)}))}))}(t,e,i,n).catch(a)}))}function Fn(t,e){var n,r={del:[],add:[],change:[]};for(n in t)e[n]||r.del.push(n);for(n in e){var o=t[n],i=e[n];if(o){var a={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!Me)a.recreate=!0,r.change.push(a);else{var u=o.idxByName,c=i.idxByName,s=void 0;for(s in u)c[s]||a.del.push(s);for(s in c){var f=u[s],l=c[s];f?f.src!==l.src&&a.change.push(l):a.add.push(l)}(a.del.length>0||a.add.length>0||a.change.length>0)&&r.change.push(a)}}else r.add.push([n,i])}return r}function Bn(t,e,n,r){var o=t.db.createObjectStore(e,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(t){return Nn(o,t)})),o}function Nn(t,e){t.createIndex(e.name,e.keyPath,{unique:e.unique,multiEntry:e.multi})}function Mn(t,e,n){var r={};return A(e.objectStoreNames,0).forEach((function(t){for(var e=n.objectStore(t),o=e.keyPath,i=_n(xn(o),o||"",!1,!1,!!e.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<e.indexNames.length;++u){var c=e.index(e.indexNames[u]);o=c.keyPath;var s=_n(c.name,o,!!c.unique,!!c.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(s)}r[t]=kn(t,i,a)})),r}function qn(t,e,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var i=r[o],a=n.objectStore(i);t._hasGetAll="getAll"in a;for(var u=0;u<a.indexNames.length;++u){var c=a.indexNames[u],s=a.index(c).keyPath,f="string"==typeof s?s:"["+A(s).join("+")+"]";if(e[i]){var l=e[i].idxByName[f];l&&(l.name=c,delete e[i].idxByName[f],e[i].idxByName[c]=l)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\\/|Edge\\/)/.test(navigator.userAgent)&&g.WorkerGlobalScope&&g instanceof g.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\\/(\\d*)/))[1]<604&&(t._hasGetAll=!1)}var Ln,Un=function(){function t(){}return t.prototype._parseStoresSpec=function(t,e){y(t).forEach((function(n){if(null!==t[n]){var r=t[n].split(",").map((function(t,e){var n=(t=t.trim()).replace(/([&*]|\\+\\+)/g,""),r=/^\\[/.test(n)?n.match(/^\\[(.*)\\]$/)[1].split("+"):n;return _n(n,r||null,/\\&/.test(t),/\\*/.test(t),/\\+\\+/.test(t),m(r),0===e)})),o=r.shift();if(o.multi)throw new vt.Schema("Primary key cannot be multi-valued");r.forEach((function(t){if(t.auto)throw new vt.Schema("Only primary key can be marked as autoIncrement (++)");if(!t.keyPath)throw new vt.Schema("Index must have a name and cannot be an empty string")})),e[n]=kn(n,o,r)}}))},t.prototype.stores=function(t){var e=this.db;this._cfg.storesSource=this._cfg.storesSource?b(this._cfg.storesSource,t):t;var n=e._versions,r={},o={};return n.forEach((function(t){b(r,t._cfg.storesSource),o=t._cfg.dbschema={},t._parseStoresSpec(r,o)})),e._dbSchema=o,In(e,[e._allTables,e,e.Transaction.prototype]),Kn(e,[e._allTables,e,e.Transaction.prototype,this._cfg.tables],y(o),o),e._storeNames=y(o),this},t.prototype.upgrade=function(t){return this._cfg.contentUpgrade=t,this},t}();function Gn(t){return me((function(){return zt.letThrough=!0,t()}))}function Wn(t){var e=t._state,n=t._deps.indexedDB;if(e.isBeingOpened||t.idbdb)return e.dbReadyPromise.then((function(){return e.dbOpenError?Ce(e.dbOpenError):t}));tt&&(e.openCanceller._stackHolder=ot()),e.isBeingOpened=!0,e.dbOpenError=null,e.openComplete=!1;var r=e.dbReadyResolve,o=null;return Xt.race([e.openCanceller,new Xt((function(r,i){if(!n)throw new vt.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 a=t.name,u=e.autoSchema?n.open(a):n.open(a,Math.round(10*t.verno));if(!u)throw new vt.MissingAPI("IndexedDB API not available");u.onerror=gn(i),u.onblocked=fe(t._fireOnBlocked),u.onupgradeneeded=fe((function(r){if(o=u.transaction,e.autoSchema&&!t._options.allowEmptyDB){u.onerror=bn,o.abort(),u.result.close();var c=n.deleteDatabase(a);c.onsuccess=c.onerror=fe((function(){i(new vt.NoSuchDatabase("Database "+a+" doesnt exist"))}))}else{o.onerror=gn(i);var s=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;t.idbdb=u.result,Rn(t,s/10,o,i)}}),i),u.onsuccess=fe((function(){o=null;var n=t.idbdb=u.result,i=A(n.objectStoreNames);if(i.length>0)try{var c=n.transaction(yn(i),"readonly");e.autoSchema?function(t,e,n){t.verno=e.version/10;var r=t._dbSchema=Mn(0,e,n);t._storeNames=A(e.objectStoreNames,0),Kn(t,[t._allTables],y(r),r)}(t,n,c):(qn(t,t._dbSchema,c),function(t,e){var n=Fn(Mn(0,t.idbdb,e),t._dbSchema);return!(n.add.length||n.change.some((function(t){return t.add.length||t.change.length})))}(t,c)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Cn(t,c)}catch(t){}Ne.push(t),n.onversionchange=fe((function(n){e.vcFired=!0,t.on("versionchange").fire(n)})),Ln.add(a),r()}),i)}))]).then((function(){return e.onReadyBeingFired=[],Xt.resolve(Gn(t.on.ready.fire)).then((function t(){if(e.onReadyBeingFired.length>0){var n=e.onReadyBeingFired.reduce(Et,gt);return e.onReadyBeingFired=[],Xt.resolve(Gn(n)).then(t)}}))})).finally((function(){e.onReadyBeingFired=null})).then((function(){return e.isBeingOpened=!1,t})).catch((function(n){try{o&&o.abort()}catch(t){}return e.isBeingOpened=!1,t.close(),e.dbOpenError=n,Ce(e.dbOpenError)})).finally((function(){e.openComplete=!0,r()}))}function zn(t){var e=function(e){return t.next(e)},n=o(e),r=o((function(e){return t.throw(e)}));function o(t){return function(e){var o=t(e),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):m(i)?Promise.all(i).then(n,r):n(i)}}return o(e)()}function Vn(t,e,n){var r=arguments.length;if(r<2)throw new vt.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];n=o.pop();var i=q(o);return[t,i,n]}function Yn(t,e,n,r,o){return Xt.resolve().then((function(){var i=zt.transless||zt,a=t._createTransaction(e,n,t._dbSchema,r),u={trans:a,transless:i};r?a.idbtrans=r.idbtrans:a.create();var c,s=Z(o);s&&ge();var f=Xt.follow((function(){if(c=o.call(a,a))if(s){var t=be.bind(null,null);c.then(t,t)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=zn(c))}),u);return(c&&"function"==typeof c.then?Xt.resolve(c).then((function(t){return a.active?t:Ce(new vt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):f.then((function(){return c}))).then((function(t){return r&&a._resolve(),a._completion.then((function(){return t}))})).catch((function(t){return a._reject(t),Ce(t)}))}))}function Hn(t,e,n){for(var r=m(t)?t.slice():[t],o=0;o<n;++o)r.push(e);return r}var Xn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(t){return d(d({},t),{table:function(e){var n=t.table(e),r=n.schema,o={},i=[];function a(t,e,n){var r=Sn(t),u=o[r]=o[r]||[],c=null==t?0:"string"==typeof t?1:t.length,s=e>0,f=d(d({},n),{isVirtual:s,isPrimaryKey:!s&&n.isPrimaryKey,keyTail:e,keyLength:c,extractKey:On(t),unique:!s&&n.unique});(u.push(f),f.isPrimaryKey||i.push(f),c>1)&&a(2===c?t[0]:t.slice(0,c-1),e+1,n);return u.sort((function(t,e){return t.keyTail-e.keyTail})),f}var u=a(r.primaryKey.keyPath,0,r.primaryKey);o[":id"]=[u];for(var c=0,s=r.indexes;c<s.length;c++){var f=s[c];a(f.keyPath,0,f)}function l(e){var n,r,o=e.query.index;return o.isVirtual?d(d({},e),{query:{index:o,range:(n=e.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:Hn(n.lower,n.lowerOpen?t.MAX_KEY:t.MIN_KEY,r),lowerOpen:!0,upper:Hn(n.upper,n.upperOpen?t.MIN_KEY:t.MAX_KEY,r),upperOpen:!0})}}):e}var h=d(d({},n),{schema:d(d({},r),{primaryKey:u,indexes:i,getIndexByKeyPath:function(t){var e=o[Sn(t)];return e&&e[0]}}),count:function(t){return n.count(l(t))},query:function(t){return n.query(l(t))},openCursor:function(e){var r=e.query.index,o=r.keyTail,i=r.isVirtual,a=r.keyLength;if(!i)return n.openCursor(e);return n.openCursor(l(e)).then((function(n){return n&&function(n){var r=Object.create(n,{continue:{value:function(r){null!=r?n.continue(Hn(r,e.reverse?t.MAX_KEY:t.MIN_KEY,o)):e.unique?n.continue(Hn(n.key,e.reverse?t.MIN_KEY:t.MAX_KEY,o)):n.continue()}},continuePrimaryKey:{value:function(e,r){n.continuePrimaryKey(Hn(e,t.MAX_KEY,o),r)}},key:{get:function(){var t=n.key;return 1===a?t[0]:t.slice(0,a)}},value:{get:function(){return n.value}}});return r}(n)}))}});return h}})}},Qn={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(t){return d(d({},t),{table:function(e){var n=t.table(e),r=n.schema.primaryKey,o=d(d({},n),{mutate:function(t){var o=zt.trans,i=o.table(e).hook,a=i.deleting,u=i.creating,c=i.updating;switch(t.type){case"add":if(u.fire===gt)break;return o._promise("readwrite",(function(){return s(t)}),!0);case"put":if(u.fire===gt&&c.fire===gt)break;return o._promise("readwrite",(function(){return s(t)}),!0);case"delete":if(a.fire===gt)break;return o._promise("readwrite",(function(){return s(t)}),!0);case"deleteRange":if(a.fire===gt)break;return o._promise("readwrite",(function(){return function(t){return f(t.trans,t.range,1e4)}(t)}),!0)}return n.mutate(t);function s(t){var e=zt.trans,o=t.keys||jn(r,t);if(!o)throw new Error("Keys missing");return"delete"!==(t="add"===t.type||"put"===t.type?d(d({},t),{keys:o,wantResults:!0}):d({},t)).type&&(t.values=v(t.values)),t.keys&&(t.keys=v(t.keys)),function(t,e,n){return"add"===e.type?Promise.resolve(new Array(e.values.length)):t.getMany({trans:e.trans,keys:n})}(n,t,o).then((function(i){var s=o.map((function(n,o){var s=i[o],f={onerror:null,onsuccess:null};if("delete"===t.type)a.fire.call(f,n,s,e);else if("add"===t.type||void 0===s){var l=u.fire.call(f,n,t.values[o],e);null==n&&null!=l&&(n=l,t.keys[o]=n,r.outbound||F(t.values[o],r.keyPath,n))}else{var h=H(s,t.values[o]),p=c.fire.call(f,h,n,s,e);if(p){var d=t.values[o];Object.keys(p).forEach((function(t){x(d,t)?d[t]=p[t]:F(d,t,p[t])}))}}return f}));return n.mutate(t).then((function(e){for(var n=e.failures,r=e.results,a=e.numFailures,u=e.lastResult,c=0;c<o.length;++c){var f=r?r[c]:o[c],l=s[c];null==f?l.onerror&&l.onerror(n[c]):l.onsuccess&&l.onsuccess("put"===t.type&&i[c]?t.values[c]:f)}return{failures:n,results:r,numFailures:a,lastResult:u}})).catch((function(t){return s.forEach((function(e){return e.onerror&&e.onerror(t)})),Promise.reject(t)}))}))}function f(t,e,o){return n.query({trans:t,values:!1,query:{index:r,range:e},limit:o}).then((function(n){var r=n.result;return s({type:"delete",keys:r,trans:t}).then((function(n){return n.numFailures>0?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:f(t,d(d({},e),{lower:r[r.length-1],lowerOpen:!0}),o)}))}))}}});return o}})}},$n=function(){function t(e,n){var r=this;this._middlewares={},this.verno=0;var o=t.dependencies;this._options=n=d({addons:t.addons,autoOpen:!0,indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var i=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null;var a={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:gt,dbReadyPromise:null,cancelOpen:gt,openCanceller:null,autoSchema:!0};a.dbReadyPromise=new Xt((function(t){a.dbReadyResolve=t})),a.openCanceller=new Xt((function(t,e){a.cancelOpen=e})),this._state=a,this.name=e,this.on=Qe(this,"populate","blocked","versionchange",{ready:[Et,gt]}),this.on.ready.subscribe=C(this.on.ready.subscribe,(function(e){return function(n,o){t.vip((function(){var t=r._state;if(t.openComplete)t.dbOpenError||Xt.resolve().then(n),o&&e(n);else if(t.onReadyBeingFired)t.onReadyBeingFired.push(n),o&&e(n);else{e(n);var i=r;o||e((function t(){i.on.ready.unsubscribe(n),i.on.ready.unsubscribe(t)}))}}))}})),this.Collection=function(t){return $e(an.prototype,(function(e,n){this.db=t;var r=Ye,o=null;if(n)try{r=n()}catch(t){o=t}var i=e._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:r,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!==bt?u:null}}))}(this),this.Table=function(t){return $e(Xe.prototype,(function(e,n,r){this.db=t,this._tx=r,this.name=e,this.schema=n,this.hook=t._allTables[e]?t._allTables[e].hook:Qe(null,{creating:[xt,gt],reading:[wt,bt],updating:[Ot,gt],deleting:[kt,gt]})}))}(this),this.Transaction=function(t){return $e(wn.prototype,(function(e,n,r,o){var i=this;this.db=t,this.mode=e,this.storeNames=n,this.schema=r,this.idbtrans=null,this.on=Qe(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 Xt((function(t,e){i._resolve=t,i._reject=e})),this._completion.then((function(){i.active=!1,i.on.complete.fire()}),(function(t){var e=i.active;return i.active=!1,i.on.error.fire(t),i.parent?i.parent._reject(t):e&&i.idbtrans&&i.idbtrans.abort(),Ce(t)}))}))}(this),this.Version=function(t){return $e(Un.prototype,(function(e){this.db=t,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(t){return $e(vn.prototype,(function(e,n,r){this.db=t,this._ctx={table:e,index:":id"===n?null:n,or:r};var o=t._deps.indexedDB;if(!o)throw new vt.MissingAPI("indexedDB API missing");this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(t,e){return o.cmp(e,t)},this._max=function(t,e){return o.cmp(t,e)>0?t:e},this._min=function(t,e){return o.cmp(t,e)<0?t:e},this._IDBKeyRange=t._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(t){t.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(t){!t.newVersion||t.newVersion<t.oldVersion?console.warn("Dexie.delete(\'"+r.name+"\') was blocked"):console.warn("Upgrade \'"+r.name+"\' blocked by other connection holding version "+t.oldVersion/10)})),this._maxKey=mn(n.IDBKeyRange),this._createTransaction=function(t,e,n,o){return new r.Transaction(t,e,n,o)},this._fireOnBlocked=function(t){r.on("blocked").fire(t),Ne.filter((function(t){return t.name===r.name&&t!==r&&!t._state.vcFired})).map((function(e){return e.on("versionchange").fire(t)}))},this.use(Xn),this.use(Qn),i.forEach((function(t){return t(r)}))}return t.prototype.version=function(t){if(isNaN(t)||t<.1)throw new vt.Type("Given version is not a positive number");if(t=Math.round(10*t)/10,this.idbdb||this._state.isBeingOpened)throw new vt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,t);var e=this._versions,n=e.filter((function(e){return e._cfg.version===t}))[0];return n||(n=new this.Version(t),e.push(n),e.sort(Dn),n.stores({}),this._state.autoSchema=!1,n)},t.prototype._whenReady=function(t){var e=this;return this._state.openComplete||zt.letThrough?t():new Xt((function(t,n){if(!e._state.isBeingOpened){if(!e._options.autoOpen)return void n(new vt.DatabaseClosed);e.open().catch(gt)}e._state.dbReadyPromise.then(t,n)})).then(t)},t.prototype.use=function(t){var e=t.stack,n=t.create,r=t.level,o=t.name;o&&this.unuse({stack:e,name:o});var i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:n,level:null==r?10:r,name:o}),i.sort((function(t,e){return t.level-e.level})),this},t.prototype.unuse=function(t){var e=t.stack,n=t.name,r=t.create;return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((function(t){return r?t.create!==r:!!n&&t.name!==n}))),this},t.prototype.open=function(){return Wn(this)},t.prototype.close=function(){var t=Ne.indexOf(this),e=this._state;if(t>=0&&Ne.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(t){}this.idbdb=null}this._options.autoOpen=!1,e.dbOpenError=new vt.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError),e.dbReadyPromise=new Xt((function(t){e.dbReadyResolve=t})),e.openCanceller=new Xt((function(t,n){e.cancelOpen=n}))},t.prototype.delete=function(){var t=this,e=arguments.length>0,n=this._state;return new Xt((function(r,o){var i=function(){t.close();var e=t._deps.indexedDB.deleteDatabase(t.name);e.onsuccess=fe((function(){Ln.remove(t.name),r()})),e.onerror=gn(o),e.onblocked=t._fireOnBlocked};if(e)throw new vt.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(i):i()}))},t.prototype.backendDB=function(){return this.idbdb},t.prototype.isOpen=function(){return null!==this.idbdb},t.prototype.hasBeenClosed=function(){var t=this._state.dbOpenError;return t&&"DatabaseClosed"===t.name},t.prototype.hasFailed=function(){return null!==this._state.dbOpenError},t.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(t.prototype,"tables",{get:function(){var t=this;return y(this._allTables).map((function(e){return t._allTables[e]}))},enumerable:!0,configurable:!0}),t.prototype.transaction=function(){var t=Vn.apply(this,arguments);return this._transaction.apply(this,t)},t.prototype._transaction=function(t,e,n){var r=this,o=zt.trans;o&&o.db===this&&-1===t.indexOf("!")||(o=null);var i,a,u=-1!==t.indexOf("?");t=t.replace("!","").replace("?","");try{if(a=e.map((function(t){var e=t instanceof r.Table?t.name:t;if("string"!=typeof e)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e})),"r"==t||t===We)i=We;else{if("rw"!=t&&t!=ze)throw new vt.InvalidArgument("Invalid transaction mode: "+t);i=ze}if(o){if(o.mode===We&&i===ze){if(!u)throw new vt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach((function(t){if(o&&-1===o.storeNames.indexOf(t)){if(!u)throw new vt.SubTransaction("Table "+t+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(t){return o?o._promise(null,(function(e,n){n(t)})):Ce(t)}var c=Yn.bind(null,this,i,a,o,n);return o?o._promise(i,c,"lock"):zt.trans?je(zt.transless,(function(){return r._whenReady(c)})):this._whenReady(c)},t.prototype.table=function(t){if(!x(this._allTables,t))throw new vt.InvalidTable("Table "+t+" does not exist");return this._allTables[t]},t}(),Jn=$n;k(Jn,d(d({},mt),{delete:function(t){return new Jn(t).delete()},exists:function(t){return new Jn(t,{addons:[]}).open().then((function(t){return t.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(t){return Ln?Ln.getDatabaseNames().then(t):Xt.resolve([])},defineClass:function(){return function(t){b(this,t)}},ignoreTransaction:function(t){return zt.trans?je(zt.transless,t):t()},vip:Gn,async:function(t){return function(){try{var e=zn(t.apply(this,arguments));return e&&"function"==typeof e.then?e:Xt.resolve(e)}catch(t){return Ce(t)}}},spawn:function(t,e,n){try{var r=zn(t.apply(n,e||[]));return r&&"function"==typeof r.then?r:Xt.resolve(r)}catch(t){return Ce(t)}},currentTransaction:{get:function(){return zt.trans||null}},waitFor:function(t,e){var n=Xt.resolve("function"==typeof t?Jn.ignoreTransaction(t):t).timeout(e||6e4);return zt.trans?zt.trans.waitFor(n):n},Promise:Xt,debug:{get:function(){return tt},set:function(t){et(t,"dexie"===t?function(){return!0}:Ue)}},derive:E,extend:b,props:k,override:C,Events:Qe,getByKeyPath:R,setByKeyPath:F,delByKeyPath:B,shallowClone:N,deepClone:W,getObjectDiff:H,asap:I,minKey:Re,addons:[],connections:Ne,errnames:pt,dependencies:function(){try{return{indexedDB:g.indexedDB||g.mozIndexedDB||g.webkitIndexedDB||g.msIndexedDB,IDBKeyRange:g.IDBKeyRange||g.webkitIDBKeyRange}}catch(t){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:Ie,version:Ie.split(".").map((function(t){return parseInt(t)})).reduce((function(t,e,n){return t+e/Math.pow(10,2*n)})),default:Jn,Dexie:Jn})),Jn.maxKey=mn(Jn.dependencies.IDBKeyRange),function(t){try{Ln=function(t){var e,n=t&&"function"==typeof t.databases;if(!n){var r=new $n(Ge,{addons:[]});r.version(1).stores({dbnames:"name"}),e=r.table("dbnames")}return{getDatabaseNames:function(){return n?Xt.resolve(t.databases()).then((function(t){return t.map((function(t){return t.name})).filter((function(t){return t!==Ge}))})):e.toCollection().primaryKeys()},add:function(t){return!n&&t!==Ge&&e.put({name:t}).catch(gt)},remove:function(t){return!n&&t!==Ge&&e.delete(t).catch(gt)}}}(t)}catch(t){}}($n.dependencies.indexedDB),Xt.rejectionMapper=function(t,e){if(!t||t instanceof st||t instanceof TypeError||t instanceof SyntaxError||!t.name||!yt[t.name])return t;var n=new yt[t.name](e||t.message,t);return"stack"in t&&j(n,"stack",{get:function(){return this.inner.stack}}),n},et(tt,Ue);function Zn(t){var e=function(){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(t){return!1}}();return function(){var n,r=p(t);if(e){var o=p(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}var tr=new(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(n,t);var e=Zn(n);function n(){var t;return u(this,n),(t=e.call(this,"AgoraLogger")).logs=void 0,t.openDatabase(),t.logs=t.table("logs"),t}return s(n,[{key:"openDatabase",value:function(){this.version(1).stores({logs:"++id, content, created_at"})}}]),n}($n)),er=(n(1539),n(8674),function(){function t(){u(this,t),this.mutex=Promise.resolve()}var n;return s(t,[{key:"lock",value:function(){var t=function(t){};return this.mutex=this.mutex.then((function(){return new Promise(t)})),new Promise((function(e){t=e}))}},{key:"dispatch",value:(n=e(o().mark((function t(e){var n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.lock();case 2:return n=t.sent,t.prev=3,t.next=6,Promise.resolve(e());case 6:return t.abrupt("return",t.sent);case 7:return t.prev=7,n(),t.finish(7);case 10:case"end":return t.stop()}}),t,this,[[3,,7,10]])}))),function(t){return n.apply(this,arguments)})}]),t}());console.log("[log worker] log worker initialzied");var nr=self,rr=new er,or=[],ir=function(){var t;(t=console).debug.apply(t,arguments)},ar=a()((function(){rr.dispatch(e(o().mark((function t(){var e,n,r,i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=(new Date).getTime(),n=or,or=[],t.prev=3,t.next=6,tr.logs.count();case 6:if(r=t.sent,!((i=n.length+r-5e4)>0)){t.next=12;break}return t.next=11,tr.logs.orderBy(":id").reverse().limit(i).delete();case 11:console.debug("[log worker] clear ".concat(i," records"));case 12:t.next=17;break;case 14:t.prev=14,t.t0=t.catch(3),console.error("[log worker] clear db failed");case 17:return t.prev=17,t.next=20,tr.logs.bulkPut(n);case 20:t.next=25;break;case 22:t.prev=22,t.t1=t.catch(17),console.error("[log worker] bulkPut ".concat(n.length," failed"));case 25:a=(new Date).getTime(),ir("[log worker] done writing ".concat(n.length," records in ").concat(a-e,"ms"));case 27:case"end":return t.stop()}}),t,null,[[3,14],[17,22]])}))))}),2e3,{maxWait:3e4});nr.onmessage=function(){var t=e(o().mark((function t(e){var n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.data&&"log"===e.data.type&&(n=new Date,or.push({content:e.data.data,created_at:+Date.now(),timestamp:"".concat(n)}),ar());case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})()})();',"Worker",void 0,__webpack_require__.p+"index.worker.js")}var O=function(){return O=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},O.apply(this,arguments)};function N(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}var x=Object.keys,D=Array.isArray,L="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function P(e,t){return"object"!=typeof t||x(t).forEach((function(r){e[r]=t[r]})),e}"undefined"==typeof Promise||L.Promise||(L.Promise=Promise);var B=Object.getPrototypeOf,M={}.hasOwnProperty;function j(e,t){return M.call(e,t)}function U(e,t){"function"==typeof t&&(t=t(B(e))),x(t).forEach((function(r){Q(e,r,t[r])}))}var F=Object.defineProperty;function Q(e,t,r,n){F(e,t,P(r&&j(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function q(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Q(e.prototype,"constructor",e),{extend:U.bind(null,e.prototype)}}}}var G=Object.getOwnPropertyDescriptor;function V(e,t){var r;return G(e,t)||(r=B(e))&&V(r,t)}var K=[].slice;function H(e,t,r){return K.call(e,t,r)}function z(e,t){return t(e)}function W(e){if(!e)throw new Error("Assertion Failed")}function Y(e){L.setImmediate?setImmediate(e):setTimeout(e,0)}function J(e,t){return e.reduce((function(e,r,n){var i=t(r,n);return i&&(e[i[0]]=i[1]),e}),{})}function X(e,t){if(j(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,i=t.length;n<i;++n){var o=X(e,t[n]);r.push(o)}return r}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return void 0===s?void 0:X(s,t.substr(a+1))}}function Z(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){W("string"!=typeof r&&"length"in r);for(var n=0,i=t.length;n<i;++n)Z(e,t[n],r[n])}else{var o=t.indexOf(".");if(-1!==o){var a=t.substr(0,o),s=t.substr(o+1);if(""===s)void 0===r?D(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=r;else{var c=e[a];c||(c=e[a]={}),Z(c,s,r)}}else void 0===r?D(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function $(e,t){"string"==typeof t?Z(e,t,void 0):"length"in t&&[].map.call(t,(function(t){Z(e,t,void 0)}))}function ee(e){var t={};for(var r in e)j(e,r)&&(t[r]=e[r]);return t}var te=[].concat;function re(e){return te.apply([],e)}var ne="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(re([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return L[e]})),ie=ne.map((function(e){return L[e]})),oe=J(ne,(function(e){return[e,!0]}));function ae(e){if(!e||"object"!=typeof e)return e;var t;if(D(e)){t=[];for(var r=0,n=e.length;r<n;++r)t.push(ae(e[r]))}else if(ie.indexOf(e.constructor)>=0)t=e;else for(var i in t=e.constructor?Object.create(e.constructor.prototype):{},e)j(e,i)&&(t[i]=ae(e[i]));return t}var se={}.toString;function ce(e){return se.call(e).slice(8,-1)}var ue=function(e,t){return"Array"===t?""+e.map((function(e){return ue(e,ce(e))})):"ArrayBuffer"===t?""+new Uint8Array(e):"Date"===t?e.getTime():ArrayBuffer.isView(e)?""+new Uint8Array(e.buffer):e};function le(e,t,r,n){return r=r||{},n=n||"",x(e).forEach((function(i){if(j(t,i)){var o=e[i],a=t[i];if("object"==typeof o&&"object"==typeof a&&o&&a){var s=ce(o),c=ce(a);s===c?oe[s]?ue(o,s)!==ue(a,c)&&(r[n+i]=t[i]):le(o,a,r,n+i+"."):r[n+i]=t[i]}else o!==a&&(r[n+i]=t[i])}else r[n+i]=void 0})),x(t).forEach((function(i){j(e,i)||(r[n+i]=t[i])})),r}var he="undefined"!=typeof Symbol&&Symbol.iterator,fe=he?function(e){var t;return null!=e&&(t=e[he])&&t.apply(e)}:function(){return null},de={};function pe(e){var t,r,n,i;if(1===arguments.length){if(D(e))return e.slice();if(this===de&&"string"==typeof e)return[e];if(i=fe(e)){for(r=[];!(n=i.next()).done;)r.push(n.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 ge="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},ve="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Ae(e,t){ve=e,me=t}var me=function(){return!0},ye=!new Error("").stack;function _e(){if(ye)try{throw new Error}catch(e){return e}return new Error}function be(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(me).map((function(e){return"\n"+e})).join("")):""}var Ee=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],we=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ee),Ie={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function Ce(e,t){this._e=_e(),this.name=e,this.message=t}function Se(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 Te(e,t,r,n){this._e=_e(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=Se(e,t)}function Re(e,t){this._e=_e(),this.name="BulkError",this.failures=t,this.message=Se(e,t)}q(Ce).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+be(this._e,2))}},toString:function(){return this.name+": "+this.message}}),q(Te).from(Ce),q(Re).from(Ce);var ke=we.reduce((function(e,t){return e[t]=t+"Error",e}),{}),Oe=Ce,Ne=we.reduce((function(e,t){var r=t+"Error";function n(e,n){this._e=_e(),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=Ie[t]||r,this.inner=null)}return q(n).from(Oe),e[t]=n,e}),{});Ne.Syntax=SyntaxError,Ne.Type=TypeError,Ne.Range=RangeError;var xe=Ee.reduce((function(e,t){return e[t+"Error"]=Ne[t],e}),{});var De=we.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Ne[t]),e}),{});function Le(){}function Pe(e){return e}function Be(e,t){return null==e||e===Pe?t:function(r){return t(e(r))}}function Me(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function je(e,t){return e===Le?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?Me(n,this.onsuccess):n),i&&(this.onerror=this.onerror?Me(i,this.onerror):i),void 0!==o?o:r}}function Ue(e,t){return e===Le?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?Me(r,this.onsuccess):r),n&&(this.onerror=this.onerror?Me(n,this.onerror):n)}}function Fe(e,t){return e===Le?t:function(r){var n=e.apply(this,arguments);P(r,n);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?Me(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Me(o,this.onerror):o),void 0===n?void 0===a?void 0:a:P(n,a)}}function Qe(e,t){return e===Le?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function qe(e,t){return e===Le?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return r.then((function(){return t.apply(n,o)}))}return t.apply(this,arguments)}}De.ModifyError=Te,De.DexieError=Ce,De.BulkError=Re;var Ge={},Ve="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]}(),Ke=Ve[0],He=Ve[1],ze=Ve[2],We=He&&He.then,Ye=Ke&&Ke.constructor,Je=!!ze,Xe=!1,Ze=ze?function(){ze.then(bt)}:L.setImmediate?setImmediate.bind(null,bt):L.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){bt(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(bt,0)},$e=function(e,t){ct.push([e,t]),tt&&(Ze(),tt=!1)},et=!0,tt=!0,rt=[],nt=[],it=null,ot=Pe,at={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Ht,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{Ht(e[0],e[1])}catch(e){}}))}},st=at,ct=[],ut=0,lt=[];function ht(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=Le,this._lib=!1;var t=this._PSD=st;if(ve&&(this._stackHolder=_e(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Ge)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&>(this,this._value))}this._state=null,this._value=null,++t.ref,pt(this,e)}var ft={get:function(){var e=st,t=Nt;function r(r,n){var i=this,o=!e.global&&(e!==st||t!==Nt),a=o&&!Pt(),s=new ht((function(t,s){At(i,new dt(Gt(r,e,o,a),Gt(n,e,o,a),t,s,e))}));return ve&&_t(s,this),s}return r.prototype=Ge,r},set:function(e){Q(this,"then",e&&e.prototype===Ge?ft:{get:function(){return e},set:ft.set})}};function dt(e,t,r,n,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=i}function pt(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&&Et();t&&"function"==typeof t.then?pt(e,(function(e,r){t instanceof ht?t._then(e,r):t.then(e,r)})):(e._state=!0,e._value=t,vt(e)),r&&wt()}}),gt.bind(null,e))}catch(t){gt(e,t)}}function gt(e,t){if(nt.push(t),null===e._state){var r=e._lib&&Et();t=ot(t),e._state=!1,e._value=t,ve&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,r){try{e.apply(null,r)}catch(e){t&&t(e)}}((function(){var r=V(t,"stack");t._promise=e,Q(t,"stack",{get:function(){return Xe?r&&(r.get?r.get.apply(t):r.value):e.stack}})})),function(e){rt.some((function(t){return t._value===e._value}))||rt.push(e)}(e),vt(e),r&&wt()}}function vt(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)At(e,t[r]);var i=e._PSD;--i.ref||i.finalize(),0===ut&&(++ut,$e((function(){0==--ut&&It()}),[]))}function At(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,++ut,$e(mt,[r,e,t])}else e._listeners.push(t)}function mt(e,t,r){try{it=t;var n,i=t._value;t._state?n=e(i):(nt.length&&(nt=[]),n=e(i),-1===nt.indexOf(i)&&function(e){var t=rt.length;for(;t;)if(rt[--t]._value===e._value)return void rt.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{it=null,0==--ut&&It(),--r.psd.ref||r.psd.finalize()}}function yt(e,t,r){if(t.length===r)return t;var n="";if(!1===e._state){var i,o,a=e._value;null!=a?(i=a.name||"Error",o=a.message||a,n=be(a,0)):(i=a,o=""),t.push(i+(o?": "+o:"")+n)}return ve&&((n=be(e._stackHolder,2))&&-1===t.indexOf(n)&&t.push(n),e._prev&&yt(e._prev,t,r)),t}function _t(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function bt(){Et()&&wt()}function Et(){var e=et;return et=!1,tt=!1,e}function wt(){var e,t,r;do{for(;ct.length>0;)for(e=ct,ct=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}}while(ct.length>0);et=!0,tt=!0}function It(){var e=rt;rt=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=lt.slice(0),r=t.length;r;)t[--r]()}function Ct(e){return new ht(Ge,!1,e)}function St(e,t){var r=st;return function(){var n=Et(),i=st;try{return Ut(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Ut(i,!1),n&&wt()}}}U(ht.prototype,{then:ft,_then:function(e,t){At(this,new dt(null,null,e,t,st))},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):Ct(e)})):this.then(null,(function(e){return e&&e.name===t?r(e):Ct(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),Ct(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{Xe=!0;var e=yt(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Xe=!1}}},timeout:function(e,t){var r=this;return e<1/0?new ht((function(n,i){var o=setTimeout((function(){return i(new Ne.Timeout(t))}),e);r.then(n,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&Q(ht.prototype,Symbol.toStringTag,"Dexie.Promise"),at.env=Ft(),U(ht,{all:function(){var e=pe.apply(null,arguments).map(Bt);return new ht((function(t,r){0===e.length&&t([]);var n=e.length;e.forEach((function(i,o){return ht.resolve(i).then((function(r){e[o]=r,--n||t(e)}),r)}))}))},resolve:function(e){if(e instanceof ht)return e;if(e&&"function"==typeof e.then)return new ht((function(t,r){e.then(t,r)}));var t=new ht(Ge,!0,e);return _t(t,it),t},reject:Ct,race:function(){var e=pe.apply(null,arguments).map(Bt);return new ht((function(t,r){e.map((function(e){return ht.resolve(e).then(t,r)}))}))},PSD:{get:function(){return st},set:function(e){return st=e}},totalEchoes:{get:function(){return Nt}},newPSD:Dt,usePSD:Qt,scheduler:{get:function(){return $e},set:function(e){$e=e}},rejectionMapper:{get:function(){return ot},set:function(e){ot=e}},follow:function(e,t){return new ht((function(r,n){return Dt((function(t,r){var n=st;n.unhandleds=[],n.onunhandled=r,n.finalize=Me((function(){var e=this;!function(e){function t(){e(),lt.splice(lt.indexOf(t),1)}lt.push(t),++ut,$e((function(){0==--ut&&It()}),[])}((function(){0===e.unhandleds.length?t():r(e.unhandleds[0])}))}),n.finalize),e()}),t,r,n)}))}}),Ye&&(Ye.allSettled&&Q(ht,"allSettled",(function(){var e=pe.apply(null,arguments).map(Bt);return new ht((function(t){0===e.length&&t([]);var r=e.length,n=new Array(r);e.forEach((function(e,i){return ht.resolve(e).then((function(e){return n[i]={status:"fulfilled",value:e}}),(function(e){return n[i]={status:"rejected",reason:e}})).then((function(){return--r||t(n)}))}))}))})),Ye.any&&"undefined"!=typeof AggregateError&&Q(ht,"any",(function(){var e=pe.apply(null,arguments).map(Bt);return new ht((function(t,r){0===e.length&&r(new AggregateError([]));var n=e.length,i=new Array(n);e.forEach((function(e,o){return ht.resolve(e).then((function(e){return t(e)}),(function(e){i[o]=e,--n||r(new AggregateError(i))}))}))}))})));var Tt={awaits:0,echoes:0,id:0},Rt=0,kt=[],Ot=0,Nt=0,xt=0;function Dt(e,t,r,n){var i=st,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++xt;var a=at.env;o.env=Je?{Promise:ht,PromiseProp:{value:ht,configurable:!0,writable:!0},all:ht.all,race:ht.race,allSettled:ht.allSettled,any:ht.any,resolve:ht.resolve,reject:ht.reject,nthen:Vt(a.nthen,o),gthen:Vt(a.gthen,o)}:{},t&&P(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=Qt(o,e,r,n);return 0===o.ref&&o.finalize(),s}function Lt(){return Tt.id||(Tt.id=++Rt),++Tt.awaits,Tt.echoes+=100,Tt.id}function Pt(){return!!Tt.awaits&&(0==--Tt.awaits&&(Tt.id=0),Tt.echoes=100*Tt.awaits,!0)}function Bt(e){return Tt.echoes&&e&&e.constructor===Ye?(Lt(),e.then((function(e){return Pt(),e}),(function(e){return Pt(),zt(e)}))):e}function Mt(e){++Nt,Tt.echoes&&0!=--Tt.echoes||(Tt.echoes=Tt.id=0),kt.push(st),Ut(e,!0)}function jt(){var e=kt[kt.length-1];kt.pop(),Ut(e,!1)}function Ut(e,t){var r=st;if((t?!Tt.echoes||Ot++&&e===st:!Ot||--Ot&&e===st)||qt(t?Mt.bind(null,e):jt),e!==st&&(st=e,r===at&&(at.env=Ft()),Je)){var n=at.env.Promise,i=e.env;He.then=i.nthen,n.prototype.then=i.gthen,(r.global||e.global)&&(Object.defineProperty(L,"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 Ft(){var e=L.Promise;return Je?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(L,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:He.then,gthen:e.prototype.then}:{}}function Qt(e,t,r,n,i){var o=st;try{return Ut(e,!0),t(r,n,i)}finally{Ut(o,!1)}}function qt(e){We.call(Ke,e)}function Gt(e,t,r,n){return"function"!=typeof e?e:function(){var i=st;r&&Lt(),Ut(t,!0);try{return e.apply(this,arguments)}finally{Ut(i,!1),n&&qt(Pt)}}}function Vt(e,t){return function(r,n){return e.call(this,Gt(r,t),Gt(n,t))}}-1===(""+We).indexOf("[native code]")&&(Lt=Pt=Le);var Kt="unhandledrejection";function Ht(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,i={promise:t,reason:e};if(L.document&&document.createEvent?((n=document.createEvent("Event")).initEvent(Kt,!0,!0),P(n,i)):L.CustomEvent&&P(n=new CustomEvent(Kt,{detail:i}),i),n&&L.dispatchEvent&&(dispatchEvent(n),!L.PromiseRejectionEvent&&L.onunhandledrejection))try{L.onunhandledrejection(n)}catch(e){}ve&&n&&!n.defaultPrevented&&console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var zt=ht.reject;function Wt(e,t,r,n){if(e._state.openComplete||st.letThrough){var i=e._createTransaction(t,r,e._dbSchema);try{i.create()}catch(e){return zt(e)}return i._promise(t,(function(e,t){return Dt((function(){return st.trans=i,n(e,t,i)}))})).then((function(e){return i._completion.then((function(){return e}))}))}if(!e._state.isBeingOpened){if(!e._options.autoOpen)return zt(new Ne.DatabaseClosed);e.open().catch(Le)}return e._state.dbReadyPromise.then((function(){return Wt(e,t,r,n)}))}var Yt="3.0.3",Jt=String.fromCharCode(65535),Xt=-1/0,Zt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",$t="String expected.",er=[],tr="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),rr=tr,nr=tr,ir=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},or="__dbnames",ar="readonly",sr="readwrite";function cr(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var ur={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function lr(e){return function(t){return void 0===X(t,e)&&$(t=ae(t),e),t}}var hr=function(){function e(){}return e.prototype._trans=function(e,t,r){var n=this._tx||st.trans,i=this.name;function o(e,r,n){if(!n.schema[i])throw new Ne.NotFound("Table "+i+" not part of transaction");return t(n.idbtrans,n)}var a=Et();try{return n&&n.db===this.db?n===st.trans?n._promise(e,o,r):Dt((function(){return n._promise(e,o,r)}),{trans:n,transless:st.transless||st}):Wt(this.db,e,[this.name],o)}finally{a&&wt()}},e.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)},e.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(D(e))return new this.db.WhereClause(this,"["+e.join("+")+"]");var t=x(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var r=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(r&&this.db._maxKey!==Jt)return this.where(r.name).equals(r.keyPath.map((function(t){return e[t]})));!r&&ve&&console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var n=this.schema.idxByName,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}var a=t.reduce((function(t,r){var i=t[0],a=t[1],s=n[r],c=e[r];return[i||s,i||!s?cr(a,s&&s.multi?function(e){var t=X(e,r);return D(t)&&t.some((function(e){return o(c,e)}))}:function(e){return o(c,X(e,r))}):a]}),[null,null]),s=a[0],c=a[1];return s?this.where(s.name).equals(e[s.keyPath]).filter(c):r?this.filter(c):this.where(t).equals("")},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,D(e)?"["+e.join("+")+"]":e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var r=Object.create(e.prototype);for(var n in t)if(j(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=t,this.hook("reading",t),e},e.prototype.defineClass=function(){return this.mapToClass((function(e){P(this,e)}))},e.prototype.add=function(e,t){var r=this,n=this.schema.primKey,i=n.auto,o=n.keyPath,a=e;return o&&i&&(a=lr(o)(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?ht.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{Z(e,o,t)}catch(e){}return t}))},e.prototype.update=function(e,t){if("object"!=typeof t||D(t))throw new Ne.InvalidArgument("Modifications must be an object.");if("object"!=typeof e||D(e))return this.where(":id").equals(e).modify(t);x(t).forEach((function(r){Z(e,r,t[r])}));var r=X(e,this.schema.primKey.keyPath);return void 0===r?zt(new Ne.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(t)},e.prototype.put=function(e,t){var r=this,n=this.schema.primKey,i=n.auto,o=n.keyPath,a=e;return o&&i&&(a=lr(o)(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?ht.reject(e.failures[0]):e.lastResult})).then((function(t){if(o)try{Z(e,o,t)}catch(e){}return t}))},e.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?ht.reject(e.failures[0]):void 0}))},e.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:ur})})).then((function(e){return e.numFailures?ht.reject(e.failures[0]):void 0}))},e.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)}))}))}))},e.prototype.bulkAdd=function(e,t,r){var n=this,i=Array.isArray(t)?t:void 0,o=(r=r||(i?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(function(t){var r=n.schema.primKey,a=r.auto,s=r.keyPath;if(s&&i)throw new Ne.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new Ne.InvalidArgument("Arguments objects and keys must have the same length");var c=e.length,u=s&&a?e.map(lr(s)):e;return n.core.mutate({trans:t,type:"add",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,r=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?r:i;throw new Re(n.name+".bulkAdd(): "+t+" of "+c+" operations failed",Object.keys(a).map((function(e){return a[e]})))}))}))},e.prototype.bulkPut=function(e,t,r){var n=this,i=Array.isArray(t)?t:void 0,o=(r=r||(i?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",(function(t){var r=n.schema.primKey,a=r.auto,s=r.keyPath;if(s&&i)throw new Ne.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==e.length)throw new Ne.InvalidArgument("Arguments objects and keys must have the same length");var c=e.length,u=s&&a?e.map(lr(s)):e;return n.core.mutate({trans:t,type:"put",keys:i,values:u,wantResults:o}).then((function(e){var t=e.numFailures,r=e.results,i=e.lastResult,a=e.failures;if(0===t)return o?r:i;throw new Re(n.name+".bulkPut(): "+t+" of "+c+" operations failed",Object.keys(a).map((function(e){return a[e]})))}))}))},e.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,i=e.lastResult,o=e.failures;if(0===n)return i;throw new Re(t.name+".bulkDelete(): "+n+" of "+r+" operations failed",o)}))},e}();function fr(e){var t={},r=function(r,n){if(n){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return t[r].subscribe.apply(null,o),e}if("string"==typeof r)return t[r]};r.addEventType=o;for(var n=1,i=arguments.length;n<i;++n)o(arguments[n]);return r;function o(e,n,i){if("object"==typeof e)return a(e);n||(n=Qe),i||(i=Le);var o={subscribers:[],fire:i,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=n(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(n,i)}};return t[e]=r[e]=o,o}function a(e){x(e).forEach((function(t){var r=e[t];if(D(r))o(t,e[t][0],e[t][1]);else{if("asap"!==r)throw new Ne.InvalidArgument("Invalid event config");var n=o(t,Pe,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach((function(e){Y((function(){e.apply(null,t)}))}))}))}}))}}function dr(e,t){return q(t).from({prototype:e}),t}function pr(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function gr(e,t){e.filter=cr(e.filter,t)}function vr(e,t,r){var n=e.replayFilter;e.replayFilter=n?function(){return cr(n(),t())}:t,e.justLimit=r&&!n}function Ar(e,t){if(e.isPrimKey)return t.primaryKey;var r=t.getIndexByKeyPath(e.index);if(!r)throw new Ne.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function mr(e,t,r){var n=Ar(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 yr(e,t,r,n){var i=e.replayFilter?cr(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},a=function(e,r,n){if(!i||i(r,n,(function(e){return r.stop(e)}),(function(e){return r.fail(e)}))){var a=r.primaryKey,s=""+a;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(a)),j(o,s)||(o[s]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(a,r),_r(mr(e,n,r),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return _r(mr(e,n,r),cr(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function _r(e,t,r,n){var i=St(n?function(e,t,i){return r(n(e),t,i)}:r);return e.then((function(e){if(e)return e.start((function(){var r=function(){return e.continue()};t&&!t(e,(function(e){return r=e}),(function(t){e.stop(t),r=Le}),(function(t){e.fail(t),r=Le}))||i(e.value,e,(function(e){return r=e})),r()}))}))}var br=function(){function e(){}return e.prototype._read=function(e,t){var r=this._ctx;return r.error?r.table._trans(null,zt.bind(null,r.error)):r.table._trans("readonly",e).then(t)},e.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,zt.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},e.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=cr(t.algorithm,e)},e.prototype._iterate=function(e,t){return yr(this._ctx,e,t,this._ctx.table.core)},e.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&P(r,e),t._ctx=r,t},e.prototype.raw=function(){return this._ctx.valueMapper=null,this},e.prototype.each=function(e){var t=this._ctx;return this._read((function(r){return yr(t,e,r,t.table.core)}))},e.prototype.count=function(e){var t=this;return this._read((function(e){var r=t._ctx,n=r.table.core;if(pr(r,!0))return n.count({trans:e,query:{index:Ar(r,n.schema),range:r.range}}).then((function(e){return Math.min(e,r.limit)}));var i=0;return yr(r,(function(){return++i,!1}),e,n).then((function(){return i}))})).then(e)},e.prototype.sortBy=function(e,t){var r=e.split(".").reverse(),n=r[0],i=r.length-1;function o(e,t){return t?o(e[r[t]],t-1):e[n]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var r=o(e,i),n=o(t,i);return r<n?-a:r>n?a:0}return this.toArray((function(e){return e.sort(s)})).then(t)},e.prototype.toArray=function(e){var t=this;return this._read((function(e){var r=t._ctx;if("next"===r.dir&&pr(r,!0)&&r.limit>0){var n=r.valueMapper,i=Ar(r,r.table.core.schema);return r.table.core.query({trans:e,limit:r.limit,values:!0,query:{index:i,range:r.range}}).then((function(e){var t=e.result;return n?t.map(n):t}))}var o=[];return yr(r,(function(e){return o.push(e)}),e,r.table.core).then((function(){return o}))}),e)},e.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,pr(t)?vr(t,(function(){var t=e;return function(e,r){return 0===t||(1===t?(--t,!1):(r((function(){e.advance(t),t=0})),!1))}})):vr(t,(function(){var t=e;return function(){return--t<0}}))),this},e.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),vr(this._ctx,(function(){var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}}),!0),this},e.prototype.until=function(e,t){return gr(this._ctx,(function(r,n,i){return!e(r.value)||(n(i),t)})),this},e.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){var t,r;return gr(this._ctx,(function(t){return e(t.value)})),t=this._ctx,r=e,t.isMatch=cr(t.isMatch,r),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.key,r)}))},e.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.primaryKey,r)}))},e.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)},e.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&pr(t,!0)&&t.limit>0)return this._read((function(e){var r=Ar(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)},e.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.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 gr(this._ctx,(function(e){var t=e.primaryKey.toString(),n=j(r,t);return r[t]=!0,!n})),this},e.prototype.modify=function(e){var t=this,r=this._ctx;return this._write((function(n){var i;if("function"==typeof e)i=e;else{var o=x(e),a=o.length;i=function(t){for(var r=!1,n=0;n<a;++n){var i=o[n],s=e[i];X(t,i)!==s&&(Z(t,i,s),r=!0)}return r}}var s=r.table.core,c=s.schema.primaryKey,u=c.outbound,l=c.extractKey,h="testmode"in dn?1:2e3,f=t.db.core.cmp,d=[],p=0,g=[],v=function(e,t){var r=t.failures,n=t.numFailures;p+=e-n;for(var i=0,o=x(r);i<o.length;i++){var a=o[i];d.push(r[a])}};return t.clone().primaryKeys().then((function(e){var t=function(r){var o=Math.min(h,e.length-r);return s.getMany({trans:n,keys:e.slice(r,r+o)}).then((function(a){for(var c=[],d=[],p=u?[]:null,g=[],A=0;A<o;++A){var m=a[A],y={value:ae(m),primKey:e[r+A]};!1!==i.call(y,y.value,y)&&(null==y.value?g.push(e[r+A]):u||0===f(l(m),l(y.value))?(d.push(y.value),u&&p.push(e[r+A])):(g.push(e[r+A]),c.push(y.value)))}return Promise.resolve(c.length>0&&s.mutate({trans:n,type:"add",values:c}).then((function(e){for(var t in e.failures)g.splice(parseInt(t),1);v(c.length,e)}))).then((function(e){return d.length>0&&s.mutate({trans:n,type:"put",keys:p,values:d}).then((function(e){return v(d.length,e)}))})).then((function(){return g.length>0&&s.mutate({trans:n,type:"delete",keys:g}).then((function(e){return v(g.length,e)}))})).then((function(){return e.length>r+o&&t(r+h)}))}))};return t(0).then((function(){if(d.length>0)throw new Te("Error modifying one or more objects",d,p,g);return e.length}))}))}))},e.prototype.delete=function(){var e=this._ctx,t=e.range;return pr(e)&&(e.isPrimKey&&!nr||3===t.type)?this._write((function(r){var n=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:r,query:{index:n,range:i}}).then((function(t){return e.table.core.mutate({trans:r,type:"deleteRange",range:i}).then((function(e){var r=e.failures,n=(e.lastResult,e.results,e.numFailures);if(n)throw new Te("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}))},e}();function Er(e,t){return e<t?-1:e===t?0:1}function wr(e,t){return e>t?-1:e===t?0:1}function Ir(e,t,r){var n=e instanceof Or?new e.Collection(e):e;return n._ctx.error=r?new r(t):new TypeError(t),n}function Cr(e){return new e.Collection(e,(function(){return kr("")})).limit(0)}function Sr(e,t,r,n,i,o){for(var a=Math.min(e.length,n.length),s=-1,c=0;c<a;++c){var u=t[c];if(u!==n[c])return i(e[c],r[c])<0?e.substr(0,c)+r[c]+r.substr(c+1):i(e[c],n[c])<0?e.substr(0,c)+n[c]+r.substr(c+1):s>=0?e.substr(0,s)+t[s]+r.substr(s+1):null;i(e[c],u)<0&&(s=c)}return a<n.length&&"next"===o?e+r.substr(e.length):a<e.length&&"prev"===o?e.substr(0,r.length):s<0?null:e.substr(0,s)+n[s]+r.substr(s+1)}function Tr(e,t,r,n){var i,o,a,s,c,u,l,h=r.length;if(!r.every((function(e){return"string"==typeof e})))return Ir(e,$t);function f(e){i=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),o=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),a="next"===e?Er:wr;var t=r.map((function(e){return{lower:o(e),upper:i(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));s=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),u=e,l="next"===e?"":n}f("next");var d=new e.Collection(e,(function(){return Rr(s[0],c[h-1]+n)}));d._ondirectionchange=function(e){f(e)};var p=0;return d._addAlgorithm((function(e,r,n){var i=e.key;if("string"!=typeof i)return!1;var f=o(i);if(t(f,c,p))return!0;for(var d=null,g=p;g<h;++g){var v=Sr(i,f,s[g],c[g],a,u);null===v&&null===d?p=g+1:(null===d||a(d,v)>0)&&(d=v)}return r(null!==d?function(){e.continue(d+l)}:n),!1})),d}function Rr(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function kr(e){return{type:1,lower:e,upper:e}}var Or=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),e.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)?Cr(this):new this.Collection(this,(function(){return Rr(e,t,!r,!n)}))}catch(e){return Ir(this,Zt)}},e.prototype.equals=function(e){return null==e?Ir(this,Zt):new this.Collection(this,(function(){return kr(e)}))},e.prototype.above=function(e){return null==e?Ir(this,Zt):new this.Collection(this,(function(){return Rr(e,void 0,!0)}))},e.prototype.aboveOrEqual=function(e){return null==e?Ir(this,Zt):new this.Collection(this,(function(){return Rr(e,void 0,!1)}))},e.prototype.below=function(e){return null==e?Ir(this,Zt):new this.Collection(this,(function(){return Rr(void 0,e,!1,!0)}))},e.prototype.belowOrEqual=function(e){return null==e?Ir(this,Zt):new this.Collection(this,(function(){return Rr(void 0,e)}))},e.prototype.startsWith=function(e){return"string"!=typeof e?Ir(this,$t):this.between(e,e+Jt,!0,!0)},e.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Tr(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Jt)},e.prototype.equalsIgnoreCase=function(e){return Tr(this,(function(e,t){return e===t[0]}),[e],"")},e.prototype.anyOfIgnoreCase=function(){var e=pe.apply(de,arguments);return 0===e.length?Cr(this):Tr(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=pe.apply(de,arguments);return 0===e.length?Cr(this):Tr(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,Jt)},e.prototype.anyOf=function(){var e=this,t=pe.apply(de,arguments),r=this._cmp;try{t.sort(r)}catch(e){return Ir(this,Zt)}if(0===t.length)return Cr(this);var n=new this.Collection(this,(function(){return Rr(t[0],t[t.length-1])}));n._ondirectionchange=function(n){r="next"===n?e._ascending:e._descending,t.sort(r)};var i=0;return n._addAlgorithm((function(e,n,o){for(var a=e.key;r(a,t[i])>0;)if(++i===t.length)return n(o),!1;return 0===r(a,t[i])||(n((function(){e.continue(t[i])})),!1)})),n},e.prototype.notEqual=function(e){return this.inAnyRange([[Xt,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=pe.apply(de,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Ir(this,Zt)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[Xt,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){var r=this,n=this._cmp,i=this._ascending,o=this._descending,a=this._min,s=this._max;if(0===e.length)return Cr(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0})))return Ir(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ne.InvalidArgument);var c=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;var l,h=i;function f(e,t){return h(e[0],t[0])}try{l=e.reduce((function(e,t){for(var r=0,i=e.length;r<i;++r){var o=e[r];if(n(t[0],o[1])<0&&n(t[1],o[0])>0){o[0]=a(o[0],t[0]),o[1]=s(o[1],t[1]);break}}return r===i&&e.push(t),e}),[]),l.sort(f)}catch(e){return Ir(this,Zt)}var d=0,p=u?function(e){return i(e,l[d][1])>0}:function(e){return i(e,l[d][1])>=0},g=c?function(e){return o(e,l[d][0])>0}:function(e){return o(e,l[d][0])>=0};var v=p,A=new this.Collection(this,(function(){return Rr(l[0][0],l[l.length-1][1],!c,!u)}));return A._ondirectionchange=function(e){"next"===e?(v=p,h=i):(v=g,h=o),l.sort(f)},A._addAlgorithm((function(e,t,n){for(var o=e.key;v(o);)if(++d===l.length)return t(n),!1;return!!function(e){return!p(e)&&!g(e)}(o)||(0===r._cmp(o,l[d][1])||0===r._cmp(o,l[d][0])||t((function(){h===i?e.continue(l[d][0]):e.continue(l[d][1])})),!1)})),A},e.prototype.startsWithAnyOf=function(){var e=pe.apply(de,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Cr(this):this.inAnyRange(e.map((function(e){return[e,e+Jt]}))):Ir(this,"startsWithAnyOf() only works with strings")},e}();function Nr(e){return 1===e.length?e[0]:e}function xr(e){try{return e.only([[]]),[[]]}catch(e){return Jt}}function Dr(e){return St((function(t){return Lr(t),e(t.target.error),!1}))}function Lr(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Pr=function(){function e(){}return e.prototype._lock=function(){return W(!st.global),++this._reculock,1!==this._reculock||st.global||(st.lockOwnerFor=this),this},e.prototype._unlock=function(){if(W(!st.global),0==--this._reculock)for(st.global||(st.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Qt(e[1],e[0])}catch(e){}}return this},e.prototype._locked=function(){return this._reculock&&st.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var r=this.db.idbdb,n=this.db._state.dbOpenError;if(W(!this.idbtrans),!e&&!r)switch(n&&n.name){case"DatabaseClosedError":throw new Ne.DatabaseClosed(n);case"MissingAPIError":throw new Ne.MissingAPI(n.message,n);default:throw new Ne.OpenFailed(n)}if(!this.active)throw new Ne.TransactionInactive;return W(null===this._completion._state),(e=this.idbtrans=e||r.transaction(Nr(this.storeNames),this.mode)).onerror=St((function(r){Lr(r),t._reject(e.error)})),e.onabort=St((function(r){Lr(r),t.active&&t._reject(new Ne.Abort(e.error)),t.active=!1,t.on("abort").fire(r)})),e.oncomplete=St((function(){t.active=!1,t._resolve()})),this},e.prototype._promise=function(e,t,r){var n=this;if("readwrite"===e&&"readwrite"!==this.mode)return zt(new Ne.ReadOnly("Transaction is readonly"));if(!this.active)return zt(new Ne.TransactionInactive);if(this._locked())return new ht((function(i,o){n._blockedFuncs.push([function(){n._promise(e,t,r).then(i,o)},st])}));if(r)return Dt((function(){var e=new ht((function(e,r){n._lock();var i=t(e,r,n);i&&i.then&&i.then(e,r)}));return e.finally((function(){return n._unlock()})),e._lib=!0,e}));var i=new ht((function(e,r){var i=t(e,r,n);i&&i.then&&i.then(e,r)}));return i._lib=!0,i},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),r=ht.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 e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new ht((function(e,n){r.then((function(r){return t._waitingQueue.push(St(e.bind(null,r)))}),(function(e){return t._waitingQueue.push(St(n.bind(null,e)))})).finally((function(){t._waitingFor===i&&(t._waitingFor=null)}))}))},e.prototype.abort=function(){this.active&&this._reject(new Ne.Abort),this.active=!1},e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(j(t,e))return t[e];var r=this.schema[e];if(!r)throw new Ne.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},e}();function Br(e,t,r,n,i,o,a){return{name:e,keyPath:t,unique:r,multi:n,auto:i,compound:o,src:(r&&!a?"&":"")+(n?"*":"")+(i?"++":"")+Mr(t)}}function Mr(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function jr(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:J(r,(function(e){return[e.name,e]}))}}function Ur(e){return null==e?function(){}:"string"==typeof e?function(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return X(t,e)}}(e):function(t){return X(t,e)}}function Fr(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}function Qr(e){return[].slice.call(e)}var qr=0;function Gr(e){return null==e?":id":"string"==typeof e?e:"["+e.join("+")+"]"}function Vr(e,t,r,n){var i=t.cmp.bind(t);function o(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,i=e.lowerOpen,o=e.upperOpen;return void 0===t?void 0===n?null:r.upperBound(n,!!o):void 0===n?r.lowerBound(t,!!i):r.bound(t,n,!!i,!!o)}var a=function(e,t){var r=Qr(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,n=D(t),i=null==t,o={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:n,keyPath:t,autoIncrement:r,unique:!0,extractKey:Ur(t)},indexes:Qr(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,r=e.unique,n=e.multiEntry,i=e.keyPath,a={name:t,compound:D(i),keyPath:i,unique:r,multiEntry:n,extractKey:Ur(i)};return o[Gr(i)]=a,a})),getIndexByKeyPath:function(e){return o[Gr(e)]}};return o[":id"]=a.primaryKey,null!=t&&(o[Gr(t)]=a.primaryKey),a}))},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,n),s=a.schema,c=a.hasGetAll,u=s.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(r){var n=r.trans,i=r.type,a=r.keys,s=r.values,c=r.range,u=r.wantResults;return new Promise((function(r,l){r=St(r);var h=n.objectStore(t),f=null==h.keyPath,d="put"===i||"add"===i;if(!d&&"delete"!==i&&"deleteRange"!==i)throw new Error("Invalid operation type: "+i);var p=(a||s||{length:1}).length;if(a&&s&&a.length!==s.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return r({numFailures:0,failures:{},results:[],lastResult:void 0});var g,v=u&&N(a||Fr(e.primaryKey,{type:i,keys:a,values:s})),A=[],m=0,y=function(e){++m,Lr(e),v&&(v[e.target._reqno]=void 0),A[e.target._reqno]=e.target.error},_=function(e){var t=e.target;v[t._reqno]=t.result};if("deleteRange"===i){if(4===c.type)return r({numFailures:m,failures:A,results:v,lastResult:void 0});g=3===c.type?h.clear():h.delete(o(c))}else{var b=d?f?[s,a]:[s,null]:[a,null],E=b[0],w=b[1];if(d)for(var I=0;I<p;++I)(g=w&&void 0!==w[I]?h[i](E[I],w[I]):h[i](E[I]))._reqno=I,v&&void 0===v[I]&&(g.onsuccess=_),g.onerror=y;else for(I=0;I<p;++I)(g=h[i](E[I]))._reqno=I,g.onerror=y}var C=function(e){var t=e.target.result;v&&(v[p-1]=t),r({numFailures:m,failures:A,results:v,lastResult:t})};g.onerror=function(e){y(e),C(e)},g.onsuccess=C}))},getMany:function(e){var r=e.trans,n=e.keys;return new Promise((function(e,i){e=St(e);for(var o,a=r.objectStore(t),s=n.length,c=new Array(s),u=0,l=0,h=function(t){var r=t.target;c[r._pos]=r.result,++l===u&&e(c)},f=Dr(i),d=0;d<s;++d)null!=n[d]&&((o=a.get(n[d]))._pos=d,o.onsuccess=h,o.onerror=f,++u);0===u&&e(c)}))},get:function(e){var r=e.trans,n=e.key;return new Promise((function(e,i){e=St(e);var o=r.objectStore(t).get(n);o.onsuccess=function(t){return e(t.target.result)},o.onerror=Dr(i)}))},query:function(e){return function(r){return new Promise((function(n,i){n=St(n);var a=r.trans,s=r.values,c=r.limit,u=r.query,l=c===1/0?void 0:c,h=u.index,f=u.range,d=a.objectStore(t),p=h.isPrimaryKey?d:d.index(h.name),g=o(f);if(0===c)return n({result:[]});if(e){var v=s?p.getAll(g,l):p.getAllKeys(g,l);v.onsuccess=function(e){return n({result:e.target.result})},v.onerror=Dr(i)}else{var A=0,m=s||!("openKeyCursor"in p)?p.openCursor(g):p.openKeyCursor(g),y=[];m.onsuccess=function(e){var t=m.result;return t?(y.push(s?t.value:t.primaryKey),++A===c?n({result:y}):void t.continue()):n({result:y})},m.onerror=Dr(i)}}))}}(c),openCursor:function(e){var r=e.trans,n=e.values,i=e.query,a=e.reverse,s=e.unique;return new Promise((function(e,c){e=St(e);var u=i.index,l=i.range,h=r.objectStore(t),f=u.isPrimaryKey?h:h.index(u.name),d=a?s?"prevunique":"prev":s?"nextunique":"next",p=n||!("openKeyCursor"in f)?f.openCursor(o(l),d):f.openKeyCursor(o(l),d);p.onerror=Dr(c),p.onsuccess=St((function(t){var n=p.result;if(n){n.___id=++qr,n.done=!1;var i=n.continue.bind(n),o=n.continuePrimaryKey;o&&(o=o.bind(n));var a=n.advance.bind(n),s=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=St(c),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=St(e),p.onerror=Dr(t),n.fail=t,n.stop=function(t){n.stop=n.continue=n.continuePrimaryKey=n.advance=s,e(t)}})),r=function(){if(p.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 p.onsuccess=St((function(e){p.onsuccess=r,r()})),n.continue=i,n.continuePrimaryKey=o,n.advance=a,r(),t},e(n)}else e(null)}),c)}))},count:function(e){var r=e.query,n=e.trans,i=r.index,a=r.range;return new Promise((function(e,r){var s=n.objectStore(t),c=i.isPrimaryKey?s:s.index(i.name),u=o(a),l=u?c.count(u):c.count();l.onsuccess=St((function(t){return e(t.target.result)})),l.onerror=Dr(r)}))}}}(e)})),l={};return u.forEach((function(e){return l[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!l[e])throw new Error("Table '"+e+"' not found");return l[e]},cmp:i,MIN_KEY:-1/0,MAX_KEY:xr(r),schema:s}}function Kr(e,t,r,n){var i=r.IDBKeyRange,o=function(e,t){return t.reduce((function(e,t){var r=t.create;return O(O({},e),r(e))}),e)}(Vr(t,r.indexedDB,i,n),e.dbcore);return{dbcore:o}}function Hr(e,t){var r=t.db,n=Kr(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 zr(e,t,r,n){r.forEach((function(r){var i=n[r];t.forEach((function(t){var n=V(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?Q(t,r,{get:function(){return this.table(r)},set:function(e){F(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,i))}))}))}function Wr(e,t){t.forEach((function(t){for(var r in t)t[r]instanceof e.Table&&delete t[r]}))}function Yr(e,t){return e._cfg.version-t._cfg.version}function Jr(e,t,r,n){var i=e._dbSchema,o=e._createTransaction("readwrite",e._storeNames,i);o.create(r),o._completion.catch(n);var a=o._reject.bind(o),s=st.transless||st;Dt((function(){st.trans=o,st.transless=s,0===t?(x(i).forEach((function(e){Zr(r,e,i[e].primKey,i[e].indexes)})),Hr(e,r),ht.follow((function(){return e.on.populate.fire(o)})).catch(a)):function(e,t,r,n){var i=[],o=e._versions,a=e._dbSchema=en(e,e.idbdb,n),s=!1;function c(){return i.length?ht.resolve(i.shift()(r.idbtrans)).then(c):ht.resolve()}return o.filter((function(e){return e._cfg.version>=t})).forEach((function(o){i.push((function(){var i=a,c=o._cfg.dbschema;tn(e,i,n),tn(e,c,n),a=e._dbSchema=c;var u=Xr(i,c);u.add.forEach((function(e){Zr(n,e[0],e[1].primKey,e[1].indexes)})),u.change.forEach((function(e){if(e.recreate)throw new Ne.Upgrade("Not yet support for changing primary key");var t=n.objectStore(e.name);e.add.forEach((function(e){return $r(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),$r(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var l=o._cfg.contentUpgrade;if(l&&o._cfg.version>t){Hr(e,n),r._memoizedTables={},s=!0;var h=ee(c);u.del.forEach((function(e){h[e]=i[e]})),Wr(e,[e.Transaction.prototype]),zr(e,[e.Transaction.prototype],x(h),h),r.schema=h;var f,d=ge(l);d&&Lt();var p=ht.follow((function(){if((f=l(r))&&d){var e=Pt.bind(null,null);f.then(e,e)}}));return f&&"function"==typeof f.then?ht.resolve(f):p.then((function(){return f}))}})),i.push((function(t){s&&rr||function(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)}}(o._cfg.dbschema,t);Wr(e,[e.Transaction.prototype]),zr(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema}))})),c().then((function(){var e,t;t=n,x(e=a).forEach((function(r){t.db.objectStoreNames.contains(r)||Zr(t,r,e[r].primKey,e[r].indexes)}))}))}(e,t,o,r).catch(a)}))}function Xr(e,t){var r,n={del:[],add:[],change:[]};for(r in e)t[r]||n.del.push(r);for(r in t){var i=e[r],o=t[r];if(i){var a={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto&&!tr)a.recreate=!0,n.change.push(a);else{var s=i.idxByName,c=o.idxByName,u=void 0;for(u in s)c[u]||a.del.push(u);for(u in c){var l=s[u],h=c[u];l?l.src!==h.src&&a.change.push(h):a.add.push(h)}(a.del.length>0||a.add.length>0||a.change.length>0)&&n.change.push(a)}}else n.add.push([r,o])}return n}function Zr(e,t,r,n){var i=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach((function(e){return $r(i,e)})),i}function $r(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function en(e,t,r){var n={};return H(t.objectStoreNames,0).forEach((function(e){for(var t=r.objectStore(e),i=t.keyPath,o=Br(Mr(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),a=[],s=0;s<t.indexNames.length;++s){var c=t.index(t.indexNames[s]);i=c.keyPath;var u=Br(c.name,i,!!c.unique,!!c.multiEntry,!1,i&&"string"!=typeof i,!1);a.push(u)}n[e]=jr(e,o,a)})),n}function tn(e,t,r){for(var n=r.db.objectStoreNames,i=0;i<n.length;++i){var o=n[i],a=r.objectStore(o);e._hasGetAll="getAll"in a;for(var s=0;s<a.indexNames.length;++s){var c=a.indexNames[s],u=a.index(c).keyPath,l="string"==typeof u?u:"["+H(u).join("+")+"]";if(t[o]){var h=t[o].idxByName[l];h&&(h.name=c,delete t[o].idxByName[l],t[o].idxByName[c]=h)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&L.WorkerGlobalScope&&L instanceof L.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}var rn,nn=function(){function e(){}return e.prototype._parseStoresSpec=function(e,t){x(e).forEach((function(r){if(null!==e[r]){var n=e[r].split(",").map((function(e,t){var r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return Br(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),D(n),0===t)})),i=n.shift();if(i.multi)throw new Ne.Schema("Primary key cannot be multi-valued");n.forEach((function(e){if(e.auto)throw new Ne.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Ne.Schema("Index must have a name and cannot be an empty string")})),t[r]=jr(r,i,n)}}))},e.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?P(this._cfg.storesSource,e):e;var r=t._versions,n={},i={};return r.forEach((function(e){P(n,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(n,i)})),t._dbSchema=i,Wr(t,[t._allTables,t,t.Transaction.prototype]),zr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],x(i),i),t._storeNames=x(i),this},e.prototype.upgrade=function(e){return this._cfg.contentUpgrade=e,this},e}();function on(e){return Dt((function(){return st.letThrough=!0,e()}))}function an(e){var t=e._state,r=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?zt(t.dbOpenError):e}));ve&&(t.openCanceller._stackHolder=_e()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var n=t.dbReadyResolve,i=null;return ht.race([t.openCanceller,new ht((function(n,o){if(!r)throw new Ne.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 a=e.name,s=t.autoSchema?r.open(a):r.open(a,Math.round(10*e.verno));if(!s)throw new Ne.MissingAPI("IndexedDB API not available");s.onerror=Dr(o),s.onblocked=St(e._fireOnBlocked),s.onupgradeneeded=St((function(n){if(i=s.transaction,t.autoSchema&&!e._options.allowEmptyDB){s.onerror=Lr,i.abort(),s.result.close();var c=r.deleteDatabase(a);c.onsuccess=c.onerror=St((function(){o(new Ne.NoSuchDatabase("Database "+a+" doesnt exist"))}))}else{i.onerror=Dr(o);var u=n.oldVersion>Math.pow(2,62)?0:n.oldVersion;e.idbdb=s.result,Jr(e,u/10,i,o)}}),o),s.onsuccess=St((function(){i=null;var r=e.idbdb=s.result,o=H(r.objectStoreNames);if(o.length>0)try{var c=r.transaction(Nr(o),"readonly");t.autoSchema?function(e,t,r){e.verno=t.version/10;var n=e._dbSchema=en(0,t,r);e._storeNames=H(t.objectStoreNames,0),zr(e,[e._allTables],x(n),n)}(e,r,c):(tn(e,e._dbSchema,c),function(e,t){var r=Xr(en(0,e.idbdb,t),e._dbSchema);return!(r.add.length||r.change.some((function(e){return e.add.length||e.change.length})))}(e,c)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Hr(e,c)}catch(e){}er.push(e),r.onversionchange=St((function(r){t.vcFired=!0,e.on("versionchange").fire(r)})),rn.add(a),n()}),o)}))]).then((function(){return t.onReadyBeingFired=[],ht.resolve(on(e.on.ready.fire)).then((function e(){if(t.onReadyBeingFired.length>0){var r=t.onReadyBeingFired.reduce(qe,Le);return t.onReadyBeingFired=[],ht.resolve(on(r)).then(e)}}))})).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,zt(t.dbOpenError)})).finally((function(){t.openComplete=!0,n()}))}function sn(e){var t=function(t){return e.next(t)},r=i(t),n=i((function(t){return e.throw(t)}));function i(e){return function(t){var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(r,n):D(o)?Promise.all(o).then(r,n):r(o)}}return i(t)()}function cn(e,t,r){var n=arguments.length;if(n<2)throw new Ne.InvalidArgument("Too few arguments");for(var i=new Array(n-1);--n;)i[n-1]=arguments[n];r=i.pop();var o=re(i);return[e,o,r]}function un(e,t,r,n,i){return ht.resolve().then((function(){var o=st.transless||st,a=e._createTransaction(t,r,e._dbSchema,n),s={trans:a,transless:o};n?a.idbtrans=n.idbtrans:a.create();var c,u=ge(i);u&&Lt();var l=ht.follow((function(){if(c=i.call(a,a))if(u){var e=Pt.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=sn(c))}),s);return(c&&"function"==typeof c.then?ht.resolve(c).then((function(e){return a.active?e:zt(new Ne.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return c}))).then((function(e){return n&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),zt(e)}))}))}function ln(e,t,r){for(var n=D(e)?e.slice():[e],i=0;i<r;++i)n.push(t);return n}var hn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return O(O({},e),{table:function(t){var r=e.table(t),n=r.schema,i={},o=[];function a(e,t,r){var n=Gr(e),s=i[n]=i[n]||[],c=null==e?0:"string"==typeof e?1:e.length,u=t>0,l=O(O({},r),{isVirtual:u,isPrimaryKey:!u&&r.isPrimaryKey,keyTail:t,keyLength:c,extractKey:Ur(e),unique:!u&&r.unique});(s.push(l),l.isPrimaryKey||o.push(l),c>1)&&a(2===c?e[0]:e.slice(0,c-1),t+1,r);return s.sort((function(e,t){return e.keyTail-t.keyTail})),l}var s=a(n.primaryKey.keyPath,0,n.primaryKey);i[":id"]=[s];for(var c=0,u=n.indexes;c<u.length;c++){var l=u[c];a(l.keyPath,0,l)}function h(t){var r,n,i=t.query.index;return i.isVirtual?O(O({},t),{query:{index:i,range:(r=t.query.range,n=i.keyTail,{type:1===r.type?2:r.type,lower:ln(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:ln(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0})}}):t}var f=O(O({},r),{schema:O(O({},n),{primaryKey:s,indexes:o,getIndexByKeyPath:function(e){var t=i[Gr(e)];return t&&t[0]}}),count:function(e){return r.count(h(e))},query:function(e){return r.query(h(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,o=n.isVirtual,a=n.keyLength;if(!o)return r.openCursor(t);return r.openCursor(h(t)).then((function(r){return r&&function(r){var n=Object.create(r,{continue:{value:function(n){null!=n?r.continue(ln(n,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?r.continue(ln(r.key,t.reverse?e.MIN_KEY:e.MAX_KEY,i)):r.continue()}},continuePrimaryKey:{value:function(t,n){r.continuePrimaryKey(ln(t,e.MAX_KEY,i),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}})}},fn={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return O(O({},e),{table:function(t){var r=e.table(t),n=r.schema.primaryKey,i=O(O({},r),{mutate:function(e){var i=st.trans,o=i.table(t).hook,a=o.deleting,s=o.creating,c=o.updating;switch(e.type){case"add":if(s.fire===Le)break;return i._promise("readwrite",(function(){return u(e)}),!0);case"put":if(s.fire===Le&&c.fire===Le)break;return i._promise("readwrite",(function(){return u(e)}),!0);case"delete":if(a.fire===Le)break;return i._promise("readwrite",(function(){return u(e)}),!0);case"deleteRange":if(a.fire===Le)break;return i._promise("readwrite",(function(){return function(e){return l(e.trans,e.range,1e4)}(e)}),!0)}return r.mutate(e);function u(e){var t=st.trans,i=e.keys||Fr(n,e);if(!i)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?O(O({},e),{keys:i,wantResults:!0}):O({},e)).type&&(e.values=N(e.values)),e.keys&&(e.keys=N(e.keys)),function(e,t,r){return"add"===t.type?Promise.resolve(new Array(t.values.length)):e.getMany({trans:t.trans,keys:r})}(r,e,i).then((function(o){var u=i.map((function(r,i){var u=o[i],l={onerror:null,onsuccess:null};if("delete"===e.type)a.fire.call(l,r,u,t);else if("add"===e.type||void 0===u){var h=s.fire.call(l,r,e.values[i],t);null==r&&null!=h&&(r=h,e.keys[i]=r,n.outbound||Z(e.values[i],n.keyPath,r))}else{var f=le(u,e.values[i]),d=c.fire.call(l,f,r,u,t);if(d){var p=e.values[i];Object.keys(d).forEach((function(e){j(p,e)?p[e]=d[e]:Z(p,e,d[e])}))}}return l}));return r.mutate(e).then((function(t){for(var r=t.failures,n=t.results,a=t.numFailures,s=t.lastResult,c=0;c<i.length;++c){var l=n?n[c]:i[c],h=u[c];null==l?h.onerror&&h.onerror(r[c]):h.onsuccess&&h.onsuccess("put"===e.type&&o[c]?e.values[c]:l)}return{failures:r,results:n,numFailures:a,lastResult:s}})).catch((function(e){return u.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}function l(e,t,i){return r.query({trans:e,values:!1,query:{index:n,range:t},limit:i}).then((function(r){var n=r.result;return u({type:"delete",keys:n,trans:e}).then((function(r){return r.numFailures>0?Promise.reject(r.failures[0]):n.length<i?{failures:[],numFailures:0,lastResult:void 0}:l(e,O(O({},t),{lower:n[n.length-1],lowerOpen:!0}),i)}))}))}}});return i}})}},dn=function(){function e(t,r){var n=this;this._middlewares={},this.verno=0;var i=e.dependencies;this._options=r=O({addons:e.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},r),this._deps={indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange};var o=r.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null;var a={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Le,dbReadyPromise:null,cancelOpen:Le,openCanceller:null,autoSchema:!0};a.dbReadyPromise=new ht((function(e){a.dbReadyResolve=e})),a.openCanceller=new ht((function(e,t){a.cancelOpen=t})),this._state=a,this.name=t,this.on=fr(this,"populate","blocked","versionchange",{ready:[qe,Le]}),this.on.ready.subscribe=z(this.on.ready.subscribe,(function(t){return function(r,i){e.vip((function(){var e=n._state;if(e.openComplete)e.dbOpenError||ht.resolve().then(r),i&&t(r);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(r),i&&t(r);else{t(r);var o=n;i||t((function e(){o.on.ready.unsubscribe(r),o.on.ready.unsubscribe(e)}))}}))}})),this.Collection=function(e){return dr(br.prototype,(function(t,r){this.db=e;var n=ur,i=null;if(r)try{n=r()}catch(e){i=e}var o=t._ctx,a=o.table,s=a.hook.reading.fire;this._ctx={table:a,index:o.index,isPrimKey:!o.index||a.schema.primKey.keyPath&&o.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:i,or:o.or,valueMapper:s!==Pe?s:null}}))}(this),this.Table=function(e){return dr(hr.prototype,(function(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:fr(null,{creating:[je,Le],reading:[Be,Pe],updating:[Fe,Le],deleting:[Ue,Le]})}))}(this),this.Transaction=function(e){return dr(Pr.prototype,(function(t,r,n,i){var o=this;this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.idbtrans=null,this.on=fr(this,"complete","error","abort"),this.parent=i||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 ht((function(e,t){o._resolve=e,o._reject=t})),this._completion.then((function(){o.active=!1,o.on.complete.fire()}),(function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),zt(e)}))}))}(this),this.Version=function(e){return dr(nn.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return dr(Or.prototype,(function(t,r,n){this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n};var i=e._deps.indexedDB;if(!i)throw new Ne.MissingAPI("indexedDB API missing");this._cmp=this._ascending=i.cmp.bind(i),this._descending=function(e,t){return i.cmp(t,e)},this._max=function(e,t){return i.cmp(e,t)>0?e:t},this._min=function(e,t){return i.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 '"+n.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+n.name+"'. Closing db now to resume the delete request."),n.close()})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('"+n.name+"') was blocked"):console.warn("Upgrade '"+n.name+"' blocked by other connection holding version "+e.oldVersion/10)})),this._maxKey=xr(r.IDBKeyRange),this._createTransaction=function(e,t,r,i){return new n.Transaction(e,t,r,i)},this._fireOnBlocked=function(e){n.on("blocked").fire(e),er.filter((function(e){return e.name===n.name&&e!==n&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(hn),this.use(fn),o.forEach((function(e){return e(n)}))}return e.prototype.version=function(e){if(isNaN(e)||e<.1)throw new Ne.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Ne.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(Yr),r.stores({}),this._state.autoSchema=!1,r)},e.prototype._whenReady=function(e){var t=this;return this._state.openComplete||st.letThrough?e():new ht((function(e,r){if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void r(new Ne.DatabaseClosed);t.open().catch(Le)}t._state.dbReadyPromise.then(e,r)})).then(e)},e.prototype.use=function(e){var t=e.stack,r=e.create,n=e.level,i=e.name;i&&this.unuse({stack:t,name:i});var o=this._middlewares[t]||(this._middlewares[t]=[]);return o.push({stack:t,create:r,level:null==n?10:n,name:i}),o.sort((function(e,t){return e.level-t.level})),this},e.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},e.prototype.open=function(){return an(this)},e.prototype.close=function(){var e=er.indexOf(this),t=this._state;if(e>=0&&er.splice(e,1),this.idbdb){try{this.idbdb.close()}catch(e){}this.idbdb=null}this._options.autoOpen=!1,t.dbOpenError=new Ne.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError),t.dbReadyPromise=new ht((function(e){t.dbReadyResolve=e})),t.openCanceller=new ht((function(e,r){t.cancelOpen=r}))},e.prototype.delete=function(){var e=this,t=arguments.length>0,r=this._state;return new ht((function(n,i){var o=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=St((function(){rn.remove(e.name),n()})),t.onerror=Dr(i),t.onblocked=e._fireOnBlocked};if(t)throw new Ne.InvalidArgument("Arguments not allowed in db.delete()");r.isBeingOpened?r.dbReadyPromise.then(o):o()}))},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return null!==this.idbdb},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},e.prototype.hasFailed=function(){return null!==this._state.dbOpenError},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return x(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!0,configurable:!0}),e.prototype.transaction=function(){var e=cn.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,r){var n=this,i=st.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,a,s=-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===ar)o=ar;else{if("rw"!=e&&e!=sr)throw new Ne.InvalidArgument("Invalid transaction mode: "+e);o=sr}if(i){if(i.mode===ar&&o===sr){if(!s)throw new Ne.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&a.forEach((function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!s)throw new Ne.SubTransaction("Table "+e+" not included in parent transaction.");i=null}})),s&&i&&!i.active&&(i=null)}}catch(e){return i?i._promise(null,(function(t,r){r(e)})):zt(e)}var c=un.bind(null,this,o,a,i,r);return i?i._promise(o,c,"lock"):st.trans?Qt(st.transless,(function(){return n._whenReady(c)})):this._whenReady(c)},e.prototype.table=function(e){if(!j(this._allTables,e))throw new Ne.InvalidTable("Table "+e+" does not exist");return this._allTables[e]},e}(),pn=dn;U(pn,O(O({},De),{delete:function(e){return new pn(e).delete()},exists:function(e){return new pn(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){return rn?rn.getDatabaseNames().then(e):ht.resolve([])},defineClass:function(){return function(e){P(this,e)}},ignoreTransaction:function(e){return st.trans?Qt(st.transless,e):e()},vip:on,async:function(e){return function(){try{var t=sn(e.apply(this,arguments));return t&&"function"==typeof t.then?t:ht.resolve(t)}catch(e){return zt(e)}}},spawn:function(e,t,r){try{var n=sn(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:ht.resolve(n)}catch(e){return zt(e)}},currentTransaction:{get:function(){return st.trans||null}},waitFor:function(e,t){var r=ht.resolve("function"==typeof e?pn.ignoreTransaction(e):e).timeout(t||6e4);return st.trans?st.trans.waitFor(r):r},Promise:ht,debug:{get:function(){return ve},set:function(e){Ae(e,"dexie"===e?function(){return!0}:ir)}},derive:q,extend:P,props:U,override:z,Events:fr,getByKeyPath:X,setByKeyPath:Z,delByKeyPath:$,shallowClone:ee,deepClone:ae,getObjectDiff:le,asap:Y,minKey:Xt,addons:[],connections:er,errnames:ke,dependencies:function(){try{return{indexedDB:L.indexedDB||L.mozIndexedDB||L.webkitIndexedDB||L.msIndexedDB,IDBKeyRange:L.IDBKeyRange||L.webkitIDBKeyRange}}catch(e){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:Yt,version:Yt.split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,r){return e+t/Math.pow(10,2*r)})),default:pn,Dexie:pn})),pn.maxKey=xr(pn.dependencies.IDBKeyRange),function(e){try{rn=function(e){var t,r=e&&"function"==typeof e.databases;if(!r){var n=new dn(or,{addons:[]});n.version(1).stores({dbnames:"name"}),t=n.table("dbnames")}return{getDatabaseNames:function(){return r?ht.resolve(e.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==or}))})):t.toCollection().primaryKeys()},add:function(e){return!r&&e!==or&&t.put({name:e}).catch(Le)},remove:function(e){return!r&&e!==or&&t.delete(e).catch(Le)}}}(e)}catch(e){}}(dn.dependencies.indexedDB),ht.rejectionMapper=function(e,t){if(!e||e instanceof Ce||e instanceof TypeError||e instanceof SyntaxError||!e.name||!xe[e.name])return e;var r=new xe[e.name](t||e.message,e);return"stack"in e&&Q(r,"stack",{get:function(){return this.inner.stack}}),r},Ae(ve,ir);function gn(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var vn=new(function(e){l(r,e);var t=gn(r);function r(){var e;return a(this,r),(e=t.call(this,"AgoraLogger")).logs=void 0,e.openDatabase(),e.logs=e.table("logs"),e}return c(r,[{key:"openDatabase",value:function(){this.version(1).stores({logs:"++id, content, created_at"})}}]),r}(dn));function An(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var mn,yn=function(){function e(){a(this,e),this._lastObjectIndex=-1,this.thread=new k}var t,r,n;return c(e,[{key:"collectConsoleLogs",value:(n=o(v().mark((function e(){var t,r,n,i=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="",e.next=3,vn.logs.each((function(e){t+=e.content+"\n",i._lastObjectIndex=e.id}));case 3:return r=+Date.now(),n=new File([t],"".concat(r)),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"cleanupConsoleLogs",value:(r=o(v().mark((function e(){var t;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,vn.logs.where("id").belowOrEqual(this._lastObjectIndex).delete();case 2:t=e.sent,console.log("[logger] delete ".concat(t," logs"));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"_addLocalFolderAsync",value:function(e,t){return new Promise((function(r,n){e.addLocalFolderAsync(t,(function(e,t){if(t)return n(t);r()}))}))}},{key:"_readFile",value:function(e){return new Promise((function(t,r){window.require("fs").readFile(e,(function(e,n){return e?r(e):t(n)}))}))}},{key:"collectElectronLogs",value:(t=o(v().mark((function e(t,r){var n,i,o,a,s,c;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=+Date.now(),i=window.require("adm-zip"),o=window.require("path"),a=new i,e.next=6,this._addLocalFolderAsync(a,r);case 6:return s=o.resolve(t,"logs.zip"),a.writeZip(s),e.next=10,this._readFile(s);case 10:return c=e.sent,e.abrupt("return",new File([c],"".concat(n)));case 12:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}],[{key:"warn",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.log.apply(e,[On.WARN].concat(r))}},{key:"debug",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.log.apply(e,[On.DEBUG].concat(r))}},{key:"info",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.log.apply(e,[On.INFO].concat(r))}},{key:"error",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.log.apply(e,[On.ERROR].concat(r))}},{key:"log",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=Qn.logLevel;if(!(e>o)){var a="AgoraEdu-SDK [".concat(e,"]: "),s=[],c=(_(t={},"".concat(On.WARN),{call:function(){s=[a].concat(n),console.warn.apply(console,s)}}),_(t,"".concat(On.DEBUG),{call:function(){s=[a].concat(n),console.debug.apply(console,s)}}),_(t,"".concat(On.INFO),{call:function(){s=[a].concat(n),console.info.apply(console,s)}}),_(t,"".concat(On.ERROR),{call:function(){s=[a].concat(n),console.error.apply(console,s)}}),t),u="".concat(e);c.hasOwnProperty(u)?c[u].call():(s=[a].concat(n),console.log.apply(console,s))}}},{key:"setupConsoleHijack",value:function(){var t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?An(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):An(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e.originConsole);if(t.__hijackSetup)t.log("[logger] hijack already setup!");else{t.log("[logger] setup hijack..");var r=this.logger.thread,n=function(e,t){return"".concat(C()().format("YYYY-MM-DD HH:mm:ss")," ").concat((0,S.upperCase)(e||"unknown")," ").concat((0,S.escape)(t))};Object.keys(t).filter((function(e){return["info","error","warn","log","debug"].indexOf(e)>=0})).forEach((function(e,i){t[e]=function(e,t){return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=n(t.name,o.join(" "));r.postMessage({type:"log",data:s}),t.apply(e,o)}}(t,t[e])})),t.__hijackSetup=!0,window.console=t}}},{key:"restoreConsoleHijack",value:function(){console.log("[logger] restore hijack.."),window.console=e.originConsole,console.__hijackSetup=!1}}]),e}();yn.logger=new yn,yn.originConsole=window.console;var _n=new Uint8Array(16);function bn(){if(!mn&&!(mn="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 mn(_n)}const En=/^(?:[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 wn=function(e){return"string"==typeof e&&En.test(e)};for(var In=[],Cn=0;Cn<256;++Cn)In.push((Cn+256).toString(16).substr(1));const Sn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(In[e[t+0]]+In[e[t+1]]+In[e[t+2]]+In[e[t+3]]+"-"+In[e[t+4]]+In[e[t+5]]+"-"+In[e[t+6]]+In[e[t+7]]+"-"+In[e[t+8]]+In[e[t+9]]+"-"+In[e[t+10]]+In[e[t+11]]+In[e[t+12]]+In[e[t+13]]+In[e[t+14]]+In[e[t+15]]).toLowerCase();if(!wn(r))throw TypeError("Stringified UUID is invalid");return r};const Tn=function(e,t,r){var n=(e=e||{}).random||(e.rng||bn)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return Sn(n)};function Rn(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var kn,On,Nn,xn,Dn,Ln,Pn=function(e){l(r,e);var t=Rn(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r)}(y),Bn=function(e){l(r,e);var t=Rn(r);function r(e,n,i){var o;return a(this,r),(o=t.call(this))._extra=i,o.id=Tn(),o.original=void 0,o.codeList=void 0,o.message=n.message,o.original=n,o.codeList=[e],o.stack=n.stack,o}return c(r,[{key:"servCode",get:function(){var e;return null===(e=this._extra)||void 0===e?void 0:e.servCode}}],[{key:"isOf",value:function(e){if(!(e instanceof r))return!1;for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return n.includes(e.servCode)}}]),r}(w(Error)),Mn=function(e,t){return t instanceof Bn?(t.codeList.push(e),t):new Bn(e,t)},jn=function(e){l(r,e);var t=Rn(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r,[{key:"_handleError",value:function(e,t){var r=(null==t?void 0:t.stack)||(null==t?void 0:t.message);yn.error("[RteErrorCenter] error ".concat(e,": ").concat(r))}},{key:"handleThrowableError",value:function(e,t){var r=Mn(e,t);throw this._handleError(e,r),r}},{key:"handleNonThrowableError",value:function(e,t){var r=Mn(e,t);this._handleError(e,r)}}]),r}(Pn);function Un(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Un(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Un(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}jn.shared=new jn,function(e){e.RTE_ERR_MISSING_PARAMS="100000",e.RTE_ERR_SCENE_NOT_READY="100001",e.RTE_ERR_INVALID_DATA_STRUCT="100002",e.RTE_ERR_LOG_UPLOAD_FAIL="100003",e.RTE_ERR_RESTFUL_SERVICE_ERR="100004",e.RTE_ERR_RESTFUL_HTTP_CLIENT_ERR="100005",e.RTE_ERR_AGORA_FETCH_ERR="100006",e.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR="100007",e.RTE_ERR_WEB_LOG_UPLOAD_ERR="100008",e.RTE_ERR_JOIN_SCENE_FAILED="100009",e.RTE_ERR_LEAVE_SCENE_FAIL="100010",e.RTE_ERR_EVENT_CALLBACK_ERR="100011",e.RTE_ERR_SCENE_ALREADY_JOINED="100012",e.RTE_ERR_ENGINE_NOT_READY="100013",e.RTE_ERR_CONFIG_NOT_READY="100014",e.RTE_ERR_RESTFUL_NETWORK_ERR="100015",e.RTE_ERR_RESTFUL_NETWORK_TIMEOUT_ERR="100016",e.RTE_ERR_LOCAL_USER_NOT_EXIST="100017",e.RTM_ERR_LOGGED_IN_ALREADY="200000",e.RTM_ERR_JOIN_FAILED="200001",e.RTM_ERR_LEAVE_FAILED="200002",e.RTM_ERR_DESTROY_FAILED="200003",e.RTM_ERR_LOGIN_FAIL="200004",e.RTM_ERR_REGION_NOT_SPECIFIED="200005",e.RTC_ERR_CAM_ERR="300000",e.RTC_ERR_MIC_ERR="300001",e.RTC_ERR_TRACK_PUBLISH_FAIL="300002",e.RTC_ERR_TRACK_UNPUBLISH_FAIL="300003",e.RTC_ERR_TRACK_SUBSCRIBE_FAIL="300004",e.RTC_ERR_TRACK_UNSUBSCRIBE_FAIL="300005",e.RTC_ERR_NO_CHANNEL_EXISTS="300006",e.RTC_ERR_INVALID_CANVAS="300007",e.RTC_ERR_SCREEN_SHARE_ERR="300008",e.RTC_ERR_CLIENT_LEAVE_CHANNEL_FAIL="300009",e.RTC_ERR_LEAVE_MAIN_CHANNEL_FAIL="300010",e.RTC_ERR_LEAVE_SUB_CHANNEL_FAIL="300011",e.RTC_ERR_LEAVE_CHANNEL_FAIL="300012",e.RTC_ERR_VDM_GET_DEVICES_FAIL="300013",e.RTC_ERR_ADM_GET_RECORD_DEVICES_FAIL="300014",e.RTC_ERR_ADM_GET_PLAYBACK_DEVICES_FAIL="300015",e.RTC_ERR_REGION_NOT_SPECIFIED="300016",e.RTC_ERR_RTC_ENGINE_INITIALZIE_FAILED="300017",e.RTC_ERR_RTC_VDM_NOT_READY="300018",e.RTC_ERR_RTC_ADM_NOT_READY="300019"}(kn||(kn={})),function(e){e[e.OFF=0]="OFF",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e[e.VERBOSE=5]="VERBOSE"}(On||(On={})),function(e){e[e.Electron=0]="Electron",e[e.Web=1]="Web"}(Nn||(Nn={})),function(e){e.zh="zh",e.en="en"}(xn||(xn={})),function(e){e.CN="CN",e.AP="AP",e.EU="EU",e.NA="NA"}(Dn||(Dn={})),function(e){e.AREA_GLOBAL="AREA_GLOBAL",e.AREA_CN="AREA_CN",e.AREA_AS="AREA_AS",e.AREA_EUR="AREA_EUR",e.AREA_NA="AREA_NA",e.AREA_JAPAN="AREA_JAPAN",e.AREA_INDIA="AREA_INDIA"}(Ln||(Ln={}));var Qn=function(){function e(t,r){a(this,e),this.appId=void 0,this.service={},this.rtcConfigs={},this.logFilePath=void 0,this.rtcSDKParameters=[],this.userId="",this.token="",this.ignoreUrlRegionPrefix=!1,this.language=xn.zh,this.debugI18n=!1,this.region=Dn.CN,this._rtcRegion=void 0,this._rtmRegion=void 0,this.SCENE_JOIN_RETRY_ATTEMPTS=3,this.appId=t,r&&(r.language&&(this.language=r.language),r.region&&(this.region=r.region),r.rtcConfigs&&(this.rtcConfigs=Fn(Fn({},this.rtcConfigs),r.rtcConfigs)),r.rtcSDKParameters&&(this.rtcSDKParameters=r.rtcSDKParameters))}return c(e,[{key:"rtcRegion",get:function(){var e;return null!==(e=this._rtcRegion)&&void 0!==e?e:Ln.AREA_GLOBAL}},{key:"rtmRegion",get:function(){var e;return null!==(e=this._rtmRegion)&&void 0!==e?e:Ln.AREA_GLOBAL}},{key:"setRtcRegion",value:function(e){this._rtcRegion=e}},{key:"setRtmRegion",value:function(e){this._rtmRegion=e}}],[{key:"shared",get:function(){return this._config?this._config:jn.shared.handleThrowableError(kn.RTE_ERR_CONFIG_NOT_READY,new Error("classroom config not ready"))}},{key:"setConfig",value:function(e){this._config=e}},{key:"platform",get:function(){return navigator.userAgent.toLowerCase().indexOf(" electron/")>-1?Nn.Electron:Nn.Web}},{key:"version",get:function(){return"2.5.2"}}]),e}();Qn._config=void 0,Qn.logLevel=On.DEBUG;__webpack_require__(4812),__webpack_require__(1249),__webpack_require__(9826),__webpack_require__(2707),__webpack_require__(2564);var qn,Gn,Vn=function(e,t){var r=e.__$$ignoreMethods||[];r=r.concat(t),e.__$$ignoreMethods=r};__webpack_require__(7727),__webpack_require__(6210);function Kn(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}!function(e){e[e.pre=0]="pre",e[e.post=1]="post"}(qn||(qn={})),Gn||(Gn={});var Hn=function(e,t,r){if(!r)try{return e.apply(null,t)}catch(e){}},zn=function(e,t,r,n,i,o,a){var s=function(e,t){return e.__$$ignoreMethods&&e.__$$ignoreMethods.indexOf(t)>-1}(r,n);Hn(o,[{type:qn.pre,arguments:i,method:n,class:r.constructor.name,context:a}],s);var c,u,l=t.apply(e,i),h=function(e,t){Hn(o,[{type:qn.post,arguments:i,return:e,method:n,class:r.constructor.name,context:a,error:t}],s)};l&&!!l.then?l.then((function(e){c=e})).catch((function(e){u=e})).finally((function(){h(c,u)})):h(l);return l},Wn=function(e,t,r,n,i){return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return zn(this,e,t,r,a,n,i)}},Yn=function(e){return Object.getOwnPropertyNames(e).filter((function(t){return"function"==typeof e[t]}))},Jn=function(){},Xn=function(e){var t=yn[e]||Jn;return function(e){if(e.type===qn.pre){var r;e.context.start=(new Date).getTime();var n=["[".concat(e.class,"] >>> [").concat(e.method,"]")];(null===(r=e.arguments)||void 0===r?void 0:r.length)&&n.push(", args:",e.arguments),t.apply(void 0,n)}else{var i=(new Date).getTime()-e.context.start,o=["[".concat(e.class,"] <<< [").concat(e.method,"]")];e.return&&o.push(", return:",e.return),e.error&&o.push(", err:",e.error),o.push(", Time elapsed: ".concat(i,"ms")),t.apply(void 0,o)}}},Zn=(__webpack_require__(3371),{info:function(e,t,r){var n=Xn("info"),i=e[t],o=Wn(i,e,t,n,{});return{configurable:!0,enumerable:!1,get:function(){return o.bind(this)}}},warn:function(e,t,r){var n=Xn("warn"),i=e[t],o=Wn(i,e,t,n,{});return{configurable:!0,enumerable:!1,get:function(){return o.bind(this)}}},error:function(e,t,r){var n=Xn("error"),i=e[t],o=Wn(i,e,t,n,{});return{configurable:!0,enumerable:!1,get:function(){return o.bind(this)}}},attach:function(e){var t=e.level,r=void 0===t?On.INFO:t,n=e.proxyMethods,i=void 0===n||n;return function(e){var t=Xn([,"error","warn","info","info","info"][r]),n=function(e){return Object.freeze({info:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];yn.info.apply(yn,["[".concat(e.name,"]")].concat(r))},warn:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];yn.warn.apply(yn,["[".concat(e.name,"]")].concat(r))},error:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];yn.error.apply(yn,["[".concat(e.name,"]")].concat(r))},debug:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];yn.debug.apply(yn,["[".concat(e.name,"]")].concat(r))}})}(e);return function(e,t,r,n,i){var o=e.prototype;return function(e){l(u,e);var s=Kn(u);function u(){var e;a(this,u);for(var c=arguments.length,l=new Array(c),h=0;h<c;h++)l[h]=arguments[h];(e=s.call.apply(s,[this].concat(l)),Vn(o,[]),i)&&Yn(o).forEach((function(n){var i=o[n];e[n]=Wn(i,o,n,t,r).bind(f(e))}));return Object.keys(n).forEach((function(t){e[t]=n[t]})),e}return c(u)}(e)}(e,t,{},{logger:n},i)}},silence:function(e,t){Vn(e,[t])}});function $n(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||r(e)||function(){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__(4916),__webpack_require__(3123),__webpack_require__(561),__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);var ei=32,ti=31,ri={};function ni(e){e&&(e.value=!0)}function ii(){}function oi(e){return void 0===e.size&&(e.size=e.__iterate(si)),e.size}function ai(e,t){if("number"!=typeof t){var r=t>>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?oi(e)+t:t}function si(){return!0}function ci(e,t,r){return(0===e&&!fi(e)||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function ui(e,t){return hi(e,t,0)}function li(e,t){return hi(e,t,t)}function hi(e,t,r){return void 0===e?r:fi(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function fi(e){return e<0||0===e&&1/e==-1/0}var di="@@__IMMUTABLE_ITERABLE__@@";function pi(e){return Boolean(e&&e[di])}var gi="@@__IMMUTABLE_KEYED__@@";function vi(e){return Boolean(e&&e[gi])}var Ai="@@__IMMUTABLE_INDEXED__@@";function mi(e){return Boolean(e&&e[Ai])}function yi(e){return vi(e)||mi(e)}var _i=function(e){return pi(e)?e:Gi(e)},bi=function(e){function t(e){return vi(e)?e:Vi(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(_i),Ei=function(e){function t(e){return mi(e)?e:Ki(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(_i),wi=function(e){function t(e){return pi(e)&&!yi(e)?e:Hi(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(_i);_i.Keyed=bi,_i.Indexed=Ei,_i.Set=wi;var Ii="@@__IMMUTABLE_SEQ__@@";function Ci(e){return Boolean(e&&e[Ii])}var Si="@@__IMMUTABLE_RECORD__@@";function Ti(e){return Boolean(e&&e[Si])}function Ri(e){return pi(e)||Ti(e)}var ki="@@__IMMUTABLE_ORDERED__@@";function Oi(e){return Boolean(e&&e[ki])}var Ni="function"==typeof Symbol&&Symbol.iterator,xi="@@iterator",Di=Ni||xi,Li=function(e){this.next=e};function Pi(e,t,r,n){var i=0===e?t:1===e?r:[t,r];return n?n.value=i:n={value:i,done:!1},n}function Bi(){return{value:void 0,done:!0}}function Mi(e){return!!Array.isArray(e)||!!Fi(e)}function ji(e){return e&&"function"==typeof e.next}function Ui(e){var t=Fi(e);return t&&t.call(e)}function Fi(e){var t=e&&(Ni&&e[Ni]||e["@@iterator"]);if("function"==typeof t)return t}Li.prototype.toString=function(){return"[Iterator]"},Li.KEYS=0,Li.VALUES=1,Li.ENTRIES=2,Li.prototype.inspect=Li.prototype.toSource=function(){return this.toString()},Li.prototype[Di]=function(){return this};var Qi=Object.prototype.hasOwnProperty;function qi(e){return!(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var Gi=function(e){function t(e){return null==e?Xi():Ri(e)?e.toSeq():function(e){var t=eo(e);if(t)return(n=Fi(r=e))&&n===r.entries?t.fromEntrySeq():function(e){var t=Fi(e);return t&&t===e.keys}(e)?t.toSetSeq():t;var r,n;if("object"==typeof e)return new Wi(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(e,t){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[t?n-++i:i++];if(!1===e(o[1],o[0],this))break}return i}return this.__iterateUncached(e,t)},t.prototype.__iterator=function(e,t){var r=this._cache;if(r){var n=r.length,i=0;return new Li((function(){if(i===n)return{value:void 0,done:!0};var o=r[t?n-++i:i++];return Pi(e,o[0],o[1])}))}return this.__iteratorUncached(e,t)},t}(_i),Vi=function(e){function t(e){return null==e?Xi().toKeyedSeq():pi(e)?vi(e)?e.toSeq():e.fromEntrySeq():Ti(e)?e.toSeq():Zi(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(Gi),Ki=function(e){function t(e){return null==e?Xi():pi(e)?vi(e)?e.entrySeq():e.toIndexedSeq():Ti(e)?e.toSeq().entrySeq():$i(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(Gi),Hi=function(e){function t(e){return(pi(e)&&!yi(e)?e:Ki(e)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(Gi);Gi.isSeq=Ci,Gi.Keyed=Vi,Gi.Set=Hi,Gi.Indexed=Ki,Gi.prototype[Ii]=!0;var zi=function(e){function t(e){this._array=e,this.size=e.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this.has(e)?this._array[ai(this,e)]:t},t.prototype.__iterate=function(e,t){for(var r=this._array,n=r.length,i=0;i!==n;){var o=t?n-++i:i++;if(!1===e(r[o],o,this))break}return i},t.prototype.__iterator=function(e,t){var r=this._array,n=r.length,i=0;return new Li((function(){if(i===n)return{value:void 0,done:!0};var o=t?n-++i:i++;return Pi(e,o,r[o])}))},t}(Ki),Wi=function(e){function t(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},t.prototype.has=function(e){return Qi.call(this._object,e)},t.prototype.__iterate=function(e,t){for(var r=this._object,n=this._keys,i=n.length,o=0;o!==i;){var a=n[t?i-++o:o++];if(!1===e(r[a],a,this))break}return o},t.prototype.__iterator=function(e,t){var r=this._object,n=this._keys,i=n.length,o=0;return new Li((function(){if(o===i)return{value:void 0,done:!0};var a=n[t?i-++o:o++];return Pi(e,a,r[a])}))},t}(Vi);Wi.prototype[ki]=!0;var Yi,Ji=function(e){function t(e){this._collection=e,this.size=e.length||e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var r=Ui(this._collection),n=0;if(ji(r))for(var i;!(i=r.next()).done&&!1!==e(i.value,n++,this););return n},t.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=Ui(this._collection);if(!ji(r))return new Li(Bi);var n=0;return new Li((function(){var t=r.next();return t.done?t:Pi(e,n++,t.value)}))},t}(Ki);function Xi(){return Yi||(Yi=new zi([]))}function Zi(e){var t=eo(e);if(t)return t.fromEntrySeq();if("object"==typeof e)return new Wi(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function $i(e){var t=eo(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function eo(e){return qi(e)?new zi(e):Mi(e)?new Ji(e):void 0}var to="@@__IMMUTABLE_MAP__@@";function ro(e){return Boolean(e&&e[to])}function no(e){return ro(e)&&Oi(e)}function io(e){return Boolean(e&&"function"==typeof e.equals&&"function"==typeof e.hashCode)}function oo(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!!(io(e)&&io(t)&&e.equals(t))}var ao="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var r=65535&(e|=0),n=65535&(t|=0);return r*n+((e>>>16)*n+r*(t>>>16)<<16>>>0)|0};function so(e){return e>>>1&1073741824|3221225471&e}var co=Object.prototype.valueOf;function uo(e){if(null==e)return lo(e);if("function"==typeof e.hashCode)return so(e.hashCode(e));var t,r=(t=e).valueOf!==co&&"function"==typeof t.valueOf?t.valueOf(t):t;if(null==r)return lo(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(e){if(e!=e||e===1/0)return 0;var t=0|e;t!==e&&(t^=4294967295*e);for(;e>4294967295;)t^=e/=4294967295;return so(t)}(r);case"string":return r.length>bo?function(e){var t=Io[e];void 0===t&&(t=ho(e),wo===Eo&&(wo=0,Io={}),wo++,Io[e]=t);return t}(r):ho(r);case"object":case"function":return function(e){var t;if(Ao&&void 0!==(t=vo.get(e)))return t;if(void 0!==(t=e[_o]))return t;if(!po){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[_o]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=go(),Ao)vo.set(e,t);else{if(void 0!==fo&&!1===fo(e))throw new Error("Non-extensible objects are not allowed as keys.");if(po)Object.defineProperty(e,_o,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[_o]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[_o]=t}}return t}(r);case"symbol":return function(e){var t=mo[e];if(void 0!==t)return t;return t=go(),mo[e]=t,t}(r);default:if("function"==typeof r.toString)return ho(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function lo(e){return null===e?1108378658:1108378659}function ho(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return so(t)}var fo=Object.isExtensible,po=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();function go(){var e=++yo;return 1073741824&yo&&(yo=0),e}var vo,Ao="function"==typeof WeakMap;Ao&&(vo=new WeakMap);var mo=Object.create(null),yo=0,_o="__immutablehash__";"function"==typeof Symbol&&(_o=Symbol(_o));var bo=16,Eo=255,wo=0,Io={},Co=function(e){function t(e,t){this._iter=e,this._useKeys=t,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this._iter.get(e,t)},t.prototype.has=function(e){return this._iter.has(e)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var e=this,t=No(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},t.prototype.map=function(e,t){var r=this,n=Oo(this,e,t);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(e,t)}),n},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t,n){return e(t,n,r)}),t)},t.prototype.__iterator=function(e,t){return this._iter.__iterator(e,t)},t}(Vi);Co.prototype[ki]=!0;var So=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(e){return this._iter.includes(e)},t.prototype.__iterate=function(e,t){var r=this,n=0;return t&&oi(this),this._iter.__iterate((function(i){return e(i,t?r.size-++n:n++,r)}),t)},t.prototype.__iterator=function(e,t){var r=this,n=this._iter.__iterator(1,t),i=0;return t&&oi(this),new Li((function(){var o=n.next();return o.done?o:Pi(e,t?r.size-++i:i++,o.value,o)}))},t}(Ki),To=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(e){return this._iter.includes(e)},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){return e(t,t,r)}),t)},t.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new Li((function(){var t=r.next();return t.done?t:Pi(e,t.value,t.value,t)}))},t}(Hi),Ro=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){if(t){qo(t);var n=pi(t);return e(n?t.get(1):t[1],n?t.get(0):t[0],r)}}),t)},t.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new Li((function(){for(;;){var t=r.next();if(t.done)return t;var n=t.value;if(n){qo(n);var i=pi(n);return Pi(e,i?n.get(0):n[0],i?n.get(1):n[1],t)}}}))},t}(Vi);function ko(e){var t=Vo(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Ko,t.__iterateUncached=function(t,r){var n=this;return e.__iterate((function(e,r){return!1!==t(r,e,n)}),r)},t.__iteratorUncached=function(t,r){if(2===t){var n=e.__iterator(t,r);return new Li((function(){var e=n.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,r)},t}function Oo(e,t,r){var n=Vo(e);return n.size=e.size,n.has=function(t){return e.has(t)},n.get=function(n,i){var o=e.get(n,ri);return o===ri?i:t.call(r,o,n,e)},n.__iterateUncached=function(n,i){var o=this;return e.__iterate((function(e,i,a){return!1!==n(t.call(r,e,i,a),i,o)}),i)},n.__iteratorUncached=function(n,i){var o=e.__iterator(2,i);return new Li((function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return Pi(n,s,t.call(r,a[1],s,e),i)}))},n}function No(e,t){var r=this,n=Vo(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=ko(e);return t.reverse=function(){return e.flip()},t}),n.get=function(r,n){return e.get(t?r:-1-r,n)},n.has=function(r){return e.has(t?r:-1-r)},n.includes=function(t){return e.includes(t)},n.cacheResult=Ko,n.__iterate=function(r,n){var i=this,o=0;return n&&oi(e),e.__iterate((function(e,a){return r(e,t?a:n?i.size-++o:o++,i)}),!n)},n.__iterator=function(n,i){var o=0;i&&oi(e);var a=e.__iterator(2,!i);return new Li((function(){var e=a.next();if(e.done)return e;var s=e.value;return Pi(n,t?s[0]:i?r.size-++o:o++,s[1],e)}))},n}function xo(e,t,r,n){var i=Vo(e);return n&&(i.has=function(n){var i=e.get(n,ri);return i!==ri&&!!t.call(r,i,n,e)},i.get=function(n,i){var o=e.get(n,ri);return o!==ri&&t.call(r,o,n,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate((function(e,o,c){if(t.call(r,e,o,c))return s++,i(e,n?o:s-1,a)}),o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(2,o),s=0;return new Li((function(){for(;;){var o=a.next();if(o.done)return o;var c=o.value,u=c[0],l=c[1];if(t.call(r,l,u,e))return Pi(i,n?u:s++,l,o)}}))},i}function Do(e,t,r,n){var i=e.size;if(ci(t,r,i))return e;var o=ui(t,i),a=li(r,i);if(o!=o||a!=a)return Do(e.toSeq().cacheResult(),t,r,n);var s,c=a-o;c==c&&(s=c<0?0:c);var u=Vo(e);return u.size=0===s?s:e.size&&s||void 0,!n&&Ci(e)&&s>=0&&(u.get=function(t,r){return(t=ai(this,t))>=0&&t<s?e.get(t+o,r):r}),u.__iterateUncached=function(t,r){var i=this;if(0===s)return 0;if(r)return this.cacheResult().__iterate(t,r);var a=0,c=!0,u=0;return e.__iterate((function(e,r){if(!c||!(c=a++<o))return u++,!1!==t(e,n?r:u-1,i)&&u!==s})),u},u.__iteratorUncached=function(t,r){if(0!==s&&r)return this.cacheResult().__iterator(t,r);if(0===s)return new Li(Bi);var i=e.__iterator(t,r),a=0,c=0;return new Li((function(){for(;a++<o;)i.next();if(++c>s)return{value:void 0,done:!0};var e=i.next();return n||1===t||e.done?e:Pi(t,c-1,0===t?void 0:e.value[1],e)}))},u}function Lo(e,t,r,n){var i=Vo(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,c=0;return e.__iterate((function(e,o,u){if(!s||!(s=t.call(r,e,o,u)))return c++,i(e,n?o:c-1,a)})),c},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(2,o),c=!0,u=0;return new Li((function(){var e,o,l;do{if((e=s.next()).done)return n||1===i?e:Pi(i,u++,0===i?void 0:e.value[1],e);var h=e.value;o=h[0],l=h[1],c&&(c=t.call(r,l,o,a))}while(c);return 2===i?e:Pi(i,o,l,e)}))},i}function Po(e,t){var r=vi(e),n=[e].concat(t).map((function(e){return pi(e)?r&&(e=bi(e)):e=r?Zi(e):$i(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===n.length)return e;if(1===n.length){var i=n[0];if(i===e||r&&vi(i)||mi(e)&&mi(i))return i}var o=new zi(n);return r?o=o.toKeyedSeq():mi(e)||(o=o.toSetSeq()),(o=o.flatten(!0)).size=n.reduce((function(e,t){if(void 0!==e){var r=t.size;if(void 0!==r)return e+r}}),0),o}function Bo(e,t,r){var n=Vo(e);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var a=0,s=!1;return function e(c,u){c.__iterate((function(o,c){return(!t||u<t)&&pi(o)?e(o,u+1):(a++,!1===i(o,r?c:a-1,n)&&(s=!0)),!s}),o)}(e,0),a},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var o=e.__iterator(n,i),a=[],s=0;return new Li((function(){for(;o;){var e=o.next();if(!1===e.done){var c=e.value;if(2===n&&(c=c[1]),t&&!(a.length<t)||!pi(c))return r?e:Pi(n,s++,c,e);a.push(o),o=c.__iterator(n,i)}else o=a.pop()}return{value:void 0,done:!0}}))},n}function Mo(e,t,r){t||(t=Ho);var n=vi(e),i=0,o=e.toSeq().map((function(t,n){return[n,t,i++,r?r(t,n,e):t]})).valueSeq().toArray();return o.sort((function(e,r){return t(e[3],r[3])||e[2]-r[2]})).forEach(n?function(e,t){o[t].length=2}:function(e,t){o[t]=e[1]}),n?Vi(o):mi(e)?Ki(o):Hi(o)}function jo(e,t,r){if(t||(t=Ho),r){var n=e.toSeq().map((function(t,n){return[t,r(t,n,e)]})).reduce((function(e,r){return Uo(t,e[1],r[1])?r:e}));return n&&n[0]}return e.reduce((function(e,r){return Uo(t,e,r)?r:e}))}function Uo(e,t,r){var n=e(r,t);return 0===n&&r!==t&&(null==r||r!=r)||n>0}function Fo(e,t,r,n){var i=Vo(e),o=new zi(r).map((function(e){return e.size}));return i.size=n?o.max():o.min(),i.__iterate=function(e,t){for(var r,n=this.__iterator(1,t),i=0;!(r=n.next()).done&&!1!==e(r.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map((function(e){return e=_i(e),Ui(i?e.reverse():e)})),a=0,s=!1;return new Li((function(){var r;return s||(r=o.map((function(e){return e.next()})),s=n?r.every((function(e){return e.done})):r.some((function(e){return e.done}))),s?{value:void 0,done:!0}:Pi(e,a++,t.apply(null,r.map((function(e){return e.value}))))}))},i}function Qo(e,t){return e===t?e:Ci(e)?t:e.constructor(t)}function qo(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Go(e){return vi(e)?bi:mi(e)?Ei:wi}function Vo(e){return Object.create((vi(e)?Vi:mi(e)?Ki:Hi).prototype)}function Ko(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Gi.prototype.cacheResult.call(this)}function Ho(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e<t?-1:0}function zo(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),i=0;i<r;i++)n[i]=e[i+t];return n}function Wo(e,t){if(!e)throw new Error(t)}function Yo(e){Wo(e!==1/0,"Cannot perform this action with an infinite size.")}function Jo(e){if(qi(e)&&"string"!=typeof e)return e;if(Oi(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}So.prototype.cacheResult=Co.prototype.cacheResult=To.prototype.cacheResult=Ro.prototype.cacheResult=Ko;var Xo=Object.prototype.toString;function Zo(e){if(!e||"object"!=typeof e||"[object Object]"!==Xo.call(e))return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var r=t,n=Object.getPrototypeOf(t);null!==n;)r=n,n=Object.getPrototypeOf(r);return r===t}function $o(e){return"object"==typeof e&&(Ri(e)||Array.isArray(e)||Zo(e))}function ea(e){try{return"string"==typeof e?JSON.stringify(e):String(e)}catch(t){return JSON.stringify(e)}}function ta(e,t){return Ri(e)?e.has(t):$o(e)&&Qi.call(e,t)}function ra(e,t,r){return Ri(e)?e.get(t,r):ta(e,t)?"function"==typeof e.get?e.get(t):e[t]:r}function na(e){if(Array.isArray(e))return zo(e);var t={};for(var r in e)Qi.call(e,r)&&(t[r]=e[r]);return t}function ia(e,t){if(!$o(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Ri(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!Qi.call(e,t))return e;var r=na(e);return Array.isArray(r)?r.splice(t,1):delete r[t],r}function oa(e,t,r){if(!$o(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Ri(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,r)}if(Qi.call(e,t)&&r===e[t])return e;var n=na(e);return n[t]=r,n}function aa(e,t,r,n){n||(n=r,r=void 0);var i=sa(Ri(e),e,Jo(t),0,r,n);return i===ri?r:i}function sa(e,t,r,n,i,o){var a=t===ri;if(n===r.length){var s=a?i:t,c=o(s);return c===s?t:c}if(!a&&!$o(t))throw new TypeError("Cannot update within non-data-structure value in path ["+r.slice(0,n).map(ea)+"]: "+t);var u=r[n],l=a?ri:ra(t,u,ri),h=sa(l===ri?e:Ri(l),l,r,n+1,i,o);return h===l?t:h===ri?ia(t,u):oa(a?e?Fa():{}:t,u,h)}function ca(e,t,r){return aa(e,t,ri,(function(){return r}))}function ua(e,t){return ca(this,e,t)}function la(e,t){return aa(e,t,(function(){return ri}))}function ha(e){return la(this,e)}function fa(e,t,r,n){return aa(e,[t],r,n)}function da(e,t,r){return 1===arguments.length?e(this):fa(this,e,t,r)}function pa(e,t,r){return aa(this,e,t,r)}function ga(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Aa(this,e)}function va(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return Aa(this,t,e)}function Aa(e,t,r){for(var n=[],i=0;i<t.length;i++){var o=bi(t[i]);0!==o.size&&n.push(o)}return 0===n.length?e:0!==e.toSeq().size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var t=r?function(t,n){fa(e,n,ri,(function(e){return e===ri?t:r(e,t,n)}))}:function(t,r){e.set(r,t)},i=0;i<n.length;i++)n[i].forEach(t)})):e.constructor(n[0])}function ma(e,t,r){return ya(e,t,function(e){function t(r,n,i){return $o(r)&&$o(n)&&(o=n,a=Gi(r),s=Gi(o),mi(a)===mi(s)&&vi(a)===vi(s))?ya(r,[n],t):e?e(r,n,i):n;var o,a,s}return t}(r))}function ya(e,t,r){if(!$o(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(Ri(e))return"function"==typeof r&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),i=e,o=n?Ei:bi,a=n?function(t){i===e&&(i=na(i)),i.push(t)}:function(t,n){var o=Qi.call(i,n),a=o&&r?r(i[n],t,n):t;o&&a===i[n]||(i===e&&(i=na(i)),i[n]=a)},s=0;s<t.length;s++)o(t[s]).forEach(a);return i}function _a(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return ma(this,e)}function ba(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return ma(this,t,e)}function Ea(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return aa(this,e,Fa(),(function(e){return ya(e,t)}))}function wa(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return aa(this,e,Fa(),(function(e){return ma(e,t)}))}function Ia(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function Ca(){return this.__ownerID?this:this.__ensureOwner(new ii)}function Sa(){return this.__ensureOwner()}function Ta(){return this.__altered}var Ra=function(e){function t(t){return null==t?Fa():ro(t)&&!Oi(t)?t:Fa().withMutations((function(r){var n=e(t);Yo(n.size),n.forEach((function(e,t){return r.set(t,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Fa().withMutations((function(t){for(var r=0;r<e.length;r+=2){if(r+1>=e.length)throw new Error("Missing value for key: "+e[r]);t.set(e[r],e[r+1])}}))},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},t.prototype.set=function(e,t){return Qa(this,e,t)},t.prototype.remove=function(e){return Qa(this,e,ri)},t.prototype.deleteAll=function(e){var t=_i(e);return 0===t.size?this:this.withMutations((function(e){t.forEach((function(t){return e.remove(t)}))}))},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Fa()},t.prototype.sort=function(e){return fs(Mo(this,e))},t.prototype.sortBy=function(e,t){return fs(Mo(this,t,e))},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){n.forEach((function(i,o){n.set(o,e.call(t,i,o,r))}))}))},t.prototype.__iterator=function(e,t){return new Ba(this,e,t)},t.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate((function(t){return n++,e(t[1],t[0],r)}),t),n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ua(this.size,this._root,e,this.__hash):0===this.size?Fa():(this.__ownerID=e,this.__altered=!1,this)},t}(bi);Ra.isMap=ro;var ka=Ra.prototype;ka[to]=!0,ka.delete=ka.remove,ka.removeAll=ka.deleteAll,ka.setIn=ua,ka.removeIn=ka.deleteIn=ha,ka.update=da,ka.updateIn=pa,ka.merge=ka.concat=ga,ka.mergeWith=va,ka.mergeDeep=_a,ka.mergeDeepWith=ba,ka.mergeIn=Ea,ka.mergeDeepIn=wa,ka.withMutations=Ia,ka.wasAltered=Ta,ka.asImmutable=Sa,ka["@@transducer/init"]=ka.asMutable=Ca,ka["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},ka["@@transducer/result"]=function(e){return e.asImmutable()};var Oa=function(e,t){this.ownerID=e,this.entries=t};Oa.prototype.get=function(e,t,r,n){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(oo(r,i[o][0]))return i[o][1];return n},Oa.prototype.update=function(e,t,r,n,i,o,a){for(var s=i===ri,c=this.entries,u=0,l=c.length;u<l&&!oo(n,c[u][0]);u++);var h=u<l;if(h?c[u][1]===i:s)return this;if(ni(a),(s||!h)&&ni(o),!s||1!==c.length){if(!h&&!s&&c.length>=za)return function(e,t,r,n){e||(e=new ii);for(var i=new La(e,uo(r),[r,n]),o=0;o<t.length;o++){var a=t[o];i=i.update(e,0,void 0,a[0],a[1])}return i}(e,c,n,i);var f=e&&e===this.ownerID,d=f?c:zo(c);return h?s?u===l-1?d.pop():d[u]=d.pop():d[u]=[n,i]:d.push([n,i]),f?(this.entries=d,this):new Oa(e,d)}};var Na=function(e,t,r){this.ownerID=e,this.bitmap=t,this.nodes=r};Na.prototype.get=function(e,t,r,n){void 0===t&&(t=uo(r));var i=1<<((0===e?t:t>>>e)&ti),o=this.bitmap;return 0==(o&i)?n:this.nodes[Ka(o&i-1)].get(e+5,t,r,n)},Na.prototype.update=function(e,t,r,n,i,o,a){void 0===r&&(r=uo(n));var s=(0===t?r:r>>>t)&ti,c=1<<s,u=this.bitmap,l=0!=(u&c);if(!l&&i===ri)return this;var h=Ka(u&c-1),f=this.nodes,d=l?f[h]:void 0,p=qa(d,e,t+5,r,n,i,o,a);if(p===d)return this;if(!l&&p&&f.length>=Wa)return function(e,t,r,n,i){for(var o=0,a=new Array(ei),s=0;0!==r;s++,r>>>=1)a[s]=1&r?t[o++]:void 0;return a[n]=i,new xa(e,o+1,a)}(e,f,u,s,p);if(l&&!p&&2===f.length&&Ga(f[1^h]))return f[1^h];if(l&&p&&1===f.length&&Ga(p))return p;var g=e&&e===this.ownerID,v=l?p?u:u^c:u|c,A=l?p?Ha(f,h,p,g):function(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var i=new Array(n),o=0,a=0;a<n;a++)a===t&&(o=1),i[a]=e[a+o];return i}(f,h,g):function(e,t,r,n){var i=e.length+1;if(n&&t+1===i)return e[t]=r,e;for(var o=new Array(i),a=0,s=0;s<i;s++)s===t?(o[s]=r,a=-1):o[s]=e[s+a];return o}(f,h,p,g);return g?(this.bitmap=v,this.nodes=A,this):new Na(e,v,A)};var xa=function(e,t,r){this.ownerID=e,this.count=t,this.nodes=r};xa.prototype.get=function(e,t,r,n){void 0===t&&(t=uo(r));var i=(0===e?t:t>>>e)&ti,o=this.nodes[i];return o?o.get(e+5,t,r,n):n},xa.prototype.update=function(e,t,r,n,i,o,a){void 0===r&&(r=uo(n));var s=(0===t?r:r>>>t)&ti,c=i===ri,u=this.nodes,l=u[s];if(c&&!l)return this;var h=qa(l,e,t+5,r,n,i,o,a);if(h===l)return this;var f=this.count;if(l){if(!h&&--f<Ya)return function(e,t,r,n){for(var i=0,o=0,a=new Array(r),s=0,c=1,u=t.length;s<u;s++,c<<=1){var l=t[s];void 0!==l&&s!==n&&(i|=c,a[o++]=l)}return new Na(e,i,a)}(e,u,f,s)}else f++;var d=e&&e===this.ownerID,p=Ha(u,s,h,d);return d?(this.count=f,this.nodes=p,this):new xa(e,f,p)};var Da=function(e,t,r){this.ownerID=e,this.keyHash=t,this.entries=r};Da.prototype.get=function(e,t,r,n){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(oo(r,i[o][0]))return i[o][1];return n},Da.prototype.update=function(e,t,r,n,i,o,a){void 0===r&&(r=uo(n));var s=i===ri;if(r!==this.keyHash)return s?this:(ni(a),ni(o),Va(this,e,t,r,[n,i]));for(var c=this.entries,u=0,l=c.length;u<l&&!oo(n,c[u][0]);u++);var h=u<l;if(h?c[u][1]===i:s)return this;if(ni(a),(s||!h)&&ni(o),s&&2===l)return new La(e,this.keyHash,c[1^u]);var f=e&&e===this.ownerID,d=f?c:zo(c);return h?s?u===l-1?d.pop():d[u]=d.pop():d[u]=[n,i]:d.push([n,i]),f?(this.entries=d,this):new Da(e,this.keyHash,d)};var La=function(e,t,r){this.ownerID=e,this.keyHash=t,this.entry=r};La.prototype.get=function(e,t,r,n){return oo(r,this.entry[0])?this.entry[1]:n},La.prototype.update=function(e,t,r,n,i,o,a){var s=i===ri,c=oo(n,this.entry[0]);return(c?i===this.entry[1]:s)?this:(ni(a),s?void ni(o):c?e&&e===this.ownerID?(this.entry[1]=i,this):new La(e,this.keyHash,[n,i]):(ni(o),Va(this,e,t,uo(n),[n,i])))},Oa.prototype.iterate=Da.prototype.iterate=function(e,t){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(!1===e(r[t?i-n:n]))return!1},Na.prototype.iterate=xa.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[t?i-n:n];if(o&&!1===o.iterate(e,t))return!1}},La.prototype.iterate=function(e,t){return e(this.entry)};var Pa,Ba=function(e){function t(e,t,r){this._type=t,this._reverse=r,this._stack=e._root&&ja(e._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var r=t.node,n=t.index++,i=void 0;if(r.entry){if(0===n)return Ma(e,r.entry)}else if(r.entries){if(n<=(i=r.entries.length-1))return Ma(e,r.entries[this._reverse?i-n:n])}else if(n<=(i=r.nodes.length-1)){var o=r.nodes[this._reverse?i-n:n];if(o){if(o.entry)return Ma(e,o.entry);t=this._stack=ja(o,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}},t}(Li);function Ma(e,t){return Pi(e,t[0],t[1])}function ja(e,t){return{node:e,index:0,__prev:t}}function Ua(e,t,r,n){var i=Object.create(ka);return i.size=e,i._root=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Fa(){return Pa||(Pa=Ua(0))}function Qa(e,t,r){var n,i;if(e._root){var o={value:!1},a={value:!1};if(n=qa(e._root,e.__ownerID,0,void 0,t,r,o,a),!a.value)return e;i=e.size+(o.value?r===ri?-1:1:0)}else{if(r===ri)return e;i=1,n=new Oa(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=i,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?Ua(i,n):Fa()}function qa(e,t,r,n,i,o,a,s){return e?e.update(t,r,n,i,o,a,s):o===ri?e:(ni(s),ni(a),new La(t,n,[i,o]))}function Ga(e){return e.constructor===La||e.constructor===Da}function Va(e,t,r,n,i){if(e.keyHash===n)return new Da(t,n,[e.entry,i]);var o,a=(0===r?e.keyHash:e.keyHash>>>r)&ti,s=(0===r?n:n>>>r)&ti,c=a===s?[Va(e,t,r+5,n,i)]:(o=new La(t,n,i),a<s?[e,o]:[o,e]);return new Na(t,1<<a|1<<s,c)}function Ka(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function Ha(e,t,r,n){var i=n?e:zo(e);return i[t]=r,i}var za=8,Wa=16,Ya=8,Ja="@@__IMMUTABLE_LIST__@@";function Xa(e){return Boolean(e&&e[Ja])}var Za=function(e){function t(t){var r=os();if(null==t)return r;if(Xa(t))return t;var n=e(t),i=n.size;return 0===i?r:(Yo(i),i>0&&i<ei?is(0,i,5,null,new es(n.toArray())):r.withMutations((function(e){e.setSize(i),n.forEach((function(t,r){return e.set(r,t)}))})))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(e,t){if((e=ai(this,e))>=0&&e<this.size){var r=cs(this,e+=this._origin);return r&&r.array[e&ti]}return t},t.prototype.set=function(e,t){return function(e,t,r){if((t=ai(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?us(e,t).set(0,r):us(e,0,t+1).set(t,r)}));t+=e._origin;var n=e._tail,i=e._root,o={value:!1};t>=ls(e._capacity)?n=as(n,e.__ownerID,0,t,r,o):i=as(i,e.__ownerID,e._level,t,r,o);if(!o.value)return e;if(e.__ownerID)return e._root=i,e._tail=n,e.__hash=void 0,e.__altered=!0,e;return is(e._origin,e._capacity,e._level,i,n)}(this,e,t)},t.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},t.prototype.insert=function(e,t){return this.splice(e,0,t)},t.prototype.clear=function(){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):os()},t.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(r){us(r,0,t+e.length);for(var n=0;n<e.length;n++)r.set(t+n,e[n])}))},t.prototype.pop=function(){return us(this,0,-1)},t.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){us(t,-e.length);for(var r=0;r<e.length;r++)t.set(r,e[r])}))},t.prototype.shift=function(){return us(this,1)},t.prototype.concat=function(){for(var t=arguments,r=[],n=0;n<arguments.length;n++){var i=t[n],o=e("string"!=typeof i&&Mi(i)?i:[i]);0!==o.size&&r.push(o)}return 0===r.length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations((function(e){r.forEach((function(t){return t.forEach((function(t){return e.push(t)}))}))})):this.constructor(r[0])},t.prototype.setSize=function(e){return us(this,0,e)},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){for(var i=0;i<r.size;i++)n.set(i,e.call(t,n.get(i),i,r))}))},t.prototype.slice=function(e,t){var r=this.size;return ci(e,t,r)?this:us(this,ui(e,r),li(t,r))},t.prototype.__iterator=function(e,t){var r=t?this.size:0,n=ns(this,t);return new Li((function(){var i=n();return i===rs?{value:void 0,done:!0}:Pi(e,t?--r:r++,i)}))},t.prototype.__iterate=function(e,t){for(var r,n=t?this.size:0,i=ns(this,t);(r=i())!==rs&&!1!==e(r,t?--n:n++,this););return n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?is(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):0===this.size?os():(this.__ownerID=e,this.__altered=!1,this)},t}(Ei);Za.isList=Xa;var $a=Za.prototype;$a[Ja]=!0,$a.delete=$a.remove,$a.merge=$a.concat,$a.setIn=ua,$a.deleteIn=$a.removeIn=ha,$a.update=da,$a.updateIn=pa,$a.mergeIn=Ea,$a.mergeDeepIn=wa,$a.withMutations=Ia,$a.wasAltered=Ta,$a.asImmutable=Sa,$a["@@transducer/init"]=$a.asMutable=Ca,$a["@@transducer/step"]=function(e,t){return e.push(t)},$a["@@transducer/result"]=function(e){return e.asImmutable()};var es=function(e,t){this.array=e,this.ownerID=t};es.prototype.removeBefore=function(e,t,r){if(r===t?1<<t:0===this.array.length)return this;var n=r>>>t&ti;if(n>=this.array.length)return new es([],e);var i,o=0===n;if(t>0){var a=this.array[n];if((i=a&&a.removeBefore(e,t-5,r))===a&&o)return this}if(o&&!i)return this;var s=ss(this,e);if(!o)for(var c=0;c<n;c++)s.array[c]=void 0;return i&&(s.array[n]=i),s},es.prototype.removeAfter=function(e,t,r){if(r===(t?1<<t:0)||0===this.array.length)return this;var n,i=r-1>>>t&ti;if(i>=this.array.length)return this;if(t>0){var o=this.array[i];if((n=o&&o.removeAfter(e,t-5,r))===o&&i===this.array.length-1)return this}var a=ss(this,e);return a.array.splice(i+1),n&&(a.array[i]=n),a};var ts,rs={};function ns(e,t){var r=e._origin,n=e._capacity,i=ls(n),o=e._tail;return a(e._root,e._level,0);function a(e,s,c){return 0===s?function(e,a){var s=a===i?o&&o.array:e&&e.array,c=a>r?0:r-a,u=n-a;u>ei&&(u=ei);return function(){if(c===u)return rs;var e=t?--u:c++;return s&&s[e]}}(e,c):function(e,i,o){var s,c=e&&e.array,u=o>r?0:r-o>>i,l=1+(n-o>>i);l>ei&&(l=ei);return function(){for(;;){if(s){var e=s();if(e!==rs)return e;s=null}if(u===l)return rs;var r=t?--l:u++;s=a(c&&c[r],i-5,o+(r<<i))}}}(e,s,c)}}function is(e,t,r,n,i,o,a){var s=Object.create($a);return s.size=t-e,s._origin=e,s._capacity=t,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}function os(){return ts||(ts=is(0,0,5))}function as(e,t,r,n,i,o){var a,s=n>>>r&ti,c=e&&s<e.array.length;if(!c&&void 0===i)return e;if(r>0){var u=e&&e.array[s],l=as(u,t,r-5,n,i,o);return l===u?e:((a=ss(e,t)).array[s]=l,a)}return c&&e.array[s]===i?e:(o&&ni(o),a=ss(e,t),void 0===i&&s===a.array.length-1?a.array.pop():a.array[s]=i,a)}function ss(e,t){return t&&e&&t===e.ownerID?e:new es(e?e.array.slice():[],t)}function cs(e,t){if(t>=ls(e._capacity))return e._tail;if(t<1<<e._level+5){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&ti],n-=5;return r}}function us(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new ii,i=e._origin,o=e._capacity,a=i+t,s=void 0===r?o:r<0?o+r:i+r;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var c=e._level,u=e._root,l=0;a+l<0;)u=new es(u&&u.array.length?[void 0,u]:[],n),l+=1<<(c+=5);l&&(a+=l,i+=l,s+=l,o+=l);for(var h=ls(o),f=ls(s);f>=1<<c+5;)u=new es(u&&u.array.length?[u]:[],n),c+=5;var d=e._tail,p=f<h?cs(e,s-1):f>h?new es([],n):d;if(d&&f>h&&a<o&&d.array.length){for(var g=u=ss(u,n),v=c;v>5;v-=5){var A=h>>>v&ti;g=g.array[A]=ss(g.array[A],n)}g.array[h>>>5&ti]=d}if(s<o&&(p=p&&p.removeAfter(n,0,s)),a>=f)a-=f,s-=f,c=5,u=null,p=p&&p.removeBefore(n,0,a);else if(a>i||f<h){for(l=0;u;){var m=a>>>c&ti;if(m!==f>>>c&ti)break;m&&(l+=(1<<c)*m),c-=5,u=u.array[m]}u&&a>i&&(u=u.removeBefore(n,c,a-l)),u&&f<h&&(u=u.removeAfter(n,c,f-l)),l&&(a-=l,s-=l)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=c,e._root=u,e._tail=p,e.__hash=void 0,e.__altered=!0,e):is(a,s,c,u,p)}function ls(e){return e<ei?0:e-1>>>5<<5}var hs,fs=function(e){function t(e){return null==e?ps():no(e)?e:ps().withMutations((function(t){var r=bi(e);Yo(r.size),r.forEach((function(e,r){return t.set(r,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(e,t){var r=this._map.get(e);return void 0!==r?this._list.get(r)[1]:t},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):ps()},t.prototype.set=function(e,t){return gs(this,e,t)},t.prototype.remove=function(e){return gs(this,e,ri)},t.prototype.__iterate=function(e,t){var r=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],r)}),t)},t.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),r=this._list.__ensureOwner(e);return e?ds(t,r,e,this.__hash):0===this.size?ps():(this.__ownerID=e,this.__altered=!1,this._map=t,this._list=r,this)},t}(Ra);function ds(e,t,r,n){var i=Object.create(fs.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function ps(){return hs||(hs=ds(Fa(),os()))}function gs(e,t,r){var n,i,o=e._map,a=e._list,s=o.get(t),c=void 0!==s;if(r===ri){if(!c)return e;a.size>=ei&&a.size>=2*o.size?(n=(i=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(n.__ownerID=i.__ownerID=e.__ownerID)):(n=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(c){if(r===a.get(s)[1])return e;n=o,i=a.set(s,[t,r])}else n=o.set(t,a.size),i=a.set(a.size,[t,r]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=i,e.__hash=void 0,e.__altered=!0,e):ds(n,i)}fs.isOrderedMap=no,fs.prototype[ki]=!0,fs.prototype.delete=fs.prototype.remove;var vs="@@__IMMUTABLE_STACK__@@";function As(e){return Boolean(e&&e[vs])}var ms=function(e){function t(e){return null==e?Es():As(e)?e:Es().pushAll(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(e,t){var r=this._head;for(e=ai(this,e);r&&e--;)r=r.next;return r?r.value:t},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var e=arguments;if(0===arguments.length)return this;for(var t=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:e[n],next:r};return this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):bs(t,r)},t.prototype.pushAll=function(t){if(0===(t=e(t)).size)return this;if(0===this.size&&As(t))return t;Yo(t.size);var r=this.size,n=this._head;return t.__iterate((function(e){r++,n={value:e,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):bs(r,n)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Es()},t.prototype.slice=function(t,r){if(ci(t,r,this.size))return this;var n=ui(t,this.size);if(li(r,this.size)!==this.size)return e.prototype.slice.call(this,t,r);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):bs(i,o)},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?bs(this.size,this._head,e,this.__hash):0===this.size?Es():(this.__ownerID=e,this.__altered=!1,this)},t.prototype.__iterate=function(e,t){var r=this;if(t)return new zi(this.toArray()).__iterate((function(t,n){return e(t,n,r)}),t);for(var n=0,i=this._head;i&&!1!==e(i.value,n++,this);)i=i.next;return n},t.prototype.__iterator=function(e,t){if(t)return new zi(this.toArray()).__iterator(e,t);var r=0,n=this._head;return new Li((function(){if(n){var t=n.value;return n=n.next,Pi(e,r++,t)}return{value:void 0,done:!0}}))},t}(Ei);ms.isStack=As;var ys,_s=ms.prototype;function bs(e,t,r,n){var i=Object.create(_s);return i.size=e,i._head=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Es(){return ys||(ys=bs(0))}_s[vs]=!0,_s.shift=_s.pop,_s.unshift=_s.push,_s.unshiftAll=_s.pushAll,_s.withMutations=Ia,_s.wasAltered=Ta,_s.asImmutable=Sa,_s["@@transducer/init"]=_s.asMutable=Ca,_s["@@transducer/step"]=function(e,t){return e.unshift(t)},_s["@@transducer/result"]=function(e){return e.asImmutable()};var ws="@@__IMMUTABLE_SET__@@";function Is(e){return Boolean(e&&e[ws])}function Cs(e){return Is(e)&&Oi(e)}function Ss(e,t){if(e===t)return!0;if(!pi(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||vi(e)!==vi(t)||mi(e)!==mi(t)||Oi(e)!==Oi(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!yi(e);if(Oi(e)){var n=e.entries();return t.every((function(e,t){var i=n.next().value;return i&&oo(i[1],e)&&(r||oo(i[0],t))}))&&n.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var a=!0,s=t.__iterate((function(t,n){if(r?!e.has(t):i?!oo(t,e.get(n,ri)):!oo(e.get(n,ri),t))return a=!1,!1}));return a&&e.size===s}function Ts(e,t){var r=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function Rs(e){if(!e||"object"!=typeof e)return e;if(!pi(e)){if(!$o(e))return e;e=Gi(e)}if(vi(e)){var t={};return e.__iterate((function(e,r){t[r]=Rs(e)})),t}var r=[];return e.__iterate((function(e){r.push(Rs(e))})),r}var ks=function(e){function t(t){return null==t?Ls():Is(t)&&!Oi(t)?t:Ls().withMutations((function(r){var n=e(t);Yo(n.size),n.forEach((function(e){return r.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(bi(e).keySeq())},t.intersect=function(e){return(e=_i(e).toArray()).length?Ns.intersect.apply(t(e.pop()),e):Ls()},t.union=function(e){return(e=_i(e).toArray()).length?Ns.union.apply(t(e.pop()),e):Ls()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(e){return this._map.has(e)},t.prototype.add=function(e){return xs(this,this._map.set(e,e))},t.prototype.remove=function(e){return xs(this,this._map.remove(e))},t.prototype.clear=function(){return xs(this,this._map.clear())},t.prototype.map=function(e,t){var r=this,n=!1,i=xs(this,this._map.mapEntries((function(i){var o=i[1],a=e.call(t,o,o,r);return a!==o&&(n=!0),[a,a]}),t));return n?i:this},t.prototype.union=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(r){for(var n=0;n<t.length;n++)e(t[n]).forEach((function(e){return r.add(e)}))})):this.constructor(t[0])},t.prototype.intersect=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(0===t.length)return this;t=t.map((function(t){return e(t)}));var n=[];return this.forEach((function(e){t.every((function(t){return t.includes(e)}))||n.push(e)})),this.withMutations((function(e){n.forEach((function(t){e.remove(t)}))}))},t.prototype.subtract=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(0===t.length)return this;t=t.map((function(t){return e(t)}));var n=[];return this.forEach((function(e){t.some((function(t){return t.includes(e)}))&&n.push(e)})),this.withMutations((function(e){n.forEach((function(t){e.remove(t)}))}))},t.prototype.sort=function(e){return $s(Mo(this,e))},t.prototype.sortBy=function(e,t){return $s(Mo(this,t,e))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(e,t){var r=this;return this._map.__iterate((function(t){return e(t,t,r)}),t)},t.prototype.__iterator=function(e,t){return this._map.__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):0===this.size?this.__empty():(this.__ownerID=e,this._map=t,this)},t}(wi);ks.isSet=Is;var Os,Ns=ks.prototype;function xs(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function Ds(e,t){var r=Object.create(Ns);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function Ls(){return Os||(Os=Ds(Fa()))}Ns[ws]=!0,Ns.delete=Ns.remove,Ns.merge=Ns.concat=Ns.union,Ns.withMutations=Ia,Ns.asImmutable=Sa,Ns["@@transducer/init"]=Ns.asMutable=Ca,Ns["@@transducer/step"]=function(e,t){return e.add(t)},Ns["@@transducer/result"]=function(e){return e.asImmutable()},Ns.__empty=Ls,Ns.__make=Ds;var Ps,Bs=function(e){function t(e,r,n){if(!(this instanceof t))return new t(e,r,n);if(Wo(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===r&&(r=1/0),n=void 0===n?1:Math.abs(n),r<e&&(n=-n),this._start=e,this._end=r,this._step=n,this.size=Math.max(0,Math.ceil((r-e)/n-1)+1),0===this.size){if(Ps)return Ps;Ps=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},t.prototype.get=function(e,t){return this.has(e)?this._start+ai(this,e)*this._step:t},t.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},t.prototype.slice=function(e,r){return ci(e,r,this.size)?this:(e=ui(e,this.size),(r=li(r,this.size))<=e?new t(0,0):new t(this.get(e,this._end),this.get(r,this._end),this._step))},t.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var r=t/this._step;if(r>=0&&r<this.size)return r}return-1},t.prototype.lastIndexOf=function(e){return this.indexOf(e)},t.prototype.__iterate=function(e,t){for(var r=this.size,n=this._step,i=t?this._start+(r-1)*n:this._start,o=0;o!==r&&!1!==e(i,t?r-++o:o++,this);)i+=t?-n:n;return o},t.prototype.__iterator=function(e,t){var r=this.size,n=this._step,i=t?this._start+(r-1)*n:this._start,o=0;return new Li((function(){if(o===r)return{value:void 0,done:!0};var a=i;return i+=t?-n:n,Pi(e,t?r-++o:o++,a)}))},t.prototype.equals=function(e){return e instanceof t?this._start===e._start&&this._end===e._end&&this._step===e._step:Ss(this,e)},t}(Ki);function Ms(e,t,r){for(var n=Jo(t),i=0;i!==n.length;)if((e=ra(e,n[i++],ri))===ri)return r;return e}function js(e,t){return Ms(this,e,t)}function Us(e,t){return Ms(e,t,ri)!==ri}function Fs(){Yo(this.size);var e={};return this.__iterate((function(t,r){e[r]=t})),e}_i.isIterable=pi,_i.isKeyed=vi,_i.isIndexed=mi,_i.isAssociative=yi,_i.isOrdered=Oi,_i.Iterator=Li,Ts(_i,{toArray:function(){Yo(this.size);var e=new Array(this.size||0),t=vi(this),r=0;return this.__iterate((function(n,i){e[r++]=t?[i,n]:n})),e},toIndexedSeq:function(){return new So(this)},toJS:function(){return Rs(this)},toKeyedSeq:function(){return new Co(this,!0)},toMap:function(){return Ra(this.toKeyedSeq())},toObject:Fs,toOrderedMap:function(){return fs(this.toKeyedSeq())},toOrderedSet:function(){return $s(vi(this)?this.valueSeq():this)},toSet:function(){return ks(vi(this)?this.valueSeq():this)},toSetSeq:function(){return new To(this)},toSeq:function(){return mi(this)?this.toIndexedSeq():vi(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return ms(vi(this)?this.valueSeq():this)},toList:function(){return Za(vi(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Qo(this,Po(this,e))},includes:function(e){return this.some((function(t){return oo(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){Yo(this.size);var r=!0;return this.__iterate((function(n,i,o){if(!e.call(t,n,i,o))return r=!1,!1})),r},filter:function(e,t){return Qo(this,xo(this,e,t,!0))},find:function(e,t,r){var n=this.findEntry(e,t);return n?n[1]:r},forEach:function(e,t){return Yo(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Yo(this.size),e=void 0!==e?""+e:",";var t="",r=!0;return this.__iterate((function(n){r?r=!1:t+=e,t+=null!=n?n.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return Qo(this,Oo(this,e,t))},reduce:function(e,t,r){return Ks(this,e,t,r,arguments.length<2,!1)},reduceRight:function(e,t,r){return Ks(this,e,t,r,arguments.length<2,!0)},reverse:function(){return Qo(this,No(this,!0))},slice:function(e,t){return Qo(this,Do(this,e,t,!0))},some:function(e,t){return!this.every(Ws(e),t)},sort:function(e){return Qo(this,Mo(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return oi(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,r){var n=Ra().asMutable();return e.__iterate((function(i,o){n.update(t.call(r,i,o,e),0,(function(e){return e+1}))})),n.asImmutable()}(this,e,t)},equals:function(e){return Ss(this,e)},entrySeq:function(){var e=this;if(e._cache)return new zi(e._cache);var t=e.toSeq().map(zs).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Ws(e),t)},findEntry:function(e,t,r){var n=r;return this.__iterate((function(r,i,o){if(e.call(t,r,i,o))return n=[i,r],!1})),n},findKey:function(e,t){var r=this.findEntry(e,t);return r&&r[0]},findLast:function(e,t,r){return this.toKeyedSeq().reverse().find(e,t,r)},findLastEntry:function(e,t,r){return this.toKeyedSeq().reverse().findEntry(e,t,r)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(e){return this.find(si,null,e)},flatMap:function(e,t){return Qo(this,function(e,t,r){var n=Go(e);return e.toSeq().map((function(i,o){return n(t.call(r,i,o,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Qo(this,Bo(this,e,!0))},fromEntrySeq:function(){return new Ro(this)},get:function(e,t){return this.find((function(t,r){return oo(r,e)}),void 0,t)},getIn:js,groupBy:function(e,t){return function(e,t,r){var n=vi(e),i=(Oi(e)?fs():Ra()).asMutable();e.__iterate((function(o,a){i.update(t.call(r,o,a,e),(function(e){return(e=e||[]).push(n?[a,o]:o),e}))}));var o=Go(e);return i.map((function(t){return Qo(e,o(t))})).asImmutable()}(this,e,t)},has:function(e){return this.get(e,ri)!==ri},hasIn:function(e){return Us(this,e)},isSubset:function(e){return e="function"==typeof e.includes?e:_i(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:_i(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return oo(t,e)}))},keySeq:function(){return this.toSeq().map(Hs).toIndexedSeq()},last:function(e){return this.toSeq().reverse().first(e)},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return jo(this,e)},maxBy:function(e,t){return jo(this,t,e)},min:function(e){return jo(this,e?Ys(e):Xs)},minBy:function(e,t){return jo(this,t?Ys(t):Xs,e)},rest:function(){return this.slice(1)},skip:function(e){return 0===e?this:this.slice(Math.max(0,e))},skipLast:function(e){return 0===e?this:this.slice(0,-Math.max(0,e))},skipWhile:function(e,t){return Qo(this,Lo(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Ws(e),t)},sortBy:function(e,t){return Qo(this,Mo(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return this.slice(-Math.max(0,e))},takeWhile:function(e,t){return Qo(this,function(e,t,r){var n=Vo(e);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var a=0;return e.__iterate((function(e,i,s){return t.call(r,e,i,s)&&++a&&n(e,i,o)})),a},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var a=e.__iterator(2,i),s=!0;return new Li((function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var i=e.value,c=i[0],u=i[1];return t.call(r,u,c,o)?2===n?e:Pi(n,c,u,e):(s=!1,{value:void 0,done:!0})}))},n}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Ws(e),t)},update:function(e){return e(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=Oi(e),r=vi(e),n=t?1:0;return function(e,t){return t=ao(t,3432918353),t=ao(t<<15|t>>>-15,461845907),t=ao(t<<13|t>>>-13,5),t=ao((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=so((t=ao(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(r?t?function(e,t){n=31*n+Zs(uo(e),uo(t))|0}:function(e,t){n=n+Zs(uo(e),uo(t))|0}:t?function(e){n=31*n+uo(e)|0}:function(e){n=n+uo(e)|0}),n)}(this))}});var Qs=_i.prototype;Qs[di]=!0,Qs[Di]=Qs.values,Qs.toJSON=Qs.toArray,Qs.__toStringMapper=ea,Qs.inspect=Qs.toSource=function(){return this.toString()},Qs.chain=Qs.flatMap,Qs.contains=Qs.includes,Ts(bi,{flip:function(){return Qo(this,ko(this))},mapEntries:function(e,t){var r=this,n=0;return Qo(this,this.toSeq().map((function(i,o){return e.call(t,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(e,t){var r=this;return Qo(this,this.toSeq().flip().map((function(n,i){return e.call(t,n,i,r)})).flip())}});var qs=bi.prototype;qs[gi]=!0,qs[Di]=Qs.entries,qs.toJSON=Fs,qs.__toStringMapper=function(e,t){return ea(t)+": "+ea(e)},Ts(Ei,{toKeyedSeq:function(){return new Co(this,!1)},filter:function(e,t){return Qo(this,xo(this,e,t,!1))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Qo(this,No(this,!1))},slice:function(e,t){return Qo(this,Do(this,e,t,!1))},splice:function(e,t){var r=arguments.length;if(t=Math.max(t||0,0),0===r||2===r&&!t)return this;e=ui(e,e<0?this.count():this.size);var n=this.slice(0,e);return Qo(this,1===r?n:n.concat(zo(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.findLastEntry(e,t);return r?r[0]:-1},first:function(e){return this.get(0,e)},flatten:function(e){return Qo(this,Bo(this,e,!1))},get:function(e,t){return(e=ai(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,r){return r===e}),void 0,t)},has:function(e){return(e=ai(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Qo(this,function(e,t){var r=Vo(e);return r.size=e.size&&2*e.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return e.__iterate((function(e){return(!o||!1!==r(t,o++,i))&&!1!==r(e,o++,i)}),n),o},r.__iteratorUncached=function(r,n){var i,o=e.__iterator(1,n),a=0;return new Li((function(){return(!i||a%2)&&(i=o.next()).done?i:a%2?Pi(r,a++,t):Pi(r,a++,i.value,i)}))},r}(this,e))},interleave:function(){var e=[this].concat(zo(arguments)),t=Fo(this.toSeq(),Ki.of,e),r=t.flatten(!0);return t.size&&(r.size=t.size*e.length),Qo(this,r)},keySeq:function(){return Bs(0,this.size)},last:function(e){return this.get(-1,e)},skipWhile:function(e,t){return Qo(this,Lo(this,e,t,!1))},zip:function(){var e=[this].concat(zo(arguments));return Qo(this,Fo(this,Js,e))},zipAll:function(){var e=[this].concat(zo(arguments));return Qo(this,Fo(this,Js,e,!0))},zipWith:function(e){var t=zo(arguments);return t[0]=this,Qo(this,Fo(this,e,t))}});var Gs=Ei.prototype;Gs[Ai]=!0,Gs[ki]=!0,Ts(wi,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}});var Vs=wi.prototype;function Ks(e,t,r,n,i,o){return Yo(e.size),e.__iterate((function(e,o,a){i?(i=!1,r=e):r=t.call(n,r,e,o,a)}),o),r}function Hs(e,t){return t}function zs(e,t){return[t,e]}function Ws(e){return function(){return!e.apply(this,arguments)}}function Ys(e){return function(){return-e.apply(this,arguments)}}function Js(){return zo(arguments)}function Xs(e,t){return e<t?1:e>t?-1:0}function Zs(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}Vs.has=Qs.includes,Vs.contains=Vs.includes,Vs.keys=Vs.values,Ts(Vi,qs),Ts(Ki,Gs),Ts(Hi,Vs);var $s=function(e){function t(e){return null==e?nc():Cs(e)?e:nc().withMutations((function(t){var r=wi(e);Yo(r.size),r.forEach((function(e){return t.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(bi(e).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(ks);$s.isOrderedSet=Cs;var ec,tc=$s.prototype;function rc(e,t){var r=Object.create(tc);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function nc(){return ec||(ec=rc(ps()))}tc[ki]=!0,tc.zip=Gs.zip,tc.zipWith=Gs.zipWith,tc.zipAll=Gs.zipAll,tc.__empty=nc,tc.__make=rc;var ic=function(e,t){var r;!function(e){if(Ti(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Ri(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===e||"object"!=typeof e)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(e);var n=function(o){var a=this;if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var s=Object.keys(e),c=i._indices={};i._name=t,i._keys=s,i._defaultValues=e;for(var u=0;u<s.length;u++){var l=s[u];c[l]=u,i[l]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+sc(this)+' with property "'+l+'" since that property name is part of the Record API.'):uc(i,l)}}return this.__ownerID=void 0,this._values=Za().withMutations((function(e){e.setSize(a._keys.length),bi(o).forEach((function(t,r){e.set(a._indices[r],t===a._defaultValues[r]?void 0:t)}))})),this},i=n.prototype=Object.create(oc);return i.constructor=n,t&&(n.displayName=t),n};ic.prototype.toString=function(){for(var e,t=sc(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)t+=(n?", ":"")+(e=r[n])+": "+ea(this.get(e));return t+" }"},ic.prototype.equals=function(e){return this===e||e&&cc(this).equals(cc(e))},ic.prototype.hashCode=function(){return cc(this).hashCode()},ic.prototype.has=function(e){return this._indices.hasOwnProperty(e)},ic.prototype.get=function(e,t){if(!this.has(e))return t;var r=this._indices[e],n=this._values.get(r);return void 0===n?this._defaultValues[e]:n},ic.prototype.set=function(e,t){if(this.has(e)){var r=this._values.set(this._indices[e],t===this._defaultValues[e]?void 0:t);if(r!==this._values&&!this.__ownerID)return ac(this,r)}return this},ic.prototype.remove=function(e){return this.set(e)},ic.prototype.clear=function(){var e=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:ac(this,e)},ic.prototype.wasAltered=function(){return this._values.wasAltered()},ic.prototype.toSeq=function(){return cc(this)},ic.prototype.toJS=function(){return Rs(this)},ic.prototype.entries=function(){return this.__iterator(2)},ic.prototype.__iterator=function(e,t){return cc(this).__iterator(e,t)},ic.prototype.__iterate=function(e,t){return cc(this).__iterate(e,t)},ic.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._values.__ensureOwner(e);return e?ac(this,t,e):(this.__ownerID=e,this._values=t,this)},ic.isRecord=Ti,ic.getDescriptiveName=sc;var oc=ic.prototype;function ac(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._values=t,n.__ownerID=r,n}function sc(e){return e.constructor.displayName||e.constructor.name||"Record"}function cc(e){return Zi(e._keys.map((function(t){return[t,e.get(t)]})))}function uc(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){Wo(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}catch(e){}}oc[Si]=!0,oc.delete=oc.remove,oc.deleteIn=oc.removeIn=ha,oc.getIn=js,oc.hasIn=Qs.hasIn,oc.merge=ga,oc.mergeWith=va,oc.mergeIn=Ea,oc.mergeDeep=_a,oc.mergeDeepWith=ba,oc.mergeDeepIn=wa,oc.setIn=ua,oc.update=da,oc.updateIn=pa,oc.withMutations=Ia,oc.asMutable=Ca,oc.asImmutable=Sa,oc[Di]=oc.entries,oc.toJSON=oc.toObject=Qs.toObject,oc.inspect=oc.toSource=function(){return this.toString()};var lc,hc=function(e){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this._value=e,this.size=void 0===r?1/0:Math.max(0,r),0===this.size){if(lc)return lc;lc=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},t.prototype.get=function(e,t){return this.has(e)?this._value:t},t.prototype.includes=function(e){return oo(this._value,e)},t.prototype.slice=function(e,r){var n=this.size;return ci(e,r,n)?this:new t(this._value,li(r,n)-ui(e,n))},t.prototype.reverse=function(){return this},t.prototype.indexOf=function(e){return oo(this._value,e)?0:-1},t.prototype.lastIndexOf=function(e){return oo(this._value,e)?this.size:-1},t.prototype.__iterate=function(e,t){for(var r=this.size,n=0;n!==r&&!1!==e(this._value,t?r-++n:n++,this););return n},t.prototype.__iterator=function(e,t){var r=this,n=this.size,i=0;return new Li((function(){return i===n?{value:void 0,done:!0}:Pi(e,t?n-++i:i++,r._value)}))},t.prototype.equals=function(e){return e instanceof t?oo(this._value,e._value):Ss(e)},t}(Ki);function fc(e,t,r,n,i,o){if("string"!=typeof r&&!Ri(r)&&(qi(r)||Mi(r)||Zo(r))){if(~e.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");e.push(r),i&&""!==n&&i.push(n);var a=t.call(o,n,Gi(r).map((function(n,o){return fc(e,t,n,o,i,r)})),i&&i.slice());return e.pop(),i&&i.pop(),a}return r}function dc(e,t){return mi(t)?t.toList():vi(t)?t.toMap():t.toSet()}var pc={version:"4.0.0",Collection:_i,Iterable:_i,Seq:Gi,Map:Ra,OrderedMap:fs,List:Za,Stack:ms,Set:ks,OrderedSet:$s,Record:ic,Range:Bs,Repeat:hc,is:oo,fromJS:function(e,t){return fc([],t||dc,e,"",t&&t.length>2?[]:void 0,{"":e})},hash:uo,isImmutable:Ri,isCollection:pi,isKeyed:vi,isIndexed:mi,isAssociative:yi,isOrdered:Oi,isValueObject:io,isPlainObject:Zo,isSeq:Ci,isList:Xa,isMap:ro,isOrderedMap:no,isStack:As,isSet:Is,isOrderedSet:Cs,isRecord:Ti,get:ra,getIn:Ms,has:ta,hasIn:Us,merge:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return ya(e,t)},mergeDeep:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return ma(e,t)},mergeWith:function(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return ya(t,r,e)},mergeDeepWith:function(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return ma(t,r,e)},remove:ia,removeIn:la,set:oa,setIn:ca,update:fa,updateIn:aa};const gc=pc;function vc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ac(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vc(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var mc,yc,_c,bc,Ec=function(){function e(t){var r=this;a(this,e),this.sequence=void 0,this.users=new Map,this.streams=new Map,this.roomProperties=gc.Map(),this.room=void 0;var n=t.seq,i=t.users,o=t.roomProperties,s=t.roomInfo;this.sequence=n,i.forEach((function(e){var t=wc.fromData(e),n=e.streams;(void 0===n?[]:n).forEach((function(e){r.streams.set(e.streamUuid,Ic.fromData(Ac(Ac({},e),{},{fromUser:{userName:t.userName,role:t.userRole,userUuid:t.userUuid}})))})),r.users.set(e.userUuid,t)})),this.roomProperties=gc.Map(o),this.room=Cc.fromData(s)}return c(e,null,[{key:"fromData",value:function(t){return new e(t)}}]),e}(),wc=function(){function e(t){a(this,e),this.userUuid=void 0,this.userName=void 0,this.userRole=void 0,this.userProperties=void 0,this.userName=t.userName,this.userRole=t.role,this.userUuid=t.userUuid,this.userProperties=gc.Map(t.userProperties)}return c(e,[{key:"setUserProperties",value:function(e){this.userProperties=gc.Map(e)}},{key:"toString",value:function(){return this.userUuid}}],[{key:"fromData",value:function(t){return new e(t)}}]),e}(),Ic=function(){function e(t){a(this,e),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.previous=void 0,this.streamUuid=t.streamUuid,this.streamName=t.streamName,this.fromUser=t.fromUser,this.videoSourceType=t.videoSourceType,this.audioSourceType=t.audioSourceType,this.videoState=t.videoState,this.audioState=t.audioState,this.videoSourceState=t.videoSourceState,this.audioSourceState=t.audioSourceState,["streamUuid","fromUser","videoSourceType","audioSourceType","videoState","audioState","videoSourceState","audioSourceState"].forEach((function(e){void 0===t[e]&&yn.warn("stream key ".concat(e," is unexpectedly undefined"))})),this.fromUser||(yn.error("[stream-data-struct] stream must has owner info"),jn.shared.handleThrowableError(kn.RTE_ERR_INVALID_DATA_STRUCT,new Error("invalid stream data")))}return c(e,[{key:"toString",value:function(){return this.streamUuid}}],[{key:"fromData",value:function(t){return new e(t)}}]),e}(),Cc=function(){function e(t){a(this,e),this.roomName=void 0,this.roomUuid=void 0,this.roomScenario=void 0,this.roomName=t.roomName,this.roomUuid=t.roomUuid,this.roomScenario=t.roomScenario}return c(e,null,[{key:"fromData",value:function(t){return new e(t)}}]),e}(),Sc=function(){function e(t){a(this,e),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=t.fromUser,this.message=t.message,this.type=t.type,this.sendTime=t.sendTime,this.sensitiveWords=t.sensitiveWords,this.messageId=t.messageId||t.peerMessageId,this.ext=t.ext}return c(e,[{key:"toString",value:function(){return"".concat(this.fromUser.userName,": ").concat(this.message)}}],[{key:"fromData",value:function(t){return new e(t)}}]),e}(),Tc=__webpack_require__(9850),Rc=__webpack_require__.n(Tc),kc=__webpack_require__(2579),Oc=__webpack_require__.n(kc);function Nc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nc(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Dc(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Lc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lc(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Lc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pc(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}!function(e){e[e.Chat=3]="Chat",e[e.RoomProperty=4]="RoomProperty",e[e.RoomProperties=5]="RoomProperties",e[e.UserInOut=20]="UserInOut",e[e.UserInfo=21]="UserInfo",e[e.UserProperty=22]="UserProperty",e[e.UserProperties=23]="UserProperties",e[e.UserSubscribeInOut=24]="UserSubscribeInOut",e[e.StreamInOut=40]="StreamInOut",e[e.StreamsInOut=41]="StreamsInOut",e[e.MessageExtension=99]="MessageExtension"}(yc||(yc={})),function(e){e[e.PeerChat=1]="PeerChat"}(_c||(_c={})),function(e){e.SnapshotUpdated="snapshot-updated",e.ChatReceived="chat-received",e.UserAdded="user-added",e.UserUpdated="user-updated",e.UserRemoved="user-removed",e.RoomPropertyUpdated="room-property-updated",e.UserPropertyUpdated="user-property-updated",e.LocalStreamAdded="local-stream-added",e.LocalStreamUpdate="local-stream-update",e.LocalStreamRemove="local-stream-removed",e.RemoteStreamAdded="remote-stream-added",e.RemoteStreamUpdate="remote-stream-update",e.RemoteStreamRemove="remote-stream-removed",e.ChatUserMessage="user-chat-message",e.ChatRoomMessage="room-chat-message",e.NetworkStats="network-stats",e.LocalAudioVolume="local-audio-volume",e.AudioVolumes="audio-volumes",e.LocalVideoCameraListChanged="local-video-camera-list-changed",e.LocalAudioRecordingListChanged="local-audio-recording-list-changed",e.LocalAudioPlaybackListChanged="local-audio-playback-list-changed",e.LocalVideoTrackStateChanged="local-video-track-state-changed",e.LocalAudioTrackStateChanged="local-audio-track-state-changed",e.RtcConnectionStateChanged="rtc-connection-state-changed",e.RtmConnectionStateChanged="rtm-connection-state-changed",e.RteConnectionStateChanged="rte-connection-state-changed",e.TimeStampGapUpdate="timestamp-gap-update",e.UserPropertyListUpdated="user-property-list-updated"}(bc||(bc={}));var Bc,Mc=Zn.attach({proxyMethods:!1})(mc=function(e){l(r,e);var t=Pc(r);function r(e,n){var i,o=n.sceneId,s=n.userUuid,c=n.streamUuid;return a(this,r),(i=t.call(this)).logger=void 0,i._dataStore=void 0,i._timestampGap=0,i.sceneId=void 0,i.userUuid=void 0,i.streamUuid=void 0,i.sceneId=o,i.userUuid=s,i.streamUuid=c,i._dataStore=e,i}return c(r,[{key:"handleSnapshot",value:function(e){this._dataStore.setUsers(e.users),this._dataStore.setStreams(e.streams),this._dataStore.setRoomProperties(e.roomProperties),this._dataStore.setRoomInfo(e.room),this.emit(bc.SnapshotUpdated,e)}},{key:"handleMessage",value:function(e){var t=e.sequence,r=t.batch,n=t.cmd;r?this._handleBatchMessage(e,n):this._handleSimpleMessage(e,n),this._syncTsGapWithServerAndLocal(e)}},{key:"_handleSimpleMessage",value:function(e,t){switch(t){case yc.Chat:this._handleChat(e);break;case yc.RoomProperty:case yc.RoomProperties:this._handleRoomProperties(e);break;case yc.UserInOut:this._handleUserInOut(e);break;case yc.UserInfo:this._handleUserInfo(e);break;case yc.UserProperty:this._handleUserProperty(e);break;case yc.UserProperties:this._handleUserProperties(e);break;case yc.UserSubscribeInOut:this._handleUserSubscribe(e);break;case yc.StreamInOut:this._handleStreamInOut(e);break;case yc.StreamsInOut:this._handleStreamsInOut(e);break;case yc.MessageExtension:this._handleMessageExtension(e)}}},{key:"_handleBatchMessage",value:function(e,t){if(t===yc.UserProperties)this._handleUserPropertyList(e)}},{key:"_handleUserPropertyList",value:function(e){var t,r,n=this,i=e.sequence,o=i.batch,a=i.list,s=void 0===a?[]:a,c=null===(t=s[0])||void 0===t?void 0:t.operator,u=null===(r=s[0])||void 0===r?void 0:r.cause,l=s.map((function(e){var t=e,r=t.changeProperties,i=t.fromUser.userUuid,o=n._dataStore.findUser(i);return o?(o.setUserProperties(n._mergeProperties(o.userProperties.toJS(),r)),{userUuid:i,userProperties:o.userProperties.toObject()}):n.logger.warn("user ".concat(i," not exists, update property failed"))})),h={id:null==o?void 0:o.id,total:null==o?void 0:o.total,index:null==o?void 0:o.progress};this.emit(bc.UserPropertyListUpdated,l,h,c,u)}},{key:"handlePeerMessage",value:function(e){if(e.cmd===_c.PeerChat)this._handlePeerChat(e)}},{key:"_handlePeerChat",value:function(e){var t=e.data,r=Sc.fromData(t);this._dataStore.addMessage(r),this.emit(bc.ChatUserMessage,r)}},{key:"_handleChat",value:function(e){var t=e.sequence.data,r=Sc.fromData(t);this._dataStore.addMessage(r),this.emit(bc.ChatReceived,r)}},{key:"_mergeProperties",value:function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r],o=i.split(".");if(0!==o.length){var a,s=o.filter((function(e){return e})),c=e,u=Dc(s);try{for(u.s();!(a=u.n()).done;){var l=a.value;c[l]=c[l]||{},c=c[l]}}catch(e){u.e(e)}finally{u.f()}var h=1===s.length?e:Oc()(e,$n(s).splice(0,s.length-1).join("."),{}),f=Rc()(t[i]);"deleted"===f?delete h[$n(s).pop()]:h[$n(s).pop()]=f}else this.logger.error("invalid key when batch set room properties ".concat(i))}return e}},{key:"_handleRoomProperties",value:function(e){var t=e.sequence.data,r=t.changeProperties,n=t.cause,i=t.operator;this._dataStore.setRoomProperties(this._mergeProperties(this._dataStore.roomProperties.toJS(),r));var o=Array.from(new Set(Object.keys(r).map((function(e){return e.split(".")[0]}))));this.emit(bc.RoomPropertyUpdated,o,this._dataStore.roomProperties,i,n)}},{key:"_handleUserSubscribe",value:function(e){var t=this,r=e.sequence.data.users,n=[],i=[];r.forEach((function(e){var r=wc.fromData(e);if(1===e.subscribe){t._dataStore.setUser(r.userUuid,r);var o=e.streams;(void 0===o?[]:o).forEach((function(e){var n=Ic.fromData(xc(xc({},e),{},{fromUser:{userUuid:r.userUuid,role:r.userRole,userName:r.userName}}));t._dataStore.setStream(n.streamUuid,n)})),n.push(r)}else 0===e.subscribe&&(t._dataStore.deleteStream(e.streamUuid),t._dataStore.deleteUser(e.userUuid),i.push(r))})),n.length>0&&this.emit(bc.UserAdded,n),i.length>0&&this.emit(bc.UserRemoved,i)}},{key:"_handleUserInOut",value:function(e){var t=this,r=e.sequence.data,n=r.offlineUsers,i=r.onlineUsers,o=n.map((function(e){var r=wc.fromData(e);return t._dataStore.deleteStream(e.streamUuid),t._dataStore.deleteUser(e.userUuid),r})),a=i.map((function(e){var r=wc.fromData(e);t._dataStore.setUser(r.userUuid,r);var n=e.streams;return(void 0===n?[]:n).forEach((function(e){var n=Ic.fromData(xc(xc({},e),{},{fromUser:{userUuid:r.userUuid,role:r.userRole,userName:r.userName}}));t._dataStore.setStream(n.streamUuid,n)})),r}));if(a.length>0&&this.emit(bc.UserAdded,a),o.length>0){var s=n.length?n[0].type:void 0;this.emit(bc.UserRemoved,o,s)}}},{key:"_handleUserInfo",value:function(e){var t=e.sequence.data,r=t.userUuid,n=t.userName,i=t.role,o=this._dataStore.findUser(r);if(!o)return this.logger.warn("user ".concat(r," not exists, update info failed"));o.userName=n,o.userRole=i,this.emit(bc.UserUpdated,o)}},{key:"_handleUserProperty",value:function(e){throw"not_implemented"}},{key:"_handleUserProperties",value:function(e){var t=e.sequence.data,r=t.changeProperties,n=t.cause,i=t.fromUser,o=t.operator,a=i.userUuid,s=this._dataStore.findUser(a);if(!s)return this.logger.warn("user ".concat(a," not exists, update property failed"));s.setUserProperties(this._mergeProperties(s.userProperties.toJS(),r)),this.emit(bc.UserPropertyUpdated,a,s.userProperties.toObject(),o,n)}},{key:"_processStreamEvent",value:function(e,t){var r=t.fromUser.userUuid===this.userUuid;if(3===e){var n=this._dataStore.findStream(t.streamUuid);return this._dataStore.deleteStream(t.streamUuid),t.previous=n,r?bc.LocalStreamRemove:bc.RemoteStreamRemove}if(2===e){var i=this._dataStore.findStream(t.streamUuid);return this._dataStore.setStream(t.streamUuid,t),t.previous=i,r?bc.LocalStreamUpdate:bc.RemoteStreamUpdate}return t.previous=void 0,this._dataStore.setStream(t.streamUuid,t),r?bc.LocalStreamAdded:bc.RemoteStreamAdded}},{key:"_handleStreamInOut",value:function(e){var t=e.sequence.data,r=t.action,n=t.fromUser,i=t.streamUuid,o=t.streamName,a=t.videoSourceType,s=t.audioSourceType,c=t.videoSourceState,u=t.audioSourceState,l=t.videoState,h=t.audioState,f=t.operator,d=Ic.fromData({streamName:o,streamUuid:i,fromUser:n,videoSourceType:a,audioSourceType:s,videoState:l,audioState:h,videoSourceState:c,audioSourceState:u}),p=this._processStreamEvent(r,d);this.emit(p,[d],f)}},{key:"_handleStreamsInOut",value:function(e){var t=this,r=e.sequence.data,n=r.streams,i=r.operator,o=(r.cause,new Map);n.forEach((function(e){var r=e.action,n=Ic.fromData(e),i=t._processStreamEvent(r,n);o.has(i)?o.set(i,o.get(i).concat([n])):o.set(i,[n])})),o.forEach((function(e,r){t.emit(r,e,i)}))}},{key:"_handleMessageExtension",value:function(e){}},{key:"_syncTsGapWithServerAndLocal",value:function(e){var t=e.sequence.timestamp-Date.now();this._timestampGap!==t&&Math.abs(this._timestampGap-t)>800&&(this._timestampGap=t,this.emit(bc.TimeStampGapUpdate,this._timestampGap))}}]),r}(y))||mc,jc=Zn.attach({proxyMethods:!1})(Bc=function(){function e(t,r){var n=this,i=r.scene,o=r.userUuid,s=r.streamUuid,c=r.channelObserver,u=r.rtm;a(this,e),this.logger=void 0,this._scene=void 0,this.userUuid=void 0,this.streamUuid=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(n._currentTask)n.logger.debug("Task Running");else{var e=n.dequeueTask();e?(n._currentTask=e,n.processTask(n._currentTask).then((function(){n._currentTask=void 0,n.notifyTaskQueueUpdate()})).catch((function(e){n.logger.error("message handle failed: ".concat(e)),n._currentTask=void 0,n.notifyTaskQueueUpdate()}))):n.logger.debug("message handle queue clear")}},this._scene=i,this.streamUuid=s,this.userUuid=o,this._handleChannelMessage=this.handleChannelMessage.bind(this),this._handlePeerMessage=this.handlePeerMessage.bind(this),this._channelObserver=c,this._channelObserver.on("ChannelMessage",this._handleChannelMessage),u.on("MessageFromPeer",this._handlePeerMessage),this.handle=new Mc(t,{sceneId:i.sceneId,userUuid:o,streamUuid:s})}var t,r;return c(e,[{key:"handlePeerMessage",value:function(e){var t=e.message;if("server"===e.peerId){this.logger.debug("peer message",t);try{var r=JSON.parse(t);this.handle.handlePeerMessage(r)}catch(e){this.logger.error("".concat(e.message," original: ").concat(t))}}}},{key:"handleChannelMessage",value:function(e){var t=e.message;if("server"===e.memberId){this.logger.debug("channel message sceneId:".concat(this._scene.sceneId),t.text);try{var r=JSON.parse(t.text);this.addTask({sequence:r})}catch(e){this.logger.error("".concat(e.message," original: ").concat(t.text))}}}},{key:"syncSnapshot",value:function(e){this._snapshot=e,this.handle.handleSnapshot(e),this._lastSeq=e.sequence,this.notifyTaskQueueUpdate()}},{key:"findSequenceGap",value:function(){if(0===this._queueTasks.length)return null;var e=this._queueTasks[0].sequence.sequence;return e-this._lastSeq>1?{seq:this._lastSeq+1,count:e-this._lastSeq-1,queueHeadSeq:e}:null}},{key:"sortTasks",value:function(){this._queueTasks=this._queueTasks.sort((function(e,t){return e.sequence.sequence-t.sequence.sequence}))}},{key:"addTask",value:function(e){this._queueTasks.push(e),this.sortTasks(),this.notifyTaskQueueUpdate()}},{key:"prependTasks",value:function(e){this._queueTasks=e.concat(this._queueTasks),this.sortTasks()}},{key:"notifyTaskQueueUpdate",value:function(){if(this._snapshot){var e=this.findSequenceGap();if(e){var t=e.seq,r=e.count,n=e.queueHeadSeq;return this.logger.warn("gap ".concat(this._lastSeq," - ").concat(n," exists, need fill ").concat(t," ").concat(r,". stop task processing before gap is resolved")),void this.syncSequenceUntilSuccess(t,r)}this.runNextTask()}else this.logger.warn("Snapshot not ready yet..wait")}},{key:"dequeueTask",value:function(){return 0===this._queueTasks.length?null:this._queueTasks.shift()}},{key:"processTask",value:(r=o(v().mark((function e(t){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._snapshot){e.next=2;break}return e.abrupt("return");case 2:if(!(t.sequence.sequence<=this._lastSeq)){e.next=5;break}return this.logger.debug("skip sequence ".concat(t.sequence.sequence,", snapshot ").concat(this._snapshot.sequence)),e.abrupt("return");case 5:return this.logger.debug("process sequence ".concat(t.sequence.sequence,", snapshot ").concat(this._snapshot.sequence,", last ").concat(this._lastSeq)),this.handle.handleMessage(t),this._lastSeq=t.sequence.sequence,e.next=10,new Promise((function(e){return setTimeout(e,0)}));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"syncSequenceUntilSuccess",value:(t=o(v().mark((function e(t,r){var n,i,o,a,s;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._requestingGap){e.next=2;break}return e.abrupt("return");case 2:this._requestingGap=!0,n=!1,this.logger.info("begin resolve gap ".concat(t," - ").concat(r));case 5:return e.prev=5,e.next=8,this._scene.getApiService().syncSequence(this._scene.sceneId,t,r);case 8:i=e.sent,o=i.list,a=Math.min(r,o.length),s=o.slice(0,a).map((function(e){return{sequence:e}})),this.prependTasks(s),n=!0,this.logger.info("gap resolved, new ".concat(s.length," tasks prepended ")),this.notifyTaskQueueUpdate(),e.next=23;break;case 18:return e.prev=18,e.t0=e.catch(5),this.logger.error("syncSequence failed: ".concat(e.t0)),e.next=23,new Promise((function(e){return setTimeout(e,3e3)}));case 23:if(!n){e.next=5;break}case 24:this._requestingGap=!1;case 25:case"end":return e.stop()}}),e,this,[[5,18]])}))),function(e,r){return t.apply(this,arguments)})},{key:"reset",value:function(){this._channelObserver.off("ChannelMessage",this._handleChannelMessage)}}]),e}())||Bc,Uc=__webpack_require__(2699),Fc=__webpack_require__(3136),Qc=__webpack_require__.n(Fc);__webpack_require__(9601),__webpack_require__(9720);function qc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qc(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Vc=function(){var e=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var i=new AbortController,o=setTimeout((function(){return i.abort()}),1e4);fetch(t,Gc(Gc({},r),{},{signal:i.signal})).then((function(t){return e(t)})).catch((function(e){n(e)})).finally((function(){clearTimeout(o)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Kc=function(){function e(){a(this,e),this.host=void 0,this.pathPrefix=void 0,this.headers=void 0}var t;return c(e,[{key:"fetch",value:(t=o(v().mark((function e(t){var r,i,o,a,s,c,u,l,h,f,d,p,g,A,m,y;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.method,i=t.data,o=t.full_url,a=t.path,s=t.query,c=void 0===s?{}:s,u=Qn.shared.service,l=u.host,h=u.pathPrefix,f={method:r,headers:Object.assign({},Qn.shared.service.headers,this.headers,t.headers)},d=Object.entries(c).filter((function(e){return!!n(e,2)[1]})).map((function(e){var t=n(e,2),r=t[0],i=t[1];return"".concat(r,"=").concat(i)})),p=d.length>0?"?".concat(d.join("&")):"",i&&(f.body=JSON.stringify(i)),e.prev=6,!o){e.next=13;break}return e.next=10,Vc("".concat(o),f);case 10:g=e.sent,e.next=16;break;case 13:return e.next=15,Vc("".concat(t.host||this.host||l).concat(t.pathPrefix||this.pathPrefix||h||"").concat(a).concat(p),f);case 15:g=e.sent;case 16:e.next=24;break;case 18:if(e.prev=18,e.t0=e.catch(6),20!==(A=e.t0).code){e.next=23;break}return e.abrupt("return",jn.shared.handleThrowableError(kn.RTE_ERR_RESTFUL_NETWORK_TIMEOUT_ERR,A));case 23:return e.abrupt("return",jn.shared.handleThrowableError(kn.RTE_ERR_RESTFUL_NETWORK_ERR,A));case 24:return e.next=26,g.json();case 26:if(m=e.sent,0==(y=+m.code)){e.next=34;break}if(!isNaN(y)){e.next=33;break}return e.abrupt("return",jn.shared.handleThrowableError(kn.RTE_ERR_RESTFUL_SERVICE_ERR,new Bn(kn.RTE_ERR_RESTFUL_SERVICE_ERR,new Error(m.msg),{servCode:-1})));case 33:return e.abrupt("return",jn.shared.handleThrowableError(kn.RTE_ERR_RESTFUL_SERVICE_ERR,new Bn(kn.RTE_ERR_RESTFUL_SERVICE_ERR,new Error(m.msg),{servCode:y})));case 34:return e.abrupt("return",m);case 35:case"end":return e.stop()}}),e,this,[[6,18]])}))),function(e){return t.apply(this,arguments)})}]),e}(),Hc=__webpack_require__(2775),zc=__webpack_require__.n(Hc);function Wc(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Yc,Jc=function(e){l(h,e);var t,r,n,i,s,u=Wc(h);function h(){var e;a(this,h);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=u.call.apply(u,[this].concat(r))).tickerMap=new Map,e.timer=void 0,e}return c(h,[{key:"guardParams",value:function(){var e=Qn.shared.appId,t=Qn.shared.userId;if(e&&t)return!0;jn.shared.handleThrowableError(kn.RTE_ERR_MISSING_PARAMS,new Error("invalid params"))}},{key:"platform",get:function(){return Qn.platform===Nn.Electron?"electron":"web"}},{key:"buildBaseParams",value:function(e,t,r,n,i,o,a){var s=(new Date).getTime(),c=zc()("src=".concat(t,"&ts=").concat(s)),u=i.result,l=i.errCode,h=i.httpCode,f=i.api;return{pts:[{m:r,ls:{ctype:e,platform:this.platform,version:Vh.getVersion(),appId:Qn.shared.appId,event:o,category:a,result:void 0===u?void 0:"".concat(+u),errCode:l,httpCode:h,api:f},vs:n}],sign:c,src:t,ts:s}}},{key:"buildEventParams",value:function(e,t,r,n){return this.buildBaseParams("flexibleClass","rte","event",r,n,e,t)}},{key:"buildHBParams",value:function(){return this.buildBaseParams("flexibleClass","rte","online_user",{count:1},{})}},{key:"reportHB",value:(s=o(v().mark((function e(){var t;return v().wrap((function(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 t=e.sent,e.abrupt("return",t.data);case 6:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"report",value:(i=o(v().mark((function e(t,r,n,i){var o;return v().wrap((function(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.buildEventParams(t,r,n,i||{})});case 4:return o=e.sent,e.abrupt("return",o.data);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return i.apply(this,arguments)})},{key:"tickerKey",value:function(e,t,r){return"".concat(e,"/").concat(t,"/").concat(r||"")}},{key:"startTick",value:function(e,t,r){this.tickerMap.set(this.tickerKey(e,t,r),(new Date).getTime())}},{key:"startHB",value:function(){}},{key:"stopHB",value:function(){clearTimeout(this.timer),this.timer=null}},{key:"getElapse",value:function(e,t,r){var n=this.tickerKey(e,t,r);return this.tickerMap.has(n)?(new Date).getTime()-this.tickerMap.get(n):0}},{key:"reportEC",value:(n=o(v().mark((function e(t,r,n){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.report(t,r,{count:1},n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"reportElapse",value:(r=o(v().mark((function e(t,r,n){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.report(t,r,{elapse:this.getElapse(t,r,null==n?void 0:n.api)},n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"reportHttp",value:(t=o(v().mark((function e(t,r,n,i,o,a){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.report(t,r,{elapse:this.getElapse(t,r,n)},{api:n,httpCode:i,result:o,errCode:a}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r,n,i,o,a){return t.apply(this,arguments)})}]),h}(Kc);function Xc(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}Jc.shared=new Jc,function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.RECONNECTING="RECONNECTING",e.ABORTED="ABORTED"}(Yc||(Yc={}));var Zc=function(e){return void 0!==e.text},$c=function(e){l(h,e);var t,r,n,i,s,u=Xc(h);function h(){var e;return a(this,h),(e=u.call(this)).connectionState=Yc.DISCONNECTED,e.prevConnectionState=Yc.DISCONNECTED,e.channels={},e._client=void 0,e.connectionState=Yc.DISCONNECTED,e.prevConnectionState=Yc.DISCONNECTED,e.channels={},e._client=void 0,e}return c(h,[{key:"client",get:function(){return this._client}},{key:"sessionId",get:function(){return this.client.context.sid}},{key:"logFilter",get:function(){var e=Qc().LOG_FILTER_INFO;switch(Qn.logLevel){case On.WARN:e=Qc().LOG_FILTER_WARNING;break;case On.OFF:e=Qc().LOG_FILTER_OFF;break;case On.ERROR:e=Qc().LOG_FILTER_ERROR}return e}},{key:"_region",get:function(){switch(Qn.shared.rtmRegion){case Ln.AREA_GLOBAL:return"GLOBAL";case Ln.AREA_CN:return"CHINA";case Ln.AREA_AS:return"ASIA";case Ln.AREA_EUR:return"EUROPE";case Ln.AREA_NA:return"NORTH_AMERICA";case Ln.AREA_JAPAN:return"JAPAN";case Ln.AREA_INDIA:return"INDIA"}}},{key:"login",value:(s=o(v().mark((function e(t,r,n){var i,o=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Qc().setArea({areaCodes:[this._region]}),i=Qc().createInstance(Qn.shared.appId,{enableLogUpload:n.uploadLog,logFilter:this.logFilter}),yn.info("[rtm] wrapper init"),i.on("ConnectionStateChanged",(function(e,t){yn.info("[rtm] [Wrapper] ConnectionStateChanged",e,t),o.prevConnectionState=o.connectionState,o.connectionState=e,o.emit(bc.RtmConnectionStateChanged,{newState:e,reason:t})})),i.on("MessageFromPeer",(function(e,t,r){Zc(e)&&(yn.debug("[rtm] [Wrapper] MessageFromPeer ".concat(e.text)),o.emit("MessageFromPeer",{message:e.text,peerId:t,props:r}))})),e.next=8,i.login({uid:r,token:t});case 8:this._client=i,e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),this._destroyRtm(i),jn.shared.handleThrowableError(kn.RTM_ERR_LOGIN_FAIL,e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,11]])}))),function(e,t,r){return s.apply(this,arguments)})},{key:"createObserverChannel",value:function(e){return[this.client.createChannel(e),new Uc.EventEmitter]}},{key:"join",value:(i=o(v().mark((function e(t,r,n){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,Jc.shared.startTick("joinRoom","rtm","joinChannel"),this.channels[n]!==t){e.next=4;break}return e.abrupt("return",yn.warn("[rtm] skip channel ".concat(n," join as the channel is already joined")));case 4:return t.on("ChannelMessage",(function(e,t,i){r.emit("ChannelMessage",{channelName:n,message:e,memberId:t,messagePros:i})})),t.on("MemberJoined",(function(e){r.emit("MemberJoined",{channelName:n,memberId:e})})),t.on("MemberLeft",(function(e){r.emit("MemberLeft",{channelName:n,memberId:e})})),t.on("MemberCountUpdated",(function(e){r.emit("MemberCountUpdated",{channelName:n,memberCount:e})})),e.next=10,t.join();case 10:this.channels[n]=t,Jc.shared.reportElapse("joinRoom","rtm",{api:"joinChannel",result:!0}),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),Jc.shared.reportElapse("joinRoom","rtm",{api:"joinChannel",result:!1,errCode:"".concat(e.t0.message)}),jn.shared.handleThrowableError(kn.RTM_ERR_JOIN_FAILED,e.t0);case 18:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(e,t,r){return i.apply(this,arguments)})},{key:"leave",value:(n=o(v().mark((function e(t){var r;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(r=this.channels[t])){e.next=7;break}return e.next=5,r.leave();case 5:r.removeAllListeners(),delete this.channels[t];case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),jn.shared.handleNonThrowableError(kn.RTM_ERR_LEAVE_FAILED,e.t0);case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e){return n.apply(this,arguments)})},{key:"releaseChannels",value:function(){for(var e=0,t=Object.keys(this.channels);e<t.length;e++){var r=t[e];this.channels[r]&&this.release(this.channels[r]),this.channels[r]=void 0}}},{key:"releaseClient",value:function(){this._client&&this.release(this._client)}},{key:"release",value:function(e){e.removeAllListeners(),yn.info("[AGRtmManager] eventClient removeAllListeners ")}},{key:"reset",value:function(){this.connectionState=Yc.DISCONNECTED,this.prevConnectionState=Yc.DISCONNECTED,this.releaseClient(),this.releaseChannels(),this.channels={},this.client&&(this.client.removeAllListeners(),yn.info("[AGRtmManager] removeAllListeners")),this._client=void 0,this.removeAllListeners(),yn.info("[AGRtmManager] self removeAllListeners")}},{key:"_destroyRtm",value:function(e){try{null==e||e.logout()}catch(e){jn.shared.handleNonThrowableError(kn.RTM_ERR_DESTROY_FAILED,e)}}},{key:"destroyRtm",value:function(){this._destroyRtm(this._client),this._client=void 0}},{key:"sendChannelMessage",value:(r=o(v().mark((function e(t,r,n){var i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.channels[t],e.next=3,i.sendMessage(r,{enableHistoricalMessaging:n.enableHistoricalMessaging});case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"sendPeerMessage",value:(t=o(v().mark((function e(t,r,n){var i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.sendMessageToPeer(r,t,{enableHistoricalMessaging:n.enableHistoricalMessaging});case 2:return i=e.sent,e.abrupt("return",i.hasPeerReceived);case 4:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),h}(Uc.EventEmitter);function eu(e,t,r,n,i){var o={};return Object.keys(n).forEach((function(e){o[e]=n[e]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce((function(r,n){return n(e,t,r)||r}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}__webpack_require__(86);var tu,ru,nu,iu=__webpack_require__(4073),ou=__webpack_require__.n(iu),au=(__webpack_require__(4129),__webpack_require__(8206),new Set),su=function(e,t,r){var n=r.value;return{configurable:!0,enumerable:!1,get:function(){var e=this.__cacheMap;return e||(e=new WeakMap,this.__cacheMap=e,au.add(this)),e.has(n)||e.set(n,n.bind(this)),e.get(n)},set:function(e){var t=this.__cacheMap;t||(t=new WeakMap,this.__cacheMap=t,au.add(this)),t.set(e,e.bind(this))}}};function cu(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}!function(e){e[e.None=0]="None",e[e.Camera=1]="Camera",e[e.ScreenShare=2]="ScreenShare"}(tu||(tu={})),function(e){e[e.None=0]="None",e[e.Mic=1]="Mic",e[e.Mix=2]="Mix"}(ru||(ru={})),function(e){e[e.Unpublished=0]="Unpublished",e[e.Published=1]="Published"}(nu||(nu={}));var uu,lu,hu=c((function e(t,r){var n=r.videoSourceType,i=r.audioSourceType;a(this,e),this.videoSourceType=tu.None,this.audioSourceType=ru.None,this.rtc=void 0,this.rtc=t,n&&(this.videoSourceType=n),i&&(this.audioSourceType=i)})),fu=function(e){l(r,e);var t=cu(r);function r(e){var n;return a(this,r),(n=t.call(this,e,{videoSourceType:tu.Camera})).state=yu.stopped,e.onLocalVideoTrackStateChanged((function(e,t){t===tu.Camera&&(n.state=e)})),n}return c(r,[{key:"setView",value:function(e){this.rtc.setupLocalVideo(e,tu.Camera)}},{key:"setDeviceId",value:function(e){this.rtc.setVideoCameraDevice(e)}},{key:"setVideoEncoderConfiguration",value:function(){}},{key:"start",value:function(){return this.rtc.enableLocalVideo(!0)}},{key:"stop",value:function(){return this.rtc.enableLocalVideo(!1)}}]),r}(hu),du=function(e){l(r,e);var t=cu(r);function r(e){var n;return a(this,r),(n=t.call(this,e,{audioSourceType:ru.Mic})).state=yu.stopped,e.onLocalAudioTrackStateChanged((function(e,t){t===ru.Mic&&(n.state=e)})),n}return c(r,[{key:"setRecordingDevice",value:function(e){return this.rtc.setAudioRecordingDevice(e)}},{key:"setPlaybackDevice",value:function(e){return this.rtc.setAudioPlaybackDevice(e)}},{key:"start",value:function(){return this.rtc.enableLocalAudio(!0)}},{key:"stop",value:function(){return this.rtc.enableLocalAudio(!1)}}]),r}(hu),pu=function(e){l(r,e);var t=cu(r);function r(e){return a(this,r),t.call(this,e,{videoSourceType:tu.ScreenShare})}return c(r,[{key:"setView",value:function(e){this.rtc.setupLocalVideo(e,tu.ScreenShare)}},{key:"start",value:function(){return this.rtc.startScreenCapture()}},{key:"startWithParams",value:function(e,t){return this.rtc.startScreenCapture(e,t)}},{key:"stop",value:function(){return this.rtc.stopScreenCapture()}}]),r}(hu),gu=new Set,vu={debounced:function(e,t){return function(r,n,i){var o=i.value;return{configurable:!0,enumerable:!1,get:function(){var r=this.__cacheMap;return r||(r=new WeakMap,this.__cacheMap=r,gu.add(this)),r.has(o)||r.set(o,(0,S.debounce)(o,e,t).bind(this)),r.get(o)},set:function(e){var t=this.__cacheMap;t||(t=new WeakMap,this.__cacheMap=t,gu.add(this)),t.set(e,e.bind(this))}}}},throttled:function(e,t){return function(r,n,i){var o=i.value;return{configurable:!0,enumerable:!1,get:function(){var r=this.__cacheMap;return r||(r=new WeakMap,this.__cacheMap=r,gu.add(this)),r.has(o)||r.set(o,(0,S.throttle)(o,e,t).bind(this)),r.get(o)},set:function(e){var t=this.__cacheMap;t||(t=new WeakMap,this.__cacheMap=t,gu.add(this)),t.set(e,e.bind(this))}}}}};!function(e){e[e.main=0]="main",e[e.sub=1]="sub"}(lu||(lu={}));var Au,mu,yu,_u,bu,Eu,wu,Iu,Cu,Su,Tu=Zn.attach({level:On.DEBUG})(uu=function(){function e(t,r){a(this,e),this.channelName=void 0,this._adapter=void 0,this._adapter=r,this.channelName=t}return c(e,[{key:"connectionType",value:function(e){return void 0===e?lu.main:e}},{key:"enableDualStream",value:function(e,t){return this._adapter.enableDualStream(e,this.connectionType(t))}},{key:"setLowStreamParameter",value:function(e,t){return this._adapter.setLowStreamParameter(e,this.connectionType(t))}},{key:"setRemoteVideoStreamType",value:function(e,t,r){return this._adapter.setRemoteVideoStreamType(e,t,this.connectionType(r))}},{key:"getRtcSid",value:function(){return this._adapter.getSessionId()}},{key:"join",value:function(e,t,r){return this._adapter.join(e,t,this.connectionType(r))}},{key:"leave",value:function(e){return this._adapter.leave(e)}},{key:"setClientRole",value:function(e){return this._adapter.setClientRole(e)}},{key:"muteLocalVideoStream",value:function(e,t){return this._adapter.muteLocalVideo(e,this.connectionType(t))}},{key:"muteLocalAudioStream",value:function(e,t){return this._adapter.muteLocalAudio(e,this.connectionType(t))}},{key:"muteLocalScreenStream",value:function(e,t){return this._adapter.muteLocalScreenShare(e,this.connectionType(t))}},{key:"muteRemoteVideoStream",value:function(e,t){return this._adapter.muteRemoteVideo(e,t)}},{key:"muteRemoteAudioStream",value:function(e,t){return this._adapter.muteRemoteAudio(e,t)}},{key:"onNetworkStats",value:function(e){return this._adapter.onNetworkStats(e)}},{key:"onAudioVolumeIndication",value:function(e){return this._adapter.onAudioVolumeIndication(e)}},{key:"onConnectionStageChanged",value:function(e){return this._adapter.onConnectionStateChanged(e)}}]),e}())||uu;__webpack_require__(3290);!function(e){e[e.unknown=99]="unknown",e[e.bad=1]="bad",e[e.poor=2]="poor",e[e.good=3]="good",e[e.great=4]="great",e[e.down=5]="down"}(Au||(Au={})),function(e){e[e.Unknown=0]="Unknown",e[e.PermissionDenied=1]="PermissionDenied"}(mu||(mu={})),function(e){e[e.stopped=0]="stopped",e[e.starting=2]="starting",e[e.started=1]="started",e[e.error=-1]="error"}(yu||(yu={})),function(e){e[e.Idle=0]="Idle",e[e.Connecting=1]="Connecting",e[e.Connected=2]="Connected",e[e.Reconnecting=3]="Reconnecting"}(_u||(_u={})),function(e){e[e.AES_128_XTS=1]="AES_128_XTS",e[e.AES_128_ECB=2]="AES_128_ECB",e[e.AES_256_XTS=3]="AES_256_XTS",e[e.SM4_128_ECB=4]="SM4_128_ECB",e[e.AES_128_GCM=5]="AES_128_GCM",e[e.AES_256_GCM=6]="AES_256_GCM"}(bu||(bu={})),function(e){e[e.Window=0]="Window",e[e.Screen=1]="Screen"}(Eu||(Eu={})),function(e){e[e.fit=0]="fit",e[e.fill=1]="fill"}(wu||(wu={})),function(e){e[e.low=0]="low",e[e.normal=1]="normal",e[e.height=2]="height"}(Iu||(Iu={})),function(e){e[e.HIGH_STREAM=0]="HIGH_STREAM",e[e.LOW_STREAM=1]="LOW_STREAM"}(Cu||(Cu={}));var Ru=(Su=function(){function e(t,r){var n=r.userUuid,i=r.userName,o=r.userRole,s=r.streamUuid,c=r.sceneId,u=r.rtcToken,l=r.rtc,h=r.userProperties;a(this,e),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=ou()(this._syncVideoSourceState,500),this._debouncedSyncAudio=ou()(this._syncAudioSourceState,500),this.subStream=void 0,this.userUuid=n,this.userName=i,this.userRole=o,this.userProperties=h,this.streamUuid=s,this.sceneId=c,this.rtcToken=u,this._rtc=l,this._scene=t,this._addEventHandler()}var t,r,n,i,s,u,l,h,f,d;return c(e,[{key:"toData",value:function(){var e=this.userName,t=this.userUuid,r=this.userRole,n=this.userProperties;return wc.fromData({userName:e,userUuid:t,role:r,userProperties:n})}},{key:"destroy",value:function(){Vh.engine.getAgoraMediaControl().off(Ju.localVideoTrackChanged,this._handleVideoTrackStateChange),Vh.engine.getAgoraMediaControl().off(Ju.localAudioTrackChanged,this._handleAudioTrackStateChange)}},{key:"_addEventHandler",value:function(){Vh.engine.getAgoraMediaControl().on(Ju.localVideoTrackChanged,this._handleVideoTrackStateChange),Vh.engine.getAgoraMediaControl().on(Ju.localAudioTrackChanged,this._handleAudioTrackStateChange)}},{key:"_handleVideoTrackStateChange",value:function(e,t){t===tu.Camera&&e!==yu.starting&&this._debouncedSyncVideo(e)}},{key:"_handleAudioTrackStateChange",value:function(e,t){t===ru.Mic&&e!==yu.starting&&this._debouncedSyncAudio(e)}},{key:"_syncVideoSourceState",value:function(e){yn.info("sync video state ".concat(e)),this.updateLocalMediaState({videoSourceState:e})}},{key:"_syncAudioSourceState",value:function(e){yn.info("sync audio state ".concat(e)),this.updateLocalMediaState({audioSourceState:e})}},{key:"setSceneProperties",value:(d=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._scene.getApiService().updateRoomProperties({roomUuid:this.sceneId,properties:t,cause:r});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"deleteSceneProperties",value:(f=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._scene.getApiService().deleteRoomProperties({roomUuid:this.sceneId,properties:t,cause:r});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"setUserProperties",value:(h=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._scene.getApiService().updateUserProperties({userUuid:this.userUuid,roomUuid:this.sceneId,properties:t,cause:r});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"deleteUserProperties",value:(l=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._scene.getApiService().deleteUserProperties({userUuid:this.userUuid,roomUuid:this.sceneId,properties:t,cause:r});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"updateLocalMediaState",value:(u=o(v().mark((function e(t,r){var n,i,o;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.videoSourceState,o=t.audioSourceState,e.next=3,this._scene.getApiService().updateDeviceState(this.sceneId,this.userUuid,r&&r===lu.sub?(null===(n=this.subStream)||void 0===n?void 0:n.streamUuid)||"0":this.streamUuid,{videoSourceState:i,audioSourceState:o});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"updateLocalMediaStream",value:(s=o(v().mark((function e(t,r){var n,i,o;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.publishVideo,o=t.publishAudio,e.next=3,this._scene.getApiService().upsertStream(this.sceneId,this.userUuid,r&&r===lu.sub?(null===(n=this.subStream)||void 0===n?void 0:n.streamUuid)||"0":this.streamUuid,{publishVideo:i,publishAudio:o});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"updateRemoteMediaStream",value:(i=o(v().mark((function e(t,r,n,i){var o,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.publishVideo,a=n.publishAudio,e.next=3,this._scene.getApiService().upsertStream(this.sceneId,t,r,{publishVideo:o,publishAudio:a});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return i.apply(this,arguments)})},{key:"deleteLocalMediaStream",value:(n=o(v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._scene.getApiService().deleteStream(this.sceneId,this.userUuid,this.streamUuid);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"deleteLocalScreenStream",value:(r=o(v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.subStream){e.next=4;break}return e.next=3,this._scene.getApiService().deleteStream(this.sceneId,this.userUuid,this.subStream.streamUuid);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"sendRoomMessage",value:(t=o(v().mark((function e(t){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._scene.getApiService().sendRoomChatMessage(t,this.sceneId);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setupRemoteVideo",value:function(e){this._rtc.setupRemoteVideo(e)}}]),e}(),eu(Su.prototype,"_handleVideoTrackStateChange",[su],Object.getOwnPropertyDescriptor(Su.prototype,"_handleVideoTrackStateChange"),Su.prototype),eu(Su.prototype,"_handleAudioTrackStateChange",[su],Object.getOwnPropertyDescriptor(Su.prototype,"_handleAudioTrackStateChange"),Su.prototype),eu(Su.prototype,"_syncVideoSourceState",[su],Object.getOwnPropertyDescriptor(Su.prototype,"_syncVideoSourceState"),Su.prototype),eu(Su.prototype,"_syncAudioSourceState",[su],Object.getOwnPropertyDescriptor(Su.prototype,"_syncAudioSourceState"),Su.prototype),Su),ku=__webpack_require__(8640),Ou=__webpack_require__.n(ku);function Nu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nu(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Du=function(){function e(t,r,n){a(this,e),this.fn=void 0,this.args=void 0,this.onRetryAttemptFail=void 0,this.onRetryAbort=void 0,this.opts=void 0,this.fn=t,this.args=r,this.opts=n}var t;return c(e,[{key:"fail",value:function(e){return this.onRetryAttemptFail=e,this}},{key:"abort",value:function(e){return this.onRetryAbort=e,this}},{key:"exec",value:(t=o(v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ou()(this.fn,this.args,xu(xu({retriesMax:3},this.opts),{},{onAttemptFail:this.onRetryAttemptFail}));case 3:e.next=12;break;case 5:if(e.prev=5,e.t0=e.catch(0),e.t1=this.onRetryAbort,!e.t1){e.next=11;break}return e.next=11,this.onRetryAbort(e.t0);case 11:throw e.t0;case 12:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return t.apply(this,arguments)})}]),e}(),Lu=function(e,t,r){return new Du(e,t,r)},Pu=function(e){try{return JSON.stringify(e)}catch(e){}return"invalid json"},Bu=function(e){return new Promise((function(t){setTimeout(t,e)}))},Mu=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Promise.race([e,new Promise((function(e,n){setTimeout(r?n:e,t)}))])},ju=function(){function e(){a(this,e),this._users=gc.Map(),this._roomProperties=gc.Map({}),this._streams=gc.Map(),this._roomInfo=gc.Map(),this._messages=gc.List([])}return c(e,[{key:"users",get:function(){return this._users}},{key:"setUsers",value:function(e){this._users=gc.Map(e)}},{key:"setUser",value:function(e,t){this._users=this._users.set(e,t)}},{key:"deleteUser",value:function(e){this._users=this._users.delete(e)}},{key:"findUser",value:function(e){return this._users.get(e)}},{key:"roomProperties",get:function(){return this._roomProperties}},{key:"setRoomProperties",value:function(e){this._roomProperties=gc.Map(e)}},{key:"streams",get:function(){return this._streams}},{key:"setStreams",value:function(e){this._streams=gc.Map(e)}},{key:"findUserStreams",value:function(e){return Array.from(this._streams.values()).filter((function(t){return t.fromUser.userUuid===e}))}},{key:"setStream",value:function(e,t){this._streams=this._streams.set(e,t)}},{key:"deleteStream",value:function(e){this._streams=this._streams.delete(e)}},{key:"findStream",value:function(e){return this._streams.get(e)}},{key:"roomInfo",get:function(){return this._roomInfo}},{key:"setRoomInfo",value:function(e){this._roomInfo=gc.Map(e)}},{key:"messages",get:function(){return this._messages}},{key:"addMessage",value:function(e){this._messages.push(e)}}]),e}();function Uu(e,t){return e.then((function(e){return[null,e]})).catch((function(e){return t&&Object.assign(e,t),[e,void 0]}))}const Fu=Uu;var Qu,qu,Gu;function Vu(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}!function(e){e[e.Idle=0]="Idle",e[e.Connecting=1]="Connecting",e[e.Connected=2]="Connected",e[e.Reconnecting=3]="Reconnecting",e[e.Error=4]="Error"}(Qu||(Qu={})),function(e){e[e.Communication=0]="Communication",e[e.LiveBroadcasting=1]="LiveBroadcasting"}(qu||(qu={})),function(e){e[e.Host=0]="Host",e[e.Audience=1]="Audience"}(Gu||(Gu={}));var Ku,Hu=function(e){l(b,e);var t,r,n,i,s,u,h,f,d,p,g,A,m,y,_=Vu(b);function b(){return a(this,b),_.call(this)}return c(b,[{key:"checkIn",value:(y=o(v().mark((function e(t,r,n,i,o){var a,s;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch({path:"/v2/rooms/".concat(t,"/users/").concat(r),pathPrefix:"/edu/apps/".concat(Qn.shared.appId),method:"PUT",data:{boardRegion:"cn-hz",duration:18e3,role:o,roomName:n,roomType:4,userName:i,userProperties:{}}});case 2:return a=e.sent,s=a.data,e.abrupt("return",s);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,i){return y.apply(this,arguments)})},{key:"entryRoom",value:(m=o(v().mark((function e(t){var r,n,i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Jc.shared.startTick("joinRoom","http","entry"),e.next=3,this.fetch({path:"/v1/rooms/".concat(t.roomUuid,"/users/").concat(t.userUuid,"/entry"),method:"POST",data:t});case 3:return r=e.sent,n=r.__status,i=r.code,Jc.shared.reportHttp("joinRoom","http","entry",n,200===n,i),e.abrupt("return",r.data);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"syncSnapShot",value:(A=o(v().mark((function e(t){var r,n,i,o,a,s,c,u;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch({path:"/v1/rooms/".concat(t,"/snapshot"),method:"GET"});case 2:return n=e.sent,i=n.data,o=null!==(r=i.sequence)&&void 0!==r?r:0,a=Oc()(i,"snapshot.room.roomInfo",null),s=Oc()(i,"snapshot.room.roomProperties",null),c=Oc()(i,"snapshot.room.roomState"),u=Oc()(i,"snapshot.users",[]),e.abrupt("return",{seq:o,roomInfo:a,roomState:c,roomProperties:s,users:u});case 10:case"end":return e.stop()}}),e,this)}))),function(e){return A.apply(this,arguments)})},{key:"syncSequence",value:(g=o(v().mark((function e(t,r,n){var i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch({path:"/v1/rooms/".concat(t,"/sequences?nextId=").concat(r,"&count=").concat(n),method:"GET"});case 2:return i=e.sent,e.abrupt("return",i.data);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return g.apply(this,arguments)})},{key:"updateRoomProperties",value:(p=o(v().mark((function e(t){var r,n,i,o,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.roomUuid,n=t.properties,i=t.cause,o={properties:n},i&&(o.cause=i),e.next=5,this.fetch({path:"/v1/rooms/".concat(r,"/properties"),method:"PUT",data:o});case 5:return a=e.sent,e.abrupt("return",a.data);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"deleteRoomProperties",value:(d=o(v().mark((function e(t){var r,n,i,o,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.roomUuid,n=t.properties,i=t.cause,o={properties:n},i&&(o.cause=i),e.next=5,this.fetch({path:"/v1/rooms/".concat(r,"/properties"),method:"DELETE",data:o});case 5:return a=e.sent,e.abrupt("return",a.data);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"updateUserProperties",value:(f=o(v().mark((function e(t){var r,n,i,o,a,s;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.roomUuid,n=t.userUuid,i=t.properties,o=t.cause,a={properties:i,cause:void 0===o?void 0:o},e.next=4,this.fetch({path:"/v1/rooms/".concat(r,"/users/").concat(n,"/properties"),method:"PUT",data:a});case 4:return s=e.sent,e.abrupt("return",s.data);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"updateBatchUserProperties",value:(h=o(v().mark((function e(t){var r,n,i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.roomUuid,n=t.data,e.next=3,this.fetch({path:"/v1/rooms/".concat(r,"/users/properties"),method:"PUT",data:{users:n}});case 3:return i=e.sent,e.abrupt("return",i.data);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"deleteUserProperties",value:(u=o(v().mark((function e(t){var r,n,i,o,a,s,c;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.roomUuid,n=t.userUuid,i=t.properties,o=t.cause,s={properties:i},(a=void 0===o?void 0:o)&&(s.cause=a),e.next=5,this.fetch({path:"/v1/rooms/".concat(r,"/users/").concat(n,"/properties"),method:"DELETE",data:{users:s}});case 5:return c=e.sent,e.abrupt("return",c.data);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"deleteBatchUserProperties",value:(s=o(v().mark((function e(t){var r,n,i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.roomUuid,n=t.data,e.next=3,this.fetch({path:"/v1/rooms/".concat(r,"/users/properties"),method:"DELETE",data:{users:n}});case 3:return i=e.sent,e.abrupt("return",i.data);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"upsertStream",value:(i=o(v().mark((function e(t,r,n,i){var o,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.publishVideo,a=i.publishAudio,e.next=3,this.fetch({path:"/v1/rooms/".concat(t,"/users/").concat(r,"/streams/").concat(n),method:"PUT",data:{videoState:o,audioState:a}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return i.apply(this,arguments)})},{key:"deleteStream",value:(n=o(v().mark((function e(t,r,n){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch({path:"/v1/rooms/".concat(t,"/users/").concat(r,"/streams/").concat(n),method:"DELETE"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"updateDeviceState",value:(r=o(v().mark((function e(t,r,n,i){var o,a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.videoSourceState,a=i.audioSourceState,e.next=3,this.fetch({path:"/v1/rooms/".concat(t,"/users/").concat(r,"/streams/").concat(n),method:"PATCH",data:{videoSourceState:o,audioSourceState:a}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"sendRoomChatMessage",value:(t=o(v().mark((function e(t,r){var n;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetch({path:"/v1/rooms/".concat(r,"/chat/channel"),method:"POST",data:{message:t,type:1}});case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),b}(Kc);function zu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zu(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yu(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Ju,Xu=Zn.attach({proxyMethods:!1})(Ku=function(e){l(h,e);var t,r,i,s,u=Yu(h);function h(e,t){var r;a(this,h),(r=u.call(this)).logger=void 0,r.sceneId=void 0,r._localUser=void 0,r._sceneState=Qu.Idle,r._initialSync=!1,r._apiService=void 0,r.dataStore=void 0,r._rtmManager=void 0,r._rtcManager=void 0,r._rtmChannel=void 0,r._rtcChannel=void 0,r._rtmChannelObserver=void 0,r._synchronizer=void 0,r._timestampGap=0,r.createTs=void 0,r.sceneId=e,r._rtmManager=t.rtm,r._rtcManager=t.rtc,r._rtmChannel=t.rtmChannel,r._rtmChannelObserver=t.rtmChannelObserver,r._rtcChannel=t.rtcChannel,r._apiService=new Hu,r._apiService.pathPrefix=Vh.engine.apiServicePathPrefix,r.dataStore=new ju;var n=r._rtcChannel,i=r._rtmManager;return n.onNetworkStats((function(e){r.emit(bc.NetworkStats,e)})),n.onAudioVolumeIndication((function(e){r.emit(bc.AudioVolumes,e)})),n.onConnectionStageChanged((function(e,t){r.emit(bc.RtcConnectionStateChanged,e,t)})),i.on(bc.RtmConnectionStateChanged,r._handleRtmStateChange=r._handleRtmStateChange.bind(f(r))),r}return c(h,[{key:"getApiService",value:function(){return this._apiService}},{key:"localUser",get:function(){return this._localUser}},{key:"rtcSid",get:function(){return this._rtcChannel.getRtcSid()}},{key:"rtmSid",get:function(){return this._rtmManager.sessionId}},{key:"rtcChannel",get:function(){return this._rtcChannel}},{key:"timestampServerLocalGap",get:function(){return this._timestampGap}},{key:"enableDualStream",value:function(e,t){return this._rtcChannel.enableDualStream(e,t)}},{key:"setLowStreamParameter",value:function(e,t){return this._rtcChannel.setLowStreamParameter(e,t)}},{key:"setRemoteVideoStreamType",value:function(e,t){return this._rtcChannel.setRemoteVideoStreamType(e,t)}},{key:"joinScene",value:(s=o(v().mark((function e(t){var r,n,i,o,a,s,c,u,l,h,f,d,p,g,A;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._sceneState===Qu.Idle){e.next=3;break}return yn.warn("scene not idle"),e.abrupt("return");case 3:return e.prev=3,this._setRteConnectionState(Qu.Connecting),r=Vh.engine.getAgoraMediaControl(),e.next=8,this.getApiService().entryRoom({userUuid:Qn.shared.userId,roomUuid:this.sceneId,userName:t.userName,streamUuid:t.streamId,role:t.userRole,stream:{videoSourceState:r.createCameraVideoTrack().state,audioSourceState:r.createMicrophoneAudioTrack().state}});case 8:return n=e.sent,i=n.user,o=n.room,this.createTs=o.roomState.createTime,this._apiService.headers=Wu(Wu({},Qn.shared.service.headers),{},{token:i.userToken}),e.next=15,this._rtmManager.join(this._rtmChannel,this._rtmChannelObserver,this.sceneId);case 15:return a=i.streamUuid,s=i.userName,c=i.userUuid,u=i.role,l=i.rtcToken,h=i.streams,f=void 0===h?[]:h,d=i.userProperties,p=f.map((function(e){return Ic.fromData({streamUuid:e.streamUuid,streamName:e.streamName,fromUser:{userName:s,userUuid:c,role:u},videoSourceState:e.videoSourceState,audioSourceState:e.audioSourceState,videoSourceType:e.videoSourceType,audioSourceType:e.audioSourceType,videoState:e.videoState,audioState:e.audioState})})),this.dataStore.setStreams(p),this._localUser=new Ru(this,{userUuid:Qn.shared.userId,userName:s,userRole:u,streamUuid:a,sceneId:this.sceneId,rtcToken:l,rtc:this._rtcManager,userProperties:d}),2===f.length&&(g=f.find((function(e){return e.streamUuid!==a})),this._localUser.subStream=g),this._synchronizer=new jc(this.dataStore,{scene:this,userUuid:Qn.shared.userId,streamUuid:a,channelObserver:this._rtmChannelObserver,rtm:this._rtmManager}),this._addEventListeners(this._synchronizer.handle),e.next=24,this.getApiService().syncSnapShot(this.sceneId);case 24:A=e.sent,this._synchronizer.syncSnapshot(Ec.fromData(A)),e.next=32;break;case 28:return e.prev=28,e.t0=e.catch(3),this._cleanup(),e.abrupt("return",jn.shared.handleThrowableError(kn.RTE_ERR_JOIN_SCENE_FAILED,e.t0));case 32:case"end":return e.stop()}}),e,this,[[3,28]])}))),function(e){return s.apply(this,arguments)})},{key:"leaveScene",value:(i=o(v().mark((function e(){var t,r,i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Fu(this._rtmManager.leave(this.sceneId));case 2:t=e.sent,r=n(t,1),(i=r[0])&&jn.shared.handleNonThrowableError(kn.RTE_ERR_LEAVE_SCENE_FAIL,i),this._rtmManager.off(bc.RtmConnectionStateChanged,this._handleRtmStateChange),this._cleanup();case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"joinRTC",value:(r=o(v().mark((function e(t){var r;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._initialSync&&this.localUser){e.next=2;break}return e.abrupt("return",jn.shared.handleThrowableError(kn.RTE_ERR_SCENE_NOT_READY,new Error("try to join rtc before scene is ready ".concat(!!this._initialSync," ").concat(!!this.localUser))));case 2:if(!t){e.next=8;break}return e.next=5,this._rtcChannel.join(t.token,t.streamUuid,t.connectionType);case 5:case 10:return e.abrupt("return",e.sent);case 8:return e.next=10,this._rtcChannel.join(this.localUser.rtcToken,null===(r=this.localUser)||void 0===r?void 0:r.streamUuid);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"leaveRTC",value:(t=o(v().mark((function e(t){var r,i,o;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Fu(this._rtcChannel.leave(t));case 2:r=e.sent,i=n(r,1),(o=i[0])&&jn.shared.handleNonThrowableError(kn.RTC_ERR_LEAVE_CHANNEL_FAIL,o);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_cleanup",value:function(){var e;null===(e=this._localUser)||void 0===e||e.destroy(),this._localUser=void 0,this._synchronizer=void 0,this._initialSync=!1}},{key:"_setRteConnectionState",value:function(e,t){var r=this._sceneState;this._sceneState=e,this._sceneState!==r&&this.emit(bc.RteConnectionStateChanged,e,t)}},{key:"_setInitialSnapshotSync",value:function(e){this._initialSync=e,this._recalculateRteState()}},{key:"_recalculateRteState",value:function(e){var t=this._rtmManager.connectionState,r=this._initialSync;return t===Yc.DISCONNECTED?this._setRteConnectionState(Qu.Idle):t===Yc.CONNECTING?this._setRteConnectionState(Qu.Connecting):t===Yc.CONNECTED?r?this._setRteConnectionState(Qu.Connected):this._setRteConnectionState(Qu.Connecting):t===Yc.RECONNECTING?r?this._setRteConnectionState(Qu.Reconnecting):this._setRteConnectionState(Qu.Connecting):t===Yc.ABORTED?this._setRteConnectionState(Qu.Error,e):void yn.warn("unhandled rte connection state: rtm: ".concat(t,", snapshot: ").concat(r))}},{key:"_handleUserAdded",value:function(e){var t=this,r=[],n=[];e.forEach((function(e){var i;if(t.logger.info("check streams with user",e),(null===(i=t.localUser)||void 0===i?void 0:i.userUuid)===e.userUuid){var o=t.dataStore.findUserStreams(e.userUuid);o.length?(t.logger.info("local streams come with user",o),r=r.concat(o)):t.logger.info("no local streams come with user",o)}else{var a=t.dataStore.findUserStreams(e.userUuid);a.length?(t.logger.info("remote streams come with user",a),n=n.concat(a)):t.logger.info("no remote streams come with user",a)}})),this.emit(bc.LocalStreamAdded,r),this.emit(bc.RemoteStreamAdded,n),this.emit(bc.UserAdded,e)}},{key:"_handleUserRemoved",value:function(e,t){var r=this,n=[],i=[];e.forEach((function(e){var t;if((null===(t=r.localUser)||void 0===t?void 0:t.userUuid)===e.userUuid){var o=r.dataStore.findUserStreams(e.userUuid);o.length&&(n=n.concat(o))}else{var a=r.dataStore.findUserStreams(e.userUuid);a.length&&(i=i.concat(a))}})),this._handleLocalStreamRemoved(n),this._handleRemoteStreamsRemoved(i),this.emit(bc.UserRemoved,e,t)}},{key:"_handleLocalStreamRemoved",value:function(e,t){0!==e.length&&(this.logger.info("_handleLocalStreamRemoved [".concat(e.join(","),"]")),this.emit(bc.LocalStreamRemove,e,t))}},{key:"_handleRemoteStreamsRemoved",value:function(e,t){0!==e.length&&(this.logger.info("_handleRemoteStreamsRemoved [".concat(e.join(","),"]")),this.emit(bc.RemoteStreamRemove,e,t))}},{key:"_addEventListeners",value:function(e){var t=this;e.on(bc.SnapshotUpdated,(function(){if(t.logger.info("sceneId:".concat(t.sceneId," snapshot updated")),t._setInitialSnapshotSync(!0),!t.localUser)return jn.shared.handleThrowableError(kn.RTE_ERR_LOCAL_USER_NOT_EXIST,new Error("local user not exist"));var e=t.localUser.toData();t.dataStore.setUser(t.localUser.userUuid,wc.fromData(e));var r=Array.from(t.dataStore.users.values()).filter((function(e){return e.userUuid!==t.localUser.userUuid}));r.push(e),r.length>0&&t._handleUserAdded(r),t._handleRoomPropertyChange(Array.from(t.dataStore.roomProperties.keys()),t.dataStore.roomProperties,{},{})})),e.on(bc.ChatReceived,(function(e){t.emit(bc.ChatReceived,e)})),e.on(bc.UserAdded,(function(e){t.logger.info("sceneId:".concat(t.sceneId," user-added [").concat(e.join(","),"]")),t._handleUserAdded(e)})),e.on(bc.UserUpdated,(function(e){t.logger.info("sceneId:".concat(t.sceneId," user-updated ").concat(e))})),e.on(bc.UserRemoved,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," user-removed [").concat(e.join(","),"]")),t._handleUserRemoved(e,r)})),e.on(bc.RoomPropertyUpdated,(function(e,r,n,i){t.logger.debug("sceneId:".concat(t.sceneId," room-property-updated ").concat(Pu(r)," ").concat(Pu(n)," ").concat(Pu(i))),t._handleRoomPropertyChange(e,r,n,i)})),e.on(bc.UserPropertyUpdated,(function(e,r,n,i){t.logger.debug("sceneId:".concat(t.sceneId," user-property-updated ").concat(e," ").concat(Pu(r)," ").concat(Pu(n)," ").concat(Pu(i))),t.emit(bc.UserPropertyUpdated,e,r,n,i)})),e.on(bc.UserPropertyListUpdated,(function(e,r,n,i){t.logger.debug("user-property-list-updated ".concat(Pu(e)," ").concat(Pu(r)," ").concat(Pu(n)," ").concat(Pu(i))),t.emit(bc.UserPropertyListUpdated,e,r,n,i)})),e.on(bc.LocalStreamAdded,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," local-stream-added [").concat(e.join(","),"]")),0!==e.length&&t.emit(bc.LocalStreamAdded,e,r)})),e.on(bc.LocalStreamUpdate,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," local-stream-upsert [").concat(e.join(","),"]")),0!==e.length&&t.emit(bc.LocalStreamUpdate,e,r)})),e.on(bc.LocalStreamRemove,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," local-stream-removed [").concat(e.join(","),"]")),0!==e.length&&t.emit(bc.LocalStreamRemove,e,r)})),e.on(bc.RemoteStreamAdded,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," remote-stream-added [").concat(e.join(","),"]")),0!==e.length&&t.emit(bc.RemoteStreamAdded,e,r)})),e.on(bc.RemoteStreamUpdate,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," remote-stream-upsert [").concat(e.join(","),"]")),0!==e.length&&t.emit(bc.RemoteStreamUpdate,e,r)})),e.on(bc.RemoteStreamRemove,(function(e,r){t.logger.info("sceneId:".concat(t.sceneId," remote-stream-removed [").concat(e.join(","),"]")),0!==e.length&&t.emit(bc.RemoteStreamRemove,e,r)})),e.on(bc.ChatUserMessage,(function(e){t.emit(bc.ChatUserMessage,e)})),e.on(bc.TimeStampGapUpdate,(function(e){t._timestampGap=e,t.emit(bc.TimeStampGapUpdate,e)}))}},{key:"_handleRoomPropertyChange",value:function(e,t,r,n){this.emit(bc.RoomPropertyUpdated,e,t.toObject(),r,n)}},{key:"_handleRtmStateChange",value:function(e){this._recalculateRteState(e.reason)}}]),h}(Uc.EventEmitter))||Ku;function Zu(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}!function(e){e.cameraListChanged="camera-list-changed",e.localAudioVolume="local-audio-volume",e.localAudioRecordingListChanged="local-audio-recording-list-changed",e.localVideoTrackChanged="local-video-track-changed",e.localAudioTrackChanged="local-audio-track-changed",e.trackStateChanged="track-state-changed",e.playbackDeviceListChanged="playback-device-list-changed",e.recordingDeviceListChanged="recording-device-list-changed",e.localAudioPlaybackVolumeIndicator="start-test-audio-playback-volume-indicator",e.audioPlaybackStateChanged="audio-playback-state-changed",e.localAudioFrame="local-audio-frame"}(Ju||(Ju={}));var $u,el=function(e){l(r,e);var t=Zu(r);function r(e){var n;return a(this,r),(n=t.call(this)).camera=void 0,n.microphone=void 0,n.screen=void 0,n._rtc=void 0,n._rtc=e,n._addEventListener(e),n}return c(r,[{key:"_addEventListener",value:function(e){var t=this;e.getVideoDeviceManager().onLocalCameraListChanged((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.emit.apply(t,[Ju.cameraListChanged].concat(r))})),e.getAudioDeviceManager().onLocalRecordingDeviceListChanged((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.emit.apply(t,[Ju.recordingDeviceListChanged].concat(r))})),e.getAudioDeviceManager().onLocalPlaybackDeviceListChanged((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.emit.apply(t,[Ju.playbackDeviceListChanged].concat(r))})),e.getVideoDeviceManager().onLocalVideoTrackStateChanged((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.emit.apply(t,[Ju.localVideoTrackChanged].concat(r))})),e.getAudioDeviceManager().onLocalAudioTrackStateChanged((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.emit.apply(t,[Ju.localAudioTrackChanged].concat(r))})),e.getAudioDeviceManager().onLocalAudioVolume((function(e){t.emit(Ju.localAudioVolume,e)})),e.getAudioDeviceManager().onLocalAudioPlaybackTestVolumeChanged((function(e){t.emit(Ju.localAudioPlaybackVolumeIndicator,e)})),e.getAudioDeviceManager().onAudioFrame((function(e){t.emit(Ju.localAudioFrame,e)})),e.onLocalScreenShareTrackStateChanged((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.emit.apply(t,[Ju.localVideoTrackChanged].concat(r))}))}},{key:"createCameraVideoTrack",value:function(){return this.camera||(this.camera=new fu(this._rtc)),this.camera}},{key:"createMicrophoneAudioTrack",value:function(){return this.microphone||(this.microphone=new du(this._rtc)),this.microphone}},{key:"createScreenShareTrack",value:function(){return this.screen||(this.screen=new pu(this._rtc)),this.screen}},{key:"getVideoCameraList",value:function(){return this._rtc.getVideoDeviceManager().getVideoCameraDevices()}},{key:"getAudioRecordingList",value:function(){return this._rtc.getAudioDeviceManager().getAudioRecordingDevices()}},{key:"getAudioPlaybackList",value:function(){return this._rtc.getAudioDeviceManager().getAudioPlaybackDevices()}},{key:"isScreenDeviceEnumerateSupported",value:function(){return this._rtc.isScreenDeviceEnumerateSupported()}},{key:"hasScreenSharePermission",value:function(){return this._rtc.hasScreenSharePermission()}},{key:"getWindowDevices",value:function(){return this._rtc.getWindowDevices()}},{key:"getDisplayDevices",value:function(){return this._rtc.getDisplayDevices()}},{key:"startAudioRecordingDeviceTest",value:function(e){return this._rtc.startAudioRecordingDeviceTest(e)}},{key:"stopAudioRecordingDeviceTest",value:function(){return this._rtc.stopAudioRecordingDeviceTest()}},{key:"startAudioPlaybackDeviceTest",value:function(e){return this._rtc.startAudioPlaybackDeviceTest(e)}},{key:"stopAudioPlaybackDeviceTest",value:function(){return this._rtc.stopAudioPlaybackDeviceTest()}},{key:"setAudioFrameCallback",value:function(){return this._rtc.setAudioFrameCallback()}},{key:"stopAudioFrameCallback",value:function(){return this._rtc.stopAudioFrameCallback()}},{key:"setBeautyEffectOptions",value:function(e,t){return this._rtc.setBeautyEffectOptions(e,t)}},{key:"setAudioRawDataConfig",value:function(e){return this._rtc.setAudioRawDataConfig(e)}}]),r}(y);__webpack_require__(8478),__webpack_require__(3561),__webpack_require__(2049);!function(e){e[e.continue=0]="continue",e[e.exit=1]="exit"}($u||($u={}));var tl=function(e){return new Promise(function(){var t=o(v().mark((function t(r,n){var i;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e();case 3:i=t.sent,r(i),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),n(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,r){return t.apply(this,arguments)}}())},rl=function(){function e(t){a(this,e),this.__arguments=t,this.__timer=void 0,this.__running=!1}return c(e,[{key:"start",value:function(){var e=this;if(this.__running)throw new Error("Task is already running");this.__running=!0,this.__arguments.immediate?tl(this.__arguments.runnable).then((function(){e.poll()})):this.poll()}},{key:"poll",value:function(){var e=this;if(!this.__running)return this.stop();this.__timer=setTimeout(o(v().mark((function t(){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,tl(e.__arguments.runnable).catch((function(t){e.__arguments.onFail(t)===$u.exit&&(e.__running=!1)}));case 2:!e.__arguments.once&&e.poll();case 3:case"end":return t.stop()}}),t)}))),this.__arguments.interval)}},{key:"stop",value:function(){clearTimeout(this.__timer),this.__running=!1}},{key:"isStopped",get:function(){return!this.__running}}]),e}(),nl=function(){function e(t){a(this,e),this.__arguments=t,this.__timer=void 0,this.__running=!1}return c(e,[{key:"start",value:function(){var e=this;if(this.__running)throw new Error("Task is already running");this.__running=!0;var t=this.__arguments,r=t.immediate,n=t.interval;r&&this.poll(),this.__timer=setInterval((function(){e.poll()}),n)}},{key:"poll",value:function(){var e=this;if(!this.__running)return this.stop();var t=this.__arguments.runnable;tl(t).catch((function(t){e.__arguments.onFail(t)===$u.exit&&(e.__running=!1)}))}},{key:"stop",value:function(){clearInterval(this.__timer),this.__running=!1}},{key:"isStopped",get:function(){return!this.__running}}]),e}(),il=function(){function e(){a(this,e)}return c(e,null,[{key:"second",value:function(e){return this._factors.second*e}},{key:"minute",value:function(e){return this._factors.minute*e}},{key:"hour",value:function(e){return this._factors.hour*e}}]),e}();il._factors={hour:36e5,minute:6e4,second:1e3};var ol=function(){function e(){a(this,e),this._tasks=new WeakSet}return c(e,[{key:"addPollingTask",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return $u.continue},i=new rl({runnable:e,interval:t,immediate:r,onFail:n});return i.start(),this._tasks.add(i),i}},{key:"addDelayTask",value:function(e,t){var r=this,n=new rl({runnable:e,interval:t,once:!0,onFail:function(){return $u.exit},onComplete:function(){r._tasks.delete(n)}});return n.start(),this._tasks.add(n),n}},{key:"addIntervalTask",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return $u.continue},i=new nl({runnable:e,interval:t,immediate:r,onFail:n});return i.start(),this._tasks.add(i),i}}]),e}(),al=function(){return new ol},sl=al();function cl(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var ul=function(e){l(r,e);var t=cl(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r)}(y),ll=function(e){l(r,e);var t=cl(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r)}(y),hl=function(e){l(r,e);var t=cl(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r)}(y),fl=function(e){l(r,e);var t=cl(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r,null,[{key:"getRtcVersion",value:function(){return""}}]),r}(y);function dl(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var pl,gl=function(e){l(r,e);var t=dl(r);function r(e){var n;return a(this,r),(n=t.call(this)).adapter=e,n._deviceInfo=new Map,n._deviceIds=new Set,n._initializeDeviceList(),n}return c(r,[{key:"onLocalVideoTrackStateChanged",value:function(e){return this.adapter.onLocalVideoTrackStateChanged(e),0}},{key:"onLocalCameraListChanged",value:function(e){return this.on(Ju.cameraListChanged,e),0}},{key:"getVideoCameraDevices",value:function(){return this.cameraList}},{key:"cameraList",get:function(){var e=this,t=[];return this._deviceIds.forEach((function(r){var n=e._deviceInfo.get(r);n&&t.push({deviceid:n.deviceid,devicename:n.devicename})})),t}},{key:"_emitCameraListChanged",value:function(e,t,r){this.emit(Ju.cameraListChanged,e,t,r)}},{key:"_initializeDeviceList",value:function(){var e=this;this.fetchDeviceList(),this.adapter.rtcEngine.on("videoDeviceStateChanged",(function(){e.fetchDeviceList()}))}},{key:"fetchDeviceList",value:function(){var e=this,t=this.adapter.rtcEngine.getVideoDevices(),r=[];this._deviceIds.clear(),this._deviceInfo.clear(),t.forEach((function(t){e._deviceInfo.set(t.deviceid,t),e._deviceIds.add(t.deviceid),r.push(t)})),this._emitCameraListChanged(!0,r,this.cameraList)}}]),r}(ul),vl=function(e){l(r,e);var t=dl(r);function r(e){var n;return a(this,r),(n=t.call(this)).adapter=e,n._recordingDeviceInfo=new Map,n._recordingDeviceIds=new Set,n._playbackDeviceInfo=new Map,n._playbackDeviceIds=new Set,n._initializeDeviceList(),n}return c(r,[{key:"_initializeDeviceList",value:function(){var e=this;this._fetchRecordingDeviceList(),this._fetchPlaybackDeviceList(),this.adapter.rtcEngine.on("audioDeviceStateChanged",(function(){e._fetchRecordingDeviceList(),e._fetchPlaybackDeviceList()}))}},{key:"onLocalAudioPlaybackTestVolumeChanged",value:function(e){return this.adapter.onLocalAudioPlaybackTestVolumeChanged(e)}},{key:"onLocalAudioTrackStateChanged",value:function(e){return this.adapter.onLocalAudioTrackStateChanged(e)}},{key:"onLocalAudioVolume",value:function(e){return this.adapter.onLocalAudioVolume(e)}},{key:"onLocalRecordingDeviceListChanged",value:function(e){return this.on(Ju.recordingDeviceListChanged,e),0}},{key:"onLocalPlaybackDeviceListChanged",value:function(e){return this.on(Ju.playbackDeviceListChanged,e),0}},{key:"getAudioPlaybackDevices",value:function(){return this.speakerList}},{key:"getAudioRecordingDevices",value:function(){return this.microphoneList}},{key:"microphoneList",get:function(){var e=this,t=[];return this._recordingDeviceIds.forEach((function(r){var n=e._recordingDeviceInfo.get(r);n&&t.push({deviceid:n.deviceid,devicename:n.devicename})})),t}},{key:"speakerList",get:function(){var e=this,t=[];return this._playbackDeviceIds.forEach((function(r){var n=e._playbackDeviceInfo.get(r);n&&t.push({deviceid:n.deviceid,devicename:n.devicename})})),t}},{key:"_emitPlaybackListChanged",value:function(e,t,r){this.emit(Ju.playbackDeviceListChanged,e,t,r)}},{key:"_emitRecordingListChanged",value:function(e,t,r){this.emit(Ju.recordingDeviceListChanged,e,t,r)}},{key:"_fetchPlaybackDeviceList",value:function(){var e=this,t=this.adapter.rtcEngine.getAudioPlaybackDevices(),r=[];this._playbackDeviceInfo.clear(),this._playbackDeviceIds.clear(),t.forEach((function(t){e._playbackDeviceInfo.set(t.deviceid,t),e._playbackDeviceIds.add(t.deviceid),r.push(t)})),this._emitPlaybackListChanged(!0,r,this.speakerList)}},{key:"_fetchRecordingDeviceList",value:function(){var e=this,t=this.adapter.rtcEngine.getAudioRecordingDevices(),r=[];this._recordingDeviceInfo.clear(),this._recordingDeviceIds.clear(),t.forEach((function(t){e._recordingDeviceInfo.set(t.deviceid,t),e._recordingDeviceIds.add(t.deviceid),r.push(t)})),this._emitRecordingListChanged(!0,r,this.microphoneList)}},{key:"onAudioFrame",value:function(e){return 0}}]),r}(ll),Al=(__webpack_require__(5827),function(){function e(){a(this,e),this.quality=Au.good,this.qualities=[]}return c(e,[{key:"_updateQualities",value:function(t){this.qualities.push(t),this.qualities.length>e.MAX_QUALITY_NUMBER&&this.qualities.shift()}},{key:"_resetQualities",value:function(){this.qualities=[]}},{key:"toAGQuality",value:function(t){return void 0===t?this.quality:0===t||8===t||7===t?(this._resetQualities(),this.quality):6===t?(this._resetQualities(),this.quality=Au.down,this.quality):(this._updateQualities(t),this.qualities.length<e.MAX_QUALITY_NUMBER||(this.qualities.reduce((function(e,t){return e+t}))>=e.QUALITY_THRESHOLD?this.quality=Au.bad:this.quality=Au.good),this.quality)}}]),e}());Al.MAX_QUALITY_NUMBER=3,Al.QUALITY_THRESHOLD=10;var ml=Zn.attach({proxyMethods:!1})(pl=function(){function e(){a(this,e),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 Al,this._uplinkNetworkQualityClacInstance=new Al}return c(e,[{key:"networkStats",value:function(){var e={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 e}}]),e}())||pl;function yl(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var _l,bl=function(e){l(n,e);var t,r=yl(n);function n(){var e;a(this,n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=r.call.apply(r,[this].concat(i))).logger=void 0,e.running=!1,e.runnable=!0,e}return c(n,[{key:"run",value:function(){var e=this;if(!this.running&&this.runnable){this.running=!0;var t=setTimeout(o(v().mark((function r(){return v().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return clearTimeout(t),r.next=3,e.onExecution();case 3:e.running=!1;case 4:case"end":return r.stop()}}),r)}))),0)}}},{key:"onExecution",value:(t=o(v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"stop",value:function(){this.running=!1}}]),n}(y);function El(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var wl,Il,Cl,Sl=Zn.attach({proxyMethods:!1})(_l=function(e){l(n,e);var t,r=El(n);function n(e){var t;return a(this,n),(t=r.call(this)).logger=void 0,t.canvas=void 0,t.trackState=yu.stopped,t.cameraEnable=!1,t._rtcEngine=void 0,t.currentCanvas=void 0,t.videoStreamState=0,t._rtcEngine=e.rtcEngine,t}return c(n,[{key:"setCameraTrackState",value:function(e,t){this.trackState!==e&&(this.trackState=e,this.emit(Ju.trackStateChanged,e,tu.Camera,t))}},{key:"onExecution",value:(t=o(v().mark((function e(){var t,r=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.debug("thread notify start..."),!this.cameraEnable){e.next=17;break}if(0!==(t=this.videoStreamState)&&3!==t){e.next=10;break}return e.delegateYield(v().mark((function e(){var n;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.logger.debug("starting camera..."),r.setCameraTrackState(yu.starting),n=void 0,e.prev=3,0!==t){e.next=7;break}return e.next=7,new Promise((function(e){n=function(t){1!==t&&2!==t||e()},r._rtcEngine.on("localVideoStateChanged",n),r._rtcEngine.enableLocalVideo(!0);var t=Qn.shared.rtcConfigs.defaultCameraEncoderConfigurations,i=t?{width:t.width,height:t.height,frameRate:t.frameRate,bitrate:t.bitrate,minFrameRate:0,orientationMode:0,minBitrate:0,mirrorMode:0,degradationPreference:1}:void 0;i&&(r._rtcEngine.setVideoEncoderConfiguration(i),r._rtcEngine.setVideoRenderFPS(i.frameRate))}));case 7:r.setCameraTrackState(yu.started),n&&r._rtcEngine.off("localVideoStateChanged",n),r.logger.debug("camera started."),e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(3),r.setCameraTrackState(yu.error),n&&r._rtcEngine.off("localVideoStateChanged",n),e.abrupt("return","break");case 17:case"end":return e.stop()}}),e,null,[[3,12]])}))(),"t0",5);case 5:if("break"!==e.t0){e.next=8;break}return e.abrupt("break",23);case 8:e.next=11;break;case 10:this.trackState!==yu.started&&this.setCameraTrackState(yu.started);case 11:if(this.trackState!==yu.started){e.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,e.abrupt("break",23);case 15:e.next=20;break;case 17:if(this.trackState!==yu.stopped&&(this.logger.debug("stopping camera..."),this._rtcEngine.enableLocalVideo(!1),this.currentCanvas&&this.currentCanvas.view,this.setCameraTrackState(yu.stopped),this.logger.debug("camera stopped")),this.trackState!==yu.stopped){e.next=20;break}return e.abrupt("break",23);case 20:return e.next=22,new Promise((function(e){return setTimeout(e,500)}));case 22:if(this.running){e.next=0;break}case 23:this.logger.debug("thread sleep...");case 24:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),n}(bl))||_l;function Tl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rl(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var kl=c((function e(){a(this,e)}));try{kl=__webpack_require__(5455).default}catch(e){Qn.platform===Nn.Electron&&yn.warn("load electron sdk failed: ".concat(e))}var Ol=Zn.attach({proxyMethods:!1})((Il=function(e){l(r,e);var t=Rl(r);function r(){var e;a(this,r),(e=t.call(this)).logger=void 0,e._vdm=void 0,e._adm=void 0,e._engine=void 0,e._channels=new Map,e._configs={},e._screenEventBus=new y,e.cameraThread=void 0,e._localVideoEnabled=!1,e._localAudioEnabled=!1,e.screenShareId=void 0,e.screenShareType=void 0,r.rtcEngine||(r.rtcEngine=new kl),e._engine=r.rtcEngine;var n=r.logPath,i=0;if(n){yn.info("[RtcAdapterElectron] sdk log path: ".concat(n));window.require("path");i=e.rtcEngine.initialize(Qn.shared.appId,e._region,{filePath:n,fileSize:1024,level:1})}else yn.warn("[RtcAdapterElectron] no log path found, sdk logs will be put in default folder"),i=e.rtcEngine.initialize(Qn.shared.appId,e._region);return 0!==i&&jn.shared.handleThrowableError(kn.RTC_ERR_RTC_ENGINE_INITIALZIE_FAILED,new Error("rtc engine initialize failed ".concat(i))),Qn.shared.rtcSDKParameters&&Qn.shared.rtcSDKParameters.forEach((function(t){e.rtcEngine.setParameters(JSON.stringify(t))})),e._adm=new vl(f(e)),e._vdm=new gl(f(e)),e.cameraThread=new Sl(f(e)),e._addEventListeners(),e}return c(r,[{key:"configs",get:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tl(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},this._configs)}},{key:"rtcEngine",get:function(){return this._engine}},{key:"createRtcChannel",value:function(e,t){var r=this._channels.get(e);return r||(r=new Nl(e,this.configs,t),this._channels.set(e,r)),r}},{key:"getVideoDeviceManager",value:function(){return this._vdm}},{key:"getAudioDeviceManager",value:function(){return this._adm}},{key:"getWindowDevices",value:function(){return this.rtcEngine.getScreenWindowsInfo().map((function(e){return{id:e.windowId,type:Eu.Window,title:e.name||e.ownerName,image:e.image,isCurrent:"".concat(e.processId)===window.main_pid}}))}},{key:"getDiaplayDevices",value:function(){return this.rtcEngine.getScreenDisplaysInfo().map((function(e){return{id:e.displayId,type:Eu.Screen,title:"Display",image:e.image}}))}},{key:"isScreenDeviceEnumerateSupported",value:function(){return!0}},{key:"setVideoCameraDevice",value:function(e){return this.rtcEngine.setVideoDevice(e)}},{key:"setAudioRecordingDevice",value:function(e){return this.rtcEngine.setAudioRecordingDevice(e)}},{key:"setAudioPlaybackDevice",value:function(e){return this.rtcEngine.setAudioPlaybackDevice(e)}},{key:"enableLocalVideo",value:function(e){return this._localVideoEnabled=e,this.updateRole(),this.cameraThread.cameraEnable=e,this.cameraThread.run(),0}},{key:"enableLocalAudio",value:function(e){return this._localAudioEnabled=e,this.updateRole(),this.rtcEngine.enableLocalAudio(e)}},{key:"setupLocalVideo",value:function(e,t){return t===tu.Camera?(this.cameraThread.canvas=e,this.cameraThread.run()):t===tu.ScreenShare&&this.rtcEngine.setupLocalVideoSource(e.view),0}},{key:"setupRemoteVideo",value:function(e){return this.rtcEngine.setupRemoteVideo(+e.streamUuid,e.view),this.rtcEngine.setupViewContentMode(+e.streamUuid,e.renderMode===wu.fill?0:1,void 0),0}},{key:"startAudioRecordingDeviceTest",value:function(e){return this.rtcEngine.startAudioRecordingDeviceTest(e)}},{key:"stopAudioRecordingDeviceTest",value:function(){return this.rtcEngine.stopAudioRecordingDeviceTest()}},{key:"startAudioPlaybackDeviceTest",value:function(e){return this.rtcEngine.startAudioPlaybackDeviceTest(e)}},{key:"stopAudioPlaybackDeviceTest",value:function(){return this.rtcEngine.stopAudioPlaybackDeviceTest()}},{key:"startScreenCapture",value:function(e,t){return this.rtcEngine.videoSourceInitialize(Qn.shared.appId),void 0!==e&&(this.screenShareId=e,this.screenShareType=t,this._screenEventBus.emit(Ju.trackStateChanged,yu.started,tu.ScreenShare)),0}},{key:"stopScreenCapture",value:function(){return this.screenShareId=void 0,this.screenShareType=void 0,this.rtcEngine.stopScreenCapture2(),this._screenEventBus.emit(Ju.trackStateChanged,yu.stopped,tu.ScreenShare),0}},{key:"onLocalAudioPlaybackTestVolumeChanged",value:function(e){return this.on(Ju.localAudioPlaybackVolumeIndicator,e),0}},{key:"onLocalVideoTrackStateChanged",value:function(e){return this.cameraThread.on(Ju.trackStateChanged,e),0}},{key:"onLocalAudioTrackStateChanged",value:function(e){return this.on(Ju.localAudioTrackChanged,e),0}},{key:"onLocalAudioVolume",value:function(e){return this.on(Ju.localAudioVolume,e),0}},{key:"onLocalScreenShareTrackStateChanged",value:function(e){return this._screenEventBus.on(Ju.trackStateChanged,e),0}},{key:"onAudioFrame",value:function(e){return this.logger.warn("electron platform does not support this for now"),0}},{key:"setBeautyEffectOptions",value:function(e,t){return this.rtcEngine.setBeautyEffectOptions(e,t)}},{key:"setAudioFrameCallback",value:function(){return this.logger.warn("electron platform does not support this for now"),0}},{key:"stopAudioFrameCallback",value:function(){return this.logger.warn("electron platform does not support this for now"),0}},{key:"setAudioRawDataConfig",value:function(e){return this.logger.warn("electron platform does not support this for now"),0}},{key:"hasScreenSharePermission",value:function(){return!r.remote||"denied"!==r.remote.systemPreferences.getMediaAccessStatus("screen")}},{key:"destroy",value:function(){var e=this.rtcEngine.release();return r.rtcEngine=void 0,e}},{key:"_region",get:function(){switch(Qn.shared.rtcRegion){case Ln.AREA_GLOBAL:return 4294967295;case Ln.AREA_CN:return 1;case Ln.AREA_NA:return 2;case Ln.AREA_EUR:return 4;case Ln.AREA_AS:return 8;case Ln.AREA_JAPAN:return 16;case Ln.AREA_INDIA:return 32}}},{key:"_addEventListeners",value:function(){var e=this;this.rtcEngine.on("localVideoStateChanged",(function(t,r){e.logger.info("[rtc] video state changed ".concat(t," ").concat(r)),e.cameraThread.videoStreamState=t})),this.rtcEngine.on("localAudioStateChanged",(function(t){0===t&&e.emit(Ju.localAudioTrackChanged,yu.stopped,ru.Mic),2!==t&&1!==t||e.emit(Ju.localAudioTrackChanged,yu.started,ru.Mic)})),this.rtcEngine.on("groupAudioVolumeIndication",(function(t){var r=t.find((function(e){return 0===e.uid})),n=t.find((function(e){return 1===e.uid}));r&&e.emit(Ju.localAudioVolume,r.volume/255),n&&e.emit(Ju.localAudioPlaybackVolumeIndicator,n.volume/255)}))}},{key:"updateRole",value:function(){this._localVideoEnabled||this._localAudioEnabled?(this.logger.info("update rtc role to host"),this.rtcEngine.setClientRole(1)):(this.logger.info("update rtc role to audience"),this.rtcEngine.setClientRole(2))}}],[{key:"remote",get:function(){var e=window.require("electron").remote;if(e)return e;yn.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:"getRtcVersion",value:function(){if(!this.version){var e=this.rtcEngine;e||(e=new kl),this.version=e.getVersion(),this.rtcEngine||e.release()}var t=this.version,r=t.version,n=t.build;return"".concat(r,".").concat(n)}},{key:"logBasePath",get:function(){if(r.remote)return r.remote.app.getPath("logs")}},{key:"logFolderPath",get:function(){if(this.logBasePath)return window.require("path").resolve(this.logBasePath,"logs")}},{key:"logPath",get:function(){var e=this.logFolderPath;if(e)return window.require("path").resolve(e,"sdk.log")}}]),r}(fl),Il.rtcEngine=void 0,Il.version=void 0,wl=Il))||wl,Nl=Zn.attach({proxyMethods:!1})(Cl=function(e){l(r,e);var t=Rl(r);function r(e,n,i){var o;return a(this,r),(o=t.call(this)).logger=void 0,o.channelName=void 0,o.base=void 0,o._networkStats=new ml,o.channelName=e,o.base=i,sl.addPollingTask((function(){o.emit(bc.NetworkStats,o._networkStats.networkStats())}),il.second(2)),o._addEventListeners(),o}return c(r,[{key:"_channelProfile",get:function(){var e;return null!==(e=Qn.shared.rtcConfigs.channelProfile)&&void 0!==e?e:qu.LiveBroadcasting}},{key:"getSessionId",value:function(){return this.base.rtcEngine.getCallId()}},{key:"enableDualStream",value:function(e){return 0===this.base.rtcEngine.enableDualStreamMode(e)?Promise.resolve():Promise.reject()}},{key:"setLowStreamParameter",value:function(e){return 0}},{key:"setRemoteVideoStreamType",value:function(e,t){return 0===this.base.rtcEngine.setRemoteVideoStreamType(+e,t)?Promise.resolve():Promise.reject()}},{key:"onConnectionStateChanged",value:function(e){return this.on(bc.RtcConnectionStateChanged,e),0}},{key:"leave",value:function(e){return(null!=e?e:lu.main)===lu.main?this.base.rtcEngine.leaveChannel():this.base.rtcEngine.videoSourceLeave(),Promise.resolve()}},{key:"setChannelProfile",value:function(e){return this.base.rtcEngine.setChannelProfile(e===qu.Communication?0:1)}},{key:"setClientRole",value:function(e){return this.base.rtcEngine.setClientRole(e===Gu.Host?1:2)}},{key:"onNetworkStats",value:function(e){return this.on(bc.NetworkStats,e),0}},{key:"onAudioVolumeIndication",value:function(e){return this.on(bc.AudioVolumes,e),0}},{key:"muteRemoteVideo",value:function(e,t){return this.base.rtcEngine.muteRemoteVideoStream(+e,t)}},{key:"muteRemoteAudio",value:function(e,t){return this.base.rtcEngine.muteRemoteAudioStream(+e,t)}},{key:"_startScreenCapture",value:function(){var e=this.base.screenShareType,t=this.base.screenShareId;void 0!==t&&void 0!==e&&(e===Eu.Screen?this.base.rtcEngine.videoSourceStartScreenCaptureByScreen(t,{width:0,height:0,x:0,y:0},{width:0,height:0,frameRate:10,captureMouseCursor:!0,windowFocus:!0,bitrate:0,excludeWindowCount:0,excludeWindowList:[]}):e===Eu.Window&&this.base.rtcEngine.videoSourceStartScreenCaptureByWindow(t,{width:0,height:0,x:0,y:0},{width:0,height:0,frameRate:10,captureMouseCursor:!0,windowFocus:!0,bitrate:0,excludeWindowCount:0,excludeWindowList:[]}))}},{key:"join",value:function(e,t,r){var n=this;return new Promise((function(i,o){var a=n.base.rtcEngine;if(r===lu.main)a.once("joinedChannel",(function(){i()})),a.setChannelProfile(n._channelProfile),a.enableAudioVolumeIndication(500,3),a.joinChannel(e,n.channelName,"",+t);else if(r===lu.sub){a.once("videoSourceJoinedSuccess",(function(){n._startScreenCapture(),i()})),a.videoSourceSetChannelProfile(n._channelProfile);var s=a.videoSourceJoin(e,n.channelName,"",+t);n.logger.info("[rtc] videosource join ".concat(s))}}))}},{key:"muteLocalVideo",value:function(e,t){return this.base.rtcEngine.muteLocalVideoStream(e)}},{key:"muteLocalAudio",value:function(e,t){return this.base.rtcEngine.muteLocalAudioStream(e)}},{key:"muteLocalScreenShare",value:function(e,t){return 0}},{key:"_getRtcState",value:function(e){switch(e){case 1:case 5:return _u.Idle;case 2:return _u.Connecting;case 3:return _u.Connected;case 4:return _u.Reconnecting}}},{key:"_addEventListeners",value:function(){var e=this,t=this.base.rtcEngine;t.on("networkQuality",(function(t,r,n){0===t&&(e._networkStats.downlinkNetworkQuality=n,e._networkStats.uplinkNetworkQuality=r)})),t.on("rtcStats",(function(t){var r=t.txPacketLossRate,n=t.rxPacketLossRate,i=t.cpuAppUsage,o=t.cpuTotalUsage,a=t.lastmileDelay,s=t.gatewayRtt;e._networkStats.txVideoPacketLoss=r/100,e._networkStats.rxVideoPacketLoss=n/100,e._networkStats.rtt=s,e._networkStats.end2EndDelay=a,e._networkStats.cpu=i/100,e._networkStats.cpuTotal=o/100})),t.on("groupAudioVolumeIndication",(function(t){var r=new Map;t.forEach((function(e){return r.set(""+e.uid,e.volume)})),e.emit(bc.AudioVolumes,r)})),t.on("connectionStateChanged",(function(t){e.emit(bc.RtcConnectionStateChanged,e._getRtcState(t))})),t.on("videoSourceJoinedSuccess",(function(){e.emit(bc.RtcConnectionStateChanged,_u.Connected,lu.sub)})),t.on("videoSourceLeaveChannel",(function(){e.emit(bc.RtcConnectionStateChanged,_u.Idle,lu.sub)}))}}]),r}(hl))||Cl,xl=__webpack_require__(5904),Dl=__webpack_require__.n(xl);function Ll(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Pl,Bl,Ml,jl,Ul,Fl,Ql=function(){function e(t,r,n,i,o){a(this,e),this.streamUuid=void 0,this.channelName=void 0,this.view=void 0,this.mirror=!1,this.renderMode=wu.fill,this.streamUuid=t,this.channelName=r,this.view=n,this.mirror=i,o&&void 0!==o.renderMode&&(this.renderMode=o.renderMode)}return c(e,null,[{key:"key",value:function(e,t){return"".concat(e,"-").concat(t)}}]),e}(),ql=function(e){l(r,e);var t=Ll(r);function r(e,n){return a(this,r),t.call(this,"0","",e,n)}return c(r)}(Ql);function Gl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gl(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Kl(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Hl=function(e){l(r,e);var t=Kl(r);function r(){var e;a(this,r);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).track=void 0,e}return c(r)}(bl),zl=Zn.attach({proxyMethods:!1})(Pl=function(e){l(n,e);var t,r=Kl(n);function n(){var e;a(this,n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=r.call.apply(r,[this].concat(i))).canvas=void 0,e.trackState=yu.stopped,e.cameraEnable=!1,e._deviceId=void 0,e._deviceChanged=!1,e}return c(n,[{key:"setCameraTrackState",value:function(e,t){this.trackState!==e&&(this.trackState=e,this.emit(Ju.trackStateChanged,e,tu.Camera,t))}},{key:"setDevice",value:function(e){this._deviceId=e,this._deviceChanged=!0}},{key:"onExecution",value:(t=o(v().mark((function e(){var t,r,n,i=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.debug("thread notify start...");case 1:if(!this.cameraEnable){e.next=40;break}if(!this._deviceChanged){e.next=15;break}if(!this.track){e.next=14;break}if(e.prev=4,!this._deviceId){e.next=8;break}return e.next=8,this.track.setDevice(this._deviceId);case 8:e.next=14;break;case 10:return e.prev=10,e.t0=e.catch(4),jn.shared.handleNonThrowableError(kn.RTC_ERR_CAM_ERR,e.t0),e.abrupt("break",46);case 14:this._deviceChanged=!1;case 15:if(this.track){e.next=35;break}return this.logger.debug("starting camera..."),this.setCameraTrackState(yu.starting),e.prev=18,t=Qn.shared.rtcConfigs,r=t.defaultCameraEncoderConfigurations,n=r?{width:r.width,height:r.height,frameRate:r.frameRate,bitrateMax:r.bitrate}:void 0,e.next=24,Dl().createCameraVideoTrack({cameraId:this._deviceId,encoderConfig:n});case 24:this.track=e.sent,this.track.on("track-ended",(function(){var e;i.logger.warn("camera track ended"),null===(e=i.track)||void 0===e||e.close(),i.track=void 0,i.setCameraTrackState(yu.stopped)})),this.setCameraTrackState(yu.started),e.next=34;break;case 29:return e.prev=29,e.t1=e.catch(18),jn.shared.handleNonThrowableError(kn.RTC_ERR_CAM_ERR,e.t1),this.setCameraTrackState(yu.error),e.abrupt("break",46);case 34:this.logger.debug("camera started.");case 35:if(this.track&&this.canvas&&this.canvas.view&&(this.track.play(this.canvas.view),this.setCameraTrackState(yu.started)),!this.track||!(this.canvas&&this.canvas.view&&this.track.isPlaying)&&this.canvas&&this.canvas.view){e.next=38;break}return e.abrupt("break",46);case 38:e.next=43;break;case 40:if(this.track&&(this.logger.debug("stopping camera..."),this.track.stop(),this.track.close(),this.track=void 0,this.setCameraTrackState(yu.stopped),this.logger.debug("camera stopped")),this.track){e.next=43;break}return e.abrupt("break",46);case 43:return e.next=45,new Promise((function(e){return setTimeout(e,500)}));case 45:if(this.running){e.next=1;break}case 46:this.logger.debug("thread sleep...");case 47:case"end":return e.stop()}}),e,this,[[4,10],[18,29]])}))),function(){return t.apply(this,arguments)})}]),n}(Hl))||Pl,Wl=Zn.attach({proxyMethods:!1})(Bl=function(e){l(n,e);var t,r=Kl(n);function n(){var e;a(this,n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=r.call.apply(r,[this].concat(i))).micEnable=!1,e._recordingDeviceId=void 0,e._recordingDeviceChanged=!1,e.trackState=yu.stopped,e._volumePollingTask=void 0,e._audioRawConfig={frameSize:1024},e}return c(n,[{key:"setMicTrackState",value:function(e,t){var r,n=this;this.trackState!==e&&(this.trackState=e,this.emit(Ju.trackStateChanged,e,ru.Mic,t),e===yu.started?this._volumePollingTask||(this._volumePollingTask=sl.addPollingTask((function(){if(n.track){var e=n.track.getVolumeLevel();e=Math.min(3*e,1),n.emit(Ju.localAudioVolume,e)}}),il.second(.5))):(null===(r=this._volumePollingTask)||void 0===r||r.stop(),this._volumePollingTask=void 0))}},{key:"setRecordingDevice",value:function(e){this._recordingDeviceId=e,this._recordingDeviceChanged=!0}},{key:"setAudioRawDataConfig",value:function(e){this._audioRawConfig=Vl(Vl({},this._audioRawConfig),e)}},{key:"setAudioFrameCallback",value:function(){var e=this;this.track&&this.track.setAudioFrameCallback((function(t){e.logger.info("setAudioFrameCallback start..."),e.emit(Ju.localAudioFrame,t)}),this._audioRawConfig.frameSize)}},{key:"stopAudioFrameCallback",value:function(){this.logger.info("stopAudioFrameCallback"),this.track&&this.track.setAudioFrameCallback(null)}},{key:"onExecution",value:(t=o(v().mark((function e(){var t=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.info("thread notify start...");case 1:if(!this.micEnable){e.next=37;break}if(!this._recordingDeviceChanged){e.next=16;break}if(!this.track){e.next=15;break}if(e.prev=4,!this._recordingDeviceId){e.next=8;break}return e.next=8,this.track.setDevice(this._recordingDeviceId);case 8:e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(4),jn.shared.handleNonThrowableError(kn.RTC_ERR_MIC_ERR,e.t0),this.setMicTrackState(yu.error),e.abrupt("break",43);case 15:this._recordingDeviceChanged=!1;case 16:if(this.track){e.next=33;break}return this.logger.debug("starting mic..."),this.setMicTrackState(yu.starting),e.prev=19,e.next=22,Dl().createMicrophoneAudioTrack({microphoneId:this._recordingDeviceId});case 22:this.track=e.sent,this.track.on("track-ended",(function(){var e;t.logger.warn("mic track ended"),null===(e=t.track)||void 0===e||e.close(),t.track=void 0,t.setMicTrackState(yu.stopped)})),this.setMicTrackState(yu.started),e.next=32;break;case 27:return e.prev=27,e.t1=e.catch(19),jn.shared.handleNonThrowableError(kn.RTC_ERR_MIC_ERR,e.t1),this.setMicTrackState(yu.error),e.abrupt("break",43);case 32:this.logger.debug("mic started.");case 33:if(!this.track){e.next=35;break}return e.abrupt("break",43);case 35:e.next=40;break;case 37:if(this.track&&(this.track.stop(),this.track.close(),this.track=void 0,this.setMicTrackState(yu.stopped)),this.track){e.next=40;break}return e.abrupt("break",43);case 40:return e.next=42,new Promise((function(e){return setTimeout(e,500)}));case 42:if(this.running){e.next=1;break}case 43:this.logger.debug("thread sleep...");case 44:case"end":return e.stop()}}),e,this,[[4,10],[19,27]])}))),function(){return t.apply(this,arguments)})}]),n}(Hl))||Bl,Yl=Zn.attach({proxyMethods:!1})(Ml=function(e){l(n,e);var t,r=Kl(n);function n(){var e;a(this,n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=r.call.apply(r,[this].concat(i))).canvas=void 0,e.audioTrack=void 0,e.withAudio=!1,e.screenEnable=!1,e.trackState=yu.stopped,e}return c(n,[{key:"playing",get:function(){return this.track&&this.track.isPlaying&&(!this.audioTrack||this.audioTrack&&this.audioTrack.isPlaying)}},{key:"setScreenShareTrackState",value:function(e,t){this.trackState!==e&&(this.trackState=e,this.emit(Ju.trackStateChanged,e,tu.ScreenShare,t))}},{key:"onExecution",value:(t=o(v().mark((function e(){var t,r,n,i,o=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.debug("thread notify start...");case 1:if(!this.screenEnable){e.next=37;break}if(this.track){e.next=32;break}if(this.logger.debug("starting screenshare..."),this.setScreenShareTrackState(yu.starting),e.prev=5,t=Qn.shared.rtcConfigs,r=t.defaultScreenEncoderConfigurations,n=r?{width:r.width,height:r.height,frameRate:r.frameRate,bitrateMax:r.bitrate}:void 0,!this.withAudio){e.next=17;break}return e.next=12,Dl().createScreenVideoTrack({encoderConfig:n},"enable");case 12:i=e.sent,this.track=i[0],this.audioTrack=i[1],e.next=20;break;case 17:return e.next=19,Dl().createScreenVideoTrack({encoderConfig:n},"disable");case 19:this.track=e.sent;case 20:this.track.on("track-ended",(function(){var e;o.logger.warn("camera track ended"),null===(e=o.track)||void 0===e||e.close(),o.track=void 0,o.setScreenShareTrackState(yu.stopped)})),this.setScreenShareTrackState(yu.started),e.next=31;break;case 24:if(e.prev=24,e.t0=e.catch(5),"PERMISSION_DENIED"!==e.t0.code||/system/.test(e.t0.message)){e.next=28;break}return e.abrupt("break",44);case 28:return this.setScreenShareTrackState(yu.error,"PERMISSION_DENIED"===e.t0.code?mu.PermissionDenied:mu.Unknown),jn.shared.handleNonThrowableError(kn.RTC_ERR_SCREEN_SHARE_ERR,e.t0),e.abrupt("break",44);case 31:this.logger.debug("screenshare started.");case 32:if(this.track&&this.canvas&&this.canvas.view&&this.track.play(this.canvas.view),!(!this.canvas||this.canvas&&this.playing)){e.next=35;break}return e.abrupt("break",44);case 35:e.next=41;break;case 37:if(this.track&&(this.logger.debug("stopping screenshare..."),this.track.stop(),this.track.close(),this.track=void 0,this.logger.debug("screenshare stopped"),this.setScreenShareTrackState(yu.stopped)),this.audioTrack&&(this.logger.debug("stopping screenshare audio..."),this.audioTrack.stop(),this.audioTrack.close(),this.audioTrack=void 0,this.logger.debug("screenshare audio stopped")),this.track||this.audioTrack){e.next=41;break}return e.abrupt("break",44);case 41:return e.next=43,new Promise((function(e){return setTimeout(e,500)}));case 43:if(this.running){e.next=1;break}case 44:this.logger.debug("thread sleep...");case 45:case"end":return e.stop()}}),e,this,[[5,24]])}))),function(){return t.apply(this,arguments)})}]),n}(Hl))||Ml,Jl=Zn.attach({proxyMethods:!1})((Ul=function(e){l(n,e);var t,r=Kl(n);function n(e){var t;return a(this,n),(t=r.call(this))._client=void 0,t.mute=!1,t._trackThread=void 0,t._client=e,t}return c(n,[{key:"track",get:function(){var e;return null===(e=this._trackThread)||void 0===e?void 0:e.track}},{key:"setTrackThread",value:function(e){var t;null===(t=this._trackThread)||void 0===t||t.off(Ju.trackStateChanged,this.handleTrackStateChanged),this._trackThread=e,e.on(Ju.trackStateChanged,this.handleTrackStateChanged)}},{key:"handleTrackStateChanged",value:function(e){e===yu.started&&this.run()}},{key:"isTrackPublished",value:function(e){return void 0!==this._client.localTracks.find((function(t){return t===e}))}},{key:"onExecution",value:(t=o(v().mark((function e(){var t,r,n=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.debug("thread notify start..."),t=0;case 2:if(this.mute){e.next=25;break}if(!this.track||this.isTrackPublished(this.track)){e.next=21;break}return this.logger.debug("publishing..."),e.prev=5,e.next=8,this._client.setClientRole("host");case 8:if(!(r=this._client.localTracks.find((function(e){var t,r;return e.trackMediaType===(null===(t=n._trackThread)||void 0===t||null===(r=t.track)||void 0===r?void 0:r.trackMediaType)})))){e.next=13;break}return this.logger.warn("unpublishing old ".concat(r.trackMediaType," track...")),e.next=13,this._client.unpublish(r);case 13:return e.next=15,this._client.publish(this.track);case 15:this.logger.debug("published."),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(5),jn.shared.handleNonThrowableError(kn.RTC_ERR_TRACK_PUBLISH_FAIL,e.t0);case 21:if(!this.track||!this.isTrackPublished(this.track)){e.next=23;break}return e.abrupt("break",48);case 23:e.next=43;break;case 25:if(!this.track||!this.isTrackPublished(this.track)){e.next=41;break}return this.logger.debug("unpublishing..."),e.prev=27,e.next=30,this._client.unpublish(this.track);case 30:if(0!==this._client.localTracks.length){e.next=33;break}return e.next=33,this._client.setClientRole("audience");case 33:e.next=40;break;case 35:return e.prev=35,e.t1=e.catch(27),jn.shared.handleNonThrowableError(kn.RTC_ERR_TRACK_UNPUBLISH_FAIL,e.t1),this.emit("trackUnpublishErr",e.t1),e.abrupt("break",48);case 40:this.logger.debug("unpublished.");case 41:if(!this.track||this.isTrackPublished(this.track)){e.next=43;break}return e.abrupt("break",48);case 43:return e.next=45,new Promise((function(e){return setTimeout(e,500)}));case 45:++t%10==0&&this.logger.debug("thread running...");case 47:if(this.running){e.next=2;break}case 48:this.logger.debug("thread sleep...");case 49:case"end":return e.stop()}}),e,this,[[5,18],[27,35]])}))),function(){return t.apply(this,arguments)})}]),n}(bl),eu(Ul.prototype,"handleTrackStateChanged",[su],Object.getOwnPropertyDescriptor(Ul.prototype,"handleTrackStateChanged"),Ul.prototype),jl=Ul))||jl,Xl=Zn.attach({proxyMethods:!1})(Fl=function(e){l(n,e);var t,r=Kl(n);function n(e,t,i){var o,s=i.channelName,c=i.muteMap,u=i.canvasMap,l=i.mediaType;return a(this,n),(o=r.call(this))._client=void 0,o._user=void 0,o._channelName=void 0,o._muteMap=void 0,o._canvasMap=void 0,o._mediaType=void 0,o._volumePollingTask=void 0,o._client=e,o._user=t,o._muteMap=c,o._mediaType=l,o._canvasMap=u,o._channelName=s,o}return c(n,[{key:"mute",get:function(){return!!this._muteMap.has(this.streamUuid)&&this._muteMap.get(this.streamUuid)}},{key:"streamUuid",get:function(){return"".concat(this._user.uid)}},{key:"canvas",get:function(){if("audio"!==this._mediaType&&this._canvasMap){var e=Ql.key(this.streamUuid,this._channelName);return this._canvasMap.get(e)}}},{key:"isTrackSubscribed",value:function(){return"video"===this._mediaType?!!this._user.videoTrack:!!this._user.audioTrack}},{key:"track",get:function(){return"video"===this._mediaType?this._user.videoTrack:this._user.audioTrack}},{key:"onExecution",value:(t=o(v().mark((function e(){var t,r=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.debug("thread notify start..."),t=0;case 2:if(this.mute){e.next=19;break}if(this.isTrackSubscribed()){e.next=14;break}return this.logger.debug("[".concat(this._user.uid,"] subscribing ").concat(this._mediaType,"...")),e.prev=5,e.next=8,this._client.subscribe(this._user,this._mediaType);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),jn.shared.handleNonThrowableError(kn.RTC_ERR_TRACK_SUBSCRIBE_FAIL,e.t0);case 13:this.logger.debug("[".concat(this._user.uid,"] subscribed."));case 14:if("video"===this._mediaType?this.track&&this.canvas&&this.canvas.view&&this.track.play(this.canvas.view,{fit:this.canvas.renderMode===wu.fill?"cover":"contain"}):this.track&&(this._volumePollingTask||(this._volumePollingTask=sl.addPollingTask((function(){var e=r.track.getVolumeLevel();e=Math.min(3*e,1),r.emit("audio-volume-indication",e)}),il.second(.5))),this.track.play()),!this.isTrackSubscribed()){e.next=17;break}return e.abrupt("break",40);case 17:e.next=35;break;case 19:if(!this.isTrackSubscribed()){e.next=32;break}return this.logger.debug("[".concat(this._user.uid,"] unpublishing...")),e.prev=21,e.next=24,this._client.unsubscribe(this._user,this._mediaType);case 24:e.next=31;break;case 26:return e.prev=26,e.t1=e.catch(21),jn.shared.handleNonThrowableError(kn.RTC_ERR_TRACK_UNSUBSCRIBE_FAIL,e.t1),this.emit("trackPublishErr",e.t1),e.abrupt("break",40);case 31:this.logger.debug("[".concat(this._user.uid,"] unpublished."));case 32:if(this.track&&(this.logger.debug("[".concat(this._user.uid,"] stopping track...")),this.track.stop(),this._volumePollingTask&&this._volumePollingTask.stop(),this.logger.debug("[".concat(this._user.uid,"] track stopped"))),this.isTrackSubscribed()){e.next=35;break}return e.abrupt("break",40);case 35:return e.next=37,new Promise((function(e){return setTimeout(e,500)}));case 37:++t%10==0&&this.logger.info("thread running...");case 39:if(this.running){e.next=2;break}case 40:this.logger.info("thread sleep...");case 41:case"end":return e.stop()}}),e,this,[[5,10],[21,26]])}))),function(){return t.apply(this,arguments)})}]),n}(bl))||Fl;function Zl(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}function $l(){return $l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Zl(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},$l.apply(this,arguments)}__webpack_require__(2479);var eh,th,rh,nh=Zn.attach({proxyMethods:!1})(eh=function(){function e(){a(this,e),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 Al,this._uplinkNetworkQualityClacInstance=new Al}return c(e,[{key:"networkStats",value:function(){var e={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 e}}]),e}())||eh;function ih(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var oh=Zn.attach({proxyMethods:!1})(th=function(e){l(s,e);var t,r,i=ih(s);function s(e,t,r,n){var o;a(this,s),(o=i.call(this)).logger=void 0,o._client=void 0,o._base=void 0,o._videoPublishThread=void 0,o._audioPublishThread=void 0,o._screenPublishThread=void 0,o.configs=void 0,o._connectionState=_u.Idle,o.channelName=void 0,o.connectionType=void 0,o._networkStats=new nh,o._recentLocalPacketStats=[],o._recentRemotePacketStats=[],o.channelName=e,o.configs=t,o._base=r,o.connectionType=n,Dl().setArea({areaCode:[o._rtcRegion()]}),Qn.shared.rtcSDKParameters&&Qn.shared.rtcSDKParameters.forEach((function(e){Dl().setParameter(e)})),o._client=Dl().createClient({codec:o.configs.codec,mode:o.configs.mode});var c=Qn.shared.rtcConfigs.encryption;return c&&o._client.setEncryptionConfig(o._getEncryptionMode(c.mode),c.key),o._videoPublishThread=new Jl(o._client),o._audioPublishThread=new Jl(o._client),o._screenPublishThread=new Jl(o._client),o._videoPublishThread.runnable=!1,o._audioPublishThread.runnable=!1,o._screenPublishThread.runnable=!1,o._client.on("connection-state-change",(function(e){o.setConnectionState(o._getRtcState(e))})),o._client.on("network-quality",(function(e){o._networkStats.uplinkNetworkQuality=e.uplinkNetworkQuality,o._networkStats.downlinkNetworkQuality=e.downlinkNetworkQuality;var t=o._client.getLocalVideoStats(),r=o._client.getRemoteVideoStats(),n=o._client.getRTCStats();o._networkStats.rtt=n.RTT;var i={lossPackets:t.sendPacketsLost,totalPackets:t.sendPackets};o._recentLocalPacketStats.unshift(i),o._recentLocalPacketStats=o._recentLocalPacketStats.slice(0,10);for(var a=0,s=0,c=0,u=Object.values(r),l=0,h=u;l<h.length;l++){var f=h[l];a+=f.receivePacketsLost,s+=f.receivePackets,c+=f.end2EndDelay}var d={lossPackets:a,totalPackets:s};o._recentRemotePacketStats.unshift(d),o._recentRemotePacketStats=o._recentRemotePacketStats.slice(0,10),u.length>0&&(o._networkStats.end2EndDelay=0===u.length?0:c/u.length);var p=o._getRecentPacketLoss(),g=p.rx,v=p.tx;o._networkStats.rxVideoPacketLoss=g,o._networkStats.txVideoPacketLoss=v,o.emit("network-stats-changed",o._networkStats.networkStats(),o.connectionType)})),o}return c(s,[{key:"base",get:function(){return this._base}},{key:"_getRecentPacketLoss",value:function(){var e=this._recentLocalPacketStats[0],t=this._recentLocalPacketStats[this._recentLocalPacketStats.length-1],r=e.lossPackets-t.lossPackets,n=e.totalPackets-t.totalPackets,i=this._recentRemotePacketStats[0],o=this._recentRemotePacketStats[this._recentRemotePacketStats.length-1],a=i.lossPackets-o.lossPackets,s=i.totalPackets-o.totalPackets;return{rx:Math.abs(n>0?r/n:0),tx:Math.abs(s>0?a/s:0)}}},{key:"ready",get:function(){return this._connectionState===_u.Connected}},{key:"setConnectionState",value:function(e){this._connectionState=e,e===_u.Connected&&(this._videoPublishThread.runnable=!0,this._audioPublishThread.runnable=!0,this._screenPublishThread.runnable=!0,this._videoPublishThread.run(),this._audioPublishThread.run(),this._screenPublishThread.run()),e===_u.Idle&&(this._videoPublishThread.runnable=!1,this._audioPublishThread.runnable=!1,this._screenPublishThread.runnable=!1),this.emit("rtc-connection-state-changed",e,this.connectionType)}},{key:"getClientSessionId",value:function(){return this._client._sessionId}},{key:"join",value:(r=o(v().mark((function e(t,r,n){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._client.join(t,this.channelName,r,+n);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"leave",value:(t=o(v().mark((function e(){var t,r,i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._videoPublishThread.stop(),this._audioPublishThread.stop(),this._screenPublishThread.stop(),e.next=5,Fu(this._client.leave());case 5:t=e.sent,r=n(t,1),(i=r[0])&&jn.shared.handleNonThrowableError(kn.RTC_ERR_CLIENT_LEAVE_CHANNEL_FAIL,i);case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"muteLocalVideo",value:function(e){return this.logger.info("muteLocalVideo ".concat(e)),this.base.cameraThread?(this._videoPublishThread.mute=e,this._videoPublishThread.setTrackThread(this.base.cameraThread),this._videoPublishThread.run(),0):-1}},{key:"muteLocalAudio",value:function(e){return this.logger.info("muteLocalAudio ".concat(e)),this.base.micThread?(this._audioPublishThread.mute=e,this._audioPublishThread.setTrackThread(this.base.micThread),this._audioPublishThread.run(),0):-1}},{key:"muteLocalScreenShare",value:function(e){return this.logger.info("muteLocalScreenShare ".concat(e)),this.base.screenThread?(this._screenPublishThread.mute=e,this._screenPublishThread.setTrackThread(this.base.screenThread),this._screenPublishThread.run(),0):-1}},{key:"_rtcRegion",value:function(){switch(Qn.shared.rtcRegion){case Ln.AREA_GLOBAL:return"GLOBAL";case Ln.AREA_CN:return"CHINA";case Ln.AREA_AS:return"ASIA";case Ln.AREA_EUR:return"EUROPE";case Ln.AREA_NA:return"NORTH_AMERICA";case Ln.AREA_JAPAN:return"JAPAN";case Ln.AREA_INDIA:return"INDIA"}}},{key:"_getRtcState",value:function(e){switch(e){case"CONNECTED":return _u.Connected;case"CONNECTING":return _u.Connecting;case"DISCONNECTING":case"DISCONNECTED":return _u.Idle;case"RECONNECTING":return _u.Reconnecting}}},{key:"_getEncryptionMode",value:function(e){switch(e){case bu.AES_128_ECB:return"aes-128-ecb";case bu.AES_128_GCM:return"aes-128-gcm";case bu.AES_128_XTS:return"aes-128-xts";case bu.AES_256_XTS:return"aes-256-xts";case bu.AES_256_GCM:return"aes-256-gcm";case bu.AES_256_XTS:return"aes-256-xts"}return"none"}}]),s}(y))||th,ah=(rh=function(e){l(n,e);var t,r=ih(n);function n(e,t,i,o){var s;a(this,n),(s=r.call(this,e,t,i,o))._remoteRtcUsers=new Map,s._muteRemoteVideo=new Map,s._muteRemoteAudio=new Map,s._audioVolumes=new Map,s._subscribeVideoThreads=new Map,s._subscribeAudioThreads=new Map;var c=(0,S.throttle)(s._notifyStreamVolumes,500);return s._client.on("user-published",(function(e,t){var r="".concat(e.uid);if(s._remoteRtcUsers.set(r,e),"video"===t){var n=new Xl(s._client,e,{channelName:s.channelName,muteMap:s._muteRemoteVideo,mediaType:"video",canvasMap:s.base.remoteCanvas});s._subscribeVideoThreads.set(r,n),n.runnable=s.ready}else{var i=new Xl(s._client,e,{channelName:s.channelName,muteMap:s._muteRemoteAudio,mediaType:"audio"});i.on("audio-volume-indication",(function(e){s._audioVolumes.set(r,e),c()})),s._subscribeAudioThreads.set(r,i),i.runnable=s.ready}s._notifySubscribeThreads(r,t)})),s._client.on("user-unpublished",(function(e){if(!e.hasAudio&&!e.hasVideo){var t="".concat(e.uid);s._remoteRtcUsers.delete(t);var r=s._subscribeVideoThreads.get(t),n=s._subscribeAudioThreads.get(t);r&&(r.stop(),s._subscribeVideoThreads.delete(t)),n&&(n.stop(),s._audioVolumes.delete(t),s._subscribeAudioThreads.delete(t))}})),s._client.on("user-left",(function(e){var t="".concat(e.uid);s._remoteRtcUsers.delete(t);var r=s._subscribeVideoThreads.get(t),n=s._subscribeAudioThreads.get(t);r&&(r.stop(),s._subscribeVideoThreads.delete(t)),n&&(n.stop(),s._audioVolumes.delete(t),s._subscribeAudioThreads.delete(t))})),s}return c(n,[{key:"videoSubscribeThread",value:function(e){return this._subscribeVideoThreads.get(e)}},{key:"_notifyStreamVolumes",value:function(){this.emit("audio-volume-indication",this._audioVolumes)}},{key:"_notifySubscribeThreads",value:function(e,t){var r="video"===t?this._subscribeVideoThreads.get(e):this._subscribeAudioThreads.get(e);r&&r.run()}},{key:"setConnectionState",value:function(e){e===_u.Connected&&(this._subscribeVideoThreads.forEach((function(e){e.runnable=!0,e.run()})),this._subscribeAudioThreads.forEach((function(e){e.runnable=!0,e.run()}))),e===_u.Idle&&(this._subscribeVideoThreads.forEach((function(e){e.runnable=!1})),this._subscribeAudioThreads.forEach((function(e){e.runnable=!1,e.run()}))),$l(p(n.prototype),"setConnectionState",this).call(this,e)}},{key:"muteRemoteVideo",value:function(e,t){return this.logger.info("muteRemoteVideo ".concat(e," ").concat(t)),this._muteRemoteVideo.set(e,t),this._notifySubscribeThreads(e,"video"),0}},{key:"muteRemoteAudio",value:function(e,t){return this.logger.info("muteRemoteAudio ".concat(e," ").concat(t)),this._muteRemoteAudio.set(e,t),this._notifySubscribeThreads(e,"audio"),0}},{key:"enableDualStream",value:function(e){return e?this._client.enableDualStream():this._client.disableDualStream()}},{key:"setLowStreamParameter",value:function(e){return this._client.setLowStreamParameter(e),0}},{key:"setRemoteVideoStreamType",value:function(e,t){return this._client.setRemoteVideoStreamType(+e,t)}},{key:"leave",value:(t=o(v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$l(p(n.prototype),"leave",this).call(this);case 2:this._remoteRtcUsers.clear(),this._subscribeVideoThreads.forEach((function(e){e.stop()})),this._subscribeVideoThreads.clear(),this._subscribeAudioThreads.forEach((function(e){e.stop()})),this._subscribeAudioThreads.clear(),this._remoteRtcUsers.clear();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),n}(oh),eu(rh.prototype,"_notifyStreamVolumes",[su],Object.getOwnPropertyDescriptor(rh.prototype,"_notifyStreamVolumes"),rh.prototype),rh),sh=function(e){l(r,e);var t=ih(r);function r(){return a(this,r),t.apply(this,arguments)}return c(r,[{key:"setLowStreamParameter",value:function(e){return this._client.setLowStreamParameter(e),0}},{key:"setRemoteVideoStreamType",value:function(e,t){return this._client.setRemoteVideoStreamType(+e,t)}},{key:"enableDualStream",value:function(e){return e?this._client.enableDualStream():this._client.disableDualStream()}}]),r}(oh);function ch(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var uh=function(e){l(i,e);var t,r=ch(i);function i(e,t){var n;return a(this,i),(n=r.call(this)).adapter=e,n._deviceInfo=new Map,n._deviceIds=new Set,n._initializeDeviceList(t),n}return c(i,[{key:"onLocalVideoTrackStateChanged",value:function(e){return this.adapter.onLocalVideoTrackStateChanged(e),0}},{key:"onLocalCameraListChanged",value:function(e){return this.on(Ju.cameraListChanged,e),0}},{key:"getVideoCameraDevices",value:function(){return this.cameraList}},{key:"cameraList",get:function(){var e=this,t=[];return this._deviceIds.forEach((function(r){var n=e._deviceInfo.get(r);n&&t.push({deviceid:n.deviceid,devicename:n.devicename})})),t}},{key:"_emitCameraListChanged",value:function(e,t,r){this.emit(Ju.cameraListChanged,e,t,r)}},{key:"_initializeDeviceList",value:(t=o(v().mark((function e(t){var r,i,o,a,s,c=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Fu(Dl().getCameras(t));case 2:r=e.sent,i=n(r,2),o=i[0],a=i[1],o&&jn.shared.handleThrowableError(kn.RTC_ERR_VDM_GET_DEVICES_FAIL,o),a&&(s=[],a.forEach((function(e){if("default"!==e.deviceId){var t={deviceid:e.deviceId,devicename:e.label};c._deviceInfo.set(e.deviceId,t),c._deviceIds.add(e.deviceId),s.push(t)}})),this._emitCameraListChanged(!0,s,this.cameraList)),Dl().onCameraChanged=function(e){var t={deviceid:e.device.deviceId,devicename:e.device.label};"ACTIVE"===e.state?(c._deviceInfo.set(e.device.deviceId,t),c._deviceIds.add(e.device.deviceId),c._emitCameraListChanged(!0,[t],c.cameraList)):"INACTIVE"===e.state&&(c._deviceInfo.delete(e.device.deviceId),c._deviceIds.delete(e.device.deviceId),c._emitCameraListChanged(!1,[t],c.cameraList))};case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),i}(ul),lh=function(e){l(s,e);var t,r,i=ch(s);function s(e,t){var r;return a(this,s),(r=i.call(this)).adapter=e,r._recordingDeviceInfo=new Map,r._recordingDeviceIds=new Set,r._playbackDeviceInfo=new Map,r._playbackDeviceIds=new Set,r._initializeDeviceList(t),r._initializePlaybackDeviceList(t),r}return c(s,[{key:"onLocalAudioPlaybackTestVolumeChanged",value:function(e){return this.adapter.onLocalAudioPlaybackTestVolumeChanged(e)}},{key:"onAudioFrame",value:function(e){return this.adapter.onAudioFrame(e)}},{key:"onLocalAudioTrackStateChanged",value:function(e){return this.adapter.onLocalAudioTrackStateChanged(e)}},{key:"onLocalAudioVolume",value:function(e){return this.adapter.onLocalAudioVolume(e)}},{key:"onLocalRecordingDeviceListChanged",value:function(e){return this.on(Ju.recordingDeviceListChanged,e),0}},{key:"onLocalPlaybackDeviceListChanged",value:function(e){return this.on(Ju.playbackDeviceListChanged,e),0}},{key:"microphoneList",get:function(){var e=this,t=[];return this._recordingDeviceIds.forEach((function(r){var n=e._recordingDeviceInfo.get(r);n&&t.push({deviceid:n.deviceid,devicename:n.devicename})})),t}},{key:"speakerList",get:function(){var e=this,t=[];return this._playbackDeviceIds.forEach((function(r){var n=e._playbackDeviceInfo.get(r);n&&t.push({deviceid:n.deviceid,devicename:n.devicename})})),t}},{key:"_emitPlaybackListChanged",value:function(e,t,r){this.emit(Ju.playbackDeviceListChanged,e,t,r)}},{key:"_emitRecordingListChanged",value:function(e,t,r){this.emit(Ju.recordingDeviceListChanged,e,t,r)}},{key:"_initializePlaybackDeviceList",value:(r=o(v().mark((function e(t){var r,i,o,a,s,c=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Fu(Dl().getPlaybackDevices(t));case 2:r=e.sent,i=n(r,2),o=i[0],a=i[1],o&&jn.shared.handleThrowableError(kn.RTC_ERR_ADM_GET_PLAYBACK_DEVICES_FAIL,o),a&&(s=[],a.forEach((function(e){if("default"!==e.deviceId){var t={deviceid:e.deviceId,devicename:e.label};c._playbackDeviceInfo.set(e.deviceId,t),c._playbackDeviceIds.add(e.deviceId),s.push(t)}})),this._emitPlaybackListChanged(!0,s,this.speakerList)),Dl().onPlaybackDeviceChanged=function(e){var t={deviceid:e.device.deviceId,devicename:e.device.label};"ACTIVE"===e.state?(c._playbackDeviceInfo.set(e.device.deviceId,t),c._playbackDeviceIds.add(e.device.deviceId),c._emitPlaybackListChanged(!0,[t],c.speakerList)):"INACTIVE"===e.state&&(c._playbackDeviceInfo.delete(e.device.deviceId),c._playbackDeviceIds.delete(e.device.deviceId),c._emitPlaybackListChanged(!1,[t],c.speakerList))};case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_initializeDeviceList",value:(t=o(v().mark((function e(t){var r,i,o,a,s,c=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Fu(Dl().getMicrophones(t));case 2:r=e.sent,i=n(r,2),o=i[0],a=i[1],o&&jn.shared.handleThrowableError(kn.RTC_ERR_ADM_GET_RECORD_DEVICES_FAIL,o),a&&(s=[],a.forEach((function(e){if("default"!==e.deviceId){var t={deviceid:e.deviceId,devicename:e.label};c._recordingDeviceInfo.set(e.deviceId,t),c._recordingDeviceIds.add(e.deviceId),s.push(t)}})),this._emitRecordingListChanged(!0,s,this.microphoneList)),Dl().onMicrophoneChanged=function(e){var t={deviceid:e.device.deviceId,devicename:e.device.label};"ACTIVE"===e.state?(c._recordingDeviceInfo.set(e.device.deviceId,t),c._recordingDeviceIds.add(e.device.deviceId),c._emitRecordingListChanged(!0,[t],c.microphoneList)):"INACTIVE"===e.state&&(c._recordingDeviceInfo.delete(e.device.deviceId),c._recordingDeviceIds.delete(e.device.deviceId),c._emitRecordingListChanged(!1,[t],c.microphoneList))};case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"getAudioPlaybackDevices",value:function(){return this.speakerList}},{key:"getAudioRecordingDevices",value:function(){return this.microphoneList}}]),s}(ll);__webpack_require__(9575),__webpack_require__(4197),__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);function hh(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return fh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fh(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function fh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dh(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var ph,gh,vh,Ah=function(e){l(r,e);var t=dh(r);function r(){var e;a(this,r),(e=t.call(this)).logger=void 0,e._audioContext=void 0,e._audioTagId=Tn(),e._playingSourceNode=void 0,e._analyserNode=void 0,e._volumePollingTask=void 0;try{window.AudioContext=window.AudioContext||window.webkitAudioContext,e._audioContext=new AudioContext,e._analyserNode=e._audioContext.createAnalyser(),e._analyserNode.smoothingTimeConstant=.3,e._analyserNode.fftSize=1024}catch(e){yn.error("[audio player] initialize audio context failed ".concat(e,"."))}return e}return c(r,[{key:"_getAudioVirtualDom",value:function(){if(document){var e=document.getElementById(this._audioTagId);if(!e){var t=document.createElement("audio");t.id=this._audioTagId,t.hidden=!0,document.body.appendChild(t),e=t}return e}yn.error("[audio player] audio element creation failed.")}},{key:"play",value:function(e){var t=this;this.stop();var r=this._audioContext,n=this._getAudioVirtualDom();if(n&&r){var i=r.createMediaElementSource(n);if(i.connect(r.destination),n.src=e,this._analyserNode){var o=this._analyserNode;i.connect(o);var a=new Float32Array(o.fftSize);this._volumePollingTask=sl.addPollingTask((function(){o.getFloatTimeDomainData(a);var e,r=0,n=hh(a);try{for(n.s();!(e=n.n()).done;){var i=e.value;r+=i*i}}catch(e){n.e(e)}finally{n.f()}var s=Math.sqrt(r/a.length);t.emit(Ju.localAudioPlaybackVolumeIndicator,Math.min(s,1))}),il.second(.2))}n.addEventListener("ended",(function(){t.stop()})),this._playingSourceNode=i,n.play()}else yn.error("[audio player] start audio playback test failed.")}},{key:"stop",value:function(){var e=this._audioContext,t=this._getAudioVirtualDom();if(t&&e){var r;if(t.pause(),t.currentTime=0,this._analyserNode)try{var n;null===(n=this._playingSourceNode)||void 0===n||n.disconnect(this._analyserNode)}catch(e){yn.warn("[audio player] failed to detach analyser node")}if(this._audioContext)try{var i;null===(i=this._playingSourceNode)||void 0===i||i.disconnect(e.destination)}catch(e){yn.warn("[audio player] failed to detach audio context")}null===(r=this._volumePollingTask)||void 0===r||r.stop(),this._volumePollingTask=void 0,t.remove(),this.emit(Ju.localAudioPlaybackVolumeIndicator,0)}}}]),r}(y);function mh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mh(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _h(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var bh,Eh=Zn.attach({proxyMethods:!1})((gh=function(e){l(r,e);var t=_h(r);function r(e){var n;return a(this,r),(n=t.call(this)).logger=void 0,n._channels=new Map,n._vdm=new uh(f(n),Qn.shared.rtcConfigs.noDevicePermission),n._adm=new lh(f(n),Qn.shared.rtcConfigs.noDevicePermission),n.cameraThread=new zl,n.micThread=new Wl,n.screenThread=new Yl,n.remoteCanvas=new Map,n._audioPlayer=new Ah,n._configs=void 0,n._configs=e,n}return c(r,[{key:"configs",get:function(){return yh(yh({},r.defaultConfigs),this._configs)}},{key:"createRtcChannel",value:function(e,t){var r=this._channels.get(e);return r||(r=new wh(e,this.configs,t),this._channels.set(e,r)),r}},{key:"getVideoDeviceManager",value:function(){return this._vdm}},{key:"setVideoCameraDevice",value:function(e){return this.cameraThread.setDevice(e),this.cameraThread.run(),0}},{key:"setAudioRecordingDevice",value:function(e){return this.micThread.setRecordingDevice(e),this.micThread.run(),0}},{key:"setAudioPlaybackDevice",value:function(e){throw new Error("Method not implemented.")}},{key:"getAudioDeviceManager",value:function(){return this._adm}},{key:"getWindowDevices",value:function(){throw new Error("Method not supported.")}},{key:"getDiaplayDevices",value:function(){throw new Error("Method not supported.")}},{key:"isScreenDeviceEnumerateSupported",value:function(){return!1}},{key:"enableLocalVideo",value:function(e){return this.cameraThread.cameraEnable=e,this.cameraThread.run(),0}},{key:"enableLocalAudio",value:function(e){return this.micThread.micEnable=e,this.micThread.run(),0}},{key:"setupLocalVideo",value:function(e,t){return t===tu.Camera?(this.cameraThread.canvas=e,this.cameraThread.run()):(this.screenThread.canvas=e,this.screenThread.run()),0}},{key:"setupRemoteVideo",value:function(e){if(!e.channelName)return jn.shared.handleThrowableError(kn.RTC_ERR_NO_CHANNEL_EXISTS,new Error("invalid canvas w/o canvas name")),-1;this.remoteCanvas.set("".concat(e.streamUuid,"-").concat(e.channelName),e);var t=this._channels.get(e.channelName),r=null==t?void 0:t.main.videoSubscribeThread(e.streamUuid);return r&&r.run(),0}},{key:"startAudioRecordingDeviceTest",value:function(e){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(){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(e){return this._audioPlayer.play(e),0}},{key:"stopAudioPlaybackDeviceTest",value:function(){return this._audioPlayer.stop(),0}},{key:"startScreenCapture",value:function(e,t){return this.screenThread.screenEnable=!0,this.screenThread.run(),0}},{key:"stopScreenCapture",value:function(){return this.screenThread.screenEnable=!1,this.screenThread.run(),0}},{key:"onLocalAudioPlaybackTestVolumeChanged",value:function(e){return this._audioPlayer.on(Ju.localAudioPlaybackVolumeIndicator,e),0}},{key:"onLocalVideoTrackStateChanged",value:function(e){return this.cameraThread.on(Ju.trackStateChanged,e),0}},{key:"onLocalAudioTrackStateChanged",value:function(e){return this.micThread.on(Ju.trackStateChanged,e),0}},{key:"onLocalScreenShareTrackStateChanged",value:function(e){return this.screenThread.on(Ju.trackStateChanged,e),0}},{key:"onLocalAudioVolume",value:function(e){return this.micThread.on(Ju.localAudioVolume,e),0}},{key:"onAudioFrame",value:function(e){return this.micThread.on(Ju.localAudioFrame,e),0}},{key:"setBeautyEffectOptions",value:function(e,t){return this.logger.warn("web platform does not support this"),0}},{key:"setAudioFrameCallback",value:function(){return this.micThread.setAudioFrameCallback(),0}},{key:"stopAudioFrameCallback",value:function(){return this.micThread.stopAudioFrameCallback(),0}},{key:"setAudioRawDataConfig",value:function(e){return this.micThread.setAudioRawDataConfig(e),0}},{key:"hasScreenSharePermission",value:function(){return!0}},{key:"destroy",value:function(){return this._channels.forEach((function(e){return e.leave()})),this._channels.clear(),this.enableLocalVideo(!1),this.enableLocalAudio(!1),this.stopScreenCapture(),0}}],[{key:"getRtcVersion",value:function(){return Dl().VERSION}}]),r}(fl),gh.defaultConfigs={codec:"vp8",mode:"live"},ph=gh))||ph,wh=Zn.attach({proxyMethods:!1})(vh=function(e){l(s,e);var t,r,i=_h(s);function s(e,t,r){var n;return a(this,s),(n=i.call(this)).logger=void 0,n.main=void 0,n.sub=void 0,n.channelName=void 0,n.channelName=e,n.main=new ah(e,t,r,lu.main),n.sub=new sh(e,t,r,lu.sub),n}return c(s,[{key:"getSessionId",value:function(){return this.main.getClientSessionId()}},{key:"client",value:function(e){return e===lu.main?this.main:this.sub}},{key:"join",value:(r=o(v().mark((function e(t,r,n){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client(n).join(Qn.shared.appId,t,r);case 2:n===lu.sub&&(this.main.muteRemoteVideo(r,!0),this.main.muteRemoteAudio(r,!0));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"leave",value:(t=o(v().mark((function e(t){var r,i,o,a,s;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.sub.ready){e.next=7;break}return e.next=3,Fu(this.sub.leave());case 3:i=e.sent,o=n(i,1),(r=o[0])&&jn.shared.handleNonThrowableError(kn.RTC_ERR_LEAVE_SUB_CHANNEL_FAIL,r);case 7:if(t===lu.sub){e.next=14;break}return e.next=10,Fu(this.main.leave());case 10:a=e.sent,s=n(a,1),(r=s[0])&&jn.shared.handleNonThrowableError(kn.RTC_ERR_LEAVE_MAIN_CHANNEL_FAIL,r);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"enableDualStream",value:function(e,t){return this.client(t).enableDualStream(e)}},{key:"setLowStreamParameter",value:function(e,t){return this.client(t).setLowStreamParameter(e),0}},{key:"setRemoteVideoStreamType",value:function(e,t,r){return this.client(r).setRemoteVideoStreamType(e,t)}},{key:"setClientRole",value:function(e){return 0}},{key:"muteLocalVideo",value:function(e,t){return this.logger.info("muteLocalVideo ".concat(e)),this.client(t).muteLocalVideo(e)}},{key:"muteLocalAudio",value:function(e,t){return this.logger.info("muteLocalAudio ".concat(e)),this.client(t).muteLocalAudio(e)}},{key:"muteLocalScreenShare",value:function(e,t){return this.logger.info("muteLocalScreenShare ".concat(e)),this.client(t).muteLocalScreenShare(e)}},{key:"muteRemoteVideo",value:function(e,t){return this.logger.info("muteRemoteVideo ".concat(e," ").concat(t)),this.main.muteRemoteVideo(e,t)}},{key:"muteRemoteAudio",value:function(e,t){return this.logger.info("muteRemoteAudio ".concat(e," ").concat(t)),this.main.muteRemoteAudio(e,t)}},{key:"onNetworkStats",value:function(e){return this.main.on("network-stats-changed",e),0}},{key:"onAudioVolumeIndication",value:function(e){return this.main.on("audio-volume-indication",e),0}},{key:"onConnectionStateChanged",value:function(e){return this.main.on("rtc-connection-state-changed",e),this.sub.on("rtc-connection-state-changed",e),0}}]),s}(hl))||vh,Ih=function(){function e(){a(this,e)}return c(e,null,[{key:"getAdapter",value:function(e,t){switch(e){case Nn.Electron:return new Ol;case Nn.Web:return new Eh(null==t?void 0:t.web)}}}]),e}(),Ch=Zn.attach({level:On.DEBUG})(bh=function(){function e(t){a(this,e),this._adapter=void 0,this._channels=new Map,this._adapter=Ih.getAdapter(Qn.platform,t)}return c(e,[{key:"getRtcChannel",value:function(e){var t=this._channels.get(e);if(!t){var r=this._adapter.createRtcChannel(e,this._adapter);t=new Tu(e,r),this._channels.set(e,t)}return t}},{key:"getVideoDeviceManager",value:function(){return this._adapter.getVideoDeviceManager()}},{key:"getAudioDeviceManager",value:function(){return this._adapter.getAudioDeviceManager()}},{key:"getWindowDevices",value:function(){return this._adapter.getWindowDevices()}},{key:"getDisplayDevices",value:function(){return this._adapter.getDiaplayDevices()}},{key:"isScreenDeviceEnumerateSupported",value:function(){return this._adapter.isScreenDeviceEnumerateSupported()}},{key:"setVideoCameraDevice",value:function(e){return this._adapter.setVideoCameraDevice(e)}},{key:"setAudioRecordingDevice",value:function(e){return this._adapter.setAudioRecordingDevice(e)}},{key:"setAudioPlaybackDevice",value:function(e){return this._adapter.setAudioPlaybackDevice(e)}},{key:"enableLocalVideo",value:function(e){return this._adapter.enableLocalVideo(e)}},{key:"setupLocalVideo",value:function(e,t){return e.view.style.setProperty("transform",e.mirror?"rotateY(180deg)":""),this._adapter.setupLocalVideo(e,t)}},{key:"setupRemoteVideo",value:function(e){return e.view.style.setProperty("transform",e.mirror?"rotateY(180deg)":""),this._adapter.setupRemoteVideo(e)}},{key:"enableLocalAudio",value:function(e){return this._adapter.enableLocalAudio(e)}},{key:"startScreenCapture",value:function(e,t){return this._adapter.startScreenCapture(e,t)}},{key:"stopScreenCapture",value:function(){return this._adapter.stopScreenCapture()}},{key:"onLocalScreenShareTrackStateChanged",value:function(e){return this._adapter.onLocalScreenShareTrackStateChanged(e)}},{key:"startAudioRecordingDeviceTest",value:function(e){return this._adapter.startAudioRecordingDeviceTest(e)}},{key:"stopAudioRecordingDeviceTest",value:function(){return this._adapter.stopAudioRecordingDeviceTest()}},{key:"startAudioPlaybackDeviceTest",value:function(e){return this._adapter.startAudioPlaybackDeviceTest(e)}},{key:"stopAudioPlaybackDeviceTest",value:function(){return this._adapter.stopAudioPlaybackDeviceTest()}},{key:"setAudioFrameCallback",value:function(){return this._adapter.setAudioFrameCallback()}},{key:"stopAudioFrameCallback",value:function(){return this._adapter.stopAudioFrameCallback()}},{key:"onLocalCameraListChanged",value:function(e){return this._adapter.getVideoDeviceManager().onLocalCameraListChanged(e)}},{key:"onLocalRecordingDeviceListChanged",value:function(e){return this._adapter.getAudioDeviceManager().onLocalRecordingDeviceListChanged(e)}},{key:"onLocalPlaybackListChanged",value:function(e){return this._adapter.getAudioDeviceManager().onLocalPlaybackDeviceListChanged(e)}},{key:"onLocalVideoTrackStateChanged",value:function(e){return this._adapter.getVideoDeviceManager().onLocalVideoTrackStateChanged(e)}},{key:"onLocalAudioTrackStateChanged",value:function(e){return this._adapter.getAudioDeviceManager().onLocalAudioTrackStateChanged(e)}},{key:"onLocalAudioVolume",value:function(e){return this._adapter.getAudioDeviceManager().onLocalAudioVolume(e)}},{key:"setBeautyEffectOptions",value:function(e,t){return this._adapter.setBeautyEffectOptions(e,t)}},{key:"setAudioRawDataConfig",value:function(e){return this._adapter.setAudioRawDataConfig(e)}},{key:"hasScreenSharePermission",value:function(){return this._adapter.hasScreenSharePermission()}},{key:"destroy",value:function(){return this._adapter.destroy()}}]),e}())||bh,Sh=__webpack_require__(3977),Th=__webpack_require__.n(Sh),Rh=__webpack_require__(9644),kh=__webpack_require__.n(Rh),Oh=(new(__webpack_require__(6353).UAParser)).getResult(),Nh=function(){function e(t,r){a(this,e),this._appId=t,this._tagInfo=r,this._adapter=void 0,this._adapter=new xh(this._appId,this._tagInfo)}var t;return c(e,[{key:"upload",value:(t=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._adapter.upload(t,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}(),xh=function(){function e(t,r){a(this,e),this._appId=t,this._tagInfo=r,this._apiService=new Kc,this._checkpoints=new Map}var t,r,n,i;return c(e,[{key:"_uploadByAli",value:(i=o(v().mark((function e(t,r,n,i){var o,a,s,c,u,l,h,f,d,p,g,A,m,y,_=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.ossKey,a=n.accessKeyId,s=n.accessKeySecret,c=n.bucketName,u=n.ossEndpoint,l=n.securityToken,h=i.callbackHost,f=i.callbackBody,d=i.callbackContentType,p=new(Th())({accessKeyId:a,accessKeySecret:s,bucket:c,endpoint:u,secure:!0,stsToken:l}),g=this._checkpoints.get(r),A="".concat(h,"/monitor/apps/").concat(this._appId,"/v1/log/oss/callback"),e.next=7,p.multipartUpload(o,t,{progress:function(e,t){_._checkpoints.set(r,t)},callback:{url:A,body:f,contentType:d},checkpoint:g});case 7:if(m=e.sent,200===(y=m.res).status){e.next=11;break}throw new Error("upload to ali oss error, status is ".concat(y.status));case 11:this._checkpoints.delete(r),p.generateObjectUrl(o);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return i.apply(this,arguments)})},{key:"_uploadByAws",value:(n=o(v().mark((function e(t,r,n,i){var o,a,s,c,u,l;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.preSignedUrl,a=i.callbackHost,s=i.callbackBody,c=i.callbackContentType,u="".concat(a,"/monitor/apps/").concat(this._appId,"/v1/log/oss/callback"),e.next=5,kh().put(o,t,{headers:{"Content-Type":t.type}});case 5:return e.next=7,kh().post(u,JSON.parse(s),{headers:_({},"content-type",c)});case 7:if(200===(l=e.sent).status){e.next=10;break}throw new Error("upload to aws oss error, status is ".concat(l.status));case 10:this._checkpoints.delete(r);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,r,i){return n.apply(this,arguments)})},{key:"_fetchStsToken",value:(r=o(v().mark((function e(t,r){var n,i,o,a,s,c,u;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),i={appId:Qn.shared.appId,appVersion:Qn.version,deviceName:Oh.os.name,deviceVersion:Oh.os.version,fileExt:r,platform:"web",tag:t},o=JSON.stringify(i),a="7AIsPeMJgQAppO0Z"+o+n,s=zc()(a),e.next=8,this._apiService.fetch({host:"https://api.sd-rtn.com",path:"/monitor/v1/log/oss/policy",data:i,method:"POST",headers:{sign:s,timestamp:n}});case 8:return c=e.sent,u=c.data,e.abrupt("return",{bucketName:u.bucketName,callbackBody:u.callbackBody,callbackContentType:u.callbackContentType,accessKeyId:u.accessKeyId,accessKeySecret:u.accessKeySecret,securityToken:u.securityToken,ossKey:u.ossKey,callbackHost:u.callbackHost,preSignedUrl:u.preSignedUrl,vendor:u.vendor,ossEndpoint:u.ossEndpoint});case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"upload",value:(t=o(v().mark((function e(t,r){var n,i,o,a,s,c,u,l,h,f,d,p,g,A,m,y,_;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchStsToken(this._tagInfo,r);case 2:if(n=e.sent,i=n.vendor,1!==(o=void 0===i?-1:i)){e.next=10;break}return a=n.ossKey,s=n.callbackBody,c=n.callbackContentType,u=n.callbackHost,l=n.preSignedUrl,e.next=8,this._uploadByAws(t,a,{preSignedUrl:l},{callbackBody:s,callbackContentType:c,callbackHost:u});case 8:case 14:e.next=17;break;case 10:if(2!==o){e.next=16;break}return h=n.accessKeyId,f=n.accessKeySecret,d=n.bucketName,p=n.ossEndpoint,g=n.securityToken,A=n.ossKey,m=n.callbackBody,y=n.callbackContentType,_=n.callbackHost,e.next=14,this._uploadByAli(t,A,{accessKeyId:h,accessKeySecret:f,bucketName:d,ossEndpoint:p,securityToken:g,ossKey:A},{callbackBody:m,callbackContentType:y,callbackHost:_});case 16:throw new Error("vendor ".concat(o," is not supported"));case 17:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function Dh(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Lh,Ph,Bh,Mh,jh,Uh=function(e){l(u,e);var t,r,n,i,s=Dh(u);function u(){return a(this,u),s.apply(this,arguments)}return c(u,[{key:"uploadZipLogFile",value:(i=o(v().mark((function e(t,r){var n;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.uploadToOss(t,r,"zip");case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"uploadLogFile",value:(n=o(v().mark((function e(t,r){var n;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.uploadToOss(t,r,"log");case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"uploadToOss",value:(r=o(v().mark((function e(t,r,n){var i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i=new Nh(Qn.shared.appId,t),e.next=4,i.upload(r,n);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),jn.shared.handleThrowableError(kn.RTE_ERR_LOG_UPLOAD_FAIL,e.t0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])}))),function(e,t,n){return r.apply(this,arguments)})},{key:"uploadElectronLog",value:(t=o(v().mark((function e(t){var r,n;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!window.doGzip){e.next=8;break}return e.next=3,window.doGzip();case 3:return r=e.sent,e.next=6,this.uploadZipLogFile(t,r);case 6:return n=e.sent,e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),u}(Kc);__webpack_require__(1058);function Fh(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}!function(e){e[e.Host=1]="Host",e[e.Controlled=2]="Controlled"}(Lh||(Lh={})),function(e){e.RequestControl="request-control",e.QuitControl="quit-control",e.RequestAuthorized="request-authorized",e.RequestUnauthorized="request-unauthorized"}(Ph||(Ph={}));try{var Qh=__webpack_require__(1709).AgoraRemoteDesktopControl;jh=Qh}catch(e){Qn.platform===Nn.Electron&&yn.warn("load electron rc sdk failed: ".concat(e))}var qh=Zn.attach({proxyMethods:!1})((Mh=function(e){l(p,e);var t,r,n,i,s,u,h,f,d=Fh(p);function p(e,t){var r;return a(this,p),(r=d.call(this))._rtcChannel=e,r._role=t,r.logger=void 0,r._rdcEngine=void 0,r._displays=[],r._streamId=void 0,r.handleRDCStateChange=function(e,t){var n;(n=r.logger).info.apply(n,["RDC state changed to",e].concat($n(t?["with message",t]:[])))},r.handleRDCRequestControl=function(e){r.logger.info("RequestControl fired with args",e),r.emit(Ph.RequestControl,e)},r.handleRDCQuitControl=function(e){r.logger.info("QuitControl fired with args",e),r.emit(Ph.QuitControl,e)},r.handleRDCRequestControlAuthorized=function(e){r.logger.info("RequestAuthorized fired with args",e),r.emit(Ph.RequestAuthorized,e)},r.handleRDCRequestControlUnauthorized=function(e){r.logger.info("RequestUnauthorized fired with args",e),r.emit(Ph.RequestUnauthorized,e)},r._checkPlatform(),r._initialize(),r._addListeners(),r}return c(p,[{key:"_checkPlatform",value:function(){if(!(Qn.platform===Nn.Electron))throw new Error("Remote Control currently not supported in web browser")}},{key:"rdcEngine",get:function(){if(!this._rdcEngine)throw new Error("RCEngine not ready");return this._rdcEngine}},{key:"_initialize",value:function(){this._rdcEngine=new jh(Ol.rtcEngine,{appId:Qn.shared.appId,role:this._role})}},{key:"_addListeners",value:function(){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(){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:(f=o(v().mark((function e(t){var r,n,i,o;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.userId,n=t.userToken,i=t.streamId,o=t.streamToken,this.logger.info("join rc channel [".concat(this._rtcChannel.channelName,"] with params"),t),this._streamId=i,e.next=5,this.rdcEngine.join(r,n,this._rtcChannel.channelName,parseInt(i),o);case 5:this.logger.info("rc channel joined");case 6:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"_waitForUserJoin",value:(h=o(v().mark((function e(t){var r,n,i=this,a=arguments;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.length>1&&void 0!==a[1]?a[1]:1e4,(n=function(){return p._channelUsers.has(t)})()){e.next=7;break}return e.next=5,Mu(new Promise(function(){var e=o(v().mark((function e(o){var a;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=Date.now()+r;case 1:if(!(Date.now()<a)){e.next=11;break}if(i.logger.info("wait for user joining rc channel"),!n()){e.next=7;break}return i.logger.info("user [".concat(t,"] joined the rc channel!")),o(),e.abrupt("break",11);case 7:return e.next=9,Bu(100);case 9:e.next=1;break;case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),r,!1);case 5:e.next=8;break;case 7:this.logger.info("user [".concat(t,"] has already joined the rc channel!"));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"requestControl",value:(u=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.info("request user ".concat(t," for remote controlling")),e.next=3,this._waitForUserJoin(r.streamId,r.timeout);case 3:this.rdcEngine.requestControl(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"takeControl",value:(s=o(v().mark((function e(t,r,n,i){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.info("take control of the remote device of user ".concat(t)),this.rdcEngine.takeControl(t,parseInt(r),n);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return s.apply(this,arguments)})},{key:"unauthorizeControl",value:(i=o(v().mark((function e(t,r){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.info("unauthorize user ".concat(t," for remote controlling")),this.rdcEngine.unauthorizeControl(t);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"authorizeControl",value:(n=o(v().mark((function e(t,r,n){var i;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.info("authorize user ".concat(t," for remote controlling")),i=this._displays.find((function(e){return e.id===r.id}))){e.next=4;break}throw new Error("Invalid display obj, display with id ".concat(JSON.stringify(r.id)," not exist"));case 4:this.logger.info("display with id ".concat(r.id," is going to be controled")),this.rdcEngine.authorizeControl(t,i);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"quitControl",value:function(e,t,r){this.logger.info("role ".concat(t," is quit control from ").concat(e," and streamId ").concat(r)),r?this.rdcEngine.quitControl(e,t,r):this.rdcEngine.quitControl(e,t)}},{key:"leave",value:(r=o(v().mark((function e(){var t,r,n=this;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.info("leave rc channel [".concat(this._rtcChannel.channelName,"],streamId is [").concat(this._streamId,"]")),Ol.rtcEngine.stopScreenCapture2(),Ol.rtcEngine.videoSourceLeave(),t=1e4,r=this._streamId){e.next=8;break}return this.logger.info("user not joined yet, no op"),e.abrupt("return");case 8:return e.next=10,Mu(new Promise(function(){var e=o(v().mark((function e(i){var o;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=Date.now()+t;case 1:if(!(Date.now()<o)){e.next=10;break}if(p._channelUsers.has(r)){e.next=6;break}return n.logger.info("user not in rc channel, stop loop"),i(),e.abrupt("break",10);case 6:return e.next=8,Bu(100);case 8:e.next=1;break;case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t);case 10:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"dispose",value:function(){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:(t=o(v().mark((function e(){var t;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.rdcEngine.getDisplays();case 2:return this._displays=e.sent,t=this._displays.map((function(e){return{id:e.id,size:{width:e.width,height:e.height},thumbnail:e.thumbnail}})),this.logger.info("get rc displays",t),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"initialize",value:function(){Ol.rtcEngine.on("userJoined",p.handleRTCUserJoined),Ol.rtcEngine.on("removeStream",p.handleRTCUserLeft)}},{key:"cleanup",value:function(){p._channelUsers.clear(),Ol.rtcEngine.off("userJoined",p.handleRTCUserJoined),Ol.rtcEngine.off("removeStream",p.handleRTCUserLeft)}}]),p}(y),Mh._channelUsers=new Set,Mh.handleRTCUserJoined=function(e){yn.info("RC user joined channel",e),Mh._channelUsers.add("".concat(e))},Mh.handleRTCUserLeft=function(e){yn.info("RC user left channel",e),Mh._channelUsers.delete("".concat(e))},Bh=Mh))||Bh;function Gh(e){var t=function(){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(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}var Vh=function(e){l(s,e);var t,r,i=Gh(s);function s(e){var t;return a(this,s),(t=i.call(this))._mediaControl=void 0,t._logService=void 0,t._rtmManager=void 0,t._rtcManager=void 0,t._apiServicePathPrefix="",Qn.setConfig(e),yn.setupConsoleHijack(),t._logService=new Uh,t._rtmManager=new $c,t._rtcManager=new Ch(e.rtcConfigs),t._mediaControl=new el(t._rtcManager),Qn.platform===Nn.Electron&&qh.initialize(),t}return c(s,[{key:"apiServicePathPrefix",get:function(){return this._apiServicePathPrefix}},{key:"login",value:(r=o(v().mark((function e(t,r){var n;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Jc.shared.host="https://api.sd-rtn.com",Jc.shared.pathPrefix="/cn/v1.0/projects/".concat(Qn.shared.appId,"/app-dev-report"),n=Qn.shared.ignoreUrlRegionPrefix,this._apiServicePathPrefix="".concat(n?"":"/"+Qn.shared.region.toLowerCase(),"/scene/apps/").concat(Qn.shared.appId),Qn.shared.token=t,Qn.shared.userId=r,Qn.shared.service.headers={"Content-Type":"application/json","x-agora-token":t,"x-agora-uid":r},e.next=9,this._rtmManager.login(t,r,{uploadLog:!1});case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"logout",value:function(){this._rtcManager.destroy(),this._rtmManager.destroyRtm()}},{key:"createAgoraRteScene",value:function(e){var t=n(this._rtmManager.createObserverChannel(e),2),r=t[0],i=t[1],o=this._rtcManager.getRtcChannel(e);return new Xu(e,{rtc:this._rtcManager,rtcChannel:o,rtm:this._rtmManager,rtmChannel:r,rtmChannelObserver:i})}},{key:"createRemoteControlContext",value:function(e,t){return new qh(e.rtcChannel,t)}},{key:"getAgoraMediaControl",value:function(){return this._mediaControl}},{key:"uploadSDKLogToAgoraService",value:(t=o(v().mark((function e(t){var r,i,o,a,s,c,u,l,h,f,d;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Uu(yn.logger.collectConsoleLogs());case 2:if(a=e.sent,s=n(a,2),r=s[0],i=s[1],r){e.next=20;break}return e.next=9,Uu(this._logService.uploadLogFile(t,i));case 9:if(c=e.sent,u=n(c,1),!(r=u[0])){e.next=16;break}jn.shared.handleNonThrowableError(kn.RTE_ERR_WEB_LOG_UPLOAD_ERR,r),e.next=18;break;case 16:return e.next=18,Uu(yn.logger.cleanupConsoleLogs());case 18:e.next=21;break;case 20:jn.shared.handleNonThrowableError(kn.RTE_ERR_WEB_LOG_UPLOAD_ERR,r);case 21:if(Qn.platform!==Nn.Electron){e.next=38;break}return e.next=24,Uu(yn.logger.collectElectronLogs(Ol.logBasePath,Ol.logFolderPath));case 24:if(l=e.sent,h=n(l,2),r=h[0],o=h[1],r){e.next=37;break}return e.next=31,Uu(this._logService.uploadZipLogFile(t,o));case 31:f=e.sent,d=n(f,1),(r=d[0])&&jn.shared.handleNonThrowableError(kn.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR,r),e.next=38;break;case 37:jn.shared.handleNonThrowableError(kn.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR,r);case 38:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}],[{key:"engine",get:function(){return this._engine?this._engine:jn.shared.handleThrowableError(kn.RTE_ERR_ENGINE_NOT_READY,new Error("engine not ready"))}},{key:"createWithConfig",value:function(e){return this._engine||(this._engine=new s(e)),this._engine}},{key:"destroy",value:function(){var e,t,r,n;yn.info("rte engine destroy"),null===(e=this._engine)||void 0===e||e.getAgoraMediaControl().createCameraVideoTrack().stop(),null===(t=this._engine)||void 0===t||t.getAgoraMediaControl().createMicrophoneAudioTrack().stop(),null===(r=this._engine)||void 0===r||r.getAgoraMediaControl().createScreenShareTrack().stop(),Qn.platform===Nn.Electron&&qh.cleanup(),null===(n=this._engine)||void 0===n||n.logout(),this._engine=void 0,yn.restoreConsoleHijack(),au.forEach((function(e){delete e.__cacheMap})),au=new Set,gu.forEach((function(e){delete e.__cacheMap})),gu=new Set}},{key:"getVersion",value:function(){return Qn.version}},{key:"getRtcVersion",value:function(){return Qn.platform===Nn.Electron?Ol.getRtcVersion():Eh.getRtcVersion()}}]),s}(y);Vh._engine=void 0})(),__webpack_exports__})()}));
|