forked from ExperienceLovelace/ha-floorplan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfloorplan.js
More file actions
203 lines (182 loc) · 267 KB
/
Copy pathfloorplan.js
File metadata and controls
203 lines (182 loc) · 267 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
var e={625:e=>{!function(){var t={de_DE:{identifier:"de-DE",days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shortDays:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],shortMonths:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d.%m.%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},en_CA:{identifier:"en-CA",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinalSuffixes:["st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},en_US:{identifier:"en-US",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinalSuffixes:["st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%m/%d/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},es_MX:{identifier:"es-MX",days:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],shortDays:["dom","lun","mar","mié","jue","vie","sáb"],months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre"," diciembre"],shortMonths:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},fr_FR:{identifier:"fr-FR",days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],shortDays:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortMonths:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","déc."],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},it_IT:{identifier:"it-IT",days:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],shortDays:["dom","lun","mar","mer","gio","ven","sab"],months:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],shortMonths:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},nl_NL:{identifier:"nl-NL",days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],shortDays:["zo","ma","di","wo","do","vr","za"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortMonths:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},pt_BR:{identifier:"pt-BR",days:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},ru_RU:{identifier:"ru-RU",days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],shortDays:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],shortMonths:["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X",D:"%d.%m.%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},tr_TR:{identifier:"tr-TR",days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],shortDays:["Paz","Pzt","Sal","Çrş","Prş","Cum","Cts"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],shortMonths:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],AM:"ÖÖ",PM:"ÖS",am:"ÖÖ",pm:"ÖS",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},zh_CN:{identifier:"zh-CN",days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],shortDays:["日","一","二","三","四","五","六"],months:["一月份","二月份","三月份","四月份","五月份","六月份","七月份","八月份","九月份","十月份","十一月份","十二月份"],shortMonths:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],AM:"上午",PM:"下午",am:"上午",pm:"下午",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}}},i=t.en_US,n=new function e(n,p,d){var f,g=n||i,m=p||0,y=d||!1,v=0;function b(e,t,i,n){for(var l="",p=null,d=!1,f=e.length,g=!1,v=0;v<f;v++){var x=e.charCodeAt(v);if(!0!==d)37!==x?l+=e[v]:d=!0;else{if(45===x){p="";continue}if(95===x){p=" ";continue}if(48===x){p="0";continue}if(58===x){g&&u("[WARNING] detected use of unsupported %:: or %::: modifiers to strftime"),g=!0;continue}switch(x){case 37:l+="%";break;case 65:l+=i.days[t.getDay()];break;case 66:l+=i.months[t.getMonth()];break;case 67:l+=r(Math.floor(t.getFullYear()/100),p);break;case 68:l+=b(i.formats.D,t,i,n);break;case 70:l+=b(i.formats.F,t,i,n);break;case 72:l+=r(t.getHours(),p);break;case 73:l+=r(a(t.getHours()),p);break;case 76:l+=s(Math.floor(n%1e3));break;case 77:l+=r(t.getMinutes(),p);break;case 80:l+=t.getHours()<12?i.am:i.pm;break;case 82:l+=b(i.formats.R,t,i,n);break;case 83:l+=r(t.getSeconds(),p);break;case 84:l+=b(i.formats.T,t,i,n);break;case 85:l+=r(o(t,"sunday"),p);break;case 87:l+=r(o(t,"monday"),p);break;case 88:l+=b(i.formats.X,t,i,n);break;case 89:l+=t.getFullYear();break;case 90:if(y&&0===m)l+="GMT";else l+=h(t)||"";break;case 97:l+=i.shortDays[t.getDay()];break;case 98:case 104:l+=i.shortMonths[t.getMonth()];break;case 99:l+=b(i.formats.c,t,i,n);break;case 100:l+=r(t.getDate(),p);break;case 101:l+=r(t.getDate(),null==p?" ":p);break;case 106:var w=new Date(t.getFullYear(),0,1);l+=s(_=Math.ceil((t.getTime()-w.getTime())/864e5));break;case 107:l+=r(t.getHours(),null==p?" ":p);break;case 108:l+=r(a(t.getHours()),null==p?" ":p);break;case 109:l+=r(t.getMonth()+1,p);break;case 110:l+="\n";break;case 111:var _=t.getDate();i.ordinalSuffixes?l+=String(_)+(i.ordinalSuffixes[_-1]||c(_)):l+=String(_)+c(_);break;case 112:l+=t.getHours()<12?i.AM:i.PM;break;case 114:l+=b(i.formats.r,t,i,n);break;case 115:l+=Math.floor(n/1e3);break;case 116:l+="\t";break;case 117:l+=0===(_=t.getDay())?7:_;break;case 118:l+=b(i.formats.v,t,i,n);break;case 119:l+=t.getDay();break;case 120:l+=b(i.formats.x,t,i,n);break;case 121:l+=(""+t.getFullYear()).slice(2);break;case 122:if(y&&0===m)l+=g?"+00:00":"+0000";else{var S,k=(S=0!==m?m/6e4:-t.getTimezoneOffset())<0?"-":"+",E=g?":":"",A=Math.floor(Math.abs(S/60)),C=Math.abs(S%60);l+=k+r(A)+E+r(C)}break;default:d&&(l+="%"),l+=e[v]}p=null,d=!1}}return l}var x=function(e,t){var i;if(t){if(i=t.getTime(),y){var n=l(t);if(l(t=new Date(i+n+m))!==n){var r=l(t);t=new Date(i+r+m)}}}else{var s=Date.now();s>v?(v=s,f=new Date(v),i=v,y&&(f=new Date(v+l(f)+m))):i=v,t=f}return b(e,t,g,i)};return x.localize=function(t){return new e(t||g,m,y)},x.localizeByIdentifier=function(e){var i=t[e];return i?x.localize(i):(u('[WARNING] No locale found with identifier "'+e+'".'),x)},x.timezone=function(t){var i=m,n=y,r=typeof t;"number"!==r&&"string"!==r||(n=!0,"string"===r?i=("-"===t[0]?-1:1)*(60*parseInt(t.slice(1,3),10)+parseInt(t.slice(3,5),10))*60*1e3:"number"===r&&(i=60*t*1e3));return new e(g,i,n)},x.utc=function(){return new e(g,m,!0)},x}(i,0,!1);function r(e,t){return""===t||e>9?e:(null==t&&(t="0"),t+e)}function s(e){return e>99?e:e>9?"0"+e:"00"+e}function a(e){return 0===e?12:e>12?e-12:e}function o(e,t){t=t||"sunday";var i=e.getDay();"monday"===t&&(0===i?i=6:i--);var n=Date.UTC(e.getFullYear(),0,1),r=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),s=(Math.floor((r-n)/864e5)+7-i)/7;return Math.floor(s)}function c(e){var t=e%10,i=e%100;if(i>=11&&i<=13||0===t||t>=4)return"th";switch(t){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function l(e){return 6e4*(e.getTimezoneOffset()||0)}function h(e,t){return function(e,t){if(null==t)return null;var i=e.toLocaleString(t,{timeZoneName:"short"}).match(/\s([\w]+)$/);return i&&i[1]}(e,t)||function(e){var t=e.toString().match(/\(([\w\s]+)\)/);return t&&t[1]}(e)}function u(e){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(e)}e.exports=n,"function"!=typeof Date.now&&(Date.now=function(){return+new Date})}()},156:function(e,t,i){e.exports=function(e){var t=Object.freeze({__proto__:null,get FunctionDeclaration(){return Xe},get VariableDeclaration(){return Ke},get VariableDeclarator(){return Qe},get ClassDeclaration(){return et},get ClassBody(){return tt},get MethodDefinition(){return it}}),n=Object.freeze({__proto__:null,get FunctionDeclaration(){return ri},get VariableDeclaration(){return si},get VariableDeclarator(){return ai},get ClassDeclaration(){return oi},get ClassBody(){return ci},get MethodDefinition(){return li}}),r=Object.freeze,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.prototype.hasOwnProperty;function c(e,t){return o.call(e,t)}var l=Object.getOwnPropertyNames,h=Object.setPrototypeOf;function u(e,t){h?h(e,t):e.__proto__=t}var p=Object.getPrototypeOf;function d(e){return p?p(e):e.__proto__}var f=Object.getOwnPropertyDescriptor;function g(e,t,i){for(;t;){var n=f(t,i),r=void 0!==n&&void 0===n.writable&&"function"==typeof n[e]&&n[e];if(r)return r;t=d(t)}}function m(e,t){return g("get",e,t)}function y(e,t){return g("set",e,t)}var v=Object.create;function b(e,t){u(e,t),e.prototype=v(t.prototype,{constructor:{value:e,writable:!0}})}function x(e){for(var t=1;t<arguments.length;++t){var i=arguments[t];for(var n in i)c(i,n)&&(e[n]=i[n])}return e}var w=Object.assign||x,_=[],S=v(null);try{if(!window.Object)throw 0;_=l(S=window).filter((function(e){return"webkitStorageInfo"!==e}))}catch(e){try{if(!i.g.Object)throw 0;_=l(S=i.g).filter((function(e){return"GLOBAL"!==e&&"root"!==e}))}catch(e){try{S.Object=Object}catch(e){}try{S.Function=Function}catch(e){}try{S.Array=Array}catch(e){}try{S.Number=Number}catch(e){}try{S.parseFloat=parseFloat}catch(e){}try{S.parseInt=parseInt}catch(e){}try{S.Infinity=1/0}catch(e){}try{S.NaN=NaN}catch(e){}try{S.undefined=void 0}catch(e){}try{S.Boolean=Boolean}catch(e){}try{S.String=String}catch(e){}try{S.Symbol=Symbol}catch(e){}try{S.Date=Date}catch(e){}try{S.Promise=Promise}catch(e){}try{S.RegExp=RegExp}catch(e){}try{S.Error=Error}catch(e){}try{S.EvalError=EvalError}catch(e){}try{S.RangeError=RangeError}catch(e){}try{S.ReferenceError=ReferenceError}catch(e){}try{S.SyntaxError=SyntaxError}catch(e){}try{S.TypeError=TypeError}catch(e){}try{S.URIError=URIError}catch(e){}try{S.JSON=JSON}catch(e){}try{S.Math=Math}catch(e){}try{S.console=console}catch(e){}try{S.Intl=Intl}catch(e){}try{S.ArrayBuffer=ArrayBuffer}catch(e){}try{S.Uint8Array=Uint8Array}catch(e){}try{S.Int8Array=Int8Array}catch(e){}try{S.Uint16Array=Uint16Array}catch(e){}try{S.Int16Array=Int16Array}catch(e){}try{S.Uint32Array=Uint32Array}catch(e){}try{S.Int32Array=Int32Array}catch(e){}try{S.Float32Array=Float32Array}catch(e){}try{S.Float64Array=Float64Array}catch(e){}try{S.Uint8ClampedArray=Uint8ClampedArray}catch(e){}try{S.DataView=DataView}catch(e){}try{S.Map=Map}catch(e){}try{S.Set=Set}catch(e){}try{S.WeakMap=WeakMap}catch(e){}try{S.WeakSet=WeakSet}catch(e){}try{S.Proxy=Proxy}catch(e){}try{S.Reflect=Reflect}catch(e){}try{S.decodeURI=decodeURI}catch(e){}try{S.decodeURIComponent=decodeURIComponent}catch(e){}try{S.encodeURI=encodeURI}catch(e){}try{S.encodeURIComponent=encodeURIComponent}catch(e){}try{S.escape=escape}catch(e){}try{S.unescape=unescape}catch(e){}try{S.eval=eval}catch(e){}try{S.isFinite=isFinite}catch(e){}try{S.isNaN=isNaN}catch(e){}try{S.SharedArrayBuffer=SharedArrayBuffer}catch(e){}try{S.Atomics=Atomics}catch(e){}try{S.WebAssembly=WebAssembly}catch(e){}try{S.clearInterval=clearInterval}catch(e){}try{S.clearTimeout=clearTimeout}catch(e){}try{S.setInterval=setInterval}catch(e){}try{S.setTimeout=setTimeout}catch(e){}try{S.crypto=crypto}catch(e){}_=l(S)}}S.Symbol&&(!S.Symbol.iterator&&(S.Symbol.iterator=T("iterator")),!S.Symbol.asyncIterator&&(S.Symbol.asyncIterator=T("asynciterator")));for(var k=v({}),E=0;E<_.length;E++){var A=_[E];try{k[A]=S[A]}catch(e){}}var C=T("window");function I(){var e;return w(v(((e={})[C]=S,e)),k)}function T(e){return e+Math.random().toString(36).substring(2)}function P(e){var t;if("function"==typeof Symbol&&!(t=e[Symbol.asyncIterator])&&(t=e[Symbol.iterator]),t)return t.call(e);if("function"==typeof e.next)return e;var i=0;return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}var N="0.4.8",L={RES:void 0},O={RES:void 0},M=T("continue"),D=T("break"),R=T("super"),$=T("supercall"),V=T("noctor"),F=T("clsctor"),j=T("newtarget"),B=T("noinit"),U=T("deadzone"),H=function(){function e(e,t){this.kind=e,this.value=t}return e.prototype.get=function(){return this.value},e.prototype.set=function(e){if("const"===this.kind)throw new TypeError("Assignment to constant variable");return this.value=e},e}(),q=function(){function e(e,t){this.object=e,this.property=t}return e.prototype.get=function(){return this.object[this.property]},e.prototype.set=function(e){return this.object[this.property]=e,!0},e.prototype.del=function(){return delete this.object[this.property]},e}(),z=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=!1),this.context=v(null),this.parent=e,this.isolated=t}return e.prototype.global=function(){for(var e=this;e.parent;)e=e.parent;return e},e.prototype.clone=function(){var t=new e(this.parent,this.isolated);for(var i in this.context){var n=this.context[i];t[n.kind](i,n.get())}return t},e.prototype.find=function(e){if(this.context[e])return this.context[e];if(this.parent)return this.parent.find(e);var t=this.global().find("window").get();return e in t?new q(t,e):null},e.prototype.var=function(e,t){for(var i=this;i.parent&&!i.isolated;)i=i.parent;var n=i.context[e];if(n){if("var"!==n.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");t!==B&&n.set(t)}else i.context[e]=new H("var",t===B?void 0:t);if(!i.parent){var r=i.find("window").get();t!==B&&s(r,e,{value:t,writable:!0,enumerable:!0})}},e.prototype.let=function(e,t){var i=this.context[e];if(i&&i.get()!==U)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("let",t)},e.prototype.const=function(e,t){var i=this.context[e];if(i&&i.get()!==U)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("const",t)},e.prototype.func=function(e,t){var i=this.context[e];if(i&&"var"!==i.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");this.context[e]=new H("var",t)},e}();
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function G(e,t){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return c([e,t])}}function c(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function W(e){var t="function"==typeof Symbol&&e[Symbol.iterator],i=0;return t?t.call(e):{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}function Y(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,s=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a}function J(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Y(arguments[t]));return e}function Z(e,t,i){void 0===i&&(i={});var n=i.getVar,r=void 0!==n&&n,s=i.throwErr,a=void 0===s||s;if("undefined"!==e.name){var o=t.find(e.name);if(o){if(r)return o;var c=o.get();if(c===U)throw new ReferenceError(e.name+" is not defined");return c}if(a)throw new ReferenceError(e.name+" is not defined")}}var X=Object.freeze({__proto__:null,Identifier:Z});function K(e,t){return e.value}var Q=Object.freeze({__proto__:null,Literal:K});function ee(e,t){var i=t.find($);if(i&&!i.get())throw new ReferenceError("Must call super constructor in derived class before accessing 'this' or returning from derived constructor");return t.find("this").get()}function te(e,t){for(var i=[],n=0;n<e.elements.length;n++){var r=e.elements[n];"SpreadElement"===r.type?i=i.concat(we(r,t)):i.push(Ze(r,t))}return i}function ie(e,t){for(var i={},n=0;n<e.properties.length;n++){var r=e.properties[n];if("SpreadElement"===r.type)w(i,we(r,t));else{var o=void 0,c=r.key;o=r.computed?Ze(c,t):"Identifier"===c.type?c.name:""+K(c);var l=Ze(r.value,t),h=r.kind;if("init"===h)i[o]=l;else if("get"===h){var u=a(i,o);s(i,o,{get:l,set:u&&u.set,enumerable:!0,configurable:!0})}else u=a(i,o),s(i,o,{get:u&&u.get,set:l,enumerable:!0,configurable:!0})}}return i}function ne(e,t){if(e.id&&e.id.name){var i=new z(t),n=xi(e,i);return i.const(e.id.name,n),n}return xi(e,t)}function re(e,t){var i=e.argument;switch(e.operator){case"+":return+Ze(i,t);case"-":return-Ze(i,t);case"!":return!Ze(i,t);case"~":return~Ze(i,t);case"void":return void Ze(i,t);case"typeof":return"Identifier"===i.type?typeof Z(i,t,{throwErr:!1}):typeof Ze(i,t);case"delete":if("MemberExpression"===i.type)return le(i,t,{getVar:!0}).del();if("Identifier"===i.type)throw new SyntaxError("Delete of an unqualified identifier in strict mode");return Ze(i,t),!0;default:throw new SyntaxError("Unexpected token "+e.operator)}}function se(e,t){var i,n=e.argument;if("Identifier"===n.type)i=Z(n,t,{getVar:!0});else{if("MemberExpression"!==n.type)throw new SyntaxError("Unexpected token");i=le(n,t,{getVar:!0})}var r=i.get();if("++"===e.operator)return i.set(r+1),e.prefix?i.get():r;if("--"===e.operator)return i.set(r-1),e.prefix?i.get():r;throw new SyntaxError("Unexpected token "+e.operator)}function ae(e,t){var i=Ze(e.left,t),n=Ze(e.right,t);switch(e.operator){case"==":return i==n;case"!=":return i!=n;case"===":return i===n;case"!==":return i!==n;case"<":return i<n;case"<=":return i<=n;case">":return i>n;case">=":return i>=n;case"<<":return i<<n;case">>":return i>>n;case">>>":return i>>>n;case"+":return i+n;case"-":return i-n;case"*":return i*n;case"**":return Math.pow(i,n);case"/":return i/n;case"%":return i%n;case"|":return i|n;case"^":return i^n;case"&":return i&n;case"in":return i in n;case"instanceof":return i instanceof n;default:throw new SyntaxError("Unexpected token "+e.operator)}}function oe(e,t){var i,n=Ze(e.right,t),r=e.left;if("Identifier"===r.type){if(!(i=Z(r,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();i=new q(s,r.name)}}else{if("MemberExpression"!==r.type)return bi(r,t,{feed:n});i=le(r,t,{getVar:!0})}switch(e.operator){case"=":return i.set(n),i.get();case"+=":return i.set(i.get()+n),i.get();case"-=":return i.set(i.get()-n),i.get();case"*=":return i.set(i.get()*n),i.get();case"/=":return i.set(i.get()/n),i.get();case"%=":return i.set(i.get()%n),i.get();case"**=":return i.set(Math.pow(i.get(),n)),i.get();case"<<=":return i.set(i.get()<<n),i.get();case">>=":return i.set(i.get()>>n),i.get();case">>>=":return i.set(i.get()>>>n),i.get();case"|=":return i.set(i.get()|n),i.get();case"^=":return i.set(i.get()^n),i.get();case"&=":return i.set(i.get()&n),i.get();default:throw new SyntaxError("Unexpected token "+e.operator)}}function ce(e,t){switch(e.operator){case"||":return Ze(e.left,t)||Ze(e.right,t);case"&&":return Ze(e.left,t)&&Ze(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}}function le(e,t,i){void 0===i&&(i={});var n,r,a=i.getObj,o=void 0!==a&&a,c=i.getVar,l=void 0!==c&&c;if(n="Super"===e.object.type?xe(e.object,t,{getProto:!0}):Ze(e.object,t),o)return n;if(r=e.computed?Ze(e.property,t):e.property.name,l){var h=y(n,r);if("Super"===e.object.type&&h){var u=t.find("this").get(),p=T(r);return s(u,p,{set:h}),new q(u,p)}return new q(n,r)}var d=m(n,r);return"Super"===e.object.type&&d?(u=t.find("this").get(),d.call(u)):n[r]}function he(e,t){return Ze(e.test,t)?Ze(e.consequent,t):Ze(e.alternate,t)}function ue(e,t){var i,n;if("MemberExpression"===e.callee.type){n=le(e.callee,t,{getObj:!0});var r=void 0;if(r=e.callee.computed?Ze(e.callee.property,t):e.callee.property.name,"Super"===e.callee.object.type){var s=t.find("this").get();i=n[r].bind(s)}else i=n[r];if("function"!=typeof i)throw new TypeError(r+" is not a function");if(i[F])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'")}else if(n=t.find("this").get(),"function"!=typeof(i=Ze(e.callee,t))||"Super"!==e.callee.type&&i[F]){var a;if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(i)}catch(e){a=""+i}throw"function"!=typeof i?new TypeError(a+" is not a function"):new TypeError("Class constructor "+a+" cannot be invoked without 'new'")}for(var o=[],c=0;c<e.arguments.length;c++){var l=e.arguments[c];"SpreadElement"===l.type?o=o.concat(we(l,t)):o.push(Ze(l,t))}if("Super"===e.callee.type){if(t.find($).get())throw new ReferenceError("Super constructor may only be called once");t.find($).set(!0)}return n&&n[C]&&-1!==i.toString().indexOf("[native code]")?i.apply(n[C],o):i.apply(n,o)}function pe(e,t){var i=Ze(e.callee,t);if("function"!=typeof i){var n;if("Identifier"===e.callee.type)n=e.callee.name;else try{n=JSON.stringify(i)}catch(e){n=""+i}throw new TypeError(n+" is not a constructor")}if(i[V])throw new TypeError((i.name||"(intermediate value)")+" is not a constructor");for(var r=[],s=0;s<e.arguments.length;s++){var a=e.arguments[s];"SpreadElement"===a.type?r=r.concat(we(a,t)):r.push(Ze(a,t))}return new(i.bind.apply(i,J([void 0],r)))}function de(e,t){return t.find(j).get()}function fe(e,t){for(var i,n=0;n<e.expressions.length;n++)i=Ze(e.expressions[n],t);return i}function ge(e,t){return xi(e,t)}function me(e,t){for(var i,n,r=e.quasis.slice(),s=e.expressions.slice(),a="";i=r.shift();)a+=ve(i),(n=s.shift())&&(a+=Ze(n,t));return a}function ye(e,t){var i=Ze(e.tag,t),n=e.quasi.quasis,a=n.map((function(e){return e.value.cooked})),o=n.map((function(e){return e.value.raw}));s(a,"raw",{value:r(o)});var c=e.quasi.expressions,l=[];if(c)for(var h=0;h<c.length;h++)l.push(Ze(c[h],t));return i.apply(void 0,J([r(a)],l))}function ve(e,t){return e.value.raw}function be(e,t){if(e.id&&e.id.name){var i=new z(t),n=wi(e,i);return i.const(e.id.name,n),n}return wi(e,t)}function xe(e,t,i){void 0===i&&(i={});var n=i.getProto,r=void 0!==n&&n,s=t.find(R).get();return r?s.prototype:s}function we(e,t){return Ze(e.argument,t)}var _e=Object.freeze({__proto__:null,ThisExpression:ee,ArrayExpression:te,ObjectExpression:ie,FunctionExpression:ne,UnaryExpression:re,UpdateExpression:se,BinaryExpression:ae,AssignmentExpression:oe,LogicalExpression:ce,MemberExpression:le,ConditionalExpression:he,CallExpression:ue,NewExpression:pe,MetaProperty:de,SequenceExpression:fe,ArrowFunctionExpression:ge,TemplateLiteral:me,TaggedTemplateExpression:ye,TemplateElement:ve,ClassExpression:be,Super:xe,SpreadElement:we});function Se(e,t){Ze(e.expression,t)}function ke(e,t,i){void 0===i&&(i={});var n=i.invasived,r=void 0!==n&&n,s=i.hoisted,a=void 0!==s&&s,o=r?t:new z(t);a||yi(e,o,{onlyBlock:!0});for(var c=0;c<e.body.length;c++){var l=Ze(e.body[c],o);if(l===D||l===M||l===O)return l}}function Ee(){}function Ae(){}function Ce(e,t){return O.RES=e.argument?Ze(e.argument,t):void 0,O}function Ie(){return D}function Te(){return M}function Pe(e,t){return Ze(e.test,t)?Ze(e.consequent,t):Ze(e.alternate,t)}function Ne(e,t){for(var i=Ze(e.discriminant,t),n=!1,r=0;r<e.cases.length;r++){var s=e.cases[r];if(n||s.test&&Ze(s.test,t)!==i||(n=!0),n){var a=Le(s,t);if(a===D)break;if(a===M||a===O)return a}}}function Le(e,t){for(var i=0;i<e.consequent.length;i++){var n=Ze(e.consequent[i],t);if(n===D||n===M||n===O)return n}}function Oe(e,t){throw Ze(e.argument,t)}function Me(e,t){try{return ke(e.block,t)}catch(s){if(e.handler){var i=new z(t),n=e.handler.param;if(n)if("Identifier"===n.type){var r=n.name;i.var(r,s)}else bi(n,t,{feed:s});return De(e.handler,i)}throw s}finally{if(e.finalizer){var s=ke(e.finalizer,t);if(s===D||s===M||s===O)return s}}}function De(e,t){return ke(e.body,t,{invasived:!0})}function Re(e,t){for(;Ze(e.test,t);){var i=Ze(e.body,t);if(i===D)break;if(i!==M&&i===O)return i}}function $e(e,t){do{var i=Ze(e.body,t);if(i===D)break;if(i!==M&&i===O)return i}while(Ze(e.test,t))}function Ve(e,t){var i=new z(t);for(Ze(e.init,i);!e.test||Ze(e.test,i);Ze(e.update,i)){var n=new z(i),r=void 0;if((r="BlockStatement"===e.body.type?ke(e.body,n,{invasived:!0}):Ze(e.body,n))===D)break;if(r!==M&&r===O)return r}}function Fe(e,t){for(var i in Ze(e.right,t)){var n=_i(e,t,{value:i});if(n===D)break;if(n!==M&&n===O)return n}}function je(e,t){var i,n,r=Ze(e.right,t);try{for(var s=W(r),a=s.next();!a.done;a=s.next()){var o=_i(e,t,{value:a.value});if(o===D)break;if(o!==M&&o===O)return o}}catch(e){i={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}}var Be=Object.freeze({__proto__:null,ExpressionStatement:Se,BlockStatement:ke,EmptyStatement:Ee,DebuggerStatement:Ae,ReturnStatement:Ce,BreakStatement:Ie,ContinueStatement:Te,IfStatement:Pe,SwitchStatement:Ne,SwitchCase:Le,ThrowStatement:Oe,TryStatement:Me,CatchClause:De,WhileStatement:Re,DoWhileStatement:$e,ForStatement:Ve,ForInStatement:Fe,ForOfStatement:je});function Ue(e,t,i){void 0===i&&(i={});for(var n=i.kind,r=void 0===n?"var":n,s=i.hoist,a=void 0!==s&&s,o=i.onlyBlock,c=void 0!==o&&o,l=i.feed,h=void 0===l?{}:l,u=[],p=0;p<e.properties.length;p++){var d=e.properties[p];if(a)(c||"var"===r)&&("Property"===d.type?"Identifier"===(f=d.value).type?t[r](f.name,c?U:"var"===r?B:void 0):bi(f,t,{kind:r,hoist:a,onlyBlock:c}):qe(d,t,{kind:r,hoist:a,onlyBlock:c}));else if("Property"===d.type){var f,g=void 0;g=d.computed?Ze(d.key,t):d.key.name,u.push(g),"Identifier"===(f=d.value).type?t[r](f.name,h[g]):bi(f,t,{kind:r,feed:h[g]})}else{for(var m=w({},h),y=0;y<u.length;y++)delete m[u[y]];qe(d,t,{kind:r,feed:m})}}}function He(e,t,i){void 0===i&&(i={});for(var n=i.kind,r=i.hoist,s=void 0!==r&&r,a=i.onlyBlock,o=void 0!==a&&a,c=i.feed,l=void 0===c?[]:c,h=[],u=0;u<e.elements.length;u++){var p=e.elements[u];if(p)if(s)(o||"var"===n)&&("Identifier"===p.type?t[n](p.name,o?U:"var"===n?B:void 0):bi(p,t,{kind:n,hoist:s,onlyBlock:o}));else if("Identifier"===p.type)if(n)t[n](p.name,l[u]);else{var d=Z(p,t,{getVar:!0});d.set(l[u]),h.push(d.get())}else"RestElement"===p.type?qe(p,t,{kind:n,feed:l.slice(u)}):bi(p,t,{kind:n,feed:l[u]})}if(h.length)return h}function qe(e,t,i){void 0===i&&(i={});var n=i.kind,r=i.hoist,s=void 0!==r&&r,a=i.onlyBlock,o=void 0!==a&&a,c=i.feed,l=void 0===c?[]:c,h=e.argument;s?(o||"var"===n)&&("Identifier"===h.type?t[n](h.name,o?U:"var"===n?B:void 0):bi(h,t,{kind:n,hoist:s,onlyBlock:o})):"Identifier"===h.type?n?t[n](h.name,l):Z(h,t,{getVar:!0}).set(l):bi(h,t,{kind:n,feed:l})}function ze(e,t,i){void 0===i&&(i={});var n=i.kind,r=void 0===n?"var":n,s=i.hoist,a=void 0!==s&&s,o=i.onlyBlock,c=void 0!==o&&o,l=i.feed,h=void 0===l?Ze(e.right,t):l,u=e.left;a?(c||"var"===r)&&("Identifier"===u.type?t[r](u.name,c?U:"var"===r?B:void 0):bi(u,t,{kind:r,hoist:a,onlyBlock:c})):"Identifier"===u.type?t[r](u.name,h):bi(u,t,{kind:r,feed:h})}var Ge=Object.freeze({__proto__:null,ObjectPattern:Ue,ArrayPattern:He,RestElement:qe,AssignmentPattern:ze});function We(e,t){for(var i=0;i<e.body.length;i++)Ze(e.body[i],t)}var Ye,Je=Object.freeze({__proto__:null,Program:We});function Ze(e,i){if(e){Ye||(Ye=w({},t,_e,X,Be,Q,Ge,Je));var n=Ye[e.type];if(n)return n(e,i);throw new Error(e.type+" isn't implemented")}}function Xe(e,t){t.func(e.id.name,xi(e,t))}function Ke(e,t,i){void 0===i&&(i={});for(var n=0;n<e.declarations.length;n++)Qe(e.declarations[n],t,w({kind:e.kind},i))}function Qe(e,t,i){void 0===i&&(i={});var n=i.kind,r=void 0===n?"var":n,a=i.hoist,o=void 0!==a&&a,c=i.onlyBlock,l=void 0!==c&&c,h=i.feed;if(o)(l||"var"===r)&&("Identifier"===e.id.type?t[r](e.id.name,l?U:"var"===r?B:void 0):bi(e.id,t,{kind:r,hoist:o,onlyBlock:l}));else{var u="feed"in i,p=u?h:Ze(e.init,t);if("Identifier"===e.id.type){var d=e.id.name;"var"!==r||e.init||u?t[r](d,p):t.var(d,B),e.init&&-1!==["ClassExpression","FunctionExpression","ArrowFunctionExpression"].indexOf(e.init.type)&&!p.name&&s(p,"name",{value:d,configurable:!0})}else bi(e.id,t,{kind:r,feed:p})}}function et(e,t){t.func(e.id.name,wi(e,t))}function tt(e,t,i){void 0===i&&(i={});for(var n=i.klass,r=i.superClass,s=0;s<e.body.length;s++)it(e.body[s],t,{klass:n,superClass:r})}function it(e,t,i){void 0===i&&(i={});var n,r=i.klass,o=i.superClass;if(e.computed)n=Ze(e.key,t);else{if("Identifier"!==e.key.type)throw new SyntaxError("Unexpected token");n=e.key.name}var c=e.static?r:r.prototype,l=xi(e.value,t,{superClass:o});switch(e.kind){case"constructor":break;case"method":s(c,n,{value:l,writable:!0,configurable:!0});break;case"get":var h=a(c,n);s(c,n,{get:l,set:h&&h.set,configurable:!0});break;case"set":h=a(c,n),s(c,n,{get:h&&h.get,set:l,configurable:!0});break;default:throw new SyntaxError("Unexpected token")}}function nt(e,t,i){var n,r,s,a,o,c;return void 0===i&&(i={}),G(this,(function(l){if(n=i.getVar,r=void 0!==n&&n,s=i.throwErr,a=void 0===s||s,"undefined"===e.name)return[2,void 0];if(o=t.find(e.name)){if(r)return[2,o];if((c=o.get())===U)throw new ReferenceError(e.name+" is not defined");return[2,c]}if(a)throw new ReferenceError(e.name+" is not defined");return[2,void 0]}))}var rt=Object.freeze({__proto__:null,Identifier:nt});function st(e,t){return G(this,(function(t){return[2,e.value]}))}var at=Object.freeze({__proto__:null,Literal:st});function ot(e,t){var i;return G(this,(function(e){if((i=t.find($))&&!i.get())throw new ReferenceError("Must call super constructor in derived class before accessing 'this' or returning from derived constructor");return[2,t.find("this").get()]}))}function ct(e,t){var i,n,r,s,a,o,c;return G(this,(function(l){switch(l.label){case 0:i=[],n=0,l.label=1;case 1:return n<e.elements.length?"SpreadElement"!==(r=e.elements[n]).type?[3,3]:(a=(s=i).concat,[5,W(It(r,t))]):[3,6];case 2:return i=a.apply(s,[l.sent()]),[3,5];case 3:return c=(o=i).push,[5,W(ni(r,t))];case 4:c.apply(o,[l.sent()]),l.label=5;case 5:return n++,[3,1];case 6:return[2,i]}}))}function lt(e,t){var i,n,r,o,c,l,h,u,p,d,f;return G(this,(function(g){switch(g.label){case 0:i={},n=0,g.label=1;case 1:return n<e.properties.length?"SpreadElement"!==(r=e.properties[n]).type?[3,3]:(o=w,c=[i],[5,W(It(r,t))]):[3,11];case 2:return o.apply(void 0,c.concat([g.sent()])),[3,10];case 3:return l=void 0,h=r.key,r.computed?[5,W(ni(h,t))]:[3,5];case 4:return l=g.sent(),[3,8];case 5:return"Identifier"!==h.type?[3,6]:(l=h.name,[3,8]);case 6:return u="",[5,W(st(h))];case 7:l=u+g.sent(),g.label=8;case 8:return[5,W(ni(r.value,t))];case 9:p=g.sent(),"init"===(d=r.kind)?i[l]=p:"get"===d?(f=a(i,l),s(i,l,{get:p,set:f&&f.set,enumerable:!0,configurable:!0})):(f=a(i,l),s(i,l,{get:f&&f.get,set:p,enumerable:!0,configurable:!0})),g.label=10;case 10:return n++,[3,1];case 11:return[2,i]}}))}function ht(e,t){var i,n;return G(this,(function(r){return e.id&&e.id.name?(i=new z(t),n=fi(e,i),i.const(e.id.name,n),[2,n]):[2,fi(e,t)]}))}function ut(e,t){var i;return G(this,(function(n){switch(n.label){case 0:switch(i=e.argument,e.operator){case"+":return[3,1];case"-":return[3,3];case"!":return[3,5];case"~":return[3,7];case"void":return[3,9];case"typeof":return[3,11];case"delete":return[3,15]}return[3,20];case 1:case 3:case 5:case 7:case 9:case 13:case 18:return[5,W(ni(i,t))];case 2:return[2,+n.sent()];case 4:return[2,-n.sent()];case 6:return[2,!n.sent()];case 8:return[2,~n.sent()];case 10:return[2,void n.sent()];case 11:return"Identifier"!==i.type?[3,13]:[5,W(nt(i,t,{throwErr:!1}))];case 12:case 14:return[2,typeof n.sent()];case 15:return"MemberExpression"!==i.type?[3,17]:[5,W(mt(i,t,{getVar:!0}))];case 16:return[2,n.sent().del()];case 17:if("Identifier"!==i.type)return[3,18];throw new SyntaxError("Delete of an unqualified identifier in strict mode");case 19:return n.sent(),[2,!0];case 20:throw new SyntaxError("Unexpected token "+e.operator)}}))}function pt(e,t){var i,n,r;return G(this,(function(s){switch(s.label){case 0:return"Identifier"!==(i=e.argument).type?[3,2]:[5,W(nt(i,t,{getVar:!0}))];case 1:case 3:return n=s.sent(),[3,5];case 2:return"MemberExpression"!==i.type?[3,4]:[5,W(mt(i,t,{getVar:!0}))];case 4:throw new SyntaxError("Unexpected token");case 5:if(r=n.get(),"++"===e.operator)return n.set(r+1),[2,e.prefix?n.get():r];if("--"===e.operator)return n.set(r-1),[2,e.prefix?n.get():r];throw new SyntaxError("Unexpected token "+e.operator)}}))}function dt(e,t){var i,n;return G(this,(function(r){switch(r.label){case 0:return[5,W(ni(e.left,t))];case 1:return i=r.sent(),[5,W(ni(e.right,t))];case 2:switch(n=r.sent(),e.operator){case"==":return[2,i==n];case"!=":return[2,i!=n];case"===":return[2,i===n];case"!==":return[2,i!==n];case"<":return[2,i<n];case"<=":return[2,i<=n];case">":return[2,i>n];case">=":return[2,i>=n];case"<<":return[2,i<<n];case">>":return[2,i>>n];case">>>":return[2,i>>>n];case"+":return[2,i+n];case"-":return[2,i-n];case"*":return[2,i*n];case"**":return[2,Math.pow(i,n)];case"/":return[2,i/n];case"%":return[2,i%n];case"|":return[2,i|n];case"^":return[2,i^n];case"&":return[2,i&n];case"in":return[2,i in n];case"instanceof":return[2,i instanceof n];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))}function ft(e,t){var i,n,r,s;return G(this,(function(a){switch(a.label){case 0:return[5,W(ni(e.right,t))];case 1:return i=a.sent(),"Identifier"!==(n=e.left).type?[3,3]:[5,W(nt(n,t,{getVar:!0,throwErr:!1}))];case 2:return(r=a.sent())||(s=t.global().find("window").get(),r=new q(s,n.name)),[3,7];case 3:return"MemberExpression"!==n.type?[3,5]:[5,W(mt(n,t,{getVar:!0}))];case 4:return r=a.sent(),[3,7];case 5:return[5,W(di(n,t,{feed:i}))];case 6:return[2,a.sent()];case 7:switch(e.operator){case"=":return r.set(i),[2,r.get()];case"+=":return r.set(r.get()+i),[2,r.get()];case"-=":return r.set(r.get()-i),[2,r.get()];case"*=":return r.set(r.get()*i),[2,r.get()];case"/=":return r.set(r.get()/i),[2,r.get()];case"%=":return r.set(r.get()%i),[2,r.get()];case"**=":return r.set(Math.pow(r.get(),i)),[2,r.get()];case"<<=":return r.set(r.get()<<i),[2,r.get()];case">>=":return r.set(r.get()>>i),[2,r.get()];case">>>=":return r.set(r.get()>>>i),[2,r.get()];case"|=":return r.set(r.get()|i),[2,r.get()];case"^=":return r.set(r.get()^i),[2,r.get()];case"&=":return r.set(r.get()&i),[2,r.get()];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))}function gt(e,t){var i,n;return G(this,(function(r){switch(r.label){case 0:switch(e.operator){case"||":return[3,1];case"&&":return[3,5]}return[3,9];case 1:return[5,W(ni(e.left,t))];case 2:return(i=r.sent())?[3,4]:[5,W(ni(e.right,t))];case 3:i=r.sent(),r.label=4;case 4:return[2,i];case 5:return[5,W(ni(e.left,t))];case 6:return(n=r.sent())?[5,W(ni(e.right,t))]:[3,8];case 7:n=r.sent(),r.label=8;case 8:return[2,n];case 9:throw new SyntaxError("Unexpected token "+e.operator)}}))}function mt(e,t,i){var n,r,a,o,c,l,h,u,p,d;return void 0===i&&(i={}),G(this,(function(f){switch(f.label){case 0:return n=i.getObj,r=void 0!==n&&n,a=i.getVar,o=void 0!==a&&a,"Super"!==e.object.type?[3,2]:[5,W(Ct(e.object,t,{getProto:!0}))];case 1:return c=f.sent(),[3,4];case 2:return[5,W(ni(e.object,t))];case 3:c=f.sent(),f.label=4;case 4:return r?[2,c]:e.computed?[5,W(ni(e.property,t))]:[3,6];case 5:return l=f.sent(),[3,7];case 6:l=e.property.name,f.label=7;case 7:return o?(h=y(c,l),"Super"===e.object.type&&h?(d=t.find("this").get(),u=T(l),s(d,u,{set:h}),[2,new q(d,u)]):[2,new q(c,l)]):(p=m(c,l),"Super"===e.object.type&&p?(d=t.find("this").get(),[2,p.call(d)]):[2,c[l]])}}))}function yt(e,t){var i;return G(this,(function(n){switch(n.label){case 0:return[5,W(ni(e.test,t))];case 1:return n.sent()?[5,W(ni(e.consequent,t))]:[3,3];case 2:return i=n.sent(),[3,5];case 3:return[5,W(ni(e.alternate,t))];case 4:i=n.sent(),n.label=5;case 5:return[2,i]}}))}function vt(e,t){var i,n,r,s,a,o,c,l,h,u,p,d;return G(this,(function(f){switch(f.label){case 0:return"MemberExpression"!==e.callee.type?[3,5]:[5,W(mt(e.callee,t,{getObj:!0}))];case 1:return n=f.sent(),r=void 0,e.callee.computed?[5,W(ni(e.callee.property,t))]:[3,3];case 2:return r=f.sent(),[3,4];case 3:r=e.callee.property.name,f.label=4;case 4:if("Super"===e.callee.object.type?(s=t.find("this").get(),i=n[r].bind(s)):i=n[r],"function"!=typeof i)throw new TypeError(r+" is not a function");if(i[F])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'");return[3,7];case 5:return n=t.find("this").get(),[5,W(ni(e.callee,t))];case 6:if("function"!=typeof(i=f.sent())||"Super"!==e.callee.type&&i[F]){if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(i)}catch(e){a=""+i}throw"function"!=typeof i?new TypeError(a+" is not a function"):new TypeError("Class constructor "+a+" cannot be invoked without 'new'")}f.label=7;case 7:o=[],c=0,f.label=8;case 8:return c<e.arguments.length?"SpreadElement"!==(l=e.arguments[c]).type?[3,10]:(u=(h=o).concat,[5,W(It(l,t))]):[3,13];case 9:return o=u.apply(h,[f.sent()]),[3,12];case 10:return d=(p=o).push,[5,W(ni(l,t))];case 11:d.apply(p,[f.sent()]),f.label=12;case 12:return c++,[3,8];case 13:if("Super"===e.callee.type){if(t.find($).get())throw new ReferenceError("Super constructor may only be called once");t.find($).set(!0)}return n&&n[C]&&-1!==i.toString().indexOf("[native code]")?[2,i.apply(n[C],o)]:[2,i.apply(n,o)]}}))}function bt(e,t){var i,n,r,s,a,o,c,l,h;return G(this,(function(u){switch(u.label){case 0:return[5,W(ni(e.callee,t))];case 1:if("function"!=typeof(i=u.sent())){if("Identifier"===e.callee.type)n=e.callee.name;else try{n=JSON.stringify(i)}catch(e){n=""+i}throw new TypeError(n+" is not a constructor")}if(i[V])throw new TypeError((i.name||"(intermediate value)")+" is not a constructor");r=[],s=0,u.label=2;case 2:return s<e.arguments.length?"SpreadElement"!==(a=e.arguments[s]).type?[3,4]:(c=(o=r).concat,[5,W(It(a,t))]):[3,7];case 3:return r=c.apply(o,[u.sent()]),[3,6];case 4:return h=(l=r).push,[5,W(ni(a,t))];case 5:h.apply(l,[u.sent()]),u.label=6;case 6:return s++,[3,2];case 7:return[2,new(i.bind.apply(i,J([void 0],r)))]}}))}function xt(e,t){return G(this,(function(e){return[2,t.find(j).get()]}))}function wt(e,t){var i,n;return G(this,(function(r){switch(r.label){case 0:n=0,r.label=1;case 1:return n<e.expressions.length?[5,W(ni(e.expressions[n],t))]:[3,4];case 2:i=r.sent(),r.label=3;case 3:return n++,[3,1];case 4:return[2,i]}}))}function _t(e,t){return G(this,(function(i){return[2,fi(e,t)]}))}function St(e,t){var i,n,r,s,a,o,c;return G(this,(function(l){switch(l.label){case 0:i=e.quasis.slice(),n=e.expressions.slice(),r="",l.label=1;case 1:return(s=i.shift())?(o=r,[5,W(Et(s))]):[3,5];case 2:return r=o+l.sent(),(a=n.shift())?(c=r,[5,W(ni(a,t))]):[3,4];case 3:r=c+l.sent(),l.label=4;case 4:return[3,1];case 5:return[2,r]}}))}function kt(e,t){var i,n,a,o,c,l,h,u,p;return G(this,(function(d){switch(d.label){case 0:return[5,W(ni(e.tag,t))];case 1:if(i=d.sent(),n=e.quasi.quasis,a=n.map((function(e){return e.value.cooked})),o=n.map((function(e){return e.value.raw})),s(a,"raw",{value:r(o)}),c=e.quasi.expressions,l=[],!c)return[3,5];h=0,d.label=2;case 2:return h<c.length?(p=(u=l).push,[5,W(ni(c[h],t))]):[3,5];case 3:p.apply(u,[d.sent()]),d.label=4;case 4:return h++,[3,2];case 5:return[2,i.apply(void 0,J([r(a)],l))]}}))}function Et(e,t){return G(this,(function(t){return[2,e.value.raw]}))}function At(e,t){var i,n;return G(this,(function(r){switch(r.label){case 0:return e.id&&e.id.name?(i=new z(t),[5,W(gi(e,i))]):[3,2];case 1:return n=r.sent(),i.const(e.id.name,n),[2,n];case 2:return[5,W(gi(e,t))];case 3:return[2,r.sent()]}}))}function Ct(e,t,i){var n,r,s;return void 0===i&&(i={}),G(this,(function(e){return n=i.getProto,r=void 0!==n&&n,s=t.find(R).get(),[2,r?s.prototype:s]}))}function It(e,t){return G(this,(function(i){switch(i.label){case 0:return[5,W(ni(e.argument,t))];case 1:return[2,i.sent()]}}))}function Tt(e,t){var i,n;return G(this,(function(r){switch(r.label){case 0:return[5,W(ni(e.argument,t))];case 1:return i=r.sent(),e.delegate?[5,W(i)]:[3,3];case 2:return n=r.sent(),[3,5];case 3:return[4,i];case 4:n=r.sent(),r.label=5;case 5:return[2,n]}}))}function Pt(e,t){var i;return G(this,(function(n){switch(n.label){case 0:return i=L,[5,W(ni(e.argument,t))];case 1:return i.RES=n.sent(),[4,L];case 2:return[2,n.sent()]}}))}var Nt=Object.freeze({__proto__:null,ThisExpression:ot,ArrayExpression:ct,ObjectExpression:lt,FunctionExpression:ht,UnaryExpression:ut,UpdateExpression:pt,BinaryExpression:dt,AssignmentExpression:ft,LogicalExpression:gt,MemberExpression:mt,ConditionalExpression:yt,CallExpression:vt,NewExpression:bt,MetaProperty:xt,SequenceExpression:wt,ArrowFunctionExpression:_t,TemplateLiteral:St,TaggedTemplateExpression:kt,TemplateElement:Et,ClassExpression:At,Super:Ct,SpreadElement:It,YieldExpression:Tt,AwaitExpression:Pt});function Lt(e,t){return G(this,(function(i){switch(i.label){case 0:return[5,W(ni(e.expression,t))];case 1:return i.sent(),[2]}}))}function Ot(e,t,i){var n,r,s,a,o,c,l;return void 0===i&&(i={}),G(this,(function(h){switch(h.label){case 0:return n=i.invasived,r=void 0!==n&&n,s=i.hoisted,a=void 0!==s&&s,o=r?t:new z(t),a?[3,2]:[5,W(ui(e,o,{onlyBlock:!0}))];case 1:h.sent(),h.label=2;case 2:c=0,h.label=3;case 3:return c<e.body.length?[5,W(ni(e.body[c],o))]:[3,6];case 4:if((l=h.sent())===D||l===M||l===O)return[2,l];h.label=5;case 5:return c++,[3,3];case 6:return[2]}}))}function Mt(){return G(this,(function(e){return[2]}))}function Dt(){return G(this,(function(e){return[2]}))}function Rt(e,t){var i,n;return G(this,(function(r){switch(r.label){case 0:return i=O,e.argument?[5,W(ni(e.argument,t))]:[3,2];case 1:return n=r.sent(),[3,3];case 2:n=void 0,r.label=3;case 3:return i.RES=n,[2,O]}}))}function $t(){return G(this,(function(e){return[2,D]}))}function Vt(){return G(this,(function(e){return[2,M]}))}function Ft(e,t){return G(this,(function(i){switch(i.label){case 0:return[5,W(ni(e.test,t))];case 1:return i.sent()?[5,W(ni(e.consequent,t))]:[3,3];case 2:case 4:return[2,i.sent()];case 3:return[5,W(ni(e.alternate,t))]}}))}function jt(e,t){var i,n,r,s,a,o,c;return G(this,(function(l){switch(l.label){case 0:return[5,W(ni(e.discriminant,t))];case 1:i=l.sent(),n=!1,r=0,l.label=2;case 2:return r<e.cases.length?(s=e.cases[r],(a=!n)?(o=!s.test)?[3,4]:[5,W(ni(s.test,t))]:[3,5]):[3,8];case 3:o=l.sent()===i,l.label=4;case 4:a=o,l.label=5;case 5:return a&&(n=!0),n?[5,W(Bt(s,t))]:[3,7];case 6:if((c=l.sent())===D)return[3,8];if(c===M||c===O)return[2,c];l.label=7;case 7:return r++,[3,2];case 8:return[2]}}))}function Bt(e,t){var i,n;return G(this,(function(r){switch(r.label){case 0:i=0,r.label=1;case 1:return i<e.consequent.length?[5,W(ni(e.consequent[i],t))]:[3,4];case 2:if((n=r.sent())===D||n===M||n===O)return[2,n];r.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}function Ut(e,t){return G(this,(function(i){switch(i.label){case 0:return[5,W(ni(e.argument,t))];case 1:throw i.sent()}}))}function Ht(e,t){var i,n,r,s,a;return G(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,9,12]),[5,W(Ot(e.block,t))];case 1:return[2,o.sent()];case 2:return i=o.sent(),e.handler?(n=new z(t),(r=e.handler.param)?"Identifier"!==r.type?[3,3]:(s=r.name,n.var(s,i),[3,5]):[3,5]):[3,7];case 3:return[5,W(di(r,t,{feed:i}))];case 4:o.sent(),o.label=5;case 5:return[5,W(qt(e.handler,n))];case 6:return[2,o.sent()];case 7:throw i;case 8:return[3,12];case 9:return e.finalizer?[5,W(Ot(e.finalizer,t))]:[3,11];case 10:if((a=o.sent())===D||a===M||a===O)return[2,a];o.label=11;case 11:return[7];case 12:return[2]}}))}function qt(e,t){return G(this,(function(i){switch(i.label){case 0:return[5,W(Ot(e.body,t,{invasived:!0}))];case 1:return[2,i.sent()]}}))}function zt(e,t){var i;return G(this,(function(n){switch(n.label){case 0:return[5,W(ni(e.test,t))];case 1:return n.sent()?[5,W(ni(e.body,t))]:[3,3];case 2:return(i=n.sent())===D?[3,3]:i===M?[3,0]:i===O?[2,i]:[3,0];case 3:return[2]}}))}function Gt(e,t){var i;return G(this,(function(n){switch(n.label){case 0:return[5,W(ni(e.body,t))];case 1:if((i=n.sent())===D)return[3,4];if(i===M)return[3,2];if(i===O)return[2,i];n.label=2;case 2:return[5,W(ni(e.test,t))];case 3:if(n.sent())return[3,0];n.label=4;case 4:return[2]}}))}function Wt(e,t){var i,n,r,s;return G(this,(function(a){switch(a.label){case 0:return i=new z(t),[5,W(ni(e.init,i))];case 1:a.sent(),a.label=2;case 2:return e.test?[5,W(ni(e.test,i))]:[3,4];case 3:return n=a.sent(),[3,5];case 4:n=!0,a.label=5;case 5:return n?(r=new z(i),s=void 0,"BlockStatement"!==e.body.type?[3,7]:[5,W(Ot(e.body,r,{invasived:!0}))]):[3,12];case 6:return s=a.sent(),[3,9];case 7:return[5,W(ni(e.body,r))];case 8:s=a.sent(),a.label=9;case 9:if(s===D)return[3,12];if(s===M)return[3,10];if(s===O)return[2,s];a.label=10;case 10:return[5,W(ni(e.update,i))];case 11:return a.sent(),[3,2];case 12:return[2]}}))}function Yt(e,t){var i,n,r,s,a;return G(this,(function(o){switch(o.label){case 0:return i=[],[5,W(ni(e.right,t))];case 1:for(n in o.sent())i.push(n);r=0,o.label=2;case 2:return r<i.length?(s=i[r],[5,W(mi(e,t,{value:s}))]):[3,5];case 3:if((a=o.sent())===D)return[3,5];if(a===M)return[3,4];if(a===O)return[2,a];o.label=4;case 4:return r++,[3,2];case 5:return[2]}}))}function Jt(e,t){var i,n,r,s,a,o,c,l,h,u;return G(this,(function(p){switch(p.label){case 0:return[5,W(ni(e.right,t))];case 1:return i=p.sent(),e.await?(n=P(i),r=void 0,L.RES=n.next(),[4,L]):[3,8];case 2:r=p.sent(),p.label=3;case 3:return r.done?[3,7]:[5,W(mi(e,t,{value:r.value}))];case 4:if((c=p.sent())===D)return[3,7];if(c===M)return[3,5];if(c===O)return[2,c];p.label=5;case 5:return L.RES=n.next(),[4,L];case 6:return r=p.sent(),[3,3];case 7:return[3,15];case 8:p.trys.push([8,13,14,15]),s=W(i),a=s.next(),p.label=9;case 9:return a.done?[3,12]:(o=a.value,[5,W(mi(e,t,{value:o}))]);case 10:if((c=p.sent())===D)return[3,12];if(c===M)return[3,11];if(c===O)return[2,c];p.label=11;case 11:return a=s.next(),[3,9];case 12:return[3,15];case 13:return l=p.sent(),h={error:l},[3,15];case 14:try{a&&!a.done&&(u=s.return)&&u.call(s)}finally{if(h)throw h.error}return[7];case 15:return[2]}}))}var Zt=Object.freeze({__proto__:null,ExpressionStatement:Lt,BlockStatement:Ot,EmptyStatement:Mt,DebuggerStatement:Dt,ReturnStatement:Rt,BreakStatement:$t,ContinueStatement:Vt,IfStatement:Ft,SwitchStatement:jt,SwitchCase:Bt,ThrowStatement:Ut,TryStatement:Ht,CatchClause:qt,WhileStatement:zt,DoWhileStatement:Gt,ForStatement:Wt,ForInStatement:Yt,ForOfStatement:Jt});function Xt(e,t,i){var n,r,s,a,o,c,l,h,u,p,d,f,g,m,y;return void 0===i&&(i={}),G(this,(function(v){switch(v.label){case 0:n=i.kind,r=void 0===n?"var":n,s=i.hoist,a=void 0!==s&&s,o=i.onlyBlock,c=void 0!==o&&o,l=i.feed,h=void 0===l?{}:l,u=[],p=0,v.label=1;case 1:return p<e.properties.length?(d=e.properties[p],a?c||"var"===r?"Property"!==d.type?[3,5]:"Identifier"!==(g=d.value).type?[3,2]:(t[r](g.name,c?U:"var"===r?B:void 0),[3,4]):[3,7]:[3,8]):[3,18];case 2:return[5,W(di(g,t,{kind:r,hoist:a,onlyBlock:c}))];case 3:v.sent(),v.label=4;case 4:return[3,7];case 5:return[5,W(Qt(d,t,{kind:r,hoist:a,onlyBlock:c}))];case 6:v.sent(),v.label=7;case 7:return[3,17];case 8:return"Property"!==d.type?[3,15]:(f=void 0,d.computed?[5,W(ni(d.key,t))]:[3,10]);case 9:return f=v.sent(),[3,11];case 10:f=d.key.name,v.label=11;case 11:return u.push(f),"Identifier"!==(g=d.value).type?[3,12]:(t[r](g.name,h[f]),[3,14]);case 12:return[5,W(di(g,t,{kind:r,feed:h[f]}))];case 13:v.sent(),v.label=14;case 14:return[3,17];case 15:for(m=w({},h),y=0;y<u.length;y++)delete m[u[y]];return[5,W(Qt(d,t,{kind:r,feed:m}))];case 16:v.sent(),v.label=17;case 17:return p++,[3,1];case 18:return[2]}}))}function Kt(e,t,i){var n,r,s,a,o,c,l,h,u,p,d;return void 0===i&&(i={}),G(this,(function(f){switch(f.label){case 0:n=i.kind,r=i.hoist,s=void 0!==r&&r,a=i.onlyBlock,o=void 0!==a&&a,c=i.feed,l=void 0===c?[]:c,h=[],u=0,f.label=1;case 1:return u<e.elements.length?(p=e.elements[u])?s?o||"var"===n?"Identifier"!==p.type?[3,2]:(t[n](p.name,o?U:"var"===n?B:void 0),[3,4]):[3,4]:[3,5]:[3,13]:[3,14];case 2:return[5,W(di(p,t,{kind:n,hoist:s,onlyBlock:o}))];case 3:f.sent(),f.label=4;case 4:return[3,13];case 5:return"Identifier"!==p.type?[3,9]:n?(t[n](p.name,l[u]),[3,8]):[3,6];case 6:return[5,W(nt(p,t,{getVar:!0}))];case 7:(d=f.sent()).set(l[u]),h.push(d.get()),f.label=8;case 8:return[3,13];case 9:return"RestElement"!==p.type?[3,11]:[5,W(Qt(p,t,{kind:n,feed:l.slice(u)}))];case 10:return f.sent(),[3,13];case 11:return[5,W(di(p,t,{kind:n,feed:l[u]}))];case 12:f.sent(),f.label=13;case 13:return u++,[3,1];case 14:return h.length?[2,h]:[2]}}))}function Qt(e,t,i){var n,r,s,a,o,c,l,h;return void 0===i&&(i={}),G(this,(function(u){switch(u.label){case 0:return n=i.kind,r=i.hoist,s=void 0!==r&&r,a=i.onlyBlock,o=void 0!==a&&a,c=i.feed,l=void 0===c?[]:c,h=e.argument,s?o||"var"===n?"Identifier"!==h.type?[3,1]:(t[n](h.name,o?U:"var"===n?B:void 0),[3,3]):[3,3]:[3,4];case 1:return[5,W(di(h,t,{kind:n,hoist:s,onlyBlock:o}))];case 2:u.sent(),u.label=3;case 3:return[3,10];case 4:return"Identifier"!==h.type?[3,8]:n?(t[n](h.name,l),[3,7]):[3,5];case 5:return[5,W(nt(h,t,{getVar:!0}))];case 6:u.sent().set(l),u.label=7;case 7:return[3,10];case 8:return[5,W(di(h,t,{kind:n,feed:l}))];case 9:u.sent(),u.label=10;case 10:return[2]}}))}function ei(e,t,i){var n,r,s,a,o,c,l,h,u,p;return void 0===i&&(i={}),G(this,(function(d){switch(d.label){case 0:return n=i.kind,r=void 0===n?"var":n,s=i.hoist,a=void 0!==s&&s,o=i.onlyBlock,c=void 0!==o&&o,void 0!==(l=i.feed)?[3,2]:[5,W(ni(e.right,t))];case 1:return u=d.sent(),[3,3];case 2:u=l,d.label=3;case 3:return h=u,p=e.left,a?c||"var"===r?"Identifier"!==p.type?[3,4]:(t[r](p.name,c?U:"var"===r?B:void 0),[3,6]):[3,6]:[3,7];case 4:return[5,W(di(p,t,{kind:r,hoist:a,onlyBlock:c}))];case 5:d.sent(),d.label=6;case 6:return[3,10];case 7:return"Identifier"!==p.type?[3,8]:(t[r](p.name,h),[3,10]);case 8:return[5,W(di(p,t,{kind:r,feed:h}))];case 9:d.sent(),d.label=10;case 10:return[2]}}))}var ti,ii=Object.freeze({__proto__:null,ObjectPattern:Xt,ArrayPattern:Kt,RestElement:Qt,AssignmentPattern:ei});function ni(e,t){var i;return G(this,(function(r){switch(r.label){case 0:return e?(ti||(ti=w({},n,Nt,rt,Zt,at,ii)),(i=ti[e.type])?[5,W(i(e,t))]:[3,2]):[2];case 1:return[2,r.sent()];case 2:throw new Error(e.type+" isn't implemented")}}))}function ri(e,t){return G(this,(function(i){return t.func(e.id.name,fi(e,t)),[2]}))}function si(e,t,i){var n;return void 0===i&&(i={}),G(this,(function(r){switch(r.label){case 0:n=0,r.label=1;case 1:return n<e.declarations.length?[5,W(ai(e.declarations[n],t,w({kind:e.kind},i)))]:[3,4];case 2:r.sent(),r.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}function ai(e,t,i){var n,r,a,o,c,l,h,u,p,d,f;return void 0===i&&(i={}),G(this,(function(g){switch(g.label){case 0:return n=i.kind,r=void 0===n?"var":n,a=i.hoist,o=void 0!==a&&a,c=i.onlyBlock,l=void 0!==c&&c,h=i.feed,o?l||"var"===r?"Identifier"!==e.id.type?[3,1]:(t[r](e.id.name,l?U:"var"===r?B:void 0),[3,3]):[3,3]:[3,4];case 1:return[5,W(di(e.id,t,{kind:r,hoist:o,onlyBlock:l}))];case 2:g.sent(),g.label=3;case 3:return[3,10];case 4:return(u="feed"in i)?(d=h,[3,7]):[3,5];case 5:return[5,W(ni(e.init,t))];case 6:d=g.sent(),g.label=7;case 7:return p=d,"Identifier"!==e.id.type?[3,8]:(f=e.id.name,"var"!==r||e.init||u?t[r](f,p):t.var(f,B),e.init&&-1!==["ClassExpression","FunctionExpression","ArrowFunctionExpression"].indexOf(e.init.type)&&!p.name&&s(p,"name",{value:f,configurable:!0}),[3,10]);case 8:return[5,W(di(e.id,t,{kind:r,feed:p}))];case 9:g.sent(),g.label=10;case 10:return[2]}}))}function oi(e,t){var i,n,r;return G(this,(function(s){switch(s.label){case 0:return n=(i=t).func,r=[e.id.name],[5,W(gi(e,t))];case 1:return n.apply(i,r.concat([s.sent()])),[2]}}))}function ci(e,t,i){var n,r,s;return void 0===i&&(i={}),G(this,(function(a){switch(a.label){case 0:n=i.klass,r=i.superClass,s=0,a.label=1;case 1:return s<e.body.length?[5,W(li(e.body[s],t,{klass:n,superClass:r}))]:[3,4];case 2:a.sent(),a.label=3;case 3:return s++,[3,1];case 4:return[2]}}))}function li(e,t,i){var n,r,o,c,l,h;return void 0===i&&(i={}),G(this,(function(u){switch(u.label){case 0:return n=i.klass,r=i.superClass,e.computed?[5,W(ni(e.key,t))]:[3,2];case 1:return o=u.sent(),[3,3];case 2:if("Identifier"!==e.key.type)throw new SyntaxError("Unexpected token");o=e.key.name,u.label=3;case 3:switch(c=e.static?n:n.prototype,l=fi(e.value,t,{superClass:r}),e.kind){case"constructor":break;case"method":s(c,o,{value:l,writable:!0,configurable:!0});break;case"get":h=a(c,o),s(c,o,{get:l,set:h&&h.set,configurable:!0});break;case"set":h=a(c,o),s(c,o,{get:h&&h.get,set:l,configurable:!0});break;default:throw new SyntaxError("Unexpected token")}return[2]}}))}function hi(e,t){void 0===t&&(t={});var i=t.res,n=t.err,r=t.ret,s=t.fullRet;return new Promise((function(a,o){if("ret"in t)return a(e.return(r));function c(t){var i;try{i=e.next(t)}catch(e){return o(e)}return h(i),null}function l(t){var i;try{i=e.throw(t)}catch(e){return o(e)}h(i)}function h(e){if(e.done)return a(s?e:e.value);if(e.value!==L)return a(e);var t=e.value.RES;return(t&&"function"===t.then?t:Promise.resolve(t)).then(c,l)}"err"in t?l(n):c(i)}))}function ui(e,t,i){var n,r,s,a,o,c;return void 0===i&&(i={}),G(this,(function(l){switch(l.label){case 0:n=i.onlyBlock,r=void 0!==n&&n,s=[],a=[],c=0,l.label=1;case 1:return c<e.body.length?"FunctionDeclaration"!==(o=e.body[c]).type?[3,2]:(s.push(o),a.push(c),[3,6]):[3,7];case 2:return"VariableDeclaration"!==o.type||-1===["const","let"].indexOf(o.kind)?[3,4]:[5,W(si(o,t,{hoist:!0,onlyBlock:!0}))];case 3:return l.sent(),[3,6];case 4:return r?[3,6]:[5,W(pi(o,t))];case 5:l.sent(),l.label=6;case 6:return c++,[3,1];case 7:if(a.length){for(c=a.length-1;c>-1;c--)e.body.splice(a[c],1);e.body=s.concat(e.body)}return[2]}}))}function pi(e,t){var i,n,r,s,a;return G(this,(function(o){switch(o.label){case 0:switch(e.type){case"VariableDeclaration":return[3,1];case"ForInStatement":case"ForOfStatement":return[3,3];case"ForStatement":return[3,5];case"WhileStatement":case"DoWhileStatement":return[3,7];case"IfStatement":return[3,9];case"BlockStatement":return[3,13];case"SwitchStatement":return[3,18];case"TryStatement":return[3,25]}return[3,38];case 1:return[5,W(si(e,t,{hoist:!0}))];case 2:return o.sent(),[3,38];case 3:return"VariableDeclaration"!==e.left.type?[3,5]:[5,W(si(e.left,t,{hoist:!0}))];case 4:o.sent(),o.label=5;case 5:return"ForStatement"!==e.type||"VariableDeclaration"!==e.init.type?[3,7]:[5,W(si(e.init,t,{hoist:!0}))];case 6:o.sent(),o.label=7;case 7:return[5,W(pi(e.body,t))];case 8:return o.sent(),[3,38];case 9:return[5,W(pi(e.consequent,t))];case 10:return o.sent(),e.alternate?[5,W(pi(e.alternate,t))]:[3,12];case 11:o.sent(),o.label=12;case 12:return[3,38];case 13:a=0,o.label=14;case 14:return a<e.body.length?[5,W(pi(e.body[a],t))]:[3,17];case 15:o.sent(),o.label=16;case 16:return a++,[3,14];case 17:return[3,38];case 18:a=0,o.label=19;case 19:if(!(a<e.cases.length))return[3,24];i=0,o.label=20;case 20:return i<e.cases[a].consequent.length?[5,W(pi(e.cases[a].consequent[i],t))]:[3,23];case 21:o.sent(),o.label=22;case 22:return i++,[3,20];case 23:return a++,[3,19];case 24:return[3,38];case 25:n=e.block.body,a=0,o.label=26;case 26:return a<n.length?[5,W(pi(n[a],t))]:[3,29];case 27:o.sent(),o.label=28;case 28:return a++,[3,26];case 29:if(!(r=e.handler&&e.handler.body.body))return[3,33];a=0,o.label=30;case 30:return a<r.length?[5,W(pi(r[a],t))]:[3,33];case 31:o.sent(),o.label=32;case 32:return a++,[3,30];case 33:if(!(s=e.finalizer&&e.finalizer.body))return[3,37];a=0,o.label=34;case 34:return a<s.length?[5,W(pi(s[a],t))]:[3,37];case 35:o.sent(),o.label=36;case 36:return a++,[3,34];case 37:return[3,38];case 38:return[2]}}))}function di(e,t,i){return void 0===i&&(i={}),G(this,(function(n){switch(n.label){case 0:switch(e.type){case"ObjectPattern":return[3,1];case"ArrayPattern":return[3,3];case"RestElement":return[3,5];case"AssignmentPattern":return[3,7]}return[3,9];case 1:return[5,W(Xt(e,t,i))];case 2:case 4:case 6:case 8:return[2,n.sent()];case 3:return[5,W(Kt(e,t,i))];case 5:return[5,W(Qt(e,t,i))];case 7:return[5,W(ei(e,t,i))];case 9:throw new SyntaxError("Unexpected token")}}))}function fi(e,t,i){if(void 0===i&&(i={}),!e.generator&&!e.async)return xi(e,t,i);var n,r=i.superClass,a=i.isCtor,o=e.params,c=function i(){var n,s,c,l,h,u=this&&this instanceof i?this.constructor:void 0,p=[];for(n=0;n<arguments.length;n++)p[n]=arguments[n];return G(this,(function(i){switch(i.label){case 0:s=new z(t,!0),"ArrowFunctionExpression"!==e.type&&(s.const("this",this),s.let("arguments",arguments),s.const(j,u),r&&(s.const(R,r),a&&s.let($,!1))),c=0,i.label=1;case 1:return c<o.length?"Identifier"!==(l=o[c]).type?[3,2]:(s.var(l.name,p[c]),[3,6]):[3,7];case 2:return"RestElement"!==l.type?[3,4]:[5,W(Qt(l,s,{kind:"var",feed:p.slice(c)}))];case 3:return i.sent(),[3,6];case 4:return[5,W(di(l,s,{feed:p[c]}))];case 5:i.sent(),i.label=6;case 6:return c++,[3,1];case 7:return"BlockStatement"!==e.body.type?[3,10]:[5,W(ui(e.body,s))];case 8:return i.sent(),[5,W(Ot(e.body,s,{invasived:!0,hoisted:!0}))];case 9:return h=i.sent(),[3,12];case 10:return[5,W(ni(e.body,s))];case 11:h=i.sent(),"ArrowFunctionExpression"===e.type&&(O.RES=h,h=O),i.label=12;case 12:return h===O?[2,h.RES]:[2]}}))};return n=e.async&&e.generator?function(){var e=c.apply(this,arguments),t=Promise.resolve(),i=!1,n=function(n){return t=t.then((function(){return hi(e,w({fullRet:!0},n))})).catch((function(e){if(!i)return i=!0,Promise.reject(e)}))},r={next:function(e){return n({res:e})},throw:function(e){return n({err:e})},return:function(e){return n({ret:e})}};return"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r}:e.async?function(){return hi(c.apply(this,arguments))}:c,s(n,V,{value:!0}),s(n,"name",{value:e.id&&e.id.name||"",configurable:!0}),s(n,"length",{value:o.length,configurable:!0}),n}function gi(e,t){var i,n,r,a,o;return G(this,(function(c){switch(c.label){case 0:return[5,W(ni(e.superClass,t))];case 1:for(i=c.sent(),n=function(){i&&i.apply(this)},r=e.body.body,a=0;a<r.length;a++)if("constructor"===(o=r[a]).kind){n=fi(o.value,t,{superClass:i,isCtor:!0});break}return i&&b(n,i),[5,W(ci(e.body,t,{klass:n,superClass:i}))];case 2:return c.sent(),s(n,F,{value:!0}),s(n,"name",{value:e.id&&e.id.name||"",configurable:!0}),[2,n]}}))}function mi(e,t,i){var n,r,s,a;return G(this,(function(o){switch(o.label){case 0:return n=i.value,r=e.left,s=new z(t),"VariableDeclaration"!==r.type?[3,2]:[5,W(si(r,s,{feed:n}))];case 1:return o.sent(),[3,6];case 2:return"Identifier"!==r.type?[3,4]:[5,W(Z(r,t,{getVar:!0}))];case 3:return o.sent().set(n),[3,6];case 4:return[5,W(di(r,t,{feed:n}))];case 5:o.sent(),o.label=6;case 6:return"BlockStatement"!==e.body.type?[3,8]:[5,W(Ot(e.body,s,{invasived:!0}))];case 7:return a=o.sent(),[3,10];case 8:return[5,W(ni(e.body,s))];case 9:a=o.sent(),o.label=10;case 10:return[2,a]}}))}function yi(e,t,i){void 0===i&&(i={});for(var n=i.onlyBlock,r=void 0!==n&&n,s=[],a=[],o=0;o<e.body.length;o++){var c=e.body[o];"FunctionDeclaration"===c.type?(s.push(c),a.push(o)):"VariableDeclaration"===c.type&&-1!==["const","let"].indexOf(c.kind)?Ke(c,t,{hoist:!0,onlyBlock:!0}):r||vi(c,t)}if(a.length){for(o=a.length-1;o>-1;o--)e.body.splice(a[o],1);e.body=s.concat(e.body)}}function vi(e,t){switch(e.type){case"VariableDeclaration":Ke(e,t,{hoist:!0});break;case"ForInStatement":case"ForOfStatement":"VariableDeclaration"===e.left.type&&Ke(e.left,t,{hoist:!0});case"ForStatement":"ForStatement"===e.type&&"VariableDeclaration"===e.init.type&&Ke(e.init,t,{hoist:!0});case"WhileStatement":case"DoWhileStatement":vi(e.body,t);break;case"IfStatement":vi(e.consequent,t),e.alternate&&vi(e.alternate,t);break;case"BlockStatement":for(var i=0;i<e.body.length;i++)vi(e.body[i],t);break;case"SwitchStatement":for(i=0;i<e.cases.length;i++)for(var n=0;n<e.cases[i].consequent.length;n++)vi(e.cases[i].consequent[n],t);break;case"TryStatement":var r=e.block.body;for(i=0;i<r.length;i++)vi(r[i],t);var s=e.handler&&e.handler.body.body;if(s)for(i=0;i<s.length;i++)vi(s[i],t);var a=e.finalizer&&e.finalizer.body;if(a)for(i=0;i<a.length;i++)vi(a[i],t)}}function bi(e,t,i){switch(void 0===i&&(i={}),e.type){case"ObjectPattern":return Ue(e,t,i);case"ArrayPattern":return He(e,t,i);case"RestElement":return qe(e,t,i);case"AssignmentPattern":return ze(e,t,i);default:throw new SyntaxError("Unexpected token")}}function xi(e,t,i){if(void 0===i&&(i={}),e.generator||e.async)return fi(e,t,i);var n=i.superClass,r=i.isCtor,a=e.params,o=function i(){for(var s=this&&this instanceof i?this.constructor:void 0,o=[],c=0;c<arguments.length;c++)o[c]=arguments[c];var l,h=new z(t,!0);"ArrowFunctionExpression"!==e.type&&(h.const("this",this),h.let("arguments",arguments),h.const(j,s),n&&(h.const(R,n),r&&h.let($,!1)));for(var u=0;u<a.length;u++){var p=a[u];"Identifier"===p.type?h.var(p.name,o[u]):"RestElement"===p.type?qe(p,h,{kind:"var",feed:o.slice(u)}):bi(p,h,{feed:o[u]})}if("BlockStatement"===e.body.type?(yi(e.body,h),l=ke(e.body,h,{invasived:!0,hoisted:!0})):(l=Ze(e.body,h),"ArrowFunctionExpression"===e.type&&(O.RES=l,l=O)),l===O)return l.RES},c=o;return"ArrowFunctionExpression"===e.type&&s(c,V,{value:!0}),s(c,"name",{value:e.id&&e.id.name||"",configurable:!0}),s(c,"length",{value:a.length,configurable:!0}),c}function wi(e,t){for(var i=Ze(e.superClass,t),n=function(){i&&i.apply(this)},r=e.body.body,a=0;a<r.length;a++){var o=r[a];if("constructor"===o.kind){n=xi(o.value,t,{superClass:i,isCtor:!0});break}}return i&&b(n,i),tt(e.body,t,{klass:n,superClass:i}),s(n,F,{value:!0}),s(n,"name",{value:e.id&&e.id.name||"",configurable:!0}),n}function _i(e,t,i){var n=i.value,r=e.left,s=new z(t);return"VariableDeclaration"===r.type?Ke(r,s,{feed:n}):"Identifier"===r.type?Z(r,t,{getVar:!0}).set(n):bi(r,t,{feed:n}),"BlockStatement"===e.body.type?ke(e.body,s,{invasived:!0}):Ze(e.body,s)}var Si=function(){function t(e){void 0===e&&(e={}),this.options={},this.scope=new z(null,!0),this.exports={};var t=e.ecmaVer,i=void 0===t?9:t,n=e.sandBox,r=void 0===n||n;if(-1===[3,5,6,7,8,9,10].indexOf(i-=i<2015?0:2009))throw new Error("unsupported ecmaVer");if(this.options.ecmaVersion=i,r){var s=I();this.scope.let("window",s),this.scope.let("this",s)}else this.scope.let("window",S),this.scope.let("this",S);this.scope.const("exports",this.exports={})}return t.prototype.import=function(e,t){var i;if("string"==typeof e&&((i={})[e]=t,e=i),"object"==typeof e)for(var n=l(e),r=0;r<n.length;r++){var s=n[r];this.scope.var(s,e[s])}},t.prototype.parse=function(t,i){return"function"==typeof i?i(t,w({},this.options)):e.parse(t,this.options)},t.prototype.run=function(t){var i="string"==typeof t?e.parse(t,this.options):t;yi(i,this.scope),Ze(i,this.scope)},t.version=N,t}();return Si}(i(94))},94:(e,t,i)=>{i.r(t),i.d(t,{Node:()=>ne,Parser:()=>j,Position:()=>M,SourceLocation:()=>D,TokContext:()=>ae,Token:()=>Te,TokenType:()=>m,defaultOptions:()=>$,getLineInfo:()=>R,isIdentifierChar:()=>g,isIdentifierStart:()=>f,isNewLine:()=>E,keywordTypes:()=>x,lineBreak:()=>S,lineBreakG:()=>k,nonASCIIwhitespace:()=>A,parse:()=>Me,parseExpressionAt:()=>De,tokContexts:()=>oe,tokTypes:()=>_,tokenizer:()=>Re,version:()=>Oe});var n={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},r="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",s={5:r,"5module":r+" export import",6:r+" const class extends export import super"},a=/^in(stanceof)?$/,o="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-Ᶎꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭧꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",c="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",l=new RegExp("["+o+"]"),h=new RegExp("["+o+c+"]");o=c=null;var u=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541],p=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,232,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239];function d(e,t){for(var i=65536,n=0;n<t.length;n+=2){if((i+=t[n])>e)return!1;if((i+=t[n+1])>=e)return!0}}function f(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&l.test(String.fromCharCode(e)):!1!==t&&d(e,u)))}function g(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&h.test(String.fromCharCode(e)):!1!==t&&(d(e,u)||d(e,p)))))}var m=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function y(e,t){return new m(e,{beforeExpr:!0,binop:t})}var v={beforeExpr:!0},b={startsExpr:!0},x={};function w(e,t){return void 0===t&&(t={}),t.keyword=e,x[e]=new m(e,t)}var _={num:new m("num",b),regexp:new m("regexp",b),string:new m("string",b),name:new m("name",b),eof:new m("eof"),bracketL:new m("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new m("]"),braceL:new m("{",{beforeExpr:!0,startsExpr:!0}),braceR:new m("}"),parenL:new m("(",{beforeExpr:!0,startsExpr:!0}),parenR:new m(")"),comma:new m(",",v),semi:new m(";",v),colon:new m(":",v),dot:new m("."),question:new m("?",v),arrow:new m("=>",v),template:new m("template"),invalidTemplate:new m("invalidTemplate"),ellipsis:new m("...",v),backQuote:new m("`",b),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m("=",{beforeExpr:!0,isAssign:!0}),assign:new m("_=",{beforeExpr:!0,isAssign:!0}),incDec:new m("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:y("||",1),logicalAND:y("&&",2),bitwiseOR:y("|",3),bitwiseXOR:y("^",4),bitwiseAND:y("&",5),equality:y("==/!=/===/!==",6),relational:y("</>/<=/>=",7),bitShift:y("<</>>/>>>",8),plusMin:new m("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:y("%",10),star:y("*",10),slash:y("/",10),starstar:new m("**",{beforeExpr:!0}),_break:w("break"),_case:w("case",v),_catch:w("catch"),_continue:w("continue"),_debugger:w("debugger"),_default:w("default",v),_do:w("do",{isLoop:!0,beforeExpr:!0}),_else:w("else",v),_finally:w("finally"),_for:w("for",{isLoop:!0}),_function:w("function",b),_if:w("if"),_return:w("return",v),_switch:w("switch"),_throw:w("throw",v),_try:w("try"),_var:w("var"),_const:w("const"),_while:w("while",{isLoop:!0}),_with:w("with"),_new:w("new",{beforeExpr:!0,startsExpr:!0}),_this:w("this",b),_super:w("super",b),_class:w("class",b),_extends:w("extends",v),_export:w("export"),_import:w("import",b),_null:w("null",b),_true:w("true",b),_false:w("false",b),_in:w("in",{beforeExpr:!0,binop:7}),_instanceof:w("instanceof",{beforeExpr:!0,binop:7}),_typeof:w("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:w("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:w("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},S=/\r\n?|\n|\u2028|\u2029/,k=new RegExp(S.source,"g");function E(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var A=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,C=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,I=Object.prototype,T=I.hasOwnProperty,P=I.toString;function N(e,t){return T.call(e,t)}var L=Array.isArray||function(e){return"[object Array]"===P.call(e)};function O(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var M=function(e,t){this.line=e,this.column=t};M.prototype.offset=function(e){return new M(this.line,this.column+e)};var D=function(e,t,i){this.start=t,this.end=i,null!==e.sourceFile&&(this.source=e.sourceFile)};function R(e,t){for(var i=1,n=0;;){k.lastIndex=n;var r=k.exec(e);if(!(r&&r.index<t))return new M(i,t-n);++i,n=r.index+r[0].length}}var $={ecmaVersion:9,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function V(e){var t={};for(var i in $)t[i]=e&&N(e,i)?e[i]:$[i];if(t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),L(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}return L(t.onComment)&&(t.onComment=function(e,t){return function(i,n,r,s,a,o){var c={type:i?"Block":"Line",value:n,start:r,end:s};e.locations&&(c.loc=new D(this,a,o)),e.ranges&&(c.range=[r,s]),t.push(c)}}(t,t.onComment)),t}function F(e,t){return 2|(e?4:0)|(t?8:0)}var j=function(e,t,i){this.options=e=V(e),this.sourceFile=e.sourceFile,this.keywords=O(s[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var r="";if(!0!==e.allowReserved){for(var a=e.ecmaVersion;!(r=n[a]);a--);"module"===e.sourceType&&(r+=" await")}this.reservedWords=O(r);var o=(r?r+" ":"")+n.strict;this.reservedWordsStrict=O(o),this.reservedWordsStrictBind=O(o+" "+n.strictBind),this.input=String(t),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(S).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=_.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},B={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};j.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},B.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},B.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},B.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},B.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},B.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},B.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},j.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},j.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,n=0;n<e.length;n++)i=e[n](i);return i},j.parse=function(e,t){return new this(t,e).parse()},j.parseExpressionAt=function(e,t,i){var n=new this(i,e,t);return n.nextToken(),n.parseExpression()},j.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(j.prototype,B);var U=j.prototype,H=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;function q(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}U.strictDirective=function(e){for(;;){C.lastIndex=e,e+=C.exec(this.input)[0].length;var t=H.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2]))return!0;e+=t[0].length,C.lastIndex=e,e+=C.exec(this.input)[0].length,";"===this.input[e]&&e++}},U.eat=function(e){return this.type===e&&(this.next(),!0)},U.isContextual=function(e){return this.type===_.name&&this.value===e&&!this.containsEsc},U.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},U.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},U.canInsertSemicolon=function(){return this.type===_.eof||this.type===_.braceR||S.test(this.input.slice(this.lastTokEnd,this.start))},U.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},U.semicolon=function(){this.eat(_.semi)||this.insertSemicolon()||this.unexpected()},U.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},U.expect=function(e){this.eat(e)||this.unexpected()},U.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},U.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,"Parenthesized pattern")}},U.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,n=e.doubleProto;if(!t)return i>=0||n>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},U.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},U.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var z=j.prototype;z.parseTopLevel=function(e){var t={};for(e.body||(e.body=[]);this.type!==_.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var n=0,r=Object.keys(this.undefinedExports);n<r.length;n+=1){var s=r[n];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var G={kind:"loop"},W={kind:"switch"};z.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;C.lastIndex=this.pos;var t=C.exec(this.input),i=this.pos+t[0].length,n=this.input.charCodeAt(i);if(91===n)return!0;if(e)return!1;if(123===n)return!0;if(f(n,!0)){for(var r=i+1;g(this.input.charCodeAt(r),!0);)++r;var s=this.input.slice(i,r);if(!a.test(s))return!0}return!1},z.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;C.lastIndex=this.pos;var e=C.exec(this.input),t=this.pos+e[0].length;return!(S.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!==this.input.length&&g(this.input.charAt(t+8)))},z.parseStatement=function(e,t,i){var n,r=this.type,s=this.startNode();switch(this.isLet(e)&&(r=_._var,n="let"),r){case _._break:case _._continue:return this.parseBreakContinueStatement(s,r.keyword);case _._debugger:return this.parseDebuggerStatement(s);case _._do:return this.parseDoStatement(s);case _._for:return this.parseForStatement(s);case _._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case _._class:return e&&this.unexpected(),this.parseClass(s,!0);case _._if:return this.parseIfStatement(s);case _._return:return this.parseReturnStatement(s);case _._switch:return this.parseSwitchStatement(s);case _._throw:return this.parseThrowStatement(s);case _._try:return this.parseTryStatement(s);case _._const:case _._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(s,n);case _._while:return this.parseWhileStatement(s);case _._with:return this.parseWithStatement(s);case _.braceL:return this.parseBlock(!0,s);case _.semi:return this.parseEmptyStatement(s);case _._export:case _._import:if(this.options.ecmaVersion>10&&r===_._import){C.lastIndex=this.pos;var a=C.exec(this.input),o=this.pos+a[0].length;if(40===this.input.charCodeAt(o))return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===_._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var c=this.value,l=this.parseExpression();return r===_.name&&"Identifier"===l.type&&this.eat(_.colon)?this.parseLabeledStatement(s,c,l,e):this.parseExpressionStatement(s,l)}},z.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(_.semi)||this.insertSemicolon()?e.label=null:this.type!==_.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n<this.labels.length;++n){var r=this.labels[n];if(null==e.label||r.name===e.label.name){if(null!=r.kind&&(i||"loop"===r.kind))break;if(e.label&&i)break}}return n===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")},z.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},z.parseDoStatement=function(e){return this.next(),this.labels.push(G),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(_._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(_.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},z.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(G),this.enterScope(0),this.expect(_.parenL),this.type===_.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===_._var||this.type===_._const||i){var n=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(n,!0,r),this.finishNode(n,"VariableDeclaration"),(this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===n.declarations.length?(this.options.ecmaVersion>=9&&(this.type===_._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,n)):(t>-1&&this.unexpected(t),this.parseFor(e,n))}var s=new q,a=this.parseExpression(!0,s);return this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===_._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(a,!1,s),this.checkLVal(a),this.parseForIn(e,a)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,a))},z.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,J|(i?0:Z),!1,t)},z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(_._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},z.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(_.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},z.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(_.braceL),this.labels.push(W),this.enterScope(0);for(var i=!1;this.type!==_.braceR;)if(this.type===_._case||this.type===_._default){var n=this.type===_._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(_.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},z.parseThrowStatement=function(e){return this.next(),S.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Y=[];z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===_._catch){var t=this.startNode();if(this.next(),this.eat(_.parenL)){t.param=this.parseBindingAtom();var i="Identifier"===t.param.type;this.enterScope(i?32:0),this.checkLVal(t.param,i?4:2),this.expect(_.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(_._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},z.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(G),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},z.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},z.parseLabeledStatement=function(e,t,i,n){for(var r=0,s=this.labels;r<s.length;r+=1){s[r].name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var a=this.type.isLoop?"loop":this.type===_._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var c=this.labels[o];if(c.statementStart!==e.start)break;c.statementStart=this.start,c.kind=a}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},z.parseBlock=function(e,t){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(_.braceL),e&&this.enterScope(0);!this.eat(_.braceR);){var i=this.parseStatement(null);t.body.push(i)}return e&&this.exitScope(),this.finishNode(t,"BlockStatement")},z.parseFor=function(e,t){return e.init=t,this.expect(_.semi),e.test=this.type===_.semi?null:this.parseExpression(),this.expect(_.semi),e.update=this.type===_.parenR?null:this.parseExpression(),this.expect(_.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},z.parseForIn=function(e,t){var i=this.type===_._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(_.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},z.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var n=this.startNode();if(this.parseVarId(n,i),this.eat(_.eq)?n.init=this.parseMaybeAssign(t):"const"!==i||this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||t&&(this.type===_._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(_.comma))break}return e},z.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var J=1,Z=2;z.parseFunction=function(e,t,i,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===_.star&&t&Z&&this.unexpected(),e.generator=this.eat(_.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&J&&(e.id=4&t&&this.type!==_.name?null:this.parseIdent(),!e.id||t&Z||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var r=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(F(e.async,e.generator)),t&J||(e.id=this.type===_.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(e,t&J?"FunctionDeclaration":"FunctionExpression")},z.parseFunctionParams=function(e){this.expect(_.parenL),e.params=this.parseBindingList(_.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},z.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.startNode(),r=!1;for(n.body=[],this.expect(_.braceL);!this.eat(_.braceR);){var s=this.parseClassElement(null!==e.superClass);s&&(n.body.push(s),"MethodDefinition"===s.type&&"constructor"===s.kind&&(r&&this.raise(s.start,"Duplicate constructor in the same class"),r=!0))}return e.body=this.finishNode(n,"ClassBody"),this.strict=i,this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},z.parseClassElement=function(e){var t=this;if(this.eat(_.semi))return null;var i=this.startNode(),n=function(e,n){void 0===n&&(n=!1);var r=t.start,s=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===_.parenL||n&&t.canInsertSemicolon())||(i.key&&t.unexpected(),i.computed=!1,i.key=t.startNodeAt(r,s),i.key.name=e,t.finishNode(i.key,"Identifier"),!1))};i.kind="method",i.static=n("static");var r=this.eat(_.star),s=!1;r||(this.options.ecmaVersion>=8&&n("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(_.star)):n("get")?i.kind="get":n("set")&&(i.kind="set")),i.key||this.parsePropertyName(i);var a=i.key,o=!1;return i.computed||i.static||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?i.static&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==i.kind&&this.raise(a.start,"Constructor can't have get/set modifier"),r&&this.raise(a.start,"Constructor can't be a generator"),s&&this.raise(a.start,"Constructor can't be an async method"),i.kind="constructor",o=e),this.parseClassMethod(i,r,s,o),"get"===i.kind&&0!==i.value.params.length&&this.raiseRecoverable(i.value.start,"getter should have no params"),"set"===i.kind&&1!==i.value.params.length&&this.raiseRecoverable(i.value.start,"setter should have exactly one param"),"set"===i.kind&&"RestElement"===i.value.params[0].type&&this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params"),i},z.parseClassMethod=function(e,t,i,n){return e.value=this.parseMethod(t,i,n),this.finishNode(e,"MethodDefinition")},z.parseClassId=function(e,t){this.type===_.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},z.parseClassSuper=function(e){e.superClass=this.eat(_._extends)?this.parseExprSubscripts():null},z.parseExport=function(e,t){if(this.next(),this.eat(_.star))return this.expectContextual("from"),this.type!==_.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(_._default)){var i;if(this.checkExport(t,"default",this.lastTokStart),this.type===_._function||(i=this.isAsyncFunction())){var n=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(n,4|J,!1,i)}else if(this.type===_._class){var r=this.startNode();e.declaration=this.parseClass(r,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==_.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,a=e.specifiers;s<a.length;s+=1){var o=a[s];this.checkUnreserved(o.local),this.checkLocalExport(o.local)}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},z.checkExport=function(e,t,i){e&&(N(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)},z.checkPatternExport=function(e,t){var i=t.type;if("Identifier"===i)this.checkExport(e,t.name,t.start);else if("ObjectPattern"===i)for(var n=0,r=t.properties;n<r.length;n+=1){var s=r[n];this.checkPatternExport(e,s)}else if("ArrayPattern"===i)for(var a=0,o=t.elements;a<o.length;a+=1){var c=o[a];c&&this.checkPatternExport(e,c)}else"Property"===i?this.checkPatternExport(e,t.value):"AssignmentPattern"===i?this.checkPatternExport(e,t.left):"RestElement"===i?this.checkPatternExport(e,t.argument):"ParenthesizedExpression"===i&&this.checkPatternExport(e,t.expression)},z.checkVariableExport=function(e,t){if(e)for(var i=0,n=t;i<n.length;i+=1){var r=n[i];this.checkPatternExport(e,r.id)}},z.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},z.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(_.braceL);!this.eat(_.braceR);){if(i)i=!1;else if(this.expect(_.comma),this.afterTrailingComma(_.braceR))break;var n=this.startNode();n.local=this.parseIdent(!0),n.exported=this.eatContextual("as")?this.parseIdent(!0):n.local,this.checkExport(e,n.exported.name,n.exported.start),t.push(this.finishNode(n,"ExportSpecifier"))}return t},z.parseImport=function(e){return this.next(),this.type===_.string?(e.specifiers=Y,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===_.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},z.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===_.name){var i=this.startNode();if(i.local=this.parseIdent(),this.checkLVal(i.local,2),e.push(this.finishNode(i,"ImportDefaultSpecifier")),!this.eat(_.comma))return e}if(this.type===_.star){var n=this.startNode();return this.next(),this.expectContextual("as"),n.local=this.parseIdent(),this.checkLVal(n.local,2),e.push(this.finishNode(n,"ImportNamespaceSpecifier")),e}for(this.expect(_.braceL);!this.eat(_.braceR);){if(t)t=!1;else if(this.expect(_.comma),this.afterTrailingComma(_.braceR))break;var r=this.startNode();r.imported=this.parseIdent(!0),this.eatContextual("as")?r.local=this.parseIdent():(this.checkUnreserved(r.imported),r.local=r.imported),this.checkLVal(r.local,2),e.push(this.finishNode(r,"ImportSpecifier"))}return e},z.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},z.isDirectiveCandidate=function(e){return"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var X=j.prototype;X.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var n=0,r=e.properties;n<r.length;n+=1){var s=r[n];this.toAssignable(s,t),"RestElement"!==s.type||"ArrayPattern"!==s.argument.type&&"ObjectPattern"!==s.argument.type||this.raise(s.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e},X.toAssignableList=function(e,t){for(var i=e.length,n=0;n<i;n++){var r=e[n];r&&this.toAssignable(r,t)}if(i){var s=e[i-1];6===this.options.ecmaVersion&&t&&s&&"RestElement"===s.type&&"Identifier"!==s.argument.type&&this.unexpected(s.argument.start)}return e},X.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},X.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==_.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},X.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case _.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(_.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case _.braceL:return this.parseObj(!0)}return this.parseIdent()},X.parseBindingList=function(e,t,i){for(var n=[],r=!0;!this.eat(e);)if(r?r=!1:this.expect(_.comma),t&&this.type===_.comma)n.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===_.ellipsis){var s=this.parseRestBinding();this.parseBindingListItem(s),n.push(s),this.type===_.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}var a=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(a),n.push(a)}return n},X.parseBindingListItem=function(e){return e},X.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(_.eq))return i;var n=this.startNodeAt(e,t);return n.left=i,n.right=this.parseMaybeAssign(),this.finishNode(n,"AssignmentPattern")},X.checkLVal=function(e,t,i){switch(void 0===t&&(t=0),e.type){case"Identifier":2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(t?"Binding ":"Assigning to ")+e.name+" in strict mode"),i&&(N(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),0!==t&&5!==t&&this.declareName(e.name,t,e.start);break;case"MemberExpression":t&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ObjectPattern":for(var n=0,r=e.properties;n<r.length;n+=1){var s=r[n];this.checkLVal(s,t,i)}break;case"Property":this.checkLVal(e.value,t,i);break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var c=o[a];c&&this.checkLVal(c,t,i)}break;case"AssignmentPattern":this.checkLVal(e.left,t,i);break;case"RestElement":this.checkLVal(e.argument,t,i);break;case"ParenthesizedExpression":this.checkLVal(e.expression,t,i);break;default:this.raise(e.start,(t?"Binding":"Assigning to")+" rvalue")}};var K=j.prototype;K.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var n,r=e.key;switch(r.type){case"Identifier":n=r.name;break;case"Literal":n=String(r.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===n&&"init"===s&&(t.proto&&(i&&i.doubleProto<0?i.doubleProto=r.start:this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);else{var a=t[n="$"+n];if(a)("init"===s?this.strict&&a.init||a.get||a.set:a.init||a[s])&&this.raiseRecoverable(r.start,"Redefinition of property");else a=t[n]={init:!1,get:!1,set:!1};a[s]=!0}}},K.parseExpression=function(e,t){var i=this.start,n=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===_.comma){var s=this.startNodeAt(i,n);for(s.expressions=[r];this.eat(_.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return r},K.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var n=!1,r=-1,s=-1,a=-1;t?(r=t.parenthesizedAssign,s=t.trailingComma,a=t.shorthandAssign,t.parenthesizedAssign=t.trailingComma=t.shorthandAssign=-1):(t=new q,n=!0);var o=this.start,c=this.startLoc;this.type!==_.parenL&&this.type!==_.name||(this.potentialArrowAt=this.start);var l=this.parseMaybeConditional(e,t);if(i&&(l=i.call(this,l,o,c)),this.type.isAssign){var h=this.startNodeAt(o,c);return h.operator=this.value,h.left=this.type===_.eq?this.toAssignable(l,!1,t):l,n||q.call(t),t.shorthandAssign=-1,this.checkLVal(l),this.next(),h.right=this.parseMaybeAssign(e),this.finishNode(h,"AssignmentExpression")}return n&&this.checkExpressionErrors(t,!0),r>-1&&(t.parenthesizedAssign=r),s>-1&&(t.trailingComma=s),a>-1&&(t.shorthandAssign=a),l},K.parseMaybeConditional=function(e,t){var i=this.start,n=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat(_.question)){var s=this.startNodeAt(i,n);return s.test=r,s.consequent=this.parseMaybeAssign(),this.expect(_.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return r},K.parseExprOps=function(e,t){var i=this.start,n=this.startLoc,r=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)||r.start===i&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,i,n,-1,e)},K.parseExprOp=function(e,t,i,n,r){var s=this.type.binop;if(null!=s&&(!r||this.type!==_._in)&&s>n){var a=this.type===_.logicalOR||this.type===_.logicalAND,o=this.value;this.next();var c=this.start,l=this.startLoc,h=this.parseExprOp(this.parseMaybeUnary(null,!1),c,l,s,r),u=this.buildBinary(t,i,e,h,o,a);return this.parseExprOp(u,t,i,n,r)}return e},K.buildBinary=function(e,t,i,n,r,s){var a=this.startNodeAt(e,t);return a.left=i,a.operator=r,a.right=n,this.finishNode(a,s?"LogicalExpression":"BinaryExpression")},K.parseMaybeUnary=function(e,t){var i,n=this.start,r=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))i=this.parseAwait(),t=!0;else if(this.type.prefix){var s=this.startNode(),a=this.type===_.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),a?this.checkLVal(s.argument):this.strict&&"delete"===s.operator&&"Identifier"===s.argument.type?this.raiseRecoverable(s.start,"Deleting local variable in strict mode"):t=!0,i=this.finishNode(s,a?"UpdateExpression":"UnaryExpression")}else{if(i=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(n,r);o.operator=this.value,o.prefix=!1,o.argument=i,this.checkLVal(i),this.next(),i=this.finishNode(o,"UpdateExpression")}}return!t&&this.eat(_.starstar)?this.buildBinary(n,r,i,this.parseMaybeUnary(null,!1),"**",!1):i},K.parseExprSubscripts=function(e){var t=this.start,i=this.startLoc,n=this.parseExprAtom(e),r="ArrowFunctionExpression"===n.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);if(this.checkExpressionErrors(e)||r)return n;var s=this.parseSubscripts(n,t,i);return e&&"MemberExpression"===s.type&&(e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1)),s},K.parseSubscripts=function(e,t,i,n){for(var r=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&"async"===this.input.slice(e.start,e.end);;){var s=this.parseSubscript(e,t,i,n,r);if(s===e||"ArrowFunctionExpression"===s.type)return s;e=s}},K.parseSubscript=function(e,t,i,n,r){var s=this.eat(_.bracketL);if(s||this.eat(_.dot)){var a=this.startNodeAt(t,i);a.object=e,a.property=s?this.parseExpression():this.parseIdent("never"!==this.options.allowReserved),a.computed=!!s,s&&this.expect(_.bracketR),e=this.finishNode(a,"MemberExpression")}else if(!n&&this.eat(_.parenL)){var o=new q,c=this.yieldPos,l=this.awaitPos,h=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var u=this.parseExprList(_.parenR,this.options.ecmaVersion>=8&&"Import"!==e.type,!1,o);if(r&&!this.canInsertSemicolon()&&this.eat(_.arrow))return this.checkPatternErrors(o,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=c,this.awaitPos=l,this.awaitIdentPos=h,this.parseArrowExpression(this.startNodeAt(t,i),u,!0);this.checkExpressionErrors(o,!0),this.yieldPos=c||this.yieldPos,this.awaitPos=l||this.awaitPos,this.awaitIdentPos=h||this.awaitIdentPos;var p=this.startNodeAt(t,i);if(p.callee=e,p.arguments=u,"Import"===p.callee.type){1!==p.arguments.length&&this.raise(p.start,"import() requires exactly one argument");var d=p.arguments[0];d&&"SpreadElement"===d.type&&this.raise(d.start,"... is not allowed in import()")}e=this.finishNode(p,"CallExpression")}else if(this.type===_.backQuote){var f=this.startNodeAt(t,i);f.tag=e,f.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(f,"TaggedTemplateExpression")}return e},K.parseExprAtom=function(e){this.type===_.slash&&this.readRegexp();var t,i=this.potentialArrowAt===this.start;switch(this.type){case _._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),t=this.startNode(),this.next(),this.type!==_.parenL||this.allowDirectSuper||this.raise(t.start,"super() call outside constructor of a subclass"),this.type!==_.dot&&this.type!==_.bracketL&&this.type!==_.parenL&&this.unexpected(),this.finishNode(t,"Super");case _._this:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case _.name:var n=this.start,r=this.startLoc,s=this.containsEsc,a=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(_._function))return this.parseFunction(this.startNodeAt(n,r),0,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(_.arrow))return this.parseArrowExpression(this.startNodeAt(n,r),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===_.name&&!s)return a=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(_.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,r),[a],!0)}return a;case _.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case _.num:case _.string:return this.parseLiteral(this.value);case _._null:case _._true:case _._false:return(t=this.startNode()).value=this.type===_._null?null:this.type===_._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case _.parenL:var c=this.start,l=this.parseParenAndDistinguishExpression(i);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),l;case _.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(_.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case _.braceL:return this.parseObj(!1,e);case _._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case _._class:return this.parseClass(this.startNode(),!1);case _._new:return this.parseNew();case _.backQuote:return this.parseTemplate();case _._import:return this.options.ecmaVersion>10?this.parseDynamicImport():this.unexpected();default:this.unexpected()}},K.parseDynamicImport=function(){var e=this.startNode();return this.next(),this.type!==_.parenL&&this.unexpected(),this.finishNode(e,"Import")},K.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1)),this.next(),this.finishNode(t,"Literal")},K.parseParenExpression=function(){this.expect(_.parenL);var e=this.parseExpression();return this.expect(_.parenR),e},K.parseParenAndDistinguishExpression=function(e){var t,i=this.start,n=this.startLoc,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,a=this.start,o=this.startLoc,c=[],l=!0,h=!1,u=new q,p=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==_.parenR;){if(l?l=!1:this.expect(_.comma),r&&this.afterTrailingComma(_.parenR,!0)){h=!0;break}if(this.type===_.ellipsis){s=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===_.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,u,this.parseParenItem))}var f=this.start,g=this.startLoc;if(this.expect(_.parenR),e&&!this.canInsertSemicolon()&&this.eat(_.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=d,this.parseParenArrowList(i,n,c);c.length&&!h||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(u,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=d||this.awaitPos,c.length>1?((t=this.startNodeAt(a,o)).expressions=c,this.finishNodeAt(t,"SequenceExpression",f,g)):t=c[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var m=this.startNodeAt(i,n);return m.expression=t,this.finishNode(m,"ParenthesizedExpression")}return t},K.parseParenItem=function(e){return e},K.parseParenArrowList=function(e,t,i){return this.parseArrowExpression(this.startNodeAt(e,t),i)};var Q=[];K.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(_.dot)){e.meta=t;var i=this.containsEsc;return e.property=this.parseIdent(!0),("target"!==e.property.name||i)&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is new.target"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"new.target can only be used in functions"),this.finishNode(e,"MetaProperty")}var n=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,r,!0),this.options.ecmaVersion>10&&"Import"===e.callee.type&&this.raise(e.callee.start,"Cannot use new with import(...)"),this.eat(_.parenL)?e.arguments=this.parseExprList(_.parenR,this.options.ecmaVersion>=8&&"Import"!==e.callee.type,!1):e.arguments=Q,this.finishNode(e,"NewExpression")},K.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===_.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===_.backQuote,this.finishNode(i,"TemplateElement")},K.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(i.quasis=[n];!n.tail;)this.type===_.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(_.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(_.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},K.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===_.name||this.type===_.num||this.type===_.string||this.type===_.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===_.star)&&!S.test(this.input.slice(this.lastTokEnd,this.start))},K.parseObj=function(e,t){var i=this.startNode(),n=!0,r={};for(i.properties=[],this.next();!this.eat(_.braceR);){if(n)n=!1;else if(this.expect(_.comma),this.afterTrailingComma(_.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,r,t),i.properties.push(s)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},K.parseProperty=function(e,t){var i,n,r,s,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(_.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===_.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===_.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,t),this.type===_.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||t)&&(r=this.start,s=this.startLoc),e||(i=this.eat(_.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(a)?(n=!0,i=this.options.ecmaVersion>=9&&this.eat(_.star),this.parsePropertyName(a,t)):n=!1,this.parsePropertyValue(a,e,i,n,r,s,t,o),this.finishNode(a,"Property")},K.parsePropertyValue=function(e,t,i,n,r,s,a,o){if((i||n)&&this.type===_.colon&&this.unexpected(),this.eat(_.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===_.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,n);else if(t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===_.comma||this.type===_.braceR)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((i||n)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=r),e.kind="init",t?e.value=this.parseMaybeDefault(r,s,e.key):this.type===_.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(i||n)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var c="get"===e.kind?0:1;if(e.value.params.length!==c){var l=e.value.start;"get"===e.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},K.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(_.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(_.bracketR),e.key;e.computed=!1}return e.key=this.type===_.num||this.type===_.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},K.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},K.parseMethod=function(e,t,i){var n=this.startNode(),r=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|F(t,n.generator)|(i?128:0)),this.expect(_.parenL),n.params=this.parseBindingList(_.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(n,"FunctionExpression")},K.parseArrowExpression=function(e,t,i){var n=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|F(i,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},K.parseFunctionBody=function(e,t,i){var n=t&&this.type!==_.braceL,r=this.strict,s=!1;if(n)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);r&&!a||(s=this.strictDirective(this.end))&&a&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!r&&!s&&!t&&!i&&this.isSimpleParamList(e.params)),e.body=this.parseBlock(!1),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=o}this.exitScope(),this.strict&&e.id&&this.checkLVal(e.id,5),this.strict=r},K.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){if("Identifier"!==i[t].type)return!1}return!0},K.checkParams=function(e,t){for(var i={},n=0,r=e.params;n<r.length;n+=1){var s=r[n];this.checkLVal(s,1,t?null:i)}},K.parseExprList=function(e,t,i,n){for(var r=[],s=!0;!this.eat(e);){if(s)s=!1;else if(this.expect(_.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===_.comma?a=null:this.type===_.ellipsis?(a=this.parseSpread(n),n&&this.type===_.comma&&n.trailingComma<0&&(n.trailingComma=this.start)):a=this.parseMaybeAssign(!1,n),r.push(a)}return r},K.checkUnreserved=function(e){var t=e.start,i=e.end,n=e.name;(this.inGenerator&&"yield"===n&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===n&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(n)&&this.raise(t,"Unexpected keyword '"+n+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,i).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(n)&&(this.inAsync||"await"!==n||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+n+"' is reserved"))},K.parseIdent=function(e,t){var i=this.startNode();return this.type===_.name?i.name=this.value:this.type.keyword?(i.name=this.type.keyword,"class"!==i.name&&"function"!==i.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(),this.finishNode(i,"Identifier"),e||(this.checkUnreserved(i),"await"!==i.name||this.awaitIdentPos||(this.awaitIdentPos=i.start)),i},K.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===_.semi||this.canInsertSemicolon()||this.type!==_.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(_.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},K.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0),this.finishNode(e,"AwaitExpression")};var ee=j.prototype;ee.raise=function(e,t){var i=R(this.input,e);t+=" ("+i.line+":"+i.column+")";var n=new SyntaxError(t);throw n.pos=e,n.loc=i,n.raisedAt=this.pos,n},ee.raiseRecoverable=ee.raise,ee.curPosition=function(){if(this.options.locations)return new M(this.curLine,this.pos-this.lineStart)};var te=j.prototype,ie=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};te.enterScope=function(e){this.scopeStack.push(new ie(e))},te.exitScope=function(){this.scopeStack.pop()},te.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},te.declareName=function(e,t,i){var n=!1;if(2===t){var r=this.currentScope();n=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&1&r.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var s=this.currentScope();n=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var o=this.scopeStack[a];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){n=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],3&o.flags)break}n&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")},te.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},te.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},te.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},te.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags&&!(16&t.flags))return t}};var ne=function(e,t,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new D(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},re=j.prototype;function se(e,t,i,n){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=i),e}re.startNode=function(){return new ne(this,this.start,this.startLoc)},re.startNodeAt=function(e,t){return new ne(this,e,t)},re.finishNode=function(e,t){return se.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},re.finishNodeAt=function(e,t,i,n){return se.call(this,e,t,i,n)};var ae=function(e,t,i,n,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!i,this.override=n,this.generator=!!r},oe={b_stat:new ae("{",!1),b_expr:new ae("{",!0),b_tmpl:new ae("${",!1),p_stat:new ae("(",!1),p_expr:new ae("(",!0),q_tmpl:new ae("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new ae("function",!1),f_expr:new ae("function",!0),f_expr_gen:new ae("function",!0,!1,null,!0),f_gen:new ae("function",!1,!1,null,!0)},ce=j.prototype;ce.initialContext=function(){return[oe.b_stat]},ce.braceIsBlock=function(e){var t=this.curContext();return t===oe.f_expr||t===oe.f_stat||(e!==_.colon||t!==oe.b_stat&&t!==oe.b_expr?e===_._return||e===_.name&&this.exprAllowed?S.test(this.input.slice(this.lastTokEnd,this.start)):e===_._else||e===_.semi||e===_.eof||e===_.parenR||e===_.arrow||(e===_.braceL?t===oe.b_stat:e!==_._var&&e!==_._const&&e!==_.name&&!this.exprAllowed):!t.isExpr)},ce.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},ce.updateContext=function(e){var t,i=this.type;i.keyword&&e===_.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},_.parenR.updateContext=_.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===oe.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},_.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?oe.b_stat:oe.b_expr),this.exprAllowed=!0},_.dollarBraceL.updateContext=function(){this.context.push(oe.b_tmpl),this.exprAllowed=!0},_.parenL.updateContext=function(e){var t=e===_._if||e===_._for||e===_._with||e===_._while;this.context.push(t?oe.p_stat:oe.p_expr),this.exprAllowed=!0},_.incDec.updateContext=function(){},_._function.updateContext=_._class.updateContext=function(e){!e.beforeExpr||e===_.semi||e===_._else||e===_._return&&S.test(this.input.slice(this.lastTokEnd,this.start))||(e===_.colon||e===_.braceL)&&this.curContext()===oe.b_stat?this.context.push(oe.f_stat):this.context.push(oe.f_expr),this.exprAllowed=!1},_.backQuote.updateContext=function(){this.curContext()===oe.q_tmpl?this.context.pop():this.context.push(oe.q_tmpl),this.exprAllowed=!1},_.star.updateContext=function(e){if(e===_._function){var t=this.context.length-1;this.context[t]===oe.f_expr?this.context[t]=oe.f_expr_gen:this.context[t]=oe.f_gen}this.exprAllowed=!0},_.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==_.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var le="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",he=le+" Extended_Pictographic",ue={9:le,10:he,11:he},pe="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",de="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",fe=de+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ge={9:de,10:fe,11:fe+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},me={};function ye(e){var t=me[e]={binary:O(ue[e]+" "+pe),nonBinary:{General_Category:O(pe),Script:O(ge[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}ye(9),ye(10),ye(11);var ve=j.prototype,be=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=me[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function xe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function we(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function _e(e){return e>=65&&e<=90||e>=97&&e<=122}function Se(e){return _e(e)||95===e}function ke(e){return Se(e)||Ee(e)}function Ee(e){return e>=48&&e<=57}function Ae(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ce(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ie(e){return e>=48&&e<=55}be.prototype.reset=function(e,t,i){var n=-1!==i.indexOf("u");this.start=0|e,this.source=t+"",this.flags=i,this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchN=n&&this.parser.options.ecmaVersion>=9},be.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},be.prototype.at=function(e){var t=this.source,i=t.length;if(e>=i)return-1;var n=t.charCodeAt(e);if(!this.switchU||n<=55295||n>=57344||e+1>=i)return n;var r=t.charCodeAt(e+1);return r>=56320&&r<=57343?(n<<10)+r-56613888:n},be.prototype.nextIndex=function(e){var t=this.source,i=t.length;if(e>=i)return i;var n,r=t.charCodeAt(e);return!this.switchU||r<=55295||r>=57344||e+1>=i||(n=t.charCodeAt(e+1))<56320||n>57343?e+1:e+2},be.prototype.current=function(){return this.at(this.pos)},be.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},be.prototype.advance=function(){this.pos=this.nextIndex(this.pos)},be.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},ve.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,n=0;n<i.length;n++){var r=i.charAt(n);-1===t.indexOf(r)&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(r,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}},ve.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},ve.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var n=i[t];-1===e.groupNames.indexOf(n)&&e.raise("Invalid named capture referenced")}},ve.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},ve.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},ve.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},ve.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1},ve.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},ve.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ve.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var n=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return-1!==r&&r<n&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1},ve.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},ve.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},ve.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1},ve.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},ve.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},ve.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ve.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!we(t)&&(e.lastIntValue=t,e.advance(),!0)},ve.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!we(i);)e.advance();return e.pos!==t},ve.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},ve.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},ve.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},ve.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=xe(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=xe(e.lastIntValue);return!0}return!1},ve.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=e.current();return e.advance(),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(i=e.lastIntValue),function(e){return f(e,!0)||36===e||95===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},ve.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=e.current();return e.advance(),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(i=e.lastIntValue),function(e){return g(e,!0)||36===e||95===e||8204===e||8205===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},ve.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},ve.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1},ve.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},ve.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},ve.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ve.regexp_eatZero=function(e){return 48===e.current()&&!Ee(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},ve.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},ve.regexp_eatControlLetter=function(e){var t=e.current();return!!_e(t)&&(e.lastIntValue=t%32,e.advance(),!0)},ve.regexp_eatRegExpUnicodeEscapeSequence=function(e){var t,i=e.pos;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(e.switchU&&n>=55296&&n<=56319){var r=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=1024*(n-55296)+(s-56320)+65536,!0}e.pos=r,e.lastIntValue=n}return!0}if(e.switchU&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((t=e.lastIntValue)>=0&&t<=1114111))return!0;e.switchU&&e.raise("Invalid unicode escape"),e.pos=i}return!1},ve.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},ve.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},ve.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},ve.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,n),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r),!0}return!1},ve.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){N(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},ve.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},ve.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Se(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ve.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";ke(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ve.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ve.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},ve.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;!e.switchU||-1!==t&&-1!==i||e.raise("Invalid character class"),-1!==t&&-1!==i&&t>i&&e.raise("Range out of order in character class")}}},ve.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(99===i||Ie(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,e.advance(),!0)},ve.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},ve.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Ee(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},ve.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},ve.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ee(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},ve.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ae(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ce(i),e.advance();return e.pos!==t},ve.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*i+e.lastIntValue:e.lastIntValue=8*t+i}else e.lastIntValue=t;return!0}return!1},ve.regexp_eatOctalDigit=function(e){var t=e.current();return Ie(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},ve.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var n=0;n<t;++n){var r=e.current();if(!Ae(r))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+Ce(r),e.advance()}return!0};var Te=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new D(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Pe=j.prototype;function Ne(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}Pe.next=function(){this.options.onToken&&this.options.onToken(new Te(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Pe.getToken=function(){return this.next(),new Te(this)},"undefined"!=typeof Symbol&&(Pe[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===_.eof,value:t}}}}),Pe.curContext=function(){return this.context[this.context.length-1]},Pe.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(_.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Pe.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Pe.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Pe.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),i=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(k.lastIndex=i;(e=k.exec(this.input))&&e.index<this.pos;)++this.curLine,this.lineStart=e.index+e[0].length;this.options.onComment&&this.options.onComment(!0,this.input.slice(i+2,n),i,this.pos,t,this.curPosition())},Pe.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!E(n);)n=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())},Pe.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&A.test(String.fromCharCode(e))))break e;++this.pos}}},Pe.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)},Pe.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(_.ellipsis)):(++this.pos,this.finishToken(_.dot))},Pe.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(_.assign,2):this.finishOp(_.slash,1)},Pe.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,n=42===e?_.star:_.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,n=_.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(_.assign,i+1):this.finishOp(n,i)},Pe.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?_.logicalOR:_.logicalAND,2):61===t?this.finishOp(_.assign,2):this.finishOp(124===e?_.bitwiseOR:_.bitwiseAND,1)},Pe.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(_.assign,2):this.finishOp(_.bitwiseXOR,1)},Pe.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!S.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(_.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(_.assign,2):this.finishOp(_.plusMin,1)},Pe.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(_.assign,i+1):this.finishOp(_.bitShift,i)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(i=2),this.finishOp(_.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Pe.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(_.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(_.arrow)):this.finishOp(61===e?_.eq:_.prefix,1)},Pe.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(_.parenL);case 41:return++this.pos,this.finishToken(_.parenR);case 59:return++this.pos,this.finishToken(_.semi);case 44:return++this.pos,this.finishToken(_.comma);case 91:return++this.pos,this.finishToken(_.bracketL);case 93:return++this.pos,this.finishToken(_.bracketR);case 123:return++this.pos,this.finishToken(_.braceL);case 125:return++this.pos,this.finishToken(_.braceR);case 58:return++this.pos,this.finishToken(_.colon);case 63:return++this.pos,this.finishToken(_.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(_.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(_.prefix,1)}this.raise(this.pos,"Unexpected character '"+Ne(e)+"'")},Pe.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},Pe.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(S.test(n)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var r=this.input.slice(i,this.pos);++this.pos;var s=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(s);var o=this.regexpState||(this.regexpState=new be(this));o.reset(i,r,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var c=null;try{c=new RegExp(r,a)}catch(e){}return this.finishToken(_.regexp,{pattern:r,flags:a,value:c})},Pe.readInt=function(e,t){for(var i=this.pos,n=0,r=0,s=null==t?1/0:t;r<s;++r){var a=this.input.charCodeAt(this.pos),o=void 0;if((o=a>=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=e)break;++this.pos,n=n*e+o}return this.pos===i||null!=t&&this.pos-i!==t?null:n},Pe.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return null==i&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i="undefined"!=typeof BigInt?BigInt(this.input.slice(t,this.pos)):null,++this.pos):f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(_.num,i)},Pe.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var i=this.pos-t>=2&&48===this.input.charCodeAt(t);i&&this.strict&&this.raise(t,"Invalid number"),i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1);var n=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&110===n){var r=this.input.slice(t,this.pos),s="undefined"!=typeof BigInt?BigInt(r):null;return++this.pos,f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(_.num,s)}46!==n||i||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||i||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),f(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=this.input.slice(t,this.pos),o=i?parseInt(a,8):parseFloat(a);return this.finishToken(_.num,o)},Pe.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},Pe.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):(E(n,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(_.string,t)};var Le={};Pe.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Le)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Pe.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Le;this.raise(e,t)},Pe.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==_.template&&this.type!==_.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(_.template,e)):36===i?(this.pos+=2,this.finishToken(_.dollarBraceL)):(++this.pos,this.finishToken(_.backQuote));if(92===i)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(E(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Pe.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(_.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")},Pe.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Ne(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";default:if(t>=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(i,8);return n>255&&(i=i.slice(0,-1),n=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),"0"===i&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return E(t)?"":String.fromCharCode(t)}},Pe.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},Pe.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,n=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(g(r,n))this.pos+=r<=65535?1:2;else{if(92!==r)break;this.containsEsc=!0,e+=this.input.slice(i,this.pos);var s=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?f:g)(a,n)||this.invalidStringToken(s,"Invalid Unicode escape"),e+=Ne(a),i=this.pos}t=!1}return e+this.input.slice(i,this.pos)},Pe.readWord=function(){var e=this.readWord1(),t=_.name;return this.keywords.test(e)&&(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+e),t=x[e]),this.finishToken(t,e)};var Oe="6.4.2";function Me(e,t){return j.parse(e,t)}function De(e,t,i){return j.parseExpressionAt(e,t,i)}function Re(e,t){return j.tokenizer(e,t)}j.acorn={Parser:j,version:Oe,defaultOptions:$,Position:M,SourceLocation:D,getLineInfo:R,Node:ne,TokenType:m,tokTypes:_,keywordTypes:x,TokContext:ae,tokContexts:oe,isIdentifierChar:g,isIdentifierStart:f,Token:Te,isNewLine:E,lineBreak:S,lineBreakG:k,nonASCIIwhitespace:A}}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};i.d(n,{c:()=>$n,E:()=>jn});
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const r=window,s=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),o=new WeakMap;class c{constructor(e,t,i){if(this._$cssResult$=!0,i!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(s&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=o.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&o.set(t,e))}return e}toString(){return this.cssText}}const l=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,i,n)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[n+1]),e[0]);return new c(i,e,a)},h=s?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new c("string"==typeof e?e:e+"",void 0,a))(t)})(e):e;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
var u;const p=window,d=p.trustedTypes,f=d?d.emptyScript:"",g=p.reactiveElementPolyfillSupport,m={toAttribute(e,t){switch(t){case Boolean:e=e?f:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},y=(e,t)=>t!==e&&(t==t||e==e),v={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:y};class b extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,i)=>{const n=this._$Ep(i,t);void 0!==n&&(this._$Ev.set(n,i),e.push(n))})),e}static createProperty(e,t=v){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i="symbol"==typeof e?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,t);void 0!==n&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(n){const r=this[e];this[t]=n,this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||v}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(h(e))}else void 0!==e&&t.push(h(e));return t}static _$Ep(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,i;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(i=e.hostConnected)||void 0===i||i.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{s?e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):t.forEach((t=>{const i=document.createElement("style"),n=r.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=t.cssText,e.appendChild(i)}))})(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=v){var n;const r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:m).toAttribute(t,i.type);this._$El=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$El=null}}_$AK(e,t){var i;const n=this.constructor,r=n._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=n.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:m;this._$El=r,this[r]=s.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let n=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||y)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((e,t)=>this[t]=e)),this._$Ei=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach(((e,t)=>this._$EO(t,this[t],e))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
var x;b.finalized=!0,b.elementProperties=new Map,b.elementStyles=[],b.shadowRootOptions={mode:"open"},null==g||g({ReactiveElement:b}),(null!==(u=p.reactiveElementVersions)&&void 0!==u?u:p.reactiveElementVersions=[]).push("1.4.2");const w=window,_=w.trustedTypes,S=_?_.createPolicy("lit-html",{createHTML:e=>e}):void 0,k=`lit$${(Math.random()+"").slice(9)}$`,E="?"+k,A=`<${E}>`,C=document,I=(e="")=>C.createComment(e),T=e=>null===e||"object"!=typeof e&&"function"!=typeof e,P=Array.isArray,N=e=>P(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]),L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,M=/>/g,D=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),R=/'/g,$=/"/g,V=/^(?:script|style|textarea|title)$/i,F=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),j=F(1),B=(F(2),Symbol.for("lit-noChange")),U=Symbol.for("lit-nothing"),H=new WeakMap,q=C.createTreeWalker(C,129,null,!1),z=(e,t)=>{const i=e.length-1,n=[];let r,s=2===t?"<svg>":"",a=L;for(let t=0;t<i;t++){const i=e[t];let o,c,l=-1,h=0;for(;h<i.length&&(a.lastIndex=h,c=a.exec(i),null!==c);)h=a.lastIndex,a===L?"!--"===c[1]?a=O:void 0!==c[1]?a=M:void 0!==c[2]?(V.test(c[2])&&(r=RegExp("</"+c[2],"g")),a=D):void 0!==c[3]&&(a=D):a===D?">"===c[0]?(a=null!=r?r:L,l=-1):void 0===c[1]?l=-2:(l=a.lastIndex-c[2].length,o=c[1],a=void 0===c[3]?D:'"'===c[3]?$:R):a===$||a===R?a=D:a===O||a===M?a=L:(a=D,r=void 0);const u=a===D&&e[t+1].startsWith("/>")?" ":"";s+=a===L?i+A:l>=0?(n.push(o),i.slice(0,l)+"$lit$"+i.slice(l)+k+u):i+k+(-2===l?(n.push(void 0),t):u)}const o=s+(e[i]||"<?>")+(2===t?"</svg>":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==S?S.createHTML(o):o,n]};class G{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,s=0;const a=e.length-1,o=this.parts,[c,l]=z(e,t);if(this.el=G.createElement(c,i),q.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(n=q.nextNode())&&o.length<a;){if(1===n.nodeType){if(n.hasAttributes()){const e=[];for(const t of n.getAttributeNames())if(t.endsWith("$lit$")||t.startsWith(k)){const i=l[s++];if(e.push(t),void 0!==i){const e=n.getAttribute(i.toLowerCase()+"$lit$").split(k),t=/([.?@])?(.*)/.exec(i);o.push({type:1,index:r,name:t[2],strings:e,ctor:"."===t[1]?X:"?"===t[1]?Q:"@"===t[1]?ee:Z})}else o.push({type:6,index:r})}for(const t of e)n.removeAttribute(t)}if(V.test(n.tagName)){const e=n.textContent.split(k),t=e.length-1;if(t>0){n.textContent=_?_.emptyScript:"";for(let i=0;i<t;i++)n.append(e[i],I()),q.nextNode(),o.push({type:2,index:++r});n.append(e[t],I())}}}else if(8===n.nodeType)if(n.data===E)o.push({type:2,index:r});else{let e=-1;for(;-1!==(e=n.data.indexOf(k,e+1));)o.push({type:7,index:r}),e+=k.length-1}r++}}static createElement(e,t){const i=C.createElement("template");return i.innerHTML=e,i}}function W(e,t,i=e,n){var r,s,a,o;if(t===B)return t;let c=void 0!==n?null===(r=i._$Co)||void 0===r?void 0:r[n]:i._$Cl;const l=T(t)?void 0:t._$litDirective$;return(null==c?void 0:c.constructor)!==l&&(null===(s=null==c?void 0:c._$AO)||void 0===s||s.call(c,!1),void 0===l?c=void 0:(c=new l(e),c._$AT(e,i,n)),void 0!==n?(null!==(a=(o=i)._$Co)&&void 0!==a?a:o._$Co=[])[n]=c:i._$Cl=c),void 0!==c&&(t=W(e,c._$AS(e,t.values),c,n)),t}class Y{constructor(e,t){this.u=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(e){var t;const{el:{content:i},parts:n}=this._$AD,r=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:C).importNode(i,!0);q.currentNode=r;let s=q.nextNode(),a=0,o=0,c=n[0];for(;void 0!==c;){if(a===c.index){let t;2===c.type?t=new J(s,s.nextSibling,this,e):1===c.type?t=new c.ctor(s,c.name,c.strings,this,e):6===c.type&&(t=new te(s,this,e)),this.u.push(t),c=n[++o]}a!==(null==c?void 0:c.index)&&(s=q.nextNode(),a++)}return r}p(e){let t=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class J{constructor(e,t,i,n){var r;this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=n,this._$Cm=null===(r=null==n?void 0:n.isConnected)||void 0===r||r}get _$AU(){var e,t;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cm}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=W(this,e,t),T(e)?e===U||null==e||""===e?(this._$AH!==U&&this._$AR(),this._$AH=U):e!==this._$AH&&e!==B&&this.g(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):N(e)?this.k(e):this.g(e)}O(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==U&&T(this._$AH)?this._$AA.nextSibling.data=e:this.T(C.createTextNode(e)),this._$AH=e}$(e){var t;const{values:i,_$litType$:n}=e,r="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=G.createElement(n.h,this.options)),n);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.p(i);else{const e=new Y(r,this),t=e.v(this.options);e.p(i),this.T(t),this._$AH=e}}_$AC(e){let t=H.get(e.strings);return void 0===t&&H.set(e.strings,t=new G(e)),t}k(e){P(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,n=0;for(const r of e)n===t.length?t.push(i=new J(this.O(I()),this.O(I()),this,this.options)):i=t[n],i._$AI(r),n++;n<t.length&&(this._$AR(i&&i._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){var t;void 0===this._$AM&&(this._$Cm=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}class Z{constructor(e,t,i,n,r){this.type=1,this._$AH=U,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=U}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,n){const r=this.strings;let s=!1;if(void 0===r)e=W(this,e,t,0),s=!T(e)||e!==this._$AH&&e!==B,s&&(this._$AH=e);else{const n=e;let a,o;for(e=r[0],a=0;a<r.length-1;a++)o=W(this,n[i+a],t,a),o===B&&(o=this._$AH[a]),s||(s=!T(o)||o!==this._$AH[a]),o===U?e=U:e!==U&&(e+=(null!=o?o:"")+r[a+1]),this._$AH[a]=o}s&&!n&&this.j(e)}j(e){e===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}class X extends Z{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}}const K=_?_.emptyScript:"";class Q extends Z{constructor(){super(...arguments),this.type=4}j(e){e&&e!==U?this.element.setAttribute(this.name,K):this.element.removeAttribute(this.name)}}class ee extends Z{constructor(e,t,i,n,r){super(e,t,i,n,r),this.type=5}_$AI(e,t=this){var i;if((e=null!==(i=W(this,e,t,0))&&void 0!==i?i:U)===B)return;const n=this._$AH,r=e===U&&n!==U||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==U&&(n===U||r);r&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==i?i:this.element,e):this._$AH.handleEvent(e)}}class te{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){W(this,e)}}const ie=w.litHtmlPolyfillSupport;null==ie||ie(G,J),(null!==(x=w.litHtmlVersions)&&void 0!==x?x:w.litHtmlVersions=[]).push("2.4.0");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
var ne,re;class se extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const i=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{var n,r;const s=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:t;let a=s._$litPart$;if(void 0===a){const e=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;s._$litPart$=a=new J(t.insertBefore(I(),e),e,void 0,null!=i?i:{})}return a._$AI(e),a})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return B}}se.finalized=!0,se._$litElement$=!0,null===(ne=globalThis.litElementHydrateSupport)||void 0===ne||ne.call(globalThis,{LitElement:se});const ae=globalThis.litElementPolyfillSupport;null==ae||ae({LitElement:se});(null!==(re=globalThis.litElementVersions)&&void 0!==re?re:globalThis.litElementVersions=[]).push("3.2.2");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const oe=e=>t=>"function"==typeof t?((e,t)=>(customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:i,elements:n}=t;return{kind:i,elements:n,finisher(t){customElements.define(e,t)}}})(e,t),ce=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(i){i.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(i){i.createProperty(t.key,e)}};function le(e){return(t,i)=>void 0!==i?((e,t,i)=>{t.constructor.createProperty(i,e)})(e,t,i):ce(e,t)}
/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
var he;null===(he=window.HTMLSlotElement)||void 0===he||he.prototype.assignedElements;class ue{static closestElement(e,t){return function t(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(e);return n||t(i.getRootNode().host)}(t)}}const pe=(e,t,i,n)=>{n=n||{},i=null==i?{}:i;const r=new Event(t,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return r.detail=i,e.dispatchEvent(r),r},de=(e,t,i=!1)=>{i?history.replaceState(null,"",t):history.pushState(null,"",t),pe(window,"location-changed",{replace:i})};class fe{constructor(e,t,i,n){this.entityId=e,this.svgElement=t,this.originalSvgElement=i,this.originalBBox=n}}class ge{constructor(e){this.rule=e,this.svgElementInfos={}}}class me{constructor(e,t,i,n,r,s){this.instance=e,this.entityId=t,this.elementId=i,this.svgElementInfo=n,this.ruleInfo=r,this.actions=s}}const ye={},ve={};ve.click=ve.mousedown=ve.mouseup=ve.mousemove="MouseEvents";let be=1;function xe(e){return e._dtId||(e._dtId=be++)}function we(e){const t=e.indexOf(".");return t>0?{e:e.substring(0,e.indexOf(".")),ns:e.substring(t+1,e.length)}:{e}}function _e(e,t,i,n){const r=we(i).e;if(!e._dtId)return!1;const s=ye[xe(e)],a=function(e,t,i,n){return i=we(i),(ye[xe(e)]||[]).filter((e=>e&&(!i.e||e.e===i.e)&&(!i.ns||e.ns===i.ns)&&(!n||e.callback===n)&&(!t||e.selector===t)))}(e,t,i,n);a.forEach((t=>{e.removeEventListener?e.removeEventListener(r,t.delegator||t.callback):e.detachEvent&&e.detachEvent("on"+r,t.delegator||t.callback),s.splice(s.indexOf(t),1)}))}function Se(e,t,i,n,r,s){const a=we(i).e,o=we(i).ns;e.addEventListener?e.addEventListener(a,r||n,s):e.attachEvent&&e.attachEvent("on"+a,r||n);const c=xe(e);(ye[c]||(ye[c]=[])).push({delegator:r,callback:n,e:a,ns:o,selector:t})}const ke={on(e,t,i,n=null){Se(e,null,t,i,null,n)},off(e,t,i=null){_e(e,null,t,i)},once(e,t,i){const n=e=>(ke.off(e.currentTarget,e.type,n),i(e));this.on(e,t,n)},delegate(e,t,i,n,r=null){Se(e,t,i,n,(function(i){const r=e.querySelectorAll(t);let s=!1;for(let e=0;e<r.length;e++){const t=r[e];if(t===i.target||t.contains(i.target)){s=t;break}}s&&n.apply(s,[].slice.call(arguments))}),r)},undelegate(e,t,i,n){_e(e,t,i,n)},trigger(e,t,i){const n=document.createEvent(ve[t]||"Events");let r=!0;if(i)for(const e in i)({}).hasOwnProperty.call(i,e)&&("bubbles"===e?r=!!i[e]:n[e]=i[e]);n.initEvent(t,r,!0),e.dispatchEvent(n)}},Ee=ke,Ae=Ee;class Ce{static observe(e){let t,i=!1;const n=()=>{i=!1,t=setTimeout((()=>{i=!0,e.dispatchEvent(new Event("longClick"))}),400)},r=n=>{clearTimeout(t),i||e.dispatchEvent(new Event("short"+n.type[0].toUpperCase()+n.type.slice(1)))},s=e=>{i&&(e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation())};Ae.on(e,"mousedown",n.bind(this)),Ae.on(e,"tapstart",n.bind(this)),Ae.on(e,"touchstart",n.bind(this),{passive:!0}),Ae.on(e,"click",r.bind(this)),Ae.on(e,"mouseup",r.bind(this)),Ae.on(e,"tapend",r.bind(this)),Ae.on(e,"touchend",r.bind(this)),Ae.on(e,"tap",s.bind(this)),Ae.on(e,"touch",s.bind(this)),Ae.on(e,"mouseup",s.bind(this)),Ae.on(e,"tapend",s.bind(this)),Ae.on(e,"touchend",s.bind(this)),Ae.on(e,"click",(e=>{e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation()}).bind(this))}}const Ie=Ee,Te=new Set;class Pe{static observe(e){if(Te.has(e))return;Te.add(e);let t,i=0;Ie.on(e,"click",(()=>{i++,t=setTimeout((()=>{1===i&&(i=0,e.dispatchEvent(new Event("singleClick")))}),400),2===i&&(clearTimeout(t),i=0,e.dispatchEvent(new Event("doubleClick")))}).bind(this))}}var Ne,Le=i(625),Oe=i.n(Le);class Me{static timeago(e){let t="second",i=0;const n=("string"==typeof e?new Date(e):e).getTime()-(new Date).getTime(),r=n/this.MILLISECONDS_IN_YEAR;if(Math.abs(r)>=1)t="year",i=r;else{const e=n/this.MILLISECONDS_IN_DAY;if(Math.abs(e)>=1)t="day",i=e;else{const e=n/this.MILLISECONDS_IN_HOUR;if(Math.abs(e)>=1)t="hour",i=e;else{const e=n/this.MILLISECONDS_IN_MINUTE;if(Math.abs(e)>=1)t="minute",i=e;else{t="second",i=n/this.MILLISECONDS_IN_SECOND}}}}return this.relativeTimeFormat.format(Math.round(i),t)}}Ne=Me,Me.strftime=Oe(),Me.MILLISECONDS_IN_SECOND=1e3,Me.MILLISECONDS_IN_MINUTE=6e4,Me.MILLISECONDS_IN_HOUR=36e5,Me.MILLISECONDS_IN_DAY=864e5,Me.MILLISECONDS_IN_YEAR=31536e6,Me.DEFAULT_LANG="en",Me.relativeTimeFormat=new Intl.RelativeTimeFormat("undefined"!=typeof window?window.navigator?.language:Ne.DEFAULT_LANG,{numeric:"auto",style:"long"});var De=i(156),Re=i.n(De);function $e(e){return(e=>{if("object"==typeof(t=e)&&null!==t&&"message"in t&&"string"==typeof t.message)return e;var t;try{return new Error(JSON.stringify(e))}catch{return new Error(String(e))}})(e).message}const Ve="ha-floorplan-service-call";class Fe{static isCode(e){return this.isCodeBlock(e)||this.isCodeLine(e)}static isCodeBlock(e){return e.trim().startsWith(">")}static isCodeLine(e){return e.includes("${")&&e.includes("}")}static evaluate(e,t,i,n,r,s,a,o,c,l){this.expression=e.trim();const h=`${this.expression}_${r??""}`;this.parsedFunction=this.cache[h],void 0===this.parsedFunction&&(this.functionBody=this.expression,this.isCodeBlock(this.functionBody)?this.functionBody=this.functionBody.slice(1).trim():this.isCodeLine(this.functionBody)&&(this.functionBody.startsWith('"')&&this.functionBody.endsWith('"')&&(this.functionBody=this.functionBody.slice(1,this.functionBody.length-2)),this.functionBody=this.functionBody.replace(/\\"/g,'"'),this.functionBody=`\`${this.functionBody}\`;`,this.functionBody.includes("return")||(this.functionBody=`return ${this.functionBody}`)),this.parsedFunction=this.interpreter.parse(`exports.result = (() => { ${this.functionBody} })();`),this.cache[h]=this.parsedFunction,this.interpreter.import("config",i),this.interpreter.import("util",this.util)),this.entityState=n?t.states[n]:void 0,this.interpreter.import("functions",a),this.interpreter.import("entity",this.entityState),this.interpreter.import("entities",t.states),this.interpreter.import("states",t.states),this.interpreter.import("hass",t),this.interpreter.import("element",r),this.interpreter.import("elements",s),this.interpreter.import("svg",c),this.interpreter.import("action",(e=>{e.action=e?.action||"call-service",function(e,t){const i=new CustomEvent(Ve,{detail:t,bubbles:!0,composed:!0});e.dispatchEvent(i)}(r,{actionConfig:e,entityId:n,svgElementInfo:o,ruleInfo:l})}));try{this.interpreter.run(this.parsedFunction)}catch(e){throw new EvalError($e(e))}return this.interpreter.exports.result}}
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
function je(e){return null==e}Fe.cache={},Fe.interpreter=new(Re())({ecmaVer:2019,sandBox:!0}),Fe.util={color:class{static miredToRGB(e){return this.kelvinToRGB(1e6/e)}static kelvinToRGB(e){const t=e/100;let i,n,r;return t<=66?(i=255,n=t,n=99.4708025861*Math.log(n)-161.1195681661,t<=19?r=0:(r=t-10,r=138.5177312231*Math.log(r)-305.0447927307)):(i=t-60,i=329.698727446*Math.pow(i,-.1332047592),n=t-60,n=288.1221695283*Math.pow(n,-.0755148492),r=255),[Math.min(Math.max(Math.round(i),0),255),Math.min(Math.max(Math.round(n),0),255),Math.min(Math.max(Math.round(r),0),255)]}},date:Me};var Be={isNothing:je,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:je(e)?[]:[e]},repeat:function(e,t){var i,n="";for(i=0;i<t;i+=1)n+=e;return n},isNegativeZero:function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:function(e,t){var i,n,r,s;if(t)for(i=0,n=(s=Object.keys(t)).length;i<n;i+=1)e[r=s[i]]=t[r];return e}};function Ue(e,t){var i="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+='in "'+e.mark.name+'" '),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(i+="\n\n"+e.mark.snippet),n+" "+i):n}function He(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Ue(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}He.prototype=Object.create(Error.prototype),He.prototype.constructor=He,He.prototype.toString=function(e){return this.name+": "+Ue(this,e)};var qe=He;function ze(e,t,i,n,r){var s="",a="",o=Math.floor(r/2)-1;return n-t>o&&(t=n-o+(s=" ... ").length),i-n>o&&(i=n+o-(a=" ...").length),{str:s+e.slice(t,i).replace(/\t/g,"→")+a,pos:n-t+s.length}}function Ge(e,t){return Be.repeat(" ",t-e.length)+e}var We=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var i,n=/\r?\n|\r|\0/g,r=[0],s=[],a=-1;i=n.exec(e.buffer);)s.push(i.index),r.push(i.index+i[0].length),e.position<=i.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var o,c,l="",h=Math.min(e.line+t.linesAfter,s.length).toString().length,u=t.maxLength-(t.indent+h+3);for(o=1;o<=t.linesBefore&&!(a-o<0);o++)c=ze(e.buffer,r[a-o],s[a-o],e.position-(r[a]-r[a-o]),u),l=Be.repeat(" ",t.indent)+Ge((e.line-o+1).toString(),h)+" | "+c.str+"\n"+l;for(c=ze(e.buffer,r[a],s[a],e.position,u),l+=Be.repeat(" ",t.indent)+Ge((e.line+1).toString(),h)+" | "+c.str+"\n",l+=Be.repeat("-",t.indent+h+3+c.pos)+"^\n",o=1;o<=t.linesAfter&&!(a+o>=s.length);o++)c=ze(e.buffer,r[a+o],s[a+o],e.position-(r[a]-r[a+o]),u),l+=Be.repeat(" ",t.indent)+Ge((e.line+o+1).toString(),h)+" | "+c.str+"\n";return l.replace(/\n$/,"")},Ye=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Je=["scalar","sequence","mapping"];var Ze=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===Ye.indexOf(t))throw new qe('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(i){e[i].forEach((function(e){t[String(e)]=i}))})),t}(t.styleAliases||null),-1===Je.indexOf(this.kind))throw new qe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function Xe(e,t){var i=[];return e[t].forEach((function(e){var t=i.length;i.forEach((function(i,n){i.tag===e.tag&&i.kind===e.kind&&i.multi===e.multi&&(t=n)})),i[t]=e})),i}function Ke(e){return this.extend(e)}Ke.prototype.extend=function(e){var t=[],i=[];if(e instanceof Ze)i.push(e);else if(Array.isArray(e))i=i.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new qe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(i=i.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof Ze))throw new qe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new qe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new qe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),i.forEach((function(e){if(!(e instanceof Ze))throw new qe("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(Ke.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(i),n.compiledImplicit=Xe(n,"implicit"),n.compiledExplicit=Xe(n,"explicit"),n.compiledTypeMap=function(){var e,t,i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function n(e){e.multi?(i.multi[e.kind].push(e),i.multi.fallback.push(e)):i[e.kind][e.tag]=i.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(n);return i}(n.compiledImplicit,n.compiledExplicit),n};var Qe=Ke,et=new Ze("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),tt=new Ze("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),it=new Ze("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}}),nt=new Qe({explicit:[et,tt,it]});var rt=new Ze("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});var st=new Ze("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function at(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function ot(e){return 48<=e&&e<=55}function ct(e){return 48<=e&&e<=57}var lt=new Ze("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,i=e.length,n=0,r=!1;if(!i)return!1;if("-"!==(t=e[n])&&"+"!==t||(t=e[++n]),"0"===t){if(n+1===i)return!0;if("b"===(t=e[++n])){for(n++;n<i;n++)if("_"!==(t=e[n])){if("0"!==t&&"1"!==t)return!1;r=!0}return r&&"_"!==t}if("x"===t){for(n++;n<i;n++)if("_"!==(t=e[n])){if(!at(e.charCodeAt(n)))return!1;r=!0}return r&&"_"!==t}if("o"===t){for(n++;n<i;n++)if("_"!==(t=e[n])){if(!ot(e.charCodeAt(n)))return!1;r=!0}return r&&"_"!==t}}if("_"===t)return!1;for(;n<i;n++)if("_"!==(t=e[n])){if(!ct(e.charCodeAt(n)))return!1;r=!0}return!(!r||"_"===t)},construct:function(e){var t,i=e,n=1;if(-1!==i.indexOf("_")&&(i=i.replace(/_/g,"")),"-"!==(t=i[0])&&"+"!==t||("-"===t&&(n=-1),t=(i=i.slice(1))[0]),"0"===i)return 0;if("0"===t){if("b"===i[1])return n*parseInt(i.slice(2),2);if("x"===i[1])return n*parseInt(i.slice(2),16);if("o"===i[1])return n*parseInt(i.slice(2),8)}return n*parseInt(i,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!Be.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ht=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var ut=/^[-+]?[0-9]+e/;var pt=new Ze("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!ht.test(e)||"_"===e[e.length-1])},construct:function(e){var t,i;return i="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===i?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:i*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||Be.isNegativeZero(e))},represent:function(e,t){var i;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Be.isNegativeZero(e))return"-0.0";return i=e.toString(10),ut.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),dt=nt.extend({implicit:[rt,st,lt,pt]}),ft=dt,gt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),mt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var yt=new Ze("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==gt.exec(e)||null!==mt.exec(e))},construct:function(e){var t,i,n,r,s,a,o,c,l=0,h=null;if(null===(t=gt.exec(e))&&(t=mt.exec(e)),null===t)throw new Error("Date resolve error");if(i=+t[1],n=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(i,n,r));if(s=+t[4],a=+t[5],o=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(h=-h)),c=new Date(Date.UTC(i,n,r,s,a,o,l)),h&&c.setTime(c.getTime()-h),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var vt=new Ze("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var xt=new Ze("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,i,n=0,r=e.length,s=bt;for(i=0;i<r;i++)if(!((t=s.indexOf(e.charAt(i)))>64)){if(t<0)return!1;n+=6}return n%8==0},construct:function(e){var t,i,n=e.replace(/[\r\n=]/g,""),r=n.length,s=bt,a=0,o=[];for(t=0;t<r;t++)t%4==0&&t&&(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)),a=a<<6|s.indexOf(n.charAt(t));return 0===(i=r%4*6)?(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)):18===i?(o.push(a>>10&255),o.push(a>>2&255)):12===i&&o.push(a>>4&255),new Uint8Array(o)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,i,n="",r=0,s=e.length,a=bt;for(t=0;t<s;t++)t%3==0&&t&&(n+=a[r>>18&63],n+=a[r>>12&63],n+=a[r>>6&63],n+=a[63&r]),r=(r<<8)+e[t];return 0===(i=s%3)?(n+=a[r>>18&63],n+=a[r>>12&63],n+=a[r>>6&63],n+=a[63&r]):2===i?(n+=a[r>>10&63],n+=a[r>>4&63],n+=a[r<<2&63],n+=a[64]):1===i&&(n+=a[r>>2&63],n+=a[r<<4&63],n+=a[64],n+=a[64]),n}}),wt=Object.prototype.hasOwnProperty,_t=Object.prototype.toString;var St=new Ze("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,i,n,r,s,a=[],o=e;for(t=0,i=o.length;t<i;t+=1){if(n=o[t],s=!1,"[object Object]"!==_t.call(n))return!1;for(r in n)if(wt.call(n,r)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==a.indexOf(r))return!1;a.push(r)}return!0},construct:function(e){return null!==e?e:[]}}),kt=Object.prototype.toString;var Et=new Ze("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,i,n,r,s,a=e;for(s=new Array(a.length),t=0,i=a.length;t<i;t+=1){if(n=a[t],"[object Object]"!==kt.call(n))return!1;if(1!==(r=Object.keys(n)).length)return!1;s[t]=[r[0],n[r[0]]]}return!0},construct:function(e){if(null===e)return[];var t,i,n,r,s,a=e;for(s=new Array(a.length),t=0,i=a.length;t<i;t+=1)n=a[t],r=Object.keys(n),s[t]=[r[0],n[r[0]]];return s}}),At=Object.prototype.hasOwnProperty;var Ct=new Ze("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,i=e;for(t in i)if(At.call(i,t)&&null!==i[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),It=ft.extend({implicit:[yt,vt],explicit:[xt,St,Et,Ct]}),Tt=Object.prototype.hasOwnProperty,Pt=1,Nt=2,Lt=3,Ot=4,Mt=1,Dt=2,Rt=3,$t=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Vt=/[\x85\u2028\u2029]/,Ft=/[,\[\]\{\}]/,jt=/^(?:!|!!|![a-z\-]+!)$/i,Bt=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Ut(e){return Object.prototype.toString.call(e)}function Ht(e){return 10===e||13===e}function qt(e){return 9===e||32===e}function zt(e){return 9===e||32===e||10===e||13===e}function Gt(e){return 44===e||91===e||93===e||123===e||125===e}function Wt(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function Yt(e){return 120===e?2:117===e?4:85===e?8:0}function Jt(e){return 48<=e&&e<=57?e-48:-1}function Zt(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function Xt(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var Kt=new Array(256),Qt=new Array(256),ei=0;ei<256;ei++)Kt[ei]=Zt(ei)?1:0,Qt[ei]=Zt(ei);function ti(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||It,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function ii(e,t){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=We(i),new qe(t,i)}function ni(e,t){throw ii(e,t)}function ri(e,t){e.onWarning&&e.onWarning.call(null,ii(e,t))}var si={YAML:function(e,t,i){var n,r,s;null!==e.version&&ni(e,"duplication of %YAML directive"),1!==i.length&&ni(e,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))&&ni(e,"ill-formed argument of the YAML directive"),r=parseInt(n[1],10),s=parseInt(n[2],10),1!==r&&ni(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&ri(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,r;2!==i.length&&ni(e,"TAG directive accepts exactly two arguments"),n=i[0],r=i[1],jt.test(n)||ni(e,"ill-formed tag handle (first argument) of the TAG directive"),Tt.call(e.tagMap,n)&&ni(e,'there is a previously declared suffix for "'+n+'" tag handle'),Bt.test(r)||ni(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){ni(e,"tag prefix is malformed: "+r)}e.tagMap[n]=r}};function ai(e,t,i,n){var r,s,a,o;if(t<i){if(o=e.input.slice(t,i),n)for(r=0,s=o.length;r<s;r+=1)9===(a=o.charCodeAt(r))||32<=a&&a<=1114111||ni(e,"expected valid JSON character");else $t.test(o)&&ni(e,"the stream contains non-printable characters");e.result+=o}}function oi(e,t,i,n){var r,s,a,o;for(Be.isObject(i)||ni(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,o=(r=Object.keys(i)).length;a<o;a+=1)s=r[a],Tt.call(t,s)||(t[s]=i[s],n[s]=!0)}function ci(e,t,i,n,r,s,a,o,c){var l,h;if(Array.isArray(r))for(l=0,h=(r=Array.prototype.slice.call(r)).length;l<h;l+=1)Array.isArray(r[l])&&ni(e,"nested arrays are not supported inside keys"),"object"==typeof r&&"[object Object]"===Ut(r[l])&&(r[l]="[object Object]");if("object"==typeof r&&"[object Object]"===Ut(r)&&(r="[object Object]"),r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(s))for(l=0,h=s.length;l<h;l+=1)oi(e,t,s[l],i);else oi(e,t,s,i);else e.json||Tt.call(i,r)||!Tt.call(t,r)||(e.line=a||e.line,e.lineStart=o||e.lineStart,e.position=c||e.position,ni(e,"duplicated mapping key")),"__proto__"===r?Object.defineProperty(t,r,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[r]=s,delete i[r];return t}function li(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):ni(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function hi(e,t,i){for(var n=0,r=e.input.charCodeAt(e.position);0!==r;){for(;qt(r);)9===r&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&35===r)do{r=e.input.charCodeAt(++e.position)}while(10!==r&&13!==r&&0!==r);if(!Ht(r))break;for(li(e),r=e.input.charCodeAt(e.position),n++,e.lineIndent=0;32===r;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return-1!==i&&0!==n&&e.lineIndent<i&&ri(e,"deficient indentation"),n}function ui(e){var t,i=e.position;return!(45!==(t=e.input.charCodeAt(i))&&46!==t||t!==e.input.charCodeAt(i+1)||t!==e.input.charCodeAt(i+2)||(i+=3,0!==(t=e.input.charCodeAt(i))&&!zt(t)))}function pi(e,t){1===t?e.result+=" ":t>1&&(e.result+=Be.repeat("\n",t-1))}function di(e,t){var i,n,r=e.tag,s=e.anchor,a=[],o=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),n=e.input.charCodeAt(e.position);0!==n&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,ni(e,"tab characters must not be used in indentation")),45===n)&&zt(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,hi(e,!0,-1)&&e.lineIndent<=t)a.push(null),n=e.input.charCodeAt(e.position);else if(i=e.line,mi(e,t,Lt,!1,!0),a.push(e.result),hi(e,!0,-1),n=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&0!==n)ni(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!o&&(e.tag=r,e.anchor=s,e.kind="sequence",e.result=a,!0)}function fi(e){var t,i,n,r,s=!1,a=!1;if(33!==(r=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&ni(e,"duplication of a tag property"),60===(r=e.input.charCodeAt(++e.position))?(s=!0,r=e.input.charCodeAt(++e.position)):33===r?(a=!0,i="!!",r=e.input.charCodeAt(++e.position)):i="!",t=e.position,s){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&62!==r);e.position<e.length?(n=e.input.slice(t,e.position),r=e.input.charCodeAt(++e.position)):ni(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==r&&!zt(r);)33===r&&(a?ni(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),jt.test(i)||ni(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),r=e.input.charCodeAt(++e.position);n=e.input.slice(t,e.position),Ft.test(n)&&ni(e,"tag suffix cannot contain flow indicator characters")}n&&!Bt.test(n)&&ni(e,"tag name cannot contain such characters: "+n);try{n=decodeURIComponent(n)}catch(t){ni(e,"tag name is malformed: "+n)}return s?e.tag=n:Tt.call(e.tagMap,i)?e.tag=e.tagMap[i]+n:"!"===i?e.tag="!"+n:"!!"===i?e.tag="tag:yaml.org,2002:"+n:ni(e,'undeclared tag handle "'+i+'"'),!0}function gi(e){var t,i;if(38!==(i=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&ni(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!zt(i)&&!Gt(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&ni(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function mi(e,t,i,n,r){var s,a,o,c,l,h,u,p,d,f=1,g=!1,m=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=o=Ot===i||Lt===i,n&&hi(e,!0,-1)&&(g=!0,e.lineIndent>t?f=1:e.lineIndent===t?f=0:e.lineIndent<t&&(f=-1)),1===f)for(;fi(e)||gi(e);)hi(e,!0,-1)?(g=!0,o=s,e.lineIndent>t?f=1:e.lineIndent===t?f=0:e.lineIndent<t&&(f=-1)):o=!1;if(o&&(o=g||r),1!==f&&Ot!==i||(p=Pt===i||Nt===i?t:t+1,d=e.position-e.lineStart,1===f?o&&(di(e,d)||function(e,t,i){var n,r,s,a,o,c,l,h=e.tag,u=e.anchor,p={},d=Object.create(null),f=null,g=null,m=null,y=!1,v=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=p),l=e.input.charCodeAt(e.position);0!==l;){if(y||-1===e.firstTabInLine||(e.position=e.firstTabInLine,ni(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),s=e.line,63!==l&&58!==l||!zt(n)){if(a=e.line,o=e.lineStart,c=e.position,!mi(e,i,Nt,!1,!0))break;if(e.line===s){for(l=e.input.charCodeAt(e.position);qt(l);)l=e.input.charCodeAt(++e.position);if(58===l)zt(l=e.input.charCodeAt(++e.position))||ni(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(ci(e,p,d,f,g,null,a,o,c),f=g=m=null),v=!0,y=!1,r=!1,f=e.tag,g=e.result;else{if(!v)return e.tag=h,e.anchor=u,!0;ni(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!v)return e.tag=h,e.anchor=u,!0;ni(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(y&&(ci(e,p,d,f,g,null,a,o,c),f=g=m=null),v=!0,y=!0,r=!0):y?(y=!1,r=!0):ni(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,l=n;if((e.line===s||e.lineIndent>t)&&(y&&(a=e.line,o=e.lineStart,c=e.position),mi(e,t,Ot,!0,r)&&(y?g=e.result:m=e.result),y||(ci(e,p,d,f,g,m,a,o,c),f=g=m=null),hi(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==l)ni(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&ci(e,p,d,f,g,null,a,o,c),v&&(e.tag=h,e.anchor=u,e.kind="mapping",e.result=p),v}(e,d,p))||function(e,t){var i,n,r,s,a,o,c,l,h,u,p,d,f=!0,g=e.tag,m=e.anchor,y=Object.create(null);if(91===(d=e.input.charCodeAt(e.position)))a=93,l=!1,s=[];else{if(123!==d)return!1;a=125,l=!0,s={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=s),d=e.input.charCodeAt(++e.position);0!==d;){if(hi(e,!0,t),(d=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=g,e.anchor=m,e.kind=l?"mapping":"sequence",e.result=s,!0;f?44===d&&ni(e,"expected the node content, but found ','"):ni(e,"missed comma between flow collection entries"),p=null,o=c=!1,63===d&&zt(e.input.charCodeAt(e.position+1))&&(o=c=!0,e.position++,hi(e,!0,t)),i=e.line,n=e.lineStart,r=e.position,mi(e,t,Pt,!1,!0),u=e.tag,h=e.result,hi(e,!0,t),d=e.input.charCodeAt(e.position),!c&&e.line!==i||58!==d||(o=!0,d=e.input.charCodeAt(++e.position),hi(e,!0,t),mi(e,t,Pt,!1,!0),p=e.result),l?ci(e,s,y,u,h,p,i,n,r):o?s.push(ci(e,null,y,u,h,p,i,n,r)):s.push(h),hi(e,!0,t),44===(d=e.input.charCodeAt(e.position))?(f=!0,d=e.input.charCodeAt(++e.position)):f=!1}ni(e,"unexpected end of the stream within a flow collection")}(e,p)?m=!0:(a&&function(e,t){var i,n,r,s,a=Mt,o=!1,c=!1,l=t,h=0,u=!1;if(124===(s=e.input.charCodeAt(e.position)))n=!1;else{if(62!==s)return!1;n=!0}for(e.kind="scalar",e.result="";0!==s;)if(43===(s=e.input.charCodeAt(++e.position))||45===s)Mt===a?a=43===s?Rt:Dt:ni(e,"repeat of a chomping mode identifier");else{if(!((r=Jt(s))>=0))break;0===r?ni(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?ni(e,"repeat of an indentation width identifier"):(l=t+r-1,c=!0)}if(qt(s)){do{s=e.input.charCodeAt(++e.position)}while(qt(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!Ht(s)&&0!==s)}for(;0!==s;){for(li(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!c||e.lineIndent<l)&&32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>l&&(l=e.lineIndent),Ht(s))h++;else{if(e.lineIndent<l){a===Rt?e.result+=Be.repeat("\n",o?1+h:h):a===Mt&&o&&(e.result+="\n");break}for(n?qt(s)?(u=!0,e.result+=Be.repeat("\n",o?1+h:h)):u?(u=!1,e.result+=Be.repeat("\n",h+1)):0===h?o&&(e.result+=" "):e.result+=Be.repeat("\n",h):e.result+=Be.repeat("\n",o?1+h:h),o=!0,c=!0,h=0,i=e.position;!Ht(s)&&0!==s;)s=e.input.charCodeAt(++e.position);ai(e,i,e.position,!1)}}return!0}(e,p)||function(e,t){var i,n,r;if(39!==(i=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(i=e.input.charCodeAt(e.position));)if(39===i){if(ai(e,n,e.position,!0),39!==(i=e.input.charCodeAt(++e.position)))return!0;n=e.position,e.position++,r=e.position}else Ht(i)?(ai(e,n,r,!0),pi(e,hi(e,!1,t)),n=r=e.position):e.position===e.lineStart&&ui(e)?ni(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);ni(e,"unexpected end of the stream within a single quoted scalar")}(e,p)||function(e,t){var i,n,r,s,a,o;if(34!==(o=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,i=n=e.position;0!==(o=e.input.charCodeAt(e.position));){if(34===o)return ai(e,i,e.position,!0),e.position++,!0;if(92===o){if(ai(e,i,e.position,!0),Ht(o=e.input.charCodeAt(++e.position)))hi(e,!1,t);else if(o<256&&Kt[o])e.result+=Qt[o],e.position++;else if((a=Yt(o))>0){for(r=a,s=0;r>0;r--)(a=Wt(o=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+a:ni(e,"expected hexadecimal character");e.result+=Xt(s),e.position++}else ni(e,"unknown escape sequence");i=n=e.position}else Ht(o)?(ai(e,i,n,!0),pi(e,hi(e,!1,t)),i=n=e.position):e.position===e.lineStart&&ui(e)?ni(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}ni(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?m=!0:!function(e){var t,i,n;if(42!==(n=e.input.charCodeAt(e.position)))return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!zt(n)&&!Gt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&ni(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),Tt.call(e.anchorMap,i)||ni(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],hi(e,!0,-1),!0}(e)?function(e,t,i){var n,r,s,a,o,c,l,h,u=e.kind,p=e.result;if(zt(h=e.input.charCodeAt(e.position))||Gt(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(zt(n=e.input.charCodeAt(e.position+1))||i&&Gt(n)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,a=!1;0!==h;){if(58===h){if(zt(n=e.input.charCodeAt(e.position+1))||i&&Gt(n))break}else if(35===h){if(zt(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&ui(e)||i&&Gt(h))break;if(Ht(h)){if(o=e.line,c=e.lineStart,l=e.lineIndent,hi(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}e.position=s,e.line=o,e.lineStart=c,e.lineIndent=l;break}}a&&(ai(e,r,s,!1),pi(e,e.line-o),r=s=e.position,a=!1),qt(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return ai(e,r,s,!1),!!e.result||(e.kind=u,e.result=p,!1)}(e,p,Pt===i)&&(m=!0,null===e.tag&&(e.tag="?")):(m=!0,null===e.tag&&null===e.anchor||ni(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(m=o&&di(e,d))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&ni(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c<l;c+=1)if((u=e.implicitTypes[c]).resolve(e.result)){e.result=u.construct(e.result),e.tag=u.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(Tt.call(e.typeMap[e.kind||"fallback"],e.tag))u=e.typeMap[e.kind||"fallback"][e.tag];else for(u=null,c=0,l=(h=e.typeMap.multi[e.kind||"fallback"]).length;c<l;c+=1)if(e.tag.slice(0,h[c].tag.length)===h[c].tag){u=h[c];break}u||ni(e,"unknown tag !<"+e.tag+">"),null!==e.result&&u.kind!==e.kind&&ni(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+u.kind+'", not "'+e.kind+'"'),u.resolve(e.result,e.tag)?(e.result=u.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):ni(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}function yi(e){var t,i,n,r,s=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(hi(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!zt(r);)r=e.input.charCodeAt(++e.position);for(n=[],(i=e.input.slice(t,e.position)).length<1&&ni(e,"directive name must not be less than one character in length");0!==r;){for(;qt(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!Ht(r));break}if(Ht(r))break;for(t=e.position;0!==r&&!zt(r);)r=e.input.charCodeAt(++e.position);n.push(e.input.slice(t,e.position))}0!==r&&li(e),Tt.call(si,i)?si[i](e,i,n):ri(e,'unknown document directive "'+i+'"')}hi(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,hi(e,!0,-1)):a&&ni(e,"directives end mark is expected"),mi(e,e.lineIndent-1,Ot,!1,!0),hi(e,!0,-1),e.checkLineBreaks&&Vt.test(e.input.slice(s,e.position))&&ri(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ui(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,hi(e,!0,-1)):e.position<e.length-1&&ni(e,"end of the stream or a document separator is expected")}function vi(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var i=new ti(e,t),n=e.indexOf("\0");for(-1!==n&&(i.position=n,ni(i,"null byte is not allowed in input")),i.input+="\0";32===i.input.charCodeAt(i.position);)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)yi(i);return i.documents}var bi={loadAll:function(e,t,i){null!==t&&"object"==typeof t&&void 0===i&&(i=t,t=null);var n=vi(e,i);if("function"!=typeof t)return n;for(var r=0,s=n.length;r<s;r+=1)t(n[r])},load:function(e,t){var i=vi(e,t);if(0!==i.length){if(1===i.length)return i[0];throw new qe("expected a single document in the stream, but found more")}}},xi=Object.prototype.toString,wi=Object.prototype.hasOwnProperty,_i=65279,Si=9,ki=10,Ei=13,Ai=32,Ci=33,Ii=34,Ti=35,Pi=37,Ni=38,Li=39,Oi=42,Mi=44,Di=45,Ri=58,$i=61,Vi=62,Fi=63,ji=64,Bi=91,Ui=93,Hi=96,qi=123,zi=124,Gi=125,Wi={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},Yi=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Ji=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Zi(e){var t,i,n;if(t=e.toString(16).toUpperCase(),e<=255)i="x",n=2;else if(e<=65535)i="u",n=4;else{if(!(e<=4294967295))throw new qe("code point within a string may not be greater than 0xFFFFFFFF");i="U",n=8}return"\\"+i+Be.repeat("0",n-t.length)+t}var Xi=1,Ki=2;function Qi(e){this.schema=e.schema||It,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Be.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var i,n,r,s,a,o,c;if(null===t)return{};for(i={},r=0,s=(n=Object.keys(t)).length;r<s;r+=1)a=n[r],o=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(c=e.compiledTypeMap.fallback[a])&&wi.call(c.styleAliases,o)&&(o=c.styleAliases[o]),i[a]=o;return i}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?Ki:Xi,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function en(e,t){for(var i,n=Be.repeat(" ",t),r=0,s=-1,a="",o=e.length;r<o;)-1===(s=e.indexOf("\n",r))?(i=e.slice(r),r=o):(i=e.slice(r,s+1),r=s+1),i.length&&"\n"!==i&&(a+=n),a+=i;return a}function tn(e,t){return"\n"+Be.repeat(" ",e.indent*t)}function nn(e){return e===Ai||e===Si}function rn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==_i||65536<=e&&e<=1114111}function sn(e){return rn(e)&&e!==_i&&e!==Ei&&e!==ki}function an(e,t,i){var n=sn(e),r=n&&!nn(e);return(i?n:n&&e!==Mi&&e!==Bi&&e!==Ui&&e!==qi&&e!==Gi)&&e!==Ti&&!(t===Ri&&!r)||sn(t)&&!nn(t)&&e===Ti||t===Ri&&r}function on(e,t){var i,n=e.charCodeAt(t);return n>=55296&&n<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1))>=56320&&i<=57343?1024*(n-55296)+i-56320+65536:n}function cn(e){return/^\n* /.test(e)}var ln=1,hn=2,un=3,pn=4,dn=5;function fn(e,t,i,n,r,s,a,o){var c,l=0,h=null,u=!1,p=!1,d=-1!==n,f=-1,g=function(e){return rn(e)&&e!==_i&&!nn(e)&&e!==Di&&e!==Fi&&e!==Ri&&e!==Mi&&e!==Bi&&e!==Ui&&e!==qi&&e!==Gi&&e!==Ti&&e!==Ni&&e!==Oi&&e!==Ci&&e!==zi&&e!==$i&&e!==Vi&&e!==Li&&e!==Ii&&e!==Pi&&e!==ji&&e!==Hi}(on(e,0))&&function(e){return!nn(e)&&e!==Ri}(on(e,e.length-1));if(t||a)for(c=0;c<e.length;l>=65536?c+=2:c++){if(!rn(l=on(e,c)))return dn;g=g&&an(l,h,o),h=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if((l=on(e,c))===ki)u=!0,d&&(p=p||c-f-1>n&&" "!==e[f+1],f=c);else if(!rn(l))return dn;g=g&&an(l,h,o),h=l}p=p||d&&c-f-1>n&&" "!==e[f+1]}return u||p?i>9&&cn(e)?dn:a?s===Ki?dn:hn:p?pn:un:!g||a||r(e)?s===Ki?dn:hn:ln}function gn(e,t,i,n,r){e.dump=function(){if(0===t.length)return e.quotingType===Ki?'""':"''";if(!e.noCompatMode&&(-1!==Yi.indexOf(t)||Ji.test(t)))return e.quotingType===Ki?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,i),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),o=n||e.flowLevel>-1&&i>=e.flowLevel;switch(fn(t,o,e.indent,a,(function(t){return function(e,t){var i,n;for(i=0,n=e.implicitTypes.length;i<n;i+=1)if(e.implicitTypes[i].resolve(t))return!0;return!1}(e,t)}),e.quotingType,e.forceQuotes&&!n,r)){case ln:return t;case hn:return"'"+t.replace(/'/g,"''")+"'";case un:return"|"+mn(t,e.indent)+yn(en(t,s));case pn:return">"+mn(t,e.indent)+yn(en(function(e,t){var i,n,r=/(\n+)([^\n]*)/g,s=(o=e.indexOf("\n"),o=-1!==o?o:e.length,r.lastIndex=o,vn(e.slice(0,o),t)),a="\n"===e[0]||" "===e[0];var o;for(;n=r.exec(e);){var c=n[1],l=n[2];i=" "===l[0],s+=c+(a||i||""===l?"":"\n")+vn(l,t),a=i}return s}(t,a),s));case dn:return'"'+function(e){for(var t,i="",n=0,r=0;r<e.length;n>=65536?r+=2:r++)n=on(e,r),!(t=Wi[n])&&rn(n)?(i+=e[r],n>=65536&&(i+=e[r+1])):i+=t||Zi(n);return i}(t)+'"';default:throw new qe("impossible error: invalid scalar style")}}()}function mn(e,t){var i=cn(e)?String(t):"",n="\n"===e[e.length-1];return i+(n&&("\n"===e[e.length-2]||"\n"===e)?"+":n?"":"-")+"\n"}function yn(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function vn(e,t){if(""===e||" "===e[0])return e;for(var i,n,r=/ [^ ]/g,s=0,a=0,o=0,c="";i=r.exec(e);)(o=i.index)-s>t&&(n=a>s?a:o,c+="\n"+e.slice(s,n),s=n+1),a=o;return c+="\n",e.length-s>t&&a>s?c+=e.slice(s,a)+"\n"+e.slice(a+1):c+=e.slice(s),c.slice(1)}function bn(e,t,i,n){var r,s,a,o="",c=e.tag;for(r=0,s=i.length;r<s;r+=1)a=i[r],e.replacer&&(a=e.replacer.call(i,String(r),a)),(wn(e,t+1,a,!0,!0,!1,!0)||void 0===a&&wn(e,t+1,null,!0,!0,!1,!0))&&(n&&""===o||(o+=tn(e,t)),e.dump&&ki===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=c,e.dump=o||"[]"}function xn(e,t,i){var n,r,s,a,o,c;for(s=0,a=(r=i?e.explicitTypes:e.implicitTypes).length;s<a;s+=1)if(((o=r[s]).instanceOf||o.predicate)&&(!o.instanceOf||"object"==typeof t&&t instanceof o.instanceOf)&&(!o.predicate||o.predicate(t))){if(i?o.multi&&o.representName?e.tag=o.representName(t):e.tag=o.tag:e.tag="?",o.represent){if(c=e.styleMap[o.tag]||o.defaultStyle,"[object Function]"===xi.call(o.represent))n=o.represent(t,c);else{if(!wi.call(o.represent,c))throw new qe("!<"+o.tag+'> tag resolver accepts not "'+c+'" style');n=o.represent[c](t,c)}e.dump=n}return!0}return!1}function wn(e,t,i,n,r,s,a){e.tag=null,e.dump=i,xn(e,i,!1)||xn(e,i,!0);var o,c=xi.call(e.dump),l=n;n&&(n=e.flowLevel<0||e.flowLevel>t);var h,u,p="[object Object]"===c||"[object Array]"===c;if(p&&(u=-1!==(h=e.duplicates.indexOf(i))),(null!==e.tag&&"?"!==e.tag||u||2!==e.indent&&t>0)&&(r=!1),u&&e.usedDuplicates[h])e.dump="*ref_"+h;else{if(p&&u&&!e.usedDuplicates[h]&&(e.usedDuplicates[h]=!0),"[object Object]"===c)n&&0!==Object.keys(e.dump).length?(!function(e,t,i,n){var r,s,a,o,c,l,h="",u=e.tag,p=Object.keys(i);if(!0===e.sortKeys)p.sort();else if("function"==typeof e.sortKeys)p.sort(e.sortKeys);else if(e.sortKeys)throw new qe("sortKeys must be a boolean or a function");for(r=0,s=p.length;r<s;r+=1)l="",n&&""===h||(l+=tn(e,t)),o=i[a=p[r]],e.replacer&&(o=e.replacer.call(i,a,o)),wn(e,t+1,a,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&ki===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=tn(e,t)),wn(e,t+1,o,!0,c)&&(e.dump&&ki===e.dump.charCodeAt(0)?l+=":":l+=": ",h+=l+=e.dump));e.tag=u,e.dump=h||"{}"}(e,t,e.dump,r),u&&(e.dump="&ref_"+h+e.dump)):(!function(e,t,i){var n,r,s,a,o,c="",l=e.tag,h=Object.keys(i);for(n=0,r=h.length;n<r;n+=1)o="",""!==c&&(o+=", "),e.condenseFlow&&(o+='"'),a=i[s=h[n]],e.replacer&&(a=e.replacer.call(i,s,a)),wn(e,t,s,!1,!1)&&(e.dump.length>1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),wn(e,t,a,!1,!1)&&(c+=o+=e.dump));e.tag=l,e.dump="{"+c+"}"}(e,t,e.dump),u&&(e.dump="&ref_"+h+" "+e.dump));else if("[object Array]"===c)n&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?bn(e,t-1,e.dump,r):bn(e,t,e.dump,r),u&&(e.dump="&ref_"+h+e.dump)):(!function(e,t,i){var n,r,s,a="",o=e.tag;for(n=0,r=i.length;n<r;n+=1)s=i[n],e.replacer&&(s=e.replacer.call(i,String(n),s)),(wn(e,t,s,!1,!1)||void 0===s&&wn(e,t,null,!1,!1))&&(""!==a&&(a+=","+(e.condenseFlow?"":" ")),a+=e.dump);e.tag=o,e.dump="["+a+"]"}(e,t,e.dump),u&&(e.dump="&ref_"+h+" "+e.dump));else{if("[object String]"!==c){if("[object Undefined]"===c)return!1;if(e.skipInvalid)return!1;throw new qe("unacceptable kind of an object to dump "+c)}"?"!==e.tag&&gn(e,e.dump,t,s,l)}null!==e.tag&&"?"!==e.tag&&(o=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),o="!"===e.tag[0]?"!"+o:"tag:yaml.org,2002:"===o.slice(0,18)?"!!"+o.slice(18):"!<"+o+">",e.dump=o+" "+e.dump)}return!0}function _n(e,t){var i,n,r=[],s=[];for(Sn(e,r,s),i=0,n=s.length;i<n;i+=1)t.duplicates.push(r[s[i]]);t.usedDuplicates=new Array(n)}function Sn(e,t,i){var n,r,s;if(null!==e&&"object"==typeof e)if(-1!==(r=t.indexOf(e)))-1===i.indexOf(r)&&i.push(r);else if(t.push(e),Array.isArray(e))for(r=0,s=e.length;r<s;r+=1)Sn(e[r],t,i);else for(r=0,s=(n=Object.keys(e)).length;r<s;r+=1)Sn(e[n[r]],t,i)}function kn(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}const En={Type:Ze,Schema:Qe,FAILSAFE_SCHEMA:nt,JSON_SCHEMA:dt,CORE_SCHEMA:ft,DEFAULT_SCHEMA:It,load:bi.load,loadAll:bi.loadAll,dump:{dump:function(e,t){var i=new Qi(t=t||{});i.noRefs||_n(e,i);var n=e;return i.replacer&&(n=i.replacer.call({"":n},"",n)),wn(i,0,n,!0,!0)?i.dump+"\n":""}}.dump,YAMLException:qe,types:{binary:xt,float:pt,map:it,null:rt,pairs:Et,set:Ct,timestamp:yt,bool:st,int:lt,merge:vt,omap:St,seq:tt,str:et},safeLoad:kn("safeLoad","load"),safeLoadAll:kn("safeLoadAll","loadAll"),safeDump:kn("safeDump","dump")};class An{static hasClass(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}static removeClass(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}static hassClass(e,t){return e.classList.contains(t)}static addClass(e,t){e.classList.add(t)}static setClass(e,t){e.setAttribute("class",t)}static toggleClass(e,t){this.hasClass(e,t)?this.removeClass(e,t):this.addClass(e,t)}static datasetSet(e,t,i){e.dataset[t]=i}static getStyles(e){const t={};let i;for(let n=0;n<e.style.length;n++)i=e.style.item(n),t[i]=e.style.getPropertyValue(i);return t}static setStyle(e,t){const i=(t??[]).split(";").map((e=>e.trim())).filter((e=>e.length));for(let t=0;t<i.length;t++){const n=i[t].split(":").map((e=>e.trim())),r=n[1].includes("!important");n[1]=n[1].replace(/!important/g,"").trim(),e.style.setProperty(n[0],n[1],r?"important":"")}}static setText(e,t,i){e instanceof SVGTextElement||(e=e.querySelector("text")||e),"string"!=typeof t&&"boolean"!=typeof t&&Number.isFinite(Number(t))&&(t=Number(t).toString());const n=t.replace(/\\n/g,"\n").split("\n"),r=n.length>1,s=e.querySelector("tspan");if(r){const t=s?.getAttribute("x"),r=s?.getAttribute("y");t&&!e.getAttribute("x")&&e.setAttribute("x",t),r&&!e.getAttribute("y")&&e.setAttribute("y",r);const a=e.querySelector("tspan")||!1;e.textContent="",e.dataset.ha_floorplan_notice="The text_set function split your text into multiple tspans. Only the style of the first tspan is preserved. The style from the original tspan is reused on every tspan. The x and y are calculated on the basis of the first tspan or text-element.";const o=e.getAttribute("x")||"0",c=i||"1em";n.forEach(((t,i)=>{const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(n.textContent=t,n.setAttribute("x",o),n.setAttribute("dy",i>=1?c:"0"),a){const e=a.getAttribute("style");e&&n.setAttribute("style",e)}e.appendChild(n)}))}else{(s||e).textContent=t}}static waitForChildNodes(e,t,i){return new Promise(((n,r)=>{const s=setTimeout((()=>r("Timeout waiting for child element(s) to load")),i);new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&t.addedNodes.length)return clearTimeout(s),n()})).observe(e,{childList:!0,subtree:!0}),t()}))}static formatDate(e){return e?"string"==typeof e?new Date(e).toLocaleString():e.toLocaleString():""}static parseYaml(e){return En.load(e)}static async fetchText(e,t,i,n){i&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:An.cacheBuster(e);const r=new Request(e,{cache:n?"default":"no-store",mode:t?"no-cors":void 0});try{const e=await fetch(r);if(e.ok||t&&"opaque"===e.type){return await e.text()}throw new Error("Error fetching resource")}catch(t){throw new URIError(`${e}: ${t.message}`)}}static async fetchImage(e,t,i,n){t&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${i}/`)),e=n?e:An.cacheBuster(e);const r=new Request(e,{cache:n?"default":"no-store",headers:new Headers({"Content-Type":"text/plain; charset=x-user-defined"}),mode:t?"no-cors":void 0});try{const e=await fetch(r);if(e.ok||t&&"opaque"===e.type){const t=await e.arrayBuffer();return`data:image/jpeg;base64,${An.arrayBufferToBase64(t)}`}throw new Error("Error fetching resource")}catch(t){throw new URIError(`${e}: ${t.message}`)}}static singleToArray(e){return null==e?[]:Array.isArray(e)?e:[e]}static getArray(e){if(null==e)return[];if(Array.isArray(e))return e;{const t=e;return Object.values(t)}}static getSet(e){if(Array.isArray(e))return new Set(e);{const t=e;return new Set(Object.values(t))}}static arrayBufferToBase64(e){let t="";[].slice.call(new Uint8Array(e)).forEach((e=>t+=String.fromCharCode(e)));let i=window.btoa(t);for(;i.length%4>0;)i+="=";return i}static cacheBuster(e){return`${e}${e.includes("?")?"&":"?"}_=${(new Date).getTime()}`}static equal(e,t){if(e===t)return!0;const i=Array.isArray(e),n=Array.isArray(t);let r=0;if(i&&n){if(e.length!=t.length)return!1;for(r=0;r<e.length;r++)if(!An.equal(e[r],t[r]))return!1;return!0}if(i!=n)return!1;if(e&&t&&"object"==typeof e&&"object"==typeof t){const i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;const n=e instanceof Date,s=t instanceof Date;if(n&&s)return e.getTime()==t.getTime();if(n!=s)return!1;const a=e instanceof RegExp,o=t instanceof RegExp;if(a&&o)return e.toString()==t.toString();if(a!=o)return!1;for(r=0;r<i.length;r++)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=0;r<i.length;r++)if(!An.equal(e[i[r]],t[i[r]]))return!1;return!0}return!1}static get isMobile(){return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))}static deviceId(){const e="ha-floorplan-device-id";if(!localStorage[e]){const t=()=>Math.floor(1e5*(1+Math.random())).toString(16).substring(1);localStorage[e]=`${t()}${t()}_${t()}${t()}`}return localStorage[e]}}class Cn{constructor(e,t,i){this.element=e,this.logLevel=t,this.consoleLogLevel=i,this.logLevelGroups={error:["error"],warn:["error","warning","warn"],warning:["error","warning","warn"],info:["error","warning","warn","info"],debug:["error","warning","warn","info","debug"]}}log(e,t,i=!1){const n=`${An.formatDate(new Date)} ${e.toUpperCase()} ${t}`,r=this.logLevel&&this.logLevelGroups[this.logLevel.toLowerCase()],s=r?.length&&r.includes(e.toLowerCase());if((i||s)&&this.element){const t=document.createElement("li");An.addClass(t,e),t.textContent=n,this.element.querySelector("ul")?.prepend(t),this.element.style.display="block"}this.consoleLog(e,t,i)}consoleLog(e,t,i=!1){const n=`${An.formatDate(new Date)} ${e.toUpperCase()} ${t}`,r=this.consoleLogLevel&&this.logLevelGroups[this.consoleLogLevel.toLowerCase()],s=r?.length&&r.includes(e.toLowerCase());if(i||s)switch(e){case"error":console.error(n);break;case"warn":case"warning":console.warn(n);break;case"info":console.info(n);break;default:console.log(n)}}}var In=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};const Tn=Ee;console.info("%cFloorplan for Home Assistant (ha-floorplan)%c\nVersion 1.1.3","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: rgb(71, 170, 238)");let Pn=class extends se{constructor(){super(),this.pageInfos={},this.pageLayers={},this.pageLayerIds=new Set,this.entityInfos={},this.elementInfos={},this.cssRules=[],this.functions={},this.variables={},this.svgElements={},this.isRulesLoaded=!1,this._cards=new Map,window.onerror=this.handleWindowError.bind(this)}render(){return j`
<div id="floorplan-container">
<div id="floorplan"></div>
<div id="log" style="display: ${this.isShowLog?"block":"none"};">
<a href="#" onclick="return false;" @click=${this.clearLog}>Clear log<a/>
<ul></ul>
</div>
</div>
`}static get styles(){return l`
:host #floorplan-container {
display: flex;
flex-flow: column;
flex: 1;
min-height: 0;
}
:host #floorplan {
display: flex;
flex-flow: column;
flex: 1;
min-height: 0;
}
:host #log {
max-height: 150px;
overflow: auto;
background-color: #eee;
padding: 10px;
}
:host #log ul {
list-style-type: none;
padding-left: 0px;
text-align: left;
}
:host svg,
:host svg * {
/* vector-effect: non-scaling-stroke !important; */
pointer-events: all !important;
}
ha-circular-progress {
margin: auto;
}
#log {
min-height: 100px;
max-height: 100px;
overflow: auto;
background-color: #eee;
display: none;
padding: 10px;
}
#log ul {
list-style-type: none;
padding-left: 0px;
text-align: left;
}
.error {
color: #ff0000;
}
.warning {
color: #ff851b;
}
.info {
color: #0000ff;
}
.debug {
color: #000000;
}
`}clearLog(){this.logElement.querySelector("#log ul").innerHTML=""}async updated(e){super.updated(e),e.has("_config")&&(await this._configChanged(),await this.hassChanged()),e.has("hass")&&await this.hassChanged()}async _configChanged(){this._config&&await this.init()}async hassChanged(){if(!this.hass||!this.config||!this.svg)return;const e=An.deviceId();this.hass.states[`sensor.ha_floorplan_${e}`]={entity_id:`sensor.ha_floorplan_${e}`,state:"on",last_changed:(new Date).toString(),last_updated:(new Date).toString(),attributes:{device_class:"ha-floorplan",friendly_name:"ha-floorplan - Floorplan for Home Assistant",icon:"mdi:floor-plan",assumed_state:!1,hidden:!0},context:{}},this.isRulesLoaded?this.handleEntities():(this.initFloorplanRules(this.svg,this.config),this.isRulesLoaded=!0,await this.handleEntities(!0));for(const{card:e}of this._cards.values())e&&(e.hass=this.hass)}get floorplanElement(){return this.shadowRoot?.getElementById("floorplan")}get logElement(){return this.shadowRoot?.getElementById("log")}async init(){try{const e=await this.loadConfig(this._config,!1);if(this.isShowLog=void 0!==e.log_level,this.logger=new Cn(this.logElement,e.log_level,e.console_log_level),this.logInfo("INIT","Floorplan for Home Assistant (ha-floorplan) v1.1.3"),!this.validateConfig(e))return;this.config=e,this.config.pages?await this.initMultiPage():await this.initSinglePage(),this.initEventListeners()}catch(e){this.handleError(e)}}async initMultiPage(){try{await this.loadPages(),this.initPageDisplay(),this.initVariables(),this.initStartupActions()}catch(e){this.handleError(e)}}async initSinglePage(){try{await this.loadStyleSheet(this.config.stylesheet);const e=this.getBestImage(this.config);this.svg=await this.loadFloorplanSvg(e),this.initPageDisplay(),this.initVariables(),this.initStartupActions()}catch(e){this.handleError(e)}}async loadConfig(e,t){if("string"==typeof e){let i;try{i=await An.fetchText(e,this.isDemo,this.examplespath,t)}catch(t){throw this.logError("CONFIG",`Error loading config: ${e}`),t}return En.load(i)}return JSON.parse(JSON.stringify(e))}loadScript(e,t){return e?new Promise(((i,n)=>{const r=document.createElement("script");r.src=t?e:An.cacheBuster(e),r.onload=()=>i(),r.onerror=e=>{n(new URIError(`${e.target.src}`))},this.shadowRoot?.appendChild(r)})):Promise.resolve()}async loadPages(){for(const e of this.config.pages)await this.loadPageConfig(e,this.config.pages.indexOf(e));const e=Object.keys(this.pageInfos).map((e=>this.pageInfos[e]));e.sort(((e,t)=>e.index-t.index));const t=e.find((e=>void 0!==e.config.master_page));if(!t)throw new Error("A master page is required");t.isMaster=!0;const i=e.find((e=>void 0===e.config.master_page));i&&(i.isDefault=!0),await this.loadPageFloorplanSvg(t,t);const n=e.filter((e=>e!==t));for(const e of n)await this.loadPageFloorplanSvg(e,t);this.svg=t.svg}async loadPageConfig(e,t){const i=await this.loadConfig(e,!1),n=this.createPageInfo(i);return n.index=t,n}async loadPageFloorplanSvg(e,t){const i=this.getBestImage(e.config),n=await this.loadFloorplanSvg(i,e,t);n.id=e.config.page_id,e.svg=n,await this.loadStyleSheet(e.config.stylesheet),this.initFloorplanRules(e.svg,e.config)}getBestImage(e){let t="",i=!0;if(void 0===e?.image)throw"No image provided in configuration.";if("string"==typeof e.image)t=An.isMobile&&"string"==typeof e.image_mobile?e.image_mobile:e.image;else if(e.image?.sizes){const n=!0===e?.image?.use_screen_width?screen.width:window.innerWidth;e.image.sizes.sort(((e,t)=>t.min_width-e.min_width));for(const r of e.image.sizes)if(n>=r.min_width){t=r.location,i=!0===r.cache;break}}else An.isMobile&&e.image_mobile?(t=e.image_mobile.location,i=!0===e.image_mobile.cache):(t=e.image.location,i=!0===e.image.cache);return{location:t,cache:i}}createPageInfo(e){const t={config:e};return t.config.rules&&this.config.rules&&(t.config.rules=t.config.rules.concat(this.config.rules)),this.pageInfos[t.config.page_id]=t,t}async loadStyleSheet(e){const t="string"==typeof e?e:e?.location;if(!t)return void this.logDebug("debug","No stylesheet provided in configuration.");const i="string"!=typeof e&&!0===e?.cache;let n;try{n=await An.fetchText(t,this.isDemo,this.examplespath,i)}catch(e){throw this.logError("STYLESHEET",`Error loading stylesheet: ${t}`),e}const r=document.createElement("style"),s=()=>{r.innerHTML=n,this.shadowRoot?.appendChild(r)};try{await An.waitForChildNodes(r,s,1e4)}catch(e){this.logError("STYLESHEET","Error loading stylesheet")}const a=this.getCssRules(r);this.cssRules=this.cssRules.concat(a)}getCssRules(e){let t;if(e.sheet)t=e.sheet?.cssRules??e.sheet?.rules;else{const i=e;i.styleSheet&&(t=i.styleSheet?.cssRules??i.styleSheet?.rules)}return t?An.getArray(t):[]}async loadFloorplanSvg(e,t,i){let n;try{n=await An.fetchText(e.location,this.isDemo,this.examplespath,e.cache)}catch(t){throw this.logError("IMAGE",`Error loading image: ${e.location}`),t}const r=document.createElement("div");r.innerHTML=n;const s=r.querySelector("svg");if(t&&s.setAttribute("id",t.config.page_id),s.setAttribute("height","100%"),s.setAttribute("width","100%"),s.style.height="100%",s.style.width="100%",s.style.margin="auto",s.style.cursor="default",s.style.opacity="0",s.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),t&&i){const e=i.config.page_id,n=i.config.master_page.content_element;if(t.config.page_id===e)this.floorplanElement&&this.replaceChildrenUtil(this.floorplanElement,s);else{const e=this.floorplanElement.querySelector("#"+n),t=Number.parseFloat(s.getAttribute("height")),i=Number.parseFloat(s.getAttribute("width"));s.getAttribute("viewBox")||s.setAttribute("viewBox",`0 0 ${i} ${t}`),s.setAttribute("preserveAspectRatio","xMinYMin meet"),s.setAttribute("height",e.getAttribute("height")),s.setAttribute("width",e.getAttribute("width")),s.setAttribute("x",e.getAttribute("x")),s.setAttribute("y",e.getAttribute("y")),e?.parentElement&&this.replaceChildrenUtil(e.parentElement,s)}}else this.floorplanElement&&this.replaceChildrenUtil(this.floorplanElement,s);return s}async replaceChildrenUtil(e,t){if(e?.replaceChildren)e.replaceChildren(t);else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(t)}}async loadImage(e,t,i,n,r){try{return e.toLowerCase().includes(".svg")||"svg"===t.svgElement.nodeName||t.svgElement.querySelector("svg")?await this.loadSvgImage(e,t,i,n,r):await this.loadBitmapImage(e,t,i,n,r)}catch(t){this.logError("IMAGE",`Could not initialize image: ${e}, error: ${t}`)}}async loadBitmapImage(e,t,i,n,r){e=r?e:An.cacheBuster(e),this.logDebug("IMAGE",`${i} (setting image: ${e})`);let s=t.svgElement;return"image"!==s.nodeName&&(s=this.createImageElement(t.originalSvgElement),t.svgElement=this.replaceElement(t.svgElement,s),this.attachClickHandlers(s,t,i,void 0,n),s.onmouseover=()=>{this.handleEntityIdSetHoverOver(i,t)}),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),s}async loadSvgImage(e,t,i,n,r){let s;if(e?.trim().length)try{s=await An.fetchText(e,this.isDemo,this.examplespath,r)}catch(t){throw this.logError("IMAGE",`Error loading image: ${e}`),t}else{const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox","0 0 0 0"),s=e.outerHTML}this.logDebug("IMAGE",`${i} (setting image: ${e})`);const a="g"===t.svgElement.nodeName?t.svgElement:document.createElement("div");a.innerHTML=s;const o=a.querySelector("svg"),c=Number.parseFloat(o.getAttribute("height")),l=Number.parseFloat(o.getAttribute("width"));if(o.getAttribute("viewBox")||o.setAttribute("viewBox",`0 0 ${l} ${c}`),o.id=t.svgElement.id,o.setAttribute("preserveAspectRatio","xMinYMin meet"),null!==t.originalBBox&&(o.setAttribute("height",t.originalBBox.height.toString()),o.setAttribute("width",t.originalBBox.width.toString()),o.setAttribute("x",t.originalBBox.x.toString()),o.setAttribute("y",t.originalBBox.y.toString())),"g"!==t.svgElement.nodeName){const e=t.svgElement.getAttribute("transform");e&&o.setAttribute("transform",e),t.svgElement=this.replaceElement(t.svgElement,o)}return this.attachClickHandlers(o,t,i,void 0,n),t.svgElement.onmouseover=()=>{this.handleEntityIdSetHoverOver(i,t)},o}_querySelectorAll(e,t=void 0,i){let n=t?Array.from(e.querySelectorAll(t).values()):[];return n=i?[e].concat(n):n,n}replaceElement(e,t){const i=e.parentElement;for(const i of Array.from(e.classList))t.classList.add(i);return this._querySelectorAll(e,"*",!0).forEach((e=>{Tn.off(e,"click"),Tn.off(e,"longClick"),e.remove()})),e.remove(),i?.appendChild(t),t}async loadCardHelpers(){this._helpers=await window.loadCardHelpers()}async setCard(e,t){this._helpers||await this.loadCardHelpers();let i=this._cards.get(e);if(!i){let t=this.shadowRoot?.querySelector("#"+e);if(!t)return void this.logError("CONFIG",`Cannot find element '${e}' in SVG file`);i={container:t},this._cards.set(e,i)}if(t){const e=this._helpers.createCardElement({...t});this.hass&&(e.hass=this.hass),i.card=e,i.container.replaceChildren(e)}else i.card=void 0,i.container.replaceChildren()}initPageDisplay(){if(this.config.pages)for(const e of Object.values(this.pageInfos))e.svg.style.opacity="1",e.svg.style.display=e.isMaster||e.isDefault?"initial":"none";else this.svg.style.opacity="1",this.svg.style.display="block"}initVariables(){if(this.config.variables)for(const e of this.config.variables)this.initVariable(e);if(this.config.pages)for(const e of Object.values(this.pageInfos))if(e.config.variables)for(const t of e.config.variables)this.initVariable(t)}initVariable(e){let t,i;if("string"==typeof e?t=e:(t=e.name,i=e.value,e.value&&(i=this.evaluate(e.value,t,void 0))),!this.entityInfos[t]){const e={entityId:t,ruleInfos:[],lastState:void 0};this.entityInfos[t]=e}this.hass.states[t]||(this.hass.states[t]={entity_id:t,state:i,last_changed:(new Date).toString(),last_updated:(new Date).toString(),attributes:{},context:{}}),this.setVariable(t,i,{},!0)}getActionConfigs(e){if(null==e)return[];if(Array.isArray(e)){for(const t of e)t.action=t.action??"call-service";return e}return"object"==typeof e?(e.action=e.action??"call-service",[e]):"string"==typeof e?e.includes(".")?[{action:"call-service",service:e}]:[{action:e}]:[]}initEventListeners(){this.addEventListener(Ve,this.handleEventActionCall)}initStartupActions(){if(this.handleActions(this.config.startup_action,void 0,void 0,void 0),this.config.pages)for(const e of Object.values(this.pageInfos))this.handleActions(e.config.startup_action,void 0,void 0,void 0)}initFloorplanRules(e,t){if(!t.rules)return;const i=this._querySelectorAll(e,"*",!0);for(const e of i)e.id&&(this.svgElements[e.id]=e);this.initRules(t,e,i)}initRules(e,t,i){if(e.functions&&(this.functions=this.evaluate(e.functions)),e.defaults){const t=e.defaults;for(const i of e.rules)i.hover_action=void 0===i.hover_action?t.hover_action:i.hover_action,i.state_action=void 0===i.state_action?t.state_action:i.state_action,i.tap_action=void 0===i.tap_action?t.tap_action:i.tap_action,i.hold_action=void 0===i.hold_action?t.hold_action:i.hold_action,i.hover_info_filter=void 0===i.hover_info_filter?t.hover_info_filter:i.hover_info_filter,i.double_tap_action=void 0===i.double_tap_action?t.double_tap_action:i.double_tap_action}for(const n of e.rules)n.entity||n.entities?this.initEntityRule(n,t,i):(n.element||n.elements)&&this.initElementRule(n,t,i)}initEntityRule(e,t,i){const n=this.initGetEntityRuleEntities(e);for(const t of n){const n=t.entityId;let r=this.entityInfos[n];r||(r={entityId:n,ruleInfos:[],lastState:void 0},this.entityInfos[n]=r);const s=new ge(e);r.ruleInfos.push(s);for(const e of t.elementIds){const t=i.find((t=>t.id===e));if(!t){this.logWarning("CONFIG",`Cannot find element '${e}' in SVG file`);continue}const a=this.addSvgElementToRule(t,s);a.svgElement=t,t.querySelector("title")||t.appendChild(document.createElementNS("http://www.w3.org/2000/svg","title")),t.onmouseenter=()=>{this.handleEntitySetHoverOver(r,a)},t.onmouseleave=()=>{this.handleEntitySetHoverOver(r,a)},this.attachClickHandlers(t,a,n,void 0,s)}}}initGetEntityRuleEntities(e){const t=[];e.groups=e.groups?e.groups:[];for(const i of e.groups){const e=this.hass.states[i];if(e)for(const i of e.attributes.entity_id)this.addTargetEntity(i,[i],t);else this.logWarning("CONFIG",`Cannot find '${i}' in Home Assistant groups`)}e.entities=e.entities?e.entities:[],e.entities=e.entity?e.entities.concat(e.entity):e.entities;const i=e.entities.filter((e=>"string"==typeof e));for(const n of i){let i=[];e.elements?i=i.concat(e.elements):e.element?i=i.concat(this.evaluate(e.element,n,void 0)):null!==e.element&&(i=i.concat(n)),n&&"*"===n||this.addTargetEntity(n,i,t)}const n=e.entities.filter((e=>"string"!=typeof e));for(const e of n){const i=e;this.addTargetEntity(i.entity,[i.element],t)}return t}addTargetEntity(e,t,i){const n=this.hass.states[e],r="floorplan"===e.split(".")[0];n||r?i.push({entityId:e,elementIds:t}):this.logWarning("CONFIG",`Cannot find '${e}' in Home Assistant entities`)}initElementRule(e,t,i){if(e.element||e.elements){e.elements=e.elements?e.elements:[],e.elements=e.element?e.elements.concat(e.element):e.elements;for(const t of e.elements){const n=i.find((e=>e.id===t));if(n){let i=this.elementInfos[t];i||(i={ruleInfos:[],lastState:void 0},this.elementInfos[t]=i);const r=new ge(e);i.ruleInfos.push(r);const s=this.addSvgElementToRule(n,r);this.attachClickHandlers(n,s,void 0,t,r)}else this.logWarning("CONFIG",`Cannot find '${t}' in SVG file`)}}}attachClickHandlers(e,t,i,n,r){this._querySelectorAll(e,void 0,!0).forEach((s=>{const a=s,o=s===e;if(a.querySelector("title")||a.appendChild(document.createElementNS("http://www.w3.org/2000/svg","title")),r?.rule?.tap_action||r?.rule?.double_tap_action){const e=!!r.rule.tap_action&&this.getActionConfigs(r.rule.tap_action),s=!!r.rule.double_tap_action&&this.getActionConfigs(r.rule.double_tap_action),c=!!e&&new me(this,i,n,t,r,e);if(e&&!s&&Tn.on(a,"click",this.onClick.bind(c)),s){const o=!!s&&new me(this,i,n,t,r,s);Pe.observe(a),e&&Tn.on(a,"singleClick",this.onClick.bind(c)),Tn.on(a,"doubleClick",this.onLongClick.bind(o))}a.style&&(a.style.cursor="pointer"),An.addClass(a,"floorplan-click"+(o?"":"-child"))}if(r?.rule?.hold_action){const e=this.getActionConfigs(r.rule.hold_action),s=new me(this,i,n,t,r,e);Ce.observe(a),Tn.on(a,"longClick",this.onLongClick.bind(s)),a.style&&(a.style.cursor="pointer"),An.addClass(a,"floorplan-long-click"+(o?"":"-child"))}}))}generateSvgElementInfo(e){const t=e.getBBox?e.getBBox():null;return new fe(e.id,e,e,t)}addSvgElementToRule(e,t){const i=this.generateSvgElementInfo(e);return t.svgElementInfos[e.id]=i,i}createImageElement(e){const t=document.createElementNS("http://www.w3.org/2000/svg","image");return t.setAttribute("id",e.getAttribute("id")),t.setAttribute("x",e.getAttribute("x")),t.setAttribute("y",e.getAttribute("y")),t.setAttribute("height",e.getAttribute("height")),t.setAttribute("width",e.getAttribute("width")),t}async handleEntities(e=!1){this.handleElements();const t=this.getChangedEntities(e);for(const e of Object.keys(this.variables))t.add(e);if(t.size)for(const e of t)await this.handleEntity(e)}getChangedEntities(e){const t=new Set,i=Object.keys(this.hass.states),n=An.deviceId();for(const r of i)if(r!==`sensor.ha_floorplan_${n}`||t.has(r)){const i=this.entityInfos[r];if(i){const n=this.hass.states[r];if(e)this.logDebug("STATE",`${r}: ${n.state} (initial load)`),t.has(r)||t.add(r);else if(i.lastState){const e=n.state;n.last_changed!==i.lastState.last_changed?(this.logDebug("STATE",`${r}: ${e} (last changed ${An.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r)):An.equal(i.lastState.attributes,n.attributes)||(this.logDebug("STATE",`${r}: attributes (last updated ${An.formatDate(i.lastState.last_changed)})`),t.has(r)||t.add(r))}}}else t.add(r);return t}async handleEntity(e){const t=this.hass.states[e],i=this.entityInfos[e];if(i){i.lastState=Object.assign({},t);for(const e of i.ruleInfos){const t=Object.values(e.svgElementInfos);if(t.length)for(const n of t)n.svgElement&&this.handleActions(e.rule.state_action,i.entityId,n,e);else this.handleActions(e.rule.state_action,i.entityId,void 0,e)}}}async handleElements(){for(const e of Object.values(this.elementInfos))for(const t of e.ruleInfos)for(const e of Object.values(t.svgElementInfos))this.handleActions(t.rule.state_action,void 0,e,t)}handleEntityIdSetHoverOver(e,t){const i=this.entityInfos[e];i&&this.handleEntitySetHoverOver(i,t)}handleEntitySetHoverOver(e,t){const i=e.entityId,n=this.hass.states[i];for(const i of e.ruleInfos)if(i.rule.hover_action){let r="string"==typeof i.rule.hover_action&&"hover-info"===i.rule.hover_action;if(r=r||"object"==typeof i.rule.hover_action&&"hover-info"===i.rule.hover_action.action,r=r||Array.isArray(i.rule.hover_action)&&i.rule.hover_action.some((e=>"hover-info"===e.action)),r){const e=new Set(i.rule.hover_info_filter);for(const t of Object.values(i.svgElementInfos))An.addClass(t.svgElement,"floorplan-hover"),t.svgElement.style.cursor="pointer",t.svgElement.querySelectorAll("title").forEach((t=>{let i=`${n.attributes.friendly_name}\n`;i+=`State: ${n.state}\n\n`,Object.keys(n.attributes).map((t=>{e.has(t)||(i+=`${t}: ${n.attributes[t]}\n`)})),i+="\n",i+=`Last changed: ${Me.timeago(n.last_changed)}\n`,i+=`Last updated: ${Me.timeago(n.last_updated)}`,t.textContent=i}))}else i.rule.hover_action&&this.handleActions(i.rule.hover_action,e.entityId,t,i)}}isOptionEnabled(e){return null===e||void 0!==e}validateConfig(e){let t=!0;if(e.pages||e.rules)if(e.pages)e.pages.length||this.logWarning("CONFIG","The 'pages' section must contain one or more pages in floorplan configuration");else{e.rules||this.logWarning("CONFIG","Cannot find 'rules' in floorplan configuration");let i=e.rules.filter((e=>e.entities&&e.elements));i.length&&(this.logError("CONFIG","A rule cannot contain both 'entities' and 'elements' in floorplan configuration"),t=!1),i=e.rules.filter((e=>!(e.entity||e.entities||e.element||e.elements))),i.length&&(this.logError("CONFIG","A rule must contain either 'entities' or 'elements' in floorplan configuration"),t=!1)}else this.logWarning("CONFIG","Cannot find 'pages' nor 'rules' in floorplan configuration");return t}evaluate(e,t,i,n,r){if("string"!=typeof e||!Fe.isCode(e))return e;try{return Fe.evaluate(e,this.hass,this.config,t,i,this.svgElements,this.functions,n,this.svg,r)}catch(n){return this.handleError(n,{expression:e,entityId:t,hass:this.hass,svgElement:i})}}onClick(e){e.stopPropagation(),e.preventDefault();const t=this;t.instance.handleActions(t.actions,t.entityId,t.svgElementInfo,t.ruleInfo)}onLongClick(e){e.stopPropagation(),e.preventDefault();const t=this,i=t.instance;setTimeout((()=>{i.handleActions(t.actions,t.entityId,t.svgElementInfo,t.ruleInfo)}),300)}handleActions(e,t,i,n){const r=this.getActionConfigs(e);for(const e of r){if(e.confirmation&&(!e.confirmation.exemptions||!e.confirmation.exemptions.some((e=>e.user===this.hass.user.id)))&&!confirm(e.confirmation.text||`Are you sure you want to ${e.action}?`))return;switch(e.action){case"more-info":this.isDemo?this.notify(`Performing action: ${e.action} ${t}`):pe(this,"hass-more-info",{entityId:t});break;case"navigate":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.navigation_path}`);else{const n=this.evaluate(e.navigation_path,t,i?.svgElement);de(0,n,e.navigation_replace??!1)}break;case"url":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.url_path}`);else{const n=e.same_tab?"_self":"_blank",r=this.evaluate(e.url_path,t,i?.svgElement);window.open(r,n)}break;case"toggle":if(t){const e={action:"call-service",service:"homeassistant.toggle",service_data:{entity_id:t}};this.callService(e,t,i,n)}break;case"call-service":if(!e.service)return;this.callService(e,t,i,n);break;case"fire-dom-event":pe(this,"ll-custom",e)}}}getSvgElementsFromServiceData(e,t){let i=[],n=[];if(Array.isArray(e?.elements)&&(n=n.concat(e?.elements)),"string"==typeof e?.element&&(n=n.concat([e?.element])),n.length)for(const e of n)i=i.concat(this._querySelectorAll(this.svg,`#${e.replace(/\./g,"\\.")}`,!1));else t&&(i=[t]);return i}getServiceData(e,t,i){let n={};if("object"==typeof e.service_data)for(const r of Object.keys(e.service_data))n[r]=this.evaluate(e.service_data[r],t,i);else if("string"==typeof e.service_data){const r=this.evaluate(e.service_data,t,i);n="string"==typeof r&&r.trim().startsWith("{")?JSON.parse(r):r}else void 0!==e.service_data&&(n=e.service_data);return n}executeServiceData(e,t,i,n,r){try{if("object"==typeof e.service_data)for(const s of Object.keys(e.service_data))this.evaluate(e.service_data[s],t,i,n,r);else"string"==typeof e.service_data?this.evaluate(e.service_data,t,i,n,r):void 0!==e.service_data&&this.logWarning("CONFIG","Invalid execution data");return!0}catch(e){return this.logWarning("CONFIG","Error thrown while executing service"),!1}}callService(e,t,i,n){const r=this.evaluate(e.service,t,i?.svgElement),[s,a]=r.split(".",2);if("floorplan"===s)this.callFloorplanService(s,a,e,t,i,n);else this.callHomeAssistantService(s,a,e,t,i)}callFloorplanService(e,t,i,n,r,s){const a=r?.svgElement??void 0;let o,c,l,h,u,p,d,f,g=[],m=null;switch(m=!["execute","card_set"].includes(t)?this.getServiceData(i,n,a):{},t){case"class_toggle":g=this.getSvgElementsFromServiceData(m,r?.svgElement);for(const e of g)f=1===g.length&&g[0]===r?.svgElement,f||(m=this.getServiceData(i,n,e)),l="string"==typeof m?m:m.class,An.toggleClass(e,l);break;case"class_set":g=this.getSvgElementsFromServiceData(m,r?.svgElement);for(const e of g)f=1===g.length&&g[0]===r?.svgElement,f||(m=this.getServiceData(i,n,e)),l="string"==typeof m?m:m.class,An.setClass(e,l);break;case"dataset_set":{let e,t;if("string"==typeof m){const i=m.split(":");if(i.length<2){this.logError("FLOORPLAN_ACTION",`Service data "${m}" is not a valid dataset key value pair.`);break}e=i[1],t=i[0]}else e=m.value,t=m.key;g=this.getSvgElementsFromServiceData(m,r?.svgElement);for(const s of g)f=1===g.length&&g[0]===r?.svgElement,f||(m=this.getServiceData(i,n,s)),An.datasetSet(s,t,e);break}case"style_set":g=this.getSvgElementsFromServiceData(m,r?.svgElement);for(const e of g)f=1===g.length&&g[0]===r?.svgElement,f||(m=this.getServiceData(i,n,e)),h="string"==typeof m?m:m.style,An.setStyle(e,h);break;case"text_set":g=this.getSvgElementsFromServiceData(m,r?.svgElement);for(const e of g){f=1===g.length&&g[0]===r?.svgElement,f||(m=this.getServiceData(i,n,e)),d="string"==typeof m?m:m.text;const t=i.service_data?.shift_y_axis?i.service_data?.shift_y_axis:"1em";An.setText(e,d,t)}break;case"image_set":let e;if("object"==typeof i?.service_data){if(i?.service_data?.elements){this.logError("CONFIG","Multiple elements are not supported in service data.");break}if(i?.service_data?.element&&"string"==typeof i?.service_data?.element){if(i?.service_data?.image_refresh_interval){this.logError("CONFIG","Image refresh interval is not supported with element as service data.");break}e=i?.service_data?.element}}if(e){const e=this.getSvgElementsFromServiceData(i?.service_data||{});if(e.length<1){this.logError("CONFIG","Could not locate the specified element from the service data within the SVG. Please ensure the element ID is correct and exists in the SVG.");break}r=this.generateSvgElementInfo(e[0])}if(r&&(s||i?._is_internal_action_scope)){let e;if(m=this.getServiceData(i,n,r?.svgElement),void 0!==typeof m)if(i&&i._is_internal_action_scope){m=i?.service_data;const t=i?.service_data;if(null!==t?.image&&("string"==typeof t?.image&&(e=t?.image),"object"==typeof t?.image)){const i=t?.image;"location"in i&&"string"==typeof i.location&&(e=i.location)}}else"string"==typeof m?e=m:"object"==typeof m&&("string"==typeof m?.image&&(e=m?.image),null!==m?.image&&"object"==typeof m?.image&&"location"in m?.image&&"string"==typeof m.image.location&&(e=m.image.location));if(u=i?._is_internal_action_scope||"object"!=typeof m?0:m.image_refresh_interval,p=!(u>0)&&("object"!=typeof m||!0===m.cache),s?.imageLoader&&clearInterval(s.imageLoader),u&&s&&!i?._is_internal_action_scope&&(s.imageLoader=setInterval(this.loadImage.bind(this),1e3*u,e,r,n,s,p)),!e)break;this.loadImage(e,r,n,s,p)}break;case"page_navigate":m=this.getServiceData(i,n,r?.svgElement),o=m.page_id,c=o?this.pageInfos[o]:void 0,c&&(Object.keys(this.pageInfos).map((e=>{const t=this.pageInfos[e];t.isMaster||"none"===t.svg.style.display||(t.svg.style.display="none")})),c.svg.style.display="block");break;case"set_page_list":{const e=m??i.service_data;console.log("[floorplan.set_page_list] Incoming service data:",e);const t=this.parsePageLayerList(e);if(console.log("[floorplan.set_page_list] Parsed page layers:",t),!Object.keys(t).length){this.logWarning("CONFIG","No valid page entries were provided to floorplan.set_page_list."),console.log("[floorplan.set_page_list] No valid page entries detected.");break}console.log("SHAHZAD: set_page_list stored keys",Object.keys(this.pageLayers||{})),console.log("SHAHZAD: set_page_list layer id set size",this.pageLayerIds?this.pageLayerIds.size:0),this.pageLayers=t,this.pageLayerIds=new Set;for(const e of Object.values(t))for(const t of e)this.pageLayerIds.add(t);this.currentPageName=void 0;break}case"set_page":{if(!Object.keys(this.pageLayers).length){this.logWarning("FLOORPLAN_ACTION","No page list available. Call floorplan.set_page_list before floorplan.set_page."),console.log("SHAHZAD: set_page missing page list");break}const e=m??i.service_data;console.log("SHAHZAD: set_page service data",e);const t=this.getPageNameFromServiceData(e);if(console.log("SHAHZAD: set_page resolved page",t),!t){this.logWarning("CONFIG","floorplan.set_page requires a page name to be provided in service data."),console.log("SHAHZAD: set_page missing page name");break}const n=this.pageLayers[t]||[];console.log("SHAHZAD: set_page layers for page",t,n),this.applyPageLayerVisibility(t),console.log("SHAHZAD: set_page applied");break}case"variable_set":if(m=this.getServiceData(i,n,r?.svgElement),m.variable){const e={};if(m.attributes){const t=m.attributes;for(const i of Object.keys(t))e[i]=this.getActionValue(t[i],n,a)}const t=m,i=this.getActionValue(t,n,a);this.setVariable(m.variable,i,e,!1)}break;case"execute":this.executeServiceData(i,n,r?.svgElement,r,s);for(const e of g)f=1===g.length&&g[0]===r?.svgElement,f||this.executeServiceData(i,n,e,r,s);break;case"card_set":if(!i?.service_data){this.logError("CONFIG","Must have service data for card_set.");break}const t=Array.isArray(i.service_data)?i.service_data:[i.service_data];for(const e of t)e.container_id?(e.config&&!e.config.type&&this.logError("CONFIG","Must have type in config for card_set."),this.setCard(e.container_id,e.config)):this.logError("CONFIG","Must have container_id in service data for card_set.")}}parsePageLayerList(e){const t={};if(null==e)return t;const i=(e,i)=>{if(!e)return;const n=this.normalizeLayerValues(i);n.length&&(t[e]=n)},n=e=>{if(null!=e)if("string"!=typeof e){if("object"==typeof e){const t=e,n=this.getEntryPageName(t),r=t.layers??t.layer??t.elements??t.ids??t.layer_ids??t.layers_list;i(n,r)}}else{const t=e.trim();if(!t.length)return;const n=t.indexOf(":");if(-1===n)return void i(t,void 0);const r=t.slice(0,n).trim(),s=t.slice(n+1).trim();i(r,s)}};if("string"==typeof e){const i=e.trim();if(!i.length)return t;if(i.startsWith("{")||i.startsWith("["))try{return this.parsePageLayerList(JSON.parse(i))}catch(e){return this.logWarning("CONFIG","Unable to parse string data provided to floorplan.set_page_list."),t}return n(i),t}if(Array.isArray(e))return e.forEach(n),t;if("object"==typeof e){const i=e;if(Array.isArray(i.pages))return i.pages.forEach(n),t;if(Array.isArray(i.page_list))return i.page_list.forEach(n),t;if(this.isNumericKeyObject(i))return Object.keys(i).sort(((e,t)=>Number(e)-Number(t))).forEach((e=>n(i[e]))),t;for(const[e,t]of Object.entries(i))n({page:e,layers:t});return t}return t}getEntryPageName(e){const t=["page","page_name","name","id","key"];for(const i of t){const t=e[i];if("string"==typeof t&&t.trim())return t.trim()}}normalizeLayerValues(e){if(null==e)return[];if(Array.isArray(e)){const t=[];for(const i of e){const e=this.normalizeLayerEntry(i);e&&t.push(e)}return t}if("string"==typeof e){const t=e.trim();if(!t.length)return[];if(t.startsWith("[")||t.startsWith("{"))try{return this.normalizeLayerValues(JSON.parse(t))}catch(e){}return t.split(/[,;]/).map((e=>e.trim())).filter((e=>e.length>0))}if("object"==typeof e){const t=e;if(Array.isArray(t.layers))return this.normalizeLayerValues(t.layers);const i=t.layer??t.id??t.element??t.name;if(i)return this.normalizeLayerValues(i)}return[]}normalizeLayerEntry(e){if(null!=e){if("string"==typeof e){const t=e.trim();return t.length?t:void 0}if("object"==typeof e){const t=e,i=["id","layer","element","name"];for(const e of i){const i=t[e];if("string"==typeof i&&i.trim())return i.trim()}}}}isNumericKeyObject(e){const t=Object.keys(e);return t.length>0&&t.every((e=>/^[0-9]+$/.test(e)))}getPageNameFromServiceData(e){if(null!=e){if("string"==typeof e){const t=e.trim();return t.length?t:void 0}if("object"==typeof e){const t=e,i=["page","page_name","name","id"];for(const e of i){const i=t[e];if("string"==typeof i&&i.trim())return i.trim()}}}}applyPageLayerVisibility(e){const t=this.pageLayers[e];if(!t||!t.length)return void this.logWarning("FLOORPLAN_ACTION",`No layers configured for page "${e}".`);if(!this.svg)return void this.logWarning("FLOORPLAN_ACTION","Unable to change layers because the SVG has not finished loading.");if(!this.pageLayerIds.size){this.pageLayerIds=new Set;for(const e of Object.values(this.pageLayers))for(const t of e)this.pageLayerIds.add(t)}console.log("SHAHZAD: applyPageLayerVisibility page",e,"layers",t);let i=0,n=[];for(const e of t){const t=this.getLayerElementsById(e);t.length?i+=t.length:n.push(e)}console.log("SHAHZAD: applyPageLayerVisibility found elements",i,"missing",n);const r=new Set(t);this.currentPageName=e;for(const t of this.pageLayerIds){const i=this.getLayerElementsById(t);i.length||this.logWarning("FLOORPLAN_ACTION",`Layer "${t}" from page "${e}" was not found in the SVG.`);for(const e of i)if(void 0===e.dataset.floorplanOriginalDisplay&&(e.dataset.floorplanOriginalDisplay=e.style.display||""),r.has(t)){const t=e.dataset.floorplanOriginalDisplay??"";t?e.style.display=t:e.style.removeProperty("display"),e.classList.remove("floorplan-layer-hidden")}else e.style.display="none",e.classList.add("floorplan-layer-hidden")}}getLayerElementsById(e){if(!this.svg)return[];const t=`#${e.replace(/\./g,"\\.")}`;return this._querySelectorAll(this.svg,t,!1).map((e=>e))}getActionValue(e,t,i){let n=e.value;return e.value&&(n=this.evaluate(e.value,t,i)),n}setVariable(e,t,i,n){if(this.variables[e]=t,this.hass.states[e]){this.hass.states[e].state=t.toString();for(const t of Object.keys(i))this.hass.states[e].attributes[t]=i[t]}for(const e of Object.keys(this.variables)){const t=this.hass.states[e];t&&(t.last_changed=(new Date).toString())}n||this.handleEntities()}callHomeAssistantService(e,t,i,n,r){const s=this.getServiceData(i,n,r?.svgElement);"object"==typeof s&&(null===s.entity_id||Array.isArray(s.entity_id)&&!s.entity_id.length||!s.entity_id&&n&&(s.entity_id=n)),this.hass.callService(e,t,s),this.isDemo&&this.notify(`Calling service: ${e}.${t} (${s.entity_id})`)}handleEventActionCall(e){const t=e,{actionConfig:i,entityId:n,svgElementInfo:r,ruleInfo:s}=t.detail;console.log("SHAHZAD: action-call",{service:i.service,entityId:n,el:r?.svgElement?.id,rule:s?.rule?.element}),i._is_internal_action_scope=!0,this.handleActions(i,n,r,s)}handleWindowError(e,t,i,n,r){if(e.toLowerCase().includes("script error"))this.logError("SCRIPT","Script error: See browser console for detail");else{const s=[e,"URL: "+t,"Line: "+i+", column: "+n,"Error: "+JSON.stringify(r)].join("<br>");this.logError("ERROR",s)}return!1}handleError(e,t){console.error(e,t);let i="Error";"string"==typeof e&&(i=e),e.message?i=`${e.message} (See console for more info)`:e.stack&&(i=`${e.stack}`),this.logger.log("error",i)}logError(e,t){this.logger.log("error",`${e} ${t}`)}logWarning(e,t){this.logger.log("warning",`${e} ${t}`)}logInfo(e,t){this.logger.log("info",`${e} ${t}`)}logDebug(e,t){this.logger.log("debug",`${e} ${t}`)}};In([le({type:String})],Pn.prototype,"examplespath",void 0),In([le({type:Object})],Pn.prototype,"hass",void 0),In([le({type:String||Object})],Pn.prototype,"_config",void 0),In([le({type:Boolean})],Pn.prototype,"isDemo",void 0),In([le({type:Boolean})],Pn.prototype,"isShowLog",void 0),In([le({type:Function})],Pn.prototype,"notify",void 0),Pn=In([oe("floorplan-element")],Pn);
/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const Nn=e=>null!=e?e:U,Ln=1;class On{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}
/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const Mn=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends On{constructor(e){var t;if(super(e),e.type!==Ln||"style"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const n=e[i];return null==n?t:t+`${i=i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.vt){this.vt=new Set;for(const e in t)this.vt.add(e);return this.render(t)}this.vt.forEach((e=>{null==t[e]&&(this.vt.delete(e),e.includes("-")?i.removeProperty(e):i[e]="")}));for(const e in t){const n=t[e];null!=n&&(this.vt.add(e),e.includes("-")?i.setProperty(e,n):i[e]=n)}return B}});var Dn,Rn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let $n=Dn=class extends se{constructor(){super(...arguments),this.styles={dummy:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}}render(){return this.config?j`
<ha-card>
${this.isDisplayCardHeader?j` <h1 class="card-header">${this.config?.title}</h1> `:""}
<div class="content" style=${Mn(this.styles)}>
<floorplan-element
.examplespath=${this.examplespath}
.hass=${this.hass}
._config=${this.config?.config}
.isDemo=${this.isDemo}
.notify=${this.notify}
data-floorplan-ref=${Nn(`element-${this.config?.title}`)}
></floorplan-element>
</div>
</ha-card>
`:j``}static get styles(){return l`
/* header (main toolbar) */
/* --header-height: 56px; */
/* card header */
/* height: 76px; */
:host .content,
:host .content floorplan-element {
display: flex;
flex-flow: column;
flex: 1;
min-height: 0;
}
`}get isFullHeight(){return this.config?.full_height}get view(){return this._view||(this._view=ue.closestElement("#view",this)),this._view}get appHeader(){return this._appHeader||(this._appHeader=this.view?.previousElementSibling),this._appHeader}get appHeaderHeight(){if(this.isDemo)return 0;const e=this.appHeader;return e?e.clientHeight:0}get cardHeaderHeight(){return this.isDemo?0:this.isDisplayCardHeader?Dn.cardHeaderHeight:0}get isDisplayCardHeader(){return!this.isDemo&&this.config?.title?.trim().length>0}getCardSize(){return 1}setConfig(e){this.config=e}update(e){this.isFullHeight?this.styles={height:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}:this.styles={dummy:""},super.update(e)}};$n.cardHeaderHeight=76,Rn([le({type:Object})],$n.prototype,"hass",void 0),Rn([le({type:Boolean})],$n.prototype,"isPanel",void 0),Rn([le({type:Boolean})],$n.prototype,"editMode",void 0),Rn([le({type:Object})],$n.prototype,"config",void 0),Rn([le({type:String})],$n.prototype,"examplespath",void 0),Rn([le({type:Boolean})],$n.prototype,"isDemo",void 0),Rn([le({type:Function})],$n.prototype,"notify",void 0),$n=Dn=Rn([oe("floorplan-card")],$n);var Vn,Fn=function(e,t,i,n){var r,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let jn=Vn=class extends se{constructor(){super(...arguments),this.styles={height:"calc(100vh)"}}render(){return j`
<ha-app-layout>
<app-header fixed slot="header" ?hidden=${!this.showAppHeader}>
<app-toolbar>
<ha-menu-button .hass=${this.hass} .narrow=${this.narrow}"></ha-menu-button>
<div main-title>${this.panel?.title}</div>
</app-toolbar>
</app-header>
<div class="content" style=${Mn(this.styles)}>
<floorplan-element .examplespath=${this.examplespath} .hass=${this.hass}
._config=${this.panel?.config?.config} .isDemo=${this.isDemo} .notify=${this.notify}
data-floorplan-ref=${Nn(`element-${this.panel?.title}`)}
>
</floorplan-element>
</div>
</ha-app-layout>
`}static get styles(){return l`
:host .content,
:host .content floorplan-element {
display: flex;
flex-flow: column;
flex: 1;
min-height: 0;
}
[hidden] {
display: none !important;
}
`}get appHeaderHeight(){return this.isDemo?0:this.showAppHeader?Vn.appHeaderHeight:0}update(e){this.panel&&(this.showSideBar=!1!==this.panel.config.show_side_bar,this.showAppHeader=!1!==this.panel.config.show_app_header&&!this.isDemo,this.hass&&!1===this.panel.config.show_side_bar&&(this.hass.dockedSidebar="always_hidden"),this.styles={height:`calc(100vh - ${this.appHeaderHeight}px)`}),super.update(e)}};jn.appHeaderHeight=64,Fn([le({type:Object})],jn.prototype,"hass",void 0),Fn([le({type:Boolean})],jn.prototype,"narrow",void 0),Fn([le({type:Object})],jn.prototype,"panel",void 0),Fn([le({type:Boolean})],jn.prototype,"showSideBar",void 0),Fn([le({type:Boolean})],jn.prototype,"showAppHeader",void 0),Fn([le({type:String})],jn.prototype,"examplespath",void 0),Fn([le({type:Boolean})],jn.prototype,"isDemo",void 0),Fn([le({type:Function})],jn.prototype,"notify",void 0),jn=Vn=Fn([oe("floorplan-panel")],jn);var Bn=n.c,Un=n.E;export{Bn as FloorplanCard,Un as FloorplanPanel};