Files
rikku-home-assistant/app-configs/homeassistant/www/community/ha-floorplan/floorplan.js
T
Trez.One a4b146ad07
Home Assistant & Miscellaneous Deployment / Check and Create PR (push) Successful in 37s
Home Assistant & Miscellaneous Deployment / Generate list of added/modified/deleted services (push) Failing after 21s
Home Assistant & Miscellaneous Deployment / Home Assistant Configuration Check (push) Has been skipped
Home Assistant & Miscellaneous Deployment / Docker Compose Dry Run (push) Has been skipped
Directory structure overhaul
2025-08-24 10:38:16 -04:00

203 lines
261 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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"}}},n=t.en_US,i=new function e(i,p,d){var f,g=i||n,m=p||0,v=d||!1,y=0;function b(e,t,n,i){for(var l="",p=null,d=!1,f=e.length,g=!1,y=0;y<f;y++){var x=e.charCodeAt(y);if(!0!==d)37!==x?l+=e[y]: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+=n.days[t.getDay()];break;case 66:l+=n.months[t.getMonth()];break;case 67:l+=r(Math.floor(t.getFullYear()/100),p);break;case 68:l+=b(n.formats.D,t,n,i);break;case 70:l+=b(n.formats.F,t,n,i);break;case 72:l+=r(t.getHours(),p);break;case 73:l+=r(a(t.getHours()),p);break;case 76:l+=s(Math.floor(i%1e3));break;case 77:l+=r(t.getMinutes(),p);break;case 80:l+=t.getHours()<12?n.am:n.pm;break;case 82:l+=b(n.formats.R,t,n,i);break;case 83:l+=r(t.getSeconds(),p);break;case 84:l+=b(n.formats.T,t,n,i);break;case 85:l+=r(o(t,"sunday"),p);break;case 87:l+=r(o(t,"monday"),p);break;case 88:l+=b(n.formats.X,t,n,i);break;case 89:l+=t.getFullYear();break;case 90:if(v&&0===m)l+="GMT";else l+=h(t)||"";break;case 97:l+=n.shortDays[t.getDay()];break;case 98:case 104:l+=n.shortMonths[t.getMonth()];break;case 99:l+=b(n.formats.c,t,n,i);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();n.ordinalSuffixes?l+=String(_)+(n.ordinalSuffixes[_-1]||c(_)):l+=String(_)+c(_);break;case 112:l+=t.getHours()<12?n.AM:n.PM;break;case 114:l+=b(n.formats.r,t,n,i);break;case 115:l+=Math.floor(i/1e3);break;case 116:l+="\t";break;case 117:l+=0===(_=t.getDay())?7:_;break;case 118:l+=b(n.formats.v,t,n,i);break;case 119:l+=t.getDay();break;case 120:l+=b(n.formats.x,t,n,i);break;case 121:l+=(""+t.getFullYear()).slice(2);break;case 122:if(v&&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[y]}p=null,d=!1}}return l}var x=function(e,t){var n;if(t){if(n=t.getTime(),v){var i=l(t);if(l(t=new Date(n+i+m))!==i){var r=l(t);t=new Date(n+r+m)}}}else{var s=Date.now();s>y?(y=s,f=new Date(y),n=y,v&&(f=new Date(y+l(f)+m))):n=y,t=f}return b(e,t,g,n)};return x.localize=function(t){return new e(t||g,m,v)},x.localizeByIdentifier=function(e){var n=t[e];return n?x.localize(n):(u('[WARNING] No locale found with identifier "'+e+'".'),x)},x.timezone=function(t){var n=m,i=v,r=typeof t;"number"!==r&&"string"!==r||(i=!0,"string"===r?n=("-"===t[0]?-1:1)*(60*parseInt(t.slice(1,3),10)+parseInt(t.slice(3,5),10))*60*1e3:"number"===r&&(n=60*t*1e3));return new e(g,n,i)},x.utc=function(){return new e(g,m,!0)},x}(n,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 n=e.getDay();"monday"===t&&(0===n?n=6:n--);var i=Date.UTC(e.getFullYear(),0,1),r=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),s=(Math.floor((r-i)/864e5)+7-n)/7;return Math.floor(s)}function c(e){var t=e%10,n=e%100;if(n>=11&&n<=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 n=e.toLocaleString(t,{timeZoneName:"short"}).match(/\s([\w]+)$/);return n&&n[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=i,"function"!=typeof Date.now&&(Date.now=function(){return+new Date})}()},156:function(e,t,n){e.exports=function(e){var t=Object.freeze({__proto__:null,get FunctionDeclaration(){return Ke},get VariableDeclaration(){return Qe},get VariableDeclarator(){return Ze},get ClassDeclaration(){return et},get ClassBody(){return tt},get MethodDefinition(){return nt}}),i=Object.freeze({__proto__:null,get FunctionDeclaration(){return sn},get VariableDeclaration(){return an},get VariableDeclarator(){return on},get ClassDeclaration(){return cn},get ClassBody(){return ln},get MethodDefinition(){return hn}}),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,n){for(;t;){var i=f(t,n),r=void 0!==i&&void 0===i.writable&&"function"==typeof i[e]&&i[e];if(r)return r;t=d(t)}}function m(e,t){return g("get",e,t)}function v(e,t){return g("set",e,t)}var y=Object.create;function b(e,t){u(e,t),e.prototype=y(t.prototype,{constructor:{value:e,writable:!0}})}function x(e){for(var t=1;t<arguments.length;++t){var n=arguments[t];for(var i in n)c(n,i)&&(e[i]=n[i])}return e}var w=Object.assign||x,_=[],S=y(null);try{if(!window.Object)throw 0;_=l(S=window).filter((function(e){return"webkitStorageInfo"!==e}))}catch(e){try{if(!n.g.Object)throw 0;_=l(S=n.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=y({}),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(y(((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 n=0;return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}var N="0.4.8",M={RES:void 0},O={RES:void 0},L=T("continue"),D=T("break"),R=T("super"),$=T("supercall"),V=T("noctor"),B=T("clsctor"),F=T("newtarget"),j=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=y(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 n in this.context){var i=this.context[n];t[i.kind](n,i.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 n=this;n.parent&&!n.isolated;)n=n.parent;var i=n.context[e];if(i){if("var"!==i.kind)throw new SyntaxError("Identifier '"+e+"' has already been declared");t!==j&&i.set(t)}else n.context[e]=new H("var",t===j?void 0:t);if(!n.parent){var r=n.find("window").get();t!==j&&s(r,e,{value:t,writable:!0,enumerable:!0})}},e.prototype.let=function(e,t){var n=this.context[e];if(n&&n.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 n=this.context[e];if(n&&n.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 n=this.context[e];if(n&&"var"!==n.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 n,i,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(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=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++,i=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],i=0}finally{n=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],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function Y(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,s=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.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 X(e,t,n){void 0===n&&(n={});var i=n.getVar,r=void 0!==i&&i,s=n.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 K=Object.freeze({__proto__:null,Identifier:X});function Q(e,t){return e.value}var Z=Object.freeze({__proto__:null,Literal:Q});function ee(e,t){var n=t.find($);if(n&&!n.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 n=[],i=0;i<e.elements.length;i++){var r=e.elements[i];"SpreadElement"===r.type?n=n.concat(we(r,t)):n.push(Xe(r,t))}return n}function ne(e,t){for(var n={},i=0;i<e.properties.length;i++){var r=e.properties[i];if("SpreadElement"===r.type)w(n,we(r,t));else{var o=void 0,c=r.key;o=r.computed?Xe(c,t):"Identifier"===c.type?c.name:""+Q(c);var l=Xe(r.value,t),h=r.kind;if("init"===h)n[o]=l;else if("get"===h){var u=a(n,o);s(n,o,{get:l,set:u&&u.set,enumerable:!0,configurable:!0})}else u=a(n,o),s(n,o,{get:u&&u.get,set:l,enumerable:!0,configurable:!0})}}return n}function ie(e,t){if(e.id&&e.id.name){var n=new z(t),i=wn(e,n);return n.const(e.id.name,i),i}return wn(e,t)}function re(e,t){var n=e.argument;switch(e.operator){case"+":return+Xe(n,t);case"-":return-Xe(n,t);case"!":return!Xe(n,t);case"~":return~Xe(n,t);case"void":return void Xe(n,t);case"typeof":return"Identifier"===n.type?typeof X(n,t,{throwErr:!1}):typeof Xe(n,t);case"delete":if("MemberExpression"===n.type)return le(n,t,{getVar:!0}).del();if("Identifier"===n.type)throw new SyntaxError("Delete of an unqualified identifier in strict mode");return Xe(n,t),!0;default:throw new SyntaxError("Unexpected token "+e.operator)}}function se(e,t){var n,i=e.argument;if("Identifier"===i.type)n=X(i,t,{getVar:!0});else{if("MemberExpression"!==i.type)throw new SyntaxError("Unexpected token");n=le(i,t,{getVar:!0})}var r=n.get();if("++"===e.operator)return n.set(r+1),e.prefix?n.get():r;if("--"===e.operator)return n.set(r-1),e.prefix?n.get():r;throw new SyntaxError("Unexpected token "+e.operator)}function ae(e,t){var n=Xe(e.left,t),i=Xe(e.right,t);switch(e.operator){case"==":return n==i;case"!=":return n!=i;case"===":return n===i;case"!==":return n!==i;case"<":return n<i;case"<=":return n<=i;case">":return n>i;case">=":return n>=i;case"<<":return n<<i;case">>":return n>>i;case">>>":return n>>>i;case"+":return n+i;case"-":return n-i;case"*":return n*i;case"**":return Math.pow(n,i);case"/":return n/i;case"%":return n%i;case"|":return n|i;case"^":return n^i;case"&":return n&i;case"in":return n in i;case"instanceof":return n instanceof i;default:throw new SyntaxError("Unexpected token "+e.operator)}}function oe(e,t){var n,i=Xe(e.right,t),r=e.left;if("Identifier"===r.type){if(!(n=X(r,t,{getVar:!0,throwErr:!1}))){var s=t.global().find("window").get();n=new q(s,r.name)}}else{if("MemberExpression"!==r.type)return xn(r,t,{feed:i});n=le(r,t,{getVar:!0})}switch(e.operator){case"=":return n.set(i),n.get();case"+=":return n.set(n.get()+i),n.get();case"-=":return n.set(n.get()-i),n.get();case"*=":return n.set(n.get()*i),n.get();case"/=":return n.set(n.get()/i),n.get();case"%=":return n.set(n.get()%i),n.get();case"**=":return n.set(Math.pow(n.get(),i)),n.get();case"<<=":return n.set(n.get()<<i),n.get();case">>=":return n.set(n.get()>>i),n.get();case">>>=":return n.set(n.get()>>>i),n.get();case"|=":return n.set(n.get()|i),n.get();case"^=":return n.set(n.get()^i),n.get();case"&=":return n.set(n.get()&i),n.get();default:throw new SyntaxError("Unexpected token "+e.operator)}}function ce(e,t){switch(e.operator){case"||":return Xe(e.left,t)||Xe(e.right,t);case"&&":return Xe(e.left,t)&&Xe(e.right,t);default:throw new SyntaxError("Unexpected token "+e.operator)}}function le(e,t,n){void 0===n&&(n={});var i,r,a=n.getObj,o=void 0!==a&&a,c=n.getVar,l=void 0!==c&&c;if(i="Super"===e.object.type?xe(e.object,t,{getProto:!0}):Xe(e.object,t),o)return i;if(r=e.computed?Xe(e.property,t):e.property.name,l){var h=v(i,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(i,r)}var d=m(i,r);return"Super"===e.object.type&&d?(u=t.find("this").get(),d.call(u)):i[r]}function he(e,t){return Xe(e.test,t)?Xe(e.consequent,t):Xe(e.alternate,t)}function ue(e,t){var n,i;if("MemberExpression"===e.callee.type){i=le(e.callee,t,{getObj:!0});var r=void 0;if(r=e.callee.computed?Xe(e.callee.property,t):e.callee.property.name,"Super"===e.callee.object.type){var s=t.find("this").get();n=i[r].bind(s)}else n=i[r];if("function"!=typeof n)throw new TypeError(r+" is not a function");if(n[B])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'")}else if(i=t.find("this").get(),"function"!=typeof(n=Xe(e.callee,t))||"Super"!==e.callee.type&&n[B]){var a;if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(n)}catch(e){a=""+n}throw"function"!=typeof n?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(Xe(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 i&&i[C]&&-1!==n.toString().indexOf("[native code]")?n.apply(i[C],o):n.apply(i,o)}function pe(e,t){var n=Xe(e.callee,t);if("function"!=typeof n){var i;if("Identifier"===e.callee.type)i=e.callee.name;else try{i=JSON.stringify(n)}catch(e){i=""+n}throw new TypeError(i+" is not a constructor")}if(n[V])throw new TypeError((n.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(Xe(a,t))}return new(n.bind.apply(n,J([void 0],r)))}function de(e,t){return t.find(F).get()}function fe(e,t){for(var n,i=0;i<e.expressions.length;i++)n=Xe(e.expressions[i],t);return n}function ge(e,t){return wn(e,t)}function me(e,t){for(var n,i,r=e.quasis.slice(),s=e.expressions.slice(),a="";n=r.shift();)a+=ye(n),(i=s.shift())&&(a+=Xe(i,t));return a}function ve(e,t){var n=Xe(e.tag,t),i=e.quasi.quasis,a=i.map((function(e){return e.value.cooked})),o=i.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(Xe(c[h],t));return n.apply(void 0,J([r(a)],l))}function ye(e,t){return e.value.raw}function be(e,t){if(e.id&&e.id.name){var n=new z(t),i=_n(e,n);return n.const(e.id.name,i),i}return _n(e,t)}function xe(e,t,n){void 0===n&&(n={});var i=n.getProto,r=void 0!==i&&i,s=t.find(R).get();return r?s.prototype:s}function we(e,t){return Xe(e.argument,t)}var _e=Object.freeze({__proto__:null,ThisExpression:ee,ArrayExpression:te,ObjectExpression:ne,FunctionExpression:ie,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:ve,TemplateElement:ye,ClassExpression:be,Super:xe,SpreadElement:we});function Se(e,t){Xe(e.expression,t)}function ke(e,t,n){void 0===n&&(n={});var i=n.invasived,r=void 0!==i&&i,s=n.hoisted,a=void 0!==s&&s,o=r?t:new z(t);a||yn(e,o,{onlyBlock:!0});for(var c=0;c<e.body.length;c++){var l=Xe(e.body[c],o);if(l===D||l===L||l===O)return l}}function Ee(){}function Ae(){}function Ce(e,t){return O.RES=e.argument?Xe(e.argument,t):void 0,O}function Ie(){return D}function Te(){return L}function Pe(e,t){return Xe(e.test,t)?Xe(e.consequent,t):Xe(e.alternate,t)}function Ne(e,t){for(var n=Xe(e.discriminant,t),i=!1,r=0;r<e.cases.length;r++){var s=e.cases[r];if(i||s.test&&Xe(s.test,t)!==n||(i=!0),i){var a=Me(s,t);if(a===D)break;if(a===L||a===O)return a}}}function Me(e,t){for(var n=0;n<e.consequent.length;n++){var i=Xe(e.consequent[n],t);if(i===D||i===L||i===O)return i}}function Oe(e,t){throw Xe(e.argument,t)}function Le(e,t){try{return ke(e.block,t)}catch(s){if(e.handler){var n=new z(t),i=e.handler.param;if(i)if("Identifier"===i.type){var r=i.name;n.var(r,s)}else xn(i,t,{feed:s});return De(e.handler,n)}throw s}finally{if(e.finalizer){var s=ke(e.finalizer,t);if(s===D||s===L||s===O)return s}}}function De(e,t){return ke(e.body,t,{invasived:!0})}function Re(e,t){for(;Xe(e.test,t);){var n=Xe(e.body,t);if(n===D)break;if(n!==L&&n===O)return n}}function $e(e,t){do{var n=Xe(e.body,t);if(n===D)break;if(n!==L&&n===O)return n}while(Xe(e.test,t))}function Ve(e,t){var n=new z(t);for(Xe(e.init,n);!e.test||Xe(e.test,n);Xe(e.update,n)){var i=new z(n),r=void 0;if((r="BlockStatement"===e.body.type?ke(e.body,i,{invasived:!0}):Xe(e.body,i))===D)break;if(r!==L&&r===O)return r}}function Be(e,t){for(var n in Xe(e.right,t)){var i=Sn(e,t,{value:n});if(i===D)break;if(i!==L&&i===O)return i}}function Fe(e,t){var n,i,r=Xe(e.right,t);try{for(var s=W(r),a=s.next();!a.done;a=s.next()){var o=Sn(e,t,{value:a.value});if(o===D)break;if(o!==L&&o===O)return o}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}}var je=Object.freeze({__proto__:null,ExpressionStatement:Se,BlockStatement:ke,EmptyStatement:Ee,DebuggerStatement:Ae,ReturnStatement:Ce,BreakStatement:Ie,ContinueStatement:Te,IfStatement:Pe,SwitchStatement:Ne,SwitchCase:Me,ThrowStatement:Oe,TryStatement:Le,CatchClause:De,WhileStatement:Re,DoWhileStatement:$e,ForStatement:Ve,ForInStatement:Be,ForOfStatement:Fe});function Ue(e,t,n){void 0===n&&(n={});for(var i=n.kind,r=void 0===i?"var":i,s=n.hoist,a=void 0!==s&&s,o=n.onlyBlock,c=void 0!==o&&o,l=n.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?j:void 0):xn(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?Xe(d.key,t):d.key.name,u.push(g),"Identifier"===(f=d.value).type?t[r](f.name,h[g]):xn(f,t,{kind:r,feed:h[g]})}else{for(var m=w({},h),v=0;v<u.length;v++)delete m[u[v]];qe(d,t,{kind:r,feed:m})}}}function He(e,t,n){void 0===n&&(n={});for(var i=n.kind,r=n.hoist,s=void 0!==r&&r,a=n.onlyBlock,o=void 0!==a&&a,c=n.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"===i)&&("Identifier"===p.type?t[i](p.name,o?U:"var"===i?j:void 0):xn(p,t,{kind:i,hoist:s,onlyBlock:o}));else if("Identifier"===p.type)if(i)t[i](p.name,l[u]);else{var d=X(p,t,{getVar:!0});d.set(l[u]),h.push(d.get())}else"RestElement"===p.type?qe(p,t,{kind:i,feed:l.slice(u)}):xn(p,t,{kind:i,feed:l[u]})}if(h.length)return h}function qe(e,t,n){void 0===n&&(n={});var i=n.kind,r=n.hoist,s=void 0!==r&&r,a=n.onlyBlock,o=void 0!==a&&a,c=n.feed,l=void 0===c?[]:c,h=e.argument;s?(o||"var"===i)&&("Identifier"===h.type?t[i](h.name,o?U:"var"===i?j:void 0):xn(h,t,{kind:i,hoist:s,onlyBlock:o})):"Identifier"===h.type?i?t[i](h.name,l):X(h,t,{getVar:!0}).set(l):xn(h,t,{kind:i,feed:l})}function ze(e,t,n){void 0===n&&(n={});var i=n.kind,r=void 0===i?"var":i,s=n.hoist,a=void 0!==s&&s,o=n.onlyBlock,c=void 0!==o&&o,l=n.feed,h=void 0===l?Xe(e.right,t):l,u=e.left;a?(c||"var"===r)&&("Identifier"===u.type?t[r](u.name,c?U:"var"===r?j:void 0):xn(u,t,{kind:r,hoist:a,onlyBlock:c})):"Identifier"===u.type?t[r](u.name,h):xn(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 n=0;n<e.body.length;n++)Xe(e.body[n],t)}var Ye,Je=Object.freeze({__proto__:null,Program:We});function Xe(e,n){if(e){Ye||(Ye=w({},t,_e,K,je,Z,Ge,Je));var i=Ye[e.type];if(i)return i(e,n);throw new Error(e.type+" isn't implemented")}}function Ke(e,t){t.func(e.id.name,wn(e,t))}function Qe(e,t,n){void 0===n&&(n={});for(var i=0;i<e.declarations.length;i++)Ze(e.declarations[i],t,w({kind:e.kind},n))}function Ze(e,t,n){void 0===n&&(n={});var i=n.kind,r=void 0===i?"var":i,a=n.hoist,o=void 0!==a&&a,c=n.onlyBlock,l=void 0!==c&&c,h=n.feed;if(o)(l||"var"===r)&&("Identifier"===e.id.type?t[r](e.id.name,l?U:"var"===r?j:void 0):xn(e.id,t,{kind:r,hoist:o,onlyBlock:l}));else{var u="feed"in n,p=u?h:Xe(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,j),e.init&&-1!==["ClassExpression","FunctionExpression","ArrowFunctionExpression"].indexOf(e.init.type)&&!p.name&&s(p,"name",{value:d,configurable:!0})}else xn(e.id,t,{kind:r,feed:p})}}function et(e,t){t.func(e.id.name,_n(e,t))}function tt(e,t,n){void 0===n&&(n={});for(var i=n.klass,r=n.superClass,s=0;s<e.body.length;s++)nt(e.body[s],t,{klass:i,superClass:r})}function nt(e,t,n){void 0===n&&(n={});var i,r=n.klass,o=n.superClass;if(e.computed)i=Xe(e.key,t);else{if("Identifier"!==e.key.type)throw new SyntaxError("Unexpected token");i=e.key.name}var c=e.static?r:r.prototype,l=wn(e.value,t,{superClass:o});switch(e.kind){case"constructor":break;case"method":s(c,i,{value:l,writable:!0,configurable:!0});break;case"get":var h=a(c,i);s(c,i,{get:l,set:h&&h.set,configurable:!0});break;case"set":h=a(c,i),s(c,i,{get:h&&h.get,set:l,configurable:!0});break;default:throw new SyntaxError("Unexpected token")}}function it(e,t,n){var i,r,s,a,o,c;return void 0===n&&(n={}),G(this,(function(l){if(i=n.getVar,r=void 0!==i&&i,s=n.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:it});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 n;return G(this,(function(e){if((n=t.find($))&&!n.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 n,i,r,s,a,o,c;return G(this,(function(l){switch(l.label){case 0:n=[],i=0,l.label=1;case 1:return i<e.elements.length?"SpreadElement"!==(r=e.elements[i]).type?[3,3]:(a=(s=n).concat,[5,W(It(r,t))]):[3,6];case 2:return n=a.apply(s,[l.sent()]),[3,5];case 3:return c=(o=n).push,[5,W(rn(r,t))];case 4:c.apply(o,[l.sent()]),l.label=5;case 5:return i++,[3,1];case 6:return[2,n]}}))}function lt(e,t){var n,i,r,o,c,l,h,u,p,d,f;return G(this,(function(g){switch(g.label){case 0:n={},i=0,g.label=1;case 1:return i<e.properties.length?"SpreadElement"!==(r=e.properties[i]).type?[3,3]:(o=w,c=[n],[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(rn(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(rn(r.value,t))];case 9:p=g.sent(),"init"===(d=r.kind)?n[l]=p:"get"===d?(f=a(n,l),s(n,l,{get:p,set:f&&f.set,enumerable:!0,configurable:!0})):(f=a(n,l),s(n,l,{get:f&&f.get,set:p,enumerable:!0,configurable:!0})),g.label=10;case 10:return i++,[3,1];case 11:return[2,n]}}))}function ht(e,t){var n,i;return G(this,(function(r){return e.id&&e.id.name?(n=new z(t),i=gn(e,n),n.const(e.id.name,i),[2,i]):[2,gn(e,t)]}))}function ut(e,t){var n;return G(this,(function(i){switch(i.label){case 0:switch(n=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(rn(n,t))];case 2:return[2,+i.sent()];case 4:return[2,-i.sent()];case 6:return[2,!i.sent()];case 8:return[2,~i.sent()];case 10:return[2,void i.sent()];case 11:return"Identifier"!==n.type?[3,13]:[5,W(it(n,t,{throwErr:!1}))];case 12:case 14:return[2,typeof i.sent()];case 15:return"MemberExpression"!==n.type?[3,17]:[5,W(mt(n,t,{getVar:!0}))];case 16:return[2,i.sent().del()];case 17:if("Identifier"!==n.type)return[3,18];throw new SyntaxError("Delete of an unqualified identifier in strict mode");case 19:return i.sent(),[2,!0];case 20:throw new SyntaxError("Unexpected token "+e.operator)}}))}function pt(e,t){var n,i,r;return G(this,(function(s){switch(s.label){case 0:return"Identifier"!==(n=e.argument).type?[3,2]:[5,W(it(n,t,{getVar:!0}))];case 1:case 3:return i=s.sent(),[3,5];case 2:return"MemberExpression"!==n.type?[3,4]:[5,W(mt(n,t,{getVar:!0}))];case 4:throw new SyntaxError("Unexpected token");case 5:if(r=i.get(),"++"===e.operator)return i.set(r+1),[2,e.prefix?i.get():r];if("--"===e.operator)return i.set(r-1),[2,e.prefix?i.get():r];throw new SyntaxError("Unexpected token "+e.operator)}}))}function dt(e,t){var n,i;return G(this,(function(r){switch(r.label){case 0:return[5,W(rn(e.left,t))];case 1:return n=r.sent(),[5,W(rn(e.right,t))];case 2:switch(i=r.sent(),e.operator){case"==":return[2,n==i];case"!=":return[2,n!=i];case"===":return[2,n===i];case"!==":return[2,n!==i];case"<":return[2,n<i];case"<=":return[2,n<=i];case">":return[2,n>i];case">=":return[2,n>=i];case"<<":return[2,n<<i];case">>":return[2,n>>i];case">>>":return[2,n>>>i];case"+":return[2,n+i];case"-":return[2,n-i];case"*":return[2,n*i];case"**":return[2,Math.pow(n,i)];case"/":return[2,n/i];case"%":return[2,n%i];case"|":return[2,n|i];case"^":return[2,n^i];case"&":return[2,n&i];case"in":return[2,n in i];case"instanceof":return[2,n instanceof i];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))}function ft(e,t){var n,i,r,s;return G(this,(function(a){switch(a.label){case 0:return[5,W(rn(e.right,t))];case 1:return n=a.sent(),"Identifier"!==(i=e.left).type?[3,3]:[5,W(it(i,t,{getVar:!0,throwErr:!1}))];case 2:return(r=a.sent())||(s=t.global().find("window").get(),r=new q(s,i.name)),[3,7];case 3:return"MemberExpression"!==i.type?[3,5]:[5,W(mt(i,t,{getVar:!0}))];case 4:return r=a.sent(),[3,7];case 5:return[5,W(fn(i,t,{feed:n}))];case 6:return[2,a.sent()];case 7:switch(e.operator){case"=":return r.set(n),[2,r.get()];case"+=":return r.set(r.get()+n),[2,r.get()];case"-=":return r.set(r.get()-n),[2,r.get()];case"*=":return r.set(r.get()*n),[2,r.get()];case"/=":return r.set(r.get()/n),[2,r.get()];case"%=":return r.set(r.get()%n),[2,r.get()];case"**=":return r.set(Math.pow(r.get(),n)),[2,r.get()];case"<<=":return r.set(r.get()<<n),[2,r.get()];case">>=":return r.set(r.get()>>n),[2,r.get()];case">>>=":return r.set(r.get()>>>n),[2,r.get()];case"|=":return r.set(r.get()|n),[2,r.get()];case"^=":return r.set(r.get()^n),[2,r.get()];case"&=":return r.set(r.get()&n),[2,r.get()];default:throw new SyntaxError("Unexpected token "+e.operator)}}}))}function gt(e,t){var n,i;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(rn(e.left,t))];case 2:return(n=r.sent())?[3,4]:[5,W(rn(e.right,t))];case 3:n=r.sent(),r.label=4;case 4:return[2,n];case 5:return[5,W(rn(e.left,t))];case 6:return(i=r.sent())?[5,W(rn(e.right,t))]:[3,8];case 7:i=r.sent(),r.label=8;case 8:return[2,i];case 9:throw new SyntaxError("Unexpected token "+e.operator)}}))}function mt(e,t,n){var i,r,a,o,c,l,h,u,p,d;return void 0===n&&(n={}),G(this,(function(f){switch(f.label){case 0:return i=n.getObj,r=void 0!==i&&i,a=n.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(rn(e.object,t))];case 3:c=f.sent(),f.label=4;case 4:return r?[2,c]:e.computed?[5,W(rn(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=v(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 vt(e,t){var n;return G(this,(function(i){switch(i.label){case 0:return[5,W(rn(e.test,t))];case 1:return i.sent()?[5,W(rn(e.consequent,t))]:[3,3];case 2:return n=i.sent(),[3,5];case 3:return[5,W(rn(e.alternate,t))];case 4:n=i.sent(),i.label=5;case 5:return[2,n]}}))}function yt(e,t){var n,i,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 i=f.sent(),r=void 0,e.callee.computed?[5,W(rn(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(),n=i[r].bind(s)):n=i[r],"function"!=typeof n)throw new TypeError(r+" is not a function");if(n[B])throw new TypeError("Class constructor "+r+" cannot be invoked without 'new'");return[3,7];case 5:return i=t.find("this").get(),[5,W(rn(e.callee,t))];case 6:if("function"!=typeof(n=f.sent())||"Super"!==e.callee.type&&n[B]){if("Identifier"===e.callee.type)a=e.callee.name;else try{a=JSON.stringify(n)}catch(e){a=""+n}throw"function"!=typeof n?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(rn(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 i&&i[C]&&-1!==n.toString().indexOf("[native code]")?[2,n.apply(i[C],o)]:[2,n.apply(i,o)]}}))}function bt(e,t){var n,i,r,s,a,o,c,l,h;return G(this,(function(u){switch(u.label){case 0:return[5,W(rn(e.callee,t))];case 1:if("function"!=typeof(n=u.sent())){if("Identifier"===e.callee.type)i=e.callee.name;else try{i=JSON.stringify(n)}catch(e){i=""+n}throw new TypeError(i+" is not a constructor")}if(n[V])throw new TypeError((n.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(rn(a,t))];case 5:h.apply(l,[u.sent()]),u.label=6;case 6:return s++,[3,2];case 7:return[2,new(n.bind.apply(n,J([void 0],r)))]}}))}function xt(e,t){return G(this,(function(e){return[2,t.find(F).get()]}))}function wt(e,t){var n,i;return G(this,(function(r){switch(r.label){case 0:i=0,r.label=1;case 1:return i<e.expressions.length?[5,W(rn(e.expressions[i],t))]:[3,4];case 2:n=r.sent(),r.label=3;case 3:return i++,[3,1];case 4:return[2,n]}}))}function _t(e,t){return G(this,(function(n){return[2,gn(e,t)]}))}function St(e,t){var n,i,r,s,a,o,c;return G(this,(function(l){switch(l.label){case 0:n=e.quasis.slice(),i=e.expressions.slice(),r="",l.label=1;case 1:return(s=n.shift())?(o=r,[5,W(Et(s))]):[3,5];case 2:return r=o+l.sent(),(a=i.shift())?(c=r,[5,W(rn(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 n,i,a,o,c,l,h,u,p;return G(this,(function(d){switch(d.label){case 0:return[5,W(rn(e.tag,t))];case 1:if(n=d.sent(),i=e.quasi.quasis,a=i.map((function(e){return e.value.cooked})),o=i.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(rn(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,n.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 n,i;return G(this,(function(r){switch(r.label){case 0:return e.id&&e.id.name?(n=new z(t),[5,W(mn(e,n))]):[3,2];case 1:return i=r.sent(),n.const(e.id.name,i),[2,i];case 2:return[5,W(mn(e,t))];case 3:return[2,r.sent()]}}))}function Ct(e,t,n){var i,r,s;return void 0===n&&(n={}),G(this,(function(e){return i=n.getProto,r=void 0!==i&&i,s=t.find(R).get(),[2,r?s.prototype:s]}))}function It(e,t){return G(this,(function(n){switch(n.label){case 0:return[5,W(rn(e.argument,t))];case 1:return[2,n.sent()]}}))}function Tt(e,t){var n,i;return G(this,(function(r){switch(r.label){case 0:return[5,W(rn(e.argument,t))];case 1:return n=r.sent(),e.delegate?[5,W(n)]:[3,3];case 2:return i=r.sent(),[3,5];case 3:return[4,n];case 4:i=r.sent(),r.label=5;case 5:return[2,i]}}))}function Pt(e,t){var n;return G(this,(function(i){switch(i.label){case 0:return n=M,[5,W(rn(e.argument,t))];case 1:return n.RES=i.sent(),[4,M];case 2:return[2,i.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:vt,CallExpression:yt,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 Mt(e,t){return G(this,(function(n){switch(n.label){case 0:return[5,W(rn(e.expression,t))];case 1:return n.sent(),[2]}}))}function Ot(e,t,n){var i,r,s,a,o,c,l;return void 0===n&&(n={}),G(this,(function(h){switch(h.label){case 0:return i=n.invasived,r=void 0!==i&&i,s=n.hoisted,a=void 0!==s&&s,o=r?t:new z(t),a?[3,2]:[5,W(pn(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(rn(e.body[c],o))]:[3,6];case 4:if((l=h.sent())===D||l===L||l===O)return[2,l];h.label=5;case 5:return c++,[3,3];case 6:return[2]}}))}function Lt(){return G(this,(function(e){return[2]}))}function Dt(){return G(this,(function(e){return[2]}))}function Rt(e,t){var n,i;return G(this,(function(r){switch(r.label){case 0:return n=O,e.argument?[5,W(rn(e.argument,t))]:[3,2];case 1:return i=r.sent(),[3,3];case 2:i=void 0,r.label=3;case 3:return n.RES=i,[2,O]}}))}function $t(){return G(this,(function(e){return[2,D]}))}function Vt(){return G(this,(function(e){return[2,L]}))}function Bt(e,t){return G(this,(function(n){switch(n.label){case 0:return[5,W(rn(e.test,t))];case 1:return n.sent()?[5,W(rn(e.consequent,t))]:[3,3];case 2:case 4:return[2,n.sent()];case 3:return[5,W(rn(e.alternate,t))]}}))}function Ft(e,t){var n,i,r,s,a,o,c;return G(this,(function(l){switch(l.label){case 0:return[5,W(rn(e.discriminant,t))];case 1:n=l.sent(),i=!1,r=0,l.label=2;case 2:return r<e.cases.length?(s=e.cases[r],(a=!i)?(o=!s.test)?[3,4]:[5,W(rn(s.test,t))]:[3,5]):[3,8];case 3:o=l.sent()===n,l.label=4;case 4:a=o,l.label=5;case 5:return a&&(i=!0),i?[5,W(jt(s,t))]:[3,7];case 6:if((c=l.sent())===D)return[3,8];if(c===L||c===O)return[2,c];l.label=7;case 7:return r++,[3,2];case 8:return[2]}}))}function jt(e,t){var n,i;return G(this,(function(r){switch(r.label){case 0:n=0,r.label=1;case 1:return n<e.consequent.length?[5,W(rn(e.consequent[n],t))]:[3,4];case 2:if((i=r.sent())===D||i===L||i===O)return[2,i];r.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}function Ut(e,t){return G(this,(function(n){switch(n.label){case 0:return[5,W(rn(e.argument,t))];case 1:throw n.sent()}}))}function Ht(e,t){var n,i,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 n=o.sent(),e.handler?(i=new z(t),(r=e.handler.param)?"Identifier"!==r.type?[3,3]:(s=r.name,i.var(s,n),[3,5]):[3,5]):[3,7];case 3:return[5,W(fn(r,t,{feed:n}))];case 4:o.sent(),o.label=5;case 5:return[5,W(qt(e.handler,i))];case 6:return[2,o.sent()];case 7:throw n;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===L||a===O)return[2,a];o.label=11;case 11:return[7];case 12:return[2]}}))}function qt(e,t){return G(this,(function(n){switch(n.label){case 0:return[5,W(Ot(e.body,t,{invasived:!0}))];case 1:return[2,n.sent()]}}))}function zt(e,t){var n;return G(this,(function(i){switch(i.label){case 0:return[5,W(rn(e.test,t))];case 1:return i.sent()?[5,W(rn(e.body,t))]:[3,3];case 2:return(n=i.sent())===D?[3,3]:n===L?[3,0]:n===O?[2,n]:[3,0];case 3:return[2]}}))}function Gt(e,t){var n;return G(this,(function(i){switch(i.label){case 0:return[5,W(rn(e.body,t))];case 1:if((n=i.sent())===D)return[3,4];if(n===L)return[3,2];if(n===O)return[2,n];i.label=2;case 2:return[5,W(rn(e.test,t))];case 3:if(i.sent())return[3,0];i.label=4;case 4:return[2]}}))}function Wt(e,t){var n,i,r,s;return G(this,(function(a){switch(a.label){case 0:return n=new z(t),[5,W(rn(e.init,n))];case 1:a.sent(),a.label=2;case 2:return e.test?[5,W(rn(e.test,n))]:[3,4];case 3:return i=a.sent(),[3,5];case 4:i=!0,a.label=5;case 5:return i?(r=new z(n),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(rn(e.body,r))];case 8:s=a.sent(),a.label=9;case 9:if(s===D)return[3,12];if(s===L)return[3,10];if(s===O)return[2,s];a.label=10;case 10:return[5,W(rn(e.update,n))];case 11:return a.sent(),[3,2];case 12:return[2]}}))}function Yt(e,t){var n,i,r,s,a;return G(this,(function(o){switch(o.label){case 0:return n=[],[5,W(rn(e.right,t))];case 1:for(i in o.sent())n.push(i);r=0,o.label=2;case 2:return r<n.length?(s=n[r],[5,W(vn(e,t,{value:s}))]):[3,5];case 3:if((a=o.sent())===D)return[3,5];if(a===L)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 n,i,r,s,a,o,c,l,h,u;return G(this,(function(p){switch(p.label){case 0:return[5,W(rn(e.right,t))];case 1:return n=p.sent(),e.await?(i=P(n),r=void 0,M.RES=i.next(),[4,M]):[3,8];case 2:r=p.sent(),p.label=3;case 3:return r.done?[3,7]:[5,W(vn(e,t,{value:r.value}))];case 4:if((c=p.sent())===D)return[3,7];if(c===L)return[3,5];if(c===O)return[2,c];p.label=5;case 5:return M.RES=i.next(),[4,M];case 6:return r=p.sent(),[3,3];case 7:return[3,15];case 8:p.trys.push([8,13,14,15]),s=W(n),a=s.next(),p.label=9;case 9:return a.done?[3,12]:(o=a.value,[5,W(vn(e,t,{value:o}))]);case 10:if((c=p.sent())===D)return[3,12];if(c===L)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 Xt=Object.freeze({__proto__:null,ExpressionStatement:Mt,BlockStatement:Ot,EmptyStatement:Lt,DebuggerStatement:Dt,ReturnStatement:Rt,BreakStatement:$t,ContinueStatement:Vt,IfStatement:Bt,SwitchStatement:Ft,SwitchCase:jt,ThrowStatement:Ut,TryStatement:Ht,CatchClause:qt,WhileStatement:zt,DoWhileStatement:Gt,ForStatement:Wt,ForInStatement:Yt,ForOfStatement:Jt});function Kt(e,t,n){var i,r,s,a,o,c,l,h,u,p,d,f,g,m,v;return void 0===n&&(n={}),G(this,(function(y){switch(y.label){case 0:i=n.kind,r=void 0===i?"var":i,s=n.hoist,a=void 0!==s&&s,o=n.onlyBlock,c=void 0!==o&&o,l=n.feed,h=void 0===l?{}:l,u=[],p=0,y.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?j:void 0),[3,4]):[3,7]:[3,8]):[3,18];case 2:return[5,W(fn(g,t,{kind:r,hoist:a,onlyBlock:c}))];case 3:y.sent(),y.label=4;case 4:return[3,7];case 5:return[5,W(Zt(d,t,{kind:r,hoist:a,onlyBlock:c}))];case 6:y.sent(),y.label=7;case 7:return[3,17];case 8:return"Property"!==d.type?[3,15]:(f=void 0,d.computed?[5,W(rn(d.key,t))]:[3,10]);case 9:return f=y.sent(),[3,11];case 10:f=d.key.name,y.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(fn(g,t,{kind:r,feed:h[f]}))];case 13:y.sent(),y.label=14;case 14:return[3,17];case 15:for(m=w({},h),v=0;v<u.length;v++)delete m[u[v]];return[5,W(Zt(d,t,{kind:r,feed:m}))];case 16:y.sent(),y.label=17;case 17:return p++,[3,1];case 18:return[2]}}))}function Qt(e,t,n){var i,r,s,a,o,c,l,h,u,p,d;return void 0===n&&(n={}),G(this,(function(f){switch(f.label){case 0:i=n.kind,r=n.hoist,s=void 0!==r&&r,a=n.onlyBlock,o=void 0!==a&&a,c=n.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"===i?"Identifier"!==p.type?[3,2]:(t[i](p.name,o?U:"var"===i?j:void 0),[3,4]):[3,4]:[3,5]:[3,13]:[3,14];case 2:return[5,W(fn(p,t,{kind:i,hoist:s,onlyBlock:o}))];case 3:f.sent(),f.label=4;case 4:return[3,13];case 5:return"Identifier"!==p.type?[3,9]:i?(t[i](p.name,l[u]),[3,8]):[3,6];case 6:return[5,W(it(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(Zt(p,t,{kind:i,feed:l.slice(u)}))];case 10:return f.sent(),[3,13];case 11:return[5,W(fn(p,t,{kind:i,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 Zt(e,t,n){var i,r,s,a,o,c,l,h;return void 0===n&&(n={}),G(this,(function(u){switch(u.label){case 0:return i=n.kind,r=n.hoist,s=void 0!==r&&r,a=n.onlyBlock,o=void 0!==a&&a,c=n.feed,l=void 0===c?[]:c,h=e.argument,s?o||"var"===i?"Identifier"!==h.type?[3,1]:(t[i](h.name,o?U:"var"===i?j:void 0),[3,3]):[3,3]:[3,4];case 1:return[5,W(fn(h,t,{kind:i,hoist:s,onlyBlock:o}))];case 2:u.sent(),u.label=3;case 3:return[3,10];case 4:return"Identifier"!==h.type?[3,8]:i?(t[i](h.name,l),[3,7]):[3,5];case 5:return[5,W(it(h,t,{getVar:!0}))];case 6:u.sent().set(l),u.label=7;case 7:return[3,10];case 8:return[5,W(fn(h,t,{kind:i,feed:l}))];case 9:u.sent(),u.label=10;case 10:return[2]}}))}function en(e,t,n){var i,r,s,a,o,c,l,h,u,p;return void 0===n&&(n={}),G(this,(function(d){switch(d.label){case 0:return i=n.kind,r=void 0===i?"var":i,s=n.hoist,a=void 0!==s&&s,o=n.onlyBlock,c=void 0!==o&&o,void 0!==(l=n.feed)?[3,2]:[5,W(rn(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?j:void 0),[3,6]):[3,6]:[3,7];case 4:return[5,W(fn(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(fn(p,t,{kind:r,feed:h}))];case 9:d.sent(),d.label=10;case 10:return[2]}}))}var tn,nn=Object.freeze({__proto__:null,ObjectPattern:Kt,ArrayPattern:Qt,RestElement:Zt,AssignmentPattern:en});function rn(e,t){var n;return G(this,(function(r){switch(r.label){case 0:return e?(tn||(tn=w({},i,Nt,rt,Xt,at,nn)),(n=tn[e.type])?[5,W(n(e,t))]:[3,2]):[2];case 1:return[2,r.sent()];case 2:throw new Error(e.type+" isn't implemented")}}))}function sn(e,t){return G(this,(function(n){return t.func(e.id.name,gn(e,t)),[2]}))}function an(e,t,n){var i;return void 0===n&&(n={}),G(this,(function(r){switch(r.label){case 0:i=0,r.label=1;case 1:return i<e.declarations.length?[5,W(on(e.declarations[i],t,w({kind:e.kind},n)))]:[3,4];case 2:r.sent(),r.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}function on(e,t,n){var i,r,a,o,c,l,h,u,p,d,f;return void 0===n&&(n={}),G(this,(function(g){switch(g.label){case 0:return i=n.kind,r=void 0===i?"var":i,a=n.hoist,o=void 0!==a&&a,c=n.onlyBlock,l=void 0!==c&&c,h=n.feed,o?l||"var"===r?"Identifier"!==e.id.type?[3,1]:(t[r](e.id.name,l?U:"var"===r?j:void 0),[3,3]):[3,3]:[3,4];case 1:return[5,W(fn(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 n)?(d=h,[3,7]):[3,5];case 5:return[5,W(rn(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,j),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(fn(e.id,t,{kind:r,feed:p}))];case 9:g.sent(),g.label=10;case 10:return[2]}}))}function cn(e,t){var n,i,r;return G(this,(function(s){switch(s.label){case 0:return i=(n=t).func,r=[e.id.name],[5,W(mn(e,t))];case 1:return i.apply(n,r.concat([s.sent()])),[2]}}))}function ln(e,t,n){var i,r,s;return void 0===n&&(n={}),G(this,(function(a){switch(a.label){case 0:i=n.klass,r=n.superClass,s=0,a.label=1;case 1:return s<e.body.length?[5,W(hn(e.body[s],t,{klass:i,superClass:r}))]:[3,4];case 2:a.sent(),a.label=3;case 3:return s++,[3,1];case 4:return[2]}}))}function hn(e,t,n){var i,r,o,c,l,h;return void 0===n&&(n={}),G(this,(function(u){switch(u.label){case 0:return i=n.klass,r=n.superClass,e.computed?[5,W(rn(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?i:i.prototype,l=gn(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 un(e,t){void 0===t&&(t={});var n=t.res,i=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 n;try{n=e.next(t)}catch(e){return o(e)}return h(n),null}function l(t){var n;try{n=e.throw(t)}catch(e){return o(e)}h(n)}function h(e){if(e.done)return a(s?e:e.value);if(e.value!==M)return a(e);var t=e.value.RES;return(t&&"function"===t.then?t:Promise.resolve(t)).then(c,l)}"err"in t?l(i):c(n)}))}function pn(e,t,n){var i,r,s,a,o,c;return void 0===n&&(n={}),G(this,(function(l){switch(l.label){case 0:i=n.onlyBlock,r=void 0!==i&&i,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(an(o,t,{hoist:!0,onlyBlock:!0}))];case 3:return l.sent(),[3,6];case 4:return r?[3,6]:[5,W(dn(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 dn(e,t){var n,i,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(an(e,t,{hoist:!0}))];case 2:return o.sent(),[3,38];case 3:return"VariableDeclaration"!==e.left.type?[3,5]:[5,W(an(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(an(e.init,t,{hoist:!0}))];case 6:o.sent(),o.label=7;case 7:return[5,W(dn(e.body,t))];case 8:return o.sent(),[3,38];case 9:return[5,W(dn(e.consequent,t))];case 10:return o.sent(),e.alternate?[5,W(dn(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(dn(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];n=0,o.label=20;case 20:return n<e.cases[a].consequent.length?[5,W(dn(e.cases[a].consequent[n],t))]:[3,23];case 21:o.sent(),o.label=22;case 22:return n++,[3,20];case 23:return a++,[3,19];case 24:return[3,38];case 25:i=e.block.body,a=0,o.label=26;case 26:return a<i.length?[5,W(dn(i[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(dn(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(dn(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 fn(e,t,n){return void 0===n&&(n={}),G(this,(function(i){switch(i.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(Kt(e,t,n))];case 2:case 4:case 6:case 8:return[2,i.sent()];case 3:return[5,W(Qt(e,t,n))];case 5:return[5,W(Zt(e,t,n))];case 7:return[5,W(en(e,t,n))];case 9:throw new SyntaxError("Unexpected token")}}))}function gn(e,t,n){if(void 0===n&&(n={}),!e.generator&&!e.async)return wn(e,t,n);var i,r=n.superClass,a=n.isCtor,o=e.params,c=function n(){var i,s,c,l,h,u=this&&this instanceof n?this.constructor:void 0,p=[];for(i=0;i<arguments.length;i++)p[i]=arguments[i];return G(this,(function(n){switch(n.label){case 0:s=new z(t,!0),"ArrowFunctionExpression"!==e.type&&(s.const("this",this),s.let("arguments",arguments),s.const(F,u),r&&(s.const(R,r),a&&s.let($,!1))),c=0,n.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(Zt(l,s,{kind:"var",feed:p.slice(c)}))];case 3:return n.sent(),[3,6];case 4:return[5,W(fn(l,s,{feed:p[c]}))];case 5:n.sent(),n.label=6;case 6:return c++,[3,1];case 7:return"BlockStatement"!==e.body.type?[3,10]:[5,W(pn(e.body,s))];case 8:return n.sent(),[5,W(Ot(e.body,s,{invasived:!0,hoisted:!0}))];case 9:return h=n.sent(),[3,12];case 10:return[5,W(rn(e.body,s))];case 11:h=n.sent(),"ArrowFunctionExpression"===e.type&&(O.RES=h,h=O),n.label=12;case 12:return h===O?[2,h.RES]:[2]}}))};return i=e.async&&e.generator?function(){var e=c.apply(this,arguments),t=Promise.resolve(),n=!1,i=function(i){return t=t.then((function(){return un(e,w({fullRet:!0},i))})).catch((function(e){if(!n)return n=!0,Promise.reject(e)}))},r={next:function(e){return i({res:e})},throw:function(e){return i({err:e})},return:function(e){return i({ret:e})}};return"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r}:e.async?function(){return un(c.apply(this,arguments))}:c,s(i,V,{value:!0}),s(i,"name",{value:e.id&&e.id.name||"",configurable:!0}),s(i,"length",{value:o.length,configurable:!0}),i}function mn(e,t){var n,i,r,a,o;return G(this,(function(c){switch(c.label){case 0:return[5,W(rn(e.superClass,t))];case 1:for(n=c.sent(),i=function(){n&&n.apply(this)},r=e.body.body,a=0;a<r.length;a++)if("constructor"===(o=r[a]).kind){i=gn(o.value,t,{superClass:n,isCtor:!0});break}return n&&b(i,n),[5,W(ln(e.body,t,{klass:i,superClass:n}))];case 2:return c.sent(),s(i,B,{value:!0}),s(i,"name",{value:e.id&&e.id.name||"",configurable:!0}),[2,i]}}))}function vn(e,t,n){var i,r,s,a;return G(this,(function(o){switch(o.label){case 0:return i=n.value,r=e.left,s=new z(t),"VariableDeclaration"!==r.type?[3,2]:[5,W(an(r,s,{feed:i}))];case 1:return o.sent(),[3,6];case 2:return"Identifier"!==r.type?[3,4]:[5,W(X(r,t,{getVar:!0}))];case 3:return o.sent().set(i),[3,6];case 4:return[5,W(fn(r,t,{feed:i}))];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(rn(e.body,s))];case 9:a=o.sent(),o.label=10;case 10:return[2,a]}}))}function yn(e,t,n){void 0===n&&(n={});for(var i=n.onlyBlock,r=void 0!==i&&i,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)?Qe(c,t,{hoist:!0,onlyBlock:!0}):r||bn(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 bn(e,t){switch(e.type){case"VariableDeclaration":Qe(e,t,{hoist:!0});break;case"ForInStatement":case"ForOfStatement":"VariableDeclaration"===e.left.type&&Qe(e.left,t,{hoist:!0});case"ForStatement":"ForStatement"===e.type&&"VariableDeclaration"===e.init.type&&Qe(e.init,t,{hoist:!0});case"WhileStatement":case"DoWhileStatement":bn(e.body,t);break;case"IfStatement":bn(e.consequent,t),e.alternate&&bn(e.alternate,t);break;case"BlockStatement":for(var n=0;n<e.body.length;n++)bn(e.body[n],t);break;case"SwitchStatement":for(n=0;n<e.cases.length;n++)for(var i=0;i<e.cases[n].consequent.length;i++)bn(e.cases[n].consequent[i],t);break;case"TryStatement":var r=e.block.body;for(n=0;n<r.length;n++)bn(r[n],t);var s=e.handler&&e.handler.body.body;if(s)for(n=0;n<s.length;n++)bn(s[n],t);var a=e.finalizer&&e.finalizer.body;if(a)for(n=0;n<a.length;n++)bn(a[n],t)}}function xn(e,t,n){switch(void 0===n&&(n={}),e.type){case"ObjectPattern":return Ue(e,t,n);case"ArrayPattern":return He(e,t,n);case"RestElement":return qe(e,t,n);case"AssignmentPattern":return ze(e,t,n);default:throw new SyntaxError("Unexpected token")}}function wn(e,t,n){if(void 0===n&&(n={}),e.generator||e.async)return gn(e,t,n);var i=n.superClass,r=n.isCtor,a=e.params,o=function n(){for(var s=this&&this instanceof n?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(F,s),i&&(h.const(R,i),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)}):xn(p,h,{feed:o[u]})}if("BlockStatement"===e.body.type?(yn(e.body,h),l=ke(e.body,h,{invasived:!0,hoisted:!0})):(l=Xe(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 _n(e,t){for(var n=Xe(e.superClass,t),i=function(){n&&n.apply(this)},r=e.body.body,a=0;a<r.length;a++){var o=r[a];if("constructor"===o.kind){i=wn(o.value,t,{superClass:n,isCtor:!0});break}}return n&&b(i,n),tt(e.body,t,{klass:i,superClass:n}),s(i,B,{value:!0}),s(i,"name",{value:e.id&&e.id.name||"",configurable:!0}),i}function Sn(e,t,n){var i=n.value,r=e.left,s=new z(t);return"VariableDeclaration"===r.type?Qe(r,s,{feed:i}):"Identifier"===r.type?X(r,t,{getVar:!0}).set(i):xn(r,t,{feed:i}),"BlockStatement"===e.body.type?ke(e.body,s,{invasived:!0}):Xe(e.body,s)}var kn=function(){function t(e){void 0===e&&(e={}),this.options={},this.scope=new z(null,!0),this.exports={};var t=e.ecmaVer,n=void 0===t?9:t,i=e.sandBox,r=void 0===i||i;if(-1===[3,5,6,7,8,9,10].indexOf(n-=n<2015?0:2009))throw new Error("unsupported ecmaVer");if(this.options.ecmaVersion=n,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 n;if("string"==typeof e&&((n={})[e]=t,e=n),"object"==typeof e)for(var i=l(e),r=0;r<i.length;r++){var s=i[r];this.scope.var(s,e[s])}},t.prototype.parse=function(t,n){return"function"==typeof n?n(t,w({},this.options)):e.parse(t,this.options)},t.prototype.run=function(t){var n="string"==typeof t?e.parse(t,this.options):t;yn(n,this.scope),Xe(n,this.scope)},t.version=N,t}();return kn}(n(94))},94:(e,t,n)=>{n.r(t),n.d(t,{Node:()=>ie,Parser:()=>F,Position:()=>L,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:()=>Le,parseExpressionAt:()=>De,tokContexts:()=>oe,tokTypes:()=>_,tokenizer:()=>Re,version:()=>Oe});var i={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 n=65536,i=0;i<t.length;i+=2){if((n+=t[i])>e)return!1;if((n+=t[i+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 v(e,t){return new m(e,{beforeExpr:!0,binop:t})}var y={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(",",y),semi:new m(";",y),colon:new m(":",y),dot:new m("."),question:new m("?",y),arrow:new m("=>",y),template:new m("template"),invalidTemplate:new m("invalidTemplate"),ellipsis:new m("...",y),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:v("||",1),logicalAND:v("&&",2),bitwiseOR:v("|",3),bitwiseXOR:v("^",4),bitwiseAND:v("&",5),equality:v("==/!=/===/!==",6),relational:v("</>/<=/>=",7),bitShift:v("<</>>/>>>",8),plusMin:new m("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:v("%",10),star:v("*",10),slash:v("/",10),starstar:new m("**",{beforeExpr:!0}),_break:w("break"),_case:w("case",y),_catch:w("catch"),_continue:w("continue"),_debugger:w("debugger"),_default:w("default",y),_do:w("do",{isLoop:!0,beforeExpr:!0}),_else:w("else",y),_finally:w("finally"),_for:w("for",{isLoop:!0}),_function:w("function",b),_if:w("if"),_return:w("return",y),_switch:w("switch"),_throw:w("throw",y),_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",y),_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 M=Array.isArray||function(e){return"[object Array]"===P.call(e)};function O(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var L=function(e,t){this.line=e,this.column=t};L.prototype.offset=function(e){return new L(this.line,this.column+e)};var D=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)};function R(e,t){for(var n=1,i=0;;){k.lastIndex=i;var r=k.exec(e);if(!(r&&r.index<t))return new L(n,t-i);++n,i=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 n in $)t[n]=e&&N(e,n)?e[n]:$[n];if(t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),M(t.onToken)){var i=t.onToken;t.onToken=function(e){return i.push(e)}}return M(t.onComment)&&(t.onComment=function(e,t){return function(n,i,r,s,a,o){var c={type:n?"Block":"Line",value:i,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 B(e,t){return 2|(e?4:0)|(t?8:0)}var F=function(e,t,n){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=i[a]);a--);"module"===e.sourceType&&(r+=" await")}this.reservedWords=O(r);var o=(r?r+" ":"")+i.strict;this.reservedWordsStrict=O(o),this.reservedWordsStrictBind=O(o+" "+i.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-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},j={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};F.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},j.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},j.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},j.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},j.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},j.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},j.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},F.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},F.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,i=0;i<e.length;i++)n=e[i](n);return n},F.parse=function(e,t){return new this(t,e).parse()},F.parseExpressionAt=function(e,t,n){var i=new this(n,e,t);return i.nextToken(),i.parseExpression()},F.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(F.prototype,j);var U=F.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 n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},U.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,i=e.doubleProto;if(!t)return n>=0||i>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"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=F.prototype;z.parseTopLevel=function(e){var t={};for(e.body||(e.body=[]);this.type!==_.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var i=0,r=Object.keys(this.undefinedExports);i<r.length;i+=1){var s=r[i];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),n=this.pos+t[0].length,i=this.input.charCodeAt(n);if(91===i)return!0;if(e)return!1;if(123===i)return!0;if(f(i,!0)){for(var r=n+1;g(this.input.charCodeAt(r),!0);)++r;var s=this.input.slice(n,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,n){var i,r=this.type,s=this.startNode();switch(this.isLet(e)&&(r=_._var,i="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 i=i||this.value,e&&"var"!==i&&this.unexpected(),this.parseVarStatement(s,i);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,n);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 n="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 i=0;i<this.labels.length;++i){var r=this.labels[i];if(null==e.label||r.name===e.label.name){if(null!=r.kind&&(n||"loop"===r.kind))break;if(e.label&&n)break}}return i===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,n?"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 n=this.isLet();if(this.type===_._var||this.type===_._const||n){var i=this.startNode(),r=n?"let":this.value;return this.next(),this.parseVar(i,!0,r),this.finishNode(i,"VariableDeclaration"),(this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===i.declarations.length?(this.options.ecmaVersion>=9&&(this.type===_._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,i)):(t>-1&&this.unexpected(t),this.parseFor(e,i))}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,n){return this.next(),this.parseFunction(e,J|(n?0:X),!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 n=!1;this.type!==_.braceR;)if(this.type===_._case||this.type===_._default){var i=this.type===_._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!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 n="Identifier"===t.param.type;this.enterScope(n?32:0),this.checkLVal(t.param,n?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,n,i){for(var r=0,s=this.labels;r<s.length;r+=1){s[r].name===t&&this.raise(n.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(i?-1===i.indexOf("label")?i+"label":i:"label"),this.labels.pop(),e.label=n,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 n=this.parseStatement(null);t.body.push(n)}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 n=this.type===_._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!n||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(n?"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=n?this.parseExpression():this.parseMaybeAssign(),this.expect(_.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")},z.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(_.eq)?i.init=this.parseMaybeAssign(t):"const"!==n||this.type===_._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===i.id.type||t&&(this.type===_._in||this.isContextual("of"))?i.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(i,"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,X=2;z.parseFunction=function(e,t,n,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===_.star&&t&X&&this.unexpected(),e.generator=this.eat(_.star)),this.options.ecmaVersion>=8&&(e.async=!!i),t&J&&(e.id=4&t&&this.type!==_.name?null:this.parseIdent(),!e.id||t&X||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(B(e.async,e.generator)),t&J||(e.id=this.type===_.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!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 n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.startNode(),r=!1;for(i.body=[],this.expect(_.braceL);!this.eat(_.braceR);){var s=this.parseClassElement(null!==e.superClass);s&&(i.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(i,"ClassBody"),this.strict=n,this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},z.parseClassElement=function(e){var t=this;if(this.eat(_.semi))return null;var n=this.startNode(),i=function(e,i){void 0===i&&(i=!1);var r=t.start,s=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===_.parenL||i&&t.canInsertSemicolon())||(n.key&&t.unexpected(),n.computed=!1,n.key=t.startNodeAt(r,s),n.key.name=e,t.finishNode(n.key,"Identifier"),!1))};n.kind="method",n.static=i("static");var r=this.eat(_.star),s=!1;r||(this.options.ecmaVersion>=8&&i("async",!0)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(_.star)):i("get")?n.kind="get":i("set")&&(n.kind="set")),n.key||this.parsePropertyName(n);var a=n.key,o=!1;return n.computed||n.static||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?n.static&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==n.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"),n.kind="constructor",o=e),this.parseClassMethod(n,r,s,o),"get"===n.kind&&0!==n.value.params.length&&this.raiseRecoverable(n.value.start,"getter should have no params"),"set"===n.kind&&1!==n.value.params.length&&this.raiseRecoverable(n.value.start,"setter should have exactly one param"),"set"===n.kind&&"RestElement"===n.value.params[0].type&&this.raiseRecoverable(n.value.params[0].start,"Setter cannot use rest params"),n},z.parseClassMethod=function(e,t,n,i){return e.value=this.parseMethod(t,n,i),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 n;if(this.checkExport(t,"default",this.lastTokStart),this.type===_._function||(n=this.isAsyncFunction())){var i=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(i,4|J,!1,n)}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,n){e&&(N(e,t)&&this.raiseRecoverable(n,"Duplicate export '"+t+"'"),e[t]=!0)},z.checkPatternExport=function(e,t){var n=t.type;if("Identifier"===n)this.checkExport(e,t.name,t.start);else if("ObjectPattern"===n)for(var i=0,r=t.properties;i<r.length;i+=1){var s=r[i];this.checkPatternExport(e,s)}else if("ArrayPattern"===n)for(var a=0,o=t.elements;a<o.length;a+=1){var c=o[a];c&&this.checkPatternExport(e,c)}else"Property"===n?this.checkPatternExport(e,t.value):"AssignmentPattern"===n?this.checkPatternExport(e,t.left):"RestElement"===n?this.checkPatternExport(e,t.argument):"ParenthesizedExpression"===n&&this.checkPatternExport(e,t.expression)},z.checkVariableExport=function(e,t){if(e)for(var n=0,i=t;n<i.length;n+=1){var r=i[n];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=[],n=!0;for(this.expect(_.braceL);!this.eat(_.braceR);){if(n)n=!1;else if(this.expect(_.comma),this.afterTrailingComma(_.braceR))break;var i=this.startNode();i.local=this.parseIdent(!0),i.exported=this.eatContextual("as")?this.parseIdent(!0):i.local,this.checkExport(e,i.exported.name,i.exported.start),t.push(this.finishNode(i,"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 n=this.startNode();if(n.local=this.parseIdent(),this.checkLVal(n.local,2),e.push(this.finishNode(n,"ImportDefaultSpecifier")),!this.eat(_.comma))return e}if(this.type===_.star){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLVal(i.local,2),e.push(this.finishNode(i,"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 K=F.prototype;K.toAssignable=function(e,t,n){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",n&&this.checkPatternErrors(n,!0);for(var i=0,r=e.properties;i<r.length;i+=1){var s=r[i];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",n&&this.checkPatternErrors(n,!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,n);break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else n&&this.checkPatternErrors(n,!0);return e},K.toAssignableList=function(e,t){for(var n=e.length,i=0;i<n;i++){var r=e[i];r&&this.toAssignable(r,t)}if(n){var s=e[n-1];6===this.options.ecmaVersion&&t&&s&&"RestElement"===s.type&&"Identifier"!==s.argument.type&&this.unexpected(s.argument.start)}return e},K.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},K.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")},K.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()},K.parseBindingList=function(e,t,n){for(var i=[],r=!0;!this.eat(e);)if(r?r=!1:this.expect(_.comma),t&&this.type===_.comma)i.push(null);else{if(n&&this.afterTrailingComma(e))break;if(this.type===_.ellipsis){var s=this.parseRestBinding();this.parseBindingListItem(s),i.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),i.push(a)}return i},K.parseBindingListItem=function(e){return e},K.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(_.eq))return n;var i=this.startNodeAt(e,t);return i.left=n,i.right=this.parseMaybeAssign(),this.finishNode(i,"AssignmentPattern")},K.checkLVal=function(e,t,n){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"),n&&(N(n,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),n[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 i=0,r=e.properties;i<r.length;i+=1){var s=r[i];this.checkLVal(s,t,n)}break;case"Property":this.checkLVal(e.value,t,n);break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var c=o[a];c&&this.checkLVal(c,t,n)}break;case"AssignmentPattern":this.checkLVal(e.left,t,n);break;case"RestElement":this.checkLVal(e.argument,t,n);break;case"ParenthesizedExpression":this.checkLVal(e.expression,t,n);break;default:this.raise(e.start,(t?"Binding":"Assigning to")+" rvalue")}};var Q=F.prototype;Q.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var i,r=e.key;switch(r.type){case"Identifier":i=r.name;break;case"Literal":i=String(r.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===i&&"init"===s&&(t.proto&&(n&&n.doubleProto<0?n.doubleProto=r.start:this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);else{var a=t[i="$"+i];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[i]={init:!1,get:!1,set:!1};a[s]=!0}}},Q.parseExpression=function(e,t){var n=this.start,i=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===_.comma){var s=this.startNodeAt(n,i);for(s.expressions=[r];this.eat(_.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return r},Q.parseMaybeAssign=function(e,t,n){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var i=!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,i=!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(n&&(l=n.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,i||q.call(t),t.shorthandAssign=-1,this.checkLVal(l),this.next(),h.right=this.parseMaybeAssign(e),this.finishNode(h,"AssignmentExpression")}return i&&this.checkExpressionErrors(t,!0),r>-1&&(t.parenthesizedAssign=r),s>-1&&(t.trailingComma=s),a>-1&&(t.shorthandAssign=a),l},Q.parseMaybeConditional=function(e,t){var n=this.start,i=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat(_.question)){var s=this.startNodeAt(n,i);return s.test=r,s.consequent=this.parseMaybeAssign(),this.expect(_.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return r},Q.parseExprOps=function(e,t){var n=this.start,i=this.startLoc,r=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)||r.start===n&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,n,i,-1,e)},Q.parseExprOp=function(e,t,n,i,r){var s=this.type.binop;if(null!=s&&(!r||this.type!==_._in)&&s>i){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,n,e,h,o,a);return this.parseExprOp(u,t,n,i,r)}return e},Q.buildBinary=function(e,t,n,i,r,s){var a=this.startNodeAt(e,t);return a.left=n,a.operator=r,a.right=i,this.finishNode(a,s?"LogicalExpression":"BinaryExpression")},Q.parseMaybeUnary=function(e,t){var n,i=this.start,r=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))n=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,n=this.finishNode(s,a?"UpdateExpression":"UnaryExpression")}else{if(n=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(i,r);o.operator=this.value,o.prefix=!1,o.argument=n,this.checkLVal(n),this.next(),n=this.finishNode(o,"UpdateExpression")}}return!t&&this.eat(_.starstar)?this.buildBinary(i,r,n,this.parseMaybeUnary(null,!1),"**",!1):n},Q.parseExprSubscripts=function(e){var t=this.start,n=this.startLoc,i=this.parseExprAtom(e),r="ArrowFunctionExpression"===i.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);if(this.checkExpressionErrors(e)||r)return i;var s=this.parseSubscripts(i,t,n);return e&&"MemberExpression"===s.type&&(e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1)),s},Q.parseSubscripts=function(e,t,n,i){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,n,i,r);if(s===e||"ArrowFunctionExpression"===s.type)return s;e=s}},Q.parseSubscript=function(e,t,n,i,r){var s=this.eat(_.bracketL);if(s||this.eat(_.dot)){var a=this.startNodeAt(t,n);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(!i&&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,n),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,n);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,n);f.tag=e,f.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(f,"TaggedTemplateExpression")}return e},Q.parseExprAtom=function(e){this.type===_.slash&&this.readRegexp();var t,n=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 i=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(i,r),0,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(_.arrow))return this.parseArrowExpression(this.startNodeAt(i,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(i,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(n);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()}},Q.parseDynamicImport=function(){var e=this.startNode();return this.next(),this.type!==_.parenL&&this.unexpected(),this.finishNode(e,"Import")},Q.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")},Q.parseParenExpression=function(){this.expect(_.parenL);var e=this.parseExpression();return this.expect(_.parenR),e},Q.parseParenAndDistinguishExpression=function(e){var t,n=this.start,i=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(n,i,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(n,i);return m.expression=t,this.finishNode(m,"ParenthesizedExpression")}return t},Q.parseParenItem=function(e){return e},Q.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var Z=[];Q.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(_.dot)){e.meta=t;var n=this.containsEsc;return e.property=this.parseIdent(!0),("target"!==e.property.name||n)&&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 i=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),i,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=Z,this.finishNode(e,"NewExpression")},Q.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===_.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===_.backQuote,this.finishNode(n,"TemplateElement")},Q.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var i=this.parseTemplateElement({isTagged:t});for(n.quasis=[i];!i.tail;)this.type===_.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(_.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(_.braceR),n.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},Q.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))},Q.parseObj=function(e,t){var n=this.startNode(),i=!0,r={};for(n.properties=[],this.next();!this.eat(_.braceR);){if(i)i=!1;else if(this.expect(_.comma),this.afterTrailingComma(_.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,r,t),n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},Q.parseProperty=function(e,t){var n,i,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||(n=this.eat(_.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(a)?(i=!0,n=this.options.ecmaVersion>=9&&this.eat(_.star),this.parsePropertyName(a,t)):i=!1,this.parsePropertyValue(a,e,n,i,r,s,t,o),this.finishNode(a,"Property")},Q.parsePropertyValue=function(e,t,n,i,r,s,a,o){if((n||i)&&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(n,i);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?((n||i)&&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{(n||i)&&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")}},Q.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)},Q.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Q.parseMethod=function(e,t,n){var i=this.startNode(),r=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=e),this.options.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|B(t,i.generator)|(n?128:0)),this.expect(_.parenL),i.params=this.parseBindingList(_.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(i,"FunctionExpression")},Q.parseArrowExpression=function(e,t,n){var i=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|B(n,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=i,this.awaitPos=r,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},Q.parseFunctionBody=function(e,t,n){var i=t&&this.type!==_.braceL,r=this.strict,s=!1;if(i)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&&!n&&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},Q.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1){if("Identifier"!==n[t].type)return!1}return!0},Q.checkParams=function(e,t){for(var n={},i=0,r=e.params;i<r.length;i+=1){var s=r[i];this.checkLVal(s,1,t?null:n)}},Q.parseExprList=function(e,t,n,i){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;n&&this.type===_.comma?a=null:this.type===_.ellipsis?(a=this.parseSpread(i),i&&this.type===_.comma&&i.trailingComma<0&&(i.trailingComma=this.start)):a=this.parseMaybeAssign(!1,i),r.push(a)}return r},Q.checkUnreserved=function(e){var t=e.start,n=e.end,i=e.name;(this.inGenerator&&"yield"===i&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===i&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(i)&&this.raise(t,"Unexpected keyword '"+i+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,n).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(i)&&(this.inAsync||"await"!==i||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+i+"' is reserved"))},Q.parseIdent=function(e,t){var n=this.startNode();return this.type===_.name?n.name=this.value:this.type.keyword?(n.name=this.type.keyword,"class"!==n.name&&"function"!==n.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(),this.finishNode(n,"Identifier"),e||(this.checkUnreserved(n),"await"!==n.name||this.awaitIdentPos||(this.awaitIdentPos=n.start)),n},Q.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")},Q.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=F.prototype;ee.raise=function(e,t){var n=R(this.input,e);t+=" ("+n.line+":"+n.column+")";var i=new SyntaxError(t);throw i.pos=e,i.loc=n,i.raisedAt=this.pos,i},ee.raiseRecoverable=ee.raise,ee.curPosition=function(){if(this.options.locations)return new L(this.curLine,this.pos-this.lineStart)};var te=F.prototype,ne=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};te.enterScope=function(e){this.scopeStack.push(new ne(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,n){var i=!1;if(2===t){var r=this.currentScope();i=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();i=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){i=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],3&o.flags)break}i&&this.raiseRecoverable(n,"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 ie=function(e,t,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new D(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},re=F.prototype;function se(e,t,n,i){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=i),this.options.ranges&&(e.range[1]=n),e}re.startNode=function(){return new ie(this,this.start,this.startLoc)},re.startNodeAt=function(e,t){return new ie(this,e,t)},re.finishNode=function(e,t){return se.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},re.finishNodeAt=function(e,t,n,i){return se.call(this,e,t,n,i)};var ae=function(e,t,n,i,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=i,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=F.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,n=this.type;n.keyword&&e===_.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.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 ve(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}ve(9),ve(10),ve(11);var ye=F.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,n){var i=-1!==n.indexOf("u");this.start=0|e,this.source=t+"",this.flags=n,this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchN=i&&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,n=t.length;if(e>=n)return-1;var i=t.charCodeAt(e);if(!this.switchU||i<=55295||i>=57344||e+1>=n)return i;var r=t.charCodeAt(e+1);return r>=56320&&r<=57343?(i<<10)+r-56613888:i},be.prototype.nextIndex=function(e){var t=this.source,n=t.length;if(e>=n)return n;var i,r=t.charCodeAt(e);return!this.switchU||r<=55295||r>=57344||e+1>=n||(i=t.charCodeAt(e+1))<56320||i>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)},ye.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,i=0;i<n.length;i++){var r=n.charAt(i);-1===t.indexOf(r)&&this.raise(e.start,"Invalid regular expression flag"),n.indexOf(r,i+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}},ye.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},ye.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,n=e.backReferenceNames;t<n.length;t+=1){var i=n[t];-1===e.groupNames.indexOf(i)&&e.raise("Invalid named capture referenced")}},ye.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")},ye.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},ye.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)},ye.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 n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},ye.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},ye.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},ye.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var i=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return-1!==r&&r<i&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=n}return!1},ye.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)},ye.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},ye.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},ye.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},ye.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)},ye.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},ye.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!we(t)&&(e.lastIntValue=t,e.advance(),!0)},ye.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;-1!==(n=e.current())&&!we(n);)e.advance();return e.pos!==t},ye.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)},ye.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")}},ye.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},ye.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},ye.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=e.current();return e.advance(),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(n=e.lastIntValue),function(e){return f(e,!0)||36===e||95===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},ye.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=e.current();return e.advance(),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(n=e.lastIntValue),function(e){return g(e,!0)||36===e||95===e||8204===e||8205===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},ye.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)},ye.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},ye.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},ye.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)},ye.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},ye.regexp_eatZero=function(e){return 48===e.current()&&!Ee(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},ye.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)},ye.regexp_eatControlLetter=function(e){var t=e.current();return!!_e(t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.regexp_eatRegExpUnicodeEscapeSequence=function(e){var t,n=e.pos;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(e.switchU&&i>=55296&&i<=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*(i-55296)+(s-56320)+65536,!0}e.pos=r,e.lastIntValue=i}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=n}return!1},ye.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)},ye.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},ye.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},ye.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,i),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r),!0}return!1},ye.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){N(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")},ye.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},ye.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Se(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";ke(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},ye.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},ye.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},ye.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;!e.switchU||-1!==t&&-1!==n||e.raise("Invalid character class"),-1!==t&&-1!==n&&t>n&&e.raise("Range out of order in character class")}}},ye.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(99===n||Ie(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var i=e.current();return 93!==i&&(e.lastIntValue=i,e.advance(),!0)},ye.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)},ye.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Ee(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},ye.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},ye.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ee(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t},ye.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ae(n=e.current());)e.lastIntValue=16*e.lastIntValue+Ce(n),e.advance();return e.pos!==t},ye.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*n+e.lastIntValue:e.lastIntValue=8*t+n}else e.lastIntValue=t;return!0}return!1},ye.regexp_eatOctalDigit=function(e){var t=e.current();return Ie(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},ye.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var i=0;i<t;++i){var r=e.current();if(!Ae(r))return e.pos=n,!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=F.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(),n=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(k.lastIndex=n;(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(n+2,i),n,this.pos,t,this.curPosition())},Pe.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!E(i);)i=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,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 n=this.type;this.type=e,this.value=t,this.updateContext(n)},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),n=1,i=42===e?_.star:_.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++n,i=_.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(_.assign,n+1):this.finishOp(i,n)},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),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(_.assign,n+1):this.finishOp(_.bitShift,n)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(n=2),this.finishOp(_.relational,n)):(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 n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Pe.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(S.test(i)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++this.pos}var r=this.input.slice(n,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(n,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 n=this.pos,i=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,i=i*e+o}return this.pos===n||null!=t&&this.pos-n!==t?null:i},Pe.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return null==n&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(n="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,n)},Pe.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var n=this.pos-t>=2&&48===this.input.charCodeAt(t);n&&this.strict&&this.raise(t,"Invalid number"),n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1);var i=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&110===i){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!==i||n||(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),69!==i&&101!==i||n||(43!==(i=this.input.charCodeAt(++this.pos))&&45!==i||++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=n?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="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;92===i?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):(E(i,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(_.string,t)};var Me={};Pe.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Me)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Pe.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Me;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 n=this.input.charCodeAt(this.pos);if(96===n||36===n&&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===n?(this.pos+=2,this.finishToken(_.dollarBraceL)):(++this.pos,this.finishToken(_.backQuote));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(E(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}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 n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return E(t)?"":String.fromCharCode(t)}},Pe.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.invalidStringToken(t,"Bad character escape sequence"),n},Pe.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,i=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(g(r,i))this.pos+=r<=65535?1:2;else{if(92!==r)break;this.containsEsc=!0,e+=this.input.slice(n,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,i)||this.invalidStringToken(s,"Invalid Unicode escape"),e+=Ne(a),n=this.pos}t=!1}return e+this.input.slice(n,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 Le(e,t){return F.parse(e,t)}function De(e,t,n){return F.parseExpressionAt(e,t,n)}function Re(e,t){return F.tokenizer(e,t)}F.acorn={Parser:F,version:Oe,defaultOptions:$,Position:L,SourceLocation:D,getLineInfo:R,Node:ie,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 n(i){var r=t[i];if(void 0!==r)return r.exports;var s=t[i]={exports:{}};return e[i].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};n.d(i,{c:()=>$i,E:()=>Fi});
/**
* @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,n){if(this._$cssResult$=!0,n!==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 n=void 0!==t&&1===t.length;n&&(e=o.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&o.set(t,e))}return e}toString(){return this.cssText}}const l=(e,...t)=>{const n=1===e.length?e[0]:t.reduce(((t,n,i)=>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.")})(n)+e[i+1]),e[0]);return new c(n,e,a)},h=s?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.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 n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},v=(e,t)=>t!==e&&(t==t||e==e),y={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:v};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,n)=>{const i=this._$Ep(n,t);void 0!==i&&(this._$Ev.set(i,n),e.push(i))})),e}static createProperty(e,t=y){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n="symbol"==typeof e?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const r=this[e];this[t]=i,this.requestUpdate(e,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||y}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 n of t)this.createProperty(n,e[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(h(e))}else void 0!==e&&t.push(h(e));return t}static _$Ep(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"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,n;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.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 n=document.createElement("style"),i=r.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=t.cssText,e.appendChild(n)}))})(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,n){this._$AK(e,n)}_$EO(e,t,n=y){var i;const r=this.constructor._$Ep(e,n);if(void 0!==r&&!0===n.reflect){const s=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:m).toAttribute(t,n.type);this._$El=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$El=null}}_$AK(e,t){var n;const i=this.constructor,r=i._$Ev.get(e);if(void 0!==r&&this._$El!==r){const e=i.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(n=e.converter)||void 0===n?void 0:n.fromAttribute)?e.converter:m;this._$El=r,this[r]=s.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,n){let i=!0;void 0!==e&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||v)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(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 n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),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(n)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(n)}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]),M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,L=/>/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,B=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),F=B(1),j=(B(2),Symbol.for("lit-noChange")),U=Symbol.for("lit-nothing"),H=new WeakMap,q=C.createTreeWalker(C,129,null,!1),z=(e,t)=>{const n=e.length-1,i=[];let r,s=2===t?"<svg>":"",a=M;for(let t=0;t<n;t++){const n=e[t];let o,c,l=-1,h=0;for(;h<n.length&&(a.lastIndex=h,c=a.exec(n),null!==c);)h=a.lastIndex,a===M?"!--"===c[1]?a=O:void 0!==c[1]?a=L: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:M,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===L?a=M:(a=D,r=void 0);const u=a===D&&e[t+1].startsWith("/>")?" ":"";s+=a===M?n+A:l>=0?(i.push(o),n.slice(0,l)+"$lit$"+n.slice(l)+k+u):n+k+(-2===l?(i.push(void 0),t):u)}const o=s+(e[n]||"<?>")+(2===t?"</svg>":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==S?S.createHTML(o):o,i]};class G{constructor({strings:e,_$litType$:t},n){let i;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,n),q.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(i=q.nextNode())&&o.length<a;){if(1===i.nodeType){if(i.hasAttributes()){const e=[];for(const t of i.getAttributeNames())if(t.endsWith("$lit$")||t.startsWith(k)){const n=l[s++];if(e.push(t),void 0!==n){const e=i.getAttribute(n.toLowerCase()+"$lit$").split(k),t=/([.?@])?(.*)/.exec(n);o.push({type:1,index:r,name:t[2],strings:e,ctor:"."===t[1]?K:"?"===t[1]?Z:"@"===t[1]?ee:X})}else o.push({type:6,index:r})}for(const t of e)i.removeAttribute(t)}if(V.test(i.tagName)){const e=i.textContent.split(k),t=e.length-1;if(t>0){i.textContent=_?_.emptyScript:"";for(let n=0;n<t;n++)i.append(e[n],I()),q.nextNode(),o.push({type:2,index:++r});i.append(e[t],I())}}}else if(8===i.nodeType)if(i.data===E)o.push({type:2,index:r});else{let e=-1;for(;-1!==(e=i.data.indexOf(k,e+1));)o.push({type:7,index:r}),e+=k.length-1}r++}}static createElement(e,t){const n=C.createElement("template");return n.innerHTML=e,n}}function W(e,t,n=e,i){var r,s,a,o;if(t===j)return t;let c=void 0!==i?null===(r=n._$Co)||void 0===r?void 0:r[i]:n._$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,n,i)),void 0!==i?(null!==(a=(o=n)._$Co)&&void 0!==a?a:o._$Co=[])[i]=c:n._$Cl=c),void 0!==c&&(t=W(e,c._$AS(e,t.values),c,i)),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:n},parts:i}=this._$AD,r=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:C).importNode(n,!0);q.currentNode=r;let s=q.nextNode(),a=0,o=0,c=i[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=i[++o]}a!==(null==c?void 0:c.index)&&(s=q.nextNode(),a++)}return r}p(e){let t=0;for(const n of this.u)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class J{constructor(e,t,n,i){var r;this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cm=null===(r=null==i?void 0:i.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!==j&&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:n,_$litType$:i}=e,r="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=G.createElement(i.h,this.options)),i);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.p(n);else{const e=new Y(r,this),t=e.v(this.options);e.p(n),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 n,i=0;for(const r of e)i===t.length?t.push(n=new J(this.O(I()),this.O(I()),this,this.options)):n=t[i],n._$AI(r),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for(null===(n=this._$AP)||void 0===n||n.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 X{constructor(e,t,n,i,r){this.type=1,this._$AH=U,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=U}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,i){const r=this.strings;let s=!1;if(void 0===r)e=W(this,e,t,0),s=!T(e)||e!==this._$AH&&e!==j,s&&(this._$AH=e);else{const i=e;let a,o;for(e=r[0],a=0;a<r.length-1;a++)o=W(this,i[n+a],t,a),o===j&&(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&&!i&&this.j(e)}j(e){e===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}class K extends X{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}}const Q=_?_.emptyScript:"";class Z extends X{constructor(){super(...arguments),this.type=4}j(e){e&&e!==U?this.element.setAttribute(this.name,Q):this.element.removeAttribute(this.name)}}class ee extends X{constructor(e,t,n,i,r){super(e,t,n,i,r),this.type=5}_$AI(e,t=this){var n;if((e=null!==(n=W(this,e,t,0))&&void 0!==n?n:U)===j)return;const i=this._$AH,r=e===U&&i!==U||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==U&&(i===U||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;"function"==typeof this._$AH?this._$AH.call(null!==(n=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==n?n:this.element,e):this._$AH.handleEvent(e)}}class te{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){W(this,e)}}const ne=w.litHtmlPolyfillSupport;null==ne||ne(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 ie,re;class se extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const n=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=n.firstChild),n}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{var i,r;const s=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:t;let a=s._$litPart$;if(void 0===a){const e=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:null;s._$litPart$=a=new J(t.insertBefore(I(),e),e,void 0,null!=n?n:{})}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 j}}se.finalized=!0,se._$litElement$=!0,null===(ie=globalThis.litElementHydrateSupport)||void 0===ie||ie.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:n,elements:i}=t;return{kind:n,elements:i,finisher(t){customElements.define(e,t)}}})(e,t),ce=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(n){n.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(n){n.createProperty(t.key,e)}};function le(e){return(t,n)=>void 0!==n?((e,t,n)=>{t.constructor.createProperty(n,e)})(e,t,n):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(n){if(!n||n===document||n===window)return null;n.assignedSlot&&(n=n.assignedSlot);const i=n.closest(e);return i||t(n.getRootNode().host)}(t)}}const pe=(e,t,n,i)=>{i=i||{},n=null==n?{}:n;const r=new Event(t,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return r.detail=n,e.dispatchEvent(r),r},de=(e,t,n=!1)=>{n?history.replaceState(null,"",t):history.pushState(null,"",t),pe(window,"location-changed",{replace:n})};class fe{constructor(e,t,n,i){this.entityId=e,this.svgElement=t,this.originalSvgElement=n,this.originalBBox=i}}class ge{constructor(e){this.rule=e,this.svgElementInfos={}}}class me{constructor(e,t,n,i,r,s){this.instance=e,this.entityId=t,this.elementId=n,this.svgElementInfo=i,this.ruleInfo=r,this.actions=s}}const ve={},ye={};ye.click=ye.mousedown=ye.mouseup=ye.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,n,i){const r=we(n).e;if(!e._dtId)return!1;const s=ve[xe(e)],a=function(e,t,n,i){return n=we(n),(ve[xe(e)]||[]).filter((e=>e&&(!n.e||e.e===n.e)&&(!n.ns||e.ns===n.ns)&&(!i||e.callback===i)&&(!t||e.selector===t)))}(e,t,n,i);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,n,i,r,s){const a=we(n).e,o=we(n).ns;e.addEventListener?e.addEventListener(a,r||i,s):e.attachEvent&&e.attachEvent("on"+a,r||i);const c=xe(e);(ve[c]||(ve[c]=[])).push({delegator:r,callback:i,e:a,ns:o,selector:t})}const ke={on(e,t,n,i=null){Se(e,null,t,n,null,i)},off(e,t,n=null){_e(e,null,t,n)},once(e,t,n){const i=e=>(ke.off(e.currentTarget,e.type,i),n(e));this.on(e,t,i)},delegate(e,t,n,i,r=null){Se(e,t,n,i,(function(n){const r=e.querySelectorAll(t);let s=!1;for(let e=0;e<r.length;e++){const t=r[e];if(t===n.target||t.contains(n.target)){s=t;break}}s&&i.apply(s,[].slice.call(arguments))}),r)},undelegate(e,t,n,i){_e(e,t,n,i)},trigger(e,t,n){const i=document.createEvent(ye[t]||"Events");let r=!0;if(n)for(const e in n)({}).hasOwnProperty.call(n,e)&&("bubbles"===e?r=!!n[e]:i[e]=n[e]);i.initEvent(t,r,!0),e.dispatchEvent(i)}},Ee=ke,Ae=Ee;class Ce{static observe(e){let t,n=!1;const i=()=>{n=!1,t=setTimeout((()=>{n=!0,e.dispatchEvent(new Event("longClick"))}),400)},r=i=>{clearTimeout(t),n||e.dispatchEvent(new Event("short"+i.type[0].toUpperCase()+i.type.slice(1)))},s=e=>{n&&(e.preventDefault(),e.stopImmediatePropagation&&e.stopImmediatePropagation())};Ae.on(e,"mousedown",i.bind(this)),Ae.on(e,"tapstart",i.bind(this)),Ae.on(e,"touchstart",i.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,n=0;Ie.on(e,"click",(()=>{n++,t=setTimeout((()=>{1===n&&(n=0,e.dispatchEvent(new Event("singleClick")))}),400),2===n&&(clearTimeout(t),n=0,e.dispatchEvent(new Event("doubleClick")))}).bind(this))}}var Ne,Me=n(625),Oe=n.n(Me);class Le{static timeago(e){let t="second",n=0;const i=("string"==typeof e?new Date(e):e).getTime()-(new Date).getTime(),r=i/this.MILLISECONDS_IN_YEAR;if(Math.abs(r)>=1)t="year",n=r;else{const e=i/this.MILLISECONDS_IN_DAY;if(Math.abs(e)>=1)t="day",n=e;else{const e=i/this.MILLISECONDS_IN_HOUR;if(Math.abs(e)>=1)t="hour",n=e;else{const e=i/this.MILLISECONDS_IN_MINUTE;if(Math.abs(e)>=1)t="minute",n=e;else{t="second",n=i/this.MILLISECONDS_IN_SECOND}}}}return this.relativeTimeFormat.format(Math.round(n),t)}}Ne=Le,Le.strftime=Oe(),Le.MILLISECONDS_IN_SECOND=1e3,Le.MILLISECONDS_IN_MINUTE=6e4,Le.MILLISECONDS_IN_HOUR=36e5,Le.MILLISECONDS_IN_DAY=864e5,Le.MILLISECONDS_IN_YEAR=31536e6,Le.DEFAULT_LANG="en",Le.relativeTimeFormat=new Intl.RelativeTimeFormat("undefined"!=typeof window?window.navigator?.language:Ne.DEFAULT_LANG,{numeric:"auto",style:"long"});var De=n(156),Re=n.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 Be{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,n,i,r,s,a,o,c){this.expression=e.trim();const l=`${this.expression}_${r??""}`;this.parsedFunction=this.cache[l],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[l]=this.parsedFunction,this.interpreter.import("config",n),this.interpreter.import("util",this.util)),this.entityState=i?t.states[i]: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("action",(e=>{e.action=e?.action||"call-service",function(e,t){const n=new CustomEvent(Ve,{detail:t,bubbles:!0,composed:!0});e.dispatchEvent(n)}(r,{actionConfig:e,entityId:i,svgElementInfo:o,ruleInfo:c})}));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 Fe(e){return null==e}Be.cache={},Be.interpreter=new(Re())({ecmaVer:2019,sandBox:!0}),Be.util={color:class{static miredToRGB(e){return this.kelvinToRGB(1e6/e)}static kelvinToRGB(e){const t=e/100;let n,i,r;return t<=66?(n=255,i=t,i=99.4708025861*Math.log(i)-161.1195681661,t<=19?r=0:(r=t-10,r=138.5177312231*Math.log(r)-305.0447927307)):(n=t-60,n=329.698727446*Math.pow(n,-.1332047592),i=t-60,i=288.1221695283*Math.pow(i,-.0755148492),r=255),[Math.min(Math.max(Math.round(n),0),255),Math.min(Math.max(Math.round(i),0),255),Math.min(Math.max(Math.round(r),0),255)]}},date:Le};var je={isNothing:Fe,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:Fe(e)?[]:[e]},repeat:function(e,t){var n,i="";for(n=0;n<t;n+=1)i+=e;return i},isNegativeZero:function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:function(e,t){var n,i,r,s;if(t)for(n=0,i=(s=Object.keys(t)).length;n<i;n+=1)e[r=s[n]]=t[r];return e}};function Ue(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),i+" "+n):i}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,n,i,r){var s="",a="",o=Math.floor(r/2)-1;return i-t>o&&(t=i-o+(s=" ... ").length),n-i>o&&(n=i+o-(a=" ...").length),{str:s+e.slice(t,n).replace(/\t/g,"→")+a,pos:i-t+s.length}}function Ge(e,t){return je.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 n,i=/\r?\n|\r|\0/g,r=[0],s=[],a=-1;n=i.exec(e.buffer);)s.push(n.index),r.push(n.index+n[0].length),e.position<=n.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=je.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+=je.repeat(" ",t.indent)+Ge((e.line+1).toString(),h)+" | "+c.str+"\n",l+=je.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+=je.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 Xe=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(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===Je.indexOf(this.kind))throw new qe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function Ke(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,i){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=i)})),n[t]=e})),n}function Qe(e){return this.extend(e)}Qe.prototype.extend=function(e){var t=[],n=[];if(e instanceof Xe)n.push(e);else if(Array.isArray(e))n=n.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&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof Xe))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.")})),n.forEach((function(e){if(!(e instanceof Xe))throw new qe("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(Qe.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=Ke(i,"implicit"),i.compiledExplicit=Ke(i,"explicit"),i.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(i);return n}(i.compiledImplicit,i.compiledExplicit),i};var Ze=Qe,et=new Xe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),tt=new Xe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),nt=new Xe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}}),it=new Ze({explicit:[et,tt,nt]});var rt=new Xe("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 Xe("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 Xe("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n=e.length,i=0,r=!1;if(!n)return!1;if("-"!==(t=e[i])&&"+"!==t||(t=e[++i]),"0"===t){if(i+1===n)return!0;if("b"===(t=e[++i])){for(i++;i<n;i++)if("_"!==(t=e[i])){if("0"!==t&&"1"!==t)return!1;r=!0}return r&&"_"!==t}if("x"===t){for(i++;i<n;i++)if("_"!==(t=e[i])){if(!at(e.charCodeAt(i)))return!1;r=!0}return r&&"_"!==t}if("o"===t){for(i++;i<n;i++)if("_"!==(t=e[i])){if(!ot(e.charCodeAt(i)))return!1;r=!0}return r&&"_"!==t}}if("_"===t)return!1;for(;i<n;i++)if("_"!==(t=e[i])){if(!ct(e.charCodeAt(i)))return!1;r=!0}return!(!r||"_"===t)},construct:function(e){var t,n=e,i=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(i=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return i*parseInt(n.slice(2),2);if("x"===n[1])return i*parseInt(n.slice(2),16);if("o"===n[1])return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!je.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 Xe("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,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||je.isNegativeZero(e))},represent:function(e,t){var n;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(je.isNegativeZero(e))return"-0.0";return n=e.toString(10),ut.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),dt=it.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 vt=new Xe("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,n,i,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(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,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(n,i,r,s,a,o,l)),h&&c.setTime(c.getTime()-h),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var yt=new Xe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var xt=new Xe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,r=e.length,s=bt;for(n=0;n<r;n++)if(!((t=s.indexOf(e.charAt(n)))>64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.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(i.charAt(t));return 0===(n=r%4*6)?(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)):18===n?(o.push(a>>10&255),o.push(a>>2&255)):12===n&&o.push(a>>4&255),new Uint8Array(o)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,i="",r=0,s=e.length,a=bt;for(t=0;t<s;t++)t%3==0&&t&&(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return 0===(n=s%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}}),wt=Object.prototype.hasOwnProperty,_t=Object.prototype.toString;var St=new Xe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,s,a=[],o=e;for(t=0,n=o.length;t<n;t+=1){if(i=o[t],s=!1,"[object Object]"!==_t.call(i))return!1;for(r in i)if(wt.call(i,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 Xe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,s,a=e;for(s=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(i=a[t],"[object Object]"!==kt.call(i))return!1;if(1!==(r=Object.keys(i)).length)return!1;s[t]=[r[0],i[r[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,i,r,s,a=e;for(s=new Array(a.length),t=0,n=a.length;t<n;t+=1)i=a[t],r=Object.keys(i),s[t]=[r[0],i[r[0]]];return s}}),At=Object.prototype.hasOwnProperty;var Ct=new Xe("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(At.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),It=ft.extend({implicit:[vt,yt],explicit:[xt,St,Et,Ct]}),Tt=Object.prototype.hasOwnProperty,Pt=1,Nt=2,Mt=3,Ot=4,Lt=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]/,Bt=/[,\[\]\{\}]/,Ft=/^(?:!|!!|![a-z\-]+!)$/i,jt=/^(?:!|[^,\[\]\{\}])(?:%[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 Xt(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 Kt(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var Qt=new Array(256),Zt=new Array(256),en=0;en<256;en++)Qt[en]=Xt(en)?1:0,Zt[en]=Xt(en);function tn(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 nn(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=We(n),new qe(t,n)}function rn(e,t){throw nn(e,t)}function sn(e,t){e.onWarning&&e.onWarning.call(null,nn(e,t))}var an={YAML:function(e,t,n){var i,r,s;null!==e.version&&rn(e,"duplication of %YAML directive"),1!==n.length&&rn(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&rn(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),s=parseInt(i[2],10),1!==r&&rn(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&sn(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&rn(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],Ft.test(i)||rn(e,"ill-formed tag handle (first argument) of the TAG directive"),Tt.call(e.tagMap,i)&&rn(e,'there is a previously declared suffix for "'+i+'" tag handle'),jt.test(r)||rn(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){rn(e,"tag prefix is malformed: "+r)}e.tagMap[i]=r}};function on(e,t,n,i){var r,s,a,o;if(t<n){if(o=e.input.slice(t,n),i)for(r=0,s=o.length;r<s;r+=1)9===(a=o.charCodeAt(r))||32<=a&&a<=1114111||rn(e,"expected valid JSON character");else $t.test(o)&&rn(e,"the stream contains non-printable characters");e.result+=o}}function cn(e,t,n,i){var r,s,a,o;for(je.isObject(n)||rn(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,o=(r=Object.keys(n)).length;a<o;a+=1)s=r[a],Tt.call(t,s)||(t[s]=n[s],i[s]=!0)}function ln(e,t,n,i,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])&&rn(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"===i)if(Array.isArray(s))for(l=0,h=s.length;l<h;l+=1)cn(e,t,s[l],n);else cn(e,t,s,n);else e.json||Tt.call(n,r)||!Tt.call(t,r)||(e.line=a||e.line,e.lineStart=o||e.lineStart,e.position=c||e.position,rn(e,"duplicated mapping key")),"__proto__"===r?Object.defineProperty(t,r,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[r]=s,delete n[r];return t}function hn(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):rn(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function un(e,t,n){for(var i=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(hn(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;32===r;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return-1!==n&&0!==i&&e.lineIndent<n&&sn(e,"deficient indentation"),i}function pn(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!zt(t)))}function dn(e,t){1===t?e.result+=" ":t>1&&(e.result+=je.repeat("\n",t-1))}function fn(e,t){var n,i,r=e.tag,s=e.anchor,a=[],o=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,rn(e,"tab characters must not be used in indentation")),45===i)&&zt(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,un(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,vn(e,t,Mt,!1,!0),a.push(e.result),un(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)rn(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 gn(e){var t,n,i,r,s=!1,a=!1;if(33!==(r=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&rn(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,n="!!",r=e.input.charCodeAt(++e.position)):n="!",t=e.position,s){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&62!==r);e.position<e.length?(i=e.input.slice(t,e.position),r=e.input.charCodeAt(++e.position)):rn(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==r&&!zt(r);)33===r&&(a?rn(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),Ft.test(n)||rn(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),r=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),Bt.test(i)&&rn(e,"tag suffix cannot contain flow indicator characters")}i&&!jt.test(i)&&rn(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch(t){rn(e,"tag name is malformed: "+i)}return s?e.tag=i:Tt.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:"!"===n?e.tag="!"+i:"!!"===n?e.tag="tag:yaml.org,2002:"+i:rn(e,'undeclared tag handle "'+n+'"'),!0}function mn(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&rn(e,"duplication of an anchor property"),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&&rn(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function vn(e,t,n,i,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===n||Mt===n,i&&un(e,!0,-1)&&(g=!0,e.lineIndent>t?f=1:e.lineIndent===t?f=0:e.lineIndent<t&&(f=-1)),1===f)for(;gn(e)||mn(e);)un(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!==n||(p=Pt===n||Nt===n?t:t+1,d=e.position-e.lineStart,1===f?o&&(fn(e,d)||function(e,t,n){var i,r,s,a,o,c,l,h=e.tag,u=e.anchor,p={},d=Object.create(null),f=null,g=null,m=null,v=!1,y=!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(v||-1===e.firstTabInLine||(e.position=e.firstTabInLine,rn(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,63!==l&&58!==l||!zt(i)){if(a=e.line,o=e.lineStart,c=e.position,!vn(e,n,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))||rn(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(ln(e,p,d,f,g,null,a,o,c),f=g=m=null),y=!0,v=!1,r=!1,f=e.tag,g=e.result;else{if(!y)return e.tag=h,e.anchor=u,!0;rn(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return e.tag=h,e.anchor=u,!0;rn(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(v&&(ln(e,p,d,f,g,null,a,o,c),f=g=m=null),y=!0,v=!0,r=!0):v?(v=!1,r=!0):rn(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,l=i;if((e.line===s||e.lineIndent>t)&&(v&&(a=e.line,o=e.lineStart,c=e.position),vn(e,t,Ot,!0,r)&&(v?g=e.result:m=e.result),v||(ln(e,p,d,f,g,m,a,o,c),f=g=m=null),un(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==l)rn(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&ln(e,p,d,f,g,null,a,o,c),y&&(e.tag=h,e.anchor=u,e.kind="mapping",e.result=p),y}(e,d,p))||function(e,t){var n,i,r,s,a,o,c,l,h,u,p,d,f=!0,g=e.tag,m=e.anchor,v=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(un(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&&rn(e,"expected the node content, but found ','"):rn(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++,un(e,!0,t)),n=e.line,i=e.lineStart,r=e.position,vn(e,t,Pt,!1,!0),u=e.tag,h=e.result,un(e,!0,t),d=e.input.charCodeAt(e.position),!c&&e.line!==n||58!==d||(o=!0,d=e.input.charCodeAt(++e.position),un(e,!0,t),vn(e,t,Pt,!1,!0),p=e.result),l?ln(e,s,v,u,h,p,n,i,r):o?s.push(ln(e,null,v,u,h,p,n,i,r)):s.push(h),un(e,!0,t),44===(d=e.input.charCodeAt(e.position))?(f=!0,d=e.input.charCodeAt(++e.position)):f=!1}rn(e,"unexpected end of the stream within a flow collection")}(e,p)?m=!0:(a&&function(e,t){var n,i,r,s,a=Lt,o=!1,c=!1,l=t,h=0,u=!1;if(124===(s=e.input.charCodeAt(e.position)))i=!1;else{if(62!==s)return!1;i=!0}for(e.kind="scalar",e.result="";0!==s;)if(43===(s=e.input.charCodeAt(++e.position))||45===s)Lt===a?a=43===s?Rt:Dt:rn(e,"repeat of a chomping mode identifier");else{if(!((r=Jt(s))>=0))break;0===r?rn(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?rn(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(hn(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+=je.repeat("\n",o?1+h:h):a===Lt&&o&&(e.result+="\n");break}for(i?qt(s)?(u=!0,e.result+=je.repeat("\n",o?1+h:h)):u?(u=!1,e.result+=je.repeat("\n",h+1)):0===h?o&&(e.result+=" "):e.result+=je.repeat("\n",h):e.result+=je.repeat("\n",o?1+h:h),o=!0,c=!0,h=0,n=e.position;!Ht(s)&&0!==s;)s=e.input.charCodeAt(++e.position);on(e,n,e.position,!1)}}return!0}(e,p)||function(e,t){var n,i,r;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(on(e,i,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;i=e.position,e.position++,r=e.position}else Ht(n)?(on(e,i,r,!0),dn(e,un(e,!1,t)),i=r=e.position):e.position===e.lineStart&&pn(e)?rn(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);rn(e,"unexpected end of the stream within a single quoted scalar")}(e,p)||function(e,t){var n,i,r,s,a,o;if(34!==(o=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(o=e.input.charCodeAt(e.position));){if(34===o)return on(e,n,e.position,!0),e.position++,!0;if(92===o){if(on(e,n,e.position,!0),Ht(o=e.input.charCodeAt(++e.position)))un(e,!1,t);else if(o<256&&Qt[o])e.result+=Zt[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:rn(e,"expected hexadecimal character");e.result+=Kt(s),e.position++}else rn(e,"unknown escape sequence");n=i=e.position}else Ht(o)?(on(e,n,i,!0),dn(e,un(e,!1,t)),n=i=e.position):e.position===e.lineStart&&pn(e)?rn(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}rn(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?m=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(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&&rn(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Tt.call(e.anchorMap,n)||rn(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],un(e,!0,-1),!0}(e)?function(e,t,n){var i,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(i=e.input.charCodeAt(e.position+1))||n&&Gt(i)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,a=!1;0!==h;){if(58===h){if(zt(i=e.input.charCodeAt(e.position+1))||n&&Gt(i))break}else if(35===h){if(zt(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&pn(e)||n&&Gt(h))break;if(Ht(h)){if(o=e.line,c=e.lineStart,l=e.lineIndent,un(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&&(on(e,r,s,!1),dn(e,e.line-o),r=s=e.position,a=!1),qt(h)||(s=e.position+1),h=e.input.charCodeAt(++e.position)}return on(e,r,s,!1),!!e.result||(e.kind=u,e.result=p,!1)}(e,p,Pt===n)&&(m=!0,null===e.tag&&(e.tag="?")):(m=!0,null===e.tag&&null===e.anchor||rn(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===f&&(m=o&&fn(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&&rn(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||rn(e,"unknown tag !<"+e.tag+">"),null!==e.result&&u.kind!==e.kind&&rn(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)):rn(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 yn(e){var t,n,i,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))&&(un(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(i=[],(n=e.input.slice(t,e.position)).length<1&&rn(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);i.push(e.input.slice(t,e.position))}0!==r&&hn(e),Tt.call(an,n)?an[n](e,n,i):sn(e,'unknown document directive "'+n+'"')}un(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,un(e,!0,-1)):a&&rn(e,"directives end mark is expected"),vn(e,e.lineIndent-1,Ot,!1,!0),un(e,!0,-1),e.checkLineBreaks&&Vt.test(e.input.slice(s,e.position))&&sn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&pn(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,un(e,!0,-1)):e.position<e.length-1&&rn(e,"end of the stream or a document separator is expected")}function bn(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 n=new tn(e,t),i=e.indexOf("\0");for(-1!==i&&(n.position=i,rn(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)yn(n);return n.documents}var xn={loadAll:function(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var i=bn(e,n);if("function"!=typeof t)return i;for(var r=0,s=i.length;r<s;r+=1)t(i[r])},load:function(e,t){var n=bn(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new qe("expected a single document in the stream, but found more")}}},wn=Object.prototype.toString,_n=Object.prototype.hasOwnProperty,Sn=65279,kn=9,En=10,An=13,Cn=32,In=33,Tn=34,Pn=35,Nn=37,Mn=38,On=39,Ln=42,Dn=44,Rn=45,$n=58,Vn=61,Bn=62,Fn=63,jn=64,Un=91,Hn=93,qn=96,zn=123,Gn=124,Wn=125,Yn={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"},Jn=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Xn=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Kn(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else{if(!(e<=4294967295))throw new qe("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+je.repeat("0",i-t.length)+t}var Qn=1,Zn=2;function ei(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=je.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,i,r,s,a,o,c;if(null===t)return{};for(n={},r=0,s=(i=Object.keys(t)).length;r<s;r+=1)a=i[r],o=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(c=e.compiledTypeMap.fallback[a])&&_n.call(c.styleAliases,o)&&(o=c.styleAliases[o]),n[a]=o;return n}(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?Zn:Qn,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 ti(e,t){for(var n,i=je.repeat(" ",t),r=0,s=-1,a="",o=e.length;r<o;)-1===(s=e.indexOf("\n",r))?(n=e.slice(r),r=o):(n=e.slice(r,s+1),r=s+1),n.length&&"\n"!==n&&(a+=i),a+=n;return a}function ni(e,t){return"\n"+je.repeat(" ",e.indent*t)}function ii(e){return e===Cn||e===kn}function ri(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==Sn||65536<=e&&e<=1114111}function si(e){return ri(e)&&e!==Sn&&e!==An&&e!==En}function ai(e,t,n){var i=si(e),r=i&&!ii(e);return(n?i:i&&e!==Dn&&e!==Un&&e!==Hn&&e!==zn&&e!==Wn)&&e!==Pn&&!(t===$n&&!r)||si(t)&&!ii(t)&&e===Pn||t===$n&&r}function oi(e,t){var n,i=e.charCodeAt(t);return i>=55296&&i<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(i-55296)+n-56320+65536:i}function ci(e){return/^\n* /.test(e)}var li=1,hi=2,ui=3,pi=4,di=5;function fi(e,t,n,i,r,s,a,o){var c,l=0,h=null,u=!1,p=!1,d=-1!==i,f=-1,g=function(e){return ri(e)&&e!==Sn&&!ii(e)&&e!==Rn&&e!==Fn&&e!==$n&&e!==Dn&&e!==Un&&e!==Hn&&e!==zn&&e!==Wn&&e!==Pn&&e!==Mn&&e!==Ln&&e!==In&&e!==Gn&&e!==Vn&&e!==Bn&&e!==On&&e!==Tn&&e!==Nn&&e!==jn&&e!==qn}(oi(e,0))&&function(e){return!ii(e)&&e!==$n}(oi(e,e.length-1));if(t||a)for(c=0;c<e.length;l>=65536?c+=2:c++){if(!ri(l=oi(e,c)))return di;g=g&&ai(l,h,o),h=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if((l=oi(e,c))===En)u=!0,d&&(p=p||c-f-1>i&&" "!==e[f+1],f=c);else if(!ri(l))return di;g=g&&ai(l,h,o),h=l}p=p||d&&c-f-1>i&&" "!==e[f+1]}return u||p?n>9&&ci(e)?di:a?s===Zn?di:hi:p?pi:ui:!g||a||r(e)?s===Zn?di:hi:li}function gi(e,t,n,i,r){e.dump=function(){if(0===t.length)return e.quotingType===Zn?'""':"''";if(!e.noCompatMode&&(-1!==Jn.indexOf(t)||Xn.test(t)))return e.quotingType===Zn?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),o=i||e.flowLevel>-1&&n>=e.flowLevel;switch(fi(t,o,e.indent,a,(function(t){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n<i;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}),e.quotingType,e.forceQuotes&&!i,r)){case li:return t;case hi:return"'"+t.replace(/'/g,"''")+"'";case ui:return"|"+mi(t,e.indent)+vi(ti(t,s));case pi:return">"+mi(t,e.indent)+vi(ti(function(e,t){var n,i,r=/(\n+)([^\n]*)/g,s=(o=e.indexOf("\n"),o=-1!==o?o:e.length,r.lastIndex=o,yi(e.slice(0,o),t)),a="\n"===e[0]||" "===e[0];var o;for(;i=r.exec(e);){var c=i[1],l=i[2];n=" "===l[0],s+=c+(a||n||""===l?"":"\n")+yi(l,t),a=n}return s}(t,a),s));case di:return'"'+function(e){for(var t,n="",i=0,r=0;r<e.length;i>=65536?r+=2:r++)i=oi(e,r),!(t=Yn[i])&&ri(i)?(n+=e[r],i>=65536&&(n+=e[r+1])):n+=t||Kn(i);return n}(t)+'"';default:throw new qe("impossible error: invalid scalar style")}}()}function mi(e,t){var n=ci(e)?String(t):"",i="\n"===e[e.length-1];return n+(i&&("\n"===e[e.length-2]||"\n"===e)?"+":i?"":"-")+"\n"}function vi(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function yi(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,s=0,a=0,o=0,c="";n=r.exec(e);)(o=n.index)-s>t&&(i=a>s?a:o,c+="\n"+e.slice(s,i),s=i+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 bi(e,t,n,i){var r,s,a,o="",c=e.tag;for(r=0,s=n.length;r<s;r+=1)a=n[r],e.replacer&&(a=e.replacer.call(n,String(r),a)),(wi(e,t+1,a,!0,!0,!1,!0)||void 0===a&&wi(e,t+1,null,!0,!0,!1,!0))&&(i&&""===o||(o+=ni(e,t)),e.dump&&En===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=c,e.dump=o||"[]"}function xi(e,t,n){var i,r,s,a,o,c;for(s=0,a=(r=n?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(n?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]"===wn.call(o.represent))i=o.represent(t,c);else{if(!_n.call(o.represent,c))throw new qe("!<"+o.tag+'> tag resolver accepts not "'+c+'" style');i=o.represent[c](t,c)}e.dump=i}return!0}return!1}function wi(e,t,n,i,r,s,a){e.tag=null,e.dump=n,xi(e,n,!1)||xi(e,n,!0);var o,c=wn.call(e.dump),l=i;i&&(i=e.flowLevel<0||e.flowLevel>t);var h,u,p="[object Object]"===c||"[object Array]"===c;if(p&&(u=-1!==(h=e.duplicates.indexOf(n))),(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)i&&0!==Object.keys(e.dump).length?(!function(e,t,n,i){var r,s,a,o,c,l,h="",u=e.tag,p=Object.keys(n);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="",i&&""===h||(l+=ni(e,t)),o=n[a=p[r]],e.replacer&&(o=e.replacer.call(n,a,o)),wi(e,t+1,a,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&En===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=ni(e,t)),wi(e,t+1,o,!0,c)&&(e.dump&&En===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,n){var i,r,s,a,o,c="",l=e.tag,h=Object.keys(n);for(i=0,r=h.length;i<r;i+=1)o="",""!==c&&(o+=", "),e.condenseFlow&&(o+='"'),a=n[s=h[i]],e.replacer&&(a=e.replacer.call(n,s,a)),wi(e,t,s,!1,!1)&&(e.dump.length>1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),wi(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)i&&0!==e.dump.length?(e.noArrayIndent&&!a&&t>0?bi(e,t-1,e.dump,r):bi(e,t,e.dump,r),u&&(e.dump="&ref_"+h+e.dump)):(!function(e,t,n){var i,r,s,a="",o=e.tag;for(i=0,r=n.length;i<r;i+=1)s=n[i],e.replacer&&(s=e.replacer.call(n,String(i),s)),(wi(e,t,s,!1,!1)||void 0===s&&wi(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&&gi(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 _i(e,t){var n,i,r=[],s=[];for(Si(e,r,s),n=0,i=s.length;n<i;n+=1)t.duplicates.push(r[s[n]]);t.usedDuplicates=new Array(i)}function Si(e,t,n){var i,r,s;if(null!==e&&"object"==typeof e)if(-1!==(r=t.indexOf(e)))-1===n.indexOf(r)&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,s=e.length;r<s;r+=1)Si(e[r],t,n);else for(r=0,s=(i=Object.keys(e)).length;r<s;r+=1)Si(e[i[r]],t,n)}function ki(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 Ei={Type:Xe,Schema:Ze,FAILSAFE_SCHEMA:it,JSON_SCHEMA:dt,CORE_SCHEMA:ft,DEFAULT_SCHEMA:It,load:xn.load,loadAll:xn.loadAll,dump:{dump:function(e,t){var n=new ei(t=t||{});n.noRefs||_i(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),wi(n,0,i,!0,!0)?n.dump+"\n":""}}.dump,YAMLException:qe,types:{binary:xt,float:pt,map:nt,null:rt,pairs:Et,set:Ct,timestamp:vt,bool:st,int:lt,merge:yt,omap:St,seq:tt,str:et},safeLoad:ki("safeLoad","load"),safeLoadAll:ki("safeLoadAll","loadAll"),safeDump:ki("safeDump","dump")};class Ai{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,n){e.dataset[t]=n}static getStyles(e){const t={};let n;for(let i=0;i<e.style.length;i++)n=e.style.item(i),t[n]=e.style.getPropertyValue(n);return t}static setStyle(e,t){const n=(t??[]).split(";").map((e=>e.trim())).filter((e=>e.length));for(let t=0;t<n.length;t++){const i=n[t].split(":").map((e=>e.trim())),r=i[1].includes("!important");i[1]=i[1].replace(/!important/g,"").trim(),e.style.setProperty(i[0],i[1],r?"important":"")}}static setText(e,t,n){e instanceof SVGTextElement||(e=e.querySelector("text")||e),"string"!=typeof t&&"boolean"!=typeof t&&Number.isFinite(Number(t))&&(t=Number(t).toString());const i=t.replace(/\\n/g,"\n").split("\n"),r=i.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=n||"1em";i.forEach(((t,n)=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");if(i.textContent=t,i.setAttribute("x",o),i.setAttribute("dy",n>=1?c:"0"),a){const e=a.getAttribute("style");e&&i.setAttribute("style",e)}e.appendChild(i)}))}else{(s||e).textContent=t}}static waitForChildNodes(e,t,n){return new Promise(((i,r)=>{const s=setTimeout((()=>r("Timeout waiting for child element(s) to load")),n);new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&t.addedNodes.length)return clearTimeout(s),i()})).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 Ei.load(e)}static async fetchText(e,t,n,i){n&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${n}/`)),e=i?e:Ai.cacheBuster(e);const r=new Request(e,{cache:i?"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,n,i){t&&(e=e.replace(/^\/local\/floorplan\/examples\//g,`${n}/`)),e=i?e:Ai.cacheBuster(e);const r=new Request(e,{cache:i?"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,${Ai.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 n=window.btoa(t);for(;n.length%4>0;)n+="=";return n}static cacheBuster(e){return`${e}${e.includes("?")?"&":"?"}_=${(new Date).getTime()}`}static equal(e,t){if(e===t)return!0;const n=Array.isArray(e),i=Array.isArray(t);let r=0;if(n&&i){if(e.length!=t.length)return!1;for(r=0;r<e.length;r++)if(!Ai.equal(e[r],t[r]))return!1;return!0}if(n!=i)return!1;if(e&&t&&"object"==typeof e&&"object"==typeof t){const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;const i=e instanceof Date,s=t instanceof Date;if(i&&s)return e.getTime()==t.getTime();if(i!=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<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r]))return!1;for(r=0;r<n.length;r++)if(!Ai.equal(e[n[r]],t[n[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 Ci{constructor(e,t,n){this.element=e,this.logLevel=t,this.consoleLogLevel=n,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,n=!1){const i=`${Ai.formatDate(new Date)} ${e.toUpperCase()} ${t}`,r=this.logLevel&&this.logLevelGroups[this.logLevel.toLowerCase()],s=r?.length&&r.includes(e.toLowerCase());if((n||s)&&this.element){const t=document.createElement("li");Ai.addClass(t,e),t.textContent=i,this.element.querySelector("ul")?.prepend(t),this.element.style.display="block"}this.consoleLog(e,t,n)}consoleLog(e,t,n=!1){const i=`${Ai.formatDate(new Date)} ${e.toUpperCase()} ${t}`,r=this.consoleLogLevel&&this.logLevelGroups[this.consoleLogLevel.toLowerCase()],s=r?.length&&r.includes(e.toLowerCase());if(n||s)switch(e){case"error":console.error(i);break;case"warn":case"warning":console.warn(i);break;case"info":console.info(i);break;default:console.log(i)}}}var Ii=function(e,t,n,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,n,a):r(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a};const Ti=Ee;console.info("%cFloorplan for Home Assistant (ha-floorplan)%c\nVersion 1.1.2","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: rgb(71, 170, 238)");let Pi=class extends se{constructor(){super(),this.pageInfos={},this.entityInfos={},this.elementInfos={},this.cssRules=[],this.functions={},this.variables={},this.svgElements={},this.isRulesLoaded=!1,window.onerror=this.handleWindowError.bind(this)}render(){return F`
<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=Ai.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))}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 Ci(this.logElement,e.log_level,e.console_log_level),this.logInfo("INIT","Floorplan for Home Assistant (ha-floorplan) v1.1.2"),!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 n;try{n=await Ai.fetchText(e,this.isDemo,this.examplespath,t)}catch(t){throw this.logError("CONFIG",`Error loading config: ${e}`),t}return Ei.load(n)}return JSON.parse(JSON.stringify(e))}loadScript(e,t){return e?new Promise(((n,i)=>{const r=document.createElement("script");r.src=t?e:Ai.cacheBuster(e),r.onload=()=>n(),r.onerror=e=>{i(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 n=e.find((e=>void 0===e.config.master_page));n&&(n.isDefault=!0),await this.loadPageFloorplanSvg(t,t);const i=e.filter((e=>e!==t));for(const e of i)await this.loadPageFloorplanSvg(e,t);this.svg=t.svg}async loadPageConfig(e,t){const n=await this.loadConfig(e,!1),i=this.createPageInfo(n);return i.index=t,i}async loadPageFloorplanSvg(e,t){const n=this.getBestImage(e.config),i=await this.loadFloorplanSvg(n,e,t);i.id=e.config.page_id,e.svg=i,await this.loadStyleSheet(e.config.stylesheet),this.initFloorplanRules(e.svg,e.config)}getBestImage(e){let t="",n=!0;if(void 0===e?.image)throw"No image provided in configuration.";if("string"==typeof e.image)t=Ai.isMobile&&"string"==typeof e.image_mobile?e.image_mobile:e.image;else if(e.image?.sizes){const i=!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(i>=r.min_width){t=r.location,n=!0===r.cache;break}}else Ai.isMobile&&e.image_mobile?(t=e.image_mobile.location,n=!0===e.image_mobile.cache):(t=e.image.location,n=!0===e.image.cache);return{location:t,cache:n}}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 n="string"!=typeof e&&!0===e?.cache;let i;try{i=await Ai.fetchText(t,this.isDemo,this.examplespath,n)}catch(e){throw this.logError("STYLESHEET",`Error loading stylesheet: ${t}`),e}const r=document.createElement("style"),s=()=>{r.innerHTML=i,this.shadowRoot?.appendChild(r)};try{await Ai.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 n=e;n.styleSheet&&(t=n.styleSheet?.cssRules??n.styleSheet?.rules)}return t?Ai.getArray(t):[]}async loadFloorplanSvg(e,t,n){let i;try{i=await Ai.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=i;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&&n){const e=n.config.page_id,i=n.config.master_page.content_element;if(t.config.page_id===e)this.floorplanElement&&this.replaceChildrenUtil(this.floorplanElement,s);else{const e=this.floorplanElement.querySelector("#"+i),t=Number.parseFloat(s.getAttribute("height")),n=Number.parseFloat(s.getAttribute("width"));s.getAttribute("viewBox")||s.setAttribute("viewBox",`0 0 ${n} ${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,n,i,r){try{return e.toLowerCase().includes(".svg")||"svg"===t.svgElement.nodeName||t.svgElement.querySelector("svg")?await this.loadSvgImage(e,t,n,i,r):await this.loadBitmapImage(e,t,n,i,r)}catch(t){this.logError("IMAGE",`Could not initialize image: ${e}, error: ${t}`)}}async loadBitmapImage(e,t,n,i,r){e=r?e:Ai.cacheBuster(e),this.logDebug("IMAGE",`${n} (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,n,void 0,i),s.onmouseover=()=>{this.handleEntityIdSetHoverOver(n,t)}),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),s}async loadSvgImage(e,t,n,i,r){let s;if(e?.trim().length)try{s=await Ai.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",`${n} (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,n,void 0,i),t.svgElement.onmouseover=()=>{this.handleEntityIdSetHoverOver(n,t)},o}_querySelectorAll(e,t=void 0,n){let i=t?Array.from(e.querySelectorAll(t).values()):[];return i=n?[e].concat(i):i,i}replaceElement(e,t){const n=e.parentElement;for(const n of Array.from(e.classList))t.classList.add(n);return this._querySelectorAll(e,"*",!0).forEach((e=>{Ti.off(e,"click"),Ti.off(e,"longClick"),e.remove()})),e.remove(),n?.appendChild(t),t}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,n;if("string"==typeof e?t=e:(t=e.name,n=e.value,e.value&&(n=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:n,last_changed:(new Date).toString(),last_updated:(new Date).toString(),attributes:{},context:{}}),this.setVariable(t,n,{},!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 n=this._querySelectorAll(e,"*",!0);for(const e of n)e.id&&(this.svgElements[e.id]=e);this.initRules(t,e,n)}initRules(e,t,n){if(e.functions&&(this.functions=this.evaluate(e.functions)),e.defaults){const t=e.defaults;for(const n of e.rules)n.hover_action=void 0===n.hover_action?t.hover_action:n.hover_action,n.state_action=void 0===n.state_action?t.state_action:n.state_action,n.tap_action=void 0===n.tap_action?t.tap_action:n.tap_action,n.hold_action=void 0===n.hold_action?t.hold_action:n.hold_action,n.hover_info_filter=void 0===n.hover_info_filter?t.hover_info_filter:n.hover_info_filter,n.double_tap_action=void 0===n.double_tap_action?t.double_tap_action:n.double_tap_action}for(const i of e.rules)i.entity||i.entities?this.initEntityRule(i,t,n):(i.element||i.elements)&&this.initElementRule(i,t,n)}initEntityRule(e,t,n){const i=this.initGetEntityRuleEntities(e);for(const t of i){const i=t.entityId;let r=this.entityInfos[i];r||(r={entityId:i,ruleInfos:[],lastState:void 0},this.entityInfos[i]=r);const s=new ge(e);r.ruleInfos.push(s);for(const e of t.elementIds){const t=n.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,i,void 0,s)}}}initGetEntityRuleEntities(e){const t=[];e.groups=e.groups?e.groups:[];for(const n of e.groups){const e=this.hass.states[n];if(e)for(const n of e.attributes.entity_id)this.addTargetEntity(n,[n],t);else this.logWarning("CONFIG",`Cannot find '${n}' in Home Assistant groups`)}e.entities=e.entities?e.entities:[],e.entities=e.entity?e.entities.concat(e.entity):e.entities;const n=e.entities.filter((e=>"string"==typeof e));for(const i of n){let n=[];e.elements?n=n.concat(e.elements):e.element?n=n.concat(this.evaluate(e.element,i,void 0)):null!==e.element&&(n=n.concat(i)),i&&"*"===i||this.addTargetEntity(i,n,t)}const i=e.entities.filter((e=>"string"!=typeof e));for(const e of i){const n=e;this.addTargetEntity(n.entity,[n.element],t)}return t}addTargetEntity(e,t,n){const i=this.hass.states[e],r="floorplan"===e.split(".")[0];i||r?n.push({entityId:e,elementIds:t}):this.logWarning("CONFIG",`Cannot find '${e}' in Home Assistant entities`)}initElementRule(e,t,n){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 i=n.find((e=>e.id===t));if(i){let n=this.elementInfos[t];n||(n={ruleInfos:[],lastState:void 0},this.elementInfos[t]=n);const r=new ge(e);n.ruleInfos.push(r);const s=this.addSvgElementToRule(i,r);this.attachClickHandlers(i,s,void 0,t,r)}else this.logWarning("CONFIG",`Cannot find '${t}' in SVG file`)}}}attachClickHandlers(e,t,n,i,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,n,i,t,r,e);if(e&&!s&&Ti.on(a,"click",this.onClick.bind(c)),s){const o=!!s&&new me(this,n,i,t,r,s);Pe.observe(a),e&&Ti.on(a,"singleClick",this.onClick.bind(c)),Ti.on(a,"doubleClick",this.onLongClick.bind(o))}a.style&&(a.style.cursor="pointer"),Ai.addClass(a,"floorplan-click"+(o?"":"-child"))}if(r?.rule?.hold_action){const e=this.getActionConfigs(r.rule.hold_action),s=new me(this,n,i,t,r,e);Ce.observe(a),Ti.on(a,"longClick",this.onLongClick.bind(s)),a.style&&(a.style.cursor="pointer"),Ai.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 n=this.generateSvgElementInfo(e);return t.svgElementInfos[e.id]=n,n}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,n=Object.keys(this.hass.states),i=Ai.deviceId();for(const r of n)if(r!==`sensor.ha_floorplan_${i}`||t.has(r)){const n=this.entityInfos[r];if(n){const i=this.hass.states[r];if(e)this.logDebug("STATE",`${r}: ${i.state} (initial load)`),t.has(r)||t.add(r);else if(n.lastState){const e=i.state;i.last_changed!==n.lastState.last_changed?(this.logDebug("STATE",`${r}: ${e} (last changed ${Ai.formatDate(n.lastState.last_changed)})`),t.has(r)||t.add(r)):Ai.equal(n.lastState.attributes,i.attributes)||(this.logDebug("STATE",`${r}: attributes (last updated ${Ai.formatDate(n.lastState.last_changed)})`),t.has(r)||t.add(r))}}}else t.add(r);return t}async handleEntity(e){const t=this.hass.states[e],n=this.entityInfos[e];if(n){n.lastState=Object.assign({},t);for(const e of n.ruleInfos){const t=Object.values(e.svgElementInfos);if(t.length)for(const i of t)i.svgElement&&this.handleActions(e.rule.state_action,n.entityId,i,e);else this.handleActions(e.rule.state_action,n.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 n=this.entityInfos[e];n&&this.handleEntitySetHoverOver(n,t)}handleEntitySetHoverOver(e,t){const n=e.entityId,i=this.hass.states[n];for(const n of e.ruleInfos)if(n.rule.hover_action){let r="string"==typeof n.rule.hover_action&&"hover-info"===n.rule.hover_action;if(r=r||"object"==typeof n.rule.hover_action&&"hover-info"===n.rule.hover_action.action,r=r||Array.isArray(n.rule.hover_action)&&n.rule.hover_action.some((e=>"hover-info"===e.action)),r){const e=new Set(n.rule.hover_info_filter);for(const t of Object.values(n.svgElementInfos))Ai.addClass(t.svgElement,"floorplan-hover"),t.svgElement.style.cursor="pointer",t.svgElement.querySelectorAll("title").forEach((t=>{let n=`${i.attributes.friendly_name}\n`;n+=`State: ${i.state}\n\n`,Object.keys(i.attributes).map((t=>{e.has(t)||(n+=`${t}: ${i.attributes[t]}\n`)})),n+="\n",n+=`Last changed: ${Le.timeago(i.last_changed)}\n`,n+=`Last updated: ${Le.timeago(i.last_updated)}`,t.textContent=n}))}else n.rule.hover_action&&this.handleActions(n.rule.hover_action,e.entityId,t,n)}}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 n=e.rules.filter((e=>e.entities&&e.elements));n.length&&(this.logError("CONFIG","A rule cannot contain both 'entities' and 'elements' in floorplan configuration"),t=!1),n=e.rules.filter((e=>!(e.entity||e.entities||e.element||e.elements))),n.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,n,i,r){if("string"!=typeof e||!Be.isCode(e))return e;try{return Be.evaluate(e,this.hass,this.config,t,n,this.svgElements,this.functions,i,r)}catch(i){return this.handleError(i,{expression:e,entityId:t,hass:this.hass,svgElement:n})}}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,n=t.instance;setTimeout((()=>{n.handleActions(t.actions,t.entityId,t.svgElementInfo,t.ruleInfo)}),300)}handleActions(e,t,n,i){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 i=this.evaluate(e.navigation_path,t,n?.svgElement);de(0,i,e.navigation_replace??!1)}break;case"url":if(this.isDemo)this.notify(`Performing action: ${e.action} ${e.url_path}`);else{const i=e.same_tab?"_self":"_blank",r=this.evaluate(e.url_path,t,n?.svgElement);window.open(r,i)}break;case"toggle":if(t){const e={action:"call-service",service:"homeassistant.toggle",service_data:{entity_id:t}};this.callService(e,t,n,i)}break;case"call-service":if(!e.service)return;this.callService(e,t,n,i);break;case"fire-dom-event":pe(this,"ll-custom",e)}}}getSvgElementsFromServiceData(e,t){let n=[],i=[];if(Array.isArray(e?.elements)&&(i=i.concat(e?.elements)),"string"==typeof e?.element&&(i=i.concat([e?.element])),i.length)for(const e of i)n=n.concat(this._querySelectorAll(this.svg,`#${e.replace(/\./g,"\\.")}`,!1));else t&&(n=[t]);return n}getServiceData(e,t,n){let i={};if("object"==typeof e.service_data)for(const r of Object.keys(e.service_data))i[r]=this.evaluate(e.service_data[r],t,n);else if("string"==typeof e.service_data){const r=this.evaluate(e.service_data,t,n);i="string"==typeof r&&r.trim().startsWith("{")?JSON.parse(r):r}else void 0!==e.service_data&&(i=e.service_data);return i}executeServiceData(e,t,n,i,r){try{if("object"==typeof e.service_data)for(const s of Object.keys(e.service_data))this.evaluate(e.service_data[s],t,n,i,r);else"string"==typeof e.service_data?this.evaluate(e.service_data,t,n,i,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,n,i){const r=this.evaluate(e.service,t,n?.svgElement),[s,a]=r.split(".",2);if("floorplan"===s)this.callFloorplanService(s,a,e,t,n,i);else this.callHomeAssistantService(s,a,e,t,n)}callFloorplanService(e,t,n,i,r,s){const a=r?.svgElement??void 0;let o,c,l,h,u,p,d,f,g=[],m=null;switch(m=!["execute"].includes(t)?this.getServiceData(n,i,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(n,i,e)),l="string"==typeof m?m:m.class,Ai.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(n,i,e)),l="string"==typeof m?m:m.class,Ai.setClass(e,l);break;case"dataset_set":{let e,t;if("string"==typeof m){const n=m.split(":");if(n.length<2){this.logError("FLOORPLAN_ACTION",`Service data "${m}" is not a valid dataset key value pair.`);break}e=n[1],t=n[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(n,i,s)),Ai.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(n,i,e)),h="string"==typeof m?m:m.style,Ai.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(n,i,e)),d="string"==typeof m?m:m.text;const t=n.service_data?.shift_y_axis?n.service_data?.shift_y_axis:"1em";Ai.setText(e,d,t)}break;case"image_set":let e;if("object"==typeof n?.service_data){if(n?.service_data?.elements){this.logError("CONFIG","Multiple elements are not supported in service data.");break}if(n?.service_data?.element&&"string"==typeof n?.service_data?.element){if(n?.service_data?.image_refresh_interval){this.logError("CONFIG","Image refresh interval is not supported with element as service data.");break}e=n?.service_data?.element}}if(e){const e=this.getSvgElementsFromServiceData(n?.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||n?._is_internal_action_scope)){let e;if(m=this.getServiceData(n,i,r?.svgElement),void 0!==typeof m)if(n&&n._is_internal_action_scope){m=n?.service_data;const t=n?.service_data;if(null!==t?.image&&("string"==typeof t?.image&&(e=t?.image),"object"==typeof t?.image)){const n=t?.image;"location"in n&&"string"==typeof n.location&&(e=n.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=n?._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&&!n?._is_internal_action_scope&&(s.imageLoader=setInterval(this.loadImage.bind(this),1e3*u,e,r,i,s,p)),!e)break;this.loadImage(e,r,i,s,p)}break;case"page_navigate":m=this.getServiceData(n,i,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"variable_set":if(m=this.getServiceData(n,i,r?.svgElement),m.variable){const e={};if(m.attributes){const t=m.attributes;for(const n of Object.keys(t))e[n]=this.getActionValue(t[n],i,a)}const t=m,n=this.getActionValue(t,i,a);this.setVariable(m.variable,n,e,!1)}break;case"execute":this.executeServiceData(n,i,r?.svgElement,r,s);for(const e of g)f=1===g.length&&g[0]===r?.svgElement,f||this.executeServiceData(n,i,e,r,s)}}getActionValue(e,t,n){let i=e.value;return e.value&&(i=this.evaluate(e.value,t,n)),i}setVariable(e,t,n,i){if(this.variables[e]=t,this.hass.states[e]){this.hass.states[e].state=t.toString();for(const t of Object.keys(n))this.hass.states[e].attributes[t]=n[t]}for(const e of Object.keys(this.variables)){const t=this.hass.states[e];t&&(t.last_changed=(new Date).toString())}i||this.handleEntities()}callHomeAssistantService(e,t,n,i,r){const s=this.getServiceData(n,i,r?.svgElement);"object"==typeof s&&(null===s.entity_id||Array.isArray(s.entity_id)&&!s.entity_id.length||!s.entity_id&&i&&(s.entity_id=i)),this.hass.callService(e,t,s),this.isDemo&&this.notify(`Calling service: ${e}.${t} (${s.entity_id})`)}handleEventActionCall(e){const t=e,{actionConfig:n,entityId:i,svgElementInfo:r,ruleInfo:s}=t.detail;n._is_internal_action_scope=!0,this.handleActions(n,i,r,s)}handleWindowError(e,t,n,i,r){if(e.toLowerCase().includes("script error"))this.logError("SCRIPT","Script error: See browser console for detail");else{const s=[e,"URL: "+t,"Line: "+n+", column: "+i,"Error: "+JSON.stringify(r)].join("<br>");this.logError("ERROR",s)}return!1}handleError(e,t){console.error(e,t);let n="Error";"string"==typeof e&&(n=e),e.message?n=`${e.message} (See console for more info)`:e.stack&&(n=`${e.stack}`),this.logger.log("error",n)}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}`)}};Ii([le({type:String})],Pi.prototype,"examplespath",void 0),Ii([le({type:Object})],Pi.prototype,"hass",void 0),Ii([le({type:String||Object})],Pi.prototype,"_config",void 0),Ii([le({type:Boolean})],Pi.prototype,"isDemo",void 0),Ii([le({type:Boolean})],Pi.prototype,"isShowLog",void 0),Ii([le({type:Function})],Pi.prototype,"notify",void 0),Pi=Ii([oe("floorplan-element")],Pi);
/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const Ni=e=>null!=e?e:U,Mi=1;class Oi{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$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 Li=(e=>(...t)=>({_$litDirective$:e,values:t}))(class extends Oi{constructor(e){var t;if(super(e),e.type!==Mi||"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,n)=>{const i=e[n];return null==i?t:t+`${n=n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(e,[t]){const{style:n}=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("-")?n.removeProperty(e):n[e]="")}));for(const e in t){const i=t[e];null!=i&&(this.vt.add(e),e.includes("-")?n.setProperty(e,i):n[e]=i)}return j}});var Di,Ri=function(e,t,n,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,n,a):r(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a};let $i=Di=class extends se{constructor(){super(...arguments),this.styles={dummy:`calc(100vh - ${this.appHeaderHeight}px - ${this.cardHeaderHeight}px)`}}render(){return this.config?F`
<ha-card>
${this.isDisplayCardHeader?F` <h1 class="card-header">${this.config?.title}</h1> `:""}
<div class="content" style=${Li(this.styles)}>
<floorplan-element
.examplespath=${this.examplespath}
.hass=${this.hass}
._config=${this.config?.config}
.isDemo=${this.isDemo}
.notify=${this.notify}
data-floorplan-ref=${Ni(`element-${this.config?.title}`)}
></floorplan-element>
</div>
</ha-card>
`:F``}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?Di.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)}};$i.cardHeaderHeight=76,Ri([le({type:Object})],$i.prototype,"hass",void 0),Ri([le({type:Boolean})],$i.prototype,"isPanel",void 0),Ri([le({type:Boolean})],$i.prototype,"editMode",void 0),Ri([le({type:Object})],$i.prototype,"config",void 0),Ri([le({type:String})],$i.prototype,"examplespath",void 0),Ri([le({type:Boolean})],$i.prototype,"isDemo",void 0),Ri([le({type:Function})],$i.prototype,"notify",void 0),$i=Di=Ri([oe("floorplan-card")],$i);var Vi,Bi=function(e,t,n,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,n,a):r(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a};let Fi=Vi=class extends se{constructor(){super(...arguments),this.styles={height:"calc(100vh)"}}render(){return F`
<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=${Li(this.styles)}>
<floorplan-element .examplespath=${this.examplespath} .hass=${this.hass}
._config=${this.panel?.config?.config} .isDemo=${this.isDemo} .notify=${this.notify}
data-floorplan-ref=${Ni(`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?Vi.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)}};Fi.appHeaderHeight=64,Bi([le({type:Object})],Fi.prototype,"hass",void 0),Bi([le({type:Boolean})],Fi.prototype,"narrow",void 0),Bi([le({type:Object})],Fi.prototype,"panel",void 0),Bi([le({type:Boolean})],Fi.prototype,"showSideBar",void 0),Bi([le({type:Boolean})],Fi.prototype,"showAppHeader",void 0),Bi([le({type:String})],Fi.prototype,"examplespath",void 0),Bi([le({type:Boolean})],Fi.prototype,"isDemo",void 0),Bi([le({type:Function})],Fi.prototype,"notify",void 0),Fi=Vi=Bi([oe("floorplan-panel")],Fi);var ji=i.c,Ui=i.E;export{ji as FloorplanCard,Ui as FloorplanPanel};