(function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n=window.webpackJsonp;window.webpackJsonp=function(o,s,l){for(var d=0,i=[],c,p,u;de}function c(e,t,n){return t=t||65,n=n||90,e&=-33,e>=t&&e<=n}function p(e){return d(e)||c(e)}function u(e){return 32===e||9===e||160===e}function m(e){return u(e)||10===e||13===e}function h(e,t,n,o){o=o?fr({},kr,o):kr;const r=e.pos;if(e.eat(t)){for(let i=1,s;!e.eof();)if(!vr(e,o))if(s=e.next(),s===t)i++;else if(s!==n)s===o.escape&&e.next();else if(i--,!i)return e.start=r,!0;if(e.pos=r,o.throws)throw e.error(`Unable to find matching pair for ${cr(t)}`)}return!1}function g(e,t,n){n=n||f;const o=t.map((e,t)=>({order:t,field:e,end:e.location+e.length})).sort((e,t)=>e.end-t.end||e.order-t.order);let r=0;const i=o.map((t)=>{const o=e.substr(t.field.location,t.field.length),i=e.slice(r,t.field.location);return r=t.end,i+n(t.field.index,o)});return i.join("")+e.slice(r)}function f(e,t){return t?`\${${e}:${t}}`:`\${${e}}`}function y(e,t){const n=e.pos;if(e.eat(Sr)){let n=x(e),o="";if(null!=n)return new Er(n,o,t);if(e.eat(wr)&&(n=x(e),null!=n&&(e.eat(Cr)&&(o=b(e)),e.eat(Tr))))return new Er(n,o,t)}e.pos=n}function b(e){let t;const n=[];for(e.start=e.pos;!e.eof();){if(t=e.peek(),t===wr)n.push(e.pos);else if(t===Tr){if(!n.length)break;n.pop()}e.next()}if(n.length)throw e.error("Unable to find matching \"}\" for curly brace at "+n.pop());return e.current()}function x(e){if(e.start=e.pos,e.eatWhile(d))return+e.current()}function v(e){return e===_r||e===Or}function k(e){const t=e.pos,n=e.prev();if(v(n))for(;!e.sol();)if(e.prev()===n&&e.peek()!==Mr)return!0;return e.pos=t,!1}function S(e){return C(e)||w(e)}function C(e){const t=e.pos;return k(e)&&e.eat(Ur)&&T(e)||(e.pos=t,!1)}function w(e){const t=e.pos;return e.eatWhile(L)&&e.eat(Ur)&&T(e)||(e.pos=t,!1)}function T(e){return e.eatWhile(E)}function E(e){return e===Br||e===Pr||A(e)||I(e)}function A(e){return e&=-33,65<=e&&90>=e}function I(e){return 47e}function N(e){return e===Rr||e===Dr}function L(e){return e&&e!==Ur&&!N(e)&&!v(e)}function _(e,t,n){for(v(e.charCodeAt(t))&&t++;B(e.charCodeAt(t),n.syntax);)t++;return t}function O(e,t,n){if(!n)return 0;const o=new Lr(e),r=(n+"").split("").map(jr);o.pos=t;for(let i;!o.sol();)if(!(M(o,zr,Wr)||M(o,Xr,Gr))){if(i=o.pos,D(o,r))return i;o.pos--}return-1}function M(e,t,n){const o=e.pos;if(e.eat(t))for(;!e.sol();){if(e.eat(n))return!0;e.pos--}return e.pos=o,!1}function D(e,t){const n=e.pos;let o=!1;for(let n=t.length-1;0<=n&&!e.sol()&&!!e.eat(t[n]);n--)o=0===n;return o||(e.pos=n),o}function R(e,t){return-1!==e.indexOf(t)}function P(e){return 64e||96e||47e||Qr.has(e)}function F(e,t){return e===Hr||"markup"===t&&(e===Wr||e===Gr)}function B(e,t){return e===Kr||"markup"===t&&(e===zr||e===Xr)}function U(e,t){return e instanceof ea?e:"string"==typeof e?new ea(e,t):e&&"object"==typeof e?new ea(e.name,e.value,e.options):void 0}function V(e){return(e+"").trim()}function q(e,t,n){return e&&n.indexOf(e)===t}function j(e){if(e.eat(oa))return e.start=e.pos,{count:e.eatWhile(d)?+e.current():null}}function W(e){if(vr(e,ra))return e.current().slice(1,-1)}function z(e){const t=e.pos;if(e.eat(aa)){for(let n=1,o="",r=e.pos,i;!e.eof();)if(i=e.next(),i===aa)n++;else if(i!==ia)i===sa&&(i=e.next(),(i===aa||i===ia)&&(o+=e.substring(r,e.pos-2)+cr(i),r=e.pos));else if(n--,!n)return e.start=t,o+e.substring(r,e.pos-1);throw e.pos=t,e.error(`Unable to find closing ${"}"} for text start`)}return null}function H(e){if(!e.eat(pa))return null;const t=[];for(let n,o;!e.eof();){if(e.eatWhile(u),e.eat(ua))return t;if(null!=(n=W(e)))t.push({name:null,value:n});else if(G(e))n=e.current(),ma.test(n)?(o=K(n),t.push(o),e.eat(ca)&&(null==(n=W(e))?null==(n=z(e))?G(e)&&(o.value=e.current()):(o.value=n,o.options={before:"{",after:"}"}):o.value=n)):t.push({name:null,value:n});else throw e.error("Expected attribute name")}throw e.error("Expected closing \"]\" brace")}function K(e){const t={};e.charCodeAt(0)===la&&(e=e.slice(1),t.implied=!0),e.charCodeAt(e.length-1)===da&&(e=e.slice(0,e.length-1),t.boolean=!0);const n={name:e};return Object.keys(t).length&&(n.options=t),n}function G(e){const t=e.pos;if(e.eatWhile(X))return e.start=t,!0}function X(e){return!m(e)&&!l(e)&&e!==pa&&e!==ua&&e!==ca}function Q(e){const t=e.pos,n=new na(J(e));for(let t;!e.eof();)if(e.eat(ga))n.addClass(J(e));else if(e.eat(ha))n.setAttribute("id",J(e));else if(e.eat(fa)){if(n.isGroup)throw e.backUp(1),e.error("Unexpected self-closing indicator");n.selfClosing=!0,(t=j(e))&&(n.repeat=t);break}else if(t=H(e))for(let e=0,o=t.length;e{const r=t.resolve(e.name);if(r&&!n.has(r)){if("function"==typeof r.value)return r.value(e,t,o);const i=Sa(r.value);n.add(r),i.walk(o),n.delete(r);const s=re(i);for(te(s,e);i.firstChild;)e.parent.insertBefore(i.firstChild,e);s.parent.insertBefore(e,s),s.remove()}};o(e)}function te(e,t){return t.name=e.name,e.selfClosing&&(t.selfClosing=!0),null!=e.value&&(t.value=e.value),e.repeat&&(t.repeat=Ca({},e.repeat)),ne(e,t)}function ne(e,t){oe(e,t);const n=new Map;let o=e.attributes;for(let r=0;rse(e,o))}function ie(e,t,n){for(let o=t.length-1;0<=o;o--){const i=t[o];let r=0,s=0,l=!1;if("@"===e.substr(i[0]+i[1],1)){"-"===e.substr(i[0]+i[1]+1,1)&&(l=!0);const t=e.substr(i[0]+i[1]+1+ +l).match(/^(\d+)/);t?(s=t[1].length+1+ +l,r=parseInt(t[1])-1):s=2}e=e.substring(0,i[0])+("function"==typeof n?n(e.substr(i[0],i[1]),r,l):n)+e.substring(i[0]+i[1]+s)}return e}function se(e,t){return[e,t]}function le(e){const t=de(e);if(t&&null!=t.value){const n=t.value,o=t.count;e.name=ce(e.name,n,o),e.value=ce(e.value,n,o),e.attributes.forEach((t)=>{const r=e.getAttribute(t.name).clone();r.name=ce(t.name,n,o),r.value=ce(t.value,n,o),e.replaceAttribute(t.name,r)})}return e}function de(e){for(;e;){if(e.repeat)return e.repeat;e=e.parent}}function ce(e,t,n){if("string"==typeof e){const o=pe(e);return ue(e,o,t,n)}return e}function pe(e){return ae(e||"",La).reduce((t,n)=>{if(!/[#{]/.test(e[n[0]+1]||"")){const e=t[t.length-1];e&&e[0]+e[1]===n[0]?e[1]+=n[1]:t.push(n)}return t},[])}function ue(e,t,n,o){const r=ie(e,t,(e,t,r)=>{let i=r?t+o-n+1+"":n+t+"";for(;i.length{if(e.repeat&&null===e.repeat.count){for(let n=0;n{e.repeat&&e.repeat.implicit&&(n=!0,fe(e,t[e.repeat.index]))}),n||ve(xe(e),t.join("\n"))}return e}function fe(e,t){let n=ye(e,t);return e.walk((e)=>n|=ye(e,t)),n||ve(xe(e),t),e}function ye(e,t){const n={replaced:!1};return e.value=be(e.value,t,n),e.attributes.forEach((o)=>{o.value&&e.setAttribute(o.name,be(o.value,t,n))}),n.replaced}function be(e,t,n){if("string"==typeof e){const o=ae(e,Oa);o.length&&(n&&(n.replaced=!0),e=ie(e,o,t))}return e}function xe(e){for(;e.children.length;)e=e.children[e.children.length-1];return e}function ve(e,t){if(e.value){const n=ae(e.value,Ma);if(n.length)return void(e.value=ie(e.value,n,t))}("a"===e.name.toLowerCase()||e.hasAttribute("href"))&&(Da.test(t)?e.setAttribute("href",(Pa.test(t)?"":"http://")+t):Ra.test(t)&&e.setAttribute("href","mailto:"+t)),e.value=t}function ke(e){const t=e.classList.reduce((e,t)=>{const n=t.indexOf("_");return 0{let i,s;const l=r;return(s=r.match(Ba))&&(i=we(e,t,s[1])+n.element+s[2],o.add(i),r=r.slice(s[0].length)),(s=r.match(Ua))&&(!i&&(i=we(e,t,s[1]),o.add(i)),o.add(`${i}${n.modifier}${s[2]}`),r=r.slice(s[0].length)),r===l&&o.add(l),o},new Set),r=Array.from(o).filter(Boolean);r.length&&e.setAttribute("class",r.join(" "))}function Ce(e){const t=new Map;return e.walk((e)=>{const n=e.classList;n.length&&t.set(e,Te(n,Va)||Te(n,qa)||t.get(e.parent))}),t}function we(e,t,n){for(let o=1{const o=t(new Qa(e,n));return o?o.toString(_e(e.children,t,n)):""}).join("")}function Oe(e,t){const n="object"==typeof e?e:Ir(e);let o=-1;return n.fields.forEach((e)=>{e.index+=t.index,e.index>o&&(o=e.index)}),-1!==o&&(t.index=o+1),n}function Me(e,t){if(null==e)return e;const n=[],o=(e,n,o,r)=>null==t[o]?"":n+t[o]+r;let r="",s=0,l=0,i,d;for(;l!e||t.index=t.get("inlineBreak"))return!0}for(let n=0,o=e.children.length;n{if(n.options.implied&&null==n.value)return null;const o=t.attribute(n.name);let r=null;if(n.options.boolean||-1!==t.get("booleanAttributes").indexOf(o.toLowerCase())){if(t.get("compactBooleanAttributes")&&null==n.value)return` ${o}`;null==n.value&&(r=o)}return null==r&&(r=e.renderFields(n.value)),` ${o}=${t.quote(r)}`}).join("")}function Ke(e,t){return e&&e.isTextOnly||Ge(e,t)}function Ge(e,t){return e&&t.isInline(e)}function Xe(e,t){const n=t.get("formatSkip")||[];let o=e.parent.isTextOnly?-2:-1,r=e;for(;r=r.parent;)-1===n.indexOf((r.name||"").toLowerCase())&&o++;return 0>o?0:o}function Qe(e,t){const n=e.node;if(t.enabled&&t.trigger&&n.name){const n=e.node.attributes.reduce((e,t)=>(t.name&&null!=t.value&&(e[t.name.toUpperCase().replace(/-/g,"_")]=t.value),e),{});for(let o=0,r=t.trigger.length;o{if(n.options.implied&&null==n.value)return null;const i=t.attribute(n.name),s=e.renderFields(n.value);if(oi.test(i))s&&o.push(`#${s}`);else if(ri.test(i))s&&o.push(`.${s.replace(/\s+/g,".")}`);else{const e=null==n.value&&(n.options.boolean||-1!==t.get("booleanAttributes").indexOf(i.toLowerCase()));r.push({name:i,value:s,isBoolean:e})}}),{PRIMARY_ATTRS:n.primary(o)||null,SECONDARY_ATTRS:n.secondary(r)||null}}function Ze(e){let t=e.parent.isTextOnly?-2:-1,n=e;for(;n=n.parent;)t++;return 0>t?0:t}function et(e,t){const n=e.node;return!n.isTextOnly&&n.value&&(e.beforeText=si.test(n.value)?e.newline+e.indent+t.indent(1):" "),e}function tt(e,t){if(null!=e.value&&si.test(e.value)){const n=De(e.value),o=t.indent(1),r=n.reduce((e,t)=>dr(e,t.length),0);return n.map((e,t)=>`${t?o:""}${nt(e,r)} |`).join("\n")}return e.value}function nt(e,t){for(;e.length`${n}${t?" ":"|"} ${e}`).join("\n")}return e.value}function at(e,t){return e&&(e.isTextOnly||t.isInline(e))}function it(e,t){const n=e.node;return!n.isTextOnly&&n.value&&(e.beforeText=ci.test(n.value)?e.newline+e.indent+t.indent(1):" "),e}function st(e,t){if(null!=e.value&&ci.test(e.value)){const n=t.indent(1);return De(e.value).map((e)=>`${n}| ${e}`).join("\n")}return e.value}function lt(e){return!!e&&e in pi}function dt(e){if(e.peek()===hi){e.start=e.pos,e.next(),e.eat(116)||e.eatWhile(ct);const t=e.current();if(e.start=e.pos,e.eat(gi)&&!e.eatWhile(d))throw e.error("Unexpected character for alpha value of color");return new fi(t,e.current())}}function ct(e){return d(e)||c(e,65,70)}function pt(e){return!(e%17)}function ut(e){return(e>>4).toString(16)}function mt(e){return ht(e.toString(16),2)}function ht(e,t){for(;e.lengthnew qi(e.key,e.value)))}function Mt(e){e=e.sort(Dt);const t=[];for(let n=0,o,r;ne.property===n.property),n);const o=Wt(e.name,t,"key",n.fuzzySearchMinScore);return o?o.property?Ut(e,o,n):Vt(e,o):"!"===e.name?jt(e,"!important"):e}function Ut(e,t,n){const o=e.name;if(e.name=t.property,e.value&&"object"==typeof e.value){const r=t.keywords();if(!e.value.size){let n=Wt(Ht(o,t.key),r);n||(n=t.defaultValue,n&&-1===n.indexOf("${")&&(n=`\${1:${n}}`)),n&&e.value.add(n)}else for(let t=0,o;t"string"==typeof e||"keyword"===e.type?(e+="",Wt(e,o,null,n.fuzzySearchMinScore)||e):e);return e.name=null,e.value.value=r,e}function jt(e,t){return e.name=null,e.value=t,e}function Wt(e,t,n,o){if(!e)return null;let r=null,s=0;o=o||0;for(let l=0,i;l=s&&(s=o,r=i)}return s>=o?r:null}function zt(e,t){const n=e&&"object"==typeof e?e[t]:e,o=(n||"").match(/^[\w-@]+/);return o?o[0]:n}function Ht(e,t){for(let n=0,o=0;n{const r=n.node;let i=Yt(r,o);if(r.attributes.length){const e=r.attributes.map((e)=>Yt(e,o));i=$t(i,e)}return n.open=r.name&&t.name(r.name),n.afterOpen=o.between,n.text=n.renderFields(i||null),!n.open||n.text&&n.text.endsWith(";")||(n.afterText=o.after),t.get("format")&&(n.newline="\n",e.lastChild!==r&&(n.afterText+=n.newline)),n})}function $t(e,t){const n=Ir(e),o=n.fields.length;if(o)for(t=t.slice(),t.length>o&&(t=t.slice(0,o-1).concat(t.slice(o-1).join(", ")));t.length;){const e=t.shift(),o=n.fields.shift(),r=e.length-o.length;n.string=n.string.slice(0,o.location)+e+n.string.slice(o.location+o.length);for(let e=0,t=n.fields.length;ee&&"object"==typeof e?"color"===e.type?e.toString(t.shortHex):e.toString():e+"").join(" "):null==e.value?"":e.value+""}function Zt(e){return!!e&&e in Xi}function en(e,t){let n=Xi[e];return"string"==typeof n&&(n=Xi[n]),Ki({},n,t&&t.format)}function tn(e){return!e.parent}function nn(e,t){return Math.floor(Math.random()*(t-e)+e)}function on(e,t){const n=e.length,o=lr(n,t),r=new Set;for(;r.sizee.length)return e;e=e.slice();const t=e.length,n=/,$/;let o=0;o=3=t?nn(0,1):6=t?nn(0,2):nn(1,4);for(let r=0,i;r{o.push("string"==typeof e?Ji[e]:e)}):"object"==typeof n&&o.push(n);const r=new os(o.filter(Boolean));return"stylesheet"!==e&&r.get(0).set(ls,yn),r}function yn(e){const t={},n=e.name.match(ls);return n[1]&&(t.lang=n[1]),n[2]&&(t.wordCount=+n[2]),es(e,t)}function bn(e,t){return t=kn(t),"stylesheet"===wn(t.type,t.syntax)?hn(e,t):un(e,t)}function xn(e,t){return t=kn(t),"stylesheet"===wn(t.type,t.syntax)?gn(e,t):mn(e,t)}function vn(e,t,n){return e&&"markup"!==e&&"stylesheet"!==e&&(n=t,t=e,e="markup"),n instanceof os?n:fn(e,t,n)}function kn(e){return"string"==typeof e&&(e={syntax:e}),e=ss({},ps,e),null==e.type&&e.syntax&&(e.type=Sn(e.syntax)?"stylesheet":"markup"),e.format=ss({field:e.field},e.format),e.profile=Cn(e),e.variables=ss({},ds,e.variables),e.snippets=vn(e.type,e.syntax,e.snippets),e}function Sn(e){return-1!==cs.indexOf(e)}function Cn(e){return e.profile instanceof is?e.profile:new is(e.profile)}function wn(e,t){return e?"stylesheet"===e?"stylesheet":"markup":Sn(t)?"stylesheet":"markup"}function Tn(e,t){if(e=e.toLowerCase(),t=t.toLowerCase(),e===t)return 1;if(!t||e.charCodeAt(0)!==t.charCodeAt(0))return 0;const n=e.length,o=t.length;let r=1,i=1,s=o,l,d,c,p;for(;rnew fs(e.key,e.value)))}function In(e){e=e.sort(Nn);const t=[];for(let n=0,o,r;n=s&&(s=o,r=i)}return s>=o?r:null}function Bn(e,t){const n=e&&"object"==typeof e?e[t]:e,o=(n||"").match(/^[\w-@]+/);return o?o[0]:n}function Un(e,t){for(let n=0,o=0;ne.charCodeAt(0))}function no(e){if(60===e.peek())return Bs(e)||qs(e)||Rs(e)}function oo(e,t){const n=e.pos;for(;!e.eof();){if(Zn(e,t))return e.pos=e.start,Rs(e);e.next()}return e.pos=n,null}function ro(e){return e.name?e.name.value.toLowerCase():`#${e.type}`}function ao(e){return e[e.length-1]}function io(e,t,n){t=t||e.getCursor();const o=so(e,t),r=hr(zs({field:Hs},e.getOption("emmet"),n),{syntax:o}),i=e.getModeAt(t);return"jsx"===o?(r.profile=zs({selfClosingStyle:"xml"},r.profile),r.options=zs({jsx:!0},r.options)):"xml"===i.name&&(r.profile=zs({selfClosingStyle:i.configuration},r.profile)),r}function so(e,t){const n=e.getMode();if("jsx"===n.name||"javascript"===n.name)return n.name;const o=e.getModeAt(t);return"xml"===o.name?"html":o.name}function lo(e,t){return e.line-t.line||e.ch-t.ch}function co(e){return e.getOption("indentWithTabs")?"\t":mo(" ",e.getOption("indentUnit"))}function po(e,t,n){let o=uo(t);const r=co(e);return"\t"!==r&&(o=o.map((e)=>e.replace(/^\t+/,(e)=>mo(r,e.length)))),n&&(o=o.map((e,t)=>t?n+e:e)),o.join("\n")}function uo(e){return Array.isArray(e)?e:e.split(/\r\n|\r|\n/g)}function mo(e,t){let n="";for(;0fo(t,e.to):0<=fo(t,e.from)&&0>=fo(t,e.to)}function fo(e,t){return e.line-t.line||e.ch-t.ch}function yo(e){return{from:e.start,to:e.end}}function bo(e,t,n){const o=new Ks(e,t);if(o.eatWhile(m),t=o.pos,n){for(o.pos=n,o.backUp();!o.sof()&&m(o.peek());)o.backUp();o.next(),n=o.pos}else n=t;return{from:t,to:n}}function xo(e,t){const n=t.line;for(let o=t.ch,r;0<=o;){if(r=e.getTokenAt({line:n,ch:o}),"property"===r.type)return r.string;if(r.start!==o)o=r.start;else break}}function vo(e,t){const n=e.getModeAt(t);if(n&&"css"===n.name){const n=e.getTokenAt(t),o=n.state&&n.state.localState||n.state;return o&&o.context&&"prop"===o.context.type}return!1}function ko(e,t,n){const o=io(e,t);if(n&&!So(e,t,o))return null;const r=Yr(e.getLine(t.line),t.ch,{lookAhead:!0,syntax:o.type,prefix:"jsx"===o.syntax&&e.getOption("jsxBracket")?"<":""});if(r){const i={line:t.line,ch:r.start},s={line:t.line,ch:r.end};return"stylesheet"===o.type&&n&&vo(e,t)&&(o.options=zs({property:xo(e,t)},o.options)),{abbreviation:r.abbreviation,range:{from:i,to:s},config:o}}}function So(e,t,n){const o=e.getTokenTypeAt(t);return"stylesheet"===n.type?"comment"!==o&&"string"!==o:"html"===n.syntax?null===o:"slim"===n.syntax||"pug"===n.syntax?null===o||"tag"===o||o&&/attribute/.test(o):"haml"===n.syntax?null===o||"attribute"===o:"jsx"===n.syntax}function Co(e,t,n){const o=e.getLine(t.from.line),r=o.match(/^\s+/);let i=po(e,n,r&&r[0]);const s=Ir(i);return e.operation(()=>{e.replaceRange(s.string,t.from,t.to);const n=e.indexFromPos(t.from);if(s.fields.length){const t=s.fields[0],o=e.posFromIndex(t.location+n),r=e.posFromIndex(t.location+t.length+n);e.setSelection(o,r)}else e.setCursor(e.posFromIndex(n+s.string.length));return!0})}function wo(e,t,n){const o=To(e,t);if(o&&o.model)return o.model;const r=ko(e,t,n);if(r)try{const t=new Xs(r.abbreviation,r.range,r.config);return t.valid(e,n)?t:null}catch(e){}}function To(e,t){const n=e.findMarksAt(t);for(let o=0,r;o_o(e,t));return t.some(Boolean)?void e.operation(()=>{let n=e.listSelections();const o=e.doc.lineSeparator();for(let r=n.length-1;0<=r;r--)e.replaceRange(t[r]?o+o:o,n[r].anchor,n[r].head,"+newline");n=e.listSelections();for(let o=0;o{if(t[o]){const t=n.from().line-1,o={line:t,ch:e.getLine(t).length};return{anchor:o,head:o}}return n}))}):e.constructor.Pass}function _o(e,t){if(Mo(t.anchor,t.head)){const n=t.anchor,o=e.getModeAt(n);if("xml"===o.name){const t=e.getTokenAt(n),o=e.getTokenAt(zs({},n,{ch:n.ch+1}));return"tag bracket"===t.type&&">"===t.string&&"tag bracket"===o.type&&"e.trim());n(e,"Enter abbreviation to wrap with:",(n)=>{if(n){const r=new Xs(n,t,io(e,t.from,{text:o}));r.insert(e)}})}else console.warn("Nothing to wrap")}function Ro(e){if(e.somethingSelected()){const t=e.listSelections().filter((e)=>e.anchor!==e.head)[0];if(t)return 0>fo(t.anchor,t.head)?{from:t.anchor,to:t.head}:{from:t.head,to:t.anchor}}return Po(e,e.getCursor())}function Po(e,t){const n=e.getEmmetDocumentModel(),o=n&&n.nodeForPoint(t);if(!o)return null;if(Fo(o.open,t)||Fo(o.close,t))return yo(o);const r=o.open.end,i=o.close?o.close.start:o.open.end;return bo(e,r,i)}function Fo(e,t){return e&&go(yo(e),t)}function Bo(e,t,n){n(window.prompt(t))}function Uo(e,t){const n=To(e,t);if(n)return n;Eo(e);const o=wo(e,t,!0);if(o)return Ao(e,o)}function Vo(e,t){t=t||e.getCursor();let n=[];const o=wo(e,t,!0);o&&o.abbreviation!==o.snippet&&n.push(Ko(e,t,o));const r=o?o.config:io(e,t);return n="stylesheet"===r.type?n.concat(jo(e,t,r)):n.concat(qo(e,t,r)),{type:r.type,syntax:r.syntax,abbreviation:o,completions:n.filter(Boolean)}}function qo(e,t,n){const o=e.getLine(t.line).slice(0,t.ch),r=Go(o,/[\w:\-$@]/);if(r){const o={from:{line:t.line,ch:t.ch-r.length},to:t};return Wo(e,t,n).filter((e)=>e.key!==r&&0===e.key.indexOf(r)).map((t)=>new Qs("snippet",e,o,t.key,t.preview,t.snippet))}return[]}function jo(e,t,n){const o=e.getLine(t.line).slice(0,t.ch),r=Go(o,/[\w-@$]/);if(r){const o={from:{line:t.line,ch:t.ch-r.length},to:t};if(n.options&&n.options.property){const i=n.options.property.toLowerCase(),s=Wo(e,t,n).find((e)=>e.property&&e.property===i);if(s&&s.keywords.length)return s.keywords.map((t)=>0===t.key.indexOf(r)&&new Qs("value",e,o,t.key,t.preview,t.snippet)).filter(Boolean)}else return Wo(e,t,n).filter((e)=>e.key!==r&&0===e.key.indexOf(r)).map((t)=>new Qs("snippet",e,o,t.key,t.preview,t.snippet))}return[]}function Wo(e,t,n){const{type:o,syntax:r}=n;e.state.emmetCompletions||(e.state.emmetCompletions={});const i=e.state.emmetCompletions;if(!(r in i)){const e=vn(o,r,n.snippets);i[r]="stylesheet"===o?zo(e,n):Ho(e,n)}return i[r]}function zo(e){return On(e).map((e)=>{let t=e.property;const n=e.keywords();return n.length?t+=`: ${ho(n.join(" | "))}`:e.value&&(t+=`: ${ho(e.value)}`),{key:e.key,value:e.value,snippet:e.key,property:e.property,keywords:n.map((e)=>{const t=e.match(/^[\w-]+/);return t&&{key:t[0],preview:ho(e),snippet:e}}).filter(Boolean),preview:t}})}function Ho(e,t){return e.all({type:"string"}).map((e)=>({key:e.key,value:e.value,preview:ho(bn(e.value,t)),snippet:e.key}))}function Ko(e,t,n){let o=n.preview;return 500n.insert(e,t))}function Go(e,t){let n=e.length;for(;0{e.className===$s?t=e:e.className===Ys&&(n=e)}),t?{open:t,close:n}:null}function tr(e){e.getAllMarks().forEach((e)=>{(e.className===$s||e.className===Ys)&&e.clear()})}function nr(e,t){const n=e.getEmmetDocumentModel();return n&&n.nodeForPoint(t||e.getCursor())}function or(e,t,n){return e.markText(t.start,t.end,{className:n,inclusiveLeft:!0,inclusiveRight:!0,clearWhenEmpty:!1})}function rr(e,t){const n=t.find();return n?e.getRange(n.from,n.to):""}function ar(e,t){const n=er(e),o=t.from;n&&(go(n.open.find(),o)&&n.close?ir(e,n.open,n.close):n.close&&go(n.close.find(),o)&&ir(e,n.close,n.open))}function ir(e,t,n){const o=sr(e,t),r=n.find(),i=o.match(/[\w:.-]+/),s=o?i&&i[0]:"";null==s?tr(e):e.getRange(r.from,r.to)!==s&&e.replaceRange(s,r.from,r.to)}function sr(e,t){const n=t.find();return n?e.getRange(n.from,n.to):""}var lr=Math.min,dr=Math.max,cr=String.fromCharCode,pr=Object.assign||function(e){for(var t=1,n;t=this.end}limit(e,t){return new this.constructor(this.string,e,t)}peek(){return this.string.charCodeAt(this.pos)}next(){if(this.pose.charCodeAt(0),Wr=jr("["),zr=jr("]"),Hr=jr("("),Kr=jr(")"),Gr=jr("{"),Xr=jr("}"),Qr=new Set(["#",".","*",":","$","-","_","!","@","%","^","+",">","/"].map(jr)),Jr=new Map().set(Wr,zr).set(Hr,Kr).set(Gr,Xr),$r={syntax:"markup",lookAhead:null,prefix:""};var Yr=function(e,t,n){t=lr(e.length,dr(0,null==t?e.length:t)),n="boolean"==typeof n?Nr({},$r,{lookAhead:n}):Nr({},$r,n),(null==n.lookAhead||!0===n.lookAhead)&&(t=_(e,t,n));let o;const r=O(e,t,n.prefix);if(-1===r)return null;const i=new Lr(e,r);i.pos=t;const s=[];for(;!i.sol();){if(o=i.peek(),B(o,n.syntax))s.push(o);else if(F(o,n.syntax)){if(s.pop()!==Jr.get(o))break;}else if(R(s,zr)||R(s,Xr)){i.pos--;continue}else if(qr(i)||!P(o))break;i.pos--}if(!s.length&&i.pos!==t){const o=e.slice(i.pos,t).replace(/^[*+>^]+/,"");return{abbreviation:o,location:t-o.length,start:n.prefix?r-n.prefix.length:t-o.length,end:t}}},Zr=Object.assign||function(e){for(var t=1,n;tthis.setAttribute(e))}get attributes(){return this._attributes}get attributesMap(){return this.attributes.reduce((e,t)=>(e[t.name]=t.options.boolean?t.name:t.value,e),{})}get isGroup(){return!this.name&&!this.value&&!this._attributes.length}get isTextOnly(){return!this.name&&!!this.value&&!this._attributes.length}get firstChild(){return this.children[0]}get lastChild(){return this.children[this.children.length-1]}get childIndex(){return this.parent?this.parent.children.indexOf(this):-1}get nextSibling(){return this.next}get previousSibling(){return this.previous}get classList(){const e=this.getAttribute("class");return e&&e.value?e.value.split(/\s+/g).filter(q):[]}create(t,n){return new e(t,n)}setAttribute(e,t){const n=U(e,t),o=this.getAttribute(e);o?this.replaceAttribute(o,n):this._attributes.push(n)}hasAttribute(e){return!!this.getAttribute(e)}getAttribute(e){"object"==typeof e&&(e=e.name);for(var t=0;tt!==e).join(" "))}appendChild(e){this.insertAt(e,this.children.length)}insertBefore(e,t){this.insertAt(e,this.children.indexOf(t))}insertAt(e,t){if(0>t||t>this.children.length)throw new Error("Unable to insert node: position is out of child list range");const n=this.children[t-1],o=this.children[t];e.remove(),e.parent=this,this.children.splice(t,0,e),n&&(e.previous=n,n.next=e),o&&(e.next=o,o.previous=e)}removeChild(e){const t=this.children.indexOf(e);-1!==t&&(this.children.splice(t,1),e.previous&&(e.previous.next=e.next),e.next&&(e.next.previous=e.previous),e.parent=e.next=e.previous=null)}remove(){this.parent&&this.parent.removeChild(this)}clone(t){const n=new e(this.name);return n.value=this.value,n.selfClosing=this.selfClosing,this.repeat&&(n.repeat=Zr({},this.repeat)),this._attributes.forEach((e)=>n.setAttribute(e.clone())),t&&this.children.forEach((e)=>n.appendChild(e.clone(!0))),n}walk(e,t){t=t||0;for(let n=this.firstChild;n;){const o=n.next;if(!1===e(n,t)||!1===n.walk(e,t+1))return!1;n=o}}use(e){const t=[this];for(var n=1;n{e=this.getAttribute(e.name);const t=e.options;let n=`${t&&t.implied?"!":""}${e.name||""}`;return t&&t.boolean?n+=".":null!=e.value&&(n+=`="${e.value}"`),n});let t=`${this.name||""}`;return e.length&&(t+=`[${e.join(" ")}]`),null!=this.value&&(t+=`{${this.value}}`),this.selfClosing&&(t+="/"),this.repeat&&(t+=`*${this.repeat.count?this.repeat.count:""}`,null!=this.repeat.value&&(t+=`@${this.repeat.value}`)),t}};var na=ta;const oa=42,ra={throws:!0},aa=123,ia=125,sa=92,la=33,da=46,ca=61,pa=91,ua=93,ma=/^\!?[\w\-:\$@]+\.?$/,ha=35,ga=46,fa=47,ya=40,ba=41,xa=43,va=62,ka=94;var Sa=function(e){const t=Y(e);return t.walk(Z),t},Ca=Object.assign||function(e){for(var t=1,n;tee(e,t)),e};const Ta=new Set(["a","abbr","acronym","applet","b","basefont","bdo","big","br","button","cite","code","del","dfn","em","font","i","iframe","img","input","ins","kbd","label","map","object","q","s","samp","select","small","span","strike","strong","sub","sup","textarea","tt","u","var"]),Ea={p:"span",ul:"li",ol:"li",table:"tr",tr:"td",tbody:"tr",thead:"tr",tfoot:"tr",colgroup:"col",select:"option",optgroup:"option",audio:"source",video:"source",object:"param",map:"area"};var Aa=function(e){return e=(e||"").toLowerCase(),Ea[e]||(Ta.has(e)?"span":"div")},Ia=Object.assign||function(e){for(var t=1,n;t{null==e.name&&e.attributes.length&&(e.name=Aa(e.parent.name))}),e};const La="$";var _a=function(e){return e.walk(le),e};const Oa="$#",Ma="|",Da=/^((?:https?|ftp|file):\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/,Ra=/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/,Pa=/^([a-z]+:)?\/\//i,Fa={element:"__",modifier:"_"},Ba=/^(-+)([a-z0-9]+[a-z0-9-]*)/i,Ua=/^(_+)([a-z0-9]+[a-z0-9-_]*)/i,Va=(e)=>/^[a-z]\-/i.test(e),qa=(e)=>/^[a-z]/i.test(e);const ja=/^xsl:(variable|with\-param)$/i;const Wa={bem:function(e,t){t=Ia({},Fa,t),e.walk((e)=>ke(e,t));const n=Ce(e);return e.walk((e)=>Se(e,n,t)),e},jsx:function(e){return e.walk((e)=>{Ee(e,"class","className"),Ee(e,"for","htmlFor")}),e},xsl:function(e){return e.walk((e)=>{ja.test(e.name||"")&&(e.children.length||e.value)&&e.removeAttribute("select")}),e}};var za=function(e,t){return Object.keys(t||{}).forEach((n)=>{if(n in Wa){const o="object"==typeof t[n]?t[n]:null;e=e.use(Wa[n],o)}}),e},Ha=function(e,t,n){return"string"==typeof t?t=[t]:t&&"object"==typeof t&&!Array.isArray(t)&&(n=t,t=null),e.use(Na).use(he,Array.isArray(t)?t.length:null).use(_a).use(ge,t).use(za,n)},Ka=function(e,t){return t=t||{},e.walk((e)=>Ae(e,t)),e},Ga=Object.assign||function(e){for(var t=1,n;te;let Qa=class{constructor(e,t,n){"object"==typeof t&&(n=t,t=null),this.node=e,this._fieldsRenderer=t||Xa,this.open=null,this.beforeOpen="",this.afterOpen="",this.close=null,this.beforeClose="",this.afterClose="",this.text=null,this.beforeText="",this.afterText="",this.indent="",this.newline="",n&&Ga(this,n)}clone(){return new this.constructor(this.node,this)}indentText(e){const t=Le(e);if(1===t.length)return e;const n=this.newline||this.indent?this.newline:" ";return t.map((e,t)=>t?this.indent+e:e).join(n)}renderFields(e){return this._fieldsRenderer(e)}toString(e){const t=this._wrap(this.open,this.beforeOpen,this.afterOpen),n=this._wrap(this.close,this.beforeClose,this.afterClose),o=this._wrap(this.text,this.beforeText,this.afterText);return t+o+(null==e?"":e)+n}_wrap(e,t,n){return t=null==t?"":t,n=null==n?"":n,null==e?"":(e=t?e.replace(/^\s+/,""):e,e=n?e.replace(/\s+$/,""):e,t+this.indentText(e)+n)}};const Ja=(e,t)=>t||"";var $a=function(e,t,n){"undefined"==typeof n&&(n=t,t=null),t=t||Ja;const o={index:1};return _e(e.children,n,(e)=>null==e?t(o.index++):Oe(e,o).mark(t))},Ya=Object.assign||function(e){for(var t=1,n;t"},oi=/^id$/i,ri=/^class$/i,ai={primary:(e)=>e.join(""),secondary:(e)=>e.map((e)=>e.isBoolean?e.name:`${e.name}=${e.value}`).join(", ")},ii={open:null,close:null,omitName:/^div$/i,attributes:ai},si=/\n|\r/,li=/\n|\r/,di={none:"[ SECONDARY_ATTRS]",round:"[(SECONDARY_ATTRS)]",curly:"[{SECONDARY_ATTRS}]",square:"[[SECONDARY_ATTRS]"},ci=/\n|\r/,pi={html:function(e,t,n){n=Ya({},n);const o=Je(n);return $a(e,n.field,(e)=>{if(e=qe(e,t),!Be(e)){const n=e.node;if(n.name){const r=t.name(n.name),i=He(e,t);e.open=`<${r}${i}${n.selfClosing?t.selfClose():""}>`,n.selfClosing||(e.close=``),Qe(e,o.comment)}!n.value&&(n.children.length||n.selfClosing)||(e.text=e.renderFields(n.value))}return e})},haml:function(e,t,n){n=n||{};const o={open:"[%NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)][SELF_CLOSE]",selfClose:"/",attributes:{secondary(e){return e.map((e)=>e.isBoolean?`${e.name}${t.get("compactBooleanAttributes")?"":"=true"}`:`${e.name}=${t.quote(e.value)}`).join(" ")}}};return $a(e,n.field,(e)=>{if(e=$e(e,t,o),e=et(e,t),!Be(e)){const n=e.node;!n.value&&(n.children.length||n.selfClosing)||(e.text=e.renderFields(tt(n,t)))}return e})},slim:function(e,t,n){n=n||{};const o=n.attributeWrap&&di[n.attributeWrap]||di.none,r=o===di.none?(e)=>`${e.name}=true`:(e)=>e.name,i={open:`[NAME][PRIMARY_ATTRS]${o}[SELF_CLOSE]`,selfClose:"/",attributes:{secondary(e){return e.map((e)=>e.isBoolean?r(e):`${e.name}=${t.quote(e.value)}`).join(" ")}}};return $a(e,n.field,(e)=>{if(e=$e(e,t,i),e=ot(e,t),!Be(e)){const n=e.node;!n.value&&(n.children.length||n.selfClosing)||(e.text=e.renderFields(rt(n,t)))}return e})},pug:function(e,t,n){n=n||{};const o={open:"[NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)]",attributes:{secondary(e){return e.map((e)=>e.isBoolean?e.name:`${e.name}=${t.quote(e.value)}`).join(", ")}}};return $a(e,n.field,(e)=>{if(e=$e(e,t,o),e=it(e,t),!Be(e)){const n=e.node;!n.value&&(n.children.length||n.selfClosing)||(e.text=e.renderFields(st(n,t)))}return e})}};var ui=function(e,t,n,o){return"object"==typeof n&&(o=n,n=null),lt(n)||(n="html"),pi[n](e,t,o)};let mi=class{constructor(){this.type="css-value",this.value=[]}get size(){return this.value.length}add(e){this.value.push(e)}has(e){return-1!==this.value.indexOf(e)}toString(){return this.value.join(" ")}};const hi=35,gi=46;let fi=class{constructor(e,t){this.type="color",this.raw=e,this.alpha=+(null!=t&&""!==t?t:1),e=e.slice(1);let n=0,o=0,r=0;if("t"===e)this.alpha=0;else switch(e.length){case 0:break;case 1:n=o=r=e+e;break;case 2:n=o=r=e;break;case 3:n=e[0]+e[0],o=e[1]+e[1],r=e[2]+e[2];break;default:e+=e,n=e.slice(0,2),o=e.slice(2,4),r=e.slice(4,6);}this.r=parseInt(n,16),this.g=parseInt(o,16),this.b=parseInt(r,16)}toHex(e){const t=e&&pt(this.r)&&pt(this.g)&&pt(this.b)?ut:mt;return"#"+t(this.r)+t(this.g)+t(this.b)}toRGB(){const e=[this.r,this.g,this.b];return 1!==this.alpha&&e.push(this.alpha.toFixed(8).replace(/\.?0+$/,"")),`${3===e.length?"rgb":"rgba"}(${e.join(", ")})`}toString(e){return this.r||this.g||this.b||this.alpha?1===this.alpha?this.toHex(e):this.toRGB():"transparent"}};const yi=37,bi=46,xi=45;let vi=class{constructor(e,t){this.type="numeric",this.value=+e,this.unit=t||""}toString(){return`${this.value}${this.unit}`}};const ki=36,Si=45,Ci=64;let wi=class{constructor(e){this.type="keyword",this.value=e}toString(){return this.value}};const Ti={throws:!0};let Ei=class{constructor(e){this.type="string",this.value=e}toString(){return this.value}};const Ai=40,Ii=41,Ni=44;let Li=class{constructor(e,t){this.type="function",this.name=e,this.args=t||[]}toString(){return`${this.name}(${this.args.join(", ")})`}};const _i=33,Oi=36,Mi=45,Di=58,Ri=64;var Pi=function(e){const t=new na,n=new gr(e);for(;!n.eof();){let e=new na(Et(n));e.value=At(n);const o=Ct(n);if(o)for(let t=0;tBt(e,o,n)),e},Ki=Object.assign||function(e){for(var t=1,n;tsrc:m+img","ri:t|ri:type":"pic>src:t+img","!!!":"{}",doc:"html[lang=${lang}]>(head>meta[charset=${charset}]+meta:vp+meta:edge+title{${1:Document}})+body","!|html:5":"!!!+doc",c:"{}","cc:ie":"{}","cc:noie":"{${0}}"},css:{"@f":"@font-face {\n\tfont-family: ${1};\n\tsrc: url(${1});\n}","@ff":"@font-face {\n\tfont-family: '${1:FontName}';\n\tsrc: url('${2:FileName}.eot');\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\n\t\t url('${2:FileName}.woff') format('woff'),\n\t\t url('${2:FileName}.ttf') format('truetype'),\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}","@i|@import":"@import url(${0});","@kf":"@keyframes ${1:identifier} {\n\t${2}\n}","@m|@media":"@media ${1:screen} {\n\t${0}\n}",ac:"align-content:flex-start|flex-end|center|space-between|space-around|stretch",ai:"align-items:flex-start|flex-end|center|baseline|stretch",anim:"animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}",animdel:"animation-delay:${1:time}",animdir:"animation-direction:normal|reverse|alternate|alternate-reverse",animdur:"animation-duration:${1:0}s",animfm:"animation-fill-mode:both|forwards|backwards",animic:"animation-iteration-count:1|infinite",animn:"animation-name",animps:"animation-play-state:running|paused",animtf:"animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})",ap:"appearance:none",as:"align-self:auto|flex-start|flex-end|center|baseline|stretch",b:"bottom",bd:"border:${1:1px} ${2:solid} ${3:#000}",bdb:"border-bottom:${1:1px} ${2:solid} ${3:#000}",bdbc:"border-bottom-color:#${1:000}",bdbi:"border-bottom-image:url(${0})",bdbk:"border-break:close",bdbli:"border-bottom-left-image:url(${0})|continue",bdblrs:"border-bottom-left-radius",bdbri:"border-bottom-right-image:url(${0})|continue",bdbrrs:"border-bottom-right-radius",bdbs:"border-bottom-style",bdbw:"border-bottom-width",bdc:"border-color:#${1:000}",bdci:"border-corner-image:url(${0})|continue",bdcl:"border-collapse:collapse|separate",bdf:"border-fit:repeat|clip|scale|stretch|overwrite|overflow|space",bdi:"border-image:url(${0})",bdl:"border-left:${1:1px} ${2:solid} ${3:#000}",bdlc:"border-left-color:#${1:000}",bdlen:"border-length",bdli:"border-left-image:url(${0})",bdls:"border-left-style",bdlw:"border-left-width",bdr:"border-right:${1:1px} ${2:solid} ${3:#000}",bdrc:"border-right-color:#${1:000}",bdri:"border-right-image:url(${0})",bdrs:"border-radius",bdrst:"border-right-style",bdrw:"border-right-width",bds:"border-style:none|hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset",bdsp:"border-spacing",bdt:"border-top:${1:1px} ${2:solid} ${3:#000}",bdtc:"border-top-color:#${1:000}",bdti:"border-top-image:url(${0})",bdtli:"border-top-left-image:url(${0})|continue",bdtlrs:"border-top-left-radius",bdtri:"border-top-right-image:url(${0})|continue",bdtrrs:"border-top-right-radius",bdts:"border-top-style",bdtw:"border-top-width",bdw:"border-width",bfv:"backface-visibility:hidden|visible",bg:"background:#${1:000}",bga:"background-attachment:fixed|scroll",bgbk:"background-break:bounding-box|each-box|continuous",bgc:"background-color:#${1:fff}",bgcp:"background-clip:padding-box|border-box|content-box|no-clip",bgi:"background-image:url(${0})",bgo:"background-origin:padding-box|border-box|content-box",bgp:"background-position:${1:0} ${2:0}",bgpx:"background-position-x",bgpy:"background-position-y",bgr:"background-repeat:no-repeat|repeat-x|repeat-y|space|round",bgsz:"background-size:contain|cover",bxsh:"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} #${5:000}|none",bxsz:"box-sizing:border-box|content-box|border-box",c:"color:#${1:000}",cl:"clear:both|left|right|none",cm:"/* ${0} */",cnt:"content:'${0}'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters({$0})",coi:"counter-increment",colm:"columns",colmc:"column-count",colmf:"column-fill",colmg:"column-gap",colmr:"column-rule",colmrc:"column-rule-color",colmrs:"column-rule-style",colmrw:"column-rule-width",colms:"column-span",colmw:"column-width",cor:"counter-reset",cp:"clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})",cps:"caption-side:top|bottom",cur:"cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text",d:"display:block|none|flex|inline-flex|inline|inline-block|list-item|run-in|compact|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group",ec:"empty-cells:show|hide",f:"font:${1:1em} ${2:sans-serif}",fef:"font-effect:none|engrave|emboss|outline",fem:"font-emphasize",femp:"font-emphasize-position:before|after",fems:"font-emphasize-style:none|accent|dot|circle|disc",ff:"font-family:serif|sans-serif|cursive|fantasy|monospace",fl:"float:left|right|none",fs:"font-style:italic|normal|oblique",fsm:"font-smoothing:antialiased|subpixel-antialiased|none",fst:"font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",fv:"font-variant:normal|small-caps",fw:"font-weight:normal|bold|bolder|lighter",fx:"flex",fxb:"flex-basis:fill|max-content|min-content|fit-content|content",fxd:"flex-direction:row|row-reverse|column|column-reverse",fxf:"flex-flow",fxg:"flex-grow",fxsh:"flex-shrink",fxw:"flex-wrap:nowrap|wrap|wrap-reverse",fz:"font-size",fza:"font-size-adjust",h:"height",jc:"justify-content:flex-start|flex-end|center|space-between|space-around",l:"left",lg:"background-image:linear-gradient(${1})",lh:"line-height",lis:"list-style",lisi:"list-style-image",lisp:"list-style-position:inside|outside",list:"list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman",lts:"letter-spacing:normal",m:"margin",mah:"max-height",mar:"max-resolution",maw:"max-width",mb:"margin-bottom",mih:"min-height",mir:"min-resolution",miw:"min-width",ml:"margin-left",mr:"margin-right",mt:"margin-top",ol:"outline",olc:"outline-color:#${1:000}|invert",olo:"outline-offset",ols:"outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset",olw:"outline-width|thin|medium|thick",op:"opacity",ord:"order",ori:"orientation:landscape|portrait",orp:"orphans",ov:"overflow:hidden|visible|hidden|scroll|auto",ovs:"overflow-style:scrollbar|auto|scrollbar|panner|move|marquee",ovx:"overflow-x:hidden|visible|hidden|scroll|auto",ovy:"overflow-y:hidden|visible|hidden|scroll|auto",p:"padding",pb:"padding-bottom",pgba:"page-break-after:auto|always|left|right",pgbb:"page-break-before:auto|always|left|right",pgbi:"page-break-inside:auto|avoid",pl:"padding-left",pos:"position:relative|absolute|relative|fixed|static",pr:"padding-right",pt:"padding-top",q:"quotes",qen:"quotes:'\\201C' '\\201D' '\\2018' '\\2019'",qru:"quotes:'\\00AB' '\\00BB' '\\201E' '\\201C'",r:"right",rsz:"resize:none|both|horizontal|vertical",t:"top",ta:"text-align:left|center|right|justify",tal:"text-align-last:left|center|right",tbl:"table-layout:fixed",td:"text-decoration:none|underline|overline|line-through",te:"text-emphasis:none|accent|dot|circle|disc|before|after",th:"text-height:auto|font-size|text-size|max-size",ti:"text-indent",tj:"text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan",to:"text-outline:${1:0} ${2:0} ${3:#000}",tov:"text-overflow:ellipsis|clip",tr:"text-replace",trf:"transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})",trfo:"transform-origin",trfs:"transform-style:preserve-3d",trs:"transition:${1:prop} ${2:time}",trsde:"transition-delay:${1:time}",trsdu:"transition-duration:${1:time}",trsp:"transition-property:${1:prop}",trstf:"transition-timing-function:${1:fn}",tsh:"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}",tt:"text-transform:uppercase|lowercase|capitalize|none",tw:"text-wrap:none|normal|unrestricted|suppress",us:"user-select:none",v:"visibility:hidden|visible|collapse",va:"vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub",w:"width",whs:"white-space:nowrap|pre|pre-wrap|pre-line|normal",whsc:"white-space-collapse:normal|keep-all|loose|break-strict|break-all",wid:"widows",wm:"writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl",wob:"word-break:normal|keep-all|break-all",wos:"word-spacing",wow:"word-wrap:none|unrestricted|suppress|break-word|normal",z:"z-index",zom:"zoom:1"},xsl:{"tm|tmatch":"xsl:template[match mode]","tn|tname":"xsl:template[name]",call:"xsl:call-template[name]",ap:"xsl:apply-templates[select mode]",api:"xsl:apply-imports",imp:"xsl:import[href]",inc:"xsl:include[href]",ch:"xsl:choose","wh|xsl:when":"xsl:when[test]",ot:"xsl:otherwise",if:"xsl:if[test]",par:"xsl:param[name]",pare:"xsl:param[name select]",var:"xsl:variable[name]",vare:"xsl:variable[name select]",wp:"xsl:with-param[name select]",key:"xsl:key[name match use]",elem:"xsl:element[name]",attr:"xsl:attribute[name]",attrs:"xsl:attribute-set[name]",cp:"xsl:copy[select]",co:"xsl:copy-of[select]",val:"xsl:value-of[select]","for|each":"xsl:for-each[select]",tex:"xsl:text",com:"xsl:comment",msg:"xsl:message[terminate=no]",fall:"xsl:fallback",num:"xsl:number[value]",nam:"namespace-alias[stylesheet-prefix result-prefix]",pres:"xsl:preserve-space[elements]",strip:"xsl:strip-space[elements]",proc:"xsl:processing-instruction[name]",sort:"xsl:sort[select order]",choose:"xsl:choose>xsl:when+xsl:otherwise",xsl:"!!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform]>{\n|}","!!!":"{}"}},$i=Object.assign||function(e){for(var t=1,n;tthis._string.set(e,new ts(e,t)));else if(e instanceof RegExp)this._regexp.set(e,new ts(e,t));else throw new Error("Unknow snippet key: "+e);return this}get(e){if(!this.disabled){if(this._string.has(e))return this._string.get(e);const t=Array.from(this._regexp.keys());for(let n=0,o=t.length;nthis.set(t,e)):e&&"object"==typeof e&&Object.keys(e).forEach((t)=>this.set(t,e[t]))}reset(){this._string.clear(),this._regexp.clear()}values(){if(this.disabled)return[];const e=Array.from(this._string.values()),t=Array.from(this._regexp.values());return e.concat(t)}};var os=class{constructor(e){this._registry=[],Array.isArray(e)?e.forEach((e,t)=>this.add(t,e)):"object"==typeof e&&this.add(e)}get(e){for(let t=0;tt.level-e.level),n}remove(e){this._registry=this._registry.filter((t)=>t.level!==e&&t.store!==e)}resolve(e){for(let t=0;t{const o=n.key instanceof RegExp?"regexp":"string";e.type&&e.type!==o||t.has(n.key)||t.set(n.key,n)};return this._registry.forEach((e)=>{e.store.values().forEach(n)}),Array.from(t.values())}clear(){this._registry.length=0}},rs=Object.assign||function(e){for(var t=1,n;tt||"",text:null,profile:null,variables:{},snippets:{},options:null,format:null};var us=Object.assign||function(e){for(var t=1,n;t");var Bs=function(e){const t=e.pos;if(eo(e,Ps,Fs,!0)){const n=Ss(e,t);return n.type="comment",n}return null};const Us=to("");var qs=function(e){const t=e.pos;if(eo(e,Us,Vs,!0)){const n=Ss(e,t);return n.type="cdata",n}return null};const js={xml:!1,special:["script","style"],empty:["img","meta","link","br","base","hr","area","wbr","col","embed","input","param","source","track"]};var Ws=function(e,t){t=vs({},js,t);const n="string"==typeof e?new gr(e):e,o=new ks(n,"root"),r=new Set(t.empty),i=t.special.reduce((e,t)=>e.set(t,to(``)),new Map),s=(e,n)=>e.selfClosing||!t.xml&&r.has(n);for(let r=[o],l,d,c;!n.eof();)if(!(l=no(n)))n.next();else if(c=ro(l),"open"===l.type)d=new ks(n,"tag",l),ao(r).addChild(d),i.has(c)?d.close=oo(n,i.get(c)):!s(l,c)&&r.push(d);else if("close"===l.type){for(let e=r.length-1;0`\${${e}${t?":"+t:""}}`;let Ks=class extends gr{constructor(e,t,n){super();const o=e.constructor;this.editor=e,this.start=this.pos=t||o.Pos(0,0);const r=e.lastLine();this._eof=n?n.to:o.Pos(r,this._lineLength(r)),this._sof=n?n.from:o.Pos(0,0)}sof(){return 0>=lo(this.pos,this._sof)}eof(){return 0<=lo(this.pos,this._eof)}limit(e,t){return new this.constructor(this.editor,e,{from:e,to:t})}peek(){const{line:e,ch:t}=this.pos,n=this.editor.getLine(e);return t=this._lineLength(this.pos.line)&&(this.pos.line++,this.pos.ch=0),this.eof()&&(this.pos=zs({},this._eof)),e}return NaN}backUp(e){const t=this.editor.constructor;let{line:n,ch:o}=this.pos;for(o-=e||1;0<=n&&0>o;)n--,o+=this._lineLength(n);return this.pos=0>n||0>o?t.Pos(0,0):t.Pos(n,o),this.peek()}current(){return this.substring(this.start,this.pos)}substring(e,t){return this.editor.getRange(e,t)}error(e){const t=new Error(`${e} at line ${this.pos.line}, column ${this.pos.ch}`);return t.originalMessage=e,t.pos=this.pos,t.string=this.string,t}_lineLength(e){const t=e===this.editor.lastLine();return this.editor.getLine(e).length+(t?0:1)}};const Gs="emmet-abbreviation";let Xs=class{constructor(e,t,n){this.abbreviation=e,this.range=t,this.config=n,this.ast=xn(e,n),this.snippet=bn(this.ast,n),this.preview=ho(this.snippet)}insert(e,t){return Co(e,t||this.range,this.snippet)}valid(e,t){return this.preview&&this.abbreviation!==this.preview&&(t&&"stylesheet"===this.config.type?this._isValidForStylesheet(e):!0)}_isValidForStylesheet(e){const t=this.range.from,n=e.getTokenAt(t);if(/^[#!]/.test(this.abbreviation))return vo(e,t);const o=this.ast.children.every((e)=>e.name),r=n.state&&n.state.localState||n.state;return!o||"sass"===this.config.syntax||r&&r.context&&"block"===r.context.type}},Qs=class{constructor(e,t,n,o,r,i){this.type=e,this.editor=t,this.range=n,this.name=o,this.preview=r,this.snippet=i,this._inserted=!1}insert(){this._inserted||(this._inserted=!0,"function"==typeof this.snippet?this.snippet(this.editor,this.range):Co(this.editor,this.range,this.snippet),Eo(this.editor))}},Js=class{constructor(e,t,n){this.dom=e,this.type=t,this.syntax=n}nodeForPoint(e,t){let n=this.dom.firstChild,o=null;for(;n;)go(yo(n),e,t)?(o=n,n=n.firstChild):n=n.nextSibling;return o}};const $s="emmet-open-tag",Ys="emmet-close-tag";t.a=function(e){zs(e.commands,{emmetExpandAbbreviation:(e)=>No(e,!0),emmetExpandAbbreviationAll:(e)=>No(e,!1),emmetInsertLineBreak:Lo,emmetWrapWithAbbreviation:Do});const t=(e)=>Uo(e,e.getCursor());e.defineOption("markEmmetAbbreviation",!0,(e,n)=>{n?e.on("change",t):(e.off("change",t),Eo(e))}),e.defineOption("autoRenameTags",!0,(e,t)=>{t?e.on("change",ar):e.off("change",ar)}),e.defineOption("jsxBracket",!0),e.defineOption("markTagPairs",!1,(e,t)=>{t?(e.on("cursorActivity",Zo),e.on("change",$o)):(e.off("cursorActivity",Zo),e.off("change",$o),$o(e),tr(e))}),e.defineOption("emmet",{}),e.defineExtension("getEmmetCompletions",function(e,t){const n=this;"boolean"==typeof e&&(t=e,e=null),e=e||n.getCursor();const o=Vo(n,e);if(o&&o.completions.length)return n.getOption("markEmmetAbbreviation")&&!To(n,e)&&t&&(Eo(n),Ao(o.model)),{from:o.abbreviation.range.from,to:o.abbreviation.range.to,list:o.completions}}),e.defineExtension("getEmmetAbbreviation",function(e,t){return wo(this,e||this.getCursor(),t)}),e.defineExtension("findEmmetMarker",function(e){return To(this,e||this.getCursor())}),e.defineExtension("getEmmetDocumentModel",function(){const e=this;return e.getOption("markTagPairs")?Jo(e):Qo(e)})}},"1JcR":function(e,t,n){(function(e){e(n("tQq4"))})(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function n(e,t,n,o){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=o?Math.max(o.from,e.firstLine()):e.firstLine(),this.max=o?Math.min(o.to-1,e.lastLine()):e.lastLine()}function o(e,t){var n=e.cm.getTokenTypeAt(m(e.line,t));return n&&/\btag\b/.test(n)}function r(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function i(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function s(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t)if(r(e))continue;else return;if(!o(e,t+1)){e.ch=t+1;continue}var n=e.text.lastIndexOf("/",t),i=-1",e.ch-1):-1;if(-1==t)if(i(e))continue;else return;if(!o(e,t+1)){e.ch=t;continue}var n=e.text.lastIndexOf("/",t),r=-1p&&(!t||t==o[2]))return{tag:o[2],from:m(r,l),to:m(e.line,e.ch)}}else n.push(o[2])}}function u(e,t){for(var n=[],o;;){if(o=c(e),!o)return;if("selfClose"==o){l(e);continue}var r=e.line,s=e.ch,d=l(e);if(!d)return;if(d[1])n.push(d[2]);else{for(var p=n.length-1;0<=p;--p)if(n[p]==d[2]){n.length=p;break}if(0>p&&(!t||t==d[2]))return{tag:d[2],from:m(e.line,e.ch),to:m(r,s)}}}}var m=e.Pos,h=/<(\/?)([A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD-:.0-9\u00B7\u0300-\u036F\u203F-\u2040]*)/g;e.registerHelper("fold","xml",function(e,o){for(var r=new n(e,o.line,0),i;;){if(i=d(r),!i||r.line!=o.line)return;var l=s(r);if(!l)return;if(!i[1]&&"selfClose"!=l){var c=m(r.line,r.ch),u=p(r,i[2]);return u&&0")||-1!=i.text.indexOf("<")){var d=s(i),c=d&&m(i.line,i.ch),h=d&&l(i);if(d&&h&&!(0c);u++)i=e.getLine(d++),p=null==p?i:p+"\n"+i;l*=2,t.lastIndex=s.ch;var m=t.exec(p);if(m){var g=p.slice(0,m.index).split("\n"),f=m[0].split("\n"),y=s.line+g.length-1,b=g[g.length-1].length;return{from:h(y,b),to:h(y+f.length-1,1==f.length?b+f[0].length:f[f.length-1].length),match:m}}}}function s(e,t){for(var n=0,o;;){t.lastIndex=n;var r=t.exec(e);if(!r)return o;if(o=r,n=o.index+(o[0].length||1),n==e.length)return o}}function l(e,t,o){t=n(t,"g");for(var r=o.line,i=o.ch,l=e.firstLine(),d;r>=l;r--,i=-1){d=e.getLine(r),-1=d;){for(var p=0,i;p>1,l=o(e.slice(0,s)).length;if(l==n)return s;l>n?i=s:r=s+1}}function p(e,t,n,o){if(!t.length)return null;var r=o?g:f,s=r(t).split(/\r|\n\r?/);search:for(var l=n.line,d=n.ch,p=e.lastLine()+1-s.length;l<=p;l++,d=0){var u=e.getLine(l).slice(d),m=r(u);if(1==s.length){var y=m.indexOf(s[0]);if(-1==y)continue search;var n=c(u,m,y,r)+d;return{from:h(l,c(u,m,y,r)+d),to:h(l,c(u,m,y+s[0].length,r)+d)}}var b=m.length-s[0].length;if(m.slice(b)!=s[0])continue search;for(var x=1;x=p;l--,d=-1){u=e.getLine(l),-1=i.start&&(n.unshift(i.comment),this.leading.splice(r,1),this.trailing.splice(r,1));n.length&&(e.innerComments=n)}},e.prototype.findTrailingComments=function(e){var t=[];if(0=e.end.offset&&t.unshift(o.comment);return this.trailing.length=0,t}var r=this.stack[this.stack.length-1];if(r&&r.node.trailingComments){var i=r.node.trailingComments[0];i&&i.range[0]>=e.end.offset&&(t=r.node.trailingComments,delete r.node.trailingComments)}return t},e.prototype.findLeadingComments=function(e){for(var t=[],n,o;0=e.start.offset);)n=o.node,this.stack.pop();if(n){for(var r=n.leadingComments?n.leadingComments.length:0,s=r-1,i;0<=s;--s)i=n.leadingComments[s],i.range[1]<=e.start.offset&&(t.unshift(i),n.leadingComments.splice(s,1));return n.leadingComments&&0===n.leadingComments.length&&delete n.leadingComments,t}for(var s=this.leading.length-1,o;0<=s;--s)o=this.leading[s],o.start<=e.start.offset&&(t.unshift(o.comment),this.leading.splice(s,1));return t},e.prototype.visitNode=function(e,t){if(!(e.type===o.Syntax.Program&&0");)t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute(),e.push(t);return e},t.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),n=this.parseJSXAttributes(),o=this.matchJSX("/");return o&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new l.JSXOpeningElement(t,o,n))},t.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new l.JSXClosingElement(t))}var n=this.parseJSXElementName(),o=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new l.JSXOpeningElement(n,r,o))},t.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(e,new l.JSXEmptyExpression)},t.prototype.parseJSXExpressionContainer=function(){var e=this.createJSXNode();this.expectJSX("{");var t;return this.matchJSX("}")?(t=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),t=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(e,new l.JSXExpressionContainer(t))},t.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),n=this.nextJSXText();if(n.starte?n(e):n(55296+(e-65536>>10))+n(56320+(1023&e-65536))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||5760<=e&&0<=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||65<=e&&90>=e||97<=e&&122>=e||92===e||128<=e&&o.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||65<=e&&90>=e||97<=e&&122>=e||48<=e&&57>=e||92===e||128<=e&&o.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e))},isDecimalDigit:function(e){return 48<=e&&57>=e},isHexDigit:function(e){return 48<=e&&57>=e||65<=e&&70>=e||97<=e&&102>=e},isOctalDigit:function(e){return 48<=e&&55>=e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),r=function(){return function(e){this.type=o.JSXSyntax.JSXClosingElement,this.name=e}}();t.JSXClosingElement=r;var i=function(){return function(e,t,n){this.type=o.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=n}}();t.JSXElement=i;var s=function(){return function(){this.type=o.JSXSyntax.JSXEmptyExpression}}();t.JSXEmptyExpression=s;var l=function(){return function(e){this.type=o.JSXSyntax.JSXExpressionContainer,this.expression=e}}();t.JSXExpressionContainer=l;var d=function(){return function(e){this.type=o.JSXSyntax.JSXIdentifier,this.name=e}}();t.JSXIdentifier=d;var c=function(){return function(e,t){this.type=o.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t}}();t.JSXMemberExpression=c;var p=function(){return function(e,t){this.type=o.JSXSyntax.JSXAttribute,this.name=e,this.value=t}}();t.JSXAttribute=p;var u=function(){return function(e,t){this.type=o.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t}}();t.JSXNamespacedName=u;var m=function(){return function(e,t,n){this.type=o.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=n}}();t.JSXOpeningElement=m;var h=function(){return function(e){this.type=o.JSXSyntax.JSXSpreadAttribute,this.argument=e}}();t.JSXSpreadAttribute=h;var g=function(){return function(e,t){this.type=o.JSXSyntax.JSXText,this.value=e,this.raw=t}}();t.JSXText=g},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),r=function(){return function(e){this.type=o.Syntax.ArrayExpression,this.elements=e}}();t.ArrayExpression=r;var i=function(){return function(e){this.type=o.Syntax.ArrayPattern,this.elements=e}}();t.ArrayPattern=i;var s=function(){return function(e,t,n){this.type=o.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!1}}();t.ArrowFunctionExpression=s;var l=function(){return function(e,t,n){this.type=o.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=n}}();t.AssignmentExpression=l;var d=function(){return function(e,t){this.type=o.Syntax.AssignmentPattern,this.left=e,this.right=t}}();t.AssignmentPattern=d;var c=function(){return function(e,t,n){this.type=o.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!0}}();t.AsyncArrowFunctionExpression=c;var p=function(){return function(e,t,n){this.type=o.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0}}();t.AsyncFunctionDeclaration=p;var u=function(){return function(e,t,n){this.type=o.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0}}();t.AsyncFunctionExpression=u;var m=function(){return function(e){this.type=o.Syntax.AwaitExpression,this.argument=e}}();t.AwaitExpression=m;var h=function(){return function(e,t,n){this.type="||"===e||"&&"===e?o.Syntax.LogicalExpression:o.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=n}}();t.BinaryExpression=h;var g=function(){return function(e){this.type=o.Syntax.BlockStatement,this.body=e}}();t.BlockStatement=g;var f=function(){return function(e){this.type=o.Syntax.BreakStatement,this.label=e}}();t.BreakStatement=f;var y=function(){return function(e,t){this.type=o.Syntax.CallExpression,this.callee=e,this.arguments=t}}();t.CallExpression=y;var b=function(){return function(e,t){this.type=o.Syntax.CatchClause,this.param=e,this.body=t}}();t.CatchClause=b;var x=function(){return function(e){this.type=o.Syntax.ClassBody,this.body=e}}();t.ClassBody=x;var v=function(){return function(e,t,n){this.type=o.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=n}}();t.ClassDeclaration=v;var k=function(){return function(e,t,n){this.type=o.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=n}}();t.ClassExpression=k;var S=function(){return function(e,t){this.type=o.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t}}();t.ComputedMemberExpression=S;var C=function(){return function(e,t,n){this.type=o.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n}}();t.ConditionalExpression=C;var w=function(){return function(e){this.type=o.Syntax.ContinueStatement,this.label=e}}();t.ContinueStatement=w;var T=function(){return function(){this.type=o.Syntax.DebuggerStatement}}();t.DebuggerStatement=T;var E=function(){return function(e,t){this.type=o.Syntax.ExpressionStatement,this.expression=e,this.directive=t}}();t.Directive=E;var A=function(){return function(e,t){this.type=o.Syntax.DoWhileStatement,this.body=e,this.test=t}}();t.DoWhileStatement=A;var I=function(){return function(){this.type=o.Syntax.EmptyStatement}}();t.EmptyStatement=I;var N=function(){return function(e){this.type=o.Syntax.ExportAllDeclaration,this.source=e}}();t.ExportAllDeclaration=N;var L=function(){return function(e){this.type=o.Syntax.ExportDefaultDeclaration,this.declaration=e}}();t.ExportDefaultDeclaration=L;var _=function(){return function(e,t,n){this.type=o.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n}}();t.ExportNamedDeclaration=_;var O=function(){return function(e,t){this.type=o.Syntax.ExportSpecifier,this.exported=t,this.local=e}}();t.ExportSpecifier=O;var M=function(){return function(e){this.type=o.Syntax.ExpressionStatement,this.expression=e}}();t.ExpressionStatement=M;var D=function(){return function(e,t,n){this.type=o.Syntax.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1}}();t.ForInStatement=D;var R=function(){return function(e,t,n){this.type=o.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=n}}();t.ForOfStatement=R;var P=function(){return function(e,t,n,r){this.type=o.Syntax.ForStatement,this.init=e,this.test=t,this.update=n,this.body=r}}();t.ForStatement=P;var F=function(){return function(e,t,n,r){this.type=o.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=r,this.expression=!1,this.async=!1}}();t.FunctionDeclaration=F;var B=function(){return function(e,t,n,r){this.type=o.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=r,this.expression=!1,this.async=!1}}();t.FunctionExpression=B;var U=function(){return function(e){this.type=o.Syntax.Identifier,this.name=e}}();t.Identifier=U;var V=function(){return function(e,t,n){this.type=o.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=n}}();t.IfStatement=V;var q=function(){return function(e,t){this.type=o.Syntax.ImportDeclaration,this.specifiers=e,this.source=t}}();t.ImportDeclaration=q;var j=function(){return function(e){this.type=o.Syntax.ImportDefaultSpecifier,this.local=e}}();t.ImportDefaultSpecifier=j;var W=function(){return function(e){this.type=o.Syntax.ImportNamespaceSpecifier,this.local=e}}();t.ImportNamespaceSpecifier=W;var z=function(){return function(e,t){this.type=o.Syntax.ImportSpecifier,this.local=e,this.imported=t}}();t.ImportSpecifier=z;var H=function(){return function(e,t){this.type=o.Syntax.LabeledStatement,this.label=e,this.body=t}}();t.LabeledStatement=H;var K=function(){return function(e,t){this.type=o.Syntax.Literal,this.value=e,this.raw=t}}();t.Literal=K;var G=function(){return function(e,t){this.type=o.Syntax.MetaProperty,this.meta=e,this.property=t}}();t.MetaProperty=G;var X=function(){return function(e,t,n,r,i){this.type=o.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=n,this.kind=r,this.static=i}}();t.MethodDefinition=X;var Q=function(){return function(e){this.type=o.Syntax.Program,this.body=e,this.sourceType="module"}}();t.Module=Q;var J=function(){return function(e,t){this.type=o.Syntax.NewExpression,this.callee=e,this.arguments=t}}();t.NewExpression=J;var $=function(){return function(e){this.type=o.Syntax.ObjectExpression,this.properties=e}}();t.ObjectExpression=$;var Y=function(){return function(e){this.type=o.Syntax.ObjectPattern,this.properties=e}}();t.ObjectPattern=Y;var Z=function(){return function(e,t,n,r,i,s){this.type=o.Syntax.Property,this.key=t,this.computed=n,this.value=r,this.kind=e,this.method=i,this.shorthand=s}}();t.Property=Z;var ee=function(){return function(e,t,n,r){this.type=o.Syntax.Literal,this.value=e,this.raw=t,this.regex={pattern:n,flags:r}}}();t.RegexLiteral=ee;var te=function(){return function(e){this.type=o.Syntax.RestElement,this.argument=e}}();t.RestElement=te;var ne=function(){return function(e){this.type=o.Syntax.ReturnStatement,this.argument=e}}();t.ReturnStatement=ne;var oe=function(){return function(e){this.type=o.Syntax.Program,this.body=e,this.sourceType="script"}}();t.Script=oe;var re=function(){return function(e){this.type=o.Syntax.SequenceExpression,this.expressions=e}}();t.SequenceExpression=re;var ae=function(){return function(e){this.type=o.Syntax.SpreadElement,this.argument=e}}();t.SpreadElement=ae;var ie=function(){return function(e,t){this.type=o.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t}}();t.StaticMemberExpression=ie;var se=function(){return function(){this.type=o.Syntax.Super}}();t.Super=se;var le=function(){return function(e,t){this.type=o.Syntax.SwitchCase,this.test=e,this.consequent=t}}();t.SwitchCase=le;var de=function(){return function(e,t){this.type=o.Syntax.SwitchStatement,this.discriminant=e,this.cases=t}}();t.SwitchStatement=de;var ce=function(){return function(e,t){this.type=o.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t}}();t.TaggedTemplateExpression=ce;var pe=function(){return function(e,t){this.type=o.Syntax.TemplateElement,this.value=e,this.tail=t}}();t.TemplateElement=pe;var ue=function(){return function(e,t){this.type=o.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t}}();t.TemplateLiteral=ue;var me=function(){return function(){this.type=o.Syntax.ThisExpression}}();t.ThisExpression=me;var he=function(){return function(e){this.type=o.Syntax.ThrowStatement,this.argument=e}}();t.ThrowStatement=he;var ge=function(){return function(e,t,n){this.type=o.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=n}}();t.TryStatement=ge;var fe=function(){return function(e,t){this.type=o.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0}}();t.UnaryExpression=fe;var ye=function(){return function(e,t,n){this.type=o.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=n}}();t.UpdateExpression=ye;var be=function(){return function(e,t){this.type=o.Syntax.VariableDeclaration,this.declarations=e,this.kind=t}}();t.VariableDeclaration=be;var xe=function(){return function(e,t){this.type=o.Syntax.VariableDeclarator,this.id=e,this.init=t}}();t.VariableDeclarator=xe;var ve=function(){return function(e,t){this.type=o.Syntax.WhileStatement,this.test=e,this.body=t}}();t.WhileStatement=ve;var ke=function(){return function(e,t){this.type=o.Syntax.WithStatement,this.object=e,this.body=t}}();t.WithStatement=ke;var Se=function(){return function(e,t){this.type=o.Syntax.YieldExpression,this.argument=e,this.delegate=t}}();t.YieldExpression=Se},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(9),r=n(10),s=n(11),l=n(7),i=n(12),d=n(2),c=n(13),p="ArrowParameterPlaceHolder",u=function(){function e(e,t,n){void 0===t&&(t={}),this.config={range:"boolean"==typeof t.range&&t.range,loc:"boolean"==typeof t.loc&&t.loc,source:null,tokens:"boolean"==typeof t.tokens&&t.tokens,comment:"boolean"==typeof t.comment&&t.comment,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.config.loc&&t.source&&null!==t.source&&(this.config.source=t.source+""),this.delegate=n,this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new i.Scanner(e,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],n=1;n>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,o=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=o,r},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,o=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=o||this.context.firstCoverInitializedNameError,r},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():!this.hasLineTerminator&&(2!==this.lookahead.type&&!this.match("}")&&this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},e.prototype.parsePrimaryExpression=function(){var e=this.createNode(),t,n,o;switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),t=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(e,new l.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,s.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,n=this.nextToken(),o=this.getTokenRaw(n),t=this.finalize(e,new l.Literal(n.value,o));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,n=this.nextToken(),o=this.getTokenRaw(n),t=this.finalize(e,new l.Literal("true"===n.value,o));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,n=this.nextToken(),o=this.getTokenRaw(n),t=this.finalize(e,new l.Literal(null,o));break;case 10:t=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,t=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":t=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":t=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,n=this.nextRegexToken(),o=this.getTokenRaw(n),t=this.finalize(e,new l.RegexLiteral(n.regex,o,n.pattern,n.flags));break;default:t=this.throwUnexpectedToken(this.nextToken());}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?t=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?t=this.finalize(e,new l.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?t=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),t=this.finalize(e,new l.ThisExpression)):this.matchKeyword("class")?t=this.parseClassExpression():t=this.throwUnexpectedToken(this.nextToken()));break;default:t=this.throwUnexpectedToken(this.nextToken());}return t},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new l.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(n)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new l.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=e.simple;var o=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,this.context.allowStrictDirective=n,o},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters(),o=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new l.FunctionExpression(null,n.params,o,!1))},e.prototype.parsePropertyMethodAsyncFunction=function(){var e=this.createNode(),t=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var o=this.parseFormalParameters(),r=this.parsePropertyMethod(o);return this.context.allowYield=t,this.context.await=n,this.finalize(e,new l.AsyncFunctionExpression(null,o.params,r))},e.prototype.parseObjectPropertyKey=function(){var e=this.createNode(),t=this.nextToken(),n;switch(t.type){case 8:case 6:this.context.strict&&t.octal&&this.tolerateUnexpectedToken(t,s.Messages.StrictOctalLiteral);var o=this.getTokenRaw(t);n=this.finalize(e,new l.Literal(t.value,o));break;case 3:case 1:case 5:case 4:n=this.finalize(e,new l.Identifier(t.value));break;case 7:"["===t.value?(n=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):n=this.throwUnexpectedToken(t);break;default:n=this.throwUnexpectedToken(t);}return n},e.prototype.isPropertyKey=function(e,t){return e.type===d.Syntax.Identifier&&e.name===t||e.type===d.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t=this.createNode(),n=this.lookahead,o=null,r=null,i=!1,d=!1,c=!1,p=!1,u;if(3===n.type){var m=n.value;this.nextToken(),i=this.match("["),p=!this.hasLineTerminator&&"async"===m&&!this.match(":")&&!this.match("(")&&!this.match("*"),o=p?this.parseObjectPropertyKey():this.finalize(t,new l.Identifier(m))}else this.match("*")?this.nextToken():(i=this.match("["),o=this.parseObjectPropertyKey());var h=this.qualifiedPropertyName(this.lookahead);if(3===n.type&&!p&&"get"===n.value&&h)u="get",i=this.match("["),o=this.parseObjectPropertyKey(),this.context.allowYield=!1,r=this.parseGetterMethod();else if(3===n.type&&!p&&"set"===n.value&&h)u="set",i=this.match("["),o=this.parseObjectPropertyKey(),r=this.parseSetterMethod();else if(7===n.type&&"*"===n.value&&h)u="init",i=this.match("["),o=this.parseObjectPropertyKey(),r=this.parseGeneratorMethod(),d=!0;else if(o||this.throwUnexpectedToken(this.lookahead),u="init",this.match(":")&&!p)!i&&this.isPropertyKey(o,"__proto__")&&(e.value&&this.tolerateError(s.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),r=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))r=p?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),d=!0;else if(3===n.type){var m=this.finalize(t,new l.Identifier(n.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),c=!0;var g=this.isolateCoverGrammar(this.parseAssignmentExpression);r=this.finalize(t,new l.AssignmentPattern(m,g))}else c=!0,r=m}else this.throwUnexpectedToken(this.nextToken());return this.finalize(t,new l.Property(u,o,i,r,d,c))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],n={value:!1};!this.match("}");)t.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new l.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){o.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),n=t.value,r=t.cooked;return this.finalize(e,new l.TemplateElement({raw:n,cooked:r},t.tail))},e.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),n=t.value,o=t.cooked;return this.finalize(e,new l.TemplateElement({raw:n,cooked:o},t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],n=[],o=this.parseTemplateHead();for(n.push(o);!o.tail;)t.push(this.parseExpression()),o=this.parseTemplateElement(),n.push(o);return this.finalize(e,new l.TemplateLiteral(n,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case d.Syntax.Identifier:case d.Syntax.MemberExpression:case d.Syntax.RestElement:case d.Syntax.AssignmentPattern:break;case d.Syntax.SpreadElement:e.type=d.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case d.Syntax.ArrayExpression:e.type=d.Syntax.ArrayPattern;for(var t=0;t")||this.expect("=>"),e={type:p,params:[],async:!1};else{var t=this.lookahead,n=[];if(this.match("..."))e=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:p,params:[e],async:!1};else{var o=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var r=[];for(this.context.isAssignmentTarget=!1,r.push(e);2!==this.lookahead.type&&!!this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var s=0;s")||this.expect("=>"),this.context.isBindingElement=!1;for(var s=0;s")&&(e.type===d.Syntax.Identifier&&"yield"===e.name&&(o=!0,e={type:p,params:[e],async:!1}),!o)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===d.Syntax.SequenceExpression)for(var s=0;s")){for(var c=0;c=o);){for(;2")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var r=e.async,i=this.reinterpretAsCoverFormalsList(e);if(i){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var c=this.context.strict,u=this.context.allowStrictDirective;this.context.allowStrictDirective=i.simple;var m=this.context.allowYield,h=this.context.await;this.context.allowYield=!0,this.context.await=r;var g=this.startNode(t);this.expect("=>");var f;if(this.match("{")){var y=this.context.allowIn;this.context.allowIn=!0,f=this.parseFunctionSourceElements(),this.context.allowIn=y}else f=this.isolateCoverGrammar(this.parseAssignmentExpression);var b=f.type!==d.Syntax.BlockStatement;this.context.strict&&i.firstRestricted&&this.throwUnexpectedToken(i.firstRestricted,i.message),this.context.strict&&i.stricted&&this.tolerateUnexpectedToken(i.stricted,i.message),e=r?this.finalize(g,new l.AsyncArrowFunctionExpression(i.params,f,b)):this.finalize(g,new l.ArrowFunctionExpression(i.params,f,b)),this.context.strict=c,this.context.allowStrictDirective=u,this.context.allowYield=m,this.context.await=h}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(s.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===d.Syntax.Identifier){var x=e;this.scanner.isRestrictedWord(x.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(x.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),n=this.nextToken();var v=n.value,k=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new l.AssignmentExpression(v,e,k)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){for(var n=[t];2!==this.lookahead.type&&!!this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));t=this.finalize(this.startNode(e),new l.SequenceExpression(n))}return t},e.prototype.parseStatementListItem=function(){var e;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalExportDeclaration),e=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalImportDeclaration),e=this.parseImportDeclaration();break;case"const":e=this.parseLexicalDeclaration({inFor:!1});break;case"function":e=this.parseFunctionDeclaration();break;case"class":e=this.parseClassDeclaration();break;case"let":e=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:e=this.parseStatement();}else e=this.parseStatement();return e},e.prototype.parseBlock=function(){var e=this.createNode();this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.finalize(e,new l.BlockStatement(t))},e.prototype.parseLexicalBinding=function(e,t){var n=this.createNode(),o=this.parsePattern([],e);this.context.strict&&o.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(o.name)&&this.tolerateError(s.Messages.StrictVarName);var r=null;return"const"===e?!this.matchKeyword("in")&&!this.matchContextualKeyword("of")&&(this.match("=")?(this.nextToken(),r=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(s.Messages.DeclarationMissingInitializer,"const")):(!t.inFor&&o.type!==d.Syntax.Identifier||this.match("="))&&(this.expect("="),r=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new l.VariableDeclarator(o,r))},e.prototype.parseBindingList=function(e,t){for(var n=[this.parseLexicalBinding(e,t)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(e,t));return n},e.prototype.isLexicalDeclaration=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.scanner.lex();return this.scanner.restoreState(e),3===t.type||7===t.type&&"["===t.value||7===t.type&&"{"===t.value||4===t.type&&"let"===t.value||4===t.type&&"yield"===t.value},e.prototype.parseLexicalDeclaration=function(e){var t=this.createNode(),n=this.nextToken().value;o.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var r=this.parseBindingList(n,e);return this.consumeSemicolon(),this.finalize(t,new l.VariableDeclaration(r,n))},e.prototype.parseBindingRestElement=function(e,t){var n=this.createNode();this.expect("...");var o=this.parsePattern(e,t);return this.finalize(n,new l.RestElement(o))},e.prototype.parseArrayPattern=function(e,t){var n=this.createNode();this.expect("[");for(var o=[];!this.match("]");)if(this.match(","))this.nextToken(),o.push(null);else{if(this.match("...")){o.push(this.parseBindingRestElement(e,t));break}else o.push(this.parsePatternWithDefault(e,t));this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new l.ArrayPattern(o))},e.prototype.parsePropertyPattern=function(e,t){var n=this.createNode(),o=!1,r=!1,i,s;if(3===this.lookahead.type){var d=this.lookahead;i=this.parseVariableIdentifier();var c=this.finalize(n,new l.Identifier(d.value));if(this.match("=")){e.push(d),r=!0,this.nextToken();var p=this.parseAssignmentExpression();s=this.finalize(this.startNode(d),new l.AssignmentPattern(c,p))}else this.match(":")?(this.expect(":"),s=this.parsePatternWithDefault(e,t)):(e.push(d),r=!0,s=c)}else o=this.match("["),i=this.parseObjectPropertyKey(),this.expect(":"),s=this.parsePatternWithDefault(e,t);return this.finalize(n,new l.Property("init",i,o,s,!1,r))},e.prototype.parseObjectPattern=function(e,t){var n=this.createNode(),o=[];for(this.expect("{");!this.match("}");)o.push(this.parsePropertyPattern(e,t)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new l.ObjectPattern(o))},e.prototype.parsePattern=function(e,t){var n;return this.match("[")?n=this.parseArrayPattern(e,t):this.match("{")?n=this.parseObjectPattern(e,t):(this.matchKeyword("let")&&("const"===t||"let"===t)&&this.tolerateUnexpectedToken(this.lookahead,s.Messages.LetInLexicalBinding),e.push(this.lookahead),n=this.parseVariableIdentifier(t)),n},e.prototype.parsePatternWithDefault=function(e,t){var n=this.lookahead,o=this.parsePattern(e,t);if(this.match("=")){this.nextToken();var r=this.context.allowYield;this.context.allowYield=!0;var i=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=r,o=this.finalize(this.startNode(n),new l.AssignmentPattern(o,i))}return o},e.prototype.parseVariableIdentifier=function(e){var t=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):!this.context.allowYield&&this.throwUnexpectedToken(n):3===n.type?(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n):this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==e)&&this.throwUnexpectedToken(n),this.finalize(t,new l.Identifier(n.value))},e.prototype.parseVariableDeclaration=function(e){var t=this.createNode(),n=this.parsePattern([],"var");this.context.strict&&n.type===d.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(s.Messages.StrictVarName);var o=null;return this.match("=")?(this.nextToken(),o=this.isolateCoverGrammar(this.parseAssignmentExpression)):n.type!==d.Syntax.Identifier&&!e.inFor&&this.expect("="),this.finalize(t,new l.VariableDeclarator(n,o))},e.prototype.parseVariableDeclarationList=function(e){var t={inFor:e.inFor},n=[];for(n.push(this.parseVariableDeclaration(t));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(t));return n},e.prototype.parseVariableStatement=function(){var e=this.createNode();this.expectKeyword("var");var t=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(e,new l.VariableDeclaration(t,"var"))},e.prototype.parseEmptyStatement=function(){var e=this.createNode();return this.expect(";"),this.finalize(e,new l.EmptyStatement)},e.prototype.parseExpressionStatement=function(){var e=this.createNode(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new l.ExpressionStatement(t))},e.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(s.Messages.StrictFunction),this.parseStatement()},e.prototype.parseIfStatement=function(){var e=this.createNode(),t=null,n;this.expectKeyword("if"),this.expect("(");var o=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new l.EmptyStatement)):(this.expect(")"),n=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),t=this.parseIfClause())),this.finalize(e,new l.IfStatement(o,n,t))},e.prototype.parseDoWhileStatement=function(){var e=this.createNode();this.expectKeyword("do");var t=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=t,this.expectKeyword("while"),this.expect("(");var o=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(e,new l.DoWhileStatement(n,o))},e.prototype.parseWhileStatement=function(){var e=this.createNode(),t;this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new l.EmptyStatement);else{this.expect(")");var o=this.context.inIteration;this.context.inIteration=!0,t=this.parseStatement(),this.context.inIteration=o}return this.finalize(e,new l.WhileStatement(n,t))},e.prototype.parseForStatement=function(){var e=null,t=null,n=null,o=!0,r=this.createNode(),i,c;if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){e=this.createNode(),this.nextToken();var p=this.context.allowIn;this.context.allowIn=!1;var u=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=p,1===u.length&&this.matchKeyword("in")){var m=u[0];m.init&&(m.id.type===d.Syntax.ArrayPattern||m.id.type===d.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(s.Messages.ForInOfLoopInitializer,"for-in"),e=this.finalize(e,new l.VariableDeclaration(u,"var")),this.nextToken(),i=e,c=this.parseExpression(),e=null}else 1===u.length&&null===u[0].init&&this.matchContextualKeyword("of")?(e=this.finalize(e,new l.VariableDeclaration(u,"var")),this.nextToken(),i=e,c=this.parseAssignmentExpression(),e=null,o=!1):(e=this.finalize(e,new l.VariableDeclaration(u,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){e=this.createNode();var h=this.nextToken().value;if(!this.context.strict&&"in"===this.lookahead.value)e=this.finalize(e,new l.Identifier(h)),this.nextToken(),i=e,c=this.parseExpression(),e=null;else{var p=this.context.allowIn;this.context.allowIn=!1;var u=this.parseBindingList(h,{inFor:!0});this.context.allowIn=p,1===u.length&&null===u[0].init&&this.matchKeyword("in")?(e=this.finalize(e,new l.VariableDeclaration(u,h)),this.nextToken(),i=e,c=this.parseExpression(),e=null):1===u.length&&null===u[0].init&&this.matchContextualKeyword("of")?(e=this.finalize(e,new l.VariableDeclaration(u,h)),this.nextToken(),i=e,c=this.parseAssignmentExpression(),e=null,o=!1):(this.consumeSemicolon(),e=this.finalize(e,new l.VariableDeclaration(u,h)))}}else{var g=this.lookahead,p=this.context.allowIn;if(this.context.allowIn=!1,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=p,this.matchKeyword("in"))this.context.isAssignmentTarget&&e.type!==d.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(e),i=e,c=this.parseExpression(),e=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&e.type!==d.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(e),i=e,c=this.parseAssignmentExpression(),e=null,o=!1;else{if(this.match(",")){for(var f=[e];this.match(",");)this.nextToken(),f.push(this.isolateCoverGrammar(this.parseAssignmentExpression));e=this.finalize(this.startNode(g),new l.SequenceExpression(f))}this.expect(";")}}"undefined"==typeof i&&(!this.match(";")&&(t=this.parseExpression()),this.expect(";"),!this.match(")")&&(n=this.parseExpression()));var y;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),y=this.finalize(this.createNode(),new l.EmptyStatement);else{this.expect(")");var b=this.context.inIteration;this.context.inIteration=!0,y=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=b}return"undefined"==typeof i?this.finalize(r,new l.ForStatement(e,t,n,y)):o?this.finalize(r,new l.ForInStatement(i,c,y)):this.finalize(r,new l.ForOfStatement(i,c,y))},e.prototype.parseContinueStatement=function(){var e=this.createNode();this.expectKeyword("continue");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();t=n;var o="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,o)||this.throwError(s.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.throwError(s.Messages.IllegalContinue),this.finalize(e,new l.ContinueStatement(t))},e.prototype.parseBreakStatement=function(){var e=this.createNode();this.expectKeyword("break");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier(),o="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,o)||this.throwError(s.Messages.UnknownLabel,n.name),t=n}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.context.inSwitch||this.throwError(s.Messages.IllegalBreak),this.finalize(e,new l.BreakStatement(t))},e.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(s.Messages.IllegalReturn);var e=this.createNode();this.expectKeyword("return");var t=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&2!==this.lookahead.type,n=t?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(e,new l.ReturnStatement(n))},e.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(s.Messages.StrictModeWith);var e=this.createNode(),t;this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new l.EmptyStatement)):(this.expect(")"),t=this.parseStatement()),this.finalize(e,new l.WithStatement(n,t))},e.prototype.parseSwitchCase=function(){var e=this.createNode(),t;this.matchKeyword("default")?(this.nextToken(),t=null):(this.expectKeyword("case"),t=this.parseExpression()),this.expect(":");for(var n=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)n.push(this.parseStatementListItem());return this.finalize(e,new l.SwitchCase(t,n))},e.prototype.parseSwitchStatement=function(){var e=this.createNode();this.expectKeyword("switch"),this.expect("(");var t=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var o=[],r=!1;for(this.expect("{");!this.match("}");){var i=this.parseSwitchCase();null===i.test&&(r&&this.throwError(s.Messages.MultipleDefaultsInSwitch),r=!0),o.push(i)}return this.expect("}"),this.context.inSwitch=n,this.finalize(e,new l.SwitchStatement(t,o))},e.prototype.parseLabelledStatement=function(){var e=this.createNode(),t=this.parseExpression(),n;if(t.type===d.Syntax.Identifier&&this.match(":")){this.nextToken();var o=t,r="$"+o.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)&&this.throwError(s.Messages.Redeclaration,"Label",o.name),this.context.labelSet[r]=!0;var i;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),i=this.parseClassDeclaration();else if(this.matchKeyword("function")){var c=this.lookahead,p=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(c,s.Messages.StrictFunction):p.generator&&this.tolerateUnexpectedToken(c,s.Messages.GeneratorInLegacyContext),i=p}else i=this.parseStatement();delete this.context.labelSet[r],n=new l.LabeledStatement(o,i)}else this.consumeSemicolon(),n=new l.ExpressionStatement(t);return this.finalize(e,n)},e.prototype.parseThrowStatement=function(){var e=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(s.Messages.NewlineAfterThrow);var t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new l.ThrowStatement(t))},e.prototype.parseCatchClause=function(){var e=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var t=[],n=this.parsePattern(t),o={},r=0,i;r=this.length},e.prototype.throwUnexpectedToken=function(e){return void 0===e&&(e=d.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.tolerateUnexpectedToken=function(e){void 0===e&&(e=d.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.skipSingleLineComment=function(e){var t=[],n,o;for(this.trackComment&&(t=[],n=this.index-e,o={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(++this.index,l.Character.isLineTerminator(r)){if(this.trackComment){o.end={line:this.lineNumber,column:this.index-this.lineStart-1};var i={multiLine:!1,slice:[n+e,this.index-1],range:[n,this.index-1],loc:o};t.push(i)}return 13===r&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t}}if(this.trackComment){o.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!1,slice:[n+e,this.index],range:[n,this.index],loc:o};t.push(i)}return t},e.prototype.skipMultiLineComment=function(){var e=[],t,n;for(this.trackComment&&(e=[],t=this.index-2,n={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var o=this.source.charCodeAt(this.index);if(l.Character.isLineTerminator(o))13===o&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===o){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var r={multiLine:!0,slice:[t+2,this.index-2],range:[t,this.index],loc:n};e.push(r)}return e}++this.index}else++this.index}if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var r={multiLine:!0,slice:[t+2,this.index],range:[t,this.index],loc:n};e.push(r)}return this.tolerateUnexpectedToken(),e},e.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index,n;!this.eof();)if(n=this.source.charCodeAt(this.index),l.Character.isWhiteSpace(n))++this.index;else if(l.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===n){if(n=this.source.charCodeAt(this.index+1),47===n){this.index+=2;var o=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(o)),t=!0}else if(42===n){this.index+=2;var o=this.skipMultiLineComment();this.trackComment&&(e=e.concat(o))}else break;}else if(t&&45===n){if(45===this.source.charCodeAt(this.index+1)&&62===this.source.charCodeAt(this.index+2)){this.index+=3;var o=this.skipSingleLineComment(3);this.trackComment&&(e=e.concat(o))}else break;}else if(60!==n)break;else if("!--"===this.source.slice(this.index+1,this.index+4)){this.index+=4;var o=this.skipSingleLineComment(4);this.trackComment&&(e=e.concat(o))}else break;return e},e.prototype.isFutureReservedWord=function(e){return"enum"===e||"export"===e||"import"===e||"super"===e},e.prototype.isStrictModeReservedWord=function(e){return"implements"===e||"interface"===e||"package"===e||"private"===e||"protected"===e||"public"===e||"static"===e||"yield"===e||"let"===e},e.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},e.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1;}},e.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(55296<=t&&56319>=t){var n=this.source.charCodeAt(e+1);if(56320<=n&&57343>=n){var o=t;t=1024*(o-55296)+n-56320+65536}}return t},e.prototype.scanHexEscape=function(e){for(var t="u"===e?4:2,o=0,s=0;st)return this.index=e,this.getComplexIdentifier();if(l.Character.isIdentifierPart(t))++this.index;else break}return this.source.slice(e,this.index)},e.prototype.getComplexIdentifier=function(){var e=this.codePointAt(this.index),t=l.Character.fromCodePoint(e);this.index+=t.length;var n;for(92===e&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):(n=this.scanHexEscape("u"),(null===n||"\\"===n||!l.Character.isIdentifierStart(n.charCodeAt(0)))&&this.throwUnexpectedToken()),t=n);!this.eof()&&(e=this.codePointAt(this.index),!!l.Character.isIdentifierPart(e));)n=l.Character.fromCodePoint(e),t+=n,this.index+=n.length,92===e&&(t=t.substr(0,t.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):(n=this.scanHexEscape("u"),(null===n||"\\"===n||!l.Character.isIdentifierPart(n.charCodeAt(0)))&&this.throwUnexpectedToken()),t+=n);return t},e.prototype.octalToDecimal=function(e){var t="0"!==e,n=i(e);return!this.eof()&&l.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+i(this.source[this.index++]),0<="0123".indexOf(e)&&!this.eof()&&l.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+i(this.source[this.index++]))),{code:n,octal:t}},e.prototype.scanIdentifier=function(){var e=this.index,t=92===this.source.charCodeAt(e)?this.getComplexIdentifier():this.getIdentifier(),n;if(n=1===t.length?3:this.isKeyword(t)?4:"null"===t?5:"true"===t||"false"===t?1:3,3!==n&&e+t.length!==this.index){var o=this.index;this.index=e,this.tolerateUnexpectedToken(d.Messages.InvalidEscapedReservedWord),this.index=o}return{type:n,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanPunctuator=function(){var e=this.index,t=this.source[this.index];return"("===t||"{"===t?("{"===t&&this.curlyStack.push("{"),++this.index):"."===t?(++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...")):"}"===t?(++this.index,this.curlyStack.pop()):")"===t||";"===t||","===t||"["===t||"]"===t||":"===t||"?"===t||"~"===t?++this.index:(t=this.source.substr(this.index,4),">>>="===t?this.index+=4:(t=t.substr(0,3),"==="===t||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:(t=t.substr(0,2),"&&"===t||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],0<="<>=!+-*%&|^/".indexOf(t)&&++this.index)))),this.index===e&&this.throwUnexpectedToken(),{type:7,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&!!l.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),l.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanBinaryLiteral=function(e){for(var t="",n;!this.eof()&&(n=this.source[this.index],"0"===n||"1"===n);)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),this.eof()||(n=this.source.charCodeAt(this.index),(l.Character.isIdentifierStart(n)||l.Character.isDecimalDigit(n))&&this.throwUnexpectedToken()),{type:6,value:parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanOctalLiteral=function(e,t){var n="",o=!1;for(l.Character.isOctalDigit(e.charCodeAt(0))?(o=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&!!l.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return o||0!==n.length||this.throwUnexpectedToken(),(l.Character.isIdentifierStart(this.source.charCodeAt(this.index))||l.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:o,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1,t;e=s?n(s):o}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o));try{RegExp(r)}catch(t){this.throwUnexpectedToken(d.Messages.InvalidRegExp)}try{return new RegExp(e,t)}catch(e){return null}},e.prototype.scanRegExpBody=function(){var e=this.source[this.index];s.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],n=!1,o=!1;!this.eof();)if(e=this.source[this.index++],t+=e,"\\"===e)e=this.source[this.index++],l.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(d.Messages.UnterminatedRegExp),t+=e;else if(l.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(d.Messages.UnterminatedRegExp);else if(n)"]"===e&&(n=!1);else if("/"===e){o=!0;break}else"["===e&&(n=!0);return o||this.throwUnexpectedToken(d.Messages.UnterminatedRegExp),t.substr(1,t.length-2)},e.prototype.scanRegExpFlags=function(){for(var e="",t="",n;!this.eof()&&(n=this.source[this.index],!!l.Character.isIdentifierPart(n.charCodeAt(0)));)if(++this.index,"\\"!==n||this.eof())t+=n,e+=n;else if(n=this.source[this.index],"u"===n){++this.index;var o=this.index,r=this.scanHexEscape("u");if(null!==r)for(t+=r,e+="\\u";oe&&l.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},e}();t.Scanner=c},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenName={},t.TokenName[1]="Boolean",t.TokenName[2]="",t.TokenName[3]="Identifier",t.TokenName[4]="Keyword",t.TokenName[5]="Null",t.TokenName[6]="Numeric",t.TokenName[7]="Punctuator",t.TokenName[8]="String",t.TokenName[9]="RegularExpression",t.TokenName[10]="Template"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHTMLEntities={quot:"\"",amp:"&",apos:"'",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27E8",rang:"\u27E9"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(10),r=n(12),i=n(13),s=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return 0<=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var n=this.values[this.paren-1];t="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(t=!1,"function"===this.values[this.curly-3]){var o=this.values[this.curly-4];t=!!o&&!this.beforeFunctionExpression(o)}else if("function"===this.values[this.curly-4]){var o=this.values[this.curly-5];t=!o||!this.beforeFunctionExpression(o)}break;default:}return t},e.prototype.push=function(e){7===e.type||4===e.type?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e}(),l=function(){function e(e,t){this.errorHandler=new o.ErrorHandler,this.errorHandler.tolerant=!!t&&"boolean"==typeof t.tolerant&&t.tolerant,this.scanner=new r.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&"boolean"==typeof t.comment&&t.comment,this.trackRange=!!t&&"boolean"==typeof t.range&&t.range,this.trackLoc=!!t&&"boolean"==typeof t.loc&&t.loc,this.buffer=[],this.reader=new s}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var t=this.scanner.scanComments();if(this.scanner.trackComment)for(var n=0;n=m&&l()},200)}),t.on(i,"focus",function(){++m})}),t.defineExtension("openNotification",function(o,r){function i(){l||(l=!0,clearTimeout(c),t.rmClass(s.parentNode,"dialog-opened"),s.parentNode.removeChild(s))}n(this,i);var s=e(this,o,r&&r.bottom),l=!1,d=r&&"undefined"!=typeof r.duration?r.duration:5e3,c;return t.on(s,"click",function(n){t.e_preventDefault(n),i()}),d&&(c=setTimeout(i,d)),i})})},"58xA":function(e,t,n){"use strict";function o(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t;}for(var n in t)t.hasOwnProperty(n)&&(e[n]=o(e[n],t[n]));return e}function r(e){return JSON.parse(e)}function i(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,o=t,r;n 4. Need to update it?");}var r=e+" failed: ";return r+=o+" argument ",r}var d=String.fromCharCode;Object.defineProperty(t,"__esModule",{value:!0});var c=n("vCxL"),p={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},u=function(e,t){if(!e)throw m(t)},m=function(e){return new Error("Firebase Database ("+p.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},h=function(e){for(var t=[],n=0,o=0,r;or?t[n++]=r:2048>r?(t[n++]=192|r>>6,t[n++]=128|63&r):55296==(64512&r)&&o+1>18,t[n++]=128|63&r>>12,t[n++]=128|63&r>>6,t[n++]=128|63&r):(t[n++]=224|r>>12,t[n++]=128|63&r>>6,t[n++]=128|63&r);return t},g=function(e){for(var t=[],n=0,o=0,r;nr)t[o++]=d(r);else if(191r){var i=e[n++];t[o++]=d((31&r)<<6|63&i)}else if(239r){var i=e[n++],s=e[n++],l=e[n++],c=((7&r)<<18|(63&i)<<12|(63&s)<<6|63&l)-65536;t[o++]=d(55296+(c>>10)),t[o++]=d(56320+(1023&c))}else{var i=e[n++],s=e[n++];t[o++]=d((15&r)<<12|(63&i)<<6|63&s)}return t.join("")},f={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,o=[],r=0;r>6,u=63&c;d||(u=64,!s&&(p=64)),o.push(n[i>>2],n[(3&i)<<4|l>>4],n[p],n[u])}return o.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(h(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):g(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,o=[],r=0;r>4),64!=c){if(o.push(240&l<<4|c>>2),64!=u){o.push(192&c<<6|u)}}}return o},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},y=function(e){try{return f.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null},b=function(){function e(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})}return e.prototype.wrapCallback=function(e){var t=this;return function(n,o){n?t.reject(n):t.resolve(o),"function"==typeof e&&(t.promise.catch(function(){}),1===e.length?e(n):e(n,o))}},e}(),x=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""},v="FirebaseError",k=Error.captureStackTrace,S=function(){return function(e,t){if(this.code=e,this.message=t,k)k(this,C.prototype.create);else try{throw Error.apply(this,arguments)}catch(e){this.name=v,Object.defineProperty(this,"stack",{get:function(){return e.stack}})}}}();S.prototype=Object.create(Error.prototype),S.prototype.constructor=S,S.prototype.name=v;var C=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n,this.pattern=/\{\$([^}]+)}/g}return e.prototype.create=function(e,t){void 0===t&&(t={});var n=this.errors[e],o=this.service+"/"+e,r;r=void 0===n?"Error":n.replace(this.pattern,function(e,n){var o=t[n];return void 0===o?"<"+n+"?>":o.toString()}),r=this.serviceName+": "+r+" ("+o+").";var i=new S(o,r);for(var s in t)t.hasOwnProperty(s)&&"_"!==s.slice(-1)&&(i[s]=t[s]);return i},e}(),w=function(e){var t={},n={},o={},i="";try{var s=e.split(".");t=r(y(s[0])||""),n=r(y(s[1])||""),i=s[2],o=n.d||{},delete n.d}catch(t){}return{header:t,claims:n,data:o,signature:i}},T=function(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])},E=function(e,t){return T(t,function(t,n){e[t]=n}),e},A=function(e,t,n){for(var o in e)if(t.call(n,e[o],o,e))return o},I=function(){return function(){this.blockSize=-1}}(),N=function(e){function t(){var t=e.call(this)||this;t.chain_=[],t.buf_=[],t.W_=[],t.pad_=[],t.inbuf_=0,t.total_=0,t.blockSize=64,t.pad_[0]=128;for(var n=1;ns;s++)r[s]=n.charCodeAt(o)<<24|n.charCodeAt(o+1)<<16|n.charCodeAt(o+2)<<8|n.charCodeAt(o+3),o+=4;else for(var s=0;16>s;s++)r[s]=n[o]<<24|n[o+1]<<16|n[o+2]<<8|n[o+3],o+=4;for(var s=16,i;80>s;s++)i=r[s-3]^r[s-8]^r[s-14]^r[s-16],r[s]=4294967295&(i<<1|i>>>31);for(var t=this.chain_[0],l=this.chain_[1],p=this.chain_[2],c=this.chain_[3],d=this.chain_[4],s=0,e,u;80>s;s++){40>s?20>s?(e=c^l&(p^c),u=1518500249):(e=l^p^c,u=1859775393):60>s?(e=l&p|c&(l|p),u=2400959708):(e=l^p^c,u=3395469782);var i=4294967295&(t<<5|t>>>27)+e+d+u+r[s];d=c,c=p,p=4294967295&(l<<30|l>>>2),l=t,t=i}this.chain_[0]=4294967295&this.chain_[0]+t,this.chain_[1]=4294967295&this.chain_[1]+l,this.chain_[2]=4294967295&this.chain_[2]+p,this.chain_[3]=4294967295&this.chain_[3]+c,this.chain_[4]=4294967295&this.chain_[4]+d},t.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var o=t-this.blockSize,r=0,n=this.buf_,i=this.inbuf_;rthis.inbuf_?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var o=this.blockSize-1;56<=o;o--)this.buf_[o]=255&t,t/=256;this.compress_(this.buf_);for(var r=0,o=0;5>o;o++)for(var n=24;0<=n;n-=8)e[r]=255&this.chain_[o]>>n,++r;return e},t}(I),L=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(n)}).catch(function(t){n.error(t)})}return e.prototype.next=function(e){this.forEachObserver(function(t){t.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(t){t.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,t,n){var o=this,r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=i(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=s),void 0===r.error&&(r.error=s),void 0===r.complete&&(r.complete=s);var l=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{o.finalError?r.error(o.finalError):r.complete()}catch(t){}}),this.observers.push(r),l},e.prototype.unsubscribeOne=function(e){void 0===this.observers||void 0===this.observers[e]||(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},e.prototype.forEachObserver=function(e){if(!this.finalized)for(var t=0;t=o&&n<=r},t.clone=function(e){return E({},e)},t.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.every=function(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&!t(n,e[n]))return!1;return!0},t.extend=E,t.findKey=A,t.findValue=function(e,t,n){var o=A(e,t,n);return o&&e[o]},t.forEach=T,t.getAnyKey=function(e){for(var t in e)return t},t.getCount=function(e){var t=0;for(var n in e)t++;return t},t.getValues=function(e){var t=[],n=0;for(var o in e)t[n++]=e[o];return t},t.isEmpty=function(e){for(var t in e)return!1;return!0},t.isNonNullObject=function(e){return"object"==typeof e&&null!==e},t.map=function(e,t,n){var o={};for(var r in e)o[r]=t.call(n,e[r],r,e);return o},t.safeGet=function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]},t.querystring=function(e){var t=[];return T(e,function(e,n){Array.isArray(n)?n.forEach(function(n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}),t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){var t={},n=e.replace(/^\?/,"").split("&");return n.forEach(function(e){if(e){var n=e.split("=");t[n[0]]=n[1]}}),t},t.Sha1=N,t.async=function(e,t){return function(){for(var n=[],o=0;on&&(r=0===n?"none":"no more than "+n),r){var i=e+" failed: Was called with "+o+(1===o?" argument.":" arguments.")+" Expects "+r+".";throw new Error(i)}},t.validateCallback=function(e,t,n,o){if((!o||n)&&"function"!=typeof n)throw new Error(l(e,t,o)+"must be a valid function.")},t.validateContextObject=function(e,t,n,o){if((!o||n)&&("object"!=typeof n||null===n))throw new Error(l(e,t,o)+"must be a valid context object.")},t.validateNamespace=function(e,t,n,o){if((!o||n)&&"string"!=typeof n)throw new Error(l(e,t,o)+"must be a valid firebase namespace.")},t.stringLength=function(e){for(var t=0,n=0,o;no?t++:2048>o?t+=2:55296<=o&&56319>=o?(t+=4,n++):t+=3;return t},t.stringToByteArray=function(e){for(var t=[],n=0,o=0,r;o=r){var i=r-55296;o++,u(or?t[n++]=r:2048>r?(t[n++]=192|r>>6,t[n++]=128|63&r):65536>r?(t[n++]=224|r>>12,t[n++]=128|63&r>>6,t[n++]=128|63&r):(t[n++]=240|r>>18,t[n++]=128|63&r>>12,t[n++]=128|63&r>>6,t[n++]=128|63&r)}return t}},"5gBI":function(e,t,n){(function(e){e(n("tQq4"))})(function(e){"use strict";function t(t,n){var o=t.getLine(n),r=o.search(/\S/);return-1==r||/\bcomment\b/.test(t.getTokenTypeAt(e.Pos(n,r+1)))?-1:e.countColumn(o,null,t.getOption("tabSize"))}e.registerHelper("fold","indent",function(n,o){var r=t(n,o.line);if(!(0>r)){for(var s=null,l=o.line+1,i=n.lastLine(),d;l<=i;++l)if(d=t(n,l),-1==d);else if(d>r)s=l;else break;if(s)return{from:e.Pos(o.line,n.getLine(o.line).length),to:e.Pos(s,n.getLine(s).length)}}})})},"6r0S":function(e,t,n){(function(e){e(n("tQq4"))})(function(e){function t(t,n){for(var o=0,r=t.length;oi.ch&&(d.end=i.ch,d.string=d.string.slice(0,i.ch-d.start)):d={start:i.ch,end:i.ch,string:"",state:d.state,type:"."==d.string?"property":null};for(var p=d;"property"==p.type;){if(p=o(t,l(i.line,p.start)),"."!=p.string)return;if(p=o(t,l(i.line,p.start)),!u)var u=[];u.push(p)}return{list:s(d,u,n,r),from:l(i.line,d.start),to:l(i.line,d.end)}}}}function r(e,t){var n=e.getTokenAt(t);return t.ch==n.start+1&&"."==n.string.charAt(0)?(n.end=n.start,n.string=".",n.type="property"):/^\.[\w$_]*$/.test(n.string)&&(n.type="property",n.start++,n.string=n.string.replace(/\./,"")),n}function i(e,t){if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)for(var n in e)t(n);else for(var r=e;r;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(t)}function s(e,o,r,s){function l(e){0!=e.lastIndexOf(h,0)||n(m,e)||m.push(e)}function u(e){"string"==typeof e?t(d,l):e instanceof Array?t(c,l):e instanceof Function&&t(p,l),i(e,l)}var m=[],h=e.string,g=s&&s.globalScope||window;if(o&&o.length){var f=o.pop(),y;for(f.type&&0===f.type.indexOf("variable")?(s&&s.additionalContext&&(y=s.additionalContext[f.string]),(!s||!1!==s.useGlobalScope)&&(y=y||g[f.string])):"string"==f.type?y="":"atom"==f.type?y=1:"function"==f.type&&(null!=g.jQuery&&("$"==f.string||"jQuery"==f.string)&&"function"==typeof g.jQuery?y=g.jQuery():null!=g._&&"_"==f.string&&"function"==typeof g._&&(y=g._()));null!=y&&o.length;)y=y[o.pop().string];null!=y&&u(y)}else{for(var b=e.state.localVars;b;b=b.next)l(b.name);for(var b=e.state.globalVars;b;b=b.next)l(b.name);s&&!1===s.useGlobalScope||u(g),t(r,l)}return m}var l=e.Pos;e.registerHelper("hint","javascript",function(e,t){return o(e,u,function(t,e){return t.getTokenAt(e)},t)}),e.registerHelper("hint","coffeescript",function(e,t){return o(e,m,r,t)});var d=["charAt","charCodeAt","indexOf","lastIndexOf","substring","substr","slice","trim","trimLeft","trimRight","toUpperCase","toLowerCase","split","concat","match","replace","search"],c=["length","concat","join","splice","push","pop","shift","unshift","slice","reverse","sort","indexOf","lastIndexOf","every","some","filter","forEach","map","reduce","reduceRight",""],p=["prototype","apply","call","bind"],u=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","in","import","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield"],m=["and","break","catch","class","continue","delete","do","else","extends","false","finally","for","if","in","instanceof","isnt","new","no","not","null","of","off","on","or","return","switch","then","throw","true","try","typeof","until","void","while","with","yes"]})},"7vHL":function(e,t,n){"use strict";var o=n("eA7g"),r=n.n(o)},AIXc:function(e,t,n){(function(e){e(n("tQq4"),n("HeB0"),n("qqFR"),n("ggoL"))})(function(e){"use strict";function t(e,t,n){var o=e.current(),r=o.search(t);return-1","i")}function s(e,t){for(var n in e)for(var o=t[n]||(t[n]=[]),r=e[n],s=r.length-1;0<=s;s--)o.unshift(r[s])}function i(e,t){for(var n=0,r;n\s\/]/.test(o.current())&&(m=s.htmlState.tagName&&s.htmlState.tagName.toLowerCase())&&p.hasOwnProperty(m))s.inTag=m+" ";else if(s.inTag&&u&&/>$/.test(o.current())){var h=/^([\S]+) (.*)/.exec(s.inTag);s.inTag=null;var g=">"==o.current()&&i(p[h[1]],h[2]),f=e.getMode(n,g),y=r(h[1],!0),b=r(h[1],!1);s.token=function(e,n){return e.match(y,!1)?(n.token=d,n.localState=n.localMode=null,null):t(e,b,n.localMode.token(e,n.localState))},s.localMode=f,s.localState=e.startState(f,c.indent(s.htmlState,""))}else s.inTag&&(s.inTag+=o.current(),o.eol()&&(s.inTag+=" "));return l}var c=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:o.multilineTagIndentFactor,multilineTagIndentPastTag:o.multilineTagIndentPastTag}),p={},u=o&&o.tags,m=o&&o.scriptTypes;if(s(l,p),u&&s(u,p),m)for(var h=m.length-1;0<=h;h--)p.script.unshift(["type",m[h].matches,m[h].mode]);return{startState:function(){var t=e.startState(c);return{token:d,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,o){return!t.localMode||/^\s*<\//.test(n)?c.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n,o):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})},AhD2:function(){var e=Math.round;(function(){function t(e){var t=getComputedStyle(e).color;if(t)try{return t.match(/(\d+), (\d+), (\d+)/).slice(1)}catch(t){return[255,255,255]}else return[255,255,255]}function n(e,t,n){var o={x:e,y:t+10,alpha:1,color:n};return 1===L?(o.size=s(2,4),o.vx=T.x[0]+Math.random()*(T.x[1]-T.x[0]),o.vy=T.y[0]+Math.random()*(T.y[1]-T.y[0])):2===L&&(o.size=s(2,8),o.drag=0.92,o.vx=s(-3,3),o.vy=s(-3,3),o.wander=0.15,o.theta=s(0,360)*m/180),o}function o(t){t.vy+=S,t.x+=t.vx,t.y+=t.vy,t.alpha*=C,M.fillStyle="rgba("+t.color[0]+","+t.color[1]+","+t.color[2]+","+t.alpha+")",M.fillRect(e(t.x-1),e(t.y-1),t.size,t.size)}function r(t){t.x+=t.vx,t.y+=t.vy,t.vx*=t.drag,t.vy*=t.drag,t.theta+=s(-0.5,0.5),t.vx+=0.1*Math.sin(t.theta),t.vy+=0.1*Math.cos(t.theta),t.size*=0.96,M.fillStyle="rgba("+t.color[0]+","+t.color[1]+","+t.color[2]+","+t.alpha+")",M.beginPath(),M.arc(e(t.x-1),e(t.y-1),t.size,0,2*m),M.fill()}function i(){for(var e=x.length,t;e--;)(t=x[e],!(!t||0.01>t.alpha||0.5>=t.size))&&(1===L?o(t):2===L&&r(t))}function s(e,t){return t||(t=e,e=0),e+~~(Math.random()*(t-e+1))}function l(e,t){var n=!1;return function(){n||(e.apply(this,arguments),n=!0,setTimeout(function(){n=!1},t))}}function d(){h&&(M.clearRect(0,0,E,w),D=new Date().getTime(),!b&&(b=D),R=(D-b)/1e3,b=D,0i.ch&&(b=b.slice(0,b.length-u.end+i.ch));var x=b.toLowerCase();if(!b||"string"==u.type&&(u.end!=i.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==h.type||u.string.indexOf("/")==u.string.length-1||f&&-1"+(v?"\n\n":"")+"",newPos:v?e.Pos(i.line+1,0):e.Pos(i.line,i.ch+1)}}for(var k="object"==typeof c&&c.dontIndentOnAutoClose,p=n.length-1,S;0<=p;p--){S=o[p],t.replaceRange(S.text,n[p].head,n[p].anchor,"+insert");var C=t.listSelections().slice(0);C[p]={head:S.newPos,anchor:S.newPos},t.setSelections(C),!k&&S.indent&&(t.indentLine(S.newPos.line,null,!0),t.indentLine(S.newPos.line+1,null,!0))}}function n(t,n){for(var o=t.listSelections(),r=[],l=n?"/":""!=t.getLine(i.line).charAt(u.end)&&(g+=">"),r[p]=g}if(t.replaceSelections(r),o=t.listSelections(),!c)for(var p=0;p'"]=function(e){return t(e)}),n.addKeyMap(s)}});var l=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],d=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return n(e)}})},BtxX:function(e){(function(t){function n(){}function o(e,t){return function(){e.apply(t,arguments)}}function r(e){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(e,this)}function s(e,t){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(t):void(e._handled=!0,r._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null===n)return void(1===e._state?i:l)(t.promise,e._value);var o;try{o=n(e._value)}catch(n){return void l(t.promise,n)}i(t.promise,o)}))}function i(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof r)return t._state=3,t._value=e,void d(t);if("function"==typeof n)return void p(o(n,e),t)}t._state=1,t._value=e,d(t)}catch(n){l(t,n)}}function l(e,t){e._state=2,e._value=t,d(e)}function d(e){2===e._state&&0===e._deferreds.length&&r._immediateFn(function(){e._handled||r._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;te.firstLine();)r=t.Pos(r.line-1,0),p=l(!1);if(p&&!p.cleared&&"unfold"!==s){var u=n(e,i);t.on(u,"mousedown",function(n){m.clear(),t.e_preventDefault(n)});var m=e.markText(p.from,p.to,{replacedWith:u,clearOnEnter:o(e,i,"clearOnEnter"),__isFold:!0});m.on("clear",function(n,o){t.signal(e,"unfold",e,n,o)}),t.signal(e,"fold",e,p.from,p.to)}}function n(e,t){var n=o(e,t,"widget");if("string"==typeof n){var r=document.createTextNode(n);n=document.createElement("span"),n.appendChild(r),n.className="CodeMirror-foldmarker"}else n&&(n=n.cloneNode(!0));return n}function o(e,t,n){if(t&&void 0!==t[n])return t[n];var o=e.options.foldOptions;return o&&void 0!==o[n]?o[n]:r[n]}t.newFoldFunction=function(t,n){return function(o,r){e(o,r,{rangeFinder:t,widget:n})}},t.defineExtension("foldCode",function(t,n,o){e(this,t,n,o)}),t.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n")):null:e.match("--")?n(d("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=d("meta","?>"),"meta"):(A=e.eat("/")?"closeTag":"openTag",t.tokenize=s,"tag bracket");if("&"==o){var r;return r=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),r?"atom":"error"}return e.eatWhile(/[^&<]/),null}function s(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=i,A=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return A="equals",null;if("<"==n){t.tokenize=i,t.state=h,t.tagName=t.tagStart=null;var o=t.tokenize(e,t);return o?o+" tag error":"tag error"}return /[\'\"]/.test(n)?(t.tokenize=l(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=s;break}return"string"};return t.isInAttribute=!0,t}function d(e,t){return function(n,o){for(;!n.eol();){if(n.match(t)){o.tokenize=i;break}n.next()}return e}}function c(e){return function(t,n){for(var o;null!=(o=t.next());){if("<"==o)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==o)if(1==e){n.tokenize=i;break}else return n.tokenize=c(e-1),n.tokenize(t,n)}return"meta"}}function p(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(w.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function u(e){e.context&&(e.context=e.context.prev)}function m(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!w.contextGrabbers.hasOwnProperty(n)||!w.contextGrabbers[n].hasOwnProperty(t))return;u(e)}}function h(e,t,n){return"openTag"==e?(n.tagStart=t.column(),g):"closeTag"==e?f:h}function g(e,t,n){return"word"==e?(n.tagName=t.current(),I="tag",x):w.allowMissingTagName&&"endTag"==e?(I="tag bracket",x(e,t,n)):(I="error",g)}function f(e,t,n){if("word"==e){var o=t.current();return n.context&&n.context.tagName!=o&&w.implicitlyClosed.hasOwnProperty(n.context.tagName)&&u(n),n.context&&n.context.tagName==o||!1===w.matchClosing?(I="tag",y):(I="tag error",b)}return w.allowMissingTagName&&"endTag"==e?(I="tag bracket",y(e,t,n)):(I="error",b)}function y(e,t,n){return"endTag"==e?(u(n),h):(I="error",y)}function b(e,t,n){return I="error",y(e,t,n)}function x(e,t,n){if("word"==e)return I="attribute",v;if("endTag"==e||"selfcloseTag"==e){var o=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||w.autoSelfClosers.hasOwnProperty(o)?m(n,o):(m(n,o),n.context=new p(n,o,r==n.indented)),h}return I="error",x}function v(e,t,n){return"equals"==e?k:(w.allowMissing||(I="error"),x(e,t,n))}function k(e,t,n){return"string"==e?S:"word"==e&&w.allowUnquoted?(I="string",x):(I="error",x(e,t,n))}function S(e,t,n){return"string"==e?S:x(e,t,n)}var C=o.indentUnit,w={},T=r.htmlMode?t:n;for(var E in T)w[E]=T[E];for(var E in r)w[E]=r[E];var A,I;return i.isInText=!0,{startState:function(e){var t={tokenize:i,state:h,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;A=null;var n=t.tokenize(e,t);return(n||A)&&"comment"!=n&&(I=null,t.state=t.state(A||n,e,t),I&&(n="error"==I?n+" error":I)),n},indent:function(t,n,o){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+C;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=s&&t.tokenize!=i)return o?o.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1===w.multilineTagIndentPastTag?t.tagStart+C*(w.multilineTagIndentFactor||1):t.tagStart+t.tagName.length+2;if(w.alignCDATA&&/$/,blockCommentStart:"",configuration:w.htmlMode?"html":"xml",helperType:w.htmlMode?"html":"xml",skipAttribute:function(e){e.state==k&&(e.state=x)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},IIoC:function(e,t,n){var o=Math.round,r=Math.floor,i=Math.max;(function(t){(function(){function s(e){return"string"==typeof e}function l(e,t){e=e.split("."),t=t||Do;for(var n=0;nn?null:s(t)?t.charAt(n):t[n]}function _e(e){if(!v(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0}function et(){return Array.prototype.concat.apply([],arguments)}function tt(e){var t=e.length;if(0t?1:0}function rt(e){return-1!=Vo.indexOf(e)}function y(e,t,n){for(var o in e)t.call(n,e[o],o,e)}function at(e){var t=[],n=0,o;for(o in e)t[n++]=e[o];return t}function it(e){var t=[],n=0,o;for(o in e)t[n++]=o;return t}function st(e){var t={},n;for(n in e)t[n]=e[n];return t}function lt(t){for(var n=1,e,o;no.keyCode||void 0!=o.returnValue)){a:{var i=!1;if(0==o.keyCode)try{o.keyCode=-1;break a}catch(e){i=!0}(i||void 0==o.returnValue)&&(o.returnValue=!0)}for(o=[],i=n.a;i;i=i.parentNode)o.push(i);for(t=t.type,i=o.length-1;0<=i;i--){n.a=o[i];var e=Et(o[i],t,!0,n);r=r&&e}for(i=0;it.b&&(t.b++,e.next=t.a,t.a=e)}fr=!1}function Kt(e,t){_t.call(this),this.b=e||1,this.a=t||Do,this.c=_(this.qb,this),this.g=Ro()}function Gt(e){e.ea=!1,e.O&&(e.a.clearTimeout(e.O),e.O=null)}function Xt(e,t,n){if(m(e))n&&(e=_(e,n));else if(e&&"function"==typeof e.handleEvent)e=_(e.handleEvent,e);else throw Error("Invalid listener argument");return 2147483647<+t?-1:Do.setTimeout(e,t||0)}function Qt(e,t,n){$.call(this),this.f=null==n?e:_(e,n),this.c=t,this.b=_(this.kb,this),this.a=[]}function Jt(e){e.Y=Xt(e.b,e.c),e.f.apply(null,e.a)}function $t(e){$.call(this),this.b=e,this.a={}}function Yt(t,n,o,r){v(o)||(o&&(vr[0]=o.toString()),o=vr);for(var i=0,e;ii.length)){var e=i[1];if(v(e)&&!(1>e.length)){var s=e[0];if("noop"!=s&&"stop"!=s&&"close"!=s)for(var l=1;ln)&&(3!=n||Ko||t.a.V())){t.B||4!=n||7==o||(8==o||0>=r?mn(3):mn(2)),Fn(t);var i=t.a.W();t.C=i,(o=t.a.V())||cn(t.b,function(){return"No response text for uri "+t.g+" status "+i}),t.f=200==i,ln(t.b,t.o,t.g,t.c,t.T,n,i),t.f?((r=_n(t))&&(dn(t.b,t.c,r,"Initial handshake response via X-HTTP-Initial-Response"),t.v=!0,Vn(t,r)),t.K?(On(t,n,o),Ko&&t.f&&3==n&&Mn(t)):(dn(t.b,t.c,o,null),Vn(t,o)),4==n&&Un(t),t.f&&!t.B&&(4==n?t.i.ta(t):(t.f=!1,Rn(t)))):(400==i&&0t.length)?Pr:(t=t.substr(o,n),e.G=o+n,t)}function Rn(e){e.U=Ro()+e.R,Pn(e,e.R)}function Pn(e,t){if(null!=e.s)throw Error("WatchDog timer not null");e.s=yn(_(e.lb,e),t)}function Fn(e){e.s&&(Do.clearTimeout(e.s),e.s=null)}function Bn(e){e.i.La()||e.B||e.i.ta(e)}function Un(e){Fn(e);var t=e.I;t&&"function"==typeof t.$&&t.$(),e.I=null,Gt(e.S),Zt(e.L),e.a&&(t=e.a,e.a=null,t.abort(),t.$())}function Vn(e,t){try{e.i.Oa(e,t),mn(4)}catch(t){H(e.b,t,"Error in httprequest callback")}}function qn(e){if(e.A&&"function"==typeof e.A)return e.A();if(s(e))return e.split("");if(p(e)){for(var t=[],n=e.length,o=0;o2*e.c&&Hn(e),!0)}function Hn(t){if(t.c!=t.a.length){for(var n=0,o=0,r;nt)throw Error("Bad port number "+t);e.i=t}else e.i=null}function Jn(e,t,n){t instanceof ro?(e.c=t,po(e.c,e.h)):(n||(t=no(t,qr)),e.c=new ro(t,e.h))}function $n(e,t,n){e.c.set(t,n)}function R(e,t,n){v(n)||(n=[n+""]),so(e.c,t,n)}function Yn(e){return $n(e,"zx",r(2147483648*Math.random()).toString(36)+Math.abs(r(2147483648*Math.random())^Ro()).toString(36)),e}function Zn(e){return e instanceof Gn?Q(e):new Gn(e,void 0)}function eo(t,n,o,r){var i=new Gn(null,void 0);return t&&M(i,t),n&&Xn(i,n),o&&Qn(i,o),r&&(i.a=r),i}function to(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function no(e,t,n){return s(e)?(e=encodeURI(e).replace(t,oo),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function oo(e){return e=e.charCodeAt(0),"%"+(15&e>>4).toString(16)+(15&e).toString(16)}function ro(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function ao(e){e.a||(e.a=new Wn,e.b=0,e.c&&P(e.c,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function S(e,t){ao(e),t=co(e,t),Kn(e.a.b,t)&&(e.c=null,e.b-=e.a.get(t).length,zn(e.a,t))}function io(e,t){return ao(e),t=co(e,t),Kn(e.a.b,t)}function so(e,t,n){S(e,t),0=e.f}function de(e,t){return e.b?e=e.b==t:e.a?(t=xo(t),e=Kn(e.a.a.b,t)):e=!1,e}function ee(e,t){e.a?e.a.add(t):e.b=t}function ce(e,t){if(e.b&&e.b==t)e.b=null;else{var n;(n=e.a)&&(n=xo(t),n=Kn(e.a.a.b,n)),n&&zn(e.a.a,xo(t))}}function fe(e){if(null!=e.b)return e.c.concat(e.b.u);if(null!=e.a&&0!=e.a.a.c){var t=e.c;return Bo(e.a.A(),function(e){t=t.concat(e.u)}),t}return tt(e.c)}function ge(e,t){e.c=e.c.concat(t)}function he(){}function ie(){this.a=new he}function je(e,t,n){var o=n||"";try{jn(e,function(n,r){var i=n;I(n)&&(i=Dt(n)),t.push(o+r+"="+encodeURIComponent(i))})}catch(n){throw t.push(o+"type="+encodeURIComponent("_badmap")),n}}function ke(e,t){var n=new E;cn(n,"TestLoadImage: loading "+e);var o=new Image;o.onload=f(le,n,o,"TestLoadImage: loaded",!0,t),o.onerror=f(le,n,o,"TestLoadImage: error",!1,t),o.onabort=f(le,n,o,"TestLoadImage: abort",!1,t),o.ontimeout=f(le,n,o,"TestLoadImage: timeout",!1,t),Do.setTimeout(function(){o.ontimeout&&o.ontimeout()},1E4),o.src=e}function le(t,n,o,r,i){try{cn(t,o),n.onload=null,n.onerror=null,n.onabort=null,n.ontimeout=null,i(r)}catch(e){H(t,e)}}function me(e){_t.call(this),this.headers=new Wn,this.s=e||null,this.c=!1,this.D=this.a=null,this.K=this.B="",this.j=0,this.g="",this.h=this.I=this.u=this.G=!1,this.l=0,this.C=null,this.L=ae,this.v=this.o=!1}function T(e){return zo&&ut(9)&&"number"==typeof e.timeout&&void 0!==e.ontimeout}function se(e){return"content-type"==e.toLowerCase()}function Co(e,t){e.c=!1,e.a&&(e.h=!0,e.a.abort(),e.h=!1),e.g=t,e.j=5,qe(e),ve(e)}function qe(e){e.G||(e.G=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function te(t){if(t.c&&"undefined"!=typeof Mo)if(t.D[1]&&4==re(t)&&2==t.W())an(t.b,wo(t,"Local request error detected and ignored"));else if(t.u&&4==re(t))Xt(t.Na,0,t);else if(t.dispatchEvent("readystatechange"),4==re(t)){an(t.b,wo(t,"Request complete")),t.c=!1;try{var n=t.W();a:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var o=!0;break a;default:o=!1;}var r;if(!(r=o)){var i;if(i=0===n){var e=(t.B+"").match(Fr)[1]||null;if(!e&&Do.self&&Do.self.location){var s=Do.self.location.protocol;e=s.substr(0,s.length-1)}i=!ne.test(e?e.toLowerCase():"")}r=i}r?(t.dispatchEvent("complete"),t.dispatchEvent("success")):(t.j=6,t.g=t.Ha()+" ["+t.W()+"]",qe(t))}finally{ve(t)}}}function ve(t,e){if(t.a){ue(t);var o=t.a,r=t.D[0]?n:null;t.a=null,t.D=null,e||t.dispatchEvent("ready");try{o.onreadystatechange=r}catch(n){(t=t.b)&&t.log(Sr,"Problem encountered resetting onreadystatechange: "+n.message,void 0)}}}function ue(e){e.a&&e.v&&(e.a.ontimeout=null),e.C&&(Do.clearTimeout(e.C),e.C=null)}function re(e){return e.a?e.a.readyState:0}function N(e,t){return e.a?e.a.getResponseHeader(t):null}function wo(e,t){return t+" ["+e.K+" "+e.B+" "+e.W()+"]"}function U(e){var t="";return y(e,function(e,n){t+=n,t+=":",t+=e,t+="\r\n"}),t}function we(t,n,o){a:{for(r in o){var r=!1;break a}r=!0}if(r)return t;if(o=U(o),s(t)){if(n=encodeURIComponent(n+""),o=null==o?"":"="+encodeURIComponent(o+""),n+=o){if(o=t.indexOf("#"),0>o&&(o=t.length),r=t.indexOf("?"),0>r||r>o){r=o;var i=""}else i=t.substring(r+1,o);t=[t.substr(0,r),i,t.substr(o)],o=t[1],t[1]=n?o?o+"&"+n:n:o,t=t[0]+(t[1]?"?"+t[1]:"")+t[2]}return t}return $n(t,n,o),t}function xe(e){this.ya=0,this.g=[],this.a=new E,this.I=new yo,this.X=this.ua=this.D=this.ja=this.b=this.K=this.j=this.U=this.h=this.L=this.i=null,this.Za=this.R=0,this.Xa=!!l("internalChannelParams.failFast",e),this.ka=this.C=this.s=this.l=this.m=this.f=null,this.u=this.xa=this.N=-1,this.T=this.B=this.v=0,this.Wa=l("internalChannelParams.baseRetryDelayMs",e)||5E3,this.$a=l("internalChannelParams.retryDelaySeedMs",e)||1E4,this.Ya=l("internalChannelParams.forwardChannelMaxRetries",e)||2,this.wa=l("internalChannelParams.forwardChannelRequestTimeoutMs",e)||2E4,this.Ta=e&&e.Kb||void 0,this.G=void 0,this.S=e&&e.supportsCrossDomainXhr||!1,this.J="",this.c=new ko(e&&e.concurrentRequestLimit),this.la=new ie,this.o=e&&void 0!==e.backgroundChannelTest?e.backgroundChannelTest:!0,(this.va=e&&e.fastHandshake||!1)&&!this.o&&(rn(this.a.a,"Force backgroundChannelTest when fastHandshake is enabled."),this.o=!0),e&&e.Fa&&this.a.Fa()}function ye(e){if(cn(e.a,"disconnect()"),ze(e),3==e.F){var t=e.R++,n=Q(e.D);$n(n,"SID",e.J),$n(n,"RID",t),$n(n,"TYPE","terminate"),Je(e,n),t=new En(e,e.a,t,void 0),t.J=2,t.h=Yn(Q(n)),n=!1,Do.navigator&&Do.navigator.sendBeacon&&(n=Do.navigator.sendBeacon(t.h.toString(),"")),!n&&Do.Image&&(new Image().src=t.h,n=!0),n||(t.a=t.i.ca(null),t.a.fa(t.h)),t.D=Ro(),Rn(t)}V(e)}function ze(e){e.C&&(e.C.abort(),e.C=null),e.b&&(e.b.cancel(),e.b=null),e.l&&(Do.clearTimeout(e.l),e.l=null),Eo(e),e.c.cancel(),e.m&&(Do.clearTimeout(e.m),e.m=null)}function Ae(e,t){1E3==e.g.length&&F(e.a,function(){return"Already have 1000 queued maps upon queueing "+Dt(t)}),e.g.push(new vo(e.Za++,t)),3==e.F&&Ee(e)}function Ee(e){be(e.c)||e.m||(e.m=yn(_(e.Qa,e),0),e.v=0)}function Fe(e,t){var n=e.c;return(n.b?1:n.a?n.a.a.c:0)>=e.c.f-(e.m?1:0)?(F(e.a,"Unexpected retry request is scheduled."),!1):e.m?(cn(e.a,"Use the retry request that is already scheduled."),e.g=t.u.concat(e.g),!0):1==e.F||2==e.F||e.v>=(e.Xa?0:e.Ya)?!1:(cn(e.a,"Going to retry POST"),e.m=yn(_(e.Qa,e,t),De(e,e.v)),e.v++,!0)}function Ge(e,t){var n=t?t.c:e.R++;var r=Q(e.D);$n(r,"SID",e.J),$n(r,"RID",n),$n(r,"AID",e.N),Je(e,r),e.h&&e.i&&we(r,e.h,e.i),n=new En(e,e.a,n,e.v+1),null===e.h&&(n.j=e.i),t&&(e.g=t.u.concat(e.g)),t=Be(e,n),n.setTimeout(o(.5*e.wa)+o(.5*e.wa*Math.random())),ee(e.c,n),An(n,r,t)}function Je(e,t){e.f&&jn({},function(e,n){$n(t,n,e)})}function Be(t,n){var o=Math.min(t.g.length,1E3),r=t.f?_(t.f.ab,t.f,t):null;a:for(var s=t.g,e=-1,l;;){l=["count="+o],-1==e?0p)e=i(0,s[c].a-100),d=!1;else try{je(u,l,"req"+p+"_")}catch(e){r&&r(u)}}if(d){r=l.join("&");break a}}return t=t.g.splice(0,o),n.u=t,r}function Ie(e){if(!e.b&&!e.l){e.T=1;var t=e.Pa;xr||zt(),fr||(xr(),fr=!0),yr.add(t,e),e.B=0}}function Ke(e){return e.b||e.l?(F(e.a,"Request already in progress"),!1):!(3<=e.B)&&(cn(e.a,"Going to retry GET"),e.T++,e.l=yn(_(e.Pa,e),De(e,e.B)),e.B++,!0)}function Le(e,t,n){cn(e.a,"Test Connection Finished");var o=t.l;o&&So(e.c,o),e.ka=n,e.u=t.f,cn(e.a,"connectChannel_()"),e.D=Ce(e,e.ja),Ee(e)}function To(e,t){cn(e.a,"Test Connection Failed"),e.u=t.f,He(e,2)}function Eo(e){null!=e.s&&(Do.clearTimeout(e.s),e.s=null)}function De(e,t){var n=e.Wa+r(Math.random()*e.$a);return e.qa()||(cn(e.a,"Inactive channel"),n*=2),n*t}function He(e,t){if(pn(e.a,"Error code "+t),2==t){var n=null;e.f&&(n=null);var o=_(e.pb,e);n||(n=new Gn("//www.google.com/images/cleardot.gif"),Do.location&&"http"==Do.location.protocol||M(n,"https"),Yn(n)),ke(n.toString(),o)}else gn(2);cn(e.a,"HttpChannel: error - "+t),e.F=0,e.f&&e.f.Ba(t),V(e),ze(e)}function V(e){if(e.F=0,e.u=-1,e.f){var t=fe(e.c);(0!=t.length||0!=e.g.length)&&(cn(e.a,function(){return"Number of undelivered maps, pending: "+t.length+", outgoing: "+e.g.length}),e.c.c.length=0,tt(e.g),e.g.length=0),e.f.Aa()}}function Ce(e,t){return t=Ao(e,null,t),cn(e.a,"GetForwardChannelUri: "+t),t}function Me(e,t,n){return t=Ao(e,e.ia()?t:null,n),cn(e.a,"GetBackChannelUri: "+t),t}function Ao(t,n,o){var r=Zn(o);if(""!=r.b)n&&Xn(r,n+"."+r.b),Qn(r,r.i);else{var i=Do.location,e;e=n?n+"."+i.hostname:i.hostname,r=eo(i.protocol,e,i.port,o)}return t.U&&y(t.U,function(e,t){$n(r,t,e)}),n=t.j,o=t.K,n&&o&&$n(r,n,o),$n(r,"VER",t.na),Je(t,r),r}function Ne(){}function Oe(){for(var t=arguments[0],n=1,o;nthis.c)throw Error(Hr);this.a=new Re,this.b=new bo,this.g=null,this.aa()}function Ye(e){if("function"==typeof e.$)e.$();else for(var t in e)e[t]=null}function Io(e){return We(e.a)+e.b.a.c}function $e(e,t){this.a=e,this.b=t}function No(e){if(this.a=[],e)a:{if(e instanceof No){var t=e.M();if(e=e.A(),0>=this.a.length){for(var n=this.a,o=0;o>1,e[o].a>n.a);)e[t]=e[o],t=o;e[t]=n}function _o(){No.call(this)}function Oo(e,t){this.f=new _o,Xe.call(this,e,t)}function Y(e,t,n,o){this.l=e,this.j=!!o,Oo.call(this,t,n)}var Mo=Mo||{},Do=this,k="closure_uid_"+(1E9*Math.random()>>>0),q=0,Ro=Date.now||function(){return+new Date},t;b(u,Error),u.prototype.name="CustomError",b(j,u),j.prototype.name="AssertionError";var g=0,Po={};$.prototype.i=!1,$.prototype.$=function(){},$.prototype.w=function(){if(this.m)for(;this.m.length;)this.m.shift()()};var Fo=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if(s(e))return s(t)&&1==t.length?e.indexOf(t,0):-1;for(var n=0;nparseFloat(Jo)){Qo=Yo+"";break a}}Qo=Jo}var Zo={},er=Do.document,tr;tr=er&&zo?pt()||("CSS1Compat"==er.compatMode?parseInt(Qo,10):5):void 0;var nr=Object.freeze||function(e){return e},or=!zo||9<=+tr,rr=zo&&!ut("9"),ar=function(){if(!Do.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return Do.addEventListener("test",n,t),Do.removeEventListener("test",n,t),e}();mt.prototype.b=function(){this.Ra=!1},b(A,mt);var ir=nr({2:"touch",3:"pen",4:"mouse"});A.prototype.b=function(){A.H.b.call(this);var e=this.c;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,rr)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}};var sr="closure_listenable_"+(0|1E6*Math.random()),lr=0;ft.prototype.add=function(t,n,o,r,i){var e=t.toString();t=this.a[e],t||(t=this.a[e]=[],this.b++);var s=bt(t,n,r,i);return-1>>0);b(_t,$),_t.prototype[sr]=!0,t=_t.prototype,t.addEventListener=function(e,t,n,o){xt(this,e,t,n,o)},t.removeEventListener=function(e,t,n,o){Ct(this,e,t,n,o)},t.dispatchEvent=function(t){var n=this.J,o;if(n)for(o=[];n;n=n.J)o.push(n);n=this.N;var r=t.type||t;if(s(t))t=new mt(t,n);else if(t instanceof mt)t.target=t.target||n;else{var i=t;t=new mt(r,n),lt(t,i)}if(i=!0,o)for(var e=o.length-1,l;0<=e;e--)l=t.a=o[e],i=B(l,r,!0,t)&&i;if(l=t.a=n,i=B(l,r,!0,t)&&i,i=B(l,r,!1,t)&&i,o)for(e=0;e=C(this).value)for(m(t)&&(t=t()),e=new en(e,t+"",this.f),n&&(e.a=n),n=this;n;)n=n.a};var Ar={},Ir=null;E.prototype.Fa=function(){this.b=!1};var Nr=new _t;b(un,mt),b(hn,mt),b(K,mt);var Lr={NO_ERROR:0,rb:1,yb:2,xb:3,ub:4,wb:5,zb:6,Ua:7,TIMEOUT:8,Cb:9},_r={tb:"complete",Gb:"success",Va:"error",Ua:"abort",Eb:"ready",Fb:"readystatechange",TIMEOUT:"timeout",Ab:"incrementaldata",Db:"progress",vb:"downloadprogress",Hb:"uploadprogress"};bn.prototype.a=null;var Or={OPEN:"a",sb:"b",Va:"c",Bb:"d"};b(kn,mt),b(Sn,mt);var Mr;b(Cn,bn),Mr=new Cn;var Dr=45E3,Rr={},Pr={};t=En.prototype,t.setTimeout=function(e){this.R=e},t.nb=function(e){e=e.target;var t=this.I;t&&3==re(e)?(cn(this.b,"Throttling readystatechange."),t.cb()):this.Sa(e)},t.Sa=function(e){try{e==this.a?Ln(this):rn(this.b.a,"Called back with an unexpected xmlhttp")}catch(e){if(cn(this.b,"Failed call to OnXmlHttpReadyStateChanged_"),this.a&&this.a.V()){var t=this;H(this.b,e,function(){return"ResponseText: "+t.a.V()})}else H(this.b,e,"No response text")}finally{}},t.mb=function(){if(this.a){var e=re(this.a),t=this.a.V();this.Gn&&this.ka&&0==this.B&&!this.s&&(this.s=yn(_(this.ib,this),6E3)))}else if((t.v||this.b==t)&&Eo(this),!nt(n))for(n=o=this.la.a.parse(n),o=0;oe-this.g)){for(var t;0this.c&&0=i)e=void 0;else{if(1==i)_e(r);else{r[0]=r.pop(),r=0,o=o.a,i=o.length;for(var s=o[r];r>1;){var l=2*r+1,d=2*r+2;if(l=ds.a)break;o[r]=o[l],r=l}o[r]=s}e=e.b}e.apply(this,[n])}},t.ma=function(e){Oo.H.ma.call(this,e),this.ra()},t.aa=function(){Oo.H.aa.call(this),this.ra()},t.w=function(){Oo.H.w.call(this),Do.clearTimeout(void 0),_e(this.f.a),this.f=null},b(Y,Oo),Y.prototype.pa=function(){var e=new me,t=this.l;return t&&t.forEach(function(t,n){e.headers.set(n,t)}),this.j&&(e.o=!0),e},Y.prototype.sa=function(e){return!e.i&&!e.a},Pe.prototype.createWebChannel=Pe.prototype.a,Qe.prototype.send=Qe.prototype.gb,Qe.prototype.open=Qe.prototype.fb,Qe.prototype.close=Qe.prototype.close,Lr.NO_ERROR=0,Lr.TIMEOUT=8,Lr.HTTP_ERROR=6,_r.COMPLETE="complete",vn.EventType=Or,Or.OPEN="a",Or.CLOSE="b",Or.ERROR="c",Or.MESSAGE="d",_t.prototype.listen=_t.prototype.Ia,Y.prototype.getObject=Y.prototype.da,Y.prototype.releaseObject=Y.prototype.ob,me.prototype.listenOnce=me.prototype.Ja,me.prototype.getLastError=me.prototype.hb,me.prototype.getLastErrorCode=me.prototype.Ga,me.prototype.getStatus=me.prototype.W,me.prototype.getStatusText=me.prototype.Ha,me.prototype.getResponseJson=me.prototype.eb,me.prototype.getResponseText=me.prototype.V,me.prototype.getResponseText=me.prototype.V,me.prototype.send=me.prototype.fa,e.exports={createWebChannelTransport:pe,ErrorCode:Lr,EventType:_r,WebChannel:vn,XhrIoPool:Y}}).call("undefined"==typeof t?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:t)}).call(t,n("h6ac"))},IYZm:function(e,t,n){(function(e){e(n("tQq4"),n("LiPu"))})(function(e){"use strict";function t(e){for(var t in u)u.hasOwnProperty(t)&&(e.attrs[t]=u[t])}var n=["ab","aa","af","ak","sq","am","ar","an","hy","as","av","ae","ay","az","bm","ba","eu","be","bn","bh","bi","bs","br","bg","my","ca","ch","ce","ny","zh","cv","kw","co","cr","hr","cs","da","dv","nl","dz","en","eo","et","ee","fo","fj","fi","fr","ff","gl","ka","de","el","gn","gu","ht","ha","he","hz","hi","ho","hu","ia","id","ie","ga","ig","ik","io","is","it","iu","ja","jv","kl","kn","kr","ks","kk","km","ki","rw","ky","kv","kg","ko","ku","kj","la","lb","lg","li","ln","lo","lt","lu","lv","gv","mk","mg","ms","ml","mt","mi","mr","mh","mn","na","nv","nb","nd","ne","ng","nn","no","ii","nr","oc","oj","cu","om","or","os","pa","pi","fa","pl","ps","pt","qu","rm","rn","ro","ru","sa","sc","sd","se","sm","sg","sr","gd","sn","si","sk","sl","so","st","es","su","sw","ss","sv","ta","te","tg","th","ti","bo","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","cy","wo","fy","xh","yi","yo","za","zu"],o=["_blank","_self","_top","_parent"],r=["ascii","utf-8","utf-16","latin1","latin1"],i=["get","post","put","delete"],l=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],d=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],c={attrs:{}},p={a:{attrs:{href:null,ping:null,type:null,media:d,target:o,hreflang:n}},abbr:c,acronym:c,address:c,applet:c,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:d,hreflang:n,type:null,shape:["default","rect","circle","poly"]}},article:c,aside:c,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:c,base:{attrs:{href:null,target:o}},basefont:c,bdi:c,bdo:c,big:c,blockquote:{attrs:{cite:null}},body:c,br:c,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:l,formmethod:i,formnovalidate:["","novalidate"],formtarget:o,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:c,center:c,cite:c,code:c,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:c,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:c,dir:c,div:c,dl:c,dt:c,em:c,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:c,figure:c,font:c,footer:c,form:{attrs:{action:null,name:null,"accept-charset":r,autocomplete:["on","off"],enctype:l,method:i,novalidate:["","novalidate"],target:o}},frame:c,frameset:c,h1:c,h2:c,h3:c,h4:c,h5:c,h6:c,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:c,hgroup:c,hr:c,html:{attrs:{manifest:null},children:["head","body"]},i:c,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:l,formmethod:i,formnovalidate:["","novalidate"],formtarget:o,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:c,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:c,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:n,media:d,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:c,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:r,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:c,noframes:c,noscript:c,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:c,param:{attrs:{name:null,value:null}},pre:c,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:c,rt:c,ruby:c,s:c,samp:c,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:r}},section:c,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:c,source:{attrs:{src:null,type:null,media:null}},span:c,strike:c,strong:c,style:{attrs:{type:["text/css"],media:d,scoped:null}},sub:c,summary:c,sup:c,table:c,tbody:c,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:c,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:c,time:{attrs:{datetime:null}},title:c,tr:c,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:n}},tt:c,u:c,ul:c,var:c,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:c},u={accesskey:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],class:null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]};for(var m in t(c),p)p.hasOwnProperty(m)&&p[m]!=c&&t(p[m]);e.htmlSchema=p,e.registerHelper("hint","html",function(t,n){var o={schemaInfo:p};if(n)for(var r in n)o[r]=n[r];return e.hint.xml(t,o)})})},"Jo/m":function(e,t,n){(function(e){e(n("tQq4"),n("29F7"),n("4e7A"))})(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):!e.global&&(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);return n&&n.index==t.pos?(t.pos+=n[0].length||1,"searching"):void(n?t.pos=n.index:t.skipToEnd())}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function o(e){return e.state.search||(e.state.search=new n)}function r(e){return"string"==typeof e&&e==e.toLowerCase()}function i(e,t,n){return e.getSearchCursor(t,n,{caseFold:r(t),multiline:!0})}function s(e,t,n,o,r){e.openDialog(t,o,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){g(e)},onKeyDown:r})}function l(e,t,n,o,r){e.openDialog?e.openDialog(t,r,{value:o,selectValueOnOpen:!0}):r(prompt(n,o))}function d(e,t,n,o){e.openConfirm?e.openConfirm(t,o):confirm(n)&&o[0]()}function c(e){return e.replace(/\\(.)/g,function(e,t){return"n"==t?"\n":"r"==t?"\r":t})}function p(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(t){}else e=c(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function u(e,n,o){n.queryText=o,n.query=p(o),e.removeOverlay(n.overlay,r(n.query)),n.overlay=t(n.query,r(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,r(n.query)))}function m(t,n,r,i){var d=o(t);if(d.query)return h(t,n);var c=t.getSelection()||d.lastQuery;if(c instanceof RegExp&&"x^"==c.source&&(c=null),r&&t.openDialog){var p=null,m=function(n,o){e.e_stop(o),n&&(n!=d.queryText&&(u(t,d,n),d.posFrom=d.posTo=t.getCursor()),p&&(p.style.opacity=1),h(t,o.shiftKey,function(e,n){var o;3>n.line&&document.querySelector&&(o=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&o.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((p=o).style.opacity=.4)}))};s(t,b,c,m,function(n,r){var i=e.keyName(n),s=t.getOption("extraKeys"),l=s&&s[i]||e.keyMap[t.getOption("keyMap")][i];"findNext"==l||"findPrev"==l||"findPersistentNext"==l||"findPersistentPrev"==l?(e.e_stop(n),u(t,o(t),r),t.execCommand(l)):("find"==l||"findPersistent"==l)&&(e.e_stop(n),m(r,n))}),i&&c&&(u(t,d,c),h(t,n))}else l(t,b,"Search for:",c,function(e){e&&!d.query&&t.operation(function(){u(t,d,e),d.posFrom=d.posTo=t.getCursor(),h(t,n)})})}function h(t,n,r){t.operation(function(){var s=o(t),l=i(t,s.query,n?s.posFrom:s.posTo);!l.find(n)&&(l=i(t,s.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),!l.find(n))||(t.setSelection(l.from(),l.to()),t.scrollIntoView({from:l.from(),to:l.to()},20),s.posFrom=l.from(),s.posTo=l.to(),r&&r(l.from(),l.to()))})}function g(e){e.operation(function(){var t=o(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function f(e,t,n){e.operation(function(){for(var o=i(e,t);o.findNext();)if("string"!=typeof t){var r=e.getRange(o.from(),o.to()).match(t);o.replace(n.replace(/\$(\d)/g,function(e,t){return r[t]}))}else o.replace(n)})}function y(e,t){if(!e.getOption("readOnly")){var n=e.getSelection()||o(e).lastQuery,r=""+(t?"Replace all:":"Replace:")+"";l(e,r+x,r,n,function(n){n&&(n=p(n),l(e,v,"Replace with:","",function(o){if(o=c(o),t)f(e,n,o);else{g(e);var r=i(e,n,e.getCursor("from")),s=function(){var t=r.from(),c;!(c=r.findNext())&&(r=i(e,n),!(c=r.findNext())||t&&r.from().line==t.line&&r.from().ch==t.ch)||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()}),d(e,k,"Replace?",[function(){l(c)},s,function(){f(e,n,o)}]))},l=function(e){r.replace("string"==typeof n?o:o.replace(/\$(\d)/g,function(t,n){return e[n]})),s()};s()}}))})}}var b="Search: (Use /re/ syntax for regexp search)",x=" (Use /re/ syntax for regexp search)",v="With: ",k="Replace? ";e.commands.find=function(e){g(e),m(e)},e.commands.findPersistent=function(e){g(e),m(e,!1,!0)},e.commands.findPersistentNext=function(e){m(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){m(e,!0,!0,!0)},e.commands.findNext=m,e.commands.findPrev=function(e){m(e,!0)},e.commands.clearSearch=g,e.commands.replace=y,e.commands.replaceAll=function(e){y(e,!0)}})},KM04:function(O){!function(){"use strict";function M(){}function F(e,s){var n=U,d,o,c,i;for(i=arguments.length;2c.ch&&(p.end=c.ch,p.string=p.string.slice(0,c.ch-p.start));var u=e.innerMode(r.getMode(),p.state);if("xml"==u.mode.name){var m=[],h=!1,g=/\btag\b/.test(p.type)&&!/>$/.test(p.string),f=g&&/^\w/.test(p.string),y,b;if(f){var x=r.getLine(c.line).slice(o(0,p.start-2),p.start),v=/<\/$/.test(x)?"close":/<$/.test(x)?"open":null;v&&(b=p.start-("close"==v?2:1))}else g&&"<"==p.string?v="open":g&&"")}else{var S=l[u.state.tagName],T=S&&S.attrs,E=l["!attrs"];if(!T&&!E)return;if(!T)T=E;else if(E){var A={};for(var I in E)E.hasOwnProperty(I)&&(A[I]=E[I]);for(var I in T)T.hasOwnProperty(I)&&(A[I]=T[I]);T=A}if("string"==p.type||"="==p.string){var x=r.getRange(t(c.line,o(0,c.ch-60)),t(c.line,"string"==p.type?p.start:p.end)),N=x.match(/([^\s\u00a0=<>\"\']+)=$/),L;if(!N||!T.hasOwnProperty(N[1])||!(L=T[N[1]]))return;if("function"==typeof L&&(L=L.call(this,r)),"string"==p.type){y=p.string;var _=0;/['"]/.test(p.string.charAt(0))&&(d=p.string.charAt(0),y=p.string.slice(1),_++);var n=p.string.length;/['"]/.test(p.string.charAt(n-1))&&(d=p.string.charAt(n-1),y=p.string.substr(_,n-2)),h=!0}for(var w=0;wthis.status,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new r(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var b={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(b.arrayBuffer)var x=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=function(e){return e&&DataView.prototype.isPrototypeOf(e)},k=ArrayBuffer.isView||function(e){return e&&-1e.b&&(e.b++,t.next=e.a,e.a=t)}function rt(){this.b=this.a=null}function at(){var e=vc,t=null;return e.a&&(t=e.a,e.a=e.a.next,e.a||(e.b=null),t.next=null),t}function it(){this.next=this.b=this.a=null}function st(e,t){var n=e.length,o=s(e)?e.split(""):e;for(--n;0<=n;--n)n in o&&t.call(void 0,o[n],n,e)}function lt(t){a:{for(var n=Lr,o=t.length,r=s(t)?t.split(""):t,i=0;in?null:s(t)?t.charAt(n):t[n]}function dt(e,t){return 0<=wa(e,t)}function ct(e,t){t=wa(e,t);var n;return(n=0<=t)&&Array.prototype.splice.call(e,t,1),n}function pt(t,n){var o=0;st(t,function(r,i){n.call(void 0,r,i,t)&&1==Array.prototype.splice.call(t,i,1).length&&o++})}function ut(){return Array.prototype.concat.apply([],arguments)}function mt(e){var t=e.length;if(0")&&(e=e.replace(Pa,">")),-1!=e.indexOf("\"")&&(e=e.replace(Qa,""")),-1!=e.indexOf("'")&&(e=e.replace(Ra,"'")),-1!=e.indexOf("\0")&&(e=e.replace(Sa,"�")),e):e}function ft(e,t){return-1!=e.indexOf(t)}function w(e,t){return et?1:0}function yt(e){return ft(Na,e)}function x(e,t){for(var n in e)t.call(void 0,e[n],n,e)}function bt(e){for(var t in e)return!1;return!0}function xt(e){var t={},n;for(n in e)t[n]=e[n];return t}function vt(t){for(var n=1,e,o;nr.keyCode||void 0!=r.returnValue)){a:{var i=!1;if(0==r.keyCode)try{r.keyCode=-1;break a}catch(e){i=!0}(i||void 0==r.returnValue)&&(r.returnValue=!0)}for(r=[],i=n.b;i;i=i.parentNode)r.push(i);for(t=t.type,i=r.length-1;0<=i;i--){n.b=r[i];var e=ln(r[i],t,!0,n);o=o&&e}for(i=0;it)throw Error("Bad port number "+t);e.i=t}else e.i=null}function In(e,t,n){t instanceof Rn?(e.a=t,jn(e.a,e.f)):(n||(t=Mn(t,Qc)),e.a=new Rn(t,e.f))}function Nn(e,t,n){e.a.set(t,n)}function F(e,t){return e.a.get(t)}function Ln(e){return e instanceof Tn?new Tn(e):new Tn(e,void 0)}function _n(e,t){var n=new Tn(null,void 0);return En(n,"https"),e&&(n.b=e),t&&(n.g=t),n}function On(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Mn(e,t,n){return s(e)?(e=encodeURI(e).replace(t,Dn),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Dn(e){return e=e.charCodeAt(0),"%"+(15&e>>4).toString(16)+(15&e).toString(16)}function Rn(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function Pn(e){e.a||(e.a=new kn,e.b=0,e.c&&wn(e.c,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function Fn(t){var n=xn(t);if("undefined"==typeof n)throw Error("Keys are undefined");var o=new Rn(null,void 0);t=bn(t);for(var r=0;r2*e.c&&Sn(e)))}function Un(e,t){return Pn(e),t=qn(e,t),Cn(e.a.b,t)}function Vn(e,t,n){Bn(e,t),0"),e=e.join("")}return e=n.createElement(e),o&&(s(o)?e.className=o:_(o)?e.className=o.join(" "):ro(e,o)),2e?!1:!_c||!zc||9",t=no(t),l.document.write(to(t)),l.document.close())):(l=r.open($n(n),o,l))&&t.noopener&&(l.opener=null),l)try{l.focus()}catch(e){}return l}function de(e){return new Et(function(t){function n(){yn(2E3).then(function(){return!e||e.closed?void t():n()})}return n()})}function fe(){var e=null;return new Et(function(t){"complete"==yc.document.readyState?t():(e=function(){t()},rn(window,"load",e))}).s(function(t){throw an(window,"load",e),t})}function he(){return ie(void 0)?fe().then(function(){return new Et(function(e,t){var n=yc.document,o=setTimeout(function(){t(Error("Cordova framework is not ready."))},1E3);n.addEventListener("deviceready",function(){clearTimeout(o),e()},!1)})}):A(Error("Cordova must run in an Android or iOS file scheme."))}function ie(e){return e=e||re(),"file:"===ve()&&e.toLowerCase().match(/iphone|ipad|ipod|android/)}function je(){var e=yc.window;try{return e&&e!=e.top}catch(e){return!1}}function le(){return"object"!=typeof yc.window&&"function"==typeof yc.importScripts}function me(){return uc.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":uc.INTERNAL.hasOwnProperty("node")?"Node":le()?"Worker":"Browser"}function ne(){var e=me();return"ReactNative"===e||"Node"===e}function oe(){for(var e=50,t=[];0t)throw Error("Short delay should be less than long delay!");this.a=e,this.c=t,e=re(),t=me(),this.b=bo(e)||"ReactNative"===t}function Ce(){var e=yc.document;return e&&"undefined"!=typeof e.visibilityState?"visible"==e.visibilityState:!0}function De(){var e=yc.document,t=null;return Ce()||!e?It():new Et(function(n){t=function(){Ce()&&(e.removeEventListener("visibilitychange",t,!1),n())},e.addEventListener("visibilitychange",t,!1)}).s(function(n){throw e.removeEventListener("visibilitychange",t,!1),n})}function Ee(e){try{var t=new Date(parseInt(e,10));if(!isNaN(t.getTime())&&!/[^0-9]/.test(e))return t.toUTCString()}catch(e){}return null}function Fe(){return G("fireauth.oauthhelper",yc)||G("fireauth.iframe",yc)}function Ge(e){qe[e]||(qe[e]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(e))}function Ie(e,t,n){He?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n}):e[t]=n}function I(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&Ie(e,n,t[n])}function J(e){var t={};return I(t,e),t}function Le(e){var t={},n;for(n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Me(e,t){if(!t||!t.length)return!0;if(!e)return!1;for(var n=0,o;n>4),64!=s&&(n(240&e<<4|s>>2),64!=l&&n(192&s<<6|l))}}function To(){if(!rp){rp={},ap={};for(var e=0;65>e;e++)rp[e]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e),ap[rp[e]]=e,62<=e&&(ap["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(e)]=e)}}function Eo(e){this.c=e.sub,ja(),this.a=e.provider_id||e.firebase&&e.firebase.sign_in_provider||null,this.b=!!e.is_anonymous||"anonymous"==this.a}function Ao(e){return(e=Io(e))&&e.sub&&e.iss&&e.aud&&e.exp?new Eo(e):null}function Io(e){if(!e)return null;if(e=e.split("."),3!=e.length)return null;e=e[1];for(var t=(4-e.length%4)%4,n=0;n Auth section -> Sign in method tab.",e):"http"==n||"https"==n?o=ht("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",e):t="operation-not-supported-in-this-environment",Pe.call(this,t,o)}function cr(e,t,n){Pe.call(this,e,n),e=t||{},e.wb&&Ie(this,"email",e.wb),e.$&&Ie(this,"phoneNumber",e.$),e.credential&&Ie(this,"credential",e.credential)}function pr(e){if(e.code){var t=e.code||"";0==t.indexOf(We)&&(t=t.substring(We.length));var n={credential:rr(e)};if(e.email)n.wb=e.email;else if(e.phoneNumber)n.$=e.phoneNumber;else return new Pe(t,e.message||void 0);return new cr(t,n,e.message)}return null}function ur(){}function mr(e){return e.c||(e.c=e.b())}function hr(){}function gr(e){if(!e.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var t=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0,o;nn;n++){i=0|o[n-15],r=0|o[n-2];var e=0|(0|o[n-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3),s=0|(0|o[n-7])+((r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10);o[n]=0|e+s}r=0|t.a[0],i=0|t.a[1];var l=0|t.a[2],d=0|t.a[3],c=0|t.a[4],p=0|t.a[5],u=0|t.a[6];for(e=0|t.a[7],n=0;64>n;n++){var m=0|((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&l^i&l);s=c&p^~c&u,e=0|e+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7)),s=0|s+(0|eu[n]),s=0|e+(0|s+(0|o[n])),e=u,u=p,p=c,c=0|d+s,d=l,l=i,i=r,r=0|s+m}t.a[0]=0|t.a[0]+r,t.a[1]=0|t.a[1]+i,t.a[2]=0|t.a[2]+l,t.a[3]=0|t.a[3]+d,t.a[4]=0|t.a[4]+c,t.a[5]=0|t.a[5]+p,t.a[6]=0|t.a[6]+u,t.a[7]=0|t.a[7]+e}function bs(t,n,o){void 0===o&&(o=n.length);var r=0,i=t.c;if(s(n))for(;r=e&&e==(0|e)))throw Error("message must be a byte array");t.f[i++]=e,i==t.b&&(ys(t),i=0)}else throw Error("message must be string or array");t.c=i,t.g+=o}function xs(){fs.call(this,8,iu)}function vs(t,n,o,r,i){this.l=t,this.i=n,this.m=o,this.o=r||null,this.u=i||null,this.h=n+":"+o,this.v=new gs,this.g=new ms(this.h),this.f=null,this.b=[],this.a=this.c=null}function ks(e){return new Pe("invalid-cordova-configuration",e)}function Ss(){for(var e=20,t=[];0n.c?bs(n,ru,56-n.c):bs(n,ru,n.b-(n.c-56));for(var r=63;56<=r;r--)n.f[r]=255&o,o/=256;for(ys(n),r=o=0;r>i;return So(t)}function ws(t,n,o,r){var i=Ss(),e=new ir(n,r,null,i,new Pe("no-auth-event")),s=G("BuildInfo.packageName",yc);if("string"!=typeof s)throw new Pe("invalid-cordova-configuration");var l=G("BuildInfo.displayName",yc),d={};if(re().toLowerCase().match(/iphone|ipad|ipod/))d.ibi=s;else if(re().toLowerCase().match(/android/))d.apn=s;else return A(new Pe("operation-not-supported-in-this-environment"));l&&(d.appDisplayName=l),i=Cs(i),d.sessionId=i;var p=_i(t.l,t.i,t.m,n,o,null,r,t.o,d,t.u);return t.ga().then(function(){var n=t.h;return t.v.a.set(Zp,e.D(),n)}).then(function(){var e=G("cordova.plugins.browsertab.isAvailable",yc);if("function"!=typeof e)throw new Pe("invalid-cordova-configuration");var n=null;e(function(e){if(e){if(n=G("cordova.plugins.browsertab.openUrl",yc),"function"!=typeof n)throw new Pe("invalid-cordova-configuration");n(p)}else{if(n=G("cordova.InAppBrowser.open",yc),"function"!=typeof n)throw new Pe("invalid-cordova-configuration");e=re(),e=e.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||e.match(/(iPad|iPhone|iPod).*OS 8_\d/i),t.a=n(p,e?"_blank":"_system","location=yes")}})})}function Ts(e,t){for(var n=0;ne.f&&(e.a=e.f),t)}function Rl(e,t){e.stop(),e.b=yn(_l(e,t)).then(function(){return De()}).then(function(){return e.h()}).then(function(){Rl(e,!0)}).s(function(t){e.i(t)&&Rl(e,!1)})}function ed(e){this.f=e,this.b=this.a=null,this.c=0}function od(e,t){var n=t[Ip],o=t.refreshToken;t=id(t.expiresIn),e.b=n,e.c=t,e.a=o}function rd(e,t){e.b=t.b,e.a=t.a,e.c=t.c}function id(e){return ja()+1E3*parseInt(e,10)}function sd(e,t){return pa(e.f,t).then(function(t){return e.b=t.access_token,e.c=id(t.expires_in),e.a=t.refresh_token,{accessToken:e.b,expirationTime:e.c,refreshToken:e.a}}).s(function(t){throw"auth/user-token-expired"==t.code&&(e.a=null),t})}function ld(e,t){this.a=e||null,this.b=t||null,I(this,{lastSignInTime:Ee(t||null),creationTime:Ee(e||null)})}function dd(e){return new ld(e.a,e.b)}function ud(t,n,o,r,i,e){I(this,{uid:t,displayName:r||null,photoURL:i||null,email:o||null,phoneNumber:e||null,providerId:n})}function md(e,t){for(var n in Qt.call(this,e),t)this[n]=t[n]}function hd(e,t,n){this.G=[],this.l=e.apiKey,this.o=e.appName,this.u=e.authDomain||null,e=uc.SDK_VERSION?xo(uc.SDK_VERSION):null,this.b=new ra(this.l,Ka(wi),e),this.h=new ed(this.b),Ed(this,t[Ip]),od(this.h,t),Ie(this,"refreshToken",this.h.a),al(this,n||{}),mn.call(this),this.I=!1,this.u&&se()&&(this.a=Us(this.u,this.l,this.o)),this.N=[],this.i=null,this.w=vd(this),this.V=z(this.Ha,this);var o=this;this.ka=null,this.sa=function(e){o.oa(e.g)},this.X=null,this.O=[],this.ra=function(e){fd(o,e.c)},this.W=null}function gd(e,t){e.X&&an(e.X,"languageCodeChanged",e.sa),(e.X=t)&&tn(t,"languageCodeChanged",e.sa)}function fd(e,t){e.O=t,la(e.b,uc.SDK_VERSION?xo(uc.SDK_VERSION,e.O):null)}function yd(e,t){e.W&&an(e.W,"frameworkChanged",e.ra),(e.W=t)&&tn(t,"frameworkChanged",e.ra)}function bd(e){try{return uc.app(e.o).auth()}catch(t){throw new Pe("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+e.o+"'!")}}function vd(e){return new Zs(function(){return e.F(!0)},function(e){return e&&"auth/network-request-failed"==e.code},function(){var t=e.h.c-ja()-3E5;return 0i||i>=vu.length)throw new Pe("internal-error","Argument validator received an unsupported number of arguments.");o=vu[i],r=(r?"":o+" argument ")+(n.name?"\""+n.name+"\" ":"")+"must be "+n.K+".";break a}r=null}}if(r)throw new Pe("argument-error",t+" failed: "+r)}function Qd(e,t){return{name:e||"",K:"a valid string",optional:!!t,M:s}}function V(t,n){return{name:t||"",K:"a boolean",optional:!!n,M:e}}function Jd(e,t){return{name:e||"",K:"a valid object",optional:!!t,M:j}}function W(e,t){return{name:e||"",K:"a function",optional:!!t,M:h}}function $d(e,t){return{name:e||"",K:"null",optional:!!t,M:c}}function Yd(){return{name:"",K:"an HTML element",optional:!1,M:function(e){return!!(e&&e instanceof Element)}}}function Zd(){return{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(e){return!!(e&&e instanceof Dl)}}}function ec(){return{name:"app",K:"an instance of Firebase App",optional:!0,M:function(e){return!!(e&&e instanceof uc.app.App)}}}function tc(e){return{name:e?e+"Credential":"credential",K:e?"a valid "+e+" credential":"a valid credential",optional:!1,M:function(t){if(!t)return!1;var n=!e||t.providerId===e;return t.ya&&n}}}function rc(){return{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(e){return!!(e&&e.providerId&&e.hasOwnProperty&&e.hasOwnProperty("isOAuthProvider"))}}}function ic(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(e){return!!(e&&s(e.type)&&h(e.verify))}}}function sc(e,t,n,o){return{name:n||"",K:e.K+" or "+t.K,optional:!!o,M:function(n){return e.M(n)||t.M(n)}}}function X(e,t){for(var n in t){var o=t[n].name;e[o]=Z(o,e[n],t[n].j)}}function Y(t,n){for(var o in n){var r=n[o].name;if(r!==o){var i=n[o].qb;Object.defineProperty(t,r,{get:function(){return this[o]},set:function(e){Xd(r,[i],[e],!0),this[o]=e},enumerable:!0})}}}function lc(e,t,n,o){e[t]=Z(t,n,o)}function Z(t,n,o){function r(){var e=Array.prototype.slice.call(arguments);return Xd(i,o,e),n.apply(this,e)}if(!o)return n;var i=pc(t),e;for(e in n)r[e]=n[e];for(e in n.prototype)r.prototype[e]=n.prototype[e];return r}function pc(e){return e=e.split("."),e[e.length-1]}var uc=o("dP58").default,mc=mc||{},yc=this,k="closure_uid_"+(1E9*Math.random()>>>0),ia=0,ja=Date.now||function(){return+new Date},na;$(et,Error),et.prototype.name="CustomError",$(u,et),u.prototype.name="AssertionError",nt.prototype.get=function(){if(0/g,Qa=/"/g,Ra=/'/g,Sa=/\x00/g,Ta=/[\x00&<>"']/,Na;a:{var Va=yc.navigator;if(Va){var Wa=Va.userAgent;if(Wa){Na=Wa;break a}}Na=""}var Xa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],xc=!1,vc=new rt,ya=0,kc=2,Sc=3,Cc,wc;y.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var Tc=new nt(function(){return new y},function(e){e.reset()});Et.prototype.then=function(e,t,n){return Mt(this,h(e)?e:null,h(t)?t:null,n)},t(Et),na=Et.prototype,na.ia=function(e,t){return e=At(e,e,t),e.c=!0,Ot(this,e),this},na.s=function(e,t){return Mt(this,null,e,t)},na.cancel=function(e){this.a==ya&&Ct(function(){var t=new jt(e);_t(this,t)},this)},na.Lc=function(e){this.a=ya,Dt(this,kc,e)},na.Mc=function(e){this.a=ya,Dt(this,Sc,e)},na.Ub=function(){for(var e;e=Bt(this);)Ut(this,e,this.a,this.i);this.h=!1};var Ac=kt;$(jt,et),jt.prototype.name="cancel";var Ic=0,Nc={};Wt.prototype.pa=!1,Wt.prototype.ua=function(){if(this.ja)for(;this.ja.length;)this.ja.shift()()},Ht[" "]=p;var Lc=yt("Opera"),_c=yt("Trident")||yt("MSIE"),Mc=yt("Edge"),Dc=Mc||_c,Rc=yt("Gecko")&&(!ft(Na.toLowerCase(),"webkit")||yt("Edge"))&&!(yt("Trident")||yt("MSIE"))&&!yt("Edge"),Pc=ft(Na.toLowerCase(),"webkit")&&!yt("Edge"),Fc;a:{var Bc="",Uc=function(){var e=Na;return Rc?/rv:([^\);]+)(\)|;)/.exec(e):Mc?/Edge\/([\d\.]+)/.exec(e):_c?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):Pc?/WebKit\/(\S+)/.exec(e):Lc?/(?:Version)[ \/]?(\S+)/.exec(e):void 0}();if(Uc&&(Bc=Uc?Uc[1]:""),_c){var Vc=Gt();if(null!=Vc&&Vc>parseFloat(Bc)){Fc=Vc+"";break a}}Fc=Bc}var jc={},Wc=yc.document,zc;zc=Wc&&_c?Gt()||("CSS1Compat"==Wc.compatMode?parseInt(Fc,10):5):void 0;var Hc=Object.freeze||function(e){return e},ac=!_c||9<=+zc,Kc=_c&&!Xt("9"),cc=function(){if(!yc.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return yc.addEventListener("test",p,t),yc.removeEventListener("test",p,t),e}();Qt.prototype.preventDefault=function(){this.Gb=!1},$(C,Qt);var dc=Hc({2:"touch",3:"pen",4:"mouse"});C.prototype.preventDefault=function(){C.lb.preventDefault.call(this);var e=this.a;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,Kc)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}},C.prototype.f=function(){return this.a};var fc="closure_listenable_"+(0|1E6*Math.random()),gc=0;Yt.prototype.add=function(t,n,o,r,i){var e=t.toString();t=this.a[e],t||(t=this.a[e]=[],this.b++);var s=en(t,n,r,i);return-1>>0);$(mn,Wt),mn.prototype[fc]=!0,mn.prototype.addEventListener=function(e,t,n,o){tn(this,e,t,n,o)},mn.prototype.removeEventListener=function(e,t,n,o){an(this,e,t,n,o)},mn.prototype.dispatchEvent=function(t){var n=this.Ua,o;if(n)for(o=[];n;n=n.Ua)o.push(n);n=this.Nb;var r=t.type||t;if(s(t))t=new Qt(t,n);else if(t instanceof Qt)t.target=t.target||n;else{var i=t;t=new Qt(r,n),vt(t,i)}if(i=!0,o)for(var e=o.length-1,l;0<=e;e--)l=t.b=o[e],i=gn(l,r,!0,t)&&i;if(l=t.b=n,i=gn(l,r,!0,t)&&i,i=gn(l,r,!1,t)&&i,o)for(e=0;e"),no(""),no("
");var Gd={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"},Ld={'"':"\\\"","\\":"\\\\","/":"\\/","":"\\b"," ":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"," ":"\\u000b"},Td=/\uffff/.test("\uFFFF")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g,Ud=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,ge="Firefox",ee="Chrome",ae={Sc:"FirebaseCore-web",Uc:"FirebaseUI-web"};Be.prototype.get=function(){var e=yc.navigator;return(e&&"boolean"==typeof e.onLine&&(ue()||"chrome-extension:"===ve()||"undefined"!=typeof e.connection)?e.onLine:1)?this.b?this.c:this.a:Math.min(5E3,this.a)};var qe={},He;try{var Je={};Object.defineProperty(Je,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Je,"abcd",{configurable:!0,enumerable:!0,value:2}),He=2==Je.abcd}catch(e){He=!1}var Ke="EMAIL_SIGNIN",Te="email",Qe="newEmail",Re="requestType",Se="email",Ve="fromEmail",Ue="data",Xe="operation";$(Pe,Error),Pe.prototype.D=function(){return{code:this.code,message:this.message}},Pe.prototype.toJSON=function(){return this.D()};var We="auth/",Ye={"argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":"This operation is not supported in the environment this application is running on. \"location.protocol\" must be http, https or chrome-extension and web storage must be enabled.","popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","user-cancelled":"User did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."},Ze="android",$c="handleCodeInApp",Yc="iOS",Zc="url",ep="installApp",tp="minimumVersion",np="packageName",op="bundleId",rp=null,ap=null;Eo.prototype.f=function(){return this.b};var ip=["oauth_consumer_key","oauth_nonce","oauth_signature","oauth_signature_method","oauth_timestamp","oauth_token","oauth_version"],sp=["client_id","response_type","scope","redirect_uri","state"],lp={Tc:{Ma:"locale",Ba:500,Aa:600,Na:"facebook.com",eb:sp},Vc:{Ma:null,Ba:500,Aa:620,Na:"github.com",eb:sp},Wc:{Ma:"hl",Ba:515,Aa:680,Na:"google.com",eb:sp},bd:{Ma:"lang",Ba:485,Aa:705,Na:"twitter.com",eb:ip}},dp="idToken",cp="providerId";$(Oo,_o),$(Mo,Oo),$(Do,Oo),$(Ro,Oo),$(Po,Oo),Vo.prototype.ya=function(e){return Ma(e,qo(this))},Vo.prototype.c=function(e,t){var n=qo(this);return n.idToken=t,Da(e,n)},Vo.prototype.f=function(e,t){var n=qo(this);return Uo(Fa(e,n),t)},Vo.prototype.D=function(){var e={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(e.oauthIdToken=this.idToken),this.accessToken&&(e.oauthAccessToken=this.accessToken),this.secret&&(e.oauthTokenSecret=this.secret),e},jo.prototype.Da=function(e){return this.vb=xt(e),this},$(Wo,jo),Wo.prototype.ta=function(e){return dt(this.a,e)||this.a.push(e),this},Wo.prototype.Ab=function(){return mt(this.a)},Wo.prototype.credential=function(e,t){if(!e&&!t)throw new Pe("argument-error","credential failed: must provide the ID token and/or the access token.");return new Vo(this.providerId,{idToken:e||null,accessToken:t||null},this.providerId)},$(M,Wo),Ie(M,"PROVIDER_ID","facebook.com"),Ie(M,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),$(Ho,Wo),Ie(Ho,"PROVIDER_ID","github.com"),Ie(Ho,"GITHUB_SIGN_IN_METHOD","github.com"),$(Go,Wo),Ie(Go,"PROVIDER_ID","google.com"),Ie(Go,"GOOGLE_SIGN_IN_METHOD","google.com"),$(Qo,jo),Ie(Qo,"PROVIDER_ID","twitter.com"),Ie(Qo,"TWITTER_SIGN_IN_METHOD","twitter.com"),$o.prototype.ya=function(e){return this.signInMethod==Yo.EMAIL_LINK_SIGN_IN_METHOD?qa(e,gi,{email:this.a,oobCode:this.b}):qa(e,vi,{email:this.a,password:this.b})},$o.prototype.c=function(e,t){return this.signInMethod==Yo.EMAIL_LINK_SIGN_IN_METHOD?qa(e,Bp,{idToken:t,email:this.a,oobCode:this.b}):qa(e,qp,{idToken:t,email:this.a,password:this.b})},$o.prototype.f=function(e,t){return Uo(this.ya(e),t)},$o.prototype.D=function(){return{email:this.a,password:this.b,signInMethod:this.signInMethod}},I(Yo,{PROVIDER_ID:"password"}),I(Yo,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),I(Yo,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),er.prototype.ya=function(e){return e.Ta(tr(this))},er.prototype.c=function(e,t){var n=tr(this);return n.idToken=t,qa(e,ei,n)},er.prototype.f=function(e,t){var n=tr(this);return n.operation="REAUTH",e=qa(e,Hp,n),Uo(e,t)},er.prototype.D=function(){var e={providerId:"phone"};return this.a.Sa&&(e.verificationId=this.a.Sa),this.a.Ra&&(e.verificationCode=this.a.Ra),this.a.Fa&&(e.temporaryProof=this.a.Fa),this.a.$&&(e.phoneNumber=this.a.$),e},nr.prototype.Ta=function(e,t){var n=this.a.b;return It(t.verify()).then(function(o){if(!s(o))throw new Pe("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(t.type){case"recaptcha":return Ea(n,{phoneNumber:e,recaptchaToken:o}).then(function(e){return"function"==typeof t.reset&&t.reset(),e},function(e){throw"function"==typeof t.reset&&t.reset(),e});default:throw new Pe("argument-error","Only firebase.auth.ApplicationVerifiers with type=\"recaptcha\" are currently supported.");}})},I(nr,{PROVIDER_ID:"phone"}),I(nr,{PHONE_SIGN_IN_METHOD:"phone"}),ir.prototype.D=function(){return{type:this.b,eventId:this.c,urlResponse:this.f,sessionId:this.g,error:this.a&&this.a.D()}};var pp=null;lr.prototype.subscribe=function(e){var t=this;this.a.push(e),this.b||(this.b=function(e){for(var n=0;n=Sr(this).value)for(h(t)&&(t=t()),e=new xr(e,t+"",this.f),n&&(e.a=n),n=this;n;)n=n.a};var xp={},vp=null;$(P,ur),P.prototype.a=function(){return new Tr(this.f)},P.prototype.b=function(e){return function(){return e}}({}),$(Tr,mn);var kp=0;na=Tr.prototype,na.open=function(e,t){if(this.readyState!=kp)throw this.abort(),Error("Error reopening a connection");this.h=e,this.c=t,this.readyState=1,Er(this)},na.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var t={headers:this.g,method:this.h,credentials:void 0,cache:void 0};e&&(t.body=e),this.i.fetch(new Request(this.c,t)).then(this.ec.bind(this),this.Cb.bind(this))},na.abort=function(){this.responseText="",this.g=new Headers,this.status=0,1<=this.readyState&&this.a&&4!=this.readyState&&(this.readyState=4,this.a=!1,Er(this)),this.readyState=kp},na.ec=function(e){this.a&&(this.b||(this.b=e.headers,this.readyState=2,Er(this)),this.a&&(this.readyState=3,Er(this),this.a&&e.text().then(this.dc.bind(this,e),this.Cb.bind(this))))},na.dc=function(e,t){this.a&&(this.status=e.status,this.statusText=e.statusText,this.responseText=t,this.readyState=4,Er(this))},na.Cb=function(e){var t=this.f;t&&t.log(fp,"Failed to fetch url "+this.c,e instanceof Error?e:Error(e)),this.a&&(this.readyState=4,Er(this))},na.setRequestHeader=function(e,t){this.g.append(e,t)},na.getResponseHeader=function(e){return this.b?this.b.get(e.toLowerCase())||"":((e=this.f)&&e.log(fp,"Attempting to get response header but no headers have been received for url: "+this.c,void 0),"")},na.getAllResponseHeaders=function(){if(!this.b){var e=this.f;return e&&e.log(fp,"Attempting to get all response headers but no headers have been received for url: "+this.c,void 0),""}e=[];for(var t=this.b.entries(),n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},$(Ar,mn);var Sp="";Ar.prototype.b=Cr("goog.net.XhrIo");var Cp=/^https?$/i,wp=["POST","PUT"];na=Ar.prototype,na.Ga=function(){"undefined"!=typeof mc&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",wr(this.b,Ur(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},na.abort=function(){this.a&&this.c&&(wr(this.b,Ur(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),Dr(this))},na.ua=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),Dr(this,!0)),Ar.lb.ua.call(this)},na.Fb=function(){this.pa||(this.I||this.i||this.f?Mr(this):this.tc())},na.tc=function(){Mr(this)},na.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.o){case Sp:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer;}var e=this.b;return e&&e.log(gp,"Response type "+this.o+" is not supported on this browser",void 0),null}catch(e){return wr(this.b,"Can not get response: "+e.message),null}},Vr.prototype.cancel=function(e){if(this.a)this.c instanceof Vr&&this.c.cancel();else{if(this.b){var t=this.b;delete this.b,e?t.cancel(e):(t.m--,0>=t.m&&t.cancel())}this.v?this.v.call(this.u,this):this.l=!0,this.a||(e=new Xr(this),jr(this),qr(this,!1,e))}},Vr.prototype.o=function(e,t){this.i=!1,qr(this,e,t)},Vr.prototype.C=function(){jr(this),qr(this,!0,null)},Vr.prototype.then=function(t,n,o){var r=new Et(function(e,t){i=e,s=t}),i,s;return zr(this,i,function(e){e instanceof Xr?r.cancel():s(e)}),r.then(t,n,o)},t(Vr),$(Gr,et),Gr.prototype.message="Deferred has already fired",Gr.prototype.name="AlreadyCalledError",$(Xr,et),Xr.prototype.message="Deferred was canceled",Xr.prototype.name="CanceledError",Qr.prototype.c=function(){throw delete Tp[this.a],this.b};var Tp={},Ep=0,Ap=1;$(ta,et),$(oa,ur),oa.prototype.a=function(){return new this.f},oa.prototype.b=function(){return{}};var Ip="idToken",L=new Be(3E4,6E4),Np={"Content-Type":"application/x-www-form-urlencoded"},Lp=new Be(3E4,6E4),_p={"Content-Type":"application/json"},Op;ra.prototype.o=function(t,o,r,i,s,e){if(le()&&("undefined"==typeof yc.fetch||"undefined"==typeof yc.Headers||"undefined"==typeof yc.Request))throw new Pe("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var l=new Ar(this.c);if(e){l.g=n(0,e);var d=setTimeout(function(){l.dispatchEvent("timeout")},e)}E(l,"complete",function(){d&&clearTimeout(d);var e=null;try{e=JSON.parse(Br(this))||null}catch(t){e=null}o&&o(e)}),hn(l,"ready",function(){d&&clearTimeout(d),zt(this)}),hn(l,"timeout",function(){d&&clearTimeout(d),zt(this),o&&o(null)}),Ir(l,t,r,i,s)};var Mp=Hn("https://apis.google.com/js/client.js?onload=%{onload}"),Dp="__fcb"+i(1E6*Math.random()).toString();ra.prototype.l=function(t,n,o,r,i){var s=this;Op.then(function(){window.gapi.client.setApiKey(s.b);var l=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:t,method:o,body:r,headers:i,authType:"none",callback:function(e){window.gapi.auth.setToken(l),n&&n(e)}})}).s(function(e){n&&n({error:{message:e&&e.message||"CORS_UNSUPPORTED"}})})},ra.prototype.Pa=function(){return qa(this,jp,{})},ra.prototype.mb=function(e,t){return qa(this,di,{idToken:e,email:t})},ra.prototype.nb=function(e,t){return qa(this,qp,{idToken:e,password:t})};var Rp={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};na=ra.prototype,na.ob=function(e,t){var n={idToken:e},o=[];return x(Rp,function(r,i){var s=t[i];null===s?o.push(r):i in t&&(n[i]=s)}),o.length&&(n.deleteAttribute=o),qa(this,di,n)},na.hb=function(e,t){return e={requestType:"PASSWORD_RESET",email:e},vt(e,t),qa(this,ci,e)},na.ib=function(e,t){return e={requestType:"EMAIL_SIGNIN",email:e},vt(e,t),qa(this,ti,e)},na.gb=function(e,t){return e={requestType:"VERIFY_EMAIL",idToken:e},vt(e,t),qa(this,bi,e)},na.Ta=function(e){return qa(this,zp,e)},na.Xa=function(e,t){return qa(this,ui,{oobCode:e,newPassword:t})},na.Ja=function(e){return qa(this,qi,{oobCode:e})},na.Va=function(e){return qa(this,Pp,{oobCode:e})};var Pp={endpoint:"setAccountInfo",B:Ua,da:"email"},qi={endpoint:"resetPassword",B:Ua,J:function(e){var t=e.requestType;if(!t||!e.email&&"EMAIL_SIGNIN"!=t)throw new Pe("internal-error")}},pi={endpoint:"signupNewUser",B:function(e){if(ma(e),!e.password)throw new Pe("weak-password")},J:va,R:!0},ri={endpoint:"createAuthUri"},Fp={endpoint:"deleteAccount",T:["idToken"]},si={endpoint:"setAccountInfo",T:["idToken","deleteProvider"],B:function(e){if(!_(e.deleteProvider))throw new Pe("internal-error")}},gi={endpoint:"emailLinkSignin",T:["email","oobCode"],B:ma,J:va,R:!0},Bp={endpoint:"emailLinkSignin",T:["idToken","email","oobCode"],B:ma,J:va,R:!0},Up={endpoint:"getAccountInfo"},ti={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(e){if("EMAIL_SIGNIN"!=e.requestType)throw new Pe("internal-error");ma(e)},da:"email"},bi={endpoint:"getOobConfirmationCode",T:["idToken","requestType"],B:function(e){if("VERIFY_EMAIL"!=e.requestType)throw new Pe("internal-error")},da:"email"},ci={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(e){if("PASSWORD_RESET"!=e.requestType)throw new Pe("internal-error");ma(e)},da:"email"},ai={rb:!0,endpoint:"getProjectConfig",Eb:"GET"},Vp={rb:!0,endpoint:"getRecaptchaParam",Eb:"GET",J:function(e){if(!e.recaptchaSiteKey)throw new Pe("internal-error")}},ui={endpoint:"resetPassword",B:Ua,da:"email"},oi={endpoint:"sendVerificationCode",T:["phoneNumber","recaptchaToken"],da:"sessionInfo"},di={endpoint:"setAccountInfo",T:["idToken"],B:ha,R:!0},qp={endpoint:"setAccountInfo",T:["idToken"],B:function(e){if(ha(e),!e.password)throw new Pe("weak-password")},J:va,R:!0},jp={endpoint:"signupNewUser",J:va,R:!0},Wp={endpoint:"verifyAssertion",B:Ia,J:_a,R:!0},ki={endpoint:"verifyAssertion",B:Ia,J:function(e){if(e.errorMessage&&"USER_NOT_FOUND"==e.errorMessage)throw new Pe("user-not-found");if(e.errorMessage)throw O(e.errorMessage);if(!e[Ip])throw new Pe("internal-error")},R:!0},mi={endpoint:"verifyAssertion",B:function(e){if(Ia(e),!e.idToken)throw new Pe("internal-error")},J:_a,R:!0},li={endpoint:"verifyCustomToken",B:function(e){if(!e.token)throw new Pe("invalid-custom-token")},J:va,R:!0},vi={endpoint:"verifyPassword",B:function(e){if(ma(e),!e.password)throw new Pe("wrong-password")},J:va,R:!0},zp={endpoint:"verifyPhoneNumber",B:ka,J:va},ei={endpoint:"verifyPhoneNumber",B:function(e){if(!e.idToken)throw new Pe("internal-error");ka(e)},J:function(e){if(e.temporaryProof)throw e.code="credential-already-in-use",pr(e);va(e)}},Hp={Tb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",B:ka,J:va},Kp={Yc:{Za:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",fb:"https://securetoken.googleapis.com/v1/token",id:"p"},$c:{Za:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",fb:"https://staging-securetoken.sandbox.googleapis.com/v1/token",id:"s"},ad:{Za:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",fb:"https://test-securetoken.sandbox.googleapis.com/v1/token",id:"t"}},wi;wi=Ka("__EID__")?"__EID__":void 0;var yi=Hn("https://apis.google.com/js/api.js?onload=%{onload}"),Fi=new Be(3E4,6E4),Gi=new Be(5E3,15E3),Ci=null;fi.prototype.toString=function(){return this.f?Nn(this.a,"v",this.f):Bn(this.a.a,"v"),this.b?Nn(this.a,"eid",this.b):Bn(this.a.a,"eid"),this.c.length?Nn(this.a,"fw",this.c.join(",")):Bn(this.a.a,"fw"),this.a.toString()},xi.prototype.toString=function(){var t=_n(this.o,"/__/auth/handler");if(Nn(t,"apiKey",this.l),Nn(t,"appName",this.c),Nn(t,"authType",this.m),this.a.isOAuthProvider){var n=this.a;try{var o=uc.app(this.c).auth().ea()}catch(e){o=null}for(var r in n.Ya=o,Nn(t,"providerId",this.a.providerId),n=this.a,o=xe(n.vb),o)o[r]=o[r].toString();r=n.Ac,o=xt(o);for(var i=0,e;ithis.c-3E4?this.a?sd(this,{grant_type:"refresh_token",refresh_token:this.a}):It(null):It({accessToken:this.b,expirationTime:this.c,refreshToken:this.a})},ld.prototype.D=function(){return{lastLoginAt:this.b,createdAt:this.a}},$(md,Qt),$(hd,mn),hd.prototype.oa=function(e){this.ka=e,sa(this.b,e)},hd.prototype.ea=function(){return this.ka},hd.prototype.xa=function(){return mt(this.O)},hd.prototype.Ha=function(){this.w.b&&(this.w.stop(),this.w.start())},Ie(hd.prototype,"providerId","firebase"),na=hd.prototype,na.reload=function(){var e=this;return ql(this,bl(this).then(function(){return hl(e).then(function(){return Nd(e)}).then(Od)}))},na.ac=function(e){return this.F(e).then(function(e){return new Ys(e)})},na.F=function(e){var t=this;return ql(this,bl(this).then(function(){return t.h.getToken(e)}).then(function(e){if(!e)throw new Pe("internal-error");return e.accessToken!=t.qa&&(Ed(t,e.accessToken),t.dispatchEvent(new md("tokenChanged"))),fl(t,"refreshToken",e.refreshToken),e.accessToken}))},na.uc=function(e){if(e=e.users,!e||!e.length)throw new Pe("internal-error");e=e[0],al(this,{uid:e.localId,displayName:e.displayName,photoURL:e.photoUrl,email:e.email,emailVerified:!!e.emailVerified,phoneNumber:e.phoneNumber,lastLoginAt:e.lastLoginAt,createdAt:e.createdAt});for(var t=jl(e),n=0;nthis.u&&(this.u=0),0==this.u&&S(this)&&Sd(S(this)),this.removeAuthTokenListener(e)},na.addAuthTokenListener=function(e){var t=this;this.o.push(e),Yl(this,this.i.then(function(){t.l||dt(t.o,e)&&e(U(t))}))},na.removeAuthTokenListener=function(e){pt(this.o,function(t){return t==e})},na.delete=function(){this.l=!0;for(var e=0;e=n||(c.line>=n&&(c=d(n,0)),n=i.line,null==r?t.uncomment(i,c,e)?r="un":(t.lineComment(i,c,e),r="line"):"un"==r?t.uncomment(i,c,e):t.lineComment(i,c,e))}}),e.defineExtension("lineComment",function(e,i,c){c||(c=s);var p=this,u=r(p,e),m=p.getLine(e.line);if(!(null==m||n(p,e,m))){var h=c.lineComment||u.lineComment;if(!h)return void((c.blockCommentStart||u.blockCommentStart)&&(c.fullLines=!0,p.blockComment(e,i,c)));var g=o(0!=i.ch||i.line==e.line?i.line+1:i.line,p.lastLine()+1),f=null==c.padding?" ":c.padding,y=c.commentBlankLines||e.line==i.line;p.operation(function(){if(c.indent){for(var n=null,o=e.line;oi.length)&&(n=i)}for(var o=e.line;oh||c.operation(function(){if(!1!=n.fullLines){var o=l.test(c.getLine(h));c.replaceRange(g+m,d(h)),c.replaceRange(u+g,d(e.line,0));var r=n.blockCommentLead||p.blockCommentLead;if(null!=r)for(var s=e.line+1;s<=h;++s)(s!=h||o)&&c.replaceRange(r+g,d(s,0))}else c.replaceRange(m,t),c.replaceRange(u,e)})}}),e.defineExtension("uncomment",function(e,t,n){n||(n=s);var c=this,p=r(c,e),u=o(0!=t.ch||t.line==e.line?t.line:t.line-1,c.lastLine()),m=o(e.line,u),h=n.lineComment||p.lineComment,g=[],f=null==n.padding?" ":n.padding,y;lineComment:{if(!h)break lineComment;for(var b=m;b<=u;++b){var i=c.getLine(b),x=i.indexOf(h);if(-1n||(t.slice(o,o+f.length)==f&&(o+=f.length),y=!0,c.replaceRange("",d(e,n),d(e,o)))}}),y)return!0}var v=n.blockCommentStart||p.blockCommentStart,k=n.blockCommentEnd||p.blockCommentEnd;if(!v||!k)return!1;var S=n.blockCommentLead||p.blockCommentLead,C=c.getLine(m),w=C.indexOf(v);if(-1==w)return!1;var T=u==m?C:c.getLine(u),E=T.indexOf(k,u==m?w+v.length:0),A=d(m,w+1),I=d(u,E+1);if(-1==E||!/comment/.test(c.getTokenTypeAt(A))||!/comment/.test(c.getTokenTypeAt(I))||-1o&&0==n.ch)return t.clipPos(h(n.line-1));var r=t.getLine(n.line);if(0=r.length)return t.clipPos(h(n.line+1,0));for(var s="start",l=n.ch,d=0>o?0:r.length,c=0,i;l!=d;l+=o,c++){var p=r.charAt(0>o?l-1:l),u="_"!=p&&e.isWordChar(p)?"w":"o";if("w"==u&&p.toUpperCase()==p&&(u="W"),"start"==s)"o"!=u&&(s="in",i=u);else if("in"==s&&i!=u){if("w"==i&&"W"==u&&0>o&&l--,"W"==i&&"w"==u&&0n?o.from():o.to()})}function o(t,n){return t.isReadOnly()?e.Pass:void(t.operation(function(){for(var e=t.listSelections().length,o=[],r=-1,s=0,i;s=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},m.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},m.splitSelectionByLine=function(e){for(var t=e.listSelections(),n=[],o=0;or.line&&s==i.line&&0==i.ch||n.push({anchor:s==r.line?r:h(s,0),head:s==i.line?i:h(s)});e.setSelections(n,0)},m.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},m.selectLine=function(e){for(var t=e.listSelections(),n=[],o=0,r;or?o.push(d,c):o.length&&(o[o.length-1]=c),r=c}t.operation(function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+i,h(t.lastLine()),null,"+swapLine"):t.replaceRange(i+"\n",h(r,0),null,"+swapLine")}t.setSelections(s),t.scrollIntoView()})},m.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),o=[],r=t.lastLine()+1,s=n.length-1;0<=s;s--){var i=n[s],l=i.to().line+1,d=i.from().line;0!=i.to().ch||i.empty()||l--,l=c?-1:d.lastIndexOf(r,c-1),-1==m){if(1==p)return;p=1,c=d.length;continue}if(1==p&&mv&&(v=i.length),0>k&&(k=i.length),x=Math.min(v,k),x==i.length)break;if(x==v)++h;else if(! --h){f=b,y=x;break outer}++x}return null==f||l==f&&y==u?void 0:{from:e.Pos(l,u),to:e.Pos(f,y)}}})})},dP58:function(e,t,n){"use strict";function o(){function e(e){return e=e||l,s(p,e)||r("no-app",{name:e}),p[e]}function t(){return Object.keys(p).map(function(e){return p[e]})}function n(e,t){Object.keys(u).forEach(function(n){var o=d(e,n);null===o||m[o]&&m[o](t,e)})}function d(e,t){if("serverAuth"===t)return null;e.options;return t}var p={},u={},m={},h={__esModule:!0,initializeApp:function(e,t){if(void 0===t&&(t={}),"object"!=typeof t||null===t){var o=t;t={name:o}}var i=t;void 0===i.name&&(i.name=l);var d=i.name;"string"==typeof d&&d||r("bad-app-name",{name:d+""}),s(p,d)&&r("duplicate-app",{name:d});var u=new c(e,i,h);return p[d]=u,n(u,"create"),u},app:e,apps:null,Promise:Promise,SDK_VERSION:"5.0.4",INTERNAL:{registerService:function(n,o,s,l,d){u[n]&&r("duplicate-service",{name:n}),u[n]=o,l&&(m[n]=l,t().forEach(function(e){l("create",e)}));var p=function(t){return void 0===t&&(t=e()),"function"!=typeof t[n]&&r("invalid-app-argument",{name:n}),t[n]()};return void 0!==s&&i.deepExtend(p,s),h[n]=p,c.prototype[n]=function(){for(var e=[],t=0;to)throw new gt(ht.INVALID_ARGUMENT,"Function "+e+"() requires between "+n+" and "+(o+" arguments, but was called with ")+U(t.length,"argument")+".")}function S(e,t,n,o){if(!(t instanceof Array)||t.lengthn.indexOf(t))throw new gt(ht.INVALID_ARGUMENT,"Unknown option '"+t+"' passed to function "+e+"(). Available options: "+n.join(", "))})}function F(e,t,n,o){var r=M(o);return new gt(ht.INVALID_ARGUMENT,"Function "+e+"() requires its "+B(n)+" "+("argument to be a "+t+", but it was: "+r))}function B(e){return 1===e?"first":2===e?"second":3===e?"third":e+"th"}function U(e,t){return e+" "+t+(1===e?"":"s")}function V(e,t){return et?1:0}function q(e,t){return null!==e&&void 0!==e?!!(t&&e.isEqual(t)):e===t}function j(e,t){if(e.length!==t.length)return!1;for(var n=0;nt?1:e===t?0:isNaN(e)?isNaN(t)?0:-1:1}function X(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function Q(e){return null===e||void 0===e}function J(e){return nn(e)&&e<=tn&&e>=en}function $(e,t,n){if(n.isEqual(Vt.INSTANCE)){if(t!==rn.EQUAL)throw new gt(ht.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on null.");return new sn(e)}if(n.isEqual(zt.NAN)){if(t!==rn.EQUAL)throw new gt(ht.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on NaN.");return new ln(e)}return new an(e,t,n)}function Y(e){return e===ht.OK?d("Treated status OK as error"):e===ht.CANCELLED||e===ht.UNKNOWN||e===ht.DEADLINE_EXCEEDED||e===ht.RESOURCE_EXHAUSTED||e===ht.INTERNAL||e===ht.UNAVAILABLE||e===ht.UNAUTHENTICATED?!1:e===ht.INVALID_ARGUMENT||e===ht.NOT_FOUND||e===ht.ALREADY_EXISTS||e===ht.PERMISSION_DENIED||e===ht.FAILED_PRECONDITION||e===ht.ABORTED||e===ht.OUT_OF_RANGE||e===ht.UNIMPLEMENTED||e===ht.DATA_LOSS||d("Unknown status code: "+e)}function Z(e){var t=In[e];return void 0===t?void 0:ee(t)}function ee(e){return void 0===e?(s("GRPC error has no .code"),ht.UNKNOWN):e===In.OK?ht.OK:e===In.CANCELLED?ht.CANCELLED:e===In.UNKNOWN?ht.UNKNOWN:e===In.DEADLINE_EXCEEDED?ht.DEADLINE_EXCEEDED:e===In.RESOURCE_EXHAUSTED?ht.RESOURCE_EXHAUSTED:e===In.INTERNAL?ht.INTERNAL:e===In.UNAVAILABLE?ht.UNAVAILABLE:e===In.UNAUTHENTICATED?ht.UNAUTHENTICATED:e===In.INVALID_ARGUMENT?ht.INVALID_ARGUMENT:e===In.NOT_FOUND?ht.NOT_FOUND:e===In.ALREADY_EXISTS?ht.ALREADY_EXISTS:e===In.PERMISSION_DENIED?ht.PERMISSION_DENIED:e===In.FAILED_PRECONDITION?ht.FAILED_PRECONDITION:e===In.ABORTED?ht.ABORTED:e===In.OUT_OF_RANGE?ht.OUT_OF_RANGE:e===In.UNIMPLEMENTED?ht.UNIMPLEMENTED:e===In.DATA_LOSS?ht.DATA_LOSS:d("Unknown status code: "+e)}function te(e){return void 0===e?In.OK:e===ht.OK?In.OK:e===ht.CANCELLED?In.CANCELLED:e===ht.UNKNOWN?In.UNKNOWN:e===ht.DEADLINE_EXCEEDED?In.DEADLINE_EXCEEDED:e===ht.RESOURCE_EXHAUSTED?In.RESOURCE_EXHAUSTED:e===ht.INTERNAL?In.INTERNAL:e===ht.UNAVAILABLE?In.UNAVAILABLE:e===ht.UNAUTHENTICATED?In.UNAUTHENTICATED:e===ht.INVALID_ARGUMENT?In.INVALID_ARGUMENT:e===ht.NOT_FOUND?In.NOT_FOUND:e===ht.ALREADY_EXISTS?In.ALREADY_EXISTS:e===ht.PERMISSION_DENIED?In.PERMISSION_DENIED:e===ht.FAILED_PRECONDITION?In.FAILED_PRECONDITION:e===ht.ABORTED?In.ABORTED:e===ht.OUT_OF_RANGE?In.OUT_OF_RANGE:e===ht.UNIMPLEMENTED?In.UNIMPLEMENTED:e===ht.DATA_LOSS?In.DATA_LOSS:d("Unknown status code: "+e)}function ne(e){return 200===e?ht.OK:400===e?ht.INVALID_ARGUMENT:401===e?ht.UNAUTHENTICATED:403===e?ht.PERMISSION_DENIED:404===e?ht.NOT_FOUND:409===e?ht.ABORTED:416===e?ht.OUT_OF_RANGE:429===e?ht.RESOURCE_EXHAUSTED:499===e?ht.CANCELLED:500===e?ht.UNKNOWN:501===e?ht.UNIMPLEMENTED:503===e?ht.UNAVAILABLE:504===e?ht.DEADLINE_EXCEEDED:200<=e&&300>e?ht.OK:400<=e&&500>e?ht.FAILED_PRECONDITION:500<=e&&600>e?ht.INTERNAL:ht.UNKNOWN}function oe(){return Ln}function re(){return _n}function ae(){return On}function ie(){return Mn}function se(e,t){0i||i>t-2)&&d("Invalid encoded resource path: \""+e+"\"");var s=e.charAt(i+1);switch(s){case Vo:var l=e.substring(r,i),p=void 0;0===o.length?p=l:(o+=l,p=o,o=""),n.push(p);break;case qo:o+=e.substring(r,i),o+="\0";break;case jo:o+=e.substring(r,i+1);break;default:d("Invalid encoded resource path: \""+e+"\"");}r=i+2}return new Et(n)}function be(e,t,n,o){c(n=o,"Unexpected schema upgrade from v${fromVersion} to v{toVersion}."),1>n&&1<=o&&(xe(e),ve(e),Se(e),ke(e));var r=So.resolve();return 2>n&&2<=o&&(r=we(t).next(function(e){return Ce(t,e)})),r}function xe(e){e.createObjectStore(Ho.store)}function ve(e){e.createObjectStore(Ko.store,{keyPath:Ko.keyPath}),e.createObjectStore(Go.store,{keyPath:Go.keyPath}),e.createObjectStore(Xo.store)}function ke(e){e.createObjectStore(Jo.store)}function Se(e){var t=e.createObjectStore(Yo.store,{keyPath:Yo.keyPath});t.createIndex(Yo.documentTargetsIndex,Yo.documentTargetsKeyPath,{unique:!0});var n=e.createObjectStore($o.store,{keyPath:$o.keyPath});n.createIndex($o.queryTargetsIndexName,$o.queryTargetsKeyPath,{unique:!0}),e.createObjectStore(Zo.store)}function Ce(e,t){var n=e.store(Zo.store),o=e.store($o.store);return o.count().next(function(e){return t.targetCount=e,n.put(Zo.key,t)})}function we(e){var t=e.store(Zo.store);return t.get(Zo.key).next(function(e){return null==e?(e=new Zo(0,0,hn.MIN.toTimestamp(),0),t.put(Zo.key,e).next(function(){return e})):So.resolve(e)})}function Te(e){return new So(function(t,n){e.onsuccess=function(e){var n=e.target.result;t(n)},e.onerror=function(e){n(e.target.error)}})}function Ee(e){return e instanceof Uint8Array?(c("YES"===process.env.USE_MOCK_PERSISTENCE,"Persisting non-string stream tokens is only supported with mock persistence ."),e.toString()):e}function Ae(e){return Le(e,Go.store)}function Ie(e){return Le(e,Xo.store)}function Ne(e){return Le(e,Ko.store)}function Le(e,t){return e instanceof ar?e.store(t):d("Invalid transaction object provided!")}function _e(e){return De(e,$o.store)}function Oe(e){return De(e,Zo.store)}function Me(e){return De(e,Yo.store)}function De(e,t){return e instanceof ar?e.store(t):d("Invalid transaction object provided!")}function Re(e){return e instanceof ar?e.store(Jo.store):d("Invalid transaction object provided!")}function Pe(e){return e.path.toArray()}function Fe(e){return void 0!==e.documents}function Be(e){if(!e)return new jr;switch(e.type){case"gapi":return new Hr(e.client,e.sessionIndex||"0");case"provider":return e.client;default:throw new gt(ht.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type");}}function Ue(e){return Ve(e,["next","error","complete"])}function Ve(e,t){if("object"!=typeof e||null===e)return!1;for(var n=e,o=0,r=t,i;on.query.docComparator(r,t.doc),"Got added events in wrong order"),r=t.doc,{type:"added",doc:i,oldIndex:-1,newIndex:o++}})}var i=n.oldDocs;return n.docChanges.filter(function(e){return t||e.type!==mo.Metadata}).map(function(t){var o=new ha(e,t.doc.key,t.doc,n.fromCache),r=-1,s=-1;return t.type!==mo.Added&&(r=i.indexOf(t.doc.key),c(0<=r,"Index for document not found"),i=i.delete(t.doc.key)),t.type!==mo.Removed&&(i=i.add(t.doc),s=i.indexOf(t.doc.key)),{type:Ye(t.type),doc:o,oldIndex:r,newIndex:s}})}function Ye(e){return e===mo.Added?"added":e===mo.Modified||e===mo.Metadata?"modified":e===mo.Removed?"removed":d("Unknown change type: "+e)}function Ze(e){e.INTERNAL.registerService("firestore",function(e){return new la(e)},b(Ia))}function et(e){Ze(e)}var tt=Number.POSITIVE_INFINITY,nt=Math.floor,ot=Math.min,rt=Math.max,at=String.fromCharCode;Object.defineProperty(t,"__esModule",{value:!0});var it=function(e){return e&&"object"==typeof e&&"default"in e?e["default"]:e}(n("dP58")),st=n("TUpU"),lt=n("vCxL"),dt=n("IIoC"),ct=it.SDK_VERSION,pt=new st.Logger("@firebase/firestore"),ut;(function(e){e[e.DEBUG=0]="DEBUG",e[e.ERROR=1]="ERROR",e[e.SILENT=2]="SILENT"})(ut||(ut={}));var mt=function(){function e(){}return e.setPlatform=function(t){e.platform&&d("Platform already defined"),e.platform=t},e.getPlatform=function(){return e.platform||d("Platform not set"),e.platform},e}(),ht={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},gt=function(e){function t(t,n){var o=e.call(this,n)||this;return o.code=t,o.message=n,o.name="FirebaseError",o.toString=function(){return o.name+": [code="+o.code+"]: "+o.message},o}return lt.__extends(t,e),t}(Error),ft=function(){function e(){}return e.newId=function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="",n=0;20>n;n++)t+=e.charAt(nt(Math.random()*e.length));return c(20===t.length,"Invalid auto ID: "+t),t},e}(),yt=function(){function e(e){K(),this._binaryString=e}return e.fromBase64String=function(t){x("Blob.fromBase64String",arguments,1),C("Blob.fromBase64String","string",1,t),K();try{var n=mt.getPlatform().atob(t);return new e(n)}catch(t){throw new gt(ht.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+t)}},e.fromUint8Array=function(t){if(x("Blob.fromUint8Array",arguments,1),H(),!(t instanceof Uint8Array))throw F("Blob.fromUint8Array","Uint8Array",1,t);var n=Array.prototype.map.call(t,function(e){return at(e)}).join("");return new e(n)},e.prototype.toBase64=function(){return x("Blob.toBase64",arguments,0),K(),mt.getPlatform().btoa(this._binaryString)},e.prototype.toUint8Array=function(){x("Blob.toUint8Array",arguments,0),H();for(var e=new Uint8Array(this._binaryString.length),t=0;te||90t||180t)throw new gt(ht.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(1e9<=t)throw new gt(ht.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(-62135596800>e)throw new gt(ht.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(253402300800<=e)throw new gt(ht.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}return e.now=function(){return e.fromMillis(Date.now())},e.fromDate=function(t){return e.fromMillis(t.getTime())},e.fromMillis=function(t){var n=nt(t/1e3);return new e(n,1e6*(t-1e3*n))},e.prototype.toDate=function(){return new Date(this.toMillis())},e.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},e.prototype._compareTo=function(e){return this.seconds===e.seconds?V(this.nanoseconds,e.nanoseconds):V(this.seconds,e.seconds)},e.prototype.isEqual=function(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds},e.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},e}(),kt=function(){return function(e,t,n,o){this.databaseId=e,this.persistenceKey=t,this.host=n,this.ssl=o}}(),St="(default)",Ct=function(){function e(e,t){this.projectId=e,this.database=t?t:St}return Object.defineProperty(e.prototype,"isDefaultDatabase",{get:function(){return this.database===St},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.projectId===this.projectId&&t.database===this.database},e.prototype.compareTo=function(e){return V(this.projectId,e.projectId)||V(this.database,e.database)},e}(),wt="__name__",Tt=function(){function e(e,t,n){this.init(e,t,n)}return e.prototype.init=function(e,t,n){void 0===t?t=0:t>e.length&&d("offset "+t+" out of range "+e.length),void 0===n?n=e.length-t:n>e.length-t&&d("length "+n+" out of range "+(e.length-t)),this.segments=e,this.offset=t,this.len=n},e.prototype.construct=function(e,t,n){var o=Object.create(Object.getPrototypeOf(this));return o.init(e,t,n),o},Object.defineProperty(e.prototype,"length",{get:function(){return this.len},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){return 0===e.comparator(this,t)},e.prototype.child=function(t){var n=this.segments.slice(this.offset,this.limit());return t instanceof e?t.forEach(function(e){n.push(e)}):"string"==typeof t?n.push(t):d("Unknown parameter type for Path.child(): "+t),this.construct(n)},e.prototype.limit=function(){return this.offset+this.length},e.prototype.popFirst=function(e){return e=void 0===e?1:e,c(this.length>=e,"Can't call popFirst() with less segments"),this.construct(this.segments,this.offset+e,this.length-e)},e.prototype.popLast=function(){return c(!this.isEmpty(),"Can't call popLast() on empty path"),this.construct(this.segments,this.offset,this.length-1)},e.prototype.firstSegment=function(){return c(!this.isEmpty(),"Can't call firstSegment() on empty path"),this.segments[this.offset]},e.prototype.lastSegment=function(){return c(!this.isEmpty(),"Can't call lastSegment() on empty path"),this.segments[this.limit()-1]},e.prototype.get=function(e){return c(ei)return 1}return e.lengtht.length?1:0},e}(),Et=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return lt.__extends(t,e),t.prototype.canonicalString=function(){return this.toArray().join("/")},t.prototype.toString=function(){return this.canonicalString()},t.fromString=function(e){if(0<=e.indexOf("//"))throw new gt(ht.INVALID_ARGUMENT,"Invalid path ("+e+"). Paths must not contain // in them.");var n=e.split("/").filter(function(e){return 0n?t=t.left:0o?n=n.left:(t+=n.left.size+1,n=n.right)}return-1},e.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(e.prototype,"size",{get:function(){return this.root.size},enumerable:!0,configurable:!0}),e.prototype.minKey=function(){return this.root.minKey()},e.prototype.maxKey=function(){return this.root.maxKey()},e.prototype.inorderTraversal=function(e){return this.root.inorderTraversal(e)},e.prototype.forEach=function(e){this.inorderTraversal(function(t,n){return e(t,n),!1})},e.prototype.reverseTraversal=function(e){return this.root.reverseTraversal(e)},e.prototype.getIterator=function(){return new Mt(this.root,null,this.comparator,!1)},e.prototype.getIteratorFrom=function(e){return new Mt(this.root,e,this.comparator,!1)},e.prototype.getReverseIterator=function(){return new Mt(this.root,null,this.comparator,!0)},e.prototype.getReverseIteratorFrom=function(e){return new Mt(this.root,e,this.comparator,!0)},e}(),Mt=function(){function e(e,t,n,o){this.isReverse=o,this.nodeStack=[];for(var r=1;!e.isEmpty();)if(r=t?n(e.key,t):1,o&&(r*=-1),0>r)e=this.isReverse?e.left:e.right;else if(0===r){this.nodeStack.push(e);break}else this.nodeStack.push(e),e=this.isReverse?e.right:e.left}return e.prototype.getNext=function(){c(0n?r.copy(null,null,null,r.left.insert(e,t,o),null):0===n?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,o)),r.fixUp()},e.prototype.removeMin=function(){if(this.left.isEmpty())return e.EMPTY;var t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()},e.prototype.remove=function(t,o){var r=this,n;if(0>o(t,r.key))r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(t,o),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),0===o(t,r.key)){if(r.right.isEmpty())return e.EMPTY;n=r.right.min(),r=r.copy(n.key,n.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(t,o))}return r.fixUp()},e.prototype.isRed=function(){return this.color},e.prototype.fixUp=function(){var e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e},e.prototype.moveRedLeft=function(){var e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e},e.prototype.moveRedRight=function(){var e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e},e.prototype.rotateLeft=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.checkMaxDepth=function(){var e=this.check();return!!(Math.pow(2,e)<=this.size+1)},e.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw d("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed())throw d("Right child of ("+this.key+","+this.value+") is red");var e=this.left.check();if(e!==this.right.check())throw d("Black depths differ");else return e+(this.isRed()?0:1)},e.EMPTY=null,e.RED=!0,e.BLACK=!1,e}(),Rt=function(){function e(){this.size=0}return e.prototype.copy=function(){return this},e.prototype.insert=function(e,t){return new Dt(e,t)},e.prototype.remove=function(){return this},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(){return!1},e.prototype.reverseTraversal=function(){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.isRed=function(){return!1},e.prototype.checkMaxDepth=function(){return!0},e.prototype.check=function(){return 0},e}();Dt.EMPTY=new Rt;var Pt;(function(e){e[e.NullValue=0]="NullValue",e[e.BooleanValue=1]="BooleanValue",e[e.NumberValue=2]="NumberValue",e[e.TimestampValue=3]="TimestampValue",e[e.StringValue=4]="StringValue",e[e.BlobValue=5]="BlobValue",e[e.RefValue=6]="RefValue",e[e.GeoPointValue=7]="GeoPointValue",e[e.ArrayValue=8]="ArrayValue",e[e.ObjectValue=9]="ObjectValue"})(Pt||(Pt={}));var Ft;(function(e){e[e.Default=0]="Default",e[e.Estimate=1]="Estimate",e[e.Previous=2]="Previous"})(Ft||(Ft={}));var Bt=function(){function e(e,t){this.serverTimestampBehavior=e,this.timestampsInSnapshots=t}return e.fromSnapshotOptions=function(t,n){switch(t.serverTimestamps){case"estimate":return new e(Ft.Estimate,n);case"previous":return new e(Ft.Previous,n);case"none":case void 0:return new e(Ft.Default,n);default:return d("fromSnapshotOptions() called with invalid options.");}},e}(),Ut=function(){function e(){}return e.prototype.toString=function(){var e=this.value();return null===e?"null":e.toString()},e.prototype.defaultCompareTo=function(e){c(this.typeOrder!==e.typeOrder,"Default compareTo should not be used for values of same type.");var t=V(this.typeOrder,e.typeOrder);return t},e}(),Vt=function(e){function t(){var t=e.call(this)||this;return t.typeOrder=Pt.NullValue,t.internalValue=null,t}return lt.__extends(t,e),t.prototype.value=function(){return null},t.prototype.isEqual=function(e){return e instanceof t},t.prototype.compareTo=function(e){return e instanceof t?0:this.defaultCompareTo(e)},t.INSTANCE=new t,t}(Ut),qt=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.BooleanValue,n}return lt.__extends(t,e),t.prototype.value=function(){return this.internalValue},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue===e.internalValue},t.prototype.compareTo=function(e){return e instanceof t?V(this,e):this.defaultCompareTo(e)},t.of=function(e){return e?t.TRUE:t.FALSE},t.TRUE=new t(!0),t.FALSE=new t(!1),t}(Ut),jt=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.NumberValue,n}return lt.__extends(t,e),t.prototype.value=function(){return this.internalValue},t.prototype.compareTo=function(e){return e instanceof t?G(this.internalValue,e.internalValue):this.defaultCompareTo(e)},t}(Ut),Wt=function(e){function t(t){return e.call(this,t)||this}return lt.__extends(t,e),t.prototype.isEqual=function(e){return!!(e instanceof t)&&X(this.internalValue,e.internalValue)},t}(jt),zt=function(e){function t(t){var n=e.call(this,t)||this;return n.internalValue=t,n}return lt.__extends(t,e),t.prototype.isEqual=function(e){return!!(e instanceof t)&&X(this.internalValue,e.internalValue)},t.NAN=new t(NaN),t.POSITIVE_INFINITY=new t(Infinity),t.NEGATIVE_INFINITY=new t(-Infinity),t}(jt),Ht=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.StringValue,n}return lt.__extends(t,e),t.prototype.value=function(){return this.internalValue},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue===e.internalValue},t.prototype.compareTo=function(e){return e instanceof t?V(this.internalValue,e.internalValue):this.defaultCompareTo(e)},t}(Ut),Kt=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.TimestampValue,n}return lt.__extends(t,e),t.prototype.value=function(e){return e&&e.timestampsInSnapshots?this.internalValue:this.internalValue.toDate()},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue.isEqual(e.internalValue)},t.prototype.compareTo=function(e){return e instanceof t?this.internalValue._compareTo(e.internalValue):e instanceof Gt?-1:this.defaultCompareTo(e)},t}(Ut),Gt=function(e){function t(t,n){var o=e.call(this)||this;return o.localWriteTime=t,o.previousValue=n,o.typeOrder=Pt.TimestampValue,o}return lt.__extends(t,e),t.prototype.value=function(e){return e&&e.serverTimestampBehavior===Ft.Estimate?new Kt(this.localWriteTime).value(e):e&&e.serverTimestampBehavior===Ft.Previous?this.previousValue?this.previousValue.value(e):null:null},t.prototype.isEqual=function(e){return e instanceof t&&this.localWriteTime.isEqual(e.localWriteTime)},t.prototype.compareTo=function(e){return e instanceof t?this.localWriteTime._compareTo(e.localWriteTime):e instanceof Kt?1:this.defaultCompareTo(e)},t.prototype.toString=function(){return""},t}(Ut),Xt=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.BlobValue,n}return lt.__extends(t,e),t.prototype.value=function(){return this.internalValue},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue.isEqual(e.internalValue)},t.prototype.compareTo=function(e){return e instanceof t?this.internalValue._compareTo(e.internalValue):this.defaultCompareTo(e)},t}(Ut),Qt=function(e){function t(t,n){var o=e.call(this)||this;return o.databaseId=t,o.key=n,o.typeOrder=Pt.RefValue,o}return lt.__extends(t,e),t.prototype.value=function(){return this.key},t.prototype.isEqual=function(e){return!!(e instanceof t)&&this.key.isEqual(e.key)&&this.databaseId.isEqual(e.databaseId)},t.prototype.compareTo=function(e){if(e instanceof t){var n=this.databaseId.compareTo(e.databaseId);return 0===n?Nt.comparator(this.key,e.key):n}return this.defaultCompareTo(e)},t}(Ut),Jt=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.GeoPointValue,n}return lt.__extends(t,e),t.prototype.value=function(){return this.internalValue},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue.isEqual(e.internalValue)},t.prototype.compareTo=function(e){return e instanceof t?this.internalValue._compareTo(e.internalValue):this.defaultCompareTo(e)},t}(Ut),$t=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.ObjectValue,n}return lt.__extends(t,e),t.prototype.value=function(e){var t={};return this.internalValue.inorderTraversal(function(n,o){t[n]=o.value(e)}),t},t.prototype.forEach=function(e){this.internalValue.inorderTraversal(e)},t.prototype.isEqual=function(e){if(e instanceof t){for(var n=this.internalValue.getIterator(),o=e.internalValue.getIterator();n.hasNext()&&o.hasNext();){var r=n.getNext(),i=o.getNext();if(r.key!==i.key||!r.value.isEqual(i.value))return!1}return!n.hasNext()&&!o.hasNext()}return!1},t.prototype.compareTo=function(e){if(e instanceof t){for(var n=this.internalValue.getIterator(),o=e.internalValue.getIterator();n.hasNext()&&o.hasNext();){var r=n.getNext(),i=o.getNext(),s=V(r.key,i.key)||r.value.compareTo(i.value);if(s)return s}return V(n.hasNext(),o.hasNext())}return this.defaultCompareTo(e)},t.prototype.set=function(e,n){if(c(!e.isEmpty(),"Cannot set field for empty path on ObjectValue"),1===e.length)return this.setChild(e.firstSegment(),n);var o=this.child(e.firstSegment());o instanceof t||(o=t.EMPTY);var r=o.set(e.popFirst(),n);return this.setChild(e.firstSegment(),r)},t.prototype.delete=function(e){if(c(!e.isEmpty(),"Cannot delete field for empty path on ObjectValue"),1===e.length)return new t(this.internalValue.remove(e.firstSegment()));var n=this.child(e.firstSegment());if(n instanceof t){var o=n.delete(e.popFirst());return new t(this.internalValue.insert(e.firstSegment(),o))}return this},t.prototype.contains=function(e){return void 0!==this.field(e)},t.prototype.field=function(e){c(!e.isEmpty(),"Can't get field of empty path");var n=this;return e.forEach(function(e){n=n instanceof t?n.internalValue.get(e)||void 0:void 0}),n},t.prototype.toString=function(){return JSON.stringify(this.value())},t.prototype.child=function(e){return this.internalValue.get(e)||void 0},t.prototype.setChild=function(e,n){return new t(this.internalValue.insert(e,n))},t.EMPTY=new t(new Ot(V)),t}(Ut),Yt=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=Pt.ArrayValue,n}return lt.__extends(t,e),t.prototype.value=function(e){return this.internalValue.map(function(t){return t.value(e)})},t.prototype.forEach=function(e){this.internalValue.forEach(e)},t.prototype.isEqual=function(e){if(e instanceof t){if(this.internalValue.length!==e.internalValue.length)return!1;for(var n=0;n="===t?e.GREATER_THAN_OR_EQUAL:">"===t?e.GREATER_THAN:"array-contains"===t?e.ARRAY_CONTAINS:d("Unknown relation: "+t)},e.prototype.toString=function(){return this.name},e.prototype.isEqual=function(e){return this.name===e.name},e.LESS_THAN=new e("<"),e.LESS_THAN_OR_EQUAL=new e("<="),e.EQUAL=new e("=="),e.GREATER_THAN=new e(">"),e.GREATER_THAN_OR_EQUAL=new e(">="),e.ARRAY_CONTAINS=new e("array-contains"),e}(),an=function(){function e(e,t,n){this.field=e,this.op=t,this.value=n}return e.prototype.matches=function(e){if(this.field.isKeyField()){c(this.value instanceof Qt,"Comparing on key, but filter value not a RefValue"),c(this.op!==rn.ARRAY_CONTAINS,"array-contains queries don't make sense on document keys.");var t=this.value,n=Nt.comparator(e.key,t.key);return this.matchesComparison(n)}var o=e.field(this.field);return void 0!==o&&this.matchesValue(o)},e.prototype.matchesValue=function(e){var t=this;return this.op===rn.ARRAY_CONTAINS?e instanceof Yt&&void 0!==e.internalValue.find(function(e){return e.isEqual(t.value)}):this.value.typeOrder===e.typeOrder&&this.matchesComparison(e.compareTo(this.value))},e.prototype.matchesComparison=function(e){switch(this.op){case rn.LESS_THAN:return 0>e;case rn.LESS_THAN_OR_EQUAL:return 0>=e;case rn.EQUAL:return 0===e;case rn.GREATER_THAN:return 0=n:0>n},e.prototype.isEqual=function(e){if(null===e)return!1;if(this.before!==e.before||this.position.length!==e.position.length)return!1;for(var t=0;t":o.toString()}),r=this.serviceName+": "+r+" ("+o+").";var i=new eo(o,r);for(var s in t)t.hasOwnProperty(s)&&"_"!==s.slice(-1)&&(i[s]=t[s]);return i},e}(),no=function(){return function(){this.blockSize=-1}}(),oo=function(e){function t(){var t=e.call(this)||this;t.chain_=[],t.buf_=[],t.W_=[],t.pad_=[],t.inbuf_=0,t.total_=0,t.blockSize=64,t.pad_[0]=128;for(var n=1;ns;s++)r[s]=n.charCodeAt(o)<<24|n.charCodeAt(o+1)<<16|n.charCodeAt(o+2)<<8|n.charCodeAt(o+3),o+=4;else for(var s=0;16>s;s++)r[s]=n[o]<<24|n[o+1]<<16|n[o+2]<<8|n[o+3],o+=4;for(var s=16,i;80>s;s++)i=r[s-3]^r[s-8]^r[s-14]^r[s-16],r[s]=4294967295&(i<<1|i>>>31);for(var t=this.chain_[0],l=this.chain_[1],p=this.chain_[2],c=this.chain_[3],d=this.chain_[4],s=0,e,u;80>s;s++){40>s?20>s?(e=c^l&(p^c),u=1518500249):(e=l^p^c,u=1859775393):60>s?(e=l&p|c&(l|p),u=2400959708):(e=l^p^c,u=3395469782);var i=4294967295&(t<<5|t>>>27)+e+d+u+r[s];d=c,c=p,p=4294967295&(l<<30|l>>>2),l=t,t=i}this.chain_[0]=4294967295&this.chain_[0]+t,this.chain_[1]=4294967295&this.chain_[1]+l,this.chain_[2]=4294967295&this.chain_[2]+p,this.chain_[3]=4294967295&this.chain_[3]+c,this.chain_[4]=4294967295&this.chain_[4]+d},t.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var o=t-this.blockSize,r=0,n=this.buf_,i=this.inbuf_;rthis.inbuf_?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var o=this.blockSize-1;56<=o;o--)this.buf_[o]=255&t,t/=256;this.compress_(this.buf_);for(var r=0,o=0;5>o;o++)for(var n=24;0<=n;n-=8)e[r]=255&this.chain_[o]>>n,++r;return e},t}(no),ro=function(){function e(e){this.sendFn=e.sendFn,this.closeFn=e.closeFn}return e.prototype.onOpen=function(e){c(!this.wrappedOnOpen,"Called onOpen on stream twice!"),this.wrappedOnOpen=e},e.prototype.onClose=function(e){c(!this.wrappedOnClose,"Called onClose on stream twice!"),this.wrappedOnClose=e},e.prototype.onMessage=function(e){c(!this.wrappedOnMessage,"Called onMessage on stream twice!"),this.wrappedOnMessage=e},e.prototype.close=function(){this.closeFn()},e.prototype.send=function(e){this.sendFn(e)},e.prototype.callOnOpen=function(){c(void 0!==this.wrappedOnOpen,"Cannot call onOpen because no callback was set"),this.wrappedOnOpen()},e.prototype.callOnClose=function(e){c(void 0!==this.wrappedOnClose,"Cannot call onClose because no callback was set"),this.wrappedOnClose(e)},e.prototype.callOnMessage=function(e){c(void 0!==this.wrappedOnMessage,"Cannot call onMessage because no callback was set"),this.wrappedOnMessage(e)},e}(),ao="Connection",io={BatchGetDocuments:"batchGet",Commit:"commit"},so=function(){function e(e){this.databaseId=e.databaseId,this.pool=new dt.XhrIoPool;var t=e.ssl?"https":"http";this.baseUrl=t+"://"+e.host}return e.prototype.modifyHeadersForRequest=function(e,t){if(t)for(var n in t.authHeaders)t.authHeaders.hasOwnProperty(n)&&(e[n]=t.authHeaders[n]);e["X-Goog-Api-Client"]="gl-js/ fire/"+ct},e.prototype.invokeRPC=function(e,t,n){var o=this,r=this.makeUrl(e);return new Promise(function(s,l){o.pool.getObject(function(c){c.listenOnce(dt.EventType.COMPLETE,function(){try{switch(c.getLastErrorCode()){case dt.ErrorCode.NO_ERROR:var t=c.getResponseJson();i(ao,"XHR received:",JSON.stringify(t)),s(t);break;case dt.ErrorCode.TIMEOUT:i(ao,"RPC \""+e+"\" timed out"),l(new gt(ht.DEADLINE_EXCEEDED,"Request time out"));break;case dt.ErrorCode.HTTP_ERROR:var n=c.getStatus();i(ao,"RPC \""+e+"\" failed with status:",n,"response text:",c.getResponseText()),0>Ao<=e?n|this.generatorId:(n|this.generatorId)-(1<",e),n=this.store.put(e)):(i(nr,"PUT",this.store.name,e,t),n=this.store.put(t,e)),Te(n)},e.prototype.get=function(e){var t=this,n=this.store.get(e);return Te(n).next(function(n){return void 0===n&&(n=null),i(nr,"GET",t.store.name,e,n),n})},e.prototype.delete=function(e){i(nr,"DELETE",this.store.name,e);var t=this.store.delete(e);return Te(t)},e.prototype.count=function(){i(nr,"COUNT",this.store.name);var e=this.store.count();return Te(e)},e.prototype.loadAll=function(e,t){var n=this.cursor(this.options(e,t)),o=[];return this.iterateCursor(n,function(e,t){o.push(t)}).next(function(){return o})},e.prototype.deleteAll=function(e,t){i(nr,"DELETE ALL",this.store.name);var n=this.options(e,t);n.keysOnly=!1;var o=this.cursor(n);return this.iterateCursor(o,function(e,t,n){return n.delete()})},e.prototype.iterate=function(e,t){var n;t?n=e:(n={},t=e);var o=this.cursor(n);return this.iterateCursor(o,t)},e.prototype.iterateCursor=function(e,t){var n=[];return new So(function(o,r){e.onerror=function(e){r(e.target.error)},e.onsuccess=function(e){var r=e.target.result;if(!r)return void o();var i=new rr(r),s=t(r.primaryKey,r.value,i);s instanceof So&&n.push(s),i.isDone?o():null===i.skipToKey?r.continue():r.continue(i.skipToKey)}}).next(function(){return So.waitFor(n)})},e.prototype.options=function(e,t){var n;return void 0!==e&&("string"==typeof e?n=e:(c(void 0===t,"3rd argument must not be defined if 2nd is a range."),t=e)),{index:n,range:t}},e.prototype.cursor=function(e){var t="next";if(e.reverse&&(t="prev"),e.index){var n=this.store.index(e.index);return e.keysOnly?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)},e}(),sr=function(){function e(e,t){this.userId=e,this.serializer=t,this.garbageCollector=null}return e.forUser=function(t,n){c(""!==t.uid,"UserID must not be an empty string.");var o=t.isAuthenticated()?t.uid:"";return new e(o,n)},e.prototype.start=function(t){var n=this;return e.loadNextBatchIdFromDb(t).next(function(e){return n.nextBatchId=e,Ne(t).get(n.userId)}).next(function(e){return e||(e=new Ko(n.userId,Po,"")),n.metadata=e,n.metadata.lastAcknowledgedBatchId>=n.nextBatchId?n.checkEmpty(t).next(function(e){return c(e,"Reset nextBatchID is only possible when the queue is empty"),n.metadata.lastAcknowledgedBatchId=Po,Ne(t).put(n.metadata)}):So.resolve()})},e.loadNextBatchIdFromDb=function(e){var t=Po;return Ae(e).iterate({reverse:!0},function(e,n,o){var r=e[0],i=e[1];if(i>t&&(t=n.batchId),""===r)o.done();else{var s=W(r);o.skip([s])}}).next(function(){return t+1})},e.prototype.checkEmpty=function(e){var t=!0,n=IDBKeyRange.bound(this.keyForBatchId(Number.NEGATIVE_INFINITY),this.keyForBatchId(Number.POSITIVE_INFINITY));return Ae(e).iterate({range:n},function(e,n,o){t=!1,o.done()}).next(function(){return t})},e.prototype.getNextBatchId=function(){return So.resolve(this.nextBatchId)},e.prototype.getHighestAcknowledgedBatchId=function(){return So.resolve(this.metadata.lastAcknowledgedBatchId)},e.prototype.acknowledgeBatch=function(e,t,n){var o=t.batchId;return c(o>this.metadata.lastAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order"),this.metadata.lastAcknowledgedBatchId=o,this.metadata.lastStreamToken=Ee(n),Ne(e).put(this.metadata)},e.prototype.getLastStreamToken=function(){return So.resolve(this.metadata.lastStreamToken)},e.prototype.setLastStreamToken=function(e,t){return this.metadata.lastStreamToken=Ee(t),Ne(e).put(this.metadata)},e.prototype.addMutationBatch=function(e,t,n){var o=this,r=this.nextBatchId;this.nextBatchId++;var i=new Fo(r,t,n),s=this.serializer.toDbMutationBatch(this.userId,i);return Ae(e).put(s).next(function(){for(var t=[],i=0,s=n;i=o,"Should have found mutation after "+o),i=n.serializer.fromDbMutationBatch(t)),r.done()}).next(function(){return i})},e.prototype.getAllMutationBatches=function(e){var t=this,n=IDBKeyRange.bound(this.keyForBatchId(Po),this.keyForBatchId(Number.POSITIVE_INFINITY));return Ae(e).loadAll(n).next(function(e){return e.map(function(e){return t.serializer.fromDbMutationBatch(e)})})},e.prototype.getAllMutationBatchesThroughBatchId=function(e,t){var n=this,o=IDBKeyRange.bound(this.keyForBatchId(Po),this.keyForBatchId(t));return Ae(e).loadAll(o).next(function(e){return e.map(function(e){return n.serializer.fromDbMutationBatch(e)})})},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,t){var n=this,o=Xo.prefixForPath(this.userId,t.path),r=IDBKeyRange.lowerBound(o),i=[];return Ie(e).iterate({range:r},function(o,r,s){var l=o[0],c=o[1],p=o[2],u=ye(c);if(l!==n.userId||!t.path.isEqual(u))return void s.done();var m=n.keyForBatchId(p);return Ae(e).get(m).next(function(e){null===e&&d("Dangling document-mutation reference found: "+o+" which points to "+m),i.push(n.serializer.fromDbMutationBatch(e))})}).next(function(){return i})},e.prototype.getAllMutationBatchesAffectingQuery=function(e,t){var n=this;c(!t.isDocumentQuery(),"Document queries shouldn't go down this path");var o=t.path,r=o.length+1,i=Xo.prefixForPath(this.userId,o),s=IDBKeyRange.lowerBound(i),l=new Nn(V);return Ie(e).iterate({range:s},function(e,t,i){var s=e[0],d=e[1],c=e[2],p=ye(d);return s===n.userId&&o.isPrefixOf(p)?void(p.length!==r||(l=l.add(c))):void i.done()}).next(function(){var t=[],o=[];return l.forEach(function(r){var i=n.keyForBatchId(r);o.push(Ae(e).get(i).next(function(e){null===e&&d("Dangling document-mutation reference found, which points to "+i),t.push(n.serializer.fromDbMutationBatch(e))}))}),So.waitFor(o).next(function(){return t})})},e.prototype.removeMutationBatches=function(e,t){for(var n=Ae(e),o=Ie(e),r=[],i=function(e){var t=IDBKeyRange.only(s.keyForBatchId(e.batchId)),i=0,l=n.iterate({range:t},function(e,t,n){return i++,n.delete()});r.push(l.next(function(){c(1==i,"Dangling document-mutation reference found: Missing batch "+e.batchId)}));for(var d=0,p=e.mutations;dthis.metadata.highestTargetId&&(this.metadata.highestTargetId=e.targetId,t=!0),t},Object.defineProperty(e.prototype,"count",{get:function(){return this.metadata.targetCount},enumerable:!0,configurable:!0}),e.prototype.getQueryData=function(e,t){var n=this,o=t.canonicalId(),r=IDBKeyRange.bound([o,Number.NEGATIVE_INFINITY],[o,tt]),i=null;return _e(e).iterate({range:r,index:$o.queryTargetsIndexName},function(e,o,r){var s=n.serializer.fromDbTarget(o);t.isEqual(s.query)&&(i=s,r.done())}).next(function(){return i})},e.prototype.addMatchingKeys=function(e,t,n){var o=[],r=Me(e);return t.forEach(function(e){var t=he(e.path);o.push(r.put(new Yo(n,t)))}),So.waitFor(o)},e.prototype.removeMatchingKeys=function(e,t,n){var o=this,r=[],i=Me(e);return t.forEach(function(e){var t=he(e.path);r.push(i.delete([n,t])),null!==o.garbageCollector&&o.garbageCollector.addPotentialGarbageKey(e)}),So.waitFor(r)},e.prototype.removeMatchingKeysForTargetId=function(e,t){var n=Me(e),o=IDBKeyRange.bound([t],[t+1],!1,!0);return this.notifyGCForRemovedKeys(e,o).next(function(){return n.delete(o)})},e.prototype.notifyGCForRemovedKeys=function(e,t){var n=this,o=Me(e);return null!==this.garbageCollector&&this.garbageCollector.isEager?o.iterate({range:t,keysOnly:!0},function(e){var t=ye(e[1]),o=new Nt(t);c(null!==n.garbageCollector,"GarbageCollector for query cache set to null during key removal."),n.garbageCollector.addPotentialGarbageKey(o)}):So.resolve()},e.prototype.getMatchingKeysForTargetId=function(e,t){var n=IDBKeyRange.bound([t],[t+1],!1,!0),o=Me(e),r=ie();return o.iterate({range:n,keysOnly:!0},function(e){var t=ye(e[1]),n=new Nt(t);r=r.add(n)}).next(function(){return r})},e.prototype.setGarbageCollector=function(e){this.garbageCollector=e},e.prototype.containsKey=function(e,t){c(null!==e,"Persistence Transaction cannot be null for query cache containsKey");var n=he(t.path),o=IDBKeyRange.bound([n],[z(n)],!1,!0),r=0;return Me(e).iterate({index:Yo.documentTargetsIndex,keysOnly:!0,range:o},function(e,t,n){r++,n.done()}).next(function(){return 0t?(s("Persistence owner-lease is in the future. Discarding.",e),!1):e.ownerId!==this.getZombiedOwnerId())},e.prototype.scheduleOwnerLeaseRefreshes=function(){var e=this;this.ownerLeaseRefreshHandle=setInterval(function(){var t=e.runTransaction("Refresh owner timestamp",function(t){var n=t.store(Ho.store);return n.put("owner",new Ho(e.ownerId,Date.now()))});t.catch(function(t){s(t),e.stopOwnerLeaseRefreshes()})},4e3)},e.prototype.stopOwnerLeaseRefreshes=function(){this.ownerLeaseRefreshHandle&&(clearInterval(this.ownerLeaseRefreshHandle),this.ownerLeaseRefreshHandle=null)},e.prototype.attachWindowUnloadHook=function(){var e=this;"object"==typeof window&&"function"==typeof window.addEventListener&&(this.windowUnloadHandler=function(){e.setZombiedOwnerId(e.ownerId),e.shutdown()},window.addEventListener("unload",this.windowUnloadHandler))},e.prototype.detachWindowUnloadHook=function(){this.windowUnloadHandler&&(c("object"==typeof window&&"function"==typeof window.removeEventListener,"Expected 'window.removeEventListener' to be a function"),window.removeEventListener("unload",this.windowUnloadHandler),this.windowUnloadHandler=null)},e.prototype.getZombiedOwnerId=function(){try{var e=window.localStorage.getItem(this.zombiedOwnerLocalStorageKey());return i(pr,"Zombied ownerID from LocalStorage:",e),e}catch(t){return s("Failed to get zombie owner id.",t),null}},e.prototype.setZombiedOwnerId=function(e){try{null===e?window.localStorage.removeItem(this.zombiedOwnerLocalStorageKey()):window.localStorage.setItem(this.zombiedOwnerLocalStorageKey(),e)}catch(t){s("Failed to set zombie owner id.",t)}},e.prototype.zombiedOwnerLocalStorageKey=function(){return this.localStoragePrefix+"zombiedOwnerId"},e.prototype.generateOwnerId=function(){return ft.newId()},e.MAIN_DATABASE="main",e}(),hr=function(){function e(e,t){this.remoteDocumentCache=e,this.mutationQueue=t}return e.prototype.getDocument=function(e,t){var n=this;return this.remoteDocumentCache.getEntry(e,t).next(function(o){return n.computeLocalDocument(e,t,o)})},e.prototype.getDocuments=function(e,t){var n=this,o=[],r=oe();return t.forEach(function(t){o.push(n.getDocument(e,t).next(function(e){e||(e=new _t(t,hn.forDeletedDoc())),r=r.insert(t,e)}))}),So.waitFor(o).next(function(){return r})},e.prototype.getDocumentsMatchingQuery=function(e,t){return Nt.isDocumentKey(t.path)?this.getDocumentsMatchingDocumentQuery(e,t.path):this.getDocumentsMatchingCollectionQuery(e,t)},e.prototype.getDocumentsMatchingDocumentQuery=function(e,t){return this.getDocument(e,new Nt(t)).next(function(e){var t=re();return e instanceof Lt&&(t=t.insert(e.key,e)),t})},e.prototype.getDocumentsMatchingCollectionQuery=function(e,t){var n=this,o;return this.remoteDocumentCache.getDocumentsMatchingQuery(e,t).next(function(t){return n.computeLocalDocuments(e,t)}).next(function(r){return o=r,n.mutationQueue.getAllMutationBatchesAffectingQuery(e,t)}).next(function(t){for(var r=ie(),i=0,s=t,l;it,"Acknowledged batches can't be rejected."),o})}).next(function(){return t.removeMutationBatch(n,o)}).next(function(e){return r=e,t.mutationQueue.performConsistencyCheck(n)}).next(function(){return t.localDocuments.getDocuments(n,r)})})},e.prototype.getLastStreamToken=function(){var e=this;return this.persistence.runTransaction("Get last stream token",function(t){return e.mutationQueue.getLastStreamToken(t)})},e.prototype.setLastStreamToken=function(e){var t=this;return this.persistence.runTransaction("Set last stream token",function(n){return t.mutationQueue.setLastStreamToken(n,e)})},e.prototype.getLastRemoteSnapshotVersion=function(){return this.queryCache.getLastRemoteSnapshotVersion()},e.prototype.applyRemoteEvent=function(e){var t=this,n=new gr(this.remoteDocuments);return this.persistence.runTransaction("Apply remote event",function(o){var r=[];g(e.targetChanges,function(e,n){var i=t.targetIds[e];if(i){var s=n.mapping;if(s)if(s instanceof Fn)r.push(t.queryCache.removeMatchingKeysForTargetId(o,e).next(function(){return t.queryCache.addMatchingKeys(o,s.documents,e)}));else if(s instanceof Bn)r.push(t.queryCache.removeMatchingKeys(o,s.removedDocuments,e).next(function(){return t.queryCache.addMatchingKeys(o,s.addedDocuments,e)}));else return d("Unknown mapping type: "+JSON.stringify(s));var l=n.resumeToken;0=e.compareTo(t)||y(this.targetIds)},e.prototype.shouldHoldBatchResult=function(e){return!this.isRemoteUpToVersion(e)||0i.version.compareTo(s))&&(i=o.applyToRemoteDocument(r,i,t),i?n.addEntry(i):c(!e,"Mutation batch "+o+" applied to document "+e+" resulted in null"))})}),i},e}(),yr=function(){function e(){this.mutationQueue=[],this.nextBatchId=1,this.highestAcknowledgedBatchId=Po,this.lastStreamToken=p(),this.garbageCollector=null,this.batchesByDocumentKey=new Nn(Eo.compareByKey)}return e.prototype.start=function(){return 0===this.mutationQueue.length&&(this.nextBatchId=1,this.highestAcknowledgedBatchId=Po),c(this.highestAcknowledgedBatchIdthis.highestAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order");var r=this.indexOfExistingBatchId(o,"acknowledged"),i=this.mutationQueue[r];return c(o===i.batchId,"Queue ordering failure: expected batch "+o+", got batch "+i.batchId),c(!i.isTombstone(),"Can't acknowledge a previously removed batch"),this.highestAcknowledgedBatchId=o,this.lastStreamToken=n,So.resolve()},e.prototype.getLastStreamToken=function(){return So.resolve(this.lastStreamToken)},e.prototype.setLastStreamToken=function(e,t){return this.lastStreamToken=t,So.resolve()},e.prototype.addMutationBatch=function(e,t,n){c(0!==n.length,"Mutation batches should not be empty");var o=this.nextBatchId;if(this.nextBatchId++,0r?0:r,s;io?o=0:o>=n?o=n:o++,So.resolve(this.getAllLiveMutationBatchesBeforeIndex(o))},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,t){var n=this,o=new Eo(t,0),r=new Eo(t,tt),i=[];return this.batchesByDocumentKey.forEachInRange([o,r],function(e){c(t.isEqual(e.key),"Should only iterate over a single key's batches");var o=n.findMutationBatch(e.targetOrBatchId);c(null!==o,"Batches in the index must exist in the main table"),i.push(o)}),So.resolve(i)},e.prototype.getAllMutationBatchesAffectingQuery=function(e,t){var n=this,o=t.path,r=o.length+1,i=o;Nt.isDocumentKey(i)||(i=i.child(""));var s=new Eo(new Nt(i),0),l=new Nn(V);this.batchesByDocumentKey.forEachWhile(function(e){var t=e.key.path;return!!o.isPrefixOf(t)&&(t.length===r&&(l=l.add(e.targetOrBatchId)),!0)},s);var d=[];return l.forEach(function(e){var t=n.findMutationBatch(e);null!==t&&d.push(t)}),So.resolve(d)},e.prototype.removeMutationBatches=function(e,t){var n=t.length;c(0t||t>=this.mutationQueue.length)return null;var n=this.mutationQueue[t];return c(n.batchId===e,"If found batch must match"),n.isTombstone()?null:n},e}(),br=function(){function e(){this.queries=new bo(function(e){return e.canonicalId()}),this.lastRemoteSnapshotVersion=hn.MIN,this.highestTargetId=0,this.references=new To,this.targetCount=0}return e.prototype.start=function(){return So.resolve()},e.prototype.getLastRemoteSnapshotVersion=function(){return this.lastRemoteSnapshotVersion},e.prototype.getHighestTargetId=function(){return this.highestTargetId},e.prototype.setLastRemoteSnapshotVersion=function(e,t){return this.lastRemoteSnapshotVersion=t,So.resolve()},e.prototype.saveQueryData=function(e){this.queries.set(e.query,e);var t=e.targetId;t>this.highestTargetId&&(this.highestTargetId=t)},e.prototype.addQueryData=function(e,t){return c(!this.queries.has(t.query),"Adding a query that already exists"),this.saveQueryData(t),this.targetCount+=1,So.resolve()},e.prototype.updateQueryData=function(e,t){return c(this.queries.has(t.query),"Updating a non-existent query"),this.saveQueryData(t),So.resolve()},e.prototype.removeQueryData=function(e,t){return c(0n.indexOf("Firestore Test Simulated Error")&&setTimeout(function(){throw e},0),e}).then(function(e){return t.operationInProgress=!1,e})});return this.tail=n,n},e.prototype.enqueueAfterDelay=function(e,t,n){var o=this;this.verifyNotFailed(),c(!this.containsDelayedOperation(e),"Attempted to schedule multiple operations with timer id "+e+".");var r=wr.createAndSchedule(this,e,t,n,function(e){return o.removeDelayedOperation(e)});return this.delayedOperations.push(r),r},e.prototype.verifyNotFailed=function(){this.failure&&d("AsyncQueue is already failed: "+(this.failure.stack||this.failure.message))},e.prototype.verifyOperationInProgress=function(){c(this.operationInProgress,"verifyOpInProgress() called when no op in progress on this queue.")},e.prototype.drain=function(){return this.enqueue(function(){return Promise.resolve()})},e.prototype.containsDelayedOperation=function(e){return 0<=this.delayedOperations.findIndex(function(t){return t.timerId===e})},e.prototype.runDelayedOperationsEarly=function(e){var t=this;return this.drain().then(function(){c(e===Cr.All||t.containsDelayedOperation(e),"Attempted to drain to missing operation "+e),t.delayedOperations.sort(function(e,t){return e.targetTimeMs-t.targetTimeMs});for(var n=0,o=t.delayedOperations,r;nthis.maxDelayMs&&(this.currentBaseMs=this.maxDelayMs)},e.prototype.cancel=function(){null!==this.timerPromise&&(this.timerPromise.cancel(),this.timerPromise=null)},e.prototype.jitterDelayMs=function(){return(Math.random()-0.5)*this.currentBaseMs},e}(),Ar;(function(e){e[e.Initial=0]="Initial",e[e.Auth=1]="Auth",e[e.Open=2]="Open",e[e.Error=3]="Error",e[e.Backoff=4]="Backoff",e[e.Stopped=5]="Stopped"})(Ar||(Ar={}));var Ir=function(){function e(e,t,n,o,r){this.queue=e,this.idleTimerId=n,this.connection=o,this.credentialsProvider=r,this.inactivityTimerPromise=null,this.stream=null,this.listener=null,this.backoff=new Er(e,t,1e3,1.5,60000),this.state=Ar.Initial}return e.prototype.isStarted=function(){return this.state===Ar.Backoff||this.state===Ar.Auth||this.state===Ar.Open},e.prototype.isOpen=function(){return this.state===Ar.Open},e.prototype.start=function(e){return this.state===Ar.Error?void this.performBackoff(e):void(c(this.state===Ar.Initial,"Already started"),this.listener=e,this.auth())},e.prototype.stop=function(){this.isStarted()&&this.close(Ar.Stopped)},e.prototype.inhibitBackoff=function(){c(!this.isStarted(),"Can only inhibit backoff in a stopped state"),this.state=Ar.Initial,this.backoff.reset()},e.prototype.markIdle=function(){var e=this;this.isOpen()&&null===this.inactivityTimerPromise&&(this.inactivityTimerPromise=this.queue.enqueueAfterDelay(this.idleTimerId,60000,function(){return e.handleIdleCloseTimer()}))},e.prototype.sendRequest=function(e){this.cancelIdleCheck(),this.stream.send(e)},e.prototype.handleIdleCloseTimer=function(){return lt.__awaiter(this,void 0,void 0,function(){return lt.__generator(this,function(){return this.isOpen()?[2,this.close(Ar.Initial)]:[2]})})},e.prototype.cancelIdleCheck=function(){this.inactivityTimerPromise&&(this.inactivityTimerPromise.cancel(),this.inactivityTimerPromise=null)},e.prototype.close=function(e,t){return lt.__awaiter(this,void 0,void 0,function(){var n;return lt.__generator(this,function(){return c(e===Ar.Error||Q(t),"Can't provide an error when not in an error state."),this.cancelIdleCheck(),this.backoff.cancel(),e===Ar.Error?t&&t.code===ht.RESOURCE_EXHAUSTED&&(s(t.toString()),s("Using maximum backoff delay to prevent overloading the backend."),this.backoff.resetToMax()):this.backoff.reset(),null!==this.stream&&(this.tearDown(),this.stream.close(),this.stream=null),this.state=e,n=this.listener,this.listener=null,e===Ar.Stopped?[2]:[2,n.onClose(t)]})})},e.prototype.tearDown=function(){},e.prototype.auth=function(){var e=this;c(this.state===Ar.Initial,"Must be in initial state to auth"),this.state=Ar.Auth,this.credentialsProvider.getToken(!1).then(function(t){e.startStream(t)},function(t){e.queue.enqueue(function(){return lt.__awaiter(e,void 0,void 0,function(){var e;return lt.__generator(this,function(){return this.state===Ar.Stopped?[2]:(e=new gt(ht.UNKNOWN,"Fetching auth token failed: "+t.message),[2,this.handleStreamClose(e)])})})})})},e.prototype.startStream=function(e){var t=this;if(this.state!==Ar.Stopped){c(this.state===Ar.Auth,"Trying to start stream in a non-auth state");var n=function(e,n){t.queue.enqueue(function(){return lt.__awaiter(t,void 0,void 0,function(){return lt.__generator(this,function(){return this.stream===e?[2,n()]:[2]})})})};if(null!==this.listener){var o=this.startRpc(e);this.stream=o,this.stream.onOpen(function(){n(o,function(){return c(t.state===Ar.Auth,"Expected stream to be in state auth, but was "+t.state),t.state=Ar.Open,t.listener.onOpen()})}),this.stream.onClose(function(e){n(o,function(){return t.handleStreamClose(e)})}),this.stream.onMessage(function(e){n(o,function(){return t.onMessage(e)})})}}},e.prototype.performBackoff=function(e){var t=this;c(this.state===Ar.Error,"Should only perform backoff in an error case"),this.state=Ar.Backoff,this.backoff.backoffAndRun(function(){return lt.__awaiter(t,void 0,void 0,function(){return lt.__generator(this,function(){return this.state===Ar.Stopped?[2]:(this.state=Ar.Initial,this.start(e),c(this.isStarted(),"PersistentStream should have started"),[2])})})})},e.prototype.handleStreamClose=function(e){return c(this.isStarted(),"Can't handle server close on non-started stream"),i("PersistentStream","close with error: "+e),this.stream=null,this.close(Ar.Error,e)},e}(),Nr=function(e){function t(t,n,o,r){var i=e.call(this,t,Cr.ListenStreamConnectionBackoff,Cr.ListenStreamIdle,n,o)||this;return i.serializer=r,i}return lt.__extends(t,e),t.prototype.startRpc=function(e){return this.connection.openStream("Listen",e)},t.prototype.onMessage=function(e){this.backoff.reset();var t=this.serializer.fromWatchChange(e),n=this.serializer.versionFromListenResponse(e);return this.listener.onWatchChange(t,n)},t.prototype.watch=function(e){var t={database:this.serializer.encodedDatabaseId,addTarget:this.serializer.toTarget(e)},n=this.serializer.toListenRequestLabels(e);n&&(t.labels=n),this.sendRequest(t)},t.prototype.unwatch=function(e){var t={};t.database=this.serializer.encodedDatabaseId,t.removeTarget=e,this.sendRequest(t)},t}(Ir),Lr=function(e){function t(t,n,o,r){var i=e.call(this,t,Cr.WriteStreamConnectionBackoff,Cr.WriteStreamIdle,n,o)||this;return i.serializer=r,i.handshakeComplete_=!1,i}return lt.__extends(t,e),Object.defineProperty(t.prototype,"handshakeComplete",{get:function(){return this.handshakeComplete_},enumerable:!0,configurable:!0}),t.prototype.start=function(t){this.handshakeComplete_=!1,e.prototype.start.call(this,t)},t.prototype.tearDown=function(){this.handshakeComplete_&&this.writeMutations([])},t.prototype.startRpc=function(e){return this.connection.openStream("Write",e)},t.prototype.onMessage=function(e){if(c(!!e.streamToken,"Got a write response without a stream token"),this.lastStreamToken=e.streamToken,!this.handshakeComplete_)return c(!e.writeResults||0===e.writeResults.length,"Got mutation results for handshake"),this.handshakeComplete_=!0,this.listener.onHandshakeComplete();this.backoff.reset();var t=this.serializer.fromWriteResults(e.writeResults),n=this.serializer.fromVersion(e.commitTime);return this.listener.onMutationResult(n,t)},t.prototype.writeHandshake=function(){c(this.isOpen(),"Writing handshake requires an opened stream"),c(!this.handshakeComplete_,"Handshake already completed");var e={};e.database=this.serializer.encodedDatabaseId,this.sendRequest(e)},t.prototype.writeMutations=function(e){var t=this;c(this.isOpen(),"Writing mutations requires an opened stream"),c(this.handshakeComplete_,"Handshake must be complete before writing mutations"),c(0=Mr&&(this.clearOnlineStateTimer(),this.logClientOfflineWarningIfNecessary("Connection failed "+Mr+" "+("times. Most recent error: "+e.toString())),this.setAndBroadcast(uo.Offline)))},e.prototype.set=function(e){this.clearOnlineStateTimer(),this.watchStreamFailures=0,e===uo.Online&&(this.shouldWarnClientIsOffline=!1),this.setAndBroadcast(e)},e.prototype.setAndBroadcast=function(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))},e.prototype.logClientOfflineWarningIfNecessary=function(e){var t="Could not reach Cloud Firestore backend. "+e+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.shouldWarnClientIsOffline?(s(t),this.shouldWarnClientIsOffline=!1):i("OnlineStateTracker",t)},e.prototype.clearOnlineStateTimer=function(){null!==this.onlineStateTimer&&(this.onlineStateTimer.cancel(),this.onlineStateTimer=null)},e}(),Pr="RemoteStore",Fr=function(){function e(e,t,n,o){this.localStore=e,this.datastore=t,this.pendingWrites=[],this.lastBatchSeen=Po,this.listenTargets={},this.pendingTargetResponses={},this.accumulatedWatchChanges=[],this.watchStream=null,this.writeStream=null,this.onlineStateTracker=new Rr(n,o)}return e.prototype.start=function(){return this.enableNetwork()},e.prototype.isNetworkEnabled=function(){return c(null==this.watchStream==(null==this.writeStream),"WatchStream and WriteStream should both be null or non-null"),null!=this.watchStream},e.prototype.enableNetwork=function(){var e=this;return this.isNetworkEnabled()?Promise.resolve():(this.watchStream=this.datastore.newPersistentWatchStream(),this.writeStream=this.datastore.newPersistentWriteStream(),this.localStore.getLastStreamToken().then(function(t){return e.writeStream.lastStreamToken=t,e.shouldStartWatchStream()?e.startWatchStream():e.onlineStateTracker.set(uo.Unknown),e.fillWritePipeline()}))},e.prototype.disableNetwork=function(){return lt.__awaiter(this,void 0,void 0,function(){return lt.__generator(this,function(){return this.disableNetworkInternal(),this.onlineStateTracker.set(uo.Offline),[2]})})},e.prototype.disableNetworkInternal=function(){this.isNetworkEnabled()&&(this.watchStream.stop(),this.writeStream.stop(),this.cleanUpWatchStreamState(),this.cleanUpWriteStreamState(),this.writeStream=null,this.watchStream=null)},e.prototype.shutdown=function(){return i(Pr,"RemoteStore shutting down."),this.disableNetworkInternal(),this.onlineStateTracker.set(uo.Unknown),Promise.resolve()},e.prototype.listen=function(e){c(!m(this.listenTargets,e.targetId),"listen called with duplicate targetId!"),this.listenTargets[e.targetId]=e,this.shouldStartWatchStream()?this.startWatchStream():this.isNetworkEnabled()&&this.watchStream.isOpen()&&this.sendWatchRequest(e)},e.prototype.unlisten=function(e){c(m(this.listenTargets,e),"unlisten called without assigned target ID!"),delete this.listenTargets[e],this.isNetworkEnabled()&&this.watchStream.isOpen()&&(this.sendUnwatchRequest(e),y(this.listenTargets)&&this.watchStream.markIdle())},e.prototype.sendWatchRequest=function(e){this.recordPendingTargetRequest(e.targetId),this.watchStream.watch(e)},e.prototype.sendUnwatchRequest=function(e){this.recordPendingTargetRequest(e),this.watchStream.unwatch(e)},e.prototype.recordPendingTargetRequest=function(e){this.pendingTargetResponses[e]=(this.pendingTargetResponses[e]||0)+1},e.prototype.startWatchStream=function(){c(this.shouldStartWatchStream(),"startWriteStream() called when shouldStartWatchStream() is false."),this.watchStream.start({onOpen:this.onWatchStreamOpen.bind(this),onClose:this.onWatchStreamClose.bind(this),onWatchChange:this.onWatchStreamChange.bind(this)}),this.onlineStateTracker.handleWatchStreamStart()},e.prototype.shouldStartWatchStream=function(){return this.isNetworkEnabled()&&!this.watchStream.isStarted()&&!y(this.listenTargets)},e.prototype.cleanUpWatchStreamState=function(){this.accumulatedWatchChanges=[],this.pendingTargetResponses={}},e.prototype.onWatchStreamOpen=function(){return lt.__awaiter(this,void 0,void 0,function(){var e=this;return lt.__generator(this,function(){return g(this.listenTargets,function(t,n){e.sendWatchRequest(n)}),[2]})})},e.prototype.onWatchStreamClose=function(e){return lt.__awaiter(this,void 0,void 0,function(){return lt.__generator(this,function(){return c(this.isNetworkEnabled(),"onWatchStreamClose() should only be called when the network is enabled"),this.cleanUpWatchStreamState(),this.shouldStartWatchStream()?(e&&this.onlineStateTracker.handleWatchStreamFailure(e),this.startWatchStream()):this.onlineStateTracker.set(uo.Unknown),[2]})})},e.prototype.onWatchStreamChange=function(e,t){return lt.__awaiter(this,void 0,void 0,function(){var n;return lt.__generator(this,function(){return(this.onlineStateTracker.set(uo.Online),e instanceof jn&&e.state===qn.Removed&&e.cause)?[2,this.handleTargetError(e)]:(this.accumulatedWatchChanges.push(e),!t.isEqual(hn.MIN)&&0<=t.compareTo(this.localStore.getLastRemoteSnapshotVersion())?(n=this.accumulatedWatchChanges,this.accumulatedWatchChanges=[],[2,this.handleWatchChangeBatch(t,n)]):[2])})})},e.prototype.handleWatchChangeBatch=function(e,t){var n=this,o=new Wn(e,this.listenTargets,this.pendingTargetResponses);o.addChanges(t);var r=o.createRemoteEvent();this.pendingTargetResponses=o.pendingTargetResponses;var i=[];return g(o.existenceFilters,function(t,o){var s=n.listenTargets[t];if(s){var l=s.query;if(!l.isDocumentQuery()){var d=n.localStore.remoteDocumentKeys(t).then(function(e){if(r.targetChanges[t]){var i=r.targetChanges[t].mapping;null!==i&&(i instanceof Bn?e=i.applyToKeySet(e):(c(i instanceof Fn,"Expected either reset or update mapping but got something else: "+i),e=i.documents))}if(e.size!==o.count){r.handleExistenceFilterMismatch(t);var d=new fn(l,t,s.purpose);n.listenTargets[t]=d,n.sendUnwatchRequest(t);var p=new fn(l,t,gn.ExistenceFilterMismatch);n.sendWatchRequest(p)}});i.push(d)}else if(0===o.count){var p=new Nt(l.path),u=new _t(p,e);r.addDocumentUpdate(u)}else c(1===o.count,"Single document existence filter with count: "+o.count)}}),Promise.all(i).then(function(){return g(r.targetChanges,function(e,t){if(0() instead."),Yr=/^__.*__$/,Zr=function(){function e(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}return e.prototype.toMutations=function(e,t){var n=[];return null===this.fieldMask?n.push(new Cn(e,this.data,t)):n.push(new wn(e,this.data,this.fieldMask,t)),0=e.docs.size,"Too many documents returned on a document query");var o=e.docs.get(n._key);t.next(new ma(n.firestore,n._key,o,e.fromCache))}},error:o}),i=this._firestoreClient.listen(on.atPath(this._key.path),r,e);return function(){r.mute(),n._firestoreClient.unlisten(i)}},e.prototype.get=function(e){var t=this;return P("DocumentReference.get",e,["source"]),e&&L("DocumentReference.get","options","source",e.source,["default","server","cache"]),new Promise(function(n,o){e&&"cache"===e.source?t.firestore.ensureClientConfigured().getDocumentFromLocalCache(t._key).then(function(e){n(new ma(t.firestore,t._key,e,!0))},o):t.getViaSnapshotListener(n,o,e)})},e.prototype.getViaSnapshotListener=function(e,t,n){var o=this.onSnapshotInternal({includeMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(r){o(),!r.exists&&r.metadata.fromCache?t(new gt(ht.UNAVAILABLE,"Failed to get document because the client is offline.")):r.exists&&r.metadata.fromCache&&n&&"server"===n.source?t(new gt(ht.UNAVAILABLE,"Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \"server\" to retrieve the cached document.)")):e(r)},error:t})},e}(),ua=function(){function e(e,t){this.hasPendingWrites=e,this.fromCache=t}return e.prototype.isEqual=function(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache},e}(),ma=function(){function e(e,t,n,o){this._firestore=e,this._key=t,this._document=n,this._fromCache=o}return e.prototype.data=function(e){return k("DocumentSnapshot.data",arguments,0,1),e=Qe("DocumentSnapshot.data",e),this._document?this.convertObject(this._document.data,Bt.fromSnapshotOptions(e,this._firestore._areTimestampsInSnapshotsEnabled())):void 0},e.prototype.get=function(e,t){if(k("DocumentSnapshot.get",arguments,1,2),t=Qe("DocumentSnapshot.get",t),this._document){var n=this._document.data.field(ze("DocumentSnapshot.get",e));if(void 0!==n)return this.convertValue(n,Bt.fromSnapshotOptions(t,this._firestore._areTimestampsInSnapshotsEnabled()))}},Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new pa(this._key,this._firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"exists",{get:function(){return null!==this._document},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return new ua(null!==this._document&&this._document.hasLocalMutations,this._fromCache)},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){if(!(t instanceof e))throw F("isEqual","DocumentSnapshot",1,t);return this._firestore===t._firestore&&this._fromCache===t._fromCache&&this._key.isEqual(t._key)&&(null===this._document?null===t._document:this._document.isEqual(t._document))},e.prototype.convertObject=function(e,t){var n=this,o={};return e.forEach(function(e,r){o[e]=n.convertValue(r,t)}),o},e.prototype.convertValue=function(e,t){if(e instanceof $t)return this.convertObject(e,t);if(e instanceof Yt)return this.convertArray(e,t);if(e instanceof Qt){var n=e.value(t),o=this._firestore.ensureClientConfigured().databaseId();return e.databaseId.isEqual(o)||s("Document "+this._key.path+" contains a document reference within a different database ("+(e.databaseId.projectId+"/"+e.databaseId.database+") which is not supported. It will be treated as a reference in the current ")+("database ("+o.projectId+"/"+o.database+") instead.")),new pa(n,this._firestore)}return e.value(t)},e.prototype.convertArray=function(e,t){var n=this;return e.internalValue.map(function(e){return n.convertValue(e,t)})},e}(),ha=function(e){function t(t,n,o,r){return e.call(this,t,n,o,r)||this}return lt.__extends(t,e),t.prototype.data=function(t){var n=e.prototype.data.call(this,t);return c("object"==typeof n,"Document in a QueryDocumentSnapshot should exist"),n},t}(ma),ga=function(){function e(e,t){this._query=e,this.firestore=t}return e.prototype.where=function(t,n,o){x("Query.where",arguments,3),C("Query.where","string",2,n),R("Query.where",3,o);var r=ze("Query.where",t),i=rn.fromString(n),s;if(r.isKeyField()){if(i===rn.ARRAY_CONTAINS)throw new gt(ht.INVALID_ARGUMENT,"Invalid Query. You can't perform array-contains queries on FieldPath.documentId() since document IDs are not arrays.");if("string"==typeof o){if(-1!==o.indexOf("/"))throw new gt(ht.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it contains a slash.");if(""===o)throw new gt(ht.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it was an empty string.");var l=this._query.path.child(new Et([o]));c(0==l.length%2,"Path should be a document key"),s=new Qt(this.firestore._databaseId,new Nt(l))}else if(o instanceof pa){s=new Qt(this.firestore._databaseId,o._key)}else throw new gt(ht.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a string or a DocumentReference if the first parameter is FieldPath.documentId(), but it was: "+(M(o)+"."))}else s=this.firestore._dataConverter.parseQueryValue("Query.where",o);var d=$(r,i,s);return this.validateNewFilter(d),new e(this._query.addFilter(d),this.firestore)},e.prototype.orderBy=function(t,n){k("Query.orderBy",arguments,1,2),w("Query.orderBy","string",2,n);var o;if(void 0===n||"asc"===n)o=dn.ASCENDING;else if("desc"===n)o=dn.DESCENDING;else throw new gt(ht.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+n+"', expected 'asc' or 'desc'.");if(null!==this._query.startAt)throw new gt(ht.INVALID_ARGUMENT,"Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");if(null!==this._query.endAt)throw new gt(ht.INVALID_ARGUMENT,"Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");var r=ze("Query.orderBy",t),i=new pn(r,o);return this.validateNewOrderBy(i),new e(this._query.addOrderBy(i),this.firestore)},e.prototype.limit=function(t){if(x("Query.limit",arguments,1),C("Query.limit","number",1,t),0>=t)throw new gt(ht.INVALID_ARGUMENT,"Invalid Query. Query limit ("+t+") is invalid. Limit must be positive.");return new e(this._query.withLimit(t),this.firestore)},e.prototype.startAt=function(t){for(var n=[],o=1;oo.length)throw new gt(ht.INVALID_ARGUMENT,"Too many arguments provided to "+e+"(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");for(var r=[],s=0;s, or >=) must be on the same field. But you have inequality filters on '"+t.toString()+"'"+(" and '"+e.field.toString()+"'"));var n=this._query.getFirstOrderByField();null!==n&&this.validateOrderByAndInequalityMatch(e.field,n)}else if(e.op===rn.ARRAY_CONTAINS&&this._query.hasArrayContainsFilter())throw new gt(ht.INVALID_ARGUMENT,"Invalid query. Queries only support a single array-contains filter.")},e.prototype.validateNewOrderBy=function(e){if(null===this._query.getFirstOrderByField()){var t=this._query.getInequalityFilterField();null!==t&&this.validateOrderByAndInequalityMatch(t,e.field)}},e.prototype.validateOrderByAndInequalityMatch=function(e,t){if(!t.isEqual(e))throw new gt(ht.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+e.toString()+"' "+("and so you must also use '"+e.toString()+"' as your first Query.orderBy(), but your first Query.orderBy() ")+("is on field '"+t.toString()+"' instead."))},e}(),fa=function(){function e(e,t,n){this._firestore=e,this._originalQuery=t,this._snapshot=n,this._cachedChanges=null,this._cachedChangesIncludeMetadataChanges=null,this.metadata=new ua(n.hasPendingWrites,n.fromCache)}return Object.defineProperty(e.prototype,"docs",{get:function(){var e=[];return this.forEach(function(t){return e.push(t)}),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return this._snapshot.docs.isEmpty()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!0,configurable:!0}),e.prototype.forEach=function(e,t){var n=this;k("QuerySnapshot.forEach",arguments,1,2),C("QuerySnapshot.forEach","function",1,e),this._snapshot.docs.forEach(function(o){e.call(t,n.convertToDocumentImpl(o))})},Object.defineProperty(e.prototype,"query",{get:function(){return new ga(this._originalQuery,this._firestore)},enumerable:!0,configurable:!0}),e.prototype.docChanges=function(e){P("QuerySnapshot.docChanges",e,["includeMetadataChanges"]),e&&E("QuerySnapshot.docChanges","boolean","includeMetadataChanges",e.includeMetadataChanges);var t=e&&e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new gt(ht.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=$e(this._firestore,t,this._snapshot),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges},e.prototype.isEqual=function(t){if(!(t instanceof e))throw F("isEqual","QuerySnapshot",1,t);return this._firestore===t._firestore&&this._originalQuery.isEqual(t._originalQuery)&&this._snapshot.isEqual(t._snapshot)},e.prototype.convertToDocumentImpl=function(e){return new ha(this._firestore,e.key,e,this.metadata.fromCache)},e}(),ya=["length","forEach","map"].concat("undefined"==typeof Symbol?[]:[Symbol.iterator]);ya.forEach(function(e){try{Object.defineProperty(fa.prototype.docChanges,e,{get:function(){return Ge()}})}catch(e){}});var ba=function(e){function t(t,n){var o=e.call(this,on.atPath(t),n)||this;if(1!=t.length%2)throw new gt(ht.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+(t.canonicalString()+" has "+t.length));return o}return lt.__extends(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this._query.path.popLast();return e.isEmpty()?null:new pa(new Nt(e),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!0,configurable:!0}),t.prototype.doc=function(e){if(k("CollectionReference.doc",arguments,0,1),0===arguments.length&&(e=ft.newId()),C("CollectionReference.doc","string",1,e),""===e)throw new gt(ht.INVALID_ARGUMENT,"Document path must be a non-empty string");var t=Et.fromString(e);return pa.forPath(this._query.path.child(t),this.firestore)},t.prototype.add=function(e){x("CollectionReference.add",arguments,1),C("CollectionReference.add","object",1,e);var t=this.doc();return t.set(e).then(function(){return t})},t}(ga),xa=u(la,"Use firebase.firestore() instead."),va=u(da,"Use firebase.firestore().runTransaction() instead."),ka=u(ca,"Use firebase.firestore().batch() instead."),Sa=u(pa,"Use firebase.firestore().doc() instead."),Ca=u(ma),wa=u(ha),Ta=u(ga),Ea=u(fa),Aa=u(ba,"Use firebase.firestore().collection() instead."),Ia={Firestore:xa,GeoPoint:xt,Timestamp:vt,Blob:bt,Transaction:va,WriteBatch:ka,DocumentReference:Sa,DocumentSnapshot:Ca,Query:Ta,QueryDocumentSnapshot:wa,QuerySnapshot:Ea,CollectionReference:Aa,FieldPath:co,FieldValue:$r,setLogLevel:la.setLogLevel};et(it),t.registerFirestore=et},"ew/s":function(e,t,n){(function(e){e(n("tQq4"),n("4e7A"))})(function(e){"use strict";function t(e,t,n,o,r){e.openDialog?e.openDialog(t,r,{value:o,selectValueOnOpen:!0}):r(prompt(n,o))}function n(e,t){var n=+t;return /^[-+]/.test(t)?e.getCursor().line+n:n-1}e.commands.jumpToLine=function(e){var o=e.getCursor();t(e,"Jump to line: (Use line:column or scroll% syntax)","Jump to line:",o.line+1+":"+o.ch,function(t){if(t){var r;if(r=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(n(e,r[1]),+r[2]);else if(r=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var i=Math.round(e.lineCount()*+r[1]/100);/^[-+]/.test(r[1])&&(i=o.line+i+1),e.setCursor(i-1,o.ch)}else(r=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(n(e,r[1]),o.ch)}})},e.keyMap["default"]["Alt-G"]="jumpToLine"})},gPKv:function(e,t,n){(function(e){e(n("tQq4"))})(function(e){"use strict";function t(e){for(var t=0;tr)return v(o)?e.stylize(RegExp.prototype.toString.call(o),"regexp"):e.stylize("[Object]","special");e.seen.push(o);var n;return n=T?p(e,o,r,y,f):f.map(function(t){return u(e,o,r,y,t,T)}),e.seen.pop(),m(n,k,E)}function d(e,t){if(x(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,"\"")+"'";return e.stylize(n,"string")}return f(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,o,r){for(var s=[],d=0,i=t.length;de.seen.indexOf(c.value)?(d=y(n)?l(e,c.value,null):l(e,c.value,n-1),-1e?"0"+e.toString(10):e.toString(10)}function A(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":");return[e.getDate(),O[e.getMonth()],t].join(" ")}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var N=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],n=0;n=i)return e;switch(e){case"%s":return r[n++]+"";case"%d":return+r[n++];case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e;}}),l=r[n];n*\/]/.test(n)?o(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?o("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?o(null,n):("u"==n||"U"==n)&&e.match(/rl(-prefix)?\(/i)||("d"==n||"D"==n)&&e.match("omain(",!0,!0)||("r"==n||"R"==n)&&e.match("egexp(",!0,!0)?(e.backUp(1),t.tokenize=s,o("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),o("property","word")):o(null,null)}function i(e){return function(t,n){for(var r=!1,i;null!=(i=t.next());){if(i==e&&!r){")"==e&&t.backUp(1);break}r=!r&&"\\"==i}return i!=e&&(r||")"==e)||(n.tokenize=null),o("string","string")}}function s(e,t){return e.next(),t.tokenize=e.match(/\s*[\"\')]/,!1)?null:i(")"),o(null,"(")}function l(e,t,n){this.type=e,this.indent=t,this.prev=n}function d(e,t,n,o){return e.context=new l(n,t.indentation()+(!1===o?0:g),e.context),n}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function p(e,t,n){return L[n.context.type](e,t,n)}function u(e,t,o,r){for(var n=r||1;0=this.size-(this.bMin+I+this.bGutterSize)&&(e=this.size-(this.bMin+this.bGutterSize)),g.call(this,e),u.onDrag&&u.onDrag())}function y(){var e=t.getComputedStyle(this.parent),n=this.parent[R]-parseFloat(e[B]||0)-parseFloat(e[U]||0);this.size=this.a[r]()[D]+this.b[r]()[D]+this.aGutterSize+this.bGutterSize,this.percentage=Math.min(100*(this.size/n),100),this.start=this.a[r]()[F]}function x(){var e=this,n=e.a,r=e.b;e.dragging&&u.onDragEnd&&u.onDragEnd(),e.dragging=!1,t[o]("mouseup",e.stop),t[o]("touchend",e.stop),t[o]("touchcancel",e.stop),e.parent[o]("mousemove",e.move),e.parent[o]("touchmove",e.move),delete e.stop,delete e.move,n[o]("selectstart",i),n[o]("dragstart",i),r[o]("selectstart",i),r[o]("dragstart",i),n.style.userSelect="",n.style.webkitUserSelect="",n.style.MozUserSelect="",n.style.pointerEvents="",r.style.userSelect="",r.style.webkitUserSelect="",r.style.MozUserSelect="",r.style.pointerEvents="",e.gutter.style.cursor="",e.parent.style.cursor=""}function b(o){var e=this,r=e.a,s=e.b;!e.dragging&&u.onDragStart&&u.onDragStart(),o.preventDefault(),e.dragging=!0,e.move=f.bind(e),e.stop=x.bind(e),t[n]("mouseup",e.stop),t[n]("touchend",e.stop),t[n]("touchcancel",e.stop),e.parent[n]("mousemove",e.move),e.parent[n]("touchmove",e.move),r[n]("selectstart",i),r[n]("dragstart",i),s[n]("selectstart",i),s[n]("dragstart",i),r.style.userSelect="none",r.style.webkitUserSelect="none",r.style.MozUserSelect="none",r.style.pointerEvents="none",s.style.userSelect="none",s.style.webkitUserSelect="none",s.style.MozUserSelect="none",s.style.pointerEvents="none",e.gutter.style.cursor=L,e.parent.style.cursor=L,y.call(e)}function v(e){e.forEach(function(t,n){if(0e;e++)n.execCommand("goCharRight");else if("surround"==x){for(var t=n.getSelections(),e=0;ee&&e.default?e.default:e;let i=r(n("JkW7"));if("function"==typeof i){let e=document.body.firstElementChild;!1,(()=>{let t=r(n("JkW7"));e=(0,o.render)((0,o.h)(t),document.body,e)})()}},q6qL:function(e,t,n){(function(t,o){e.exports=o(n("KM04"))})(this,function(e){"use strict";var t=function(){function e(e){this.value=e}function t(t){function n(r,i){try{var s=t[r](i),l=s.value;l instanceof e?Promise.resolve(l.value).then(function(e){n("next",e)},function(e){n("throw",e)}):o(s.done?"return":"normal",s.value)}catch(e){o("throw",e)}}function o(e,t){"return"===e?r.resolve({value:t,done:!0}):"throw"===e?r.reject(t):r.resolve({value:t,done:!1}),r=r.next,r?n(r.key,r.arg):i=null}var r,i;this._invoke=function(e,t){return new Promise(function(o,s){var l={key:e,arg:t,resolve:o,reject:s,next:null};i?i=i.next=l:(r=i=l,n(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}return"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)},{wrap:function(e){return function(){return new t(e.apply(this,arguments))}},await:function(t){return new e(t)}}}(),n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e},i=function(t){function i(){return n(this,i),r(this,t.apply(this,arguments))}return o(i,t),i.prototype.componentDidUpdate=function(e){for(var t in e)if(e[t]!==this.props[t])return setTimeout(this.renderLayer)},i.prototype.componentDidMount=function(){this.isMounted=!0,this.renderLayer=this.renderLayer.bind(this),this.renderLayer()},i.prototype.componentWillUnmount=function(){this.renderLayer(!1),this.isMounted=!1,this.remote&&this.remote.parentNode.removeChild(this.remote)},i.prototype.findNode=function(e){return"string"==typeof e?document.querySelector(e):e},i.prototype.renderLayer=function(){var t=0"))return r("=>","operator");if("0"==n&&e.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return r("number","number");if(/\d/.test(n))return e.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),r("number","number");if("/"==n)return e.eat("*")?(t.tokenize=l,l(e,t)):e.eat("/")?(e.skipToEnd(),r("comment","comment")):Be(e,t,1)?(o(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),r("regexp","string-2")):(e.eat("="),r("operator","operator",e.current()));if("`"==n)return t.tokenize=d,d(e,t);if("#"==n)return e.skipToEnd(),r("error","error");if(Ke.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?("!"==n||"="==n)&&e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),r("operator","operator",e.current());if(ze.test(n)){e.eatWhile(ze);var s=e.current();if("."!=t.lastType){if(He.propertyIsEnumerable(s)){var c=He[s];return r(c.type,c.style,s)}if("async"==s&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return r("async","keyword",s)}return r("variable","variable",s)}}function i(e){return function(t,n){var o=!1,i;if(qe&&"@"==t.peek()&&t.match(Ge))return n.tokenize=s,r("jsonld-keyword","meta");for(;null!=(i=t.next())&&(i!=e||o);)o=!o&&"\\"==i;return o||(n.tokenize=s),r("string","string")}}function l(e,t){for(var n=!1,o;o=e.next();){if("/"==o&&n){t.tokenize=s;break}n="*"==o}return r("comment","comment")}function d(e,t){for(var n=!1,o;null!=(o=e.next());){if(!n&&("`"==o||"$"==o&&e.eat("{"))){t.tokenize=s;break}n=!n&&"\\"==o}return r("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(0>n)){if(We){var o=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));o&&(n=o.index)}for(var r=0,i=!1,s=n-1;0<=s;--s){var l=e.string.charAt(s),d=Xe.indexOf(l);if(0<=d&&3>d){if(!r){++s;break}if(0==--r){"("==l&&(i=!0);break}}else if(3<=d&&6>d)++r;else if(ze.test(l))i=!0;else{if(/["'\/]/.test(l))return;if(i&&!r){++s;break}}}i&&!r&&(t.fatArrowAt=s)}}function p(e,t,n,o,r,i){this.indented=e,this.column=t,this.type=n,this.prev=r,this.info=i,null!=o&&(this.align=o)}function u(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var o=e.context;o;o=o.prev)for(var n=o.vars;n;n=n.next)if(n.name==t)return!0}function m(e,t,n,o,r){var i=e.cc;for(Je.state=e,Je.stream=r,Je.marked=null,Je.cc=i,Je.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var s=i.length?i.pop():je?L:I;if(s(n,o)){for(;i.length&&i[i.length-1].lex;)i.pop()();return Je.marked?Je.marked:"variable"==n&&u(e,o)?"variable-2":t}}}function h(){for(var e=arguments.length-1;0<=e;e--)Je.cc.push(arguments[e])}function g(){return h.apply(null,arguments),!0}function f(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function y(e){var t=Je.state;if(Je.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var o=b(e,t.context);if(null!=o)return void(t.context=o)}else if(!f(e,t.localVars))return void(t.localVars=new k(e,t.localVars));n.globalVars&&!f(e,t.globalVars)&&(t.globalVars=new k(e,t.globalVars))}function b(e,t){if(!t)return null;if(t.block){var n=b(e,t.prev);return n?n==t.prev?t:new v(n,t.vars,!0):null}return f(e,t.vars)?t:new v(t.prev,new k(e,t.vars),!1)}function x(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function v(e,t,n){this.prev=e,this.vars=t,this.block=n}function k(e,t){this.name=e,this.next=t}function S(){Je.state.context=new v(Je.state.context,Je.state.localVars,!1),Je.state.localVars=$e}function C(){Je.state.context=new v(Je.state.context,Je.state.localVars,!0),Je.state.localVars=null}function w(){Je.state.localVars=Je.state.context.vars,Je.state.context=Je.state.context.prev}function T(e,t){var n=function(){var n=Je.state,o=n.indented;if("stat"==n.lexical.type)o=n.lexical.indented;else for(var r=n.lexical;r&&")"==r.type&&r.align;r=r.prev)o=r.indented;n.lexical=new p(o,Je.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function E(){var e=Je.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function A(e){function t(n){return n==e?g():";"==e?h():g(t)}return t}function I(e,t){return"var"==e?g(T("vardef",t),de,A(";"),E):"keyword a"==e?g(T("form"),O,I,E):"keyword b"==e?g(T("form"),I,E):"keyword d"==e?Je.stream.match(/^\s*$/,!1)?g():g(T("stat"),D,A(";"),E):"debugger"==e?g(A(";")):"{"==e?g(T("}"),C,$,E,w):";"==e?g():"if"==e?("else"==Je.state.lexical.info&&Je.state.cc[Je.state.cc.length-1]==E&&Je.state.cc.pop()(),g(T("form"),O,I,E,he)):"function"==e?g(ve):"for"==e?g(T("form"),ge,I,E):"class"==e||We&&"interface"==t?(Je.marked="keyword",g(T("form"),Ce,E)):"variable"==e?We&&"declare"==t?(Je.marked="keyword",g(I)):We&&("module"==t||"enum"==t||"type"==t)&&Je.stream.match(/^\s*\w/,!1)?(Je.marked="keyword","enum"==t?g(Re):"type"==t?g(te,A("operator"),te,A(";")):g(T("form"),ce,A("{"),T("}"),$,E,E)):We&&"namespace"==t?(Je.marked="keyword",g(T("form"),L,$,E)):We&&"abstract"==t?(Je.marked="keyword",g(I)):g(T("stat"),z):"switch"==e?g(T("form"),O,A("{"),T("}","switch"),C,$,E,E,w):"case"==e?g(L,A(":")):"default"==e?g(A(":")):"catch"==e?g(T("form"),S,N,I,E,w):"export"==e?g(T("stat"),Ae,E):"import"==e?g(T("stat"),Ne,E):"async"==e?g(I):"@"==t?g(L,I):h(T("stat"),L,A(";"),E)}function N(e){if("("==e)return g(ke,A(")"))}function L(e,t){return M(e,t,!1)}function _(e,t){return M(e,t,!0)}function O(e){return"("==e?g(T(")"),L,A(")"),E):h()}function M(e,t,n){if(Je.state.fatArrowAt==Je.stream.start){var o=n?V:U;if("("==e)return g(S,T(")"),Q(ke,")"),E,A("=>"),o,w);if("variable"==e)return h(S,ce,A("=>"),o,w)}var r=n?P:R;return Qe.hasOwnProperty(e)?g(r):"function"==e?g(ve,r):"class"==e||We&&"interface"==t?(Je.marked="keyword",g(T("form"),Se,E)):"keyword c"==e||"async"==e?g(n?_:L):"("==e?g(T(")"),D,A(")"),E,r):"operator"==e||"spread"==e?g(n?_:L):"["==e?g(T("]"),De,E,r):"{"==e?J(K,"}",null,r):"quasi"==e?h(F,r):"new"==e?g(q(n)):"import"==e?g(L):g()}function D(e){return e.match(/[;\}\)\],]/)?h():h(L)}function R(e,t){return","==e?g(L):P(e,t,!1)}function P(e,t,n){var o=!1==n?R:P,r=!1==n?L:_;return"=>"==e?g(S,n?V:U,w):"operator"==e?/\+\+|--/.test(t)||We&&"!"==t?g(o):We&&"<"==t&&Je.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?g(T(">"),Q(te,">"),E,o):"?"==t?g(L,A(":"),r):g(r):"quasi"==e?h(F,o):";"==e?void 0:"("==e?J(_,")","call",o):"."==e?g(H,o):"["==e?g(T("]"),D,A("]"),E,o):We&&"as"==t?(Je.marked="keyword",g(te,o)):"regexp"==e?(Je.state.lastType=Je.marked="operator",Je.stream.backUp(Je.stream.pos-Je.stream.start-1),g(r)):void 0}function F(e,t){return"quasi"==e?"${"==t.slice(t.length-2)?g(L,B):g(F):h()}function B(e){if("}"==e)return Je.marked="string-2",Je.state.tokenize=d,g(F)}function U(e){return c(Je.stream,Je.state),h("{"==e?I:L)}function V(e){return c(Je.stream,Je.state),h("{"==e?I:_)}function q(e){return function(t){return"."==t?g(e?W:j):"variable"==t&&We?g(ie,e?P:R):h(e?_:L)}}function j(e,t){if("target"==t)return Je.marked="keyword",g(R)}function W(e,t){if("target"==t)return Je.marked="keyword",g(P)}function z(e){return":"==e?g(E,I):h(R,A(";"),E)}function H(e){if("variable"==e)return Je.marked="property",g()}function K(e,t){if("async"==e)return Je.marked="property",g(K);if("variable"==e||"keyword"==Je.style){if(Je.marked="property","get"==t||"set"==t)return g(G);var n;return We&&Je.state.fatArrowAt==Je.stream.start&&(n=Je.stream.match(/^\s*:\s*/,!1))&&(Je.state.fatArrowAt=Je.stream.pos+n[0].length),g(X)}return"number"==e||"string"==e?(Je.marked=qe?"property":Je.style+" property",g(X)):"jsonld-keyword"==e?g(X):We&&x(t)?(Je.marked="keyword",g(K)):"["==e?g(L,Y,A("]"),X):"spread"==e?g(_,X):"*"==t?(Je.marked="keyword",g(K)):":"==e?h(X):void 0}function G(e){return"variable"==e?(Je.marked="property",g(ve)):h(X)}function X(e){return":"==e?g(_):"("==e?h(ve):void 0}function Q(e,t,n){function o(r,i){if(n?-1"),te):void 0}function ne(e){if("=>"==e)return g(te)}function oe(e,t){return"variable"==e||"keyword"==Je.style?(Je.marked="property",g(oe)):"?"==t?g(oe):":"==e?g(te):"["==e?g(L,Y,A("]"),oe):void 0}function re(e,t){return"variable"==e&&Je.stream.match(/^\s*[?:]/,!1)||"?"==t?g(re):":"==e?g(te):h(te)}function ae(e,t){return"<"==t?g(T(">"),Q(te,">"),E,ae):"|"==t||"."==e||"&"==t?g(te):"["==e?g(A("]"),ae):"extends"==t||"implements"==t?(Je.marked="keyword",g(te)):void 0}function ie(e,t){if("<"==t)return g(T(">"),Q(te,">"),E,ae)}function se(){return h(te,le)}function le(e,t){if("="==t)return g(te)}function de(e,t){return"enum"==t?(Je.marked="keyword",g(Re)):h(ce,Y,ue,me)}function ce(e,t){return We&&x(t)?(Je.marked="keyword",g(ce)):"variable"==e?(y(t),g()):"spread"==e?g(ce):"["==e?J(ce,"]"):"{"==e?J(pe,"}"):void 0}function pe(e,t){return"variable"!=e||Je.stream.match(/^\s*:/,!1)?("variable"==e&&(Je.marked="property"),"spread"==e?g(ce):"}"==e?h():g(A(":"),ce,ue)):(y(t),g(ue))}function ue(e,t){if("="==t)return g(_)}function me(e){if(","==e)return g(de)}function he(e,t){if("keyword b"==e&&"else"==t)return g(T("form","else"),I,E)}function ge(e,t){return"await"==t?g(ge):"("==e?g(T(")"),fe,A(")"),E):void 0}function fe(e){return"var"==e?g(de,A(";"),be):";"==e?g(be):"variable"==e?g(ye):h(L,A(";"),be)}function ye(e,t){return"in"==t||"of"==t?(Je.marked="keyword",g(L)):g(R,be)}function be(e,t){return";"==e?g(xe):"in"==t||"of"==t?(Je.marked="keyword",g(L)):h(L,A(";"),xe)}function xe(e){")"!=e&&g(L)}function ve(e,t){return"*"==t?(Je.marked="keyword",g(ve)):"variable"==e?(y(t),g(ve)):"("==e?g(S,T(")"),Q(ke,")"),E,Z,I,w):We&&"<"==t?g(T(">"),Q(se,">"),E,ve):void 0}function ke(e,t){return"@"==t&&g(L,ke),"spread"==e?g(ke):We&&x(t)?(Je.marked="keyword",g(ke)):h(ce,Y,ue)}function Se(e,t){return"variable"==e?Ce(e,t):we(e,t)}function Ce(e,t){if("variable"==e)return y(t),g(we)}function we(e,t){return"<"==t?g(T(">"),Q(se,">"),E,we):"extends"==t||"implements"==t||We&&","==e?("implements"==t&&(Je.marked="keyword"),g(We?te:L,we)):"{"==e?g(T("}"),Te,E):void 0}function Te(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||We&&x(t))&&Je.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Je.marked="keyword",g(Te)):"variable"==e||"keyword"==Je.style?(Je.marked="property",g(We?Ee:ve,Te)):"["==e?g(L,Y,A("]"),We?Ee:ve,Te):"*"==t?(Je.marked="keyword",g(Te)):";"==e?g(Te):"}"==e?g():"@"==t?g(L,Te):void 0}function Ee(e,t){return"?"==t?g(Ee):":"==e?g(te,ue):"="==t?g(_):h(ve)}function Ae(e,t){return"*"==t?(Je.marked="keyword",g(Me,A(";"))):"default"==t?(Je.marked="keyword",g(L,A(";"))):"{"==e?g(Q(Ie,"}"),Me,A(";")):h(I)}function Ie(e,t){return"as"==t?(Je.marked="keyword",g(A("variable"))):"variable"==e?h(_,Ie):void 0}function Ne(e){return"string"==e?g():"("==e?h(L):h(Le,_e,Me)}function Le(e,t){return"{"==e?J(Le,"}"):("variable"==e&&y(t),"*"==t&&(Je.marked="keyword"),g(Oe))}function _e(e){if(","==e)return g(Le,_e)}function Oe(e,t){if("as"==t)return Je.marked="keyword",g(Le)}function Me(e,t){if("from"==t)return Je.marked="keyword",g(L)}function De(e){return"]"==e?g():h(Q(_,"]"))}function Re(){return h(T("form"),ce,A("{"),T("}"),Q(Pe,"}"),E,E)}function Pe(){return h(ce,ue)}function Fe(e,t){return"operator"==e.lastType||","==e.lastType||Ke.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function Be(e,t,n){return t.tokenize==s&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}var Ue=t.indentUnit,Ve=n.statementIndent,qe=n.jsonld,je=n.json||qe,We=n.typescript,ze=n.wordCharacters||/[\w$\xa1-\uffff]/,He=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),o=e("keyword c"),r=e("keyword d"),i=e("operator"),s={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:r,break:r,continue:r,new:e("new"),delete:o,void:o,throw:o,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:s,false:s,null:s,undefined:s,NaN:s,Infinity:s,this:e("this"),class:e("class"),super:e("atom"),yield:o,export:e("export"),import:e("import"),extends:o,await:o}}(),Ke=/[+\-*&%=<>!?|~^@]/,Ge=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Xe="([{}])",Qe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Je={state:null,column:null,marked:null,cc:null},$e=new k("this",new k("arguments",null)),Ye,Ze;return w.lex=!0,E.lex=!0,{startState:function(e){var t={tokenize:s,lastType:"sof",cc:[],lexical:new p((e||0)-Ue,0,"block",!1),localVars:n.localVars,context:n.localVars&&new v(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(!t.lexical.hasOwnProperty("align")&&(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=l&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==Ye?n:(t.lastType="operator"==Ye&&("++"==Ze||"--"==Ze)?"incdec":Ye,m(t,n,Ye,Ze,e))},indent:function(t,o){if(t.tokenize==l)return e.Pass;if(t.tokenize!=s)return 0;var r=o&&o.charAt(0),d=t.lexical,p;if(!/^\s*else\b/.test(o))for(var u=t.cc.length-1,i;0<=u;--u)if(i=t.cc[u],i==E)d=d.prev;else if(i!=he)break;for(;("stat"==d.type||"form"==d.type)&&("}"==r||(p=t.cc[t.cc.length-1])&&(p==R||p==P)&&!/^[,\.=+\-*:?[\(]/.test(o));)d=d.prev;Ve&&")"==d.type&&"stat"==d.prev.type&&(d=d.prev);var c=d.type,m=r==c;return"vardef"==c?d.indented+("operator"==t.lastType||","==t.lastType?d.info.length+1:0):"form"==c&&"{"==r?d.indented:"form"==c?d.indented+Ue:"stat"==c?d.indented+(Fe(t,o)?Ve||Ue:0):"switch"!=d.info||m||!1==n.doubleIndentSwitch?d.align?d.column+(m?0:1):d.indented+(m?0:Ue):d.indented+(/^(?:case|default)\b/.test(o)?Ue:2*Ue)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:je?null:"/*",blockCommentEnd:je?null:"*/",blockCommentContinue:je?null:" * ",lineComment:je?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:je?"json":"javascript",jsonldMode:qe,jsonMode:je,expressionAllowed:Be,skipExpression:function(e){var t=e.cc[e.cc.length-1];(t==L||t==_)&&e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},rbVD:function(e,t,n){var o=Math.max;(function(e){e(n("tQq4"))})(function(e){"use strict";function t(e,t){this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}function n(e,t,n){var o=e.options.hintOptions,r={};for(var i in g)r[i]=g[i];if(o)for(var i in o)void 0!==o[i]&&(r[i]=o[i]);if(n)for(var i in n)void 0!==n[i]&&(r[i]=n[i]);return r.hint.resolve&&(r.hint=r.hint.resolve(e,t)),r}function r(e){return"string"==typeof e?e:e.text}function s(e,t){function n(e,n){var r;r="string"==typeof n?o.hasOwnProperty(n)?o[n]:n:function(e){return n(e,t)},i[e]=r}var o={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(-t.menuSize()+1,!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close},r=e.options.customKeys,i=r?{}:o;if(r)for(var s in r)r.hasOwnProperty(s)&&n(s,r[s]);var l=e.options.extraKeys;if(l)for(var s in l)l.hasOwnProperty(s)&&n(s,l[s]);return i}function i(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function l(n,t){this.completion=n,this.data=t,this.picked=!1;var l=this,d=n.cm,c=this.hints=document.createElement("ul");c.className="CodeMirror-hints",this.selectedHint=t.selectedHint||0;for(var m=t.list,h=0;hc.clientHeight+1,A=d.getScrollInfo();if(0C){c.style.height=C-5+"px",c.style.top=(v=b.bottom-w.top)+"px";var L=d.getCursor();t.from.ch!=L.ch&&(b=d.cursorCoords(L),c.style.left=(x=b.left)+"px",w=c.getBoundingClientRect())}}var _=w.right-S;if(0<_&&(w.right-w.left>S&&(c.style.width=S-5+"px",_-=w.right-w.left-S),c.style.left=(x=b.left-_)+"px"),E)for(var O=c.firstChild;O;O=O.nextSibling)O.style.paddingRight=d.display.nativeBarWidth+"px";if(d.addKeyMap(this.keyMap=s(n,{moveFocus:function(e,t){l.changeActive(l.selectedHint+e,t)},setFocus:function(e){l.changeActive(e)},menuSize:function(){return l.screenAmount()},length:m.length,close:function(){n.close()},pick:function(){l.pick()},data:t})),n.options.closeOnUnfocus){var M;d.on("blur",this.onBlur=function(){M=setTimeout(function(){n.close()},100)}),d.on("focus",this.onFocus=function(){clearTimeout(M)})}return d.on("scroll",this.onScroll=function(){var e=d.getScrollInfo(),t=d.getWrapperElement().getBoundingClientRect(),o=v+A.top-e.top,r=o-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return k||(r+=c.offsetHeight),r<=t.top||r>=t.bottom?n.close():void(c.style.top=o+"px",c.style.left=x+A.left-e.left+"px")}),e.on(c,"dblclick",function(n){var e=i(c,n.target||n.srcElement);e&&null!=e.hintId&&(l.changeActive(e.hintId),l.pick())}),e.on(c,"click",function(o){var e=i(c,o.target||o.srcElement);e&&null!=e.hintId&&(l.changeActive(e.hintId),n.options.completeOnSingleClick&&l.pick())}),e.on(c,"mousedown",function(){setTimeout(function(){d.focus()},20)}),e.signal(t,"select",m[this.selectedHint],c.childNodes[this.selectedHint]),!0}function d(e,t){if(!e.somethingSelected())return t;for(var n=[],o=0;o=this.data.list.length?t=n?this.data.list.length-1:0:0>t&&(t=n?0:this.data.list.length-1),this.selectedHint!=t){var o=this.hints.childNodes[this.selectedHint];o&&(o.className=o.className.replace(" "+u,"")),o=this.hints.childNodes[this.selectedHint=t],o.className+=" "+u,o.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=o.offsetTop+o.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],o)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",{resolve:function(t,n){var o=t.getHelpers(n,"hint"),r;if(o.length){var i=function(e,t,n){function r(o){return o==s.length?t(null):void c(s[o],e,n,function(e){e&&0,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)})},tMLt:function(e,t,n){(function(e){e(n("tQq4"),n("H+g/"))})(function(e){"use strict";function t(e){this.options=e,this.from=this.to=0}function n(e){return!0===e&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function o(e,t){for(var n=e.findMarks(u(t,0),u(t+1,0)),o=0;o=l&&(n=r(i.indicatorOpen))}e.setGutterMarker(t,i.gutter,n),++s})}function s(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){i(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function l(e,t,n){var r=e.state.foldGutter;if(r){var i=r.options;if(n==i.gutter){var s=o(e,t);s?s.clear():e.foldCode(u(t,0),i.rangeFinder)}}}function d(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){s(e)},n.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||20t.to&&(i(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function p(e,t){var n=e.state.foldGutter;if(n){var o=t.line;o>=n.from&&on||n>=t)return i+(t-l);i+=n-l,i+=o-i%o,l=n+1}}function x(e,t){for(var n=0;n=t)return o+s(l,t-r);if(r+=i-o,r+=n-r%n,o=i+1,r>=t)return o}}function S(e){for(;es.length<=e;)es.push(C(es)+" ");return es[e]}function C(e){return e[e.length-1]}function w(e,t){for(var n=[],o=0;on?0o?-1:1;;){if(n==o)return n;var s=(n+o)/2,l=0>i?t(s):r(s);if(l==n)return e(l)?n:o;e(l)?o=l:n=l+i}}function D(e,t,n){var o=this;this.input=n,o.scrollbarFiller=p("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=p("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=u("div",null,"CodeMirror-code"),o.selectionDiv=p("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=p("div",null,"CodeMirror-cursors"),o.measure=p("div",null,"CodeMirror-measure"),o.lineMeasure=p("div",null,"CodeMirror-measure"),o.lineSpace=u("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var r=u("div",[o.lineSpace],"CodeMirror-lines");o.mover=p("div",[r],null,"position: relative"),o.sizer=p("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=p("div",null,null,"position: absolute; height: "+Qi+"px; width: 1px;"),o.gutters=p("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=p("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=p("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),Ai&&8>Ii&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),Ni||Ci&&Bi||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,n.init(o)}function R(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var o=0;;++o){var r=n.children[o],i=r.chunkSize();if(t=e.first&&tz(e,t)?t:e}function X(e,t){return 0>z(e,t)?e:t}function Q(e,t){return l(e.first,s(t,e.first+e.size-1))}function J(e,t){if(t.linen?W(n,R(e,n).text.length):$(t,R(e,t.line).text.length)}function $(e,t){var n=e.ch;return null==n||n>t?W(e.line,t):0>n?W(e.line,0):e}function Y(e,t){for(var n=[],o=0;o=t:i.to>t);(o||(o=[])).push(new te(s,i.from,d?null:i.to))}}return o}function se(e,t,n){var o;if(e)for(var r=0;r=t:i.to>t);if(l||i.from==t&&"bookmark"==s.type&&(!n||i.marker.insertLeft)){var d=null==i.from||(s.inclusiveLeft?i.from<=t:i.fromz(c.to,l.from)||0u)&&(i.inclusiveLeft||u)||p.push({from:c.from,to:l.from}),!(0ge(o,r.marker))&&(o=r.marker);return o}function ye(e){return fe(e,!0)}function be(e){return fe(e,!1)}function xe(e,t){var n=rs&&e.markedSpans,o;if(n)for(var r=0,i;rt)&&(!o||0>ge(o,i.marker))&&(o=i.marker);return o}function ve(e,t,n,o,r){var s=R(e,t),l=rs&&s.markedSpans;if(l)for(var d=0,i;d=u||0>=p&&0<=u)&&(0>=p&&(i.marker.inclusiveRight&&r.inclusiveLeft?0<=z(c.to,n):0=z(c.from,o):0>z(c.from,o))))return!0}}function ke(e){for(var t;t=ye(e);)e=t.find(-1,!0).line;return e}function Se(e){for(var t;t=be(e);)e=t.find(1,!0).line;return e}function Ce(e){for(var t,n;t=be(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function we(e,t){var n=R(e,t),o=ke(n);return n==o?t:U(o)}function Te(e,t){if(t>e.lastLine())return t;var n=R(e,t),o;if(!Ee(e,n))return t;for(;o=be(n);)n=o.find(1,!0).line;return U(n)+1}function Ee(e,t){var n=rs&&t.markedSpans;if(n)for(var o=void 0,r=0;rt.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function _e(e,t,n,o){if(!e)return o(t,n,"ltr",0);for(var r=!1,d=0,i;dt||t==n&&i.to==t)&&(o(l(i.from,t),s(i.to,n),1==i.level?"rtl":"ltr",d),r=!0);r||o(t,n,"ltr")}function Oe(e,t,n){var o;as=null;for(var r=0,i;rt)return r;i.to==t&&(i.from!=i.to&&"before"==n?o=r:as=r),i.from==t&&(i.from!=i.to&&"before"!=n?o=r:as=r)}return null==o?as:o}function Me(e,t){var n=e.order;return null==n&&(n=e.order=is(e.text,t)),n}function De(e,t){return e._handlers&&e._handlers[t]||ss}function Re(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var o=e._handlers,r=o&&o[t];if(r){var i=x(r,n);-1=t.offsetWidth&&2Ii))}var n=ys?p("span","\u200B"):p("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Xe(e){if(null!=bs)return bs;var t=c(e,document.createTextNode("A\u062EA")),n=Ki(t,0,1).getBoundingClientRect(),o=Ki(t,1,2).getBoundingClientRect();return d(e),n&&n.left!=n.right&&(bs=3>o.right-n.right)}function Qe(e){if(null!=us)return us;var t=c(e,p("span","x")),o=t.getBoundingClientRect(),r=Ki(t,0,1).getBoundingClientRect();return us=1e&&l.splice(p,1,e,l[p+1],r),p+=2,i=s(e,r);if(t)if(o.opaque)l.splice(n,p-n,e,"overlay "+t),p=n+2;else for(;ne.options.maxHighlightLength&&et(e.doc.mode,o.state),i=ot(e,t,o);r&&(o.state=r),t.stateAfter=o.save(!r),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=l(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function at(e,t,n){var o=e.doc,r=e.display;if(!o.mode.startState)return new vs(o,!0,t);var i=ut(e,t,n),s=i>o.first&&R(o,i-1).stateAfter,l=s?vs.fromSaved(o,s,i):new vs(o,nt(o.mode),i);return o.iter(i,t,function(n){it(e,n.text,l);var o=l.line;n.stateAfter=o==t-1||0==o%5||o>=r.viewFrom&&or;r++){o&&(o[0]=tt(e,n).mode);var i=e.token(t,n);if(t.pos>t.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}function dt(e,t,n,o){var r=e.doc,i=r.mode,s;t=J(r,t);var l=R(r,t.line),d=at(e,t.line,n),c=new fs(l.text,e.options.tabSize,d),p;for(o&&(p=[]);(o||c.pose.options.maxHighlightLength?(d=!1,l&&it(e,t,o,u.pos),u.pos=t.length,h=null):h=ct(lt(n,u,o.state,m),i),m){var g=m[0].name;g&&(h="m-"+(h?g+" "+h:g))}if(!d||p!=h){for(;cr;--i){if(i<=o.first)return o.first;var d=R(o,i-1),c=d.stateAfter;if(c&&(!n||i+(c instanceof xs?c.lookAhead:0)<=o.modeFrontier))return i;var p=v(d.text,null,e.options.tabSize);(null==l||s>p)&&(l=i-1,s=p)}return l}function mt(e,t){if(e.modeFrontier=s(e.modeFrontier,t),!(e.highlightFrontiern;o--)if(r=R(e,o).stateAfter,r&&(!(r instanceof xs)||o+r.lookAheadIi&&(c=!0),e.pos+=t.length;else{u=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var g=d.exec(t),f=g?g.index-h:t.length-h;if(f){var y=document.createTextNode(l.slice(h,h+f));Ai&&9>Ii?u.appendChild(p("span",[y])):u.appendChild(y),e.map.push(e.pos,e.pos+f,y),e.col+=f,e.pos+=f}if(!g)break;h+=f+1;var b=void 0;if("\t"==g[0]){var x=e.cm.options.tabSize,v=x-e.col%x;b=u.appendChild(p("span",S(v),"cm-tab")),b.setAttribute("role","presentation"),b.setAttribute("cm-text","\t"),e.col+=v}else"\r"==g[0]||"\n"==g[0]?(b=u.appendChild(p("span","\r"==g[0]?"\u240D":"\u2424","cm-invalidchar")),b.setAttribute("cm-text",g[0]),e.col+=1):(b=e.cm.options.specialCharPlaceholder(g[0]),b.setAttribute("cm-text",g[0]),Ai&&9>Ii?u.appendChild(p("span",[b])):u.appendChild(b),e.col+=1);e.map.push(e.pos,e.pos+1,b),e.pos++}}if(e.trailingSpace=32==l.charCodeAt(t.length-1),n||o||r||c||s){var k=n||"";o&&(k+=o),r&&(k+=r);var C=p("span",[u],k,s);return i&&(C.title=i),e.content.appendChild(C)}e.content.appendChild(u)}}function vt(e,t){if(1p&&m.from<=p));h++);if(m.to>=u)return e(n,o,r,s,l,d,c);e(n,o.slice(0,m.to-p),r,s,null,d,c),s=null,o=o.slice(m.to-p),p=m.to}}}function St(e,t,n,o){var r=!o&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!o&&e.cm.display.input.needsContentAttribute&&(!r&&(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function Ct(e,t,n){var o=e.markedSpans,r=e.text,l=0;if(!o){for(var d=1;dp||E.collapsed&&T.to==p&&T.from==p)?(null!=T.to&&T.to!=p&&h>T.to&&(h=T.to,b=""),E.className&&(y+=" "+E.className),E.css&&(f=(f?f+";":"")+E.css),E.startStyle&&T.from==p&&(x+=" "+E.startStyle),E.endStyle&&T.to==h&&(C||(C=[])).push(E.endStyle,T.to),E.title&&!v&&(v=E.title),E.collapsed&&(!k||0>ge(k.marker,E))&&(k=T)):T.from>p&&h>T.from&&(h=T.from)}if(C)for(var m=0;m=c)break;for(var I=s(c,h);;){if(i){var N=p+i.length;if(!k){var L=N>I?i.slice(0,I-p):i;t.addToken(t,L,g?g+y:y,x,p+L.length==h?b:"",v,f)}if(N>=I){i=i.slice(I-p),p=I;break}p=N,x=""}i=r.slice(l,l=n[u++]),g=ft(n[u++],t.cm.options)}}}function wt(e,t,n){this.line=t,this.rest=Ce(t),this.size=this.rest?U(C(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Ee(e,t)}function Tt(e,t,n){for(var o=[],r=t,i,s;rIi&&(e.node.style.zIndex=2)),e.node}function Mt(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var o=Ot(t);t.background=o.insertBefore(p("div",null,n),o.firstChild),e.display.input.setUneditable(t.background)}}function Dt(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):yt(e,t)}function Rt(e,t){var n=t.text.className,o=Dt(e,t);t.text==t.node&&(t.node=o.pre),t.text.parentNode.replaceChild(o.pre,t.text),t.text=o.pre,o.bgClass!=t.bgClass||o.textClass!=t.textClass?(t.bgClass=o.bgClass,t.textClass=o.textClass,Pt(e,t)):n&&(t.text.className=n)}function Pt(e,t){Mt(e,t),t.line.wrapClass?Ot(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Ft(e,t,n,o){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=Ot(t);t.gutterBackground=p("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px; width: "+o.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var s=Ot(t),l=t.gutter=p("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),s.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(p("div",j(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+o.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var d=0;dn)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Zt(e,t){t=ke(t);var n=U(t),o=e.display.externalMeasured=new wt(e.doc,t,n);o.lineN=n;var r=o.built=yt(e,o);return o.text=r.pre,c(e.display.lineMeasure,r.pre),o}function en(e,t,n,o){return rn(e,nn(e,t),n,o)}function tn(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(s=c-d,i=s-1,t>=c&&(l="right")),null!=i){if(r=e[o+2],d==c&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;o&&e[o-2]==e[o-3]&&e[o-1].insertLeft;)r=e[(o-=3)+2],l="left";if("right"==n&&i==c-d)for(;ou;u++){for(;l&&_(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+dIi&&0==l&&d==r.coverEnd-r.coverStart?s.parentNode.getBoundingClientRect():sn(Ki(s,l,d).getClientRects(),o),p.left||p.right||0==l)break;d=l,--l,c="right"}Ai&&11>Ii&&(p=dn(e.display.measure,p))}else{0Ii&&!l&&(!p||!p.left&&!p.right)){var h=s.parentNode.getClientRects()[0];p=h?{left:h.left,right:h.left+Ln(e.display),top:h.top,bottom:h.bottom}:As}for(var g=p.top-t.rect.top,f=p.bottom-t.rect.top,y=t.view.measure.heights,b=0;b=o.text.length?(c=o.text.length,p="before"):0>=c&&(c=0,p="after"),!d)return s("before"==p?c-1:c,"before"==p);var u=Oe(d,c,p),m=as,h=l(c,u,"before"==p);return null!=m&&(h.other=l(c,m,"before"!=p)),h}function vn(e,t){var n=0;t=J(e.doc,t),e.options.lineWrapping||(n=Ln(e.display)*t.ch);var o=R(e.doc,t.line),r=Ie(o)+Ht(e.display);return{left:n,right:n,top:r,bottom:r+o.height}}function kn(e,t,n,o,r){var i=W(e,t,n);return i.xRel=r,o&&(i.outside=!0),i}function Sn(e,t,n){var o=e.doc;if(n+=e.display.viewOffset,0>n)return kn(o.first,0,null,!0,-1);var r=V(o,n),i=o.first+o.size-1;if(r>i)return kn(o.first+o.size-1,R(o,i).text.length,null,!0,1);0>t&&(t=0);for(var s=R(o,r);;){var l=En(e,s,r,t,n),d=xe(s,l.ch+(0o},i,r),{begin:i,end:r}}function wn(e,t,n,o){n||(n=nn(e,t));var r=fn(e,t,rn(e,n,o),"line").top;return Cn(e,t,n,r)}function Tn(e,t,n,o){return!(e.bottom<=n)&&(!!(e.top>n)||(o?e.left:e.right)>t)}function En(e,t,n,o,r){r-=Ie(t);var i=nn(e,t),s=gn(t),l=0,d=t.text.length,c=!0,p=Me(t,e.doc.direction);if(p){var u=(e.options.lineWrapping?In:An)(e,t,n,i,p,o,r);c=1!=u.level,l=c?u.from:u.to-1,d=c?u.to:u.from-1}var m=null,h=null,g=M(function(t){var n=rn(e,i,t);return(n.top+=s,n.bottom+=s,!!Tn(n,o,r,!1))&&(n.top<=r&&n.left<=o&&(m=t,h=n),!0)},l,d),f=!1,y,b;if(h){var x=o-h.left=k.bottom}return g=O(t.text,g,1),kn(n,g,b,f,o-y)}function An(e,t,n,o,r,s,l){var i=M(function(d){var i=r[d],c=1!=i.level;return Tn(xn(e,W(n,c?i.to:i.from,c?"before":"after"),"line",t,o),s,l,!0)},0,r.length-1),d=r[i];if(0l&&(d=r[i-1])}return d}function In(e,t,n,o,r,d,c){var u=Cn(e,t,o,c),m=u.begin,h=u.end;/\s/.test(t.text.charAt(h-1))&&h--;for(var g=null,f=null,y=0,i;y=h||i.to<=m)){var p=1!=i.level,b=rn(e,o,p?s(h,i.to)-1:l(m,i.from)).right,x=bx)&&(g=i,f=x)}return g||(g=r[r.length-1]),g.fromh&&(g={from:g.from,to:h,level:g.level}),g}function Nn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ns){Ns=p("pre");for(var t=0;49>t;++t)Ns.appendChild(document.createTextNode("x")),Ns.appendChild(p("br"));Ns.appendChild(document.createTextNode("x"))}c(e.measure,Ns);var n=Ns.offsetHeight/50;return 3=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,o=0;ot)return o}function Fn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Bn(e,t){void 0===t&&(t=!0);for(var n=e.doc,o={},r=o.cursors=document.createDocumentFragment(),s=o.selection=document.createDocumentFragment(),l=0;l=e.display.viewTo||i.to().linet&&(t=0),t=o(t),r=o(r),c.appendChild(p("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?h-e:n)+"px;\n height: "+(r-t)+"px"))}function i(t,n,o){function s(n,o){return bn(e,W(t,n),"div",l,o)}function i(t,n,o){var r=wn(e,l,null,t),i="ltr"==n==("after"==o)?"left":"right",d="after"==o?r.begin:r.end-(/\s/.test(l.text.charAt(r.end-1))?2:1);return s(d,i)[i]}var l=R(d,t),c=l.text.length,p=Me(l,d.direction),u,f;return _e(p,n||0,null==o?c:o,function(e,t,l,d){var y="ltr"==l,b=s(e,y?"left":"right"),x=s(t-1,y?"right":"left"),v=null==n&&0==e,k=null==o&&t==c,S=0==d,C=!p||d==p.length-1;if(3>=x.top-b.top){var w=(g?v:k)&&S,T=(g?k:v)&&C,E=w?m:(y?b:x).left,A=T?h:(y?x:b).right;r(E,b.top,A-E,b.bottom)}else{var I,N,L,_;y?(I=g&&v&&S?m:b.left,N=g?h:i(e,l,"before"),L=g?m:i(t,l,"after"),_=g&&k&&C?h:x.right):(I=g?i(e,l,"before"):m,N=!g&&v&&S?h:b.right,L=!g&&k&&C?m:x.left,_=g?i(t,l,"after"):h),r(I,b.top,N-I,b.bottom),b.bottomVn(b,u))&&(u=b),0>Vn(x,u)&&(u=x),(!f||0>Vn(b,f))&&(f=b),0>Vn(x,f)&&(f=x)}),{start:u,end:f}}var s=e.display,d=e.doc,c=document.createDocumentFragment(),u=Gt(e.display),m=u.left,h=l(s.sizerWidth,Qt(e)-s.sizer.offsetLeft)-u.right,g="ltr"==d.direction,f=t.from(),y=t.to();if(f.line==y.line)i(f.line,f.ch,y.ch);else{var b=R(d,f.line),x=R(d,y.line),v=ke(b)==ke(x),k=i(f.line,f.ch,v?b.text.length+1:null).end,S=i(y.line,v?0:null,y.ch).start;v&&(k.tope.options.cursorBlinkRate&&(t.cursorDiv.style.visibility="hidden")}}function Wn(e){e.state.focused||(e.display.input.focus(),Hn(e))}function zn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Kn(e))},100)}function Hn(t,n){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"==t.options.readOnly||(!t.state.focused&&(Pe(t,"focus",t,n),t.state.focused=!0,g(t.display.wrapper,"CodeMirror-focused"),!t.curOp&&t.display.selForContextMenu!=t.doc.sel&&(t.display.input.reset(),Ni&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),jn(t))}function Kn(t,n){t.state.delayingBlurEvent||(t.state.focused&&(Pe(t,"blur",t,n),t.state.focused=!1,Hi(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function Gn(e){for(var t=e.display,n=t.lineDiv.offsetTop,o=0;oIi){var s=r.node.offsetTop+r.node.offsetHeight;i=s-n,n=s}else{var l=r.node.getBoundingClientRect();i=l.bottom-l.top}var d=r.line.height-i;if(2>i&&(i=Nn(t)),(.005d)&&(B(r.line,i),Xn(r.line),r.rest))for(var c=0;c=c&&(d=V(t,Ie(R(t,u))-e.wrapper.clientHeight),c=u)}return{from:d,to:l(c,d+1)}}function Jn(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var o=On(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=o+"px",l=0;lt.top+o.top?r=!0:t.bottom+o.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!Ri){var i=p("div","\u200B",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Ht(e.display))+"px;\n height: "+(t.bottom-t.top+Xt(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+l(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(r),e.display.lineSpace.removeChild(i)}}}function Zn(e,t,o,r){null==r&&(r=0);var i;e.options.lineWrapping||t!=o||(t=t.ch?W(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t,o="before"==t.sticky?W(t.line,t.ch+1,"before"):t);for(var d=0;5>d;d++){var c=!1,p=xn(e,t),u=o&&o!=t?xn(e,o):p;i={left:s(p.left,u.left),top:s(p.top,u.top)-r,right:l(p.left,u.left),bottom:l(p.bottom,u.bottom)+r};var m=no(e,i),h=e.doc.scrollTop,g=e.doc.scrollLeft;if(null!=m.scrollTop&&(lo(e,m.scrollTop),1t.top&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,i=Jt(e),d={};t.bottom-t.top>i&&(t.bottom=t.top+i);var c=e.doc.height+Kt(n),p=t.topc-o;if(t.topr+i){var m=s(t.top,(u?c:t.bottom)-i);m!=r&&(d.scrollTop=m)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,g=Qt(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),f=t.right-t.left>g;return f&&(t.right=t.left+g),10>t.left?d.scrollLeft=0:t.leftg+h-3&&(d.scrollLeft=t.right+(f?0:10)-g),d}function to(e,t){null==t||(io(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function oo(e){io(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ro(e,t,n){(null!=t||null!=n)&&io(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ao(e,t){io(e),e.curOp.scrollToPos=t}function io(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=vn(e,t.from),o=vn(e,t.to);so(e,n,o,t.margin)}}function so(e,t,n,o){var r=no(e,{left:s(t.left,n.left),top:s(t.top,n.top)-o,right:l(t.right,n.right),bottom:l(t.bottom,n.bottom)+o});ro(e,r.scrollLeft,r.scrollTop)}function lo(e,t){2>n(e.doc.scrollTop-t)||(!Ci&&qo(e,{top:t}),co(e,t,!0),Ci&&qo(e),Do(e,100))}function co(e,t,n){t=s(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function po(e,t,o,r){t=s(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(o?t==e.doc.scrollLeft:2>n(e.doc.scrollLeft-t))&&!r||(e.doc.scrollLeft=t,Jn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function uo(e){var t=e.display,n=t.gutters.offsetWidth,r=o(e.doc.height+Kt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Xt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function mo(e,t){t||(t=uo(e));var n=e.display.barWidth,o=e.display.barHeight;ho(e,t);for(var r=0;4>r&&n!=e.display.barWidth||o!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&Gn(e),ho(e,uo(e)),n=e.display.barWidth,o=e.display.barHeight}function ho(e,t){var n=e.display,o=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=o.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=o.bottom)+"px",n.heightForcer.style.borderBottom=o.bottom+"px solid transparent",o.right&&o.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=o.bottom+"px",n.scrollbarFiller.style.width=o.right+"px"):n.scrollbarFiller.style.display="",o.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=o.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function go(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Hi(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new _s[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ls(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?po(e,t):lo(e,t)},e),e.display.scrollbars.addClass&&g(e.display.wrapper,e.display.scrollbars.addClass)}function fo(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Os},Et(e.curOp)}function yo(e){var t=e.curOp;It(t,function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ms(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function vo(e){e.updatedDisplay=e.mustUpdate&&Uo(e.cm,e.update)}function ko(e){var t=e.cm,n=t.display;e.updatedDisplay&&Gn(t),e.barMeasure=uo(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=en(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=l(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Xt(t)+t.display.barWidth),e.maxScrollLeft=l(0,n.sizer.offsetLeft+e.adjustWidthTo-Qt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function So(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeftt)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)rs&&we(e.doc,t)r.viewFrom?Lo(e):(r.viewFrom+=o,r.viewTo+=o);else if(t<=r.viewFrom&&n>=r.viewTo)Lo(e);else if(t<=r.viewFrom){var i=_o(e,n,n+o,1);i?(r.view=r.view.slice(i.index),r.viewFrom=i.lineN,r.viewTo+=o):Lo(e)}else if(n>=r.viewTo){var s=_o(e,t,t,-1);s?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):Lo(e)}else{var l=_o(e,t,t,-1),d=_o(e,n,n+o,1);l&&d?(r.view=r.view.slice(0,l.index).concat(Tt(e,l.lineN,d.lineN)).concat(r.view.slice(d.index)),r.viewTo+=o):Lo(e)}var c=r.externalMeasured;c&&(n=r.lineN&&t=o.viewTo)){var i=o.view[Pn(e,t)];if(null!=i.node){var s=i.changes||(i.changes=[]);-1==x(s,n)&&s.push(n)}}}function Lo(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function _o(e,t,o,r){var s=Pn(e,t),l=e.display.view,d;if(!rs||o==e.doc.first+e.doc.size)return{index:s,lineN:o};for(var c=e.display.viewFrom,n=0;nr?0:l.length-1))return null;o+=r*l[s-(0>r?1:0)].size,s+=r}return{index:s,lineN:o}}function Oo(e,t,n){var o=e.display,r=o.view;0==r.length||t>=o.viewTo||n<=o.viewFrom?(o.view=Tt(e,t,n),o.viewFrom=t):(o.viewFrom>t?o.view=Tt(e,t,o.viewFrom).concat(o.view):o.viewFromn&&(o.view=o.view.slice(0,Pn(e,n)))),o.viewTo=n}function Mo(e){for(var t=e.display.view,n=0,o=0,r;o=e.display.viewTo)){var n=+new Date+e.options.workTime,o=at(e,t.highlightFrontier),r=[];t.iter(o.line,s(t.first+t.size,e.display.viewTo+500),function(s){if(o.line>=e.display.viewFrom){var l=s.styles,d=s.text.length>e.options.maxHighlightLength?et(t.mode,o.state):null,c=ot(e,s,o,!0);d&&(o.state=d),s.styles=c.styles;var p=s.styleClasses,u=c.classes;u?s.styleClasses=u:p&&(s.styleClasses=null);for(var m=!l||l.length!=s.styles.length||p!=u&&(!p||!u||p.bgClass!=u.bgClass||p.textClass!=u.textClass),h=0;!m&&hn?(Do(e,e.options.workDelay),!0):void 0}),t.highlightFrontier=o.line,t.modeFrontier=l(t.modeFrontier,o.line),r.length&&wo(e,function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Mo(e))return!1;$n(e)&&(Lo(e),t.dims=_n(e));var r=o.first+o.size,i=l(t.visible.from-e.options.viewportMargin,o.first),c=s(r,t.visible.to+e.options.viewportMargin);n.viewFromi-n.viewFrom&&(i=l(o.first,n.viewFrom)),n.viewTo>c&&20>n.viewTo-c&&(c=s(r,n.viewTo)),rs&&(i=we(e.doc,i),c=Te(e.doc,c));var p=i!=n.viewFrom||c!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Oo(e,i,c),n.viewOffset=Ie(R(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=Mo(e);if(!p&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var m=Fo(e);return 4=e.display.viewFrom&&t.visible.to<=e.display.viewTo))break;if(!Uo(e,t))break;Gn(e);var r=uo(e);Fn(e),mo(e,r),zo(e,r),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function qo(e,t){var n=new Ms(e,t);if(Uo(e,n)){Gn(e),Vo(e,n);var o=uo(e);Fn(e),mo(e,o),zo(e,o),n.finish()}}function jo(e,t,n){function o(t){var n=t.nextSibling;return Ni&&Ui&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var r=e.display,s=e.options.lineNumbers,l=r.lineDiv,c=l.firstChild,p=r.view,u=r.viewFrom,m=0,i;mc.clientWidth,u=c.scrollHeight>c.clientHeight;if(o&&p||r&&u){if(r&&Ui&&Ni)outer:for(var m=n.target,h=d.view;m!=c;m=m.parentNode)for(var g=0;gi?f=l(0,f+i-50):y=s(t.doc.height,y+i+50),qo(t,{top:f,bottom:y})}20>Ds&&(null==d.wheelStartX?(d.wheelStartX=c.scrollLeft,d.wheelStartY=c.scrollTop,d.wheelDX=o,d.wheelDY=r,setTimeout(function(){if(null!=d.wheelStartX){var e=c.scrollLeft-d.wheelStartX,t=c.scrollTop-d.wheelStartY,n=t&&d.wheelDY&&t/d.wheelDY||e&&d.wheelDX&&e/d.wheelDX;d.wheelStartX=d.wheelStartY=null,n&&(Rs=(Rs*Ds+n)/(Ds+1),++Ds)}},200)):(d.wheelDX+=o,d.wheelDY+=r))}}function Jo(e,t){var n=e[t];e.sort(function(e,t){return z(e.from(),t.from())}),t=x(e,n);for(var o=1;oz(e,t.from))return e;if(0>=z(e,t.to))return Yo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,o=e.ch;return e.line==t.to.line&&(o+=Yo(t).ch-t.to.ch),W(n,o)}function er(e,t){for(var n=[],o=0,r;oz(p.head,p.anchor);o[l]=new Fs(u?c:d,u?d:c)}else o[l]=new Fs(d,d)}return new Ps(o,e.sel.primIndex)}function or(e){e.doc.mode=Ye(e.options,e.doc.modeOption),rr(e)}function rr(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Do(e,100),e.state.modeGen++,e.curOp&&Io(e)}function ar(e,t){return 0==t.from.ch&&0==t.to.ch&&""==C(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ir(e,t,o,n){function r(e){return o?o[e]:null}function i(e,o,r){ht(e,o,r,n),Nt(e,"change",e,t)}function s(e,t){for(var o=[],s=e;si-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(s=hr(r,r.lastOp==o)))l=C(s.changes),0==z(t.from,t.to)&&0==z(t.from,l.to)?l.to=Yo(t):s.changes.push(ur(e,t));else{var d=C(r.done);for(d&&d.ranges||br(e.sel,r.done),s={changes:[ur(e,t)],generation:r.generation},r.done.push(s);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=i,r.lastOp=r.lastSelOp=o,r.lastOrigin=r.lastSelOrigin=t.origin,l||Pe(e,"historyAdded")}function fr(e,t,n,o){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==o.ranges.length&&n.somethingSelected()==o.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function yr(e,t,n,o){var r=e.history,i=o&&o.origin;n==r.lastSelOp||i&&r.lastSelOrigin==i&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==i||fr(e,i,C(r.done),t))?r.done[r.done.length-1]=t:br(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=i,r.lastSelOp=n,o&&!1!==o.clearRedo&&mr(r.undone)}function br(e,t){var n=C(t);n&&n.ranges&&n.equals(e)||t.push(e)}function xr(e,t,o,r){var i=t["spans_"+e.id],d=0;e.iter(l(e.first,o),s(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[d]=n.markedSpans),++d})}function vr(e){if(!e)return null;for(var t=0,n;tz(t,r);i==0>z(n,r)?i!=0>z(t,n)&&(t=n):(r=t,t=n)}return new Fs(r,t)}return new Fs(n||t,t)}function Tr(e,t,n,o,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),_r(e,new Ps([wr(e.sel.primary(),t,n,r)],0),o)}function Er(e,t,n){for(var o=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;sz(t.primary().head,e.sel.primary().head)?-1:1);Mr(e,Rr(e,t,o,!0)),!(n&&!1===n.scroll)&&e.cm&&oo(e.cm)}function Mr(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Be(e.cm)),Nt(e,"cursorActivity",e))}function Dr(e){Mr(e,Rr(e,e.sel,null,!1))}function Rr(e,t,n,o){for(var r=0,i;r=t.ch:i.to>t.ch))){if(r&&(Pe(d,"beforeCursorEnter"),d.explicitlyCleared))if(!s.markedSpans)break;else{--l;continue}if(!d.atomic)continue;if(n){var c=d.find(0>o?1:-1),p=void 0;if((0>o?d.inclusiveRight:d.inclusiveLeft)&&(c=Br(e,c,-o,c&&c.line==t.line?s:null)),c&&c.line==t.line&&(p=z(c,n))&&(0>o?0>p:0o?-1:1);return(0>o?d.inclusiveLeft:d.inclusiveRight)&&(u=Br(e,u,o,u.line==t.line?s:null)),u?Pr(e,u,t,o,r):null}}return t}function Fr(e,t,n,o,r){var i=o||1,s=Pr(e,t,n,i,r)||!r&&Pr(e,t,n,i,!0)||Pr(e,t,n,-i,r)||!r&&Pr(e,t,n,-i,!0);return s?s:(e.cantEdit=!0,W(e.first,0))}function Br(e,t,n,o){return 0>n&&0==t.ch?t.line>e.first?J(e,W(t.line-1)):null:0e.lastLine())){if(t.from.linei&&(t={from:t.from,to:W(i,R(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=P(e,t.from,t.to),n||(n=er(e,t)),e.cm?Kr(e.cm,t,o):ir(e,t,o),Or(e,n,$i)}}function Kr(e,t,n){var o=e.doc,r=e.display,i=t.from,s=t.to,l=!1,d=i.line;e.options.lineWrapping||(d=U(ke(R(o,i.line))),o.iter(d,s.line+1,function(e){if(e==r.maxLine)return l=!0,!0})),-1r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),mt(o,i.line),Do(e,400);var c=t.text.length-(s.line-i.line)-1;t.full?Io(e):i.line!=s.line||1!=t.text.length||ar(e.doc,t)?Io(e,i.line,s.line+1,c):No(e,i.line,"text");var p=Ue(e,"changes"),u=Ue(e,"change");if(u||p){var m={from:i,to:s,text:t.text,removed:t.removed,origin:t.origin};u&&Nt(e,"change",e,m),p&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(m)}e.display.selForContextMenu=null}function Gr(e,t,n,o,r){if(o||(o=n),0>z(o,n)){var i;i=[o,n],n=i[0],o=i[1]}"string"==typeof t&&(t=e.splitLines(t)),qr(e,{from:n,to:o,text:t,origin:r})}function Xr(e,t,n,o){n+new Date-zs))return void ze(n);if(!(Fe(t,n)||zt(t.display,n))&&(n.dataTransfer.setData("Text",t.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!Mi)){var e=p("img",null,null,"position: fixed; left: 0; top: 0;");e.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Oi&&(e.width=e.height=1,t.display.wrapper.appendChild(e),e._top=e.offsetTop),n.dataTransfer.setDragImage(e,0,0),Oi&&e.parentNode.removeChild(e)}}function da(t,n){var e=Rn(t,n);if(e){var o=document.createDocumentFragment();Un(t,e,o),t.display.dragCursor||(t.display.dragCursor=p("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),c(t.display.dragCursor,o)}}function ca(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function pa(e){if(document.getElementsByClassName)for(var t=document.getElementsByClassName("CodeMirror"),n=0,o;n=z(i.from,C(o).to);){var s=o.pop();if(0>z(s.from,i.from)){i.from=s.from;break}}o.push(i)}wo(e,function(){for(var t=o.length-1;0<=t;t--)Gr(e.doc,"",o[t].from,o[t].to,"+delete");oo(e)})}function Ca(e,t,n){var o=O(e.text,t+n,n);return 0>o||o>e.text.length?null:o}function wa(e,t,n){var o=Ca(e,t.ch,n);return null==o?null:new W(t.line,o,0>n?"after":"before")}function Ta(e,t,n,o,r){if(e){var i=Me(n,t.doc.direction);if(i){var s=0>r?C(i):i[0],l=0>r==(1==s.level),d=l?"after":"before",c;if(0r?n.text.length-1:0;var u=rn(t,p,c).top;c=M(function(e){return rn(t,p,e).top==u},0>r==(1==s.level)?s.from:s.to-1,c),"before"==d&&(c=Ca(n,c,1))}else c=0>r?s.to:s.from;return new W(o,c,d)}}return new W(o,0>r?n.text.length:0,0>r?"before":"after")}function Ea(e,t,n,o){var r=Me(t,e.doc.direction);if(!r)return wa(t,n,o);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):0>=n.ch&&(n.ch=0,n.sticky="after");var i=Oe(r,n.ch,n.sticky),s=r[i];if("ltr"==e.doc.direction&&0==s.level%2&&(0n.ch:s.fromo,m=l(n,u?1:-1);if(null!=m&&(u?m<=s.to&&m<=c.end:m>=s.from&&m>=c.begin)){var h=u?"before":"after";return new W(n.line,m,h)}}var g=function(e,t,o){for(var i=function(e,t){return t?new W(n.line,l(e,1),"before"):new W(n.line,e,"after")};0<=e&&eIi&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var o=Da(e,t);Oi&&(Zs=o?n:null,!o&&88==n&&!ps&&(Ui?t.metaKey:t.ctrlKey)&&e.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||Fa(e)}}function Fa(e){function t(o){18!=o.keyCode&&o.altKey||(Hi(n,"CodeMirror-crosshair"),Re(document,"keyup",t),Re(document,"mouseover",t))}var n=e.display.lineDiv;g(n,"CodeMirror-crosshair"),ls(document,"keyup",t),ls(document,"mouseover",t)}function Ba(t){16==t.keyCode&&(this.doc.sel.shift=!1),Fe(this,t)}function Ua(t){var e=this;if(!(zt(e.display,t)||Fe(e,t)||t.ctrlKey&&!t.altKey||Ui&&t.metaKey)){var n=t.keyCode,o=t.charCode;if(Oi&&n==Zs)return Zs=null,void qe(t);if(!(Oi&&(!t.which||10>t.which)&&Da(e,t))){var r=i(null==o?n:o);"\b"==r||Ra(e,t,r)||e.display.input.onKeyPress(t)}}}function Va(e,t){var n=+new Date;return al&&al.compare(n,e,t)?(rl=al=null,"triple"):rl&&rl.compare(n,e,t)?(al=new el(n,e,t),rl=null,"double"):(rl=new el(n,e,t),al=null,"single")}function qa(t){var e=this,n=e.display;if(!(Fe(e,t)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=t.shiftKey,zt(n,t))return void(Ni||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100)));if(!Ja(e,t)){var o=Rn(e,t),r=Ke(t),i=o?Va(o,r):"single";window.focus(),1==r&&e.state.selectingText&&e.state.selectingText(t),o&&ja(e,r,o,i,t)||(1==r?o?za(e,o,i,t):He(t)==n.scroller&&qe(t):2==r?(o&&Tr(e.doc,o),setTimeout(function(){return n.input.focus()},20)):3==r&&(zi?$a(e,t):zn(e)))}}}function ja(e,t,n,o,r){var i="Click";return"double"==o?i="Double"+i:"triple"==o&&(i="Triple"+i),i=(1==t?"Left":2==t?"Middle":"Right")+i,Oa(e,xa(i,r),r,function(t){if("string"==typeof t&&(t=$s[t]),!t)return!1;var o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),o=t(e,n)!=Ji}finally{e.state.suppressEdits=!1}return o})}function Wa(e,t,n){var o=e.getOption("configureMouse"),r=o?o(e,t,n):{};if(null==r.unit){var i=Vi?n.shiftKey&&n.metaKey:n.altKey;r.unit=i?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==r.extend||e.doc.extend)&&(r.extend=e.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=Ui?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=Ui?!n.altKey:!n.ctrlKey),r}function za(e,t,n,o){Ai?setTimeout(y(Wn,e),0):e.curOp.focus=h();var r=Wa(e,n,o),i=e.doc.sel,s;e.options.dragDrop&&on&&!e.isReadOnly()&&"single"==n&&-1<(s=i.contains(t))&&(0>z((s=i.ranges[s]).from(),t)||0t.xRel)?Ha(e,o,t,r):Ga(e,o,t,r)}function Ha(t,e,o,r){var i=t.display,s=!1,l=To(t,function(n){Ni&&(i.scroller.draggable=!1),t.state.draggingText=!1,Re(i.wrapper.ownerDocument,"mouseup",l),Re(i.wrapper.ownerDocument,"mousemove",d),Re(i.scroller,"dragstart",c),Re(i.scroller,"drop",l),s||(qe(n),!r.addNew&&Tr(t.doc,o,null,null,r.extend),Ni||Ai&&9==Ii?setTimeout(function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()},20):i.input.focus())}),d=function(t){s=s||10<=n(e.clientX-t.clientX)+n(e.clientY-t.clientY)},c=function(){return s=!0};Ni&&(i.scroller.draggable=!0),t.state.draggingText=l,l.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ls(i.wrapper.ownerDocument,"mouseup",l),ls(i.wrapper.ownerDocument,"mousemove",d),ls(i.scroller,"dragstart",c),ls(i.scroller,"drop",l),zn(t),setTimeout(function(){return i.input.focus()},20)}function Ka(e,t,n){if("char"==n)return new Fs(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Fs(W(t.line,0),J(e.doc,W(t.line+1,0)));var o=n(e,t);return new Fs(o.from,o.to)}function Ga(t,e,n,o){function r(e){if(0!=z(b,e))if(b=e,"rectangle"==o.unit){for(var r=[],i=t.options.tabSize,d=v(R(p,n.line).text,n.ch,i),c=v(R(p,e.line).text,e.ch,i),m=s(d,c),h=l(d,c),y=s(n.line,e.line),x=s(t.lastLine(),l(n.line,e.line));y<=x;y++){var S=R(p,y).text,C=k(S,m,i);m==h?r.push(new Fs(W(y,C),W(y,C))):S.length>C&&r.push(new Fs(W(y,C),W(y,k(S,h,i))))}r.length||r.push(new Fs(n,n)),_r(p,Jo(u.ranges.slice(0,f).concat(r),f),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var w=g,T=Ka(t,e,o.unit),E=w.anchor,A;0=l.to||s.linex.bottom?20:0;d&&setTimeout(To(t,function(){S!=e||(c.scroller.scrollTop+=d,i(n))}),50)}}function d(n){t.state.selectingText=!1,S=Infinity,qe(n),c.input.focus(),Re(c.wrapper.ownerDocument,"mousemove",C),Re(c.wrapper.ownerDocument,"mouseup",w),p.history.lastSelOrigin=null}var c=t.display,p=t.doc;qe(e);var u=p.sel,m=u.ranges,g,f;if(o.addNew&&!o.extend?(f=p.sel.contains(n),g=-1u:0=r(t.display.gutters.getBoundingClientRect().right))return!1;o&&qe(n);var d=t.display,c=d.lineDiv.getBoundingClientRect();if(l>c.bottom||!Ue(t,e))return We(n);l-=c.top-d.viewOffset;for(var p=0,i;p=s){var u=V(t.doc,l),m=t.options.gutters[p];return Pe(t,e,t,u,m,n),We(n)}}function Ja(t,n){return Qa(t,n,"gutterClick",!0)}function $a(t,n){zt(t.display,n)||Ya(t,n)||Fe(t,n,"contextmenu")||t.display.input.onContextMenu(n)}function Ya(t,n){return!!Ue(t,"gutterContextMenu")&&Qa(t,n,"gutterContextMenu",!1)}function Za(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),un(e)}function ei(e){Ho(e),Io(e),Jn(e)}function ti(e,t,n){if(!t!=!(n&&n!=tl)){var o=e.display.dragFunctions,r=t?ls:Re;r(e.display.scroller,"dragstart",o.start),r(e.display.scroller,"dragenter",o.enter),r(e.display.scroller,"dragover",o.over),r(e.display.scroller,"dragleave",o.leave),r(e.display.scroller,"drop",o.drop)}}function ni(e){e.options.lineWrapping?(g(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Hi(e.display.wrapper,"CodeMirror-wrap"),Le(e)),Dn(e),Io(e),un(e),setTimeout(function(){return mo(e)},100)}function oi(e,t){var n=this;if(!(this instanceof oi))return new oi(e,t);this.options=t=t?b(t):{},b(nl,t,!1),Ko(t);var o=t.value;"string"==typeof o&&(o=new Ws(o,t.mode,null,t.lineSeparator,t.direction)),this.doc=o;var r=new oi.inputStyles[t.inputStyle](this),s=this.display=new D(e,o,r);for(var l in s.wrapper.CodeMirror=this,Ho(this),Za(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),go(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Xi,keySeq:null,specialChars:null},t.autofocus&&!Bi&&s.input.focus(),Ai&&11>Ii&&setTimeout(function(){return n.display.input.reset(!0)},20),ri(this),ua(),fo(this),this.curOp.forceUpdate=!0,lr(this,o),t.autofocus&&!Bi||this.hasFocus()?setTimeout(y(Hn,this),20):Kn(this),ol)ol.hasOwnProperty(l)&&ol[l](n,t[l],tl);$n(this),t.finishInit&&t.finishInit(this);for(var d=0;d=e.radiusX&&1>=e.radiusY}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,o=t.top-e.top;return 400Ii?ls(i.scroller,"dblclick",To(t,function(n){if(!Fe(t,n)){var e=Rn(t,n);if(!(!e||Ja(t,n)||zt(t.display,n))){qe(n);var o=t.findWordAt(e);Tr(t.doc,o.anchor,o.head)}}})):ls(i.scroller,"dblclick",function(n){return Fe(t,n)||qe(n)}),zi||ls(i.scroller,"contextmenu",function(n){return $a(t,n)});var s={end:0},l;ls(i.scroller,"touchstart",function(n){if(!Fe(t,n)&&!o(n)&&!Ja(t,n)){i.input.ensurePolled(),clearTimeout(l);var e=+new Date;i.activeTouch={start:e,moved:!1,prev:300>=e-s.end?s:null},1==n.touches.length&&(i.activeTouch.left=n.touches[0].pageX,i.activeTouch.top=n.touches[0].pageY)}}),ls(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),ls(i.scroller,"touchend",function(o){var e=i.activeTouch;if(e&&!zt(i,o)&&null!=e.left&&!e.moved&&300>new Date-e.start){var s=t.coordsChar(i.activeTouch,"page"),l;l=!e.prev||r(e,e.prev)?new Fs(s,s):!e.prev.prev||r(e,e.prev.prev)?t.findWordAt(s):new Fs(W(s.line,0),J(t.doc,W(s.line+1,0))),t.setSelection(l.anchor,l.head),t.focus(),qe(o)}n()}),ls(i.scroller,"touchcancel",n),ls(i.scroller,"scroll",function(){i.scroller.clientHeight&&(lo(t,i.scroller.scrollTop),po(t,i.scroller.scrollLeft,!0),Pe(t,"scroll",t))}),ls(i.scroller,"mousewheel",function(n){return Qo(t,n)}),ls(i.scroller,"DOMMouseScroll",function(n){return Qo(t,n)}),ls(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(n){Fe(t,n)||ze(n)},over:function(n){Fe(t,n)||(da(t,n),ze(n))},start:function(n){return la(t,n)},drop:To(t,sa),leave:function(n){Fe(t,n)||ca(t)}};var e=i.input.getField();ls(e,"keyup",function(n){return Ba.call(t,n)}),ls(e,"keydown",To(t,Pa)),ls(e,"keypress",To(t,Ua)),ls(e,"focus",function(n){return Hn(t,n)}),ls(e,"blur",function(n){return Kn(t,n)})}function ai(e,t,n,o){var s=e.doc,d;null==n&&(n="add"),"smart"==n&&(s.mode.indent?d=at(e,t).state:n="prev");var c=e.options.tabSize,p=R(s,t),u=v(p.text,null,c);p.stateAfter&&(p.stateAfter=null);var m=p.text.match(/^\s*/)[0],h;if(!o&&!/\S/.test(p.text))h=0,n="not";else if("smart"==n&&(h=s.mode.indent(d,p.text.slice(m.length),p.text),h==Ji||150s.first?h=v(R(s,t-1).text,null,c):h=0:"add"==n?h=u+e.options.indentUnit:"subtract"==n?h=u-e.options.indentUnit:"number"==typeof n&&(h=u+n),h=l(0,h);var g="",f=0;if(e.options.indentWithTabs)for(var y=r(h/c);y;--y)f+=c,g+="\t";if(f=e.first+e.size?!1:(t=new W(o,t.ch,t.sticky),c=R(e,o))}function s(o){var s;if(s=r?Ea(e.cm,c,t,n):wa(c,t,n),null!=s)t=s;else if(!o&&i())t=Ta(r,e.cm,c,t.line,n);else return!1;return!0}var l=t,d=n,c=R(e,t.line);if("char"==o)s();else if("column"==o)s(!0);else if("word"==o||"group"==o)for(var p=null,u="group"==o,m=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;;h=!1){if(0>n&&!s(!h))break;var g=c.text.charAt(t.ch)||"\n",f=N(g,m)?"w":u&&"\n"==g?"n":!u||/\s/.test(g)?null:"p";if(!u||h||f||(f="s"),p&&p!=f){0>n&&(n=1,s(),t.sticky="after");break}if(f&&(p=f),0n?0>=d:d>=r.height){u.hitSide=!0;break}d+=5*n}return u}function gi(e,t){var n=tn(e,t.line);if(!n||n.hidden)return null;var o=R(e.doc,t.line),r=Yt(n,o,t.line),i=Me(o,e.doc.direction),s="left";if(i){var l=Oe(i,t.ch);s=l%2?"right":"left"}var d=an(r.map,t.ch,s);return d.offset="right"==d.collapse?d.end:d.start,d}function fi(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function yi(e,t){return t&&(e.bad=!0),e}function bi(e,t,n,o,r){function i(e){return function(t){return t.id==e}}function s(){p&&(c+=u,m&&(c+=u),p=m=!1)}function l(e){e&&(s(),c+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void l(n);var c=t.getAttribute("cm-marker"),h;if(c){var g=e.findMarks(W(o,0),W(r+1,0),i(+c));return void(g.length&&(h=g[0].find(0))&&l(P(e.doc,h.from,h.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;f&&s();for(var y=0;yr?c.map:p[r];for(var s=0,l;sr?e.line:e.rest[r]),u=i[s]+o;return(0>o||l!=t)&&(u=i[s+(o?1:0)]),W(d,u)}}}var r=e.text.firstChild,i=!1;if(!t||!m(r,t))return yi(W(U(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var s=e.rest?C(e.rest):e.line;return yi(W(U(s),s.text.length),i)}var l=3==t.nodeType?t:null,d=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));d.parentNode!=r;)d=d.parentNode;var c=e.measure,p=c.maps,u=o(l,d,n);if(u)return yi(u,i);for(var h=d.nextSibling,g=l?l.nodeValue.length-n:0;h;h=h.nextSibling){if(u=o(h,h.firstChild,0),u)return yi(W(u.line,u.ch-g),i);g+=h.textContent.length}for(var f=d.previousSibling,y=n;f;f=f.previousSibling){if(u=o(f,f.firstChild,-1),u)return yi(W(u.line,u.ch+y),i);y+=f.textContent.length}}var ki=navigator.userAgent,Si=navigator.platform,Ci=/gecko\/\d/i.test(ki),wi=/MSIE \d/.test(ki),Ti=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ki),Ei=/Edge\/(\d+)/.exec(ki),Ai=wi||Ti||Ei,Ii=Ai&&(wi?document.documentMode||6:+(Ei||Ti)[1]),Ni=!Ei&&/WebKit\//.test(ki),Li=Ni&&/Qt\/\d+\.\d+/.test(ki),_i=!Ei&&/Chrome\//.test(ki),Oi=/Opera\//.test(ki),Mi=/Apple Computer/.test(navigator.vendor),Di=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ki),Ri=/PhantomJS/.test(ki),Pi=!Ei&&/AppleWebKit/.test(ki)&&/Mobile\/\w+/.test(ki),Fi=/Android/.test(ki),Bi=Pi||Fi||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ki),Ui=Pi||/Mac/.test(Si),Vi=/\bCrOS\b/.test(ki),qi=/win/i.test(Si),ji=Oi&&ki.match(/Version\/(\d*\.\d*)/);ji&&(ji=+ji[1]),ji&&15<=ji&&(Oi=!1,Ni=!0);var Wi=Ui&&(Li||Oi&&(null==ji||12.11>ji)),zi=Ci||Ai&&9<=Ii,Hi=function(t,n){var o=t.className,r=e(n).exec(o);if(r){var i=o.slice(r.index+r[0].length);t.className=o.slice(0,r.index)+(i?r[1]+i:"")}},Ki;Ki=document.createRange?function(e,t,n,o){var i=document.createRange();return i.setEnd(o||e,n),i.setStart(e,t),i}:function(e,t,n){var o=document.body.createTextRange();try{o.moveToElementText(e.parentNode)}catch(t){return o}return o.collapse(!0),o.moveEnd("character",n),o.moveStart("character",t),o};var Gi=function(e){e.select()};Pi?Gi=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Ai&&(Gi=function(e){try{e.select()}catch(e){}});var Xi=function(){this.id=null};Xi.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Qi=30,Ji={toString:function(){return"CodeMirror.Pass"}},$i={scroll:!1},Yi={origin:"*mouse"},Zi={origin:"+move"},es=[""],ts=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,ns=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,os=!1,rs=!1,as=null,is=function(){function e(e){return 247>=e?n.charAt(e):1424<=e&&1524>=e?"R":1536<=e&&1785>=e?o.charAt(e-1536):1774<=e&&2220>=e?"r":8192<=e&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",o="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,d=/[1n]/;return function(n,o){var c="ltr"==o?"L":"R";if(0==n.length||"ltr"==o&&!r.test(n))return!1;for(var p=n.length,u=[],h=0;hIi)return!1;var e=p("div");return"draggable"in e||"dragDrop"in e}(),ds=3=="\n\nb".split(/\n/).length?function(e){return e.split(/\r\n?|\n/)}:function(e){for(var t=0,n=[],o=e.length,r;t<=o;){r=e.indexOf("\n",t),-1==r&&(r=e.length);var i=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),s=i.indexOf("\r");-1==s?(n.push(i),t=r+1):(n.push(i.slice(0,s)),t+=s+1)}return n},cs=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(t){}return t&&t.parentElement()==e&&0!=t.compareEndPoints("StartToEnd",t)},ps=function(){var t=p("div");return!!("oncopy"in t)||(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy)}(),us=null,ms={},hs={},gs={},fs=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n},ys,bs;fs.prototype.eol=function(){return this.pos>=this.string.length},fs.prototype.sol=function(){return this.pos==this.lineStart},fs.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},fs.prototype.next=function(){if(this.post},fs.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},fs.prototype.skipToEnd=function(){this.pos=this.string.length},fs.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1this.maxLookAhead&&(this.maxLookAhead=e),t},vs.prototype.baseToken=function(e){var t=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)t.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},vs.prototype.nextLine=function(){this.line++,0Ii&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")},Ns;Is.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?o+"px":"0";var r=e.viewHeight-(t?o:0);this.vert.firstChild.style.height=l(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?o+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(n?o:0);this.horiz.firstChild.style.width=l(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&0=z(e,r.to()))return o;return-1};var Fs=function(e,t){this.anchor=e,this.head=t};Fs.prototype.from=function(){return X(this.anchor,this.head)},Fs.prototype.to=function(){return G(this.anchor,this.head)},Fs.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Yr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=this,o=e,r;othis.size-t&&(1=this.children.length)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Zr(t);if(!e.parent){var o=new Zr(e.children);o.parent=e,e.children=[o,n],e=o}else{e.size-=n.size,e.height-=n.height;var r=x(e.parent.children,e);e.parent.children.splice(r+1,0,n)}n.parent=e.parent}while(10t.display.maxLineLength&&(t.display.maxLine=p,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&Io(t,r,s+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Dr(t.doc)),t&&Nt(t,"markerCleared",t,this,r,s),n&&yo(t),this.parent&&this.parent.clear()}},Vs.prototype.find=function(e,t){var n=this;null==e&&"bookmark"==this.type&&(e=1);for(var o=0,r,i;o=e.ch)&&t.push(r.marker.parent||r.marker);return t},findMarks:function(e,t,n){e=J(this,e),t=J(this,t);var o=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var d=0,i;d=i.to||null==i.from&&r!=e.line||null!=i.from&&r==t.line&&i.from>=t.ch||n&&!n(i.marker)||o.push(i.marker.parent||i.marker);++r}),o},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var o=0;oe?(o=e,!0):void(e-=i,++t)}),J(this,W(t,o))},indexFromPos:function(e){e=J(this,e);var t=e.ch;if(e.linee.ch)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Ws(F(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.toGs;Gs++)Ks[Gs+48]=Ks[Gs+96]=Gs+"";for(var Xs=65;90>=Xs;Xs++)Ks[Xs]=i(Xs);for(var Qs=1;12>=Qs;Qs++)Ks[Qs+111]=Ks[Qs+63235]="F"+Qs;var Js={};Js.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Js.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Js.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Js.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Js["default"]=Ui?Js.macDefault:Js.pcDefault;var $s={selectAll:Ur,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$i)},killLine:function(e){return Sa(e,function(t){if(t.empty()){var n=R(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.linee.doc.first){var s=R(e.doc,r.line-1).text;s&&(r=new W(r.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),W(r.line-1,s.length-1),r,"+transpose"))}n.push(new Fs(r,r))}e.setSelections(n)})},newlineAndIndent:function(e){return wo(e,function(){for(var t=e.listSelections(),n=t.length-1;0<=n;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var o=0;oe&&0==z(t,this.pos)&&n==this.button};var tl={toString:function(){return"CodeMirror.Init"}},nl={},ol={},rl,al;oi.defaults=nl,oi.optionHandlers=ol;var il=[];oi.defineInitHook=function(e){return il.push(e)};var sl=null,ll=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Xi,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ll.prototype.init=function(e){function t(t){if(!Fe(r,t)){if(r.somethingSelected())ii({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=ci(r);ii({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation(function(){r.setSelections(e.ranges,0,$i),r.replaceSelection("",null,"cut")})}if(t.clipboardData){t.clipboardData.clearData();var n=sl.text.join("\n");if(t.clipboardData.setData("Text",n),t.clipboardData.getData("Text")==n)return void t.preventDefault()}var s=ui(),l=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=sl.text.join("\n");var d=document.activeElement;Gi(l),setTimeout(function(){r.display.lineSpace.removeChild(s),d.focus(),d==i&&o.showPrimarySelection()},50)}}var n=this,o=this,r=o.cm,i=o.div=e.lineDiv;pi(i,r.options.spellcheck),ls(i,"paste",function(t){Fe(r,t)||li(t,r)||11>=Ii&&setTimeout(To(r,function(){return n.updateFromDOM()}),20)}),ls(i,"compositionstart",function(t){n.composing={data:t.data,done:!1}}),ls(i,"compositionupdate",function(t){n.composing||(n.composing={data:t.data,done:!1})}),ls(i,"compositionend",function(t){n.composing&&(t.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),ls(i,"touchstart",function(){return o.forceCompositionEnd()}),ls(i,"input",function(){n.composing||n.readFromDOMSoon()}),ls(i,"copy",t),ls(i,"cut",t)},ll.prototype.prepareSelection=function(){var e=Bn(this.cm,!1);return e.focus=this.cm.state.focused,e},ll.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ll.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ll.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),o=n.from(),r=n.to();if(t.display.viewTo==t.display.viewFrom||o.line>=t.display.viewTo||r.line=t.display.viewFrom&&gi(t,o)||{node:l[0].measure.map[2],offset:0},c=r.linee.firstLine()&&(o=W(o.line-1,R(e.doc,o.line-1).length)),r.ch==R(e.doc,r.line).text.length&&r.linet.viewTo-1)return!1;var i,l,d;o.line==t.viewFrom||0==(i=Pn(e,o.line))?(l=U(t.view[0].line),d=t.view[0].node):(l=U(t.view[i].line),d=t.view[i-1].node.nextSibling);var c=Pn(e,r.line),p,u;if(c==t.view.length-1?(p=t.viewTo-1,u=t.lineDiv.lastChild):(p=U(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!d)return!1;for(var m=e.doc.splitLines(bi(e,d,u,l,p)),h=P(e.doc,W(l,0),W(p,R(e.doc,p).text.length));1o.ch&&v.charCodeAt(v.length-f-1)==k.charCodeAt(k.length-f-1);)g--,f++;m[m.length-1]=v.slice(0,v.length-f).replace(/^\u200b+/,""),m[0]=m[0].slice(g).replace(/\u200b+$/,"");var w=W(l,g),T=W(p,h.length?C(h).length-f:0);if(1Ii&&s.scrollbars.setScrollTop(s.scroller.scrollTop=d),null!=l.selectionStart){(!Ai||Ai&&9>Ii)&&e();var t=0,n=function(){s.selForContextMenu==r.doc.sel&&0==l.selectionStart&&0t++?s.detectingSelectAll=setTimeout(n,500):(s.selForContextMenu=null,s.input.reset())};s.detectingSelectAll=setTimeout(n,200)}}var o=this,r=o.cm,s=r.display,l=o.textarea,i=Rn(r,t),d=s.scroller.scrollTop;if(i&&!Oi){var c=r.options.resetSelectionOnContextMenu;c&&-1==r.doc.sel.contains(i)&&To(r,_r)(r.doc,$o(i),$i);var p=l.style.cssText,u=o.wrapper.style.cssText;o.wrapper.style.cssText="position: absolute";var m=o.wrapper.getBoundingClientRect();l.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-m.top-5)+"px; left: "+(t.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(Ai?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var h;if(Ni&&(h=window.scrollY),s.input.focus(),Ni&&window.scrollTo(null,h),s.input.reset(),r.somethingSelected()||(l.value=o.prevInput=" "),o.contextMenuPending=!0,s.selForContextMenu=r.doc.sel,clearTimeout(s.detectingSelectAll),Ai&&9<=Ii&&e(),zi){ze(t);var g=function(){Re(window,"mouseup",g),setTimeout(n,20)};ls(window,"mouseup",g)}else setTimeout(n,50)}},dl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},dl.prototype.setUneditable=function(){},dl.prototype.needsContentAttribute=!1,function(e){function t(t,o,r,i){e.defaults[t]=o,r&&(n[t]=i?function(e,t,n){n!=tl&&r(e,t,n)}:r)}var n=e.optionHandlers;e.defineOption=t,e.Init=tl,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,or(e)},!0),t("indentUnit",2,or,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){rr(e),un(e),Io(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,!!t){var n=[],o=e.doc.first;e.doc.iter(function(e){for(var r=0,i;;){if(i=e.text.indexOf(t,r),-1==i)break;r=i+t.length,n.push(W(o,i))}o++});for(var r=n.length-1;0<=r;r--)Gr(e.doc,t,n[r],W(n[r].line,n[r].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=tl&&e.refresh()}),t("specialCharPlaceholder",bt,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",Bi?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!qi),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){Za(e),ei(e)},!0),t("keyMap","default",function(e,t,n){var o=ka(t),r=n!=tl&&ka(n);r&&r.detach&&r.detach(e,o),o.attach&&o.attach(e,r||null)}),t("extraKeys",null),t("configureMouse",null),t("lineWrapping",!1,ni,!0),t("gutters",[],function(e){Ko(e.options),ei(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?On(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return mo(e)},!0),t("scrollbarStyle","native",function(e){go(e),mo(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){Ko(e.options),ei(e)},!0),t("firstLineNumber",1,ei,!0),t("lineNumberFormatter",function(e){return e},ei,!0),t("showCursorWhenSelecting",!1,Fn,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("pasteLinesPerSelection",!0),t("readOnly",!1,function(e,t){"nocursor"==t&&(Kn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,ti),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Fn,!0),t("singleCursorHeightPerLine",!0,Fn,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,rr,!0),t("addModeClass",!1,rr,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,rr,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(oi),function(e){var t=e.optionHandlers,o=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var o=this.options,r=o[e];o[e]==n&&"mode"!=e||(o[e]=n,t.hasOwnProperty(e)&&To(this,t[e])(this,n,r),Pe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](ka(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;no&&(ai(t,i.head.line,e,!0),o=i.head.line,r==t.doc.sel.primIndex&&oo(t))}),getTokenAt:function(e,t){return dt(this,e,t)},getLineTokens:function(e,t){return dt(this,W(e),t,!0)},getTokenTypeAt:function(e){e=J(this.doc,e);var t=rt(this,R(this.doc,e.line)),n=0,o=(t.length-1)/2,r=e.ch,i;if(0==r)i=t[2];else for(;;){var s=n+o>>1;if((s?t[2*s-1]:0)>=r)o=s;else if(t[2*s+1]l?i:0==l?null:i.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=this,r=[];if(!o.hasOwnProperty(t))return r;var s=o[t],l=this.getModeAt(e);if("string"==typeof l[t])s[l[t]]&&r.push(s[l[t]]);else if(l[t])for(var d=0,i;di&&(e=i,o=!0),r=R(this.doc,e)}else r=e;return fn(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-Ie(r):0)},defaultTextHeight:function(){return Nn(this.display)},defaultCharWidth:function(){return Ln(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,o,r){var i=this.display;e=xn(this,J(this.doc,e));var s=e.bottom,d=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),i.sizer.appendChild(t),"over"==o)s=e.top;else if("above"==o||"near"==o){var c=l(i.wrapper.clientHeight,this.doc.height),p=l(i.sizer.clientWidth,i.lineSpace.clientWidth);("above"==o||e.bottom+t.offsetHeight>c)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=c&&(s=e.bottom),d+t.offsetWidth>p&&(d=p-t.offsetWidth)}t.style.top=s+"px",t.style.left=t.style.right="","right"==r?(d=i.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?d=0:"middle"==r&&(d=(i.sizer.clientWidth-t.offsetWidth)/2),t.style.left=d+"px"),n&&eo(this,{left:d,top:s,right:d+t.offsetWidth,bottom:s+t.offsetHeight})},triggerOnKeyDown:Eo(Pa),triggerOnKeyPress:Eo(Ua),triggerOnKeyUp:Ba,triggerOnMouseDown:Eo(qa),execCommand:function(e){if($s.hasOwnProperty(e))return $s[e].call(null,this)},triggerElectric:Eo(function(e){di(this,e)}),findPosH:function(e,t,n,o){var r=this,s=1;0>t&&(s=-1,t=-t);for(var l=J(this.doc,e),d=0;de?o.from():o.to()},Zi)}),deleteH:Eo(function(e,t){var n=this.doc.sel,o=this.doc;n.somethingSelected()?o.replaceSelection("",null,"+delete"):Sa(this,function(n){var r=mi(o,n.head,e,t,!1);return 0>e?{from:r,to:n.head}:{from:n.head,to:r}})}),findPosV:function(e,t,n,o){var r=this,s=1,l=o;0>t&&(s=-1,t=-t);for(var d=J(this.doc,e),c=0,i;ce?i.from():i.to();var l=xn(n,i.head,"div");null!=i.goalColumn&&(l.left=i.goalColumn),r.push(l.left);var d=hi(n,l,e,t);return"page"==t&&i==o.sel.primary()&&to(n,bn(n,d,"div").top-l.top),d},Zi),r.length)for(var l=0;lx(cl,pl)&&(oi.prototype[pl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ws.prototype[pl]));return Ve(Ws),oi.inputStyles={textarea:dl,contenteditable:ll},oi.defineMode=function(e){oi.defaults.mode||"null"==e||(oi.defaults.mode=e),Je.apply(this,arguments)},oi.defineMIME=function(e,t){hs[e]=t},oi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),oi.defineMIME("text/plain","null"),oi.defineExtension=function(e,t){oi.prototype[e]=t},oi.defineDocExtension=function(e,t){Ws.prototype[e]=t},oi.fromTextArea=function(e,t){function n(){e.value=l.getValue()}if(t=t?b(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var o=h();t.autofocus=o==e||null!=e.getAttribute("autofocus")&&o==document.body}var r;if(e.form&&(ls(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var i=e.form;r=i.submit;try{var s=i.submit=function(){n(),i.submit=r,i.submit(),i.submit=s}}catch(t){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(Re(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=r))}},e.style.display="none";var l=oi(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return l},function(e){e.off=Re,e.on=ls,e.wheelEventPixels=Xo,e.Doc=Ws,e.splitLines=ds,e.countColumn=v,e.findColumn=k,e.isWordChar=I,e.Pass=Ji,e.signal=Pe,e.Line=Ss,e.changeEnd=Yo,e.scrollbarModel=_s,e.Pos=W,e.cmpPos=z,e.modes=ms,e.mimeModes=hs,e.resolveMode=$e,e.getMode=Ye,e.modeExtensions=gs,e.extendMode=Ze,e.copyState=et,e.startState=nt,e.innerMode=tt,e.commands=$s,e.keyMap=Js,e.keyName=va,e.isModifierKey=ba,e.lookupKey=ya,e.normalizeKeyMap=fa,e.StringStream=fs,e.SharedTextMarker=qs,e.TextMarker=Vs,e.LineWidget=Bs,e.e_preventDefault=qe,e.e_stopPropagation=je,e.e_stop=ze,e.addClass=g,e.contains=m,e.rmClass=Hi,e.keyNames=Ks}(oi),oi.version="5.38.0",oi})},uQIK:function(e,t,n){(function(e){e(n("tQq4"))})(function(e){function t(e,t,o){var r=e.getLineHandle(t.line),i=t.ch-1,d=o&&o.afterCursor;null==d&&(d=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=!d&&0<=i&&l[r.text.charAt(i)]||l[r.text.charAt(++i)];if(!c)return null;var p=">"==c.charAt(1)?1:-1;if(o&&o.strict&&0i))for(m==t.line&&(g=t.ch-(0>n?1:0));g!=f;g+=n){var y=h.charAt(g);if(p.test(y)&&(void 0===o||e.getTokenTypeAt(s(m,g+1))==o)){var b=l[y];if(">"==b.charAt(1)==0document.documentMode),s=e.Pos,l={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};e.defineOption("matchBrackets",!1,function(t,n,o){o&&o!=e.Init&&(t.off("cursorActivity",r),t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",r))}),e.defineExtension("matchBrackets",function(){o(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,o){return(o||"boolean"==typeof n)&&(o?(o.strict=n,n=o):n=n?{strict:!0}:null),t(this,e,n)}),e.defineExtension("scanForBracket",function(e,t,o,r){return n(this,e,t,o,r)})})},vCxL:function(e,t,n){"use strict";function r(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 o(t,o){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var s=n.call(t),i=[],l,r;try{for(;(void 0===o||0o.indexOf(t)&&(e[t]=n[t]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,t=Object.getOwnPropertySymbols(n);ro.indexOf(t[r])&&(e[t[r]]=n[t[r]]);return e},t.__decorate=function(e,t,n,o){var s=arguments.length,l=3>s?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o,r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,o);else for(var d=e.length-1;0<=d;d--)(r=e[d])&&(l=(3>s?r(l):3d[0]&&o[1]m;m++)if((5==e||r||m in c)&&(g=c[m],f=p(g,m,d),e))if(n)h[m]=f;else if(f)switch(e){case 3:return!0;case 5:return g;case 6:return m;case 2:h.push(g);}else if(o)return!1;return r?-1:3==e||o?o:h}},he=de("unscopables"),ge=Array.prototype;void 0==ge[he]&&P(ge,he,{});var fe=function(e){ge[he][e]=!0},ye=me(5),be="find",xe=!0;be in[]&&[,][be](function(){xe=!1}),Q(Q.P+Q.F*xe,"Array",{find:function(e){return ye(this,e,1e?Ee(e+t,0):o(e,t)},Ie=le("keys"),Ne=function(e){return Ie[e]||(Ie[e]=W(e))},Le=function(e){return function(t,n,o){var r=Te(t),i=re(r.length),s=Ae(o,i),l;if(e&&n!=n){for(;i>s;)if(l=r[s++],l!=l)return!0;}else for(;i>s;s++)if((e||s in r)&&r[s]===n)return e||s||0;return!e&&-1}}(!1),_e=Ne("IE_PROTO"),Oe=function(e,t){var n=Te(e),o=0,r=[],i;for(i in n)i!=_e&&U(n,i)&&r.push(i);for(;t.length>o;)U(n,i=t[o++])&&(~Le(r,i)||r.push(i));return r},Me=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],De=Object.keys||function(e){return Oe(e,Me)},Re=Object.getOwnPropertySymbols,Pe={f:Re},Fe={}.propertyIsEnumerable,Be={f:Fe},Ue=Object.assign,Ve=!Ue||E(function(){var e={},t={},n=Symbol(),o="abcdefghijklmnopqrst";return e[n]=7,o.split("").forEach(function(e){t[e]=e}),7!=Ue({},e)[n]||Object.keys(Ue({},t)).join("")!=o})?function(e){for(var t=ee(e),n=arguments.length,o=1,r=Pe.f,i=Be.f;n>o;)for(var s=Y(arguments[o++]),l=r?De(s).concat(r(s)):De(s),d=l.length,c=0,p;d>c;)i.call(s,p=l[c++])&&(t[p]=s[p]);return t}:Ue;Q(Q.S+Q.F,"Object",{assign:Ve});var qe=S.Object.assign,je=de("match"),We=function(e){var t;return w(e)&&(void 0===(t=e[je])?"RegExp"==$(e):!!t)},ze=function(e,t,n){if(We(t))throw TypeError("String#"+n+" doesn't accept regex!");return Z(e)+""},He=de("match"),Ke="startsWith",Ge=""[Ke];Q(Q.P+Q.F*function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[He]=!1,!"/./"[e](t)}catch(e){}}return!0}(Ke),"String",{startsWith:function(e){var t=ze(this,e,Ke),n=re(o(1r||r==Infinity)throw RangeError("Count can't be negative");for(;0>>=1)&&(t+=t))1&r&&(o+=t);return o}});var Qe=S.String.repeat,Je=h(function(e){var t=W("meta"),n=R.f,o=0,r=Object.isExtensible||function(){return!0},i=!E(function(){return r(Object.preventExtensions({}))}),s=function(e){n(e,t,{value:{i:"O"+ ++o,w:{}}})},l=e.exports={KEY:t,NEED:!1,fastKey:function(e,n){if(!w(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!U(e,t)){if(!r(e))return"F";if(!n)return"E";s(e)}return e[t].i},getWeak:function(e,n){if(!U(e,t)){if(!r(e))return!0;if(!n)return!1;s(e)}return e[t].w},onFreeze:function(e){return i&&l.NEED&&r(e)&&!U(e,t)&&s(e),e}}}),$e=Je.KEY,Ye=Je.NEED,Ze=Je.fastKey,et=Je.getWeak,tt=Je.onFreeze,nt=R.f,ot=de("toStringTag"),rt=function(e,t,n){e&&!U(e=n?e:e.prototype,ot)&&nt(e,ot,{configurable:!0,value:t})},at={f:de},it=!1,st=R.f,lt=function(e){var t=S.Symbol||(S.Symbol=v.Symbol||{});"_"==e.charAt(0)||e in t||st(t,e,{value:at.f(e)})},dt=function(e){var t=De(e),n=Pe.f;if(n)for(var o=n(e),r=Be.f,s=0,i;o.length>s;)r.call(e,i=o[s++])&&t.push(i);return t},ct=A?Object.defineProperties:function(e,t){T(e);for(var n=De(t),o=n.length,r=0,i;o>r;)R.f(e,i=n[r++],t[i]);return e},pt=v.document,ut=pt&&pt.documentElement,mt=Ne("IE_PROTO"),ht=function(){},ft="prototype",yt=function(){var e=L("iframe"),t=Me.length,n="<",o=">",r;for(e.style.display="none",ut.appendChild(e),e.src="javascript:",r=e.contentWindow.document,r.open(),r.write(n+"script"+o+"document.F=Object"+n+"/script"+o),r.close(),yt=r.F;t--;)delete yt[ft][Me[t]];return yt()},gt=Object.create||function(e,t){var n;return null===e?n=yt():(ht[ft]=T(e),n=new ht,ht[ft]=null,n[mt]=e),void 0===t?n:ct(n,t)},bt=Me.concat("length","prototype"),xt=Object.getOwnPropertyNames||function(e){return Oe(e,bt)},vt={f:xt},kt=vt.f,St={}.toString,Ct="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],wt=function(e){try{return kt(e)}catch(t){return Ct.slice()}},Tt={f:function(e){return Ct&&"[object Window]"==St.call(e)?wt(e):kt(Te(e))}},Et=Object.getOwnPropertyDescriptor,At=A?Et:function(e,t){if(e=Te(e),t=M(t,!0),_)try{return Et(e,t)}catch(t){}return U(e,t)?F(!Be.f.call(e,t),e[t]):void 0},It={f:At},Nt=Je.KEY,Lt=It.f,_t=R.f,Ot=Tt.f,Mt=v.Symbol,Dt=v.JSON,Rt=Dt&&Dt.stringify,Pt="prototype",Ft=de("_hidden"),Bt=de("toPrimitive"),Ut={}.propertyIsEnumerable,Vt=le("symbol-registry"),qt=le("symbols"),jt=le("op-symbols"),Wt=Object[Pt],zt="function"==typeof Mt,Ht=v.QObject,Kt=!Ht||!Ht[Pt]||!Ht[Pt].findChild,Gt=A&&E(function(){return 7!=gt(_t({},"a",{get:function(){return _t(this,"a",{value:7}).a}})).a})?function(e,t,n){var o=Lt(Wt,t);o&&delete Wt[t],_t(e,t,n),o&&e!==Wt&&_t(Wt,t,o)}:_t,Xt=function(e){var t=qt[e]=gt(Mt[Pt]);return t._k=e,t},Qt=zt&&"symbol"==typeof Mt.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof Mt},Jt=function(e,t,n){return e===Wt&&Jt(jt,t,n),T(e),t=M(t,!0),T(n),U(qt,t)?(n.enumerable?(U(e,Ft)&&e[Ft][t]&&(e[Ft][t]=!1),n=gt(n,{enumerable:F(0,!1)})):(!U(e,Ft)&&_t(e,Ft,F(1,{})),e[Ft][t]=!0),Gt(e,t,n)):_t(e,t,n)},$t=function(e,t){T(e);for(var n=dt(t=Te(t)),o=0,r=n.length,i;r>o;)Jt(e,i=n[o++],t[i]);return e},Yt=function(e){var t=Ut.call(this,e=M(e,!0));return this===Wt&&U(qt,e)&&!U(jt,e)?!1:t||!U(this,e)||!U(qt,e)||U(this,Ft)&&this[Ft][e]?t:!0},Zt=function(e,t){if(e=Te(e),t=M(t,!0),e!==Wt||!U(qt,t)||U(jt,t)){var n=Lt(e,t);return n&&U(qt,t)&&!(U(e,Ft)&&e[Ft][t])&&(n.enumerable=!0),n}},en=function(e){for(var t=Ot(Te(e)),n=[],o=0,r;t.length>o;)U(qt,r=t[o++])||r==Ft||r==Nt||n.push(r);return n},tn=function(e){for(var t=e===Wt,n=Ot(t?jt:Te(e)),o=[],r=0,i;n.length>r;)U(qt,i=n[r++])&&(!t||U(Wt,i))&&o.push(qt[i]);return o};zt||(Mt=function(){if(this instanceof Mt)throw TypeError("Symbol is not a constructor!");var e=W(0on;)de(nn[on++]);for(var j=De(de.store),rn=0;j.length>rn;)lt(j[rn++]);Q(Q.S+Q.F*!zt,"Symbol",{for:function(e){return U(Vt,e+="")?Vt[e]:Vt[e]=Mt(e)},keyFor:function(e){if(!Qt(e))throw TypeError(e+" is not a symbol!");for(var t in Vt)if(Vt[t]===e)return t},useSetter:function(){Kt=!0},useSimple:function(){Kt=!1}}),Q(Q.S+Q.F*!zt,"Object",{create:function(e,t){return void 0===t?gt(e):$t(gt(e),t)},defineProperty:Jt,defineProperties:$t,getOwnPropertyDescriptor:Zt,getOwnPropertyNames:en,getOwnPropertySymbols:tn}),Dt&&Q(Q.S+Q.F*(!zt||E(function(){var e=Mt();return"[null]"!=Rt([e])||"{}"!=Rt({a:e})||"{}"!=Rt(Object(e))})),"JSON",{stringify:function(e){for(var t=[e],n=1,o,r;arguments.length>n;)t.push(arguments[n++]);if(r=o=t[1],(w(o)||void 0!==e)&&!Qt(e))return ae(o)||(o=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!Qt(t))return t}),t[1]=o,Rt.apply(Dt,t)}}),Mt[Pt][Bt]||P(Mt[Pt],Bt,Mt[Pt].valueOf),rt(Mt,"Symbol"),rt(Math,"Math",!0),rt(v.JSON,"JSON",!0);var k=de("toStringTag"),an="Arguments"==$(function(){return arguments}()),sn=function(e,t){try{return e[t]}catch(t){}},ln=function(e){var t,n,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=sn(t=Object(e),k))?n:an?$(t):"Object"==(o=$(t))&&"function"==typeof t.callee?"Arguments":o};({})[de("toStringTag")]="z",z(Object.prototype,"toString",function(){return"[object "+ln(this)+"]"},!0),lt("asyncIterator"),lt("observable");var dn=S.Symbol,cn={},pn={};P(pn,de("iterator"),function(){return this});var un=function(e,t,n){e.prototype=gt(pn,{next:F(1,n)}),rt(e,t+" Iterator")},mn=Ne("IE_PROTO"),hn=Object.prototype,gn=Object.getPrototypeOf||function(e){return e=ee(e),U(e,mn)?e[mn]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?hn:null},fn=de("iterator"),yn=!([].keys&&"next"in[].keys()),bn="keys",xn="values",vn=function(){return this},kn=function(e,t,n,o,r,i,s){un(n,t,o);var l=function(e){return!yn&&e in u?u[e]:e===bn?function(){return new n(this,e)}:e===xn?function(){return new n(this,e)}:function(){return new n(this,e)}},d=t+" Iterator",c=r==xn,p=!1,u=e.prototype,m=u[fn]||u["@@iterator"]||r&&u[r],h=m||l(r),g=r?c?l("entries"):h:void 0,f="Array"==t?u.entries||m:m,y,b,x;if(f&&(x=gn(f.call(new e)),x!==Object.prototype&&x.next&&(rt(x,d,!0),"function"!=typeof x[fn]&&P(x,fn,vn))),c&&m&&m.name!==xn&&(p=!0,h=function(){return m.call(this)}),(yn||p||!u[fn])&&P(u,fn,h),cn[t]=h,cn[d]=vn,r)if(y={values:c?h:l(xn),keys:i?h:l(bn),entries:g},s)for(b in y)b in u||z(u,b,y[b]);else Q(Q.P+Q.F*(yn||p),t,y);return y},Sn=function(e){return function(t,n){var o=Z(t)+"",r=oe(n),i=o.length,s,l;return 0>r||r>=i?e?"":void 0:(s=o.charCodeAt(r),55296>s||56319(l=o.charCodeAt(r+1))||57343=e.length?{value:void 0,done:!0}:(n=Sn(e,t),this._i+=n.length,{value:n,done:!1})});var Cn=function(e,t){return{value:t,done:!!e}},wn=kn(Array,"Array",function(e,t){this._t=Te(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,Cn(1)):"keys"==t?Cn(0,n):"values"==t?Cn(0,e[n]):Cn(0,[n,e[n]])},"values");cn.Arguments=cn.Array,fe("keys"),fe("values"),fe("entries");for(var Tn=de("iterator"),En=de("toStringTag"),An=cn.Array,In={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Nn=De(In),Ln=0;Ln",type:"keyToKey",toKeys:"h"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"",type:"keyToKey",toKeys:"W"},{keys:"",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"",type:"keyToKey",toKeys:"w"},{keys:"",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"",type:"keyToKey",toKeys:"0"},{keys:"",type:"keyToKey",toKeys:"$"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r",type:"action",action:"replace",isEdit:!0},{keys:"@",type:"action",action:"replayMacro"},{keys:"q",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0}},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"",type:"action",action:"redo"},{keys:"m",type:"action",action:"setMark"},{keys:"\"",type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a",type:"motion",motion:"textObjectManipulation"},{keys:"i",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],n=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],c=t.Pos;t.Vim=function(){function i(e){e.setOption("disableInput",!0),e.setOption("showCursorWhenSelecting",!1),t.signal(e,"vim-mode-change",{mode:"normal"}),e.on("cursorActivity",ct),D(e),t.on(e.getInputField(),"paste",v(e))}function p(e){e.setOption("disableInput",!1),e.off("cursorActivity",ct),t.off(e.getInputField(),"paste",v(e)),e.state.vim=null}function u(e,n){this==t.keyMap.vim&&(t.rmClass(e.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==e.getOption("inputStyle")&&null!=document.body.style.caretColor&&(y(e),e.getInputField().style.caretColor="")),n&&n.attach==m||p(e)}function m(e,n){this==t.keyMap.vim&&(t.addClass(e.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==e.getOption("inputStyle")&&null!=document.body.style.caretColor&&(f(e),e.getInputField().style.caretColor="transparent")),n&&n.attach==m||i(e)}function h(e){for(var t=e.listSelections(),n=[],o=0,r;o")}function v(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(z(e.getCursor(),0,1)),Rt.enterInsertMode(e,{},t))}),t.onPasteFn}function k(e,t){for(var n=[],o=e;o=e.firstLine()&&t<=e.lastLine()}function C(e){return /^[a-z]$/.test(e)}function w(e){return-1!="()[]{}".indexOf(e)}function T(e){return xt.test(e)}function E(e){return /^[A-Z]$/.test(e)}function A(e){return /^\s*$/.test(e)}function I(e){return-1!=".?!".indexOf(e)}function N(e,t){for(var n=0;n"==t.slice(-11)){var n=t.length-11,o=e.slice(0,n),r=t.slice(0,n);return o==r&&e.length>n?"full":0==r.indexOf(o)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function X(e){var t=/^.*(<[^>]+>)$/.exec(e),n=t?t[1]:e.slice(-1);return 1"===n?"\n":""===n?" ":""),n}function Q(e,t,n){return function(){for(var o=0;op?m:0,g=o[h].anchor,f=s(g.line,r.line),y=l(g.line,r.line),b=g.ch,x=r.ch,v=o[h].head.ch-b,k=x-b;0=k?(b++,!i&&x--):0>v&&0<=k?(b--,!u&&x++):0>v&&-1==k&&(b--,x++);for(var S=f,C;S<=y;S++)C={anchor:new c(S,b),head:new c(S,x)},n.push(C);return e.setSelections(n),t.ch=x,g.ch=b,g}function se(e,t,n){for(var o=[],r=0,i;rm&&(r.line=m),r.ch=ne(e,r.line)}else r.ch=0,d.ch=ne(e,d.line);return{ranges:[{anchor:d,head:r}],primary:0}}if("block"==n){for(var h=s(d.line,r.line),g=s(d.ch,r.ch),f=l(d.line,r.line),y=l(d.ch,r.ch)+1,b=f-h+1,x=r.line==h?0:b-1,v=[],k=0;k=s.length)return null;o?d=kt[0]:(d=vt[0],!d(s.charAt(l))&&(d=vt[1]));for(var p=l,u=l;d(s.charAt(p))&&pu&&!y?y=!0:r=!1,m=d;m>p&&(r&&s(m)!=y&&m!=d||!l(m,-1,!0));m--);return i=new c(m,0),{start:i,end:h}}function Le(e,t,n,o){function r(e,t){if(0>t.pos+t.dir||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!S(e,t.ln))return t.line=null,t.ln=null,void(t.pos=null);t.line=e.getLine(t.ln),t.pos=0o?s(e,l.ln,l.pos,o):i(e,l.ln,l.pos,o),n--;return c(l.ln,l.pos)}function _e(e,t,n,o){var r=t,i={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[n],s={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[n],l=e.getLine(r.line).charAt(r.ch),d=l===s?1:0,p,u;if(p=e.scanForBracket(c(r.line,r.ch+d),-1,void 0,{bracketRegex:i}),u=e.scanForBracket(c(r.line,r.ch+d),1,void 0,{bracketRegex:i}),!p||!u)return{start:r,end:r};if(p=p.pos,u=u.pos,p.line==u.line&&p.ch>u.ch||p.line>u.line){var m=p;p=u,u=m}return o?u.ch+=1:p.ch+=1,{start:p,end:u}}function Oe(e,t,n,o){var r=J(t),s=e.getLine(r.line),l=s.split(""),d=l.indexOf(n),p,u,m,i;if(r.ch"+t+"",{bottom:!0,duration:5e3}):alert(t)}function He(e,t){var n=""+(e||"")+"";return t&&(n+=" "+t+""),n}function Ke(e,t){var n=(t.prefix||"")+" "+(t.desc||""),o=He(t.prefix,t.desc);Re(e,o,n,t.onClose,t)}function Ge(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var n=["global","multiline","ignoreCase","source"],o=0,r;o=t&&e<=n:e==t}function et(e){var t=e.getScrollInfo(),n=e.coordsChar({left:0,top:6+t.top},"local"),o=t.clientHeight-10+t.top,r=e.coordsChar({left:0,top:o},"local");return{top:n.line,bottom:r.line}}function tt(e,t,n){if("'"==n){var o=e.doc.history.done,r=o[o.length-2];return r&&r.ranges&&r.ranges[0].head}if("."==n){if(0==e.doc.history.lastModTime)return;var i=e.doc.history.done.filter(function(e){if(void 0!==e.changes)return e});i.reverse();var s=i[0].changes[0].to;return s}var l=t.marks[n];return l&&l.find()}function nt(e,n,o,r,i,s,l,d,c){function p(){e.operation(function(){for(;!g;)u(),m();h()})}function u(){var t=e.getRange(s.from(),s.to()),n=t.replace(l,d);s.replace(n)}function m(){for(;s.findNext()&&Ze(s.from(),r,i);)if(o||!f||s.from().line!=f.line)return e.scrollIntoView(s.from(),30),e.setSelection(s.from(),s.to()),f=s.from(),void(g=!1);g=!0}function h(t){if(t&&t(),e.focus(),f){e.setCursor(f);var n=e.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=f.ch}c&&c()}e.state.vim.exMode=!0;var g=!1,f=s.from();return m(),g?void ze(e,"No matches for "+l.source):n?void Ke(e,{prefix:"replace with "+d+" (y/n/a/q/l)",onKeyDown:function(n,o,r){t.e_stop(n);var i=t.keyName(n);switch(i){case"Y":u(),m();break;case"N":m();break;case"A":var s=c;c=void 0,e.operation(p),c=s;break;case"L":u();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":h(r);}return g&&h(r),!0}}):(p(),void(c&&c()))}function ot(e){var n=e.state.vim,o=Lt.macroModeState,r=Lt.registerController.getRegister("."),s=o.isPlaying,l=o.lastInsertModeChanges,d=[];if(!s){for(var c=l.inVisualBlock&&n.lastSelection?n.lastSelection.visualBlock.height:1,p=l.changes,d=[],u=0;u|<\w+>|./.exec(i),u=p[0],i=i.substring(p.index+u.length),t.Vim.handleKey(e,u,"macro"),n.insertMode){var m=s.insertModeChanges[d++].changes;Lt.macroModeState.lastInsertModeChanges.changes=m,ft(e,m,1),ot(e)}o.isPlaying=!1}function it(e,t){if(!e.isPlaying){var n=e.latestRegister,o=Lt.registerController.getRegister(n);o&&o.pushText(t)}}function st(e){if(!e.isPlaying){var t=e.latestRegister,n=Lt.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}function lt(e,t){if(!e.isPlaying){var n=e.latestRegister,o=Lt.registerController.getRegister(n);o&&o.pushSearchQuery&&o.pushSearchQuery(t)}}function dt(e,t){var n=Lt.macroModeState,o=n.lastInsertModeChanges;if(!n.isPlaying)for(;t;){if(o.expectCursorActivityForChange=!0,"+input"==t.origin||"paste"==t.origin||void 0===t.origin){var r=t.text.join("\n");o.maybeReset&&(o.changes=[],o.maybeReset=!1),e.state.overwrite&&!/\n/.test(r)?o.changes.push([r]):o.changes.push(r)}t=t.next}}function ct(e){var t=e.state.vim;if(t.insertMode){var n=Lt.macroModeState;if(n.isPlaying)return;var o=n.lastInsertModeChanges;o.expectCursorActivityForChange?o.expectCursorActivityForChange=!1:o.maybeReset=!0}else e.curOp.isVimOp||ut(e,t);t.visualMode&&pt(e)}function pt(e){var t=e.state.vim,n=j(e,J(t.sel.head)),o=z(n,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(n,o,{className:"cm-animate-fat-cursor"})}function ut(e,n){var o=e.getCursor("anchor"),r=e.getCursor("head");if(n.visualMode&&!e.somethingSelected()?ge(e,!1):!n.visualMode&&!n.insertMode&&e.somethingSelected()&&(n.visualMode=!0,n.visualLine=!1,t.signal(e,"vim-mode-change",{mode:"visual"})),n.visualMode){var i=Y(r,o)?0:-1,s=Y(r,o)?-1:0;r=z(r,0,i),o=z(o,0,s),n.sel={anchor:o,head:r},Ae(e,n,"<",Z(r,o)),Ae(e,n,">",ee(r,o))}else n.insertMode||(n.lastHPos=e.getCursor().ch)}function mt(e){this.keyName=e}function ht(n){var e=Lt.macroModeState,o=e.lastInsertModeChanges,r=t.keyName(n);r&&(-1==r.indexOf("Delete")&&-1==r.indexOf("Backspace")||t.lookupKey(r,"vim-insert",function(){return o.maybeReset&&(o.changes=[],o.maybeReset=!1),o.changes.push(new mt(r)),!0}))}function gt(e,t,n,o){function r(){d?Ot.processAction(e,t,t.lastEditActionCommand):Ot.evalInput(e,t)}function s(n){if(0"]),Et=[].concat(St,Ct,wt,["-","\"",".",":","/"]),At={};L("filetype",void 0,"string",["ft"],function(e,t){if(void 0!==t){if(void 0===e){var n=t.getOption("mode");return"null"==n?"":n}var n=""==e?"null":e;t.setOption("mode",n)}});var It=function(){var e=100,t=-1,n=0,o=0,r=Array(e);return{cachedCursor:void 0,add:function(i,s,l){function d(n){var o=++t%e,s=r[o];s&&s.clear(),r[o]=i.setBookmark(n)}var c=t%e,p=r[c];if(p){var u=p.find();u&&!$(u,s)&&d(s)}else d(s);d(l),n=t,o=t-e+1,0>o&&(o=0)},move:function(i,s){t+=s,t>n?t=n:to)}return l}}},Nt=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};M.prototype={exitMacroRecordMode:function(){var e=Lt.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=Lt.registerController.getRegister(t);n&&(n.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var Lt,_t;P.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},P.prototype.getRepeat=function(){var e=0;return(0=n.length?(this.iterator=n.length,this.initialPrefix):0>r?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);-1"==i.keys.slice(-11)){var d=X(e);if(!d)return{type:"none"};n.selectedCharacter=d}return{type:"full",command:i}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case"motion":this.processMotion(e,t,n);break;case"operator":this.processOperator(e,t,n);break;case"operatorMotion":this.processOperatorMotion(e,t,n);break;case"action":this.processAction(e,t,n);break;case"search":this.processSearch(e,t,n);break;case"ex":case"keyToEx":this.processEx(e,t,n);break;default:}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=W(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var o=t.inputState;if(o.operator){if(o.operator==n.operator)return o.motion="expandToLine",o.motionArgs={linewise:!0},void this.evalInput(e,t);F(e)}o.operator=n.operator,o.operatorArgs=W(n.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var o=t.visualMode,r=W(n.operatorMotionArgs);r&&o&&r.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),o||this.processMotion(e,t,n)},processAction:function(e,t,n){var o=t.inputState,r=o.getRepeat(),i=W(n.actionArgs)||{};o.selectedCharacter&&(i.selectedCharacter=o.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),i.repeat=r||1,i.repeatIsExplicit=!!r,i.registerName=o.registerName,F(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,o,n),Rt[n.action](e,i,t)},processSearch:function(n,e,o){function r(t,r,i){Lt.searchHistoryController.pushInput(t),Lt.searchHistoryController.reset();try{Xe(n,t,r,i)}catch(o){return ze(n,"Invalid regex: "+t),void F(n)}Ot.processMotion(n,e,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:o.searchArgs.toJumplist}})}function i(e){n.scrollTo(h.left,h.top),r(e,!0,!0);var t=Lt.macroModeState;t.isRecording&<(t,e)}function l(o,e,r){var i=t.keyName(o),l,d;"Up"==i||"Down"==i?(l="Up"==i,d=o.target?o.target.selectionEnd:0,e=Lt.searchHistoryController.nextMatch(e,l)||"",r(e),d&&o.target&&(o.target.selectionEnd=o.target.selectionStart=s(d,o.target.value.length))):"Left"!=i&&"Right"!=i&&"Ctrl"!=i&&"Alt"!=i&&"Shift"!=i&&Lt.searchHistoryController.reset();var p;try{p=Xe(n,e,!0,!0)}catch(t){}p?n.scrollIntoView($e(n,!c,p),30):(Ye(n),n.scrollTo(h.left,h.top))}function d(o,e,r){var i=t.keyName(o);"Esc"==i||"Ctrl-C"==i||"Ctrl-["==i||"Backspace"==i&&""==e?(Lt.searchHistoryController.pushInput(e),Lt.searchHistoryController.reset(),Xe(n,m),Ye(n),n.scrollTo(h.left,h.top),t.e_stop(o),F(n),r(),n.focus()):"Up"==i||"Down"==i?t.e_stop(o):"Ctrl-U"==i&&(t.e_stop(o),r(""))}if(n.getSearchCursor){var c=o.searchArgs.forward,p=o.searchArgs.wholeWordOnly;De(n).setReversed(!c);var u=c?"/":"?",m=De(n).getQuery(),h=n.getScrollInfo();switch(o.searchArgs.querySrc){case"prompt":var g=Lt.macroModeState;if(g.isPlaying){var f=g.replaySearchQueries.shift();r(f,!0,!1)}else Ke(n,{onClose:i,prefix:u,desc:Vt,onKeyUp:l,onKeyDown:d});break;case"wordUnderCursor":var y=xe(n,!1,!0,!1,!0),b=!0;if(y||(y=xe(n,!1,!0,!1,!1),b=!1),!y)return;var f=n.getLine(y.start.line).substring(y.start.ch,y.end.ch);f=b&&p?"\\b"+f+"\\b":re(f),Lt.jumpList.cachedCursor=n.getCursor(),n.setCursor(y.start),r(f,!0,!1);}}},processEx:function(n,e,o){function r(e){Lt.exCommandHistoryController.pushInput(e),Lt.exCommandHistoryController.reset(),Wt.processCommand(n,e)}function i(o,e,r){var i=t.keyName(o),l,d;("Esc"==i||"Ctrl-C"==i||"Ctrl-["==i||"Backspace"==i&&""==e)&&(Lt.exCommandHistoryController.pushInput(e),Lt.exCommandHistoryController.reset(),t.e_stop(o),F(n),r(),n.focus()),"Up"==i||"Down"==i?(t.e_stop(o),l="Up"==i,d=o.target?o.target.selectionEnd:0,e=Lt.exCommandHistoryController.nextMatch(e,l)||"",r(e),d&&o.target&&(o.target.selectionEnd=o.target.selectionStart=s(d,o.target.value.length))):"Ctrl-U"==i?(t.e_stop(o),r("")):"Left"!=i&&"Right"!=i&&"Ctrl"!=i&&"Alt"!=i&&"Shift"!=i&&Lt.exCommandHistoryController.reset()}"keyToEx"==o.type?Wt.processCommand(n,o.exArgs.input):e.visualMode?Ke(n,{onClose:r,prefix:":",value:"'<,'>",onKeyDown:i,selectValueOnOpen:!1}):Ke(n,{onClose:r,prefix:":",onKeyDown:i})},evalInput:function(e,t){var n=t.inputState,r=n.motion,s=n.motionArgs||{},l=n.operator,d=n.operatorArgs||{},p=n.registerName,u=t.sel,m=J(t.visualMode?j(e,u.head):e.getCursor("head")),h=J(t.visualMode?j(e,u.anchor):e.getCursor("anchor")),g=J(m),f=J(h),y,b,x;if(l&&this.recordLastEdit(t,n),x=void 0===n.repeatOverride?n.getRepeat():n.repeatOverride,0",Y(b,y)?y:b)):!l&&(y=j(e,y),e.setCursor(y.line,y.ch))}if(l){if(d.lastSel){b=f;var C=d.lastSel,w=o(C.head.line-C.anchor.line),T=o(C.head.ch-C.anchor.ch);y=C.visualLine?c(f.line+w,f.ch):C.visualBlock?c(f.line+w,f.ch+T):C.head.line==C.anchor.line?c(f.line,f.ch+T):c(f.line+w,f.ch),t.visualMode=!0,t.visualLine=C.visualLine,t.visualBlock=C.visualBlock,u=t.sel={anchor:b,head:y},ue(e)}else t.visualMode&&(d.lastSel={anchor:J(u.anchor),head:J(u.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var E,A,I,N,L;if(!t.visualMode){if(E=J(b||f),A=J(y||g),Y(A,E)){var _=E;E=A,A=_}I=s.linewise||d.linewise,I?ye(e,E,A):s.forward&&fe(e,E,A),N="char";var O=!s.inclusive||I;L=me(e,{anchor:E,head:A},N,O)}else if(E=Z(u.head,u.anchor),A=ee(u.head,u.anchor),I=t.visualLine||d.linewise,N=t.visualBlock?"block":I?"line":"char",L=me(e,{anchor:E,head:A},N),I){var M=L.ranges;if("block"==N)for(var D=0;Dp&&r.line==p?this.moveToEol(e,t,n,o):(n.toFirstChar&&(i=be(e.getLine(l)),o.lastHPos=i),o.lastHSPos=e.charCoords(c(l,i),"div").left,c(l,i))},moveByDisplayLines:function(e,t,n,o){var r=t;switch(o.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:o.lastHSPos=e.charCoords(r,"div").left;}var i=n.repeat,s=e.findPosV(r,n.forward?i:-i,"line",o.lastHSPos);if(s.hitSide)if(n.forward)var l=e.charCoords(s,"div"),d={top:l.top+8,left:o.lastHSPos},s=e.coordsChar(d,"div");else{var p=e.charCoords(c(e.firstLine(),0),"div");p.left=o.lastHSPos,s=e.coordsChar(p,"div")}return o.lastHPos=s.ch,s},moveByPage:function(e,t,n){var o=n.repeat;return e.findPosV(t,n.forward?o:-o,"page")},moveByParagraph:function(e,t,n){var o=n.forward?1:-1;return Ne(e,t,n.repeat,o)},moveBySentence:function(e,t,n){var o=n.forward?1:-1;return Le(e,t,n.repeat,o)},moveByScroll:function(e,t,n,o){var r=e.getScrollInfo(),i=null,s=n.repeat;s||(s=r.clientHeight/(2*e.defaultTextHeight()));var l=e.charCoords(t,"local");n.repeat=s;var i=Mt.moveByDisplayLines(e,t,n,o);if(!i)return null;var d=e.charCoords(i,"local");return e.scrollTo(null,r.top+d.top-l.top),i},moveByWords:function(e,t,n){return we(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var o=n.repeat,r=Te(e,o,n.forward,n.selectedCharacter),i=n.forward?-1:1;return(ke(i,n),!r)?null:(r.ch+=i,r)},moveToCharacter:function(e,t,n){var o=n.repeat;return ke(0,n),Te(e,o,n.forward,n.selectedCharacter)||t},moveToSymbol:function(e,t,n){var o=n.repeat;return Se(e,o,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,o){var r=n.repeat;return o.lastHPos=r-1,o.lastHSPos=e.charCoords(t,"div").left,Ee(e,r)},moveToEol:function(e,t,n,o){o.lastHPos=Infinity;var r=c(t.line+n.repeat-1,Infinity),i=e.clipPos(r);return i.ch--,o.lastHSPos=e.charCoords(i,"div").left,r},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return c(n.line,be(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){for(var n=t,o=n.line,r=n.ch,i=e.getLine(o),s;re.lastLine()&&n.linewise&&!g?e.replaceRange("",h,p):e.replaceRange("",d,p),n.linewise&&(!g&&(e.setCursor(h),t.commands.newlineAndIndent(e)),d.ch=r),s=d}else{l=e.getSelection();var f=q("",o.length);e.replaceSelections(f),s=Z(o[0].head,o[0].anchor)}Lt.registerController.pushText(n.registerName,"change",l,n.linewise,1p.top?(c.line+=(d-p.top)/i,c.line=Math.ceil(c.line),e.setCursor(c),p=e.charCoords(c,"local"),e.scrollTo(null,p.top)):e.scrollTo(null,d);else{var u=d+e.getScrollInfo().clientHeight;u=d.anchor.line?p=z(d.head,0,1):p=c(d.anchor.line,0);else if("inplace"==i&&r.visualMode)return;e.setOption("disableInput",!1),n&&n.replace?(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),t.signal(e,"vim-mode-change",{mode:"replace"})):(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),t.signal(e,"vim-mode-change",{mode:"insert"})),Lt.macroModeState.isPlaying||(e.on("change",dt),t.on(e.getInputField(),"keydown",ht)),r.visualMode&&ge(e),se(e,p,u)}},toggleVisualMode:function(e,n,o){var r=n.repeat,i=e.getCursor(),s;o.visualMode?o.visualLine^n.linewise||o.visualBlock^n.blockwise?(o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,t.signal(e,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ue(e)):ge(e):(o.visualMode=!0,o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,s=j(e,c(i.line,i.ch+r-1),!0),o.sel={anchor:i,head:s},t.signal(e,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ue(e),Ae(e,o,"<",Z(i,s)),Ae(e,o,">",ee(i,s)))},reselectLastSelection:function(e,n,o){var r=o.lastSelection;if(o.visualMode&&ce(e,o),r){var i=r.anchorMark.find(),s=r.headMark.find();if(!i||!s)return;o.sel={anchor:i,head:s},o.visualMode=!0,o.visualLine=r.visualLine,o.visualBlock=r.visualBlock,ue(e),Ae(e,o,"<",Z(i,s)),Ae(e,o,">",ee(i,s)),t.signal(e,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var o,r;if(n.visualMode){if(o=e.getCursor("anchor"),r=e.getCursor("head"),Y(r,o)){var s=r;r=o,o=s}r.ch=ne(e,r.line)-1}else{var d=l(t.repeat,2);o=e.getCursor(),r=j(e,c(o.line+d-1,Infinity))}for(var p=0,u=o.line;un)return"";if(e.getOption("indentWithTabs")){var o=r(n/d);return Array(o+1).join("\t")}return Array(n+1).join(" ")});l+=g?"\n":""}if(1e.lastLine()&&e.replaceRange("\n",c(I,0));var N=ne(e,I);Np.length&&(l=p.length),d=c(i.line,l)}if("\n"==r)o.visualMode||e.replaceRange("",i,d),(t.commands.newlineAndIndentContinueComment||t.commands.newlineAndIndent)(e);else{var u=e.getRange(i,d);if(u=u.replace(/[^\n]/g,r),o.visualBlock){var m=Array(e.getOption("tabSize")+1).join(" ");u=e.getSelection(),u=u.replace(/\t/g,m).replace(/[^\n]/g,r).split("\n"),e.replaceSelections(u)}else e.replaceRange(u,i,d);o.visualMode?(i=Y(s[0].anchor,s[0].head)?s[0].anchor:s[0].head,e.setCursor(i),ge(e,!1)):e.setCursor(z(d,0,-1))}},incrementNumberToken:function(e,t){for(var n=e.getCursor(),o=e.getLine(n.line),r=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,i,s,l,d;null!==(i=r.exec(o))&&(s=i.index,l=s+i[0].length,!(n.cht.args.length?void ze(e,e.getOption("theme")):void e.setOption("theme",t.args[0])},map:function(e,t,n){var o=t.args;return!o||2>o.length?void(e&&ze(e,"Invalid mapping: "+t.input)):void Wt.map(o[0],o[1],n)},imap:function(e,t){this.map(e,t,"insert")},nmap:function(e,t){this.map(e,t,"normal")},vmap:function(e,t){this.map(e,t,"visual")},unmap:function(e,t,n){var o=t.args;return!o||1>o.length?void(e&&ze(e,"No such mapping: "+t.input)):void Wt.unmap(o[0],n)},move:function(e,t){Ot.processCommand(e,e.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var n=t.args,o=t.setCfg||{};if(!n||1>n.length)return void(e&&ze(e,"Invalid mapping: "+t.input));var r=n[0].split("="),i=r[0],s=r[1],l=!1;if("?"==i.charAt(i.length-1)){if(s)throw Error("Trailing characters: "+t.argString);i=i.substring(0,i.length-1),l=!0}void 0===s&&"no"==i.substring(0,2)&&(i=i.substring(2),s=!1);var d=At[i]&&"boolean"==At[i].type;if(d&&void 0==s&&(s=!0),!d&&void 0===s||l){var c=O(i,e,o);c instanceof Error?ze(e,c.message):!0===c||!1===c?ze(e," "+(c?"":"no")+i):ze(e," "+i+"="+c)}else{var p=_(i,s,e,o);p instanceof Error&&ze(e,p.message)}},setlocal:function(e,t){t.setCfg={scope:"local"},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:"global"},this.set(e,t)},registers:function(e,t){var n=t.args,o=Lt.registerController.registers,r="----------Registers----------

";if(!n)for(var s in o){var l=o[s].toString();l.length&&(r+="\""+s+" "+l+"
")}else{var s;n=n.join("");for(var d=0;d"}}ze(e,r)},sort:function(e,n){function o(e,t){if(l){var n;n=e,e=t,t=n}d&&(e=e.toLowerCase(),t=t.toLowerCase());var o=u&&x.exec(e),r=u&&x.exec(t);return o?(o=parseInt((o[1]+o[2]).toLowerCase(),v),r=parseInt((r[1]+r[2]).toLowerCase(),v),o-r):e");if(!d)return void ze(e,u);var h=0,g=function(){if(h=u)return void ze(e,"Invalid argument: "+n.argString.substring(i));for(var m=0,h;m<=u-p;m++)h=d(p+m),delete o.marks[h]}else return void ze(e,"Invalid argument: "+l+"-")}else delete o.marks[s]}}},Wt=new qt;return t.keyMap.vim={attach:m,detach:u,call:b},L("insertModeEscKeysTimeout",200,"number"),t.keyMap["vim-insert"]={fallthrough:["default"],attach:m,detach:u,call:b},t.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:m,detach:u,call:b},R(),{buildKeyMap:function(){},getRegisterController:function(){return Lt.registerController},resetVimGlobalState_:R,getVimGlobalState_:function(){return Lt},maybeInitVimState_:D,suppressErrorLogging:!1,InsertModeKey:mt,map:function(e,t,n){Wt.map(e,t,n)},unmap:function(e,t){Wt.unmap(e,t)},setOption:_,getOption:O,defineOption:L,defineEx:function(e,t,n){if(!t)t=e;else if(0!==e.indexOf(t))throw new Error("(Vim.defineEx) \""+t+"\" is not a prefix of \""+e+"\", command not registered");jt[e]=n,Wt.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,n){var o=this.findKey(e,t,n);if("function"==typeof o)return o()},findKey:function(n,o,r){function i(){var e=Lt.macroModeState;if(e.isRecording){if("q"==o)return e.exitMacroRecordMode(),F(n),!0;"mapping"!=r&&it(e,o)}}function s(){if(""==o)return F(n),d.visualMode?ge(n):d.insertMode&&ot(n),!0}function l(e){for(var r;e;)r=/<\w+-.+?>|<\w+>|./.exec(e),o=r[0],e=e.substring(r.index+o.length),t.Vim.handleKey(n,o,"mapping")}var d=D(n),c;return c=d.insertMode?function(){if(s())return!0;for(var t=d.inputState.keyBuffer+=o,r=1==o.length,l=Ot.matchCommand(t,e,d.inputState,"insert");1=r?-1:l.lastIndexOf(o,r-1),-1==d){if(1==i)break;i=1,r=l.length;continue}if(1==i&&dx&&(x=i.length),0>v&&(v=i.length),b=o(x,v),b==i.length)break;if(e.getTokenTypeAt(t.Pos(y,b+1))==u)if(b==x)++m;else if(! --m){g=y,f=b;break outer}++b}return null==g||s==g&&f==p?void 0:{from:t.Pos(s,p),to:t.Pos(g,f)}}}),t.registerHelper("fold","import",function(n,e){function r(r){if(rn.lastLine())return null;var s=n.getTokenAt(t.Pos(r,1));if(/\S/.test(s.string)||(s=n.getTokenAt(t.Pos(r,s.end+1))),"keyword"!=s.type||"import"!=s.string)return null;for(var l=r,i=o(n.lastLine(),r+10);l<=i;++l){var e=n.getLine(l),d=e.indexOf(";");if(-1!=d)return{startCh:s.end,end:t.Pos(l,d)}}}var i=e.line,s=r(i),l;if(!s||r(i-1)||(l=r(i-2))&&l.end.line==i-1)return null;for(var d=s.end,c;;){if(c=r(d.line+1),null==c)break;d=c.end}return{from:n.clipPos(t.Pos(i,s.startCh+1)),to:d}}),t.registerHelper("fold","include",function(e,n){function o(n){if(ne.lastLine())return null;var o=e.getTokenAt(t.Pos(n,1));if(/\S/.test(o.string)||(o=e.getTokenAt(t.Pos(n,o.end+1))),"meta"==o.type&&"#include"==o.string.slice(0,8))return o.start+8}var r=n.line,i=o(r);if(null==i||null!=o(r-1))return null;for(var s=r,l;;){if(l=o(s+1),null==l)break;++s}return{from:t.Pos(r,i+1),to:e.clipPos(t.Pos(s))}})})}});