(function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);(this||window).CodeMirror=e()}})(function(){"use strict";function e(n,o){if(!(this instanceof e))return new e(n,o);this.options=o=o?Fr(o):{},Fr(ii,o,!1),u(o);var r=o.value;"string"==typeof r&&(r=new Li(r,o.mode,null,o.lineSeparator)),this.doc=r;var a=new e.inputStyles[o.inputStyle](this),l=this.display=new t(n,r,a);l.wrapper.CodeMirror=this,d(this),s(this),o.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),o.autofocus&&!Da&&l.input.focus(),f(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 Lr,keySeq:null,specialChars:null};var p=this;for(var c in Ta&&11>wa&&setTimeout(function(){p.display.input.reset(!0)},20),Ht(this),Qr(),xt(this),this.curOp.forceUpdate=!0,Yo(this,r),o.autofocus&&!Da||p.hasFocus()?setTimeout(Br(yn,this),20):bn(this),si)si.hasOwnProperty(c)&&si[c](this,o[c],di);C(this),o.finishInit&&o.finishInit(this);for(var h=0;hwa&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),Ia||Sa&&Da||(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 n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),o(t)}function o(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Ue(e,100),e.state.modeGen++,e.curOp&&Dt(e)}function r(e){var t=bt(e.display),n=e.options.lineWrapping,o=n&&va(5,e.display.scroller.clientWidth/vt(e.display)-3);return function(r){if(Eo(e.doc,r))return 0;var a=0;if(r.widgets)for(var s=0;st.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function u(e){var t=Pr(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):-1wa&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function f(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&es(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Mi(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?rn(t,e):nn(t,e)},t),t.display.scrollbars.addClass&&ts(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=h(e));var n=e.display.barWidth,o=e.display.barHeight;b(e,t);for(var r=0;4>r&&n!=e.display.barWidth||o!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&L(e),b(e,h(e)),n=e.display.barWidth,o=e.display.barHeight}function b(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 v(e,t,n){var o=n&&null!=n.top?va(0,n.top):e.scroller.scrollTop;o=fa(o-je(e));var r=n&&null!=n.bottom?n.bottom:o+e.wrapper.clientHeight,a=nr(t,o),i=nr(t,r);if(n&&n.ensure){var s=n.ensure.from.line,d=n.ensure.to.line;s=i&&(a=nr(t,or(Jo(t,d))-e.wrapper.clientHeight),i=d)}return{from:a,to:va(i,a+1)}}function x(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var o=E(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,a=o+"px",s=0;s=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Wt(e))return!1;C(e)&&(Ft(e),t.dims=O(e));var r=o.first+o.size,a=va(t.visible.from-e.options.viewportMargin,o.first),i=ga(r,t.visible.to+e.options.viewportMargin);n.viewFroma-n.viewFrom&&(a=va(o.first,n.viewFrom)),n.viewTo>i&&20>n.viewTo-i&&(i=ga(r,n.viewTo)),ja&&(a=Co(e.doc,a),i=So(e.doc,i));var s=a!=n.viewFrom||i!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vt(e,a,i),n.viewOffset=or(Jo(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var d=Wt(e);if(!s&&0==d&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var l=zr();return 4=e.display.viewFrom&&t.visible.to<=e.display.viewTo))break;if(!w(e,t))break;L(e);var r=h(e);_e(e),y(e,r),A(e,r)}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 N(e,t){var n=new k(e,t);if(w(e,n)){L(e),I(e,n);var o=h(e);_e(e),y(e,o),A(e,o),n.finish()}}function A(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ke(e)+"px"}function L(e){for(var t=e.display,n=t.lineDiv.offsetTop,o=0;owa){var i=r.node.offsetTop+r.node.offsetHeight;a=i-n,n=i}else{var s=r.node.getBoundingClientRect();a=s.bottom-s.top}var d=r.line.height-a;if(2>a&&(a=bt(t)),(.001d)&&(er(r.line,a),R(r.line),r.rest))for(var l=0;lwa&&(e.node.style.zIndex=2)),e.node}function M(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=D(e);e.background=n.insertBefore(Hr("div",null,t),n.firstChild)}}function F(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Uo(e,t)}function B(e,t){var n=t.text.className,o=F(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,U(t)):n&&(t.text.className=n)}function U(e){M(e),e.line.wrapClass?D(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function V(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=D(t);t.gutterBackground=Hr("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px; width: "+o.gutterTotalWidth+"px"),r.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var r=D(t),i=t.gutter=Hr("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?o.fixedPos:-o.gutterTotalWidth)+"px");if(e.display.input.setUneditable(i),r.insertBefore(i,t.text),t.line.gutterClass&&(i.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=i.appendChild(Hr("div",S(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+o.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var s=0;sza(e,t)?t:e}function X(e,t){return 0>za(e,t)?e:t}function Q(e){e.state.focused||(e.display.input.focus(),yn(e))}function Y(e,t,n,o,r){var a=e.doc;e.display.shift=!1,o||(o=a.sel);var s=e.state.pasteIncoming||"paste"==r,d=a.splitLines(t),l=null;if(s&&1r?l.map:p[r];for(var i=0,s;ir?e.line:e.rest[r]),c=a[i]+o;return(0>o||s!=t)&&(c=a[i+(o?1:0)]),qa(d,c)}}}var r=e.text.firstChild,a=!1;if(!t||!Zi(r,t))return ae(qa(tr(e.line),0),!0);if(t==r&&(a=!0,t=r.childNodes[n],n=0,!t)){var i=e.rest?Or(e.rest):e.line;return ae(qa(tr(i),i.text.length),a)}var s=3==t.nodeType?t:null,d=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,n&&(n=s.nodeValue.length));d.parentNode!=r;)d=d.parentNode;var l=e.measure,p=l.maps,c=o(s,d,n);if(c)return ae(c,a);for(var u=d.nextSibling,h=s?s.nodeValue.length-n:0;u;u=u.nextSibling){if(c=o(u,u.firstChild,0),c)return ae(qa(c.line,c.ch-h),a);h+=u.textContent.length}for(var m=d.previousSibling,h=n;m;m=m.previousSibling){if(c=o(m,m.firstChild,-1),c)return ae(qa(c.line,c.ch+h),a);h+=u.textContent.length}}function le(e,t,n,o,r){function a(e){return function(t){return t.id==e}}function s(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(d+=n);var p=t.getAttribute("cm-marker"),c;if(p){var u=e.findMarks(qa(o,0),qa(r+1,0),a(+p));return void(u.length&&(c=u[0].find())&&(d+=$o(e.doc,c.from,c.to).join(i)))}if("false"==t.getAttribute("contenteditable"))return;for(var h=0;hn?qa(n,Jo(e,n).text.length):fe(t,Jo(e,t.line).text.length)}function fe(e,t){var n=e.ch;return null==n||n>t?qa(e.line,t):0>n?qa(e.line,0):e}function ye(e,t){return t>=e.first&&tza(n,r);a==0>za(o,r)?a!=0>za(n,o)&&(n=o):(r=n,n=o)}return new ce(r,n)}return new ce(o||n,n)}function xe(e,t,n,o){we(e,new pe([ve(e,e.sel.primary(),t,n)],0),o)}function Ce(e,t,n){for(var o=[],r=0;rza(t.primary().head,e.sel.primary().head)?-1:1);Ne(e,Le(e,t,o,!0)),!(n&&!1===n.scroll)&&e.cm&&Bn(e.cm)}function Ne(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Ir(e.cm)),kr(e,"cursorActivity",e))}function Ae(e){Ne(e,Le(e,e.sel,null,!1),Hi)}function Le(e,t,n,o){for(var r=0,a;r=t.ch:i.to>t.ch))){if(r&&(Bi(d,"beforeCursorEnter"),d.explicitlyCleared))if(!a.markedSpans)break;else{--s;continue}if(!d.atomic)continue;if(n){var l=d.find(0>o?1:-1),p;if((0>o?d.inclusiveRight:d.inclusiveLeft)&&(l=Pe(e,l,-o,l&&l.line==t.line?a:null)),l&&l.line==t.line&&(p=za(l,n))&&(0>o?0>p:0o?-1:1);return(0>o?d.inclusiveLeft:d.inclusiveRight)&&(c=Pe(e,c,o,c.line==t.line?a:null)),c?Re(e,c,t,o,r):null}}return t}function Oe(e,t,n,o,r){var a=o||1,i=Re(e,t,n,a,r)||!r&&Re(e,t,n,a,!0)||Re(e,t,n,-a,r)||!r&&Re(e,t,n,-a,!0);return i?i:(e.cantEdit=!0,qa(e.first,0))}function Pe(e,t,n,o){return 0>n&&0==t.ch?t.line>e.first?ge(e,qa(t.line-1)):null:0=e.display.viewTo||i.to().linet&&(t=0),t=ya(t),o=ya(o),s.appendChild(Hr("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?p-e:n)+"px; height: "+(o-t)+"px"))}function r(t,n,r){function a(n,o){return ut(e,qa(t,n),"div",s,o)}var s=Jo(i,t),d=s.text.length,c,u;return ea(rr(s),n||0,null==r?d:r,function(e,t,i){var s=a(e,"left"),h,m,g;if(e==t)h=s,m=g=s.left;else{if(h=a(t-1,"right"),"rtl"==i){var f=s;s=h,h=f}m=s.left,g=h.right}null==n&&0==e&&(m=l),3u.bottom||h.bottom==u.bottom&&h.right>u.right)&&(u=h),me.options.cursorBlinkRate&&(t.cursorDiv.style.visibility="hidden")}}function Ue(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var n=+new Date+e.options.workTime,o=mi(t.mode,He(e,t.frontier)),r=[];t.iter(t.frontier,ga(t.first+t.size,e.display.viewTo+500),function(a){if(t.frontier>=e.display.viewFrom){var s=a.styles,d=a.text.length>e.options.maxHighlightLength,l=Do(e,a,d?mi(t.mode,o):o,!0);a.styles=l.styles;var p=a.styleClasses,c=l.classes;c?a.styleClasses=c:p&&(a.styleClasses=null);for(var u=!s||s.length!=a.styles.length||p!=c&&(!p||!c||p.bgClass!=c.bgClass||p.textClass!=c.textClass),h=0;!u&&hn)?(Ue(e,e.options.workDelay),!0):void 0}),r.length&&At(e,function(){for(var t=0;tr;--a){if(a<=o.first)return o.first;var d=Jo(o,a-1);if(d.stateAfter&&(!n||a<=o.frontier))return a;var l=zi(d.text,null,e.options.tabSize);(null==s||i>l)&&(s=a-1,i=l)}return s}function He(e,t,n){var o=e.doc,r=e.display;if(!o.mode.startState)return!0;var a=We(e,t,n),i=a>o.first&&Jo(o,a-1).stateAfter;return i=i?mi(o.mode,i):gi(o.mode),o.iter(a,t,function(n){Fo(e,n.text,i);var s=a==t-1||0==a%5||a>=r.viewFrom&&an)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Je(e,t){t=vo(t);var n=tr(t),o=e.display.externalMeasured=new Pt(e.doc,t,n);o.lineN=n;var r=o.built=Uo(e,o);return o.text=r.pre,qr(e.display.lineMeasure,r.pre),o}function $e(e,t,n,o){return tt(e,et(e,t),n,o)}function Ze(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=l-d,a=i-1,t>=l&&(s="right")),null!=a){if(r=e[o+2],d==l&&n==(r.insertLeft?"left":"right")&&(s=n),"left"==n&&0==a)for(;o&&e[o-2]==e[o-3]&&e[o-1].insertLeft;)r=e[(o-=3)+2],s="left";if("right"==n&&a==l-d)for(;oc;c++){for(;s&&Wr(t.line.text.charAt(r.coverStart+s));)--s;for(;r.coverStart+dwa&&0==s&&d==r.coverEnd-r.coverStart)p=a.parentNode.getBoundingClientRect();else if(Ta&&e.options.lineWrapping){var i=$i(a,s,d).getClientRects();p=i.length?i["right"==o?i.length-1:0]:Ga}else p=$i(a,s,d).getBoundingClientRect()||Ga;if(p.left||p.right||0==s)break;d=s,--s,l="right"}Ta&&11>wa&&(p=rt(e.display.measure,p))}else{0wa&&!s&&(!p||!p.left&&!p.right)){var u=a.parentNode.getClientRects()[0];p=u?{left:u.left,right:u.left+vt(e.display),top:u.top,bottom:u.bottom}:Ga}for(var h=p.top-t.rect.top,m=p.bottom-t.rect.top,g=t.view.measure.heights,c=0;cn.from?i(e-1):i(e,o)}o=o||Jo(e.doc,t.line),r||(r=et(e,o));var d=rr(o),l=t.ch;if(!d)return i(l);var p=la(d,l),c=s(l,p);return null!=us&&(c.other=s(l,us)),c}function mt(e,t){var n=0,t=ge(e.doc,t);e.options.lineWrapping||(n=vt(e.display)*t.ch);var o=Jo(e.doc,t.line),r=or(o)+je(e.display);return{left:n,right:n,top:r,bottom:r+o.height}}function gt(e,t,n,o){var r=qa(e,t);return r.xRel=o,n&&(r.outside=!0),r}function ft(e,t,n){var o=e.doc;if(n+=e.display.viewOffset,0>n)return gt(o.first,0,!0,-1);var r=nr(o,n),a=o.first+o.size-1;if(r>a)return gt(o.first+o.size-1,Jo(o,a).text.length,!0,1);0>t&&(t=0);for(var i=Jo(o,r);;){var s=yt(e,i,r,t,n),d=yo(i),l=d&&d.find(0,!0);if(d&&(s.ch>l.from.ch||s.ch==l.from.ch&&0r.bottom)?r.left-l:sy)return gt(n,m,b,1);for(;;){if(c?m==h||m==ca(t,h,1):1>=m-h){for(var v=ox?-1:1o?(m=E,y=i,(b=d)&&(y+=1e3),u=S):(h=E,g=i,f=d,u-=S)}}function bt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Za){Za=Hr("pre");for(var t=0;49>t;++t)Za.appendChild(document.createTextNode("x")),Za.appendChild(Hr("br"));Za.appendChild(document.createTextNode("x"))}qr(e.measure,Za);var n=Za.offsetHeight/50;return 3=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new k(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Tt(e){e.updatedDisplay=e.mustUpdate&&w(e.cm,e.update)}function wt(e){var t=e.cm,n=t.display;e.updatedDisplay&&L(t),e.barMeasure=h(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$e(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=va(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ke(t)+t.display.barWidth),e.maxScrollLeft=va(0,n.sizer.offsetLeft+e.adjustWidthTo-Ge(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function It(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)ja&&Co(e.doc,t)r.viewFrom?Ft(e):(r.viewFrom+=o,r.viewTo+=o);else if(t<=r.viewFrom&&n>=r.viewTo)Ft(e);else if(t<=r.viewFrom){var a=Ut(e,n,n+o,1);a?(r.view=r.view.slice(a.index),r.viewFrom=a.lineN,r.viewTo+=o):Ft(e)}else if(n>=r.viewTo){var a=Ut(e,t,t,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):Ft(e)}else{var i=Ut(e,t,t,-1),s=Ut(e,n,n+o,1);i&&s?(r.view=r.view.slice(0,i.index).concat(_t(e,i.lineN,s.lineN)).concat(r.view.slice(s.index)),r.viewTo+=o):Ft(e)}var d=r.externalMeasured;d&&(n=r.lineN&&t=o.viewTo)){var a=o.view[Bt(e,t)];if(null!=a.node){var i=a.changes||(a.changes=[]);-1==Pr(i,n)&&i.push(n)}}}function Ft(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Bt(e,t){if(t>=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 Ut(e,t,o,r){var a=Bt(e,t),s=e.display.view,d;if(!ja||o==e.doc.first+e.doc.size)return{index:a,lineN:o};for(var l=0,i=e.display.viewFrom;lr?0:s.length-1))return null;o+=r*s[a-(0>r?1:0)].size,a+=r}return{index:a,lineN:o}}function Vt(e,t,n){var o=e.display,r=o.view;0==r.length||t>=o.viewTo||n<=o.viewFrom?(o.view=_t(e,t,n),o.viewFrom=t):(o.viewFrom>t?o.view=_t(e,t,o.viewFrom).concat(o.view):o.viewFromn&&(o.view=o.view.slice(0,Bt(e,n)))),o.viewTo=n}function Wt(e){for(var t=e.display.view,n=0,o=0,r;o=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 400wa?Mi(a.scroller,"dblclick",Lt(t,function(n){if(!wr(t,n)){var e=zt(t,n);if(!(!e||Jt(t,n)||qt(t.display,n))){Pi(n);var o=t.findWordAt(e);xe(t.doc,o.anchor,o.head)}}})):Mi(a.scroller,"dblclick",function(n){wr(t,n)||Pi(n)}),Wa||Mi(a.scroller,"contextmenu",function(n){vn(t,n)});var i={end:0},s;Mi(a.scroller,"touchstart",function(n){if(!wr(t,n)&&!o(n)){clearTimeout(s);var e=+new Date;a.activeTouch={start:e,moved:!1,prev:300>=e-i.end?i:null},1==n.touches.length&&(a.activeTouch.left=n.touches[0].pageX,a.activeTouch.top=n.touches[0].pageY)}}),Mi(a.scroller,"touchmove",function(){a.activeTouch&&(a.activeTouch.moved=!0)}),Mi(a.scroller,"touchend",function(o){var e=a.activeTouch;if(e&&!qt(a,o)&&null!=e.left&&!e.moved&&300>new Date-e.start){var i=t.coordsChar(a.activeTouch,"page"),s;s=!e.prev||r(e,e.prev)?new ce(i,i):!e.prev.prev||r(e,e.prev.prev)?t.findWordAt(i):new ce(qa(i.line,0),ge(t.doc,qa(i.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),Pi(o)}n()}),Mi(a.scroller,"touchcancel",n),Mi(a.scroller,"scroll",function(){a.scroller.clientHeight&&(nn(t,a.scroller.scrollTop),rn(t,a.scroller.scrollLeft,!0),Bi(t,"scroll",t))}),Mi(a.scroller,"mousewheel",function(n){an(t,n)}),Mi(a.scroller,"DOMMouseScroll",function(n){an(t,n)}),Mi(a.wrapper,"scroll",function(){a.wrapper.scrollTop=a.wrapper.scrollLeft=0}),a.dragFunctions={enter:function(n){wr(t,n)||Di(n)},over:function(n){wr(t,n)||(en(t,n),Di(n))},start:function(n){Zt(t,n)},drop:Lt(t,$t),leave:function(n){wr(t,n)||tn(t)}};var e=a.input.getField();Mi(e,"keyup",function(n){mn.call(t,n)}),Mi(e,"keydown",Lt(t,un)),Mi(e,"keypress",Lt(t,gn)),Mi(e,"focus",Br(yn,t)),Mi(e,"blur",Br(bn,t))}function jt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function qt(t,o){for(var e=Cr(o);e!=t.wrapper;e=e.parentNode)if(!e||1==e.nodeType&&"true"==e.getAttribute("cm-ignore-events")||e.parentNode==t.sizer&&e!=t.mover)return!0}function zt(t,n,e,o){var r=t.display;if(!e&&"true"==Cr(n).getAttribute("cm-not-content"))return null;var a=r.lineSpace.getBoundingClientRect(),i,s;try{i=n.clientX-a.left,s=n.clientY-a.top}catch(t){return null}var d=ft(t,i,s),l;if(o&&1==d.xRel&&(l=Jo(t.doc,d.line).text).length==d.ch){var p=zi(l,l.length,t.options.tabSize)-l.length;d=qa(d.line,va(0,ya((i-ze(t.display).left)/vt(t.display))-p))}return d}function Kt(t){var e=this,n=e.display;if(!(wr(e,t)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=t.shiftKey,qt(n,t))return void(Ia||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!Jt(e,t)){var o=zt(e,t);switch(window.focus(),Sr(t)){case 1:e.state.selectingText?e.state.selectingText(t):o?Gt(e,t,o):Cr(t)==n.scroller&&Pi(t);break;case 2:Ia&&(e.state.lastMiddleDown=+new Date),o&&xe(e.doc,o),setTimeout(function(){n.input.focus()},20),Pi(t);break;case 3:Wa?vn(e,t):fn(e);}}}}function Gt(t,n,e){Ta?setTimeout(Br(Q,t),0):t.curOp.focus=zr();var o=+new Date,r;ti&&ti.time>o-400&&0==za(ti.pos,e)?r="triple":ei&&ei.time>o-400&&0==za(ei.pos,e)?(r="double",ti={time:o,pos:e}):(r="single",ei={time:o,pos:e});var a=t.doc.sel,i=Ma?n.metaKey:n.ctrlKey,s;t.options.dragDrop&&os&&!t.isReadOnly()&&"single"==r&&-1<(s=a.contains(e))&&(0>za((s=a.ranges[s]).from(),e)||0e.xRel)?Xt(t,n,e,i):Qt(t,n,e,r,i)}function Xt(t,n,e,o){var r=t.display,a=+new Date,i=Lt(t,function(s){Ia&&(r.scroller.draggable=!1),t.state.draggingText=!1,Fi(document,"mouseup",i),Fi(r.scroller,"drop",i),10>ha(n.clientX-s.clientX)+ha(n.clientY-s.clientY)&&(Pi(s),!o&&+new Date-200b&&r.push(new ce(qa(m,b),qa(m,Ki(y,c,a))))}r.length||r.push(new ce(e,e)),we(l,ue(p.ranges.slice(0,h).concat(r),h),{origin:"*mouse",scroll:!1}),t.scrollIntoView(n)}else{var v=u,x=v.anchor,C=n;if("single"!=o){if("double"==o)var S=t.findWordAt(n);else var S=new ce(qa(n.line,0),ge(l,qa(n.line+1,0)));0=s.to||r.liney.bottom?20:0;p&&setTimeout(Lt(t,function(){b!=e||(d.scroller.scrollTop+=p,i(n))}),50)}}function s(n){t.state.selectingText=!1,b=Infinity,Pi(n),d.input.focus(),Fi(document,"mousemove",x),Fi(document,"mouseup",C),l.history.lastSelOrigin=null}var d=t.display,l=t.doc;Pi(n);var p=l.sel,c=p.ranges,u,h;if(r&&!n.shiftKey?(h=l.sel.contains(e),u=-1=fa(t.display.gutters.getBoundingClientRect().right))return!1;o&&Pi(n);var s=t.display,d=s.lineDiv.getBoundingClientRect();if(a>d.bottom||!Nr(t,e))return xr(n);a-=d.top-s.viewOffset;for(var l=0,i;l=r){var p=nr(t.doc,a),c=t.options.gutters[l];return Bi(t,e,t,p,c,n),xr(n)}}function Jt(t,n){return Yt(t,n,"gutterClick",!0)}function $t(t){var e=this;if(tn(e),!(wr(e,t)||qt(e.display,t))){Pi(t),Ta&&(Ya=+new Date);var o=zt(e,t,!0),r=t.dataTransfer.files;if(o&&!e.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var a=r.length,n=Array(a),s=0,d=function(t,r){if(!(e.options.allowDropFileTypes&&-1==Pr(e.options.allowDropFileTypes,t.type))){var i=new FileReader;i.onload=Lt(e,function(){var t=i.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(t)&&(t=""),n[r]=t,++s==a){o=ge(e.doc,o);var d={from:o,to:o,text:e.doc.splitLines(n.join(e.doc.lineSeparator())),origin:"paste"};wn(e.doc,d),Te(e.doc,he(o,ai(d)))}}),i.readAsText(t)}},l=0;l+new Date-Ya))return void Di(n);if(!(wr(t,n)||qt(t.display,n))&&(n.dataTransfer.setData("Text",t.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!Ra)){var e=Hr("img",null,null,"position: fixed; left: 0; top: 0;");e.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",La&&(e.width=e.height=1,t.display.wrapper.appendChild(e),e._top=e.offsetTop),n.dataTransfer.setDragImage(e,0,0),La&&e.parentNode.removeChild(e)}}function en(t,n){var e=zt(t,n);if(e){var o=document.createDocumentFragment();Me(t,e,o),t.display.dragCursor||(t.display.dragCursor=Hr("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),qr(t.display.dragCursor,o)}}function tn(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function nn(e,t){2>ha(e.doc.scrollTop-t)||(e.doc.scrollTop=t,!Sa&&N(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),Sa&&N(e),Ue(e,100))}function rn(e,t,n){(n?t==e.doc.scrollLeft:2>ha(e.doc.scrollLeft-t))||(t=ga(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,x(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function an(t,n){var e=ni(n),o=e.x,r=e.y,a=t.display,s=a.scroller,d=s.scrollWidth>s.clientWidth,l=s.scrollHeight>s.clientHeight;if(o&&d||r&&l){if(r&&Ma&&Ia)outer:for(var p=n.target,c=a.view;p!=s;p=p.parentNode)for(var u=0;ui?h=va(0,h+i-50):m=ga(t.doc.height,m+i+50),N(t,{top:h,bottom:m})}20>Ja&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=o,a.wheelDY=r,setTimeout(function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&($a=($a*Ja+n)/(Ja+1),++Ja)}},200)):(a.wheelDX+=o,a.wheelDY+=r))}}function sn(e,t,n){if("string"==typeof t&&(t=fi[t],!t))return!1;e.display.input.ensurePolled();var o=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=Wi}finally{e.display.shift=o,e.state.suppressEdits=!1}return r}function dn(e,t,n){for(var o=0,r;owa&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var o=pn(e,t);La&&(ri=o?n:null,!o&&88==n&&!is&&(Ma?t.metaKey:t.ctrlKey)&&e.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||hn(e)}}function hn(e){function t(o){18!=o.keyCode&&o.altKey||(es(n,"CodeMirror-crosshair"),Fi(document,"keyup",t),Fi(document,"mouseover",t))}var n=e.display.lineDiv;ts(n,"CodeMirror-crosshair"),Mi(document,"keyup",t),Mi(document,"mouseover",t)}function mn(t){16==t.keyCode&&(this.doc.sel.shift=!1),wr(this,t)}function gn(t){var e=this;if(!(qt(e.display,t)||wr(e,t)||t.ctrlKey&&!t.altKey||Ma&&t.metaKey)){var n=t.keyCode,o=t.charCode;if(La&&n==ri)return ri=null,void Pi(t);if(!(La&&(!t.which||10>t.which)&&pn(e,t))){var r=ma(null==o?n:o);cn(e,t,r)||e.display.input.onKeyPress(t)}}}function fn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,bn(e))},100)}function yn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"==e.options.readOnly||(!e.state.focused&&(Bi(e,"focus",e),e.state.focused=!0,ts(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),Ia&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Be(e))}function bn(e){e.state.delayingBlurEvent||(e.state.focused&&(Bi(e,"blur",e),e.state.focused=!1,es(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function vn(t,n){qt(t.display,n)||xn(t,n)||wr(t,n,"contextmenu")||t.display.input.onContextMenu(n)}function xn(t,n){return!!Nr(t,"gutterContextMenu")&&Yt(t,n,"gutterContextMenu",!1)}function Cn(e,t){if(0>za(e,t.from))return e;if(0>=za(e,t.to))return ai(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+=ai(t).ch-t.to.ch),qa(n,o)}function Sn(e,t){for(var n=[],o=0,r;oza(p.head,p.anchor);o[s]=new ce(c?l:d,c?d:l)}else o[s]=new ce(d,d)}return new pe(o,e.sel.primIndex)}function Tn(e,t,n){var o={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(o.update=function(t,n,o,r){t&&(this.from=ge(e,t)),n&&(this.to=ge(e,n)),o&&(this.text=o),void 0!==r&&(this.origin=r)}),Bi(e,"beforeChange",e,o),e.cm&&Bi(e.cm,"beforeChange",e.cm,o),o.canceled?null:{from:o.from,to:o.to,text:o.text,origin:o.origin}}function wn(e,t,n){if(e.cm){if(!e.cm.curOp)return Lt(e.cm,wn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Nr(e,"beforeChange")||e.cm&&Nr(e.cm,"beforeChange"))&&(t=Tn(e,t,!0),!t))){var o=Ha&&!n&&lo(e,t.from,t.to);if(o)for(var r=o.length-1;0<=r;--r)In(e,{from:o[r].from,to:o[r].to,text:r?[""]:t.text});else In(e,t)}}function In(e,t){if(1!=t.text.length||""!=t.text[0]||0!=za(t.from,t.to)){var n=Sn(e,t);lr(e,t,n,e.cm?e.cm.curOp.id:NaN),Ln(e,t,n,ao(e,t));var o=[];Qo(e,function(e,n){n||-1!=Pr(o,e.history)||(vr(e.history,t),o.push(e.history)),Ln(e,t,null,ao(e,t))})}}function Nn(e,t,n){if(!(e.cm&&e.cm.state.suppressEdits)){for(var o=e.history,r=e.sel,a="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,d=0,l;de.lastLine())){if(t.from.linea&&(t={from:t.from,to:qa(a,Jo(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=$o(e,t.from,t.to),n||(n=Sn(e,t)),e.cm?Rn(e.cm,t,o):Ko(e,t,o),Ie(e,n,Hi)}}function Rn(e,t,n){var o=e.doc,a=e.display,i=t.from,s=t.to,d=!1,l=i.line;e.options.lineWrapping||(l=tr(vo(Jo(o,i.line))),o.iter(l,s.line+1,function(e){if(e==a.maxLine)return d=!0,!0})),-1a.maxLineLength&&(a.maxLine=e,a.maxLineLength=t,a.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0)),o.frontier=ga(o.frontier,i.line),Ue(e,400);var c=t.text.length-(s.line-i.line)-1;t.full?Dt(e):i.line!=s.line||1!=t.text.length||zo(e.doc,t)?Dt(e,i.line,s.line+1,c):Mt(e,i.line,"text");var u=Nr(e,"changes"),h=Nr(e,"change");if(h||u){var m={from:i,to:s,text:t.text,removed:t.removed,origin:t.origin};h&&kr(e,"change",e,m),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(m)}e.display.selForContextMenu=null}function On(e,t,n,o,r){if(o||(o=n),0>za(o,n)){var a=o;o=n,n=a}"string"==typeof t&&(t=e.splitLines(t)),wn(e,{from:n,to:o,text:t,origin:r})}function Pn(e,t){if(!wr(e,"scrollCursorIntoView")){var n=e.display,o=n.sizer.getBoundingClientRect(),r=null;if(0>t.top+o.top?r=!0:t.bottom+o.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!Pa){var a=Hr("div","\u200B",null,"position: absolute; top: "+(t.top-n.viewOffset-je(e.display))+"px; height: "+(t.bottom-t.top+Ke(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(r),e.display.lineSpace.removeChild(a)}}}function _n(e,t,n,o){null==o&&(o=0);for(var r=0;5>r;r++){var a=!1,i=ht(e,t),s=n&&n!=t?ht(e,n):i,d=Mn(e,ga(i.left,s.left),ga(i.top,s.top)-o,va(i.left,s.left),va(i.bottom,s.bottom)+o),l=e.doc.scrollTop,p=e.doc.scrollLeft;if(null!=d.scrollTop&&(nn(e,d.scrollTop),1n&&(n=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:a.scroller.scrollTop,d=Xe(e),l={};r-n>d&&(r=n+d);var p=e.doc.height+qe(a),c=np-i;if(ns+d){var h=ga(n,(u?p:r)-d);h!=s&&(l.scrollTop=h)}var m=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:a.scroller.scrollLeft,g=Ge(e)-(e.options.fixedGutter?a.gutters.offsetWidth:0),f=o-t>g;return f&&(o=t+g),10>t?l.scrollLeft=0:tg+m-3&&(l.scrollLeft=o+(f?0:10)-g),l}function Fn(e,t,n){(null!=t||null!=n)&&Un(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Bn(e){Un(e);var t=e.getCursor(),n=t,o=t;e.options.lineWrapping||(n=t.ch?qa(t.line,t.ch-1):t,o=qa(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:o,margin:e.options.cursorScrollMargin,isCursor:!0}}function Un(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=mt(e,t.from),o=mt(e,t.to),r=Mn(e,ga(n.left,o.left),ga(n.top,o.top)-t.margin,va(n.right,o.right),va(n.bottom,o.bottom)+t.margin);e.scrollTo(r.scrollLeft,r.scrollTop)}}function Vn(e,t,n,o){var r=e.doc,a;null==n&&(n="add"),"smart"==n&&(r.mode.indent?a=He(e,t):n="prev");var s=e.options.tabSize,d=Jo(r,t),l=zi(d.text,null,s);d.stateAfter&&(d.stateAfter=null);var p=d.text.match(/^\s*/)[0],c;if(!o&&!/\S/.test(d.text))c=0,n="not";else if("smart"==n&&(c=r.mode.indent(a,d.text.slice(p.length),d.text),c==Wi||150r.first?c=zi(Jo(r,t-1).text,null,s):c=0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=va(0,c);var u="",h=0;if(e.options.indentWithTabs)for(var m=fa(c/s);m;--m)h+=s,u+="\t";if(h=za(a.from,Or(o).to);){var i=o.pop();if(0>za(i.from,a.from)){a.from=i.from;break}}o.push(a)}At(e,function(){for(var t=o.length-1;0<=t;t--)On(e.doc,"",o[t].from,o[t].to,"+delete");Bn(e)})}function jn(e,t,n,o,r){function a(){var t=s+n;return t=e.first+e.size?!1:(s=t,p=Jo(e,t))}function i(e){var t=(r?ca:ua)(p,d,n,!0);if(null!=t)d=t;else if(!e&&a())d=r?(0>n?ra:oa)(p):0>n?p.text.length:0;else return!1;return!0}var s=t.line,d=t.ch,l=n,p=Jo(e,s);if("char"==o)i();else if("column"==o)i(!0);else if("word"==o||"group"==o)for(var c=null,u="group"==o,h=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;;m=!1){if(0>n&&!i(!m))break;var g=p.text.charAt(d)||"\n",f=Ur(g,h)?"w":u&&"\n"==g?"n":!u||/\s/.test(g)?null:"p";if(!u||m||f||(f="s"),c&&c!=f){0>n&&(n=1,i());break}if(f&&(c=f),0n?1.5:.5)*bt(e.display))}else"line"==o&&(i=0n?0>=i:i>=r.height){d.hitSide=!0;break}i+=5*n}return d}function zn(t,n,o,r){e.defaults[t]=n,o&&(si[t]=r?function(e,t,n){n!=di&&o(e,t,n)}:o)}function Kn(e){for(var t=e.split(/-(?!$)/),e=t[t.length-1],n=0,o,r,a,i,s;n=t:a.to>t);(r||(r=[])).push(new Zn(i,a.from,d?null:a.to))}}return r}function ro(e,t,n){if(e)for(var o=0,r;o=t:a.to>t);if(s||a.from==t&&"bookmark"==i.type&&(!n||a.marker.insertLeft)){var d=null==a.from||(i.inclusiveLeft?a.from<=t:a.fromza(l.to,s.from)||0c)&&(i.inclusiveLeft||c)||p.push({from:l.from,to:s.from}),!(0mo(o,a.marker))&&(o=a.marker);return o}function fo(e){return go(e,!0)}function yo(e){return go(e,!1)}function bo(e,t,n,o,r){var a=Jo(e,t),s=ja&&a.markedSpans;if(s)for(var d=0,i;d=c||0>=p&&0<=c)&&(0>=p&&(0za(l.from,o)||i.marker.inclusiveLeft&&r.inclusiveRight)))return!0}}function vo(e){for(var t;t=fo(e);)e=t.find(-1,!0).line;return e}function xo(e){for(var t,n;t=yo(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Co(e,t){var n=Jo(e,t),o=vo(n);return n==o?t:tr(o)}function So(e,t){if(t>e.lastLine())return t;var n=Jo(e,t),o;if(!Eo(e,n))return t;for(;o=yo(n);)n=o.find(1,!0).line;return tr(n)+1}function Eo(e,t){var n=ja&&t.markedSpans;if(n)for(var o=0,r;oa;a++){r&&(r[0]=e.innerMode(t,o).mode);var i=t.token(n,o);if(n.pos>n.start)return i}throw new Error("Mode "+t.name+" failed to advance stream.")}function Po(e,t,n,o){function r(e){return{start:p.start,end:p.pos,string:p.current(),type:s||null,state:e?mi(a.mode,l):l}}var a=e.doc,i=a.mode,s;t=ge(a,t);var d=Jo(a,t.line),l=He(e,t.line,n),p=new Ci(d.text,e.options.tabSize),c;for(o&&(c=[]);(o||p.pose.options.maxHighlightLength?(s=!1,i&&Fo(e,t,o,p.pos),p.pos=t.length,u=null):u=Lo(Oo(n,p,o,c),a),c){var h=c[0].name;h&&(u="m-"+(u?h+" "+u:h))}if(!s||l!=u){for(;de&&a.splice(l,1,e,a[l+1],r),l+=2,i=ga(e,r);if(t)if(o.opaque)a.splice(n,l-n,e,"cm-overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength?mi(e.doc.mode,o):o);t.stateAfter=o,t.styles=r.styles,r.classes?t.styleClasses=r.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Fo(e,t,n,o){var r=e.doc.mode,a=new Ci(t,e.options.tabSize);for(a.start=a.pos=o||0,""==t&&Ro(r,n);!a.eol();)Oo(r,a,n),a.start=a.pos}function Bo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ni:Ii;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Uo(e,t){var n=Hr("span",null,null,Ia?"padding-right: .1px":null),o={pre:Hr("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(Ta||Ia)&&e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var a=r?t.rest[r-1]:t.line,i;o.pos=0,o.addToken=Vo,$r(e.display.measure)&&(i=rr(a))&&(o.addToken=Ho(o.addToken,i)),o.map=[];var s=t!=e.display.externalMeasured&&tr(a);qo(a,o,Mo(e,a,s)),a.styleClasses&&(a.styleClasses.bgClass&&(o.bgClass=Gr(a.styleClasses.bgClass,o.bgClass||"")),a.styleClasses.textClass&&(o.textClass=Gr(a.styleClasses.textClass,o.textClass||""))),0==o.map.length&&o.map.push(0,0,o.content.appendChild(Jr(e.display.measure))),0==r?(t.measure.map=o.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(o.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return Ia&&/\bcm-tab\b/.test(o.content.lastChild.className)&&(o.content.className="cm-tab-wrap-hack"),Bi(e,"renderLine",e,t.line,o.pre),o.pre.className&&(o.textClass=Gr(o.pre.className,o.textClass||"")),o}function Vo(e,t,n,o,r,a,i){if(t){var s=e.splitSpaces?t.replace(/ {3,}/g,Wo):t,d=e.cm.state.specialChars,l=!1;if(!d.test(t)){e.col+=t.length;var p=document.createTextNode(s);e.map.push(e.pos,e.pos+t.length,p),Ta&&9>wa&&(l=!0),e.pos+=t.length}else for(var p=document.createDocumentFragment(),c=0;;){d.lastIndex=c;var u=d.exec(t),h=u?u.index-c:t.length-c;if(h){var g=document.createTextNode(s.slice(c,c+h));Ta&&9>wa?p.appendChild(Hr("span",[g])):p.appendChild(g),e.map.push(e.pos,e.pos+h,g),e.col+=h,e.pos+=h}if(!u)break;if(c+=h+1,"\t"==u[0]){var f=e.cm.options.tabSize,y=f-e.col%f,g=p.appendChild(Hr("span",Rr(y),"cm-tab"));g.setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=y}else if("\r"==u[0]||"\n"==u[0]){var g=p.appendChild(Hr("span","\r"==u[0]?"\u240D":"\u2424","cm-invalidchar"));g.setAttribute("cm-text",u[0]),e.col+=1}else{var g=e.cm.options.specialCharPlaceholder(u[0]);g.setAttribute("cm-text",u[0]),Ta&&9>wa?p.appendChild(Hr("span",[g])):p.appendChild(g),e.col+=1}e.map.push(e.pos,e.pos+1,g),e.pos++}if(n||o||r||l||i){var b=n||"";o&&(b+=o),r&&(b+=r);var v=Hr("span",[p],b,i);return a&&(v.title=a),e.content.appendChild(v)}e.content.appendChild(p)}}function Wo(e){for(var t=" ",n=0;np&&i.from<=p));u++);if(i.to>=c)return e(n,o,r,a,s,d,l);e(n,o.slice(0,i.to-p),r,a,null,d,l),a=null,o=o.slice(i.to-p),p=i.to}}}function jo(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}function qo(e,t,n){var o=e.markedSpans,r=e.text,a=0;if(!o){for(var s=1;sd||E.collapsed&&S.to==d&&S.from==d)?(null!=S.to&&S.to!=d&&p>S.to&&(p=S.to,g=""),E.className&&(h+=" "+E.className),E.css&&(u=(u?u+";":"")+E.css),E.startStyle&&S.from==d&&(f+=" "+E.startStyle),E.endStyle&&S.to==p&&(C||(C=[])).push(E.endStyle,S.to),E.title&&!y&&(y=E.title),E.collapsed&&(!b||0>mo(b.marker,E))&&(b=S)):S.from>d&&p>S.from&&(p=S.from)}if(C)for(var x=0;x=i)break;for(var m=ga(i,p);;){if(l){var k=d+l.length;if(!b){var T=k>m?l.slice(0,m-d):l;t.addToken(t,T,c?c+h:h,f,d+T.length==p?g:"",y,u)}if(k>=m){l=l.slice(m-d),d=m;break}d=k,f=""}l=r.slice(a,a=n[s++]),c=Bo(n[s++],t.cm.options)}}}function zo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Or(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ko(e,t,o,n){function r(e){return o?o[e]:null}function a(e,o,r){No(e,o,r,n),kr(e,"change",e,t)}function i(e,t){for(var o=e,a=[];ot||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],a=r.chunkSize();if(ta-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(i=dr(r,r.lastOp==o))){var s=Or(i.changes);0==za(t.from,t.to)&&0==za(t.from,s.to)?s.to=ai(t):i.changes.push(ir(e,t))}else{var d=Or(r.done);for(d&&d.ranges||ur(e.sel,r.done),i={changes:[ir(e,t)],generation:r.generation},r.done.push(i);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=a,r.lastOp=r.lastSelOp=o,r.lastOrigin=r.lastSelOrigin=t.origin,s||Bi(e,"historyAdded")}function pr(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 cr(e,t,n,o){var r=e.history,a=o&&o.origin;n==r.lastSelOp||a&&r.lastSelOrigin==a&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==a||pr(e,a,Or(r.done),t))?r.done[r.done.length-1]=t:ur(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=a,r.lastSelOp=n,o&&!1!==o.clearRedo&&sr(r.undone)}function ur(e,t){var n=Or(t);n&&n.ranges&&n.equals(e)||t.push(e)}function hr(e,t,o,r){var a=t["spans_"+e.id],i=0;e.iter(va(e.first,o),ga(e.first+e.size,r),function(n){n.markedSpans&&((a||(a=t["spans_"+e.id]={}))[i]=n.markedSpans),++i})}function mr(e){if(!e)return null;for(var t=0,n;t=t.offsetWidth&&2wa))}var n=ls?Hr("span","\u200B"):Hr("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function $r(e){if(null!=ps)return ps;var t=qr(e,document.createTextNode("A\u062EA")),n=$i(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var o=$i(t,1,2).getBoundingClientRect();return ps=3>o.right-n.right}function Zr(e){if(null!=ss)return ss;var t=qr(e,Hr("span","x")),n=t.getBoundingClientRect(),o=$i(t,0,1).getBoundingClientRect();return ss=1t||t==n&&i.to==t)&&(o(va(i.from,t),ga(i.to,n),1==i.level?"rtl":"ltr"),r=!0);r||o(t,n,"ltr")}function ta(e){return e.level%2?e.to:e.from}function na(e){return e.level%2?e.from:e.to}function oa(e){var t=rr(e);return t?ta(t[0]):0}function ra(e){var t=rr(e);return t?na(Or(t)):e.text.length}function aa(e,t){var n=Jo(e.doc,t),o=vo(n);o!=n&&(t=tr(o));var r=rr(o),a=r?r[0].level%2?ra(o):oa(o):0;return qa(t,a)}function ia(e,t){for(var n=Jo(e.doc,t),o;o=yo(n);)n=o.find(1,!0).line,t=null;var r=rr(n),a=r?r[0].level%2?oa(n):ra(n):n.text.length;return qa(null==t?tr(n):t,a)}function sa(e,t){var n=aa(e,t.line),o=Jo(e.doc,n.line),r=rr(o);if(!r||0==r[0].level){var a=va(0,o.text.search(/\S/)),i=t.line==n.line&&t.ch<=a&&t.ch;return qa(n.line,i?0:a)}return n}function da(e,t,n){var o=e[0].level;return t==o||n!=o&&tt)return n;if(r.from==t||r.to==t)if(null==o)o=n;else return da(e,r.level,e[o].level)?(r.from!=r.to&&(us=o),n):(r.from!=r.to&&(us=n),o)}return o}function pa(e,t,n,o){if(!o)return t+n;do t+=n;while(0i.from&&sr||r>e.text.length?null:r}var ha=Math.abs,ma=String.fromCharCode,ga=Math.min,fa=Math.floor,ya=Math.round,ba=Math.ceil,va=Math.max,xa=navigator.userAgent,Ca=navigator.platform,Sa=/gecko\/\d/i.test(xa),Ea=/MSIE \d/.test(xa),ka=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xa),Ta=Ea||ka,wa=Ta&&(Ea?document.documentMode||6:ka[1]),Ia=/WebKit\//.test(xa),Na=Ia&&/Qt\/\d+\.\d+/.test(xa),Aa=/Chrome\//.test(xa),La=/Opera\//.test(xa),Ra=/Apple Computer/.test(navigator.vendor),Oa=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(xa),Pa=/PhantomJS/.test(xa),_a=/AppleWebKit/.test(xa)&&/Mobile\/\w+/.test(xa),Da=_a||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(xa),Ma=_a||/Mac/.test(Ca),Fa=/\bCrOS\b/.test(xa),Ba=/win/i.test(Ca),Ua=La&&xa.match(/Version\/(\d*\.\d*)/);Ua&&(Ua=+Ua[1]),Ua&&15<=Ua&&(La=!1,Ia=!0);var Va=Ma&&(Na||La&&(null==Ua||12.11>Ua)),Wa=Sa||Ta&&9<=wa,Ha=!1,ja=!1;m.prototype=Fr({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=va(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 a=e.viewWidth-e.barLeft-(n?o:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+a+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&0wa&&a.scrollbars.setScrollTop(a.scroller.scrollTop=d),null!=s.selectionStart){(!Ta||Ta&&9>wa)&&e();var t=0,n=function(){a.selForContextMenu==r.doc.sel&&0==s.selectionStart&&0t++?a.detectingSelectAll=setTimeout(n,500):a.input.reset()};a.detectingSelectAll=setTimeout(n,200)}}var o=this,r=o.cm,a=r.display,s=o.textarea,i=zt(r,t),d=a.scroller.scrollTop;if(i&&!La){var l=r.options.resetSelectionOnContextMenu;l&&-1==r.doc.sel.contains(i)&&Lt(r,we)(r.doc,he(i),Hi);var p=s.style.cssText,c=o.wrapper.style.cssText;o.wrapper.style.cssText="position: absolute";var u=o.wrapper.getBoundingClientRect();if(s.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(t.clientY-u.top-5)+"px; left: "+(t.clientX-u.left-5)+"px; z-index: 1000; background: "+(Ta?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Ia)var h=window.scrollY;if(a.input.focus(),Ia&&window.scrollTo(null,h),a.input.reset(),r.somethingSelected()||(s.value=o.prevInput=" "),o.contextMenuPending=!0,a.selForContextMenu=r.doc.sel,clearTimeout(a.detectingSelectAll),Ta&&9<=wa&&e(),Wa){Di(t);var m=function(){Fi(window,"mouseup",m),setTimeout(n,20)};Mi(window,"mouseup",m)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Dr,needsContentAttribute:!1},te.prototype),oe.prototype=Fr({init:function(e){function t(t){if(!wr(o,t)){if(o.somethingSelected())Ka=o.getSelections(),"cut"==t.type&&o.replaceSelection("",null,"cut");else{if(!o.options.lineWiseCopyCut)return;var e=Z(o);Ka=e.text,"cut"==t.type&&o.operation(function(){o.setSelections(e.ranges,0,Hi),o.replaceSelection("",null,"cut")})}if(t.clipboardData&&!_a)t.preventDefault(),t.clipboardData.clearData(),t.clipboardData.setData("text/plain",Ka.join("\n"));else{var n=ne(),r=n.firstChild;o.display.lineSpace.insertBefore(n,o.display.lineSpace.firstChild),r.value=Ka.join("\n");var a=document.activeElement;Xi(r),setTimeout(function(){o.display.lineSpace.removeChild(n),a.focus()},50)}}}var n=this,o=n.cm,r=n.div=e.lineDiv;ee(r),Mi(r,"paste",function(t){wr(o,t)||J(t,o)}),Mi(r,"compositionstart",function(t){var e=t.data;if(n.composing={sel:o.doc.sel,data:e,startData:e},!!e){var r=o.doc.sel.primary(),a=o.getLine(r.head.line),i=a.indexOf(e,va(0,r.head.ch-e.length));-1t.viewTo-1)return!1;var a;if(o.line==t.viewFrom||0==(a=Bt(e,o.line)))var i=tr(t.view[0].line),s=t.view[0].node;else var i=tr(t.view[a].line),s=t.view[a-1].node.nextSibling;var d=Bt(e,r.line);if(d==t.view.length-1)var l=t.viewTo-1,p=t.lineDiv.lastChild;else var l=tr(t.view[d+1].line)-1,p=t.view[d+1].node.previousSibling;for(var c=e.doc.splitLines(le(e,s,p,i,l)),u=$o(e.doc,qa(i,0),qa(l,Jo(e.doc,l).text.length));1=za(e,o.to()))return n;return-1}},ce.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return G(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Ga={left:0,right:0,top:0,bottom:0},Xa=null,Qa=0,Ya=0,Ja=0,$a=null,Za,ei,ti;Ta?$a=-.53:Sa?$a=15:Aa?$a=-.7:Ra&&($a=-1/3);var ni=function(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}};e.wheelEventPixels=function(t){var e=ni(t);return e.x*=$a,e.y*=$a,e};var oi=new Lr,ri=null,ai=e.changeEnd=function(e){return e.text?qa(e.from.line+e.text.length-1,Or(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,o=n[e];n[e]==t&&"mode"!=e||(n[e]=t,si.hasOwnProperty(e)&&Lt(this,si[e])(this,t,o))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Gn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Vn(this,r.head.line,e,!0),n=r.head.line,o==this.doc.sel.primIndex&&Bn(this))}),getTokenAt:function(e,t){return Po(this,e,t)},getLineTokens:function(e,t){return Po(this,qa(e),t,!0)},getTokenTypeAt:function(e){e=ge(this.doc,e);var t=Mo(this,Jo(this.doc,e.line)),n=0,o=(t.length-1)/2,r=e.ch,a;if(0==r)a=t[2];else for(;;){var i=n+o>>1;if((i?t[2*i-1]:0)>=r)o=i;else if(t[2*i+1]s?a:0==s?null:a.slice(0,s-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=[];if(!hi.hasOwnProperty(t))return n;var o=hi[t],r=this.getModeAt(e);if("string"==typeof r[t])o[r[t]]&&n.push(o[r[t]]);else if(r[t])for(var a=0,i;ar&&(e=r,n=!0),o=Jo(this.doc,e)}else o=e;return pt(this,o,{top:0,left:0},t||"page").top+(n?this.doc.height-or(o):0)},defaultTextHeight:function(){return bt(this.display)},defaultCharWidth:function(){return vt(this.display)},setGutterMarker:Rt(function(e,t,n){return Wn(this.doc,e,"gutter",function(e){var o=e.gutterMarkers||(e.gutterMarkers={});return o[t]=n,!n&&Vr(o)&&(e.gutterMarkers=null),!0})}),clearGutter:Rt(function(e){var t=this,n=t.doc,o=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,Mt(t,o,"gutter"),Vr(n.gutterMarkers)&&(n.gutterMarkers=null)),++o})}),lineInfo:function(e){if("number"==typeof e){if(!ye(this.doc,e))return null;var t=e;if(e=Jo(this.doc,e),!e)return null}else{var t=tr(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,o,r){var a=this.display;e=ht(this,ge(this.doc,e));var i=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),a.sizer.appendChild(t),"over"==o)i=e.top;else if("above"==o||"near"==o){var d=va(a.wrapper.clientHeight,this.doc.height),l=va(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==o||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?i=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(i=e.bottom),s+t.offsetWidth>l&&(s=l-t.offsetWidth)}t.style.top=i+"px",t.style.left=t.style.right="","right"==r?(s=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?s=0:"middle"==r&&(s=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&Dn(this,s,i,s+t.offsetWidth,i+t.offsetHeight)},triggerOnKeyDown:Rt(un),triggerOnKeyPress:Rt(gn),triggerOnKeyUp:mn,execCommand:function(e){if(fi.hasOwnProperty(e))return fi[e].call(null,this)},triggerElectric:Rt(function(e){$(this,e)}),findPosH:function(e,t,n,o){var r=1;0>t&&(r=-1,t=-t);for(var a=0,i=ge(this.doc,e);ae?o.from():o.to()},qi)}),deleteH:Rt(function(e,t){var n=this.doc.sel,o=this.doc;n.somethingSelected()?o.replaceSelection("",null,"+delete"):Hn(this,function(n){var r=jn(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=1,a=o;0>t&&(r=-1,t=-t);for(var s=0,i=ge(this.doc,e),d;se?i.from():i.to();var s=ht(n,i.head,"div");null!=i.goalColumn&&(s.left=i.goalColumn),r.push(s.left);var d=qn(n,s,e,t);return"page"==t&&i==o.sel.primary()&&Fn(n,null,ut(n,d,"div").top-s.top),d},qi),r.length)for(var s=0;se.xRel||r==n.length)&&o?--o:++r;for(var i=n.charAt(o),s=Ur(i,a)?function(e){return Ur(e,a)}:/\s/.test(i)?function(e){return /\s/.test(e)}:function(e){return!/\s/.test(e)&&!Ur(e)};0e.doc.first){var i=Jo(e.doc,r.line-1).text;i&&e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+i.charAt(i.length-1),qa(r.line-1,i.length-1),qa(r.line,1),"+transpose")}n.push(new ce(r,r))}e.setSelections(n)})},newlineAndIndent:function(e){At(e,function(){for(var t=e.listSelections().length,n=0,o;n=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(-1e.display.maxLineLength&&(e.display.maxLine=d,e.display.maxLineLength=l,e.display.maxLineChanged=!0)}null!=o&&e&&this.collapsed&&Dt(e,o,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ae(e.doc)),e&&kr(e,"markerCleared",e,this),t&&St(e),this.parent&&this.parent.clear()}},Ei.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n=0,o,r;nthis.size-t&&(1=this.children.length)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Xo(t);if(!e.parent){var o=new Xo(e.children);o.parent=e,e.children=[o,n],e=o}else{e.size-=n.size,e.height-=n.height;var r=Pr(e.parent.children,e);e.parent.children.splice(r+1,0,n)}n.parent=e.parent}while(10=e.ch)&&t.push(r.marker.parent||r.marker);return t},findMarks:function(e,t,n){e=ge(this,e),t=ge(this,t);var o=[],r=e.line;return this.iter(e.line,t.line+1,function(a){var s=a.markedSpans;if(s)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-=a,++t)}),ge(this,qa(t,o))},indexFromPos:function(e){e=ge(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 Li(Zo(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);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.toPr(Ri,Oi)&&(e.prototype[Oi]=function(e){return function(){return e.apply(this.doc,arguments)}}(Li.prototype[Oi]));Ar(Li);var Pi=e.e_preventDefault=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1},_i=e.e_stopPropagation=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},Di=e.e_stop=function(t){Pi(t),_i(t)},Mi=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var o=e._handlers||(e._handlers={}),r=o[t]||(o[t]=[]);r.push(n)}},on=[],Fi=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else for(var o=Er(e,t,!1),r=0;rn||n>=t)return i+(t-s);i+=n-s,i+=o-i%o,s=n+1}},Ki=e.findColumn=function(e,t,n){for(var o=0,r=0,a;;){a=e.indexOf("\t",o),-1==a&&(a=e.length);var i=a-o;if(a==e.length||r+i>=t)return o+ga(i,t-r);if(r+=a-o,r+=n-r%n,o=a+1,r>=t)return o}},Gi=[""],Xi=function(e){e.select()};_a?Xi=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Ta&&(Xi=function(e){try{e.select()}catch(e){}});var Qi=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Yi=e.isWordChar=function(e){return /\w/.test(e)||"\x80"wa&&(zr=function(){try{return document.activeElement}catch(t){return document.body}});var es=e.rmClass=function(e,t){var n=e.className,o=Kr(t).exec(n);if(o){var r=n.slice(o.index+o[0].length);e.className=n.slice(0,o.index)+(r?o[1]+r:"")}},ts=e.addClass=function(e,t){var n=e.className;Kr(t).test(n)||(e.className+=(n?" ":"")+t)},ns=!1,os=function(){if(Ta&&9>wa)return!1;var e=Hr("div");return"draggable"in e||"dragDrop"in e}(),rs=e.splitLines=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 a=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),i=a.indexOf("\r");-1==i?(n.push(a),t=r+1):(n.push(a.slice(0,i)),t+=i+1)}return n},as=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(t){}return t&&t.parentElement()==e&&0!=t.compareEndPoints("StartToEnd",t)},is=function(){var t=Hr("div");return!!("oncopy"in t)||(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy)}(),ss=null,ds=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ls,ps;(function(){for(var e=0;10>e;e++)ds[e+48]=ds[e+96]=e+"";for(var e=65;90>=e;e++)ds[e]=ma(e);for(var e=1;12>=e;e++)ds[e+111]=ds[e+63235]="F"+e})();var cs=function(){function e(e){return 247>=e?n.charAt(e):1424<=e&&1524>=e?"R":1536<=e&&1773>=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="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,s=/[LRr]/,d=/[Lb1n]/,l=/[1n]/,p="L";return function(n){if(!r.test(n))return!1;for(var o=n.length,c=[],u=0,i;ua))for(u==t.line&&(m=t.ch-(0>n?1:0));m!=g;m+=n){var f=h.charAt(m);if(p.test(f)&&(void 0===o||e.getTokenTypeAt(i(u,m+1))==o)){var y=s[f];if(">"==y.charAt(1)==0document.documentMode),i=e.Pos,s={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},d=null;e.defineOption("matchBrackets",!1,function(t,n,o){o&&o!=e.Init&&t.off("cursorActivity",r),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 t(this,e,n,o)}),e.defineExtension("scanForBracket",function(e,t,o,r){return n(this,e,t,o,r)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){if(t(n),!n.somethingSelected()){var o=n.getCursor(),r=n.getViewport();r.from=Math.min(r.from,o.line),r.to=Math.max(o.line+1,r.to);var a=e.findMatchingTag(n,o,r);if(a){if(n.state.matchBothTags){var i="open"==a.at?a.open:a.close;i&&(n.state.tagHit=n.markText(i.from,i.to,{className:"CodeMirror-matchingtag"}))}var s="close"==a.at?a.open:a.close;s?n.state.tagOther=n.markText(s.from,s.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0}}})}function o(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(r,a,i){i&&i!=e.Init&&(r.off("cursorActivity",n),r.off("viewportChange",o),t(r)),a&&(r.state.matchBothTags="object"==typeof a&&a.bothTags,r.on("cursorActivity",n),r.on("viewportChange",o),n(r))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var o="close"==n.at?n.open:n.close;o&&t.extendSelection(o.to,o.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:u[t]}function n(e){return function(t){return d(t,e)}}function o(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function r(n){var r=o(n);if(!r||n.getOption("disableInput"))return e.Pass;for(var a=t(r,"pairs"),s=n.listSelections(),d=0;d=x.ch||n.getRange(h(x.line,x.ch-3),h(x.line,x.ch-2))!=r))C="addFour";else if(m){if(!e.isWordChar(i)&&c(n,x,r))C="both";else return e.Pass;}else if(f&&(n.getLine(x.line).length==x.ch||l(i,d)||/\s/.test(i)))C="both";else return e.Pass;if(!b)b=C;else if(b!=C)return e.Pass}var S=p%2?d.charAt(p-1):r,E=p%2?r:d.charAt(p+1);n.operation(function(){if("skip"==b)n.execCommand("goCharRight");else if("skipThree"==b)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==b){for(var t=n.getSelections(),e=0;e=n.ch+1)return /\bstring2?\b/.test(s);i.start=i.pos}}var u={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},h=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,o){o&&o!=e.Init&&(t.removeKeyMap(g),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(g))});for(var m=u.pairs+"`",g={Backspace:r,Enter:a},f=0;fi.ch&&(y=y.slice(0,y.length-p.end+i.ch));var b=y.toLowerCase();if(!y||"string"==p.type&&(p.end!=i.ch||!/[\"\']/.test(p.string.charAt(p.string.length-1))||1==p.string.length)||"tag"==p.type&&"closeTag"==u.type||p.string.indexOf("/")==p.string.length-1||g&&-1"+(v?"\n\n":"")+"",newPos:v?e.Pos(i.line+1,0):e.Pos(i.line,i.ch+1)}}for(var l=n.length-1,x;0<=l;l--){x=o[l],t.replaceRange(x.text,n[l].head,n[l].anchor,"+insert");var C=t.listSelections().slice(0);C[l]={head:x.newPos,anchor:x.newPos},t.setSelections(C),x.indent&&(t.indentLine(x.newPos.line,null,!0),t.indentLine(x.newPos.line+1,null,!0))}}function n(t,n){for(var o=t.listSelections(),r=[],s=n?"/":""!=t.getLine(i.line).charAt(l.end)&&(u+=">"),r[d]=u}t.replaceSelections(r),o=t.listSelections();for(var d=0;d'"]=function(e){return t(e)}),n.addKeyMap(i)}});var s=["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)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.search(a);return-1==t?0:t}function n(e,t,n){return /\bstring\b/.test(e.getTokenTypeAt(s(t.line,0)))&&!/^[\'\"`]/.test(n)}var o=Math.min,r={},a=/[^\s\u00a0]/,s=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=r);for(var t=this,n=Infinity,o=this.listSelections(),a=null,d=o.length-1;0<=d;d--){var i=o[d].from(),l=o[d].to();i.line>=n||(l.line>=n&&(l=s(n,0)),n=i.line,null==a?t.uncomment(i,l,e)?a="un":(t.lineComment(i,l,e),a="line"):"un"==a?t.uncomment(i,l,e):t.lineComment(i,l,e))}}),e.defineExtension("lineComment",function(e,i,d){d||(d=r);var l=this,p=l.getModeAt(e),c=l.getLine(e.line);if(!(null==c||n(l,e,c))){var u=d.lineComment||p.lineComment;if(!u)return void((d.blockCommentStart||p.blockCommentStart)&&(d.fullLines=!0,l.blockComment(e,i,d)));var h=o(0!=i.ch||i.line==e.line?i.line+1:i.line,l.lastLine()+1),m=null==d.padding?" ":d.padding,g=d.commentBlankLines||e.line==i.line;l.operation(function(){if(d.indent){for(var n=null,o=e.line;oi.length)&&(n=i)}for(var o=e.line;ou||d.operation(function(){if(!1!=n.fullLines){var o=a.test(d.getLine(u));d.replaceRange(h+c,s(u)),d.replaceRange(p+h,s(e.line,0));var r=n.blockCommentLead||l.blockCommentLead;if(null!=r)for(var m=e.line+1;m<=u;++m)(m!=u||o)&&d.replaceRange(r+h,s(m,0))}else d.replaceRange(c,t),d.replaceRange(p,e)})}),e.defineExtension("uncomment",function(e,t,n){n||(n=r);var d=this,l=d.getModeAt(e),p=o(0!=t.ch||t.line==e.line?t.line:t.line-1,d.lastLine()),c=o(e.line,p),u=n.lineComment||l.lineComment,h=[],m=null==n.padding?" ":n.padding,g;lineComment:{if(!u)break lineComment;for(var f=c;f<=p;++f){var i=d.getLine(f),y=i.indexOf(u);if(-1n||(t.slice(o,o+m.length)==m&&(o+=m.length),g=!0,d.replaceRange("",s(e,n),s(e,o)))}}),g)return!0}var b=n.blockCommentStart||l.blockCommentStart,v=n.blockCommentEnd||l.blockCommentEnd;if(!b||!v)return!1;var x=n.blockCommentLead||l.blockCommentLead,C=d.getLine(c),S=p==c?C:d.getLine(p),E=C.indexOf(b),k=S.lastIndexOf(v);if(-1==k&&c!=p&&(S=d.getLine(--p),k=S.lastIndexOf(v)),-1==E||-1==k||!/comment/.test(d.getTokenTypeAt(s(c,E+1)))||!/comment/.test(d.getTokenTypeAt(s(p,k+1))))return!1;var T=C.lastIndexOf(b,e.ch),w=-1==T?-1:C.slice(0,e.ch).indexOf(v,T+b.length);if(-1!=T&&-1!=w&&w+v.length!=e.ch)return!1;w=S.indexOf(v,t.ch);var I=S.slice(t.ch).lastIndexOf(b,w-t.ch);return(T=-1==w||-1==I?-1:t.ch+I,-1==w||-1==T||T==t.ch)&&(d.operation(function(){d.replaceRange("",s(p,k-(m&&S.slice(k-m.length,k)==m?m.length:0)),s(p,k+v.length));var e=E+b.length;if(m&&C.slice(e,e+m.length)==m&&(e+=m.length),d.replaceRange("",s(c,E),s(c,e)),x)for(var t=c+1;t<=p;++t){var n=d.getLine(t),o=n.indexOf(x);if(!(-1==o||a.test(n.slice(0,o)))){var r=o+x.length;m&&n.slice(r,r+m.length)==m&&(r+=m.length),d.replaceRange("",s(t,o),s(t,r))}}}),!0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(t){"use strict";function e(e,r,a,s){function i(t){var n=d(e,r);if(!n||n.to.line-n.from.linee.firstLine();)r=t.Pos(r.line-1,0),p=i(!1);if(p&&!p.cleared&&"unfold"!==s){var c=n(e,a);t.on(c,"mousedown",function(n){u.clear(),t.e_preventDefault(n)});var u=e.markText(p.from,p.to,{replacedWith:c,clearOnEnter:!0,__isFold:!0});u.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"}return n}function o(e,t,n){if(t&&t[n]!==void 0)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=s&&(n=r(a.indicatorOpen))}e.setGutterMarker(t,a.gutter,n),++i})}function i(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){a(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function s(e,t,n){var r=e.state.foldGutter;if(r){var a=r.options;if(n==a.gutter){var i=o(e,t);i?i.clear():e.foldCode(c(t,0),a.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(){i(e)},n.foldOnChangeTimeSpan||600)}}function l(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&&(a(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&&o=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function a(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),a=-1",e.ch-1):-1;if(-1==t)if(a(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:u(r,a),to:u(e.line,e.ch)}}else n.push(o[2])}}function c(e,t){for(var n=[];;){var o=p(e);if(!o)return;if("selfClose"==o){d(e);continue}var r=e.line,a=e.ch,s=d(e);if(!s)return;if(s[1])n.push(s[2]);else{for(var l=n.length-1;0<=l;--l)if(n[l]==s[2]){n.length=l;break}if(0>l&&(!t||t==s[2]))return{tag:s[2],from:u(e.line,e.ch),to:u(r,a)}}}}var u=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,t){for(var o=new n(e,t.line,0);;){var r=l(o),a;if(!r||o.line!=t.line||!(a=s(o)))return;if(!r[1]&&"selfClose"!=a){var t=u(o.line,o.ch),d=i(o,r[2]);return d&&{from:t,to:d.from}}}}),e.findMatchingTag=function(e,o,r){var a=new n(e,o.line,o.ch,r);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var l=s(a),p=l&&u(a.line,a.ch),h=l&&d(a);if(l&&h&&!(0s)d=l;else if(!/\S/.test(p));else break}if(d)return{from:e.Pos(n.line,r.length),to:e.Pos(d,t.getLine(d).length)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerGlobalHelper("fold","comment",function(e){return e.blockCommentStart&&e.blockCommentEnd},function(t,n){var o=t.getModeAt(n),r=o.blockCommentStart,a=o.blockCommentEnd;if(r&&a){for(var s=n.line,d=t.getLine(s),l=n.ch,p=0,c,u;;){if(u=0>=l?-1:d.lastIndexOf(r,l-1),-1==u){if(1==p)return;p=1,l=d.length;continue}if(1==p&&uv&&(v=i.length),0>x&&(x=i.length),b=Math.min(v,x),b==i.length)break;if(b==v)++h;else if(! --h){g=y,f=b;break outer}++b}return null==g||s==g&&f==c?void 0:{from:e.Pos(s,c),to:e.Pos(g,f)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(t){"use strict";var n=Math.min;t.registerHelper("fold","brace",function(e,o){function r(n){for(var r=o.ch,i=0,d;;){if(d=0>=r?-1:s.lastIndexOf(n,r-1),-1==d){if(1==i)break;i=1,r=s.length;continue}if(1==i&&db&&(b=i.length),0>v&&(v=i.length),y=n(b,v),y==i.length)break;if(e.getTokenTypeAt(t.Pos(f,y+1))==c)if(y==b)++u;else if(! --u){m=f,g=y;break outer}++y}return null==m||a==m&&g==p?void 0:{from:t.Pos(a,p),to:t.Pos(m,g)}}}),t.registerHelper("fold","import",function(o,e){function r(r){if(ro.lastLine())return null;var a=o.getTokenAt(t.Pos(r,1));if(/\S/.test(a.string)||(a=o.getTokenAt(t.Pos(r,a.end+1))),"keyword"!=a.type||"import"!=a.string)return null;for(var s=r,i=n(o.lastLine(),r+10);s<=i;++s){var e=o.getLine(s),d=e.indexOf(";");if(-1!=d)return{startCh:a.end,end:t.Pos(s,d)}}}var e=e.line,a=r(e),i;if(!a||r(e-1)||(i=r(e-2))&&i.end.line==e-1)return null;for(var s=a.end,d;;){if(d=r(s.line+1),null==d)break;s=d.end}return{from:o.clipPos(t.Pos(e,a.startCh+1)),to:s}}),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 n=n.line,r=o(n);if(null==r||null!=o(n-1))return null;for(var a=n,i;;){if(i=o(a+1),null==i)break;++a}return{from:t.Pos(n,r+1),to:e.clipPos(t.Pos(a))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],function(t){e(t,"amd")}):e(CodeMirror,"plain")}(function(e,t){function n(e,t){var n=t;return function(){0==--n&&e()}}function o(t,o){var r=e.modes[t].dependencies;if(!r)return o();for(var a=[],s=0;sS){d.style.height=S-5+"px",d.style.top=(v=y.bottom-E.top)+"px";var I=s.getCursor();t.from.ch!=I.ch&&(y=s.cursorCoords(I),d.style.left=(b=y.left)+"px",E=d.getBoundingClientRect())}}var N=E.right-C;if(0C&&(d.style.width=C-5+"px",N-=E.right-E.left-C),d.style.left=(b=y.left-N)+"px"),s.addKeyMap(this.keyMap=a(n,{moveFocus:function(e,t){o.changeActive(o.selectedHint+e,t)},setFocus:function(e){o.changeActive(e)},menuSize:function(){return o.screenAmount()},length:l.length,close:function(){n.close()},pick:function(){o.pick()},data:t})),n.options.closeOnUnfocus){var A;s.on("blur",this.onBlur=function(){A=setTimeout(function(){n.close()},100)}),s.on("focus",this.onFocus=function(){clearTimeout(A)})}var L=s.getScrollInfo();return s.on("scroll",this.onScroll=function(){var e=s.getScrollInfo(),t=s.getWrapperElement().getBoundingClientRect(),o=v+L.top-e.top,r=o-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return x||(r+=d.offsetHeight),r<=t.top||r>=t.bottom?n.close():void(d.style.top=o+"px",d.style.left=b+L.left-e.left+"px")}),e.on(d,"dblclick",function(n){var e=i(d,n.target||n.srcElement);e&&null!=e.hintId&&(o.changeActive(e.hintId),o.pick())}),e.on(d,"click",function(r){var e=i(d,r.target||r.srcElement);e&&null!=e.hintId&&(o.changeActive(e.hintId),n.options.completeOnSingleClick&&o.pick())}),e.on(d,"mousedown",function(){setTimeout(function(){s.focus()},20)}),e.signal(t,"select",l[0],d.firstChild),!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.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 a=function(e,t,n){function r(o){return o==a.length?t(null):void l(a[o],e,n,function(e){e&&0,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(t,n){for(var o=0,r=t.length;os.ch&&(d.end=s.ch,d.string=d.string.slice(0,s.ch-d.start)):d={start:s.ch,end:s.ch,string:"",state:d.state,type:"."==d.string?"property":null};for(var l=d;"property"==l.type;){if(l=o(t,i(s.line,l.start)),"."!=l.string)return;if(l=o(t,i(s.line,l.start)),!p)var p=[];p.push(l)}return{list:a(d,p,n,r),from:i(s.line,d.start),to:i(s.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 a(e,o,r,a){function i(e){0!=e.lastIndexOf(u,0)||n(c,e)||c.push(e)}function p(e){for(var n in"string"==typeof e?t(s,i):e instanceof Array?t(d,i):e instanceof Function&&t(l,i),e)i(n)}var c=[],u=e.string,h=a&&a.globalScope||window;if(o&&o.length){var m=o.pop(),g;for(m.type&&0===m.type.indexOf("variable")?(a&&a.additionalContext&&(g=a.additionalContext[m.string]),(!a||!1!==a.useGlobalScope)&&(g=g||h[m.string])):"string"==m.type?g="":"atom"==m.type?g=1:"function"==m.type&&(null!=h.jQuery&&("$"==m.string||"jQuery"==m.string)&&"function"==typeof h.jQuery?g=h.jQuery():null!=h._&&"_"==m.string&&"function"==typeof h._&&(g=h._()));null!=g&&o.length;)g=g[o.pop().string];null!=g&&p(g)}else{for(var f=e.state.localVars;f;f=f.next)i(f.name);for(var f=e.state.globalVars;f;f=f.next)i(f.name);a&&!1===a.useGlobalScope||p(h),t(r,i)}return c}var i=e.Pos;e.registerHelper("hint","javascript",function(e,t){return o(e,p,function(t,e){return t.getTokenAt(e)},t)}),e.registerHelper("hint","coffeescript",function(e,t){return o(e,c,r,t)});var s="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),d="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),l=["prototype","apply","call","bind"],p="break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch throw true try typeof var void while with".split(" "),c="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".split(" ")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t=Math.max,o=e.Pos;e.registerHelper("hint","xml",function(r,a){var s=a&&a.schemaInfo,d=a&&a.quoteChar||"\"";if(s){var l=r.getCursor(),p=r.getTokenAt(l);p.end>l.ch&&(p.end=l.ch,p.string=p.string.slice(0,l.ch-p.start));var c=e.innerMode(r.getMode(),p.state);if("xml"==c.mode.name){var u=[],h=!1,m=/\btag\b/.test(p.type)&&!/>$/.test(p.string),g=m&&/^\w/.test(p.string),f,y;if(g){var b=r.getLine(l.line).slice(t(0,p.start-2),p.start),v=/<\/$/.test(b)?"close":/<$/.test(b)?"open":null;v&&(y=p.start-("close"==v?2:1))}else m&&"<"==p.string?v="open":m&&"")}else{var C=s[c.state.tagName],k=C&&C.attrs,T=s["!attrs"];if(!k&&!T)return;if(!k)k=T;else if(T){var w={};for(var I in T)T.hasOwnProperty(I)&&(w[I]=T[I]);for(var I in k)k.hasOwnProperty(I)&&(w[I]=k[I]);k=w}if("string"==p.type||"="==p.string){var b=r.getRange(o(l.line,t(0,l.ch-60)),o(l.line,"string"==p.type?p.start:p.end)),N=b.match(/([^\s\u00a0=<>\"\']+)=$/),A;if(!N||!k.hasOwnProperty(N[1])||!(A=k[N[1]]))return;if("function"==typeof A&&(A=A.call(this,r)),"string"==p.type){f=p.string;var L=0;/['"]/.test(p.string.charAt(0))&&(d=p.string.charAt(0),f=p.string.slice(1),L++);var n=p.string.length;/['"]/.test(p.string.charAt(n-1))&&(d=p.string.charAt(n-1),f=p.string.substr(L,n-2)),h=!0}for(var E=0;E][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],l={attrs:{}},p={a:{attrs:{href:null,ping:null,type:null,media:d,target:o,hreflang:n}},abbr:l,acronym:l,address:l,applet:l,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:d,hreflang:n,type:null,shape:["default","rect","circle","poly"]}},article:l,aside:l,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:l,base:{attrs:{href:null,target:o}},basefont:l,bdi:l,bdo:l,big:l,blockquote:{attrs:{cite:null}},body:l,br:l,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:i,formmethod:a,formnovalidate:["","novalidate"],formtarget:o,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:l,center:l,cite:l,code:l,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:l,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:l,dir:l,div:l,dl:l,dt:l,em:l,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:l,figure:l,font:l,footer:l,form:{attrs:{action:null,name:null,"accept-charset":r,autocomplete:["on","off"],enctype:i,method:a,novalidate:["","novalidate"],target:o}},frame:l,frameset:l,h1:l,h2:l,h3:l,h4:l,h5:l,h6:l,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:l,hgroup:l,hr:l,html:{attrs:{manifest:null},children:["head","body"]},i:l,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:i,formmethod:a,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:l,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:l,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:l,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:l,noframes:l,noscript:l,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:l,param:{attrs:{name:null,value:null}},pre:l,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:l,rt:l,ruby:l,s:l,samp:l,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:r}},section:l,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:l,source:{attrs:{src:null,type:null,media:null}},span:l,strike:l,strong:l,style:{attrs:{type:["text/css"],media:d,scoped:null}},sub:l,summary:l,sup:l,table:l,tbody:l,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:l,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:l,time:{attrs:{datetime:null}},title:l,tr:l,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:n}},tt:l,u:l,ul:l,var:l,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:l},c={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 u in t(l),p)p.hasOwnProperty(u)&&p[u]!=l&&t(p[u]);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)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],e):e(CodeMirror)}(function(e){"use strict";var t={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};e.registerHelper("hint","css",function(n){function o(e){for(var t in e)l&&0!=t.lastIndexOf(l,0)||c.push(t)}var r=n.getCursor(),a=n.getTokenAt(r),i=e.innerMode(n.getMode(),a.state);if("css"==i.mode.name){if("keyword"==a.type&&0=="!important".indexOf(a.string))return{list:["!important"],from:e.Pos(r.line,a.start),to:e.Pos(r.line,a.end)};var s=a.start,d=r.ch,l=a.string.slice(0,d-s);/[^\w$_-]/.test(l)&&(l="",s=d=r.ch);var p=e.resolveMode("text/css"),c=[],u=i.state.state;if("pseudo"==u||"variable-3"==a.type?o(t):"block"==u||"maybeprop"==u?o(p.propertyKeywords):"prop"==u||"parens"==u||"at"==u||"params"==u?(o(p.valueKeywords),o(p.colorKeywords)):("media"==u||"media_parens"==u)&&(o(p.mediaTypes),o(p.mediaFeatures)),c.length)return{list:c,from:e.Pos(r.line,s),to:e.Pos(r.line,d)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;te.lastLine())){var i=e.getLine(n.line),u=i.length-l[0].length;if(s(i.slice(u))==d[0]){for(var h=o(n.line,u),p=n.line+1,c=1;cn)--o;else return o}var o=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=o(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return t(0);r=o(r.line-1,this.doc.getLine(r.line-1).length)}else{var a=this.doc.lineCount();if(r.line==a-1)return t(a);r=o(r.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to,n),this.pos.to=o(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,o){return new t(this.doc,e,n,o)}),e.defineDocExtension("getSearchCursor",function(e,n,o){return new t(this,e,n,o)}),e.defineExtension("selectMatches",function(t,n){for(var o=[],r=this.getSearchCursor(t,this.getCursor("from"),n);r.findNext()&&!(0n.line&&document.querySelector&&(o=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&o.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((l=o).style.opacity=.4)}))})}else s(t,y,"Search for:",d,function(e){e&&!a.query&&t.operation(function(){c(t,a,e),a.posFrom=a.posTo=t.getCursor(),h(t,n)})})}function h(t,n,r){t.operation(function(){var i=o(t),s=a(t,i.query,n?i.posFrom:i.posTo);!s.find(n)&&(s=a(t,i.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),!s.find(n))||(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),i.posFrom=s.from(),i.posTo=s.to(),r&&r(s.from(),s.to()))})}function m(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 g(e,t,n){e.operation(function(){for(var o=a(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 f(e,t){if(!e.getOption("readOnly")){var n=e.getSelection()||o(e).lastQuery,r=t?"Replace all:":"Replace:";s(e,r+b,r,n,function(n){n&&(n=p(n),s(e,v,"Replace with:","",function(o){if(o=l(o),t)g(e,n,o);else{m(e);var r=a(e,n,e.getCursor("from")),i=function(){var t=r.from(),l;!(l=r.findNext())&&(r=a(e,n),!(l=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,x,"Replace?",[function(){s(l)},i,function(){g(e,n,o)}]))},s=function(e){r.replace("string"==typeof n?o:o.replace(/\$(\d)/g,function(t,n){return e[n]})),i()};i()}}))})}}var y="Search: (Use /re/ syntax for regexp search)",b=" (Use /re/ syntax for regexp search)",v="With: ",x="Replace? ";e.commands.find=function(e){m(e),u(e)},e.commands.findPersistent=function(e){m(e),u(e,!1,!0)},e.commands.findNext=u,e.commands.findPrev=function(e){u(e,!0)},e.commands.clearSearch=m,e.commands.replace=f,e.commands.replaceAll=function(e){f(e,!0)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(t){function e(e,t,n){var o=e.getWrapperElement(),r;return r=o.appendChild(document.createElement("div")),r.className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?r.innerHTML=t:r.appendChild(t),r}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}t.defineExtension("openDialog",function(o,r,a){function i(e){if("string"==typeof e)p.value=e;else{if(d)return;d=!0,s.parentNode.removeChild(s),l.focus(),a.onClose&&a.onClose(s)}}a||(a={}),n(this,null);var s=e(this,o,a.bottom),d=!1,l=this,p=s.getElementsByTagName("input")[0],c;return p?(p.focus(),a.value&&(p.value=a.value,!1!==a.selectValueOnOpen&&p.select()),a.onInput&&t.on(p,"input",function(t){a.onInput(t,p.value,i)}),a.onKeyUp&&t.on(p,"keyup",function(t){a.onKeyUp(t,p.value,i)}),t.on(p,"keydown",function(n){a&&a.onKeyDown&&a.onKeyDown(n,p.value,i)||((27==n.keyCode||!1!==a.closeOnEnter&&13==n.keyCode)&&(p.blur(),t.e_stop(n),i()),13==n.keyCode&&r(p.value,n))}),!1!==a.closeOnBlur&&t.on(p,"blur",i)):(c=s.getElementsByTagName("button")[0])&&(t.on(c,"click",function(){i(),l.focus()}),!1!==a.closeOnBlur&&t.on(c,"blur",i),c.focus()),i}),t.defineExtension("openConfirm",function(o,r,a){function s(){p||(p=!0,d.parentNode.removeChild(d),c.focus())}n(this,null);var d=e(this,o,a&&a.bottom),l=d.getElementsByTagName("button"),p=!1,c=this,u=1;l[0].focus();for(var h=0,i;h=u&&s()},200)}),t.on(i,"focus",function(){++u})}),t.defineExtension("openNotification",function(o,r){function a(){s||(s=!0,clearTimeout(l),i.parentNode.removeChild(i))}n(this,a);var i=e(this,o,r&&r.bottom),s=!1,d=r&&"undefined"!=typeof r.duration?r.duration:5e3,l;return t.on(i,"click",function(n){t.e_preventDefault(n),a()}),d&&(l=setTimeout(a,d)),a})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)}(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 a=Math.round(e.lineCount()*+r[1]/100);/^[-+]/.test(r[1])&&(a=o.line+a+1),e.setCursor(a-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"}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(o,r){function a(e,t){function n(n){return t.tokenize=n,n(e,t)}var o=e.next();if("<"==o)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(d("atom","]]>")):null:e.match("--")?n(d("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(l(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=d("meta","?>"),"meta"):(w=e.eat("/")?"closeTag":"openTag",t.tokenize=i,"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 i(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=a,w=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return w="equals",null;if("<"==n){t.tokenize=a,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=s(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function s(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i;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=a;break}n.next()}return e}}function l(e){return function(t,n){for(var o;null!=(o=t.next());){if("<"==o)return n.tokenize=l(e+1),n.tokenize(t,n);if(">"==o)if(1==e){n.tokenize=a;break}else return n.tokenize=l(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,(E.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function c(e){e.context&&(e.context=e.context.prev)}function u(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!E.contextGrabbers.hasOwnProperty(n)||!E.contextGrabbers[n].hasOwnProperty(t))return;c(e)}}function h(e,t,n){return"openTag"==e?(n.tagStart=t.column(),m):"closeTag"==e?g:h}function m(e,t,n){return"word"==e?(n.tagName=t.current(),I="tag",b):(I="error",m)}function g(e,t,n){if("word"==e){var o=t.current();return n.context&&n.context.tagName!=o&&E.implicitlyClosed.hasOwnProperty(n.context.tagName)&&c(n),n.context&&n.context.tagName==o||!1===E.matchClosing?(I="tag",f):(I="tag error",y)}return I="error",y}function f(e,t,n){return"endTag"==e?(c(n),h):(I="error",f)}function y(e,t,n){return I="error",f(e,t,n)}function b(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||E.autoSelfClosers.hasOwnProperty(o)?u(n,o):(u(n,o),n.context=new p(n,o,r==n.indented)),h}return I="error",b}function v(e,t,n){return"equals"==e?x:(E.allowMissing||(I="error"),b(e,t,n))}function x(e,t,n){return"string"==e?C:"word"==e&&E.allowUnquoted?(I="string",b):(I="error",b(e,t,n))}function C(e,t,n){return"string"==e?C:b(e,t,n)}var S=o.indentUnit,E={},k=r.htmlMode?t:n;for(var T in k)E[T]=k[T];for(var T in r)E[T]=r[T];var w,I;return a.isInText=!0,{startState:function(e){var t={tokenize:a,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;w=null;var n=t.tokenize(e,t);return(n||w)&&"comment"!=n&&(I=null,t.state=t.state(w||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+S;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=i&&t.tokenize!=a)return o?o.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1===E.multilineTagIndentPastTag?t.tagStart+S*(E.multilineTagIndentFactor||1):t.tagStart+t.tagName.length+2;if(E.alignCDATA&&/$/,blockCommentStart:"",configuration:E.htmlMode?"html":"xml",helperType:E.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=b)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}e.defineMode("javascript",function(n,o){function r(e){for(var t=!1,n=!1,o;null!=(o=e.next());){if(!t){if("/"==o&&!n)return;"["==o?n=!0:n&&"]"==o&&(n=!1)}t=!t&&"\\"==o}}function a(e,t,n){return Pe=e,_e=n,t}function s(e,n){var o=e.next();if("\""==o||"'"==o)return n.tokenize=i(o),n.tokenize(e,n);if("."==o&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return a("number","number");if("."==o&&e.match(".."))return a("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(o))return a(o);if("="==o&&e.eat(">"))return a("=>","operator");if("0"==o&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),a("number","number");if("0"==o&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),a("number","number");if("0"==o&&e.eat(/b/i))return e.eatWhile(/[01]/i),a("number","number");if(/\d/.test(o))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),a("number","number");if("/"==o)return e.eat("*")?(n.tokenize=d,d(e,n)):e.eat("/")?(e.skipToEnd(),a("comment","comment")):t(e,n,1)?(r(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),a("regexp","string-2")):(e.eatWhile(Ie),a("operator","operator",e.current()));if("`"==o)return n.tokenize=l,l(e,n);if("#"==o)return e.skipToEnd(),a("error","error");if(Ie.test(o))return e.eatWhile(Ie),a("operator","operator",e.current());if(Te.test(o)){e.eatWhile(Te);var s=e.current(),p=we.propertyIsEnumerable(s)&&we[s];return p&&"."!=n.lastType?a(p.type,p.style,s):a("variable","variable",s)}}function i(e){return function(t,n){var o=!1,r;if(Se&&"@"==t.peek()&&t.match(Ne))return n.tokenize=s,a("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||o);)o=!o&&"\\"==r;return o||(n.tokenize=s),a("string","string")}}function d(e,t){for(var n=!1,o;o=e.next();){if("/"==o&&n){t.tokenize=s;break}n="*"==o}return a("comment","comment")}function l(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 a("quasi","string-2",e.current())}function p(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(0>n)){for(var o=0,r=!1,a=n-1;0<=a;--a){var i=e.string.charAt(a),s=Ae.indexOf(i);if(0<=s&&3>s){if(!o){++a;break}if(0==--o)break}else if(3<=s&&6>s)++o;else if(Te.test(i))r=!0;else{if(/["'\/]/.test(i))return;if(r&&!o){++a;break}}}r&&!o&&(t.fatArrowAt=a)}}function c(e,t,n,o,r,a){this.indented=e,this.column=t,this.type=n,this.prev=r,this.info=a,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 h(e,t,n,o,r){var a=e.cc;for(Re.state=e,Re.stream=r,Re.marked=null,Re.cc=a,Re.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var i=a.length?a.pop():Ee?E:S;if(i(n,o)){for(;a.length&&a[a.length-1].lex;)a.pop()();return Re.marked?Re.marked:"variable"==n&&u(e,o)?"variable-2":t}}}function m(){for(var e=arguments.length-1;0<=e;e--)Re.cc.push(arguments[e])}function g(){return m.apply(null,arguments),!0}function f(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var n=Re.state;if(Re.marked="def",n.context){if(t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;o.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function y(){Re.state.context={prev:Re.state.context,vars:Re.state.localVars},Re.state.localVars=Oe}function b(){Re.state.localVars=Re.state.context.vars,Re.state.context=Re.state.context.prev}function v(e,t){var n=function(){var n=Re.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 c(o,Re.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function x(){var e=Re.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function C(e){function t(n){return n==e?g():";"==e?m():g(t)}return t}function S(e,t){return"var"==e?g(v("vardef",t.length),X,C(";"),x):"keyword a"==e?g(v("form"),E,S,x):"keyword b"==e?g(v("form"),S,x):"{"==e?g(v("}"),q,x):";"==e?g():"if"==e?("else"==Re.state.lexical.info&&Re.state.cc[Re.state.cc.length-1]==x&&Re.state.cc.pop()(),g(v("form"),E,S,x,Z)):"function"==e?g(ae):"for"==e?g(v("form"),ee,S,x):"variable"==e?g(v("stat"),F):"switch"==e?g(v("form"),E,v("}","switch"),C("{"),q,x,x):"case"==e?g(E,C(":")):"default"==e?g(C(":")):"catch"==e?g(v("form"),y,C("("),ie,C(")"),S,x,b):"class"==e?g(v("form"),se,x):"export"==e?g(v("stat"),ce,x):"import"==e?g(v("stat"),ue,x):"module"==e?g(v("form"),Q,v("}"),C("{"),q,x,x):m(v("stat"),E,C(";"),x)}function E(e){return T(e,!1)}function k(e){return T(e,!0)}function T(e,t){if(Re.state.fatArrowAt==Re.stream.start){var n=t?P:O;if("("==e)return g(y,v(")"),H(Q,")"),x,C("=>"),n,b);if("variable"==e)return m(y,Q,C("=>"),n,b)}var o=t?A:N;return Le.hasOwnProperty(e)?g(o):"function"==e?g(ae,o):"keyword c"==e?g(t?I:w):"("==e?g(v(")"),w,be,C(")"),x,o):"operator"==e||"spread"==e?g(t?k:E):"["==e?g(v("]"),fe,x,o):"{"==e?j(U,"}",null,o):"quasi"==e?m(L,o):"new"==e?g(_(t)):g()}function w(e){return e.match(/[;\}\)\],]/)?m():m(E)}function I(e){return e.match(/[;\}\)\],]/)?m():m(k)}function N(e,t){return","==e?g(E):A(e,t,!1)}function A(e,t,n){var o=!1==n?N:A,r=!1==n?E:k;return"=>"==e?g(y,n?P:O,b):"operator"==e?/\+\+|--/.test(t)?g(o):"?"==t?g(E,C(":"),r):g(r):"quasi"==e?m(L,o):";"==e?void 0:"("==e?j(k,")","call",o):"."==e?g(B,o):"["==e?g(v("]"),w,C("]"),x,o):void 0}function L(e,t){return"quasi"==e?"${"==t.slice(t.length-2)?g(E,R):g(L):m()}function R(e){if("}"==e)return Re.marked="string-2",Re.state.tokenize=l,g(L)}function O(e){return p(Re.stream,Re.state),m("{"==e?S:E)}function P(e){return p(Re.stream,Re.state),m("{"==e?S:k)}function _(e){return function(t){return"."==t?g(e?M:D):m(e?k:E)}}function D(e,t){if("target"==t)return Re.marked="keyword",g(N)}function M(e,t){if("target"==t)return Re.marked="keyword",g(A)}function F(e){return":"==e?g(x,S):m(N,C(";"),x)}function B(e){if("variable"==e)return Re.marked="property",g()}function U(e,t){return"variable"==e||"keyword"==Re.style?(Re.marked="property","get"==t||"set"==t?g(V):g(W)):"number"==e||"string"==e?(Re.marked=Se?"property":Re.style+" property",g(W)):"jsonld-keyword"==e?g(W):"modifier"==e?g(U):"["==e?g(E,C("]"),W):"spread"==e?g(E):void 0}function V(e){return"variable"==e?(Re.marked="property",g(ae)):m(W)}function W(e){return":"==e?g(k):"("==e?m(ae):void 0}function H(e,t){function n(o){if(","==o){var r=Re.state.lexical;return"call"==r.info&&(r.pos=(r.pos||0)+1),g(e,n)}return o==t?g():g(C(t))}return function(o){return o==t?g():m(e,n)}}function j(e,t,n){for(var o=3;o!?|~^]/,Ne=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ae="([{}])",Le={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Re={state:null,column:null,marked:null,cc:null},Oe={name:"this",next:{name:"arguments"}},Pe,_e;return x.lex=!0,{startState:function(e){var t={tokenize:s,lastType:"sof",cc:[],lexical:new c((e||0)-xe,0,"block",!1),localVars:o.localVars,context:o.localVars&&{vars:o.localVars},indented:e||0};return o.globalVars&&"object"==typeof o.globalVars&&(t.globalVars=o.globalVars),t},token:function(e,t){if(e.sol()&&(!t.lexical.hasOwnProperty("align")&&(t.lexical.align=!1),t.indented=e.indentation(),p(e,t)),t.tokenize!=d&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==Pe?n:(t.lastType="operator"==Pe&&("++"==_e||"--"==_e)?"incdec":Pe,h(t,n,Pe,_e,e))},indent:function(t,n){if(t.tokenize==d)return e.Pass;if(t.tokenize!=s)return 0;var r=n&&n.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(n))for(var l=t.cc.length-1,i;0<=l;--l)if(i=t.cc[l],i==x)a=a.prev;else if(i!=Z)break;"stat"==a.type&&"}"==r&&(a=a.prev),Ce&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var p=a.type,c=r==p;return"vardef"==p?a.indented+("operator"==t.lastType||","==t.lastType?a.info+1:0):"form"==p&&"{"==r?a.indented:"form"==p?a.indented+xe:"stat"==p?a.indented+(ve(t,n)?Ce||xe:0):"switch"!=a.info||c||!1==o.doubleIndentSwitch?a.align?a.column+(c?0:1):a.indented+(c?0:xe):a.indented+(/^(?:case|default)\b/.test(n)?xe:2*xe)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ee?null:"/*",blockCommentEnd:Ee?null:"*/",lineComment:Ee?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ee?"json":"javascript",jsonldMode:Se,jsonMode:Ee,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];(t==E||t==k)&&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})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=0;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&&e.match(/rl(-prefix)?\(/)||"d"==n&&e.match("omain(")||"r"==n&&e.match("egexp(")?(e.backUp(1),t.tokenize=i,o("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),o("property","word")):o(null,null)}function a(e){return function(t,n){for(var r=!1,a;null!=(a=t.next());){if(a==e&&!r){")"==e&&t.backUp(1);break}r=!r&&"\\"==a}return a!=e&&(r||")"==e)||(n.tokenize=null),o("string","string")}}function i(e,t){return e.next(),t.tokenize=e.match(/\s*[\"\')]/,!1)?null:a(")"),o(null,"(")}function s(e,t,n){this.type=e,this.indent=t,this.prev=n}function d(e,t,n,o){return e.context=new s(n,t.indentation()+(!1===o?0:m),e.context),n}function l(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function p(e,t,n){return N[n.context.type](e,t,n)}function c(e,t,o,r){for(var n=r||1;0","i")}function a(e,t){for(var n in e)for(var o=t[n]||(t[n]=[]),r=e[n],a=r.length-1;0<=a;a--)o.unshift(r[a])}function i(e,t){for(var n=0,r;n\s\/]/.test(o.current())&&(u=a.htmlState.tagName&&a.htmlState.tagName.toLowerCase())&&p.hasOwnProperty(u))a.inTag=u+" ";else if(a.inTag&&c&&/>$/.test(o.current())){var h=/^([\S]+) (.*)/.exec(a.inTag);a.inTag=null;var m=">"==o.current()&&i(p[h[1]],h[2]),g=e.getMode(n,m),f=r(h[1],!0),y=r(h[1],!1);a.token=function(e,n){return e.match(f,!1)?(n.token=d,n.localState=n.localMode=null,null):t(e,y,n.localMode.token(e,n.localState))},a.localMode=g,a.localState=e.startState(g,l.indent(a.htmlState,""))}else a.inTag&&(a.inTag+=o.current(),o.eol()&&(a.inTag+=" "));return s}var l=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:o.multilineTagIndentFactor,multilineTagIndentPastTag:o.multilineTagIndentPastTag}),p={},c=o&&o.tags,u=o&&o.scriptTypes;if(a(s,p),c&&a(c,p),u)for(var h=u.length-1;0<=h;h--)p.script.unshift(["type",u[h].matches,u[h].mode]);return{startState:function(){var e=l.startState();return{token:d,inTag:null,localMode:null,localState:null,htmlState:e}},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(l,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n){return!t.localMode||/^\s*<\//.test(n)?l.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||l}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,o){if(0>o&&0==n.ch)return t.clipPos(u(n.line-1));var r=t.getLine(n.line);if(0=r.length)return t.clipPos(u(n.line+1,0));for(var a="start",s=n.ch,d=0>o?0:r.length,l=0,i;s!=d;s+=o,l++){var p=r.charAt(0>o?s-1:s),c="_"!=p&&e.isWordChar(p)?"w":"o";if("w"==c&&p.toUpperCase()==p&&(c="W"),"start"==a)"o"!=c&&(a="in",i=c);else if("in"==a&&i!=c){if("w"==i&&"W"==c&&0>o&&s--,"W"==i&&"w"==c&&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,a=0,i;a=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},c[p[g+"Down"]="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())},c[p["Shift-"+m+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],o=0;or.line&&i==a.line&&0==a.ch||n.push({anchor:i==r.line?r:u(i,0),head:i==a.line?a:u(i)});e.setSelections(n,0)},p["Shift-Tab"]="indentLess",c[p.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},c[p[m+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],o=0,r;or?o.push(d,l):o.length&&(o[o.length-1]=l),r=l}t.operation(function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+i,u(t.lastLine()),null,"+swapLine"):t.replaceRange(i+"\n",u(r,0),null,"+swapLine")}t.setSelections(a),t.scrollIntoView()})},c[p[y+"Down"]="swapLineDown"]=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),o=[],r=t.lastLine()+1,a=n.length-1;0<=a;a--){var i=n[a],s=i.to().line+1,d=i.from().line;0!=i.to().ch||i.empty()||s--,se.firstLine()&&e.addSelection(u(o.head.line-1,o.head.ch))})},c[p["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0,o;n",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:"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"}],d=[{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"}],l=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",tt),N(e),t.on(e.getInputField(),"paste",g(e))}function p(e){e.setOption("disableInput",!1),e.off("cursorActivity",tt),t.off(e.getInputField(),"paste",g(e)),e.state.vim=null}function c(e,n){this==t.keyMap.vim&&t.rmClass(e.getWrapperElement(),"cm-fat-cursor"),n&&n.attach==u||p(e,!1)}function u(e,n){this==t.keyMap.vim&&t.addClass(e.getWrapperElement(),"cm-fat-cursor"),n&&n.attach==u||i(e)}function h(e,n){if(n){if(this[e])return this[e];var o=m(e);if(!o)return!1;var r=t.Vim.findKey(n,o);return"function"==typeof r&&t.signal(n,"vim-keypress",o),r}}function m(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),n=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==n.length)return!1;for(var o=!1,r=0,a;r")}function g(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(B(e.getCursor(),0,1)),wt.enterInsertMode(e,{},t))}),t.onPasteFn}function f(e,t){for(var o=[],r=e;r=e.firstLine()&&t<=e.lastLine()}function b(e){return /^[a-z]$/.test(e)}function v(e){return-1!="()[]{}".indexOf(e)}function x(e){return pt.test(e)}function C(e){return /^[A-Z]$/.test(e)}function S(e){return /^\s*$/.test(e)}function E(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 H(e){var t=/^.*(<[\w\-]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(1":n="\n";break;case"":n=" ";break;default:}return n}function j(e,t,n){return function(){for(var o=0;op?u:0,m=r[h].anchor,g=o(m.line,i.line),f=a(m.line,i.line),y=m.ch,b=i.ch,v=r[h].head.ch-y,x=b-y;0=x?(y++,!s&&b--):0>v&&0<=x?(y--,!c&&b++):0>v&&-1==x&&(y--,b++);for(var C=g,S;C<=f;C++)S={anchor:new l(C,y),head:new l(C,b)},n.push(S);return p=i.line==f?n.length-1:0,e.setSelections(n),t.ch=b,m.ch=y,m}function te(e,t,n){for(var o=[],r=0,a;ru&&(s.line=u),s.ch=Y(e,s.line)}else s.ch=0,d.ch=Y(e,d.line);return{ranges:[{anchor:d,head:s}],primary:0}}if("block"==n){for(var h=o(d.line,s.line),m=o(d.ch,s.ch),g=a(d.line,s.line),f=a(d.ch,s.ch)+1,y=g-h+1,b=s.line==h?0:y-1,v=[],x=0;x=i.length)return null;o?d=ut[0]:(d=ct[0],!d(i.charAt(s))&&(d=ct[1]));for(var p=s,c=s;d(i.charAt(p))&&pc&&!f?f=!0:r=!1,u=d;u>p&&(r&&a(u)!=f&&u!=d||!s(u,-1,!0));u--);return i=new l(u,0),{start:i,end:h}}function ke(e,t,n,o){var r=t,a={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[n],i={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[n],s=e.getLine(r.line).charAt(r.ch),d=s===i?1:0,p,c;if(p=e.scanForBracket(l(r.line,r.ch+d),-1,null,{bracketRegex:a}),c=e.scanForBracket(l(r.line,r.ch+d),1,null,{bracketRegex:a}),!p||!c)return{start:r,end:r};if(p=p.pos,c=c.pos,p.line==c.line&&p.ch>c.ch||p.line>c.line){var u=p;p=c,c=u}return o?c.ch+=1:p.ch+=1,{start:p,end:c}}function Te(e,t,n,o){var r=q(t),a=e.getLine(r.line),s=a.split(""),d=s.indexOf(n),p,c,u,i;if(r.ch"+t+"",{bottom:!0,duration:5e3}):alert(t)}function Me(e,t){var n=""+(e||"")+"";return t&&(n+=" "+t+""),n}function Fe(e,t){var n=(t.prefix||"")+" "+(t.desc||""),o=Me(t.prefix,t.desc);Ne(e,o,n,t.onClose,t)}function Be(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 ze(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 Ke(e,t,n){if("'"==n){var o=e.doc.history.done,r=o[o.length-2];return r&&r.ranges&&r.ranges[0].head}var a=t.marks[n];return a&&a.find()}function Ge(e,n,o,r,a,i,s,d,l){function p(){e.operation(function(){for(;!m;)c(),u();h()})}function c(){var t=e.getRange(i.from(),i.to()),n=t.replace(s,d);i.replace(n)}function u(){for(;i.findNext()&&qe(i.from(),r,a);)if(o||!g||i.from().line!=g.line)return e.scrollIntoView(i.from(),30),e.setSelection(i.from(),i.to()),g=i.from(),void(m=!1);m=!0}function h(t){if(t&&t(),e.focus(),g){e.setCursor(g);var n=e.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=g.ch}l&&l()}e.state.vim.exMode=!0;var m=!1,g=i.from();return u(),m?void De(e,"No matches for "+s.source):n?void Fe(e,{prefix:"replace with "+d+" (y/n/a/q/l)",onKeyDown:function(n,o,r){t.e_stop(n);var a=t.keyName(n);switch(a){case"Y":c(),u();break;case"N":u();break;case"A":var i=l;l=void 0,e.operation(p),l=i;break;case"L":c();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":h(r);}return m&&h(r),!0}}):(p(),void(l&&l()))}function Xe(e){var n=e.state.vim,o=Ct.macroModeState,r=Ct.registerController.getRegister("."),a=o.isPlaying,s=o.lastInsertModeChanges,d=[];if(!a){for(var l=s.inVisualBlock?n.lastSelection.visualBlock.height:1,p=s.changes,d=[],c=0;c|<\w+>|./.exec(i),c=p[0],i=i.substring(p.index+c.length),t.Vim.handleKey(e,c,"macro"),n.insertMode){var u=a.insertModeChanges[d++].changes;Ct.macroModeState.lastInsertModeChanges.changes=u,st(e,u,1),Xe(e)}o.isPlaying=!1}function Je(e,t){if(!e.isPlaying){var n=e.latestRegister,o=Ct.registerController.getRegister(n);o&&o.pushText(t)}}function $e(e){if(!e.isPlaying){var t=e.latestRegister,n=Ct.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}function Ze(e,t){if(!e.isPlaying){var n=e.latestRegister,o=Ct.registerController.getRegister(n);o&&o.pushSearchQuery&&o.pushSearchQuery(t)}}function et(e,t){var n=Ct.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),o.changes.push(r)}t=t.next}}function tt(e){var t=e.state.vim;if(t.insertMode){var n=Ct.macroModeState;if(n.isPlaying)return;var o=n.lastInsertModeChanges;o.expectCursorActivityForChange?o.expectCursorActivityForChange=!1:o.maybeReset=!0}else e.curOp.isVimOp||ot(e,t);t.visualMode&&nt(e)}function nt(e){var t=e.state.vim,n=M(e,q(t.sel.head)),o=B(n,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(n,o,{className:"cm-animate-fat-cursor"})}function ot(e,n){var o=e.getCursor("anchor"),r=e.getCursor("head");if(n.visualMode&&!e.somethingSelected()?le(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 a=K(r,o)?0:-1,i=K(r,o)?-1:0;r=B(r,0,a),o=B(o,0,i),n.sel={anchor:o,head:r},Ce(e,n,"<",G(r,o)),Ce(e,n,">",X(r,o))}else n.insertMode||(n.lastHPos=e.getCursor().ch)}function rt(e){this.keyName=e}function at(n){var e=Ct.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 rt(r)),!0}))}function it(e,t,n,o){function r(){d?Et.processAction(e,t,t.lastEditActionCommand):Et.evalInput(e,t)}function a(n){if(0"]),yt=[].concat(ht,mt,gt,["-","\"",".",":","/"]),bt={};k("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 vt=function(){var e=100,t=-1,n=0,o=0,r=Array(e);return{cachedCursor:void 0,add:function(a,i,s){function d(n){var o=++t%e,i=r[o];i&&i.clear(),r[o]=a.setBookmark(n)}var l=t%e,p=r[l];if(p){var c=p.find();c&&!z(c,i)&&d(i)}else d(i);d(s),n=t,o=t-e+1,0>o&&(o=0)},move:function(a,i){t+=i,t>n?t=n:to)}return s}}},xt=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};I.prototype={exitMacroRecordMode:function(){var e=Ct.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=Ct.registerController.getRegister(t);n&&(n.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var Ct,St;L.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},L.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)&&(n.selectedCharacter=H(e)),{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=F(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);R(e)}o.operator=n.operator,o.operatorArgs=F(n.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var o=t.visualMode,r=F(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(),a=F(n.actionArgs)||{};o.selectedCharacter&&(a.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),a.repeat=r||1,a.repeatIsExplicit=!!r,a.registerName=o.registerName,R(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,o,n),wt[n.action](e,a,t)},processSearch:function(n,e,r){function a(t,o,a){Ct.searchHistoryController.pushInput(t),Ct.searchHistoryController.reset();try{Ue(n,t,o,a)}catch(o){return De(n,"Invalid regex: "+t),void R(n)}Et.processMotion(n,e,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:r.searchArgs.toJumplist}})}function i(e){n.scrollTo(h.left,h.top),a(e,!0,!0);var t=Ct.macroModeState;t.isRecording&&Ze(t,e)}function s(r,e,a){var i=t.keyName(r),s,d;"Up"==i||"Down"==i?(s="Up"==i,d=r.target?r.target.selectionEnd:0,e=Ct.searchHistoryController.nextMatch(e,s)||"",a(e),d&&r.target&&(r.target.selectionEnd=r.target.selectionStart=o(d,r.target.value.length))):"Left"!=i&&"Right"!=i&&"Ctrl"!=i&&"Alt"!=i&&"Shift"!=i&&Ct.searchHistoryController.reset();var p;try{p=Ue(n,e,!0,!0)}catch(t){}p?n.scrollIntoView(He(n,!l,p),30):(je(n),n.scrollTo(h.left,h.top))}function d(o,e,r){var a=t.keyName(o);"Esc"==a||"Ctrl-C"==a||"Ctrl-["==a||"Backspace"==a&&""==e?(Ct.searchHistoryController.pushInput(e),Ct.searchHistoryController.reset(),Ue(n,u),je(n),n.scrollTo(h.left,h.top),t.e_stop(o),R(n),r(),n.focus()):"Up"==a||"Down"==a?t.e_stop(o):"Ctrl-U"==a&&(t.e_stop(o),r(""))}if(n.getSearchCursor){var l=r.searchArgs.forward,p=r.searchArgs.wholeWordOnly;Ie(n).setReversed(!l);var c=l?"/":"?",u=Ie(n).getQuery(),h=n.getScrollInfo();switch(r.searchArgs.querySrc){case"prompt":var m=Ct.macroModeState;if(m.isPlaying){var g=m.replaySearchQueries.shift();a(g,!0,!1)}else Fe(n,{onClose:i,prefix:c,desc:Rt,onKeyUp:s,onKeyDown:d});break;case"wordUnderCursor":var f=he(n,!1,!0,!1,!0),y=!0;if(f||(f=he(n,!1,!0,!1,!1),y=!1),!f)return;var g=n.getLine(f.start.line).substring(f.start.ch,f.end.ch);g=y&&p?"\\b"+g+"\\b":$(g),Ct.jumpList.cachedCursor=n.getCursor(),n.setCursor(f.start),a(g,!0,!1);}}},processEx:function(n,e,r){function a(e){Ct.exCommandHistoryController.pushInput(e),Ct.exCommandHistoryController.reset(),_t.processCommand(n,e)}function i(r,e,a){var i=t.keyName(r),s,d;("Esc"==i||"Ctrl-C"==i||"Ctrl-["==i||"Backspace"==i&&""==e)&&(Ct.exCommandHistoryController.pushInput(e),Ct.exCommandHistoryController.reset(),t.e_stop(r),R(n),a(),n.focus()),"Up"==i||"Down"==i?(t.e_stop(r),s="Up"==i,d=r.target?r.target.selectionEnd:0,e=Ct.exCommandHistoryController.nextMatch(e,s)||"",a(e),d&&r.target&&(r.target.selectionEnd=r.target.selectionStart=o(d,r.target.value.length))):"Ctrl-U"==i?(t.e_stop(r),a("")):"Left"!=i&&"Right"!=i&&"Ctrl"!=i&&"Alt"!=i&&"Shift"!=i&&Ct.exCommandHistoryController.reset()}"keyToEx"==r.type?_t.processCommand(n,r.exArgs.input):e.visualMode?Fe(n,{onClose:a,prefix:":",value:"'<,'>",onKeyDown:i}):Fe(n,{onClose:a,prefix:":",onKeyDown:i})},evalInput:function(t,n){var o=n.inputState,r=o.motion,a=o.motionArgs||{},s=o.operator,d=o.operatorArgs||{},p=o.registerName,c=n.sel,u=q(n.visualMode?M(t,c.head):t.getCursor("head")),h=q(n.visualMode?M(t,c.anchor):t.getCursor("anchor")),m=q(u),g=q(h),f,y,b;if(s&&this.recordLastEdit(n,o),b=void 0===o.repeatOverride?o.getRepeat():o.repeatOverride,0",K(y,f)?f:y)):!s&&(f=M(t,f),t.setCursor(f.line,f.ch))}if(s){if(d.lastSel){y=g;var S=d.lastSel,E=e(S.head.line-S.anchor.line),k=e(S.head.ch-S.anchor.ch);f=S.visualLine?l(g.line+E,g.ch):S.visualBlock?l(g.line+E,g.ch+k):S.head.line==S.anchor.line?l(g.line,g.ch+k):l(g.line+E,g.ch),n.visualMode=!0,n.visualLine=S.visualLine,n.visualBlock=S.visualBlock,c=n.sel={anchor:y,head:f},ie(t)}else n.visualMode&&(d.lastSel={anchor:q(c.anchor),head:q(c.head),visualBlock:n.visualBlock,visualLine:n.visualLine});var T,w,I,N,A;if(!n.visualMode){if(T=q(y||g),w=q(f||m),K(w,T)){var L=T;T=w,w=L}I=a.linewise||d.linewise,I?ce(t,T,w):a.forward&&pe(t,T,w),N="char";var O=!a.inclusive||I;A=se(t,{anchor:T,head:w},N,O)}else if(T=G(c.head,c.anchor),w=X(c.head,c.anchor),I=n.visualLine||d.linewise,N=n.visualBlock?"block":I?"line":"char",A=se(t,{anchor:T,head:w},N),I){var P=A.ranges;if("block"==N)for(var _=0;_p&&r.line==p?this.moveToEol(e,t,n,o):(n.toFirstChar&&(a=ue(e.getLine(s)),o.lastHPos=a),o.lastHSPos=e.charCoords(l(s,a),"div").left,l(s,a))},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 a=n.repeat,i=e.findPosV(r,n.forward?a:-a,"line",o.lastHSPos);if(i.hitSide)if(n.forward)var s=e.charCoords(i,"div"),d={top:s.top+8,left:o.lastHSPos},i=e.coordsChar(d,"div");else{var p=e.charCoords(l(e.firstLine(),0),"div");p.left=o.lastHSPos,i=e.coordsChar(p,"div")}return o.lastHPos=i.ch,i},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 Ee(e,t,n.repeat,o)},moveByScroll:function(e,t,n,o){var r=e.getScrollInfo(),a=null,i=n.repeat;i||(i=r.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");n.repeat=i;var a=kt.moveByDisplayLines(e,t,n,o);if(!a)return null;var d=e.charCoords(a,"local");return e.scrollTo(null,r.top+d.top-s.top),a},moveByWords:function(e,t,n){return be(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var o=n.repeat,r=ve(e,o,n.forward,n.selectedCharacter),a=n.forward?-1:1;return(ge(a,n),!r)?null:(r.ch+=a,r)},moveToCharacter:function(e,t,n){var o=n.repeat;return ge(0,n),ve(e,o,n.forward,n.selectedCharacter)||t},moveToSymbol:function(e,t,n){var o=n.repeat;return fe(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,xe(e,r)},moveToEol:function(e,t,n,o){o.lastHPos=Infinity;var r=l(t.line+n.repeat-1,Infinity),a=e.clipPos(r);return a.ch--,o.lastHSPos=e.charCoords(a,"div").left,r},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return l(n.line,ue(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){var n=t,o=n.line,r=n.ch,a=e.getLine(o),i;do if(i=a.charAt(r++),i&&v(i)){var s=e.getTokenTypeAt(l(o,r));if("string"!==s&&"comment"!==s)break}while(i);if(i){var d=e.findMatchingBracket(l(o,r));return d.to}return n},moveToStartOfLine:function(e,t){return l(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var o=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(o=n.repeat-e.getOption("firstLineNumber")),l(o,ue(e.getLine(o)))},textObjectManipulation:function(e,t,n,o){var r=n.selectedCharacter;"b"==r?r="(":"B"==r&&(r="{");var a=!n.textObjectInner,i;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"["}[r])i=ke(e,t,r,a);else if({"'":!0,'"':!0}[r])i=Te(e,t,r,a);else if("W"===r)i=he(e,a,!0,!0);else if("w"===r)i=he(e,a,!0,!1);else{if("p"!==r)return null;if(i=Ee(e,t,n.repeat,0,a),n.linewise=!0,o.visualMode)o.visualLine||(o.visualLine=!0);else{var s=o.inputState.operatorArgs;s&&(s.linewise=!0),i.end.line--}}return e.state.vim.visualMode?ae(e,i.start,i.end):[i.start,i.end]},repeatLastCharacterSearch:function(e,t,n){var o=Ct.lastCharacterSearch,r=n.repeat,a=n.forward===o.forward,i=(o.increment?1:0)*(a?-1:1);e.moveH(-i,"char"),n.inclusive=!!a;var s=ve(e,r,a,o.selectedCharacter);return s?(s.ch+=i,s):(e.moveH(i,"char"),t)}},Tt={change:function(e,n,o){var r=Number.MAX_VALUE,a=e.state.vim,i,s;if(Ct.macroModeState.lastInsertModeChanges.inVisualBlock=a.visualBlock,!a.visualMode){var d=o[0].anchor,p=o[0].head;s=e.getRange(d,p);var c=a.lastEditInputState||{};if("moveByWords"==c.motion&&!S(s)){var u=/\s+$/.exec(s);u&&c.motionArgs&&c.motionArgs.forward&&(p=B(p,0,-u[0].length),s=s.slice(0,-u[0].length))}var h=new l(d.line-1,r),m=e.firstLine()==e.lastLine();p.line>e.lastLine()&&n.linewise&&!m?e.replaceRange("",h,p):e.replaceRange("",d,p),n.linewise&&(!m&&(e.setCursor(h),t.commands.newlineAndIndent(e)),d.ch=r),i=d}else{s=e.getSelection();var g=D("",o.length);e.replaceSelections(g),i=G(o[0].head,o[0].anchor)}Ct.registerController.pushText(n.registerName,"change",s,n.linewise,1p.top?(l.line+=(d-p.top)/a,l.line=Math.ceil(l.line),e.setCursor(l),p=e.charCoords(l,"local"),e.scrollTo(null,p.top)):e.scrollTo(null,d);else{var c=d+e.getScrollInfo().clientHeight;c=d.anchor.line?p=B(d.head,0,1):p=l(d.anchor.line,0);else if("inplace"==s&&i.visualMode)return;n.setOption("disableInput",!1),r&&r.replace?(n.toggleOverwrite(!0),n.setOption("keyMap","vim-replace"),t.signal(n,"vim-mode-change",{mode:"replace"})):(n.toggleOverwrite(!1),n.setOption("keyMap","vim-insert"),t.signal(n,"vim-mode-change",{mode:"insert"})),Ct.macroModeState.isPlaying||(n.on("change",et),t.on(n.getInputField(),"keydown",at)),i.visualMode&&le(n),te(n,p,c)}},toggleVisualMode:function(e,n,o){var r=n.repeat,a=e.getCursor(),i;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":""}),ie(e)):le(e):(o.visualMode=!0,o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,i=M(e,l(a.line,a.ch+r-1),!0),o.sel={anchor:a,head:i},t.signal(e,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ie(e),Ce(e,o,"<",G(a,i)),Ce(e,o,">",X(a,i)))},reselectLastSelection:function(e,n,o){var r=o.lastSelection;if(o.visualMode&&re(e,o),r){var a=r.anchorMark.find(),i=r.headMark.find();if(!a||!i)return;o.sel={anchor:a,head:i},o.visualMode=!0,o.visualLine=r.visualLine,o.visualBlock=r.visualBlock,ie(e),Ce(e,o,"<",G(a,i)),Ce(e,o,">",X(a,i)),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"),K(r,o)){var s=r;r=o,o=s}r.ch=Y(e,r.line)-1}else{var d=a(t.repeat,2);o=e.getCursor(),r=M(e,l(o.line+d-1,Infinity))}for(var p=0,c=o.line;cn)return"";if(e.getOption("indentWithTabs")){var o=r(n/d);return Array(o+1).join("\t")}return Array(n+1).join(" ")});s+=m?"\n":""}if(1e.lastLine()&&e.replaceRange("\n",l(I,0));var N=Y(e,I);Np.length&&(s=p.length),d=l(a.line,s)}if("\n"==r)o.visualMode||e.replaceRange("",a,d),(t.commands.newlineAndIndentContinueComment||t.commands.newlineAndIndent)(e);else{var c=e.getRange(a,d);if(c=c.replace(/[^\n]/g,r),o.visualBlock){var u=Array(e.getOption("tabSize")+1).join(" ");c=e.getSelection(),c=c.replace(/\t/g,u).replace(/[^\n]/g,r).split("\n"),e.replaceSelections(c)}else e.replaceRange(c,a,d);o.visualMode?(a=K(i[0].anchor,i[0].head)?i[0].anchor:i[0].head,e.setCursor(a),le(e,!1)):e.setCursor(B(d,0,-1))}},incrementNumberToken:function(e,t){for(var n=e.getCursor(),o=e.getLine(n.line),r=/-?\d+/g,a,i,s,d,p;null!==(a=r.exec(o))&&(p=a[0],i=a.index,s=i+p.length,!(n.cht.args.length?void De(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&&De(e,"Invalid mapping: "+t.input)):void _t.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&&De(e,"No such mapping: "+t.input)):void _t.unmap(o[0],n)},move:function(e,t){Et.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&&De(e,"Invalid mapping: "+t.input));var r=n[0].split("="),a=r[0],i=r[1],s=!1;if("?"==a.charAt(a.length-1)){if(i)throw Error("Trailing characters: "+t.argString);a=a.substring(0,a.length-1),s=!0}void 0===i&&"no"==a.substring(0,2)&&(a=a.substring(2),i=!1);var d=bt[a]&&"boolean"==bt[a].type;if(d&&void 0==i&&(i=!0),!d&&void 0===i||s){var l=w(a,e,o);!0===l||!1===l?De(e," "+(l?"":"no")+a):De(e," "+a+"="+l)}else T(a,i,e,o)},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=Ct.registerController.registers,r="----------Registers----------

";if(!n)for(var a in o){var s=o[a].toString();s.length&&(r+="\""+a+" "+s+"
")}else{var a;n=n.join("");for(var d=0;d"}}De(e,r)},sort:function(e,n){function o(e,t){if(s){var n;n=e,e=t,t=n}d&&(e=e.toLowerCase(),t=t.toLowerCase());var o=c&&v.exec(e),r=c&&v.exec(t);return o?(o=parseInt((o[1]+o[2]).toLowerCase(),x),r=parseInt((r[1]+r[2]).toLowerCase(),x),o-r):e");if(!d)return void De(e,c);var h=0,m=function(){if(h=c)return void De(e,"Invalid argument: "+o.argString.substring(i));for(var u=0,h;u<=c-p;u++)h=n(p+u),delete r.marks[h]}else return void De(e,"Invalid argument: "+d+"-")}else delete r.marks[s]}}},_t=new Ot;return t.keyMap.vim={attach:u,detach:c,call:h},k("insertModeEscKeysTimeout",200,"number"),t.keyMap["vim-insert"]={fallthrough:["default"],attach:u,detach:c,call:h},t.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:u,detach:c,call:h},(A(),{buildKeyMap:function(){},getRegisterController:function(){return Ct.registerController},resetVimGlobalState_:A,getVimGlobalState_:function(){return Ct},maybeInitVimState_:N,suppressErrorLogging:!1,InsertModeKey:rt,map:function(e,t,n){_t.map(e,t,n)},unmap:function(e,t){_t.unmap(e,t)},setOption:T,getOption:w,defineOption:k,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");Pt[e]=n,_t.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,e,o){function r(){var t=Ct.macroModeState;if(t.isRecording){if("q"==e)return t.exitMacroRecordMode(),R(n),!0;"mapping"!=o&&Je(t,e)}}function a(){if(""==e)return R(n),d.visualMode?le(n):d.insertMode&&Xe(n),!0}function i(o){for(var r;o;)r=/<\w+-.+?>|<\w+>|./.exec(o),e=r[0],o=o.substring(r.index+e.length),t.Vim.handleKey(n,e,"mapping")}var d=N(n),l;return l=d.insertMode?function(){if(a())return!0;for(var t=d.inputState.keyBuffer+=e,o=1==e.length,r=Et.matchCommand(t,s,d.inputState,"insert");1=e}function a(e){return 47e}function s(e){return e===Tr||e===zr}function l(t){return t&&t!==Rr&&!s(t)&&!te(t)}function c(s,l,e){l=_r(s.length,jr(0,null==l?s.length:l)),null!=e&&!0!==e||(l=u(s,l));var n=new $r(s),i;n.pos=l;for(var r=[];!n.sol();){if(i=n.peek(),h(i))r.push(i);else if(!d(i)){if(t(r,Wr)||t(r,Br)){n.pos--;continue}if(Lr(n)||!p(i))break}else if(r.pop()!==Yr.get(i))break;n.pos--}if(!r.length&&n.pos!==l){var o=s.slice(n.pos,l).replace(/^[\*\+\>\^]+/,"");return{abbreviation:o,location:l-o.length}}}function u(t,e){for(te(t.charCodeAt(e))&&e++;h(t.charCodeAt(e));)e++;return e}function t(n,t){return-1!==n.indexOf(t)}function p(e){return 64e||96e||47e||Dr.has(e)}function d(e){return e===Fr||e===Pr||e===Ir}function h(e){return e===Wr||e===Ur||e===Br}function m(n,t){return t&&(n="upper"===t?n.toUpperCase():n.toLowerCase()),n}function g(n,o){return n instanceof Jr?n:"string"==typeof n?new Jr(n,o):n&&"object"==typeof n?new Jr(n.name,n.value,n.options):void 0}function f(e){return(e+"").trim()}function y(o,t,e){return o&&e.indexOf(o)===t}function b(e){return e===ia||e===sa}function v(e){return 47e}function x(o,t,e){return t=t||65,e=e||90,(o&=-33)>=t&&o<=e}function k(e){return v(e)||x(e)}function C(e){return 32===e||9===e||160===e}function w(e){return C(e)||10===e||13===e}function A(s,t,e,n){n=n?Object.assign({},$a,n):$a;var r=s.pos;if(s.eat(t)){for(var i=1,a;!s.eof();)if(!Ca(s,n))if((a=s.next())===t)i++;else if(!(a===e))a===n.escape&&s.next();else if(! --i)return s.start=r,!0;if(s.pos=r,n.throws)throw s.error("Unable to find matching pair for "+Or(t))}return!1}function O(o){var r={};o.charCodeAt(0)===ai&&(o=o.slice(1),r.implied=!0),o.charCodeAt(o.length-1)===ii&&(o=o.slice(0,o.length-1),r.boolean=!0);var e={name:o};return Object.keys(r).length&&(e.options=r),e}function _(n){var t=n.pos;if(n.eatWhile(S))return n.start=t,!0}function S(e){return!w(e)&&!b(e)&&e!==di&&e!==li&&e!==si}function E(e){return e.start=e.pos,e.eatWhile(j),e.current()}function j(e){return k(e)||45===e||58===e||36===e||64===e||33===e||95===e||37===e}function q(d){for(var t=new aa(d.trim()),n=new Kr,r=n,i=[],o;!t.eof();)if(!((o=t.peek())!==hi)){var e=new Kr,l=i.length?T(i)[0]:r;i.push([e,l,t.pos]),r=e,t.next()}else if(o!==mi){var p=ui(t);if(r.appendChild(p),t.eof())break;switch(t.peek()){case gi:t.next();continue;case fi:t.next(),r=p;continue;case yi:for(;t.eat(yi);)r=r.parent||r;continue;}}else{var a=i.pop();if(!a)throw t.error("Unexpected \")\" group end");var c=a[0];if(r=a[1],t.next(),c.repeat=ei(t))r.appendChild(c);else{for(;c.firstChild;)r.appendChild(c.firstChild);t.eat(gi)}}if(i.length)throw t.pos=i.pop()[2],t.error("Expected group close");return n}function T(e){return e[e.length-1]}function M(o){if(o.repeat&&o.repeat.count){for(var t=1,e;tn&&(n=e.index)}),-1!==n&&(a.index=n+1),e}function Ct(d,l){if(null==d)return d;for(var e=[],t=function(e,t,n,o){return null==l[n]?"":t+l[n]+o},o="",a=0,i=0,s,n;i=t.get("inlineBreak"))return!0}for(var o=0,a=d.children.length;on?0:n}function Ut(a,t){var e=a.node;if(t.enabled&&t.trigger&&e.name)for(var n=a.node.attributes.reduce(function(n,t){return t.name&&null!=t.value&&(n[t.name.toUpperCase().replace(/-/g,"_")]=t.value),n},{}),r=0,i=t.trigger.length;rt?0:t}function zt(o,t){var e=o.node;return!e.isTextOnly&&e.value&&(o.beforeText=ho.test(e.value)?o.newline+o.indent+t.indent(1):" "),o}function Vt(o,t){if(null!=o.value&&ho.test(o.value)){var e=wt(o.value),n=t.indent(1),r=e.reduce(function(n,t){return jr(n,t.length)},0);return e.map(function(o,t){return""+(t?n:"")+Xt(o,r)+" |"}).join("\n")}return o.value}function Xt(n,t){for(;n.length>4).toString(16)}function ae(e){return se(e.toString(16),2)}function se(n,t){for(;n.length=r&&(r=a,n=o)}return n}function qe(o,a){var e=o&&"object"==typeof o?o[a]:o,n=(e||"").match(/^[\w-@]+/);return n?n[0]:e}function ze(o,t){for(var e=0,n=0;en&&(t=t.slice(0,n-1).concat(t.slice(n-1).join(", ")));t.length;){var r=t.shift(),i=e.fields.shift(),o=r.length-i.length;e.string=e.string.slice(0,i.location)+r+e.string.slice(i.location+i.length);for(var a=0,s=e.fields.length;aa.length)return a;a=a.slice();var t=a.length,e=/,$/,n=0;n=3=t?Be(0,1):6=t?Be(0,2):Be(1,4);for(var r=0,i=void 0;rgn(t,o.to):0<=gn(t,o.from)&&0>=gn(t,o.to)}function gn(n,t){return n.line-t.line||n.ch-t.ch}function fn(o,t,e){return Zt(o,Object.assign({syntax:an(t),field:xa},Cn(t),e))}function yn(n,t){return en(n,Object.assign({syntax:an(t)},Cn(t)))}function bn(n,t){return t=t||t.getCursor(),c(n.getLine(t.line),t.ch,!0)}function vn(n,o){try{return{ast:yn(n,o),abbreviation:n,snippet:fn(n,o)}}catch(e){return null}}function xn(d,t,l){var n=!1,p=0,o;try{o=fn(t,d,{field:function(o,t){return void 0===t&&(t=""),n||(n=!0,p=t.length,t=ya+t),t}})}catch(e){return!1}var e=d.getLine(l.from.line),r=e.match(/^\s+/);o=cn(d,o,r&&r[0]);var a=o.length;return n&&(a=o.indexOf(ya),o=o.slice(0,a)+o.slice(a+ya.length)),d.operation(function(){d.replaceRange(o,l.from,l.to);var t=d.indexFromPos(l.from),e=d.posFromIndex(a+t);return p?d.setSelection(e,{line:e.line,ch:e.ch+p}):d.setCursor(e),!0})}function Cn(o,t){var e=o.getModeAt(t||o.getCursor()),n=o.getOption("emmet"),r=n&&n.profile;return"xml"===e.name&&(r=Object.assign({selfClosingStyle:e.configuration},r)),Object.assign({profile:r,snippets:kn(o,an(o,t))},n)}function kn(o,t){var e=o.getOption("emmet");if(e)return on(t)?e.stylesheetSnippets:e.markupSnippets}function wn(n){var t=An(n,n.getCursor());t&&_n(n,t)||(Sn(n),ln(n)&&On(n,n.getCursor()))}function An(o,t){for(var e=o.findMarksAt(t),n=0;n\^\+\(\)]/.test(o[t-r.length-1]))?r:null}function Bn(e){return e===qa||e===za}function Dn(e){return 47e}function qn(o,t,e){return t=t||65,e=e||90,(o&=-33)>=t&&o<=e}function zn(e){return Dn(e)||qn(e)}function Vn(e){return 32===e||9===e||160===e}function Gn(e){return Vn(e)||10===e||13===e}function Hn(s,t,e,n){n=n?Object.assign({},Ra,n):Ra;var r=s.pos;if(s.eat(t)){for(var i=1,a;!s.eof();)if(!Ma(s,n))if((a=s.next())===t)i++;else if(!(a===e))a===n.escape&&s.next();else if(! --i)return s.start=r,!0;if(s.pos=r,n.throws)throw s.error("Unable to find matching pair for "+Or(t))}return!1}function Xn(o,t){var e=o.pos;return o.eatWhile(t)?new Wa(o,e,o.pos):void(o.pos=e)}function Qn(e){return Ia(e)||Fa(e,Kn)}function Yn(a){var t=a.pos;if(Ma(a)){var e=a.pos,i,n;a.pos=t,a.next(),i=a.start=a.pos,a.pos=e,a.backUp(1),n=a.pos;var r=Fa(a,i,n);return a.pos=e,r}return Ia(a)||$n(a)}function Kn(e){return e!==Da&&!Jn(e)&&!Gn(e)}function Jn(e){return e===Ya||e===Ba}function $n(e){return Fa(e,Zn)}function Zn(e){return!(isNaN(e)||Bn(e)||Gn(e)||Jn(e))}function er(e){return Fa(e,tr)}function tr(e){return zn(e)||e===Ha||e===Xa||e===Va||e===Za}function nr(o,t){for(var e=o.pos,n=0;n"))},new Map),u=[o],l,n,r;!e.eof();)if(!(l=ir(e)))e.next();else if(r=lr(l),"open"===l.type)n=new La(e,"tag",l),pr(u).addChild(n),s.has(r)?n.close=sr(e,s.get(r)):function(e,t){return e.selfClosing||!p.xml&&a.has(t)}(l,r)||u.push(n);else if("close"===l.type){for(var i=u.length-1;0","/"].map(Nr)),Yr=new Map().set(Fr,Wr).set(Pr,Ur).set(Ir,Br),Gr={indent:"\t",tagCase:"",attributeCase:"",attributeQuotes:"double",format:!0,formatSkip:["html"],formatForce:["body"],inlineBreak:3,compactBooleanAttributes:!1,booleanAttributes:["contenteditable","seamless","async","autofocus","autoplay","checked","controls","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","novalidate","readonly","required","reversed","selected","typemustmatch"],selfClosingStyle:"html",inlineElements:["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"]},Vr=function(e){this.options=Object.assign({},Gr,e),this.quoteChar="single"===this.options.attributeQuotes?"'":"\""};Vr.prototype.get=function(e){return this.options[e]},Vr.prototype.quote=function(e){return""+this.quoteChar+(null==e?"":e)+this.quoteChar},Vr.prototype.name=function(e){return m(e,this.options.tagCase)},Vr.prototype.attribute=function(e){return m(e,this.options.attributeCase)},Vr.prototype.isBooleanAttribute=function(e){return e.options.boolean||-1!==this.get("booleanAttributes").indexOf((e.name||"").toLowerCase())},Vr.prototype.selfClose=function(){switch(this.options.selfClosingStyle){case"xhtml":return" /";case"xml":return"/";default:return"";}},Vr.prototype.indent=function(o){var t=this;o=o||0;for(var e="";o--;)e+=t.options.indent;return e},Vr.prototype.isInline=function(e){return"string"==typeof e?-1!==this.get("inlineElements").indexOf(e.toLowerCase()):null==e.name?e.isTextOnly:this.isInline(e.name)},Vr.prototype.field=function(n,t){return this.options.field(n,t)};var Xr=function(n,t){this.key=n,this.value=t},Hr=function(e){this._string=new Map,this._regexp=new Map,this._disabled=!1,this.load(e)},Zr={disabled:{}};Zr.disabled.get=function(){return this._disabled},Hr.prototype.disable=function(){this._disabled=!0},Hr.prototype.enable=function(){this._disabled=!1},Hr.prototype.set=function(o,r){var e=this;if("string"==typeof o)o.split("|").forEach(function(n){return e._string.set(n,new Xr(n,r))});else{if(!(o instanceof RegExp))throw new Error("Unknow snippet key: "+o);this._regexp.set(o,new Xr(o,r))}return this},Hr.prototype.get=function(o){var t=this;if(!this.disabled){if(this._string.has(o))return this._string.get(o);for(var e=Array.from(this._regexp.keys()),n=0,r=e.length;nt||t>this.children.length)throw new Error("Unable to insert node: position is out of child list range");var e=this.children[t-1],n=this.children[t];o.remove(),o.parent=this,this.children.splice(t,0,o),e&&(o.previous=e,e.next=o),n&&(o.next=n,n.previous=o)},Kr.prototype.removeChild=function(n){var t=this.children.indexOf(n);-1!==t&&(this.children.splice(t,1),n.previous&&(n.previous.next=n.next),n.next&&(n.next.previous=n.previous),n.parent=n.next=n.previous=null)},Kr.prototype.remove=function(){this.parent&&this.parent.removeChild(this)},Kr.prototype.clone=function(n){var o=new Kr(this.name);return o.value=this.value,o.selfClosing=this.selfClosing,this.repeat&&(o.repeat=Object.assign({},this.repeat)),this._attributes.forEach(function(e){return o.setAttribute(e.clone())}),n&&this.children.forEach(function(e){return o.appendChild(e.clone(!0))}),o},Kr.prototype.walk=function(o,t){t=t||0;for(var e=this.firstChild,n;e;){if(n=e.next,!1===o(e,t)||!1===e.walk(o,t+1))return!1;e=n}},Kr.prototype.use=function(o){for(var t=arguments,e=[this],n=1;n=this.end},aa.prototype.limit=function(n,t){return new this.constructor(this.string,n,t)},aa.prototype.peek=function(){return this.string.charCodeAt(this.pos)},aa.prototype.next=function(){if(this.pos"},lo=/^id$/i,co=/^class$/i,fo={primary:function(e){return e.join("")},secondary:function(e){return e.map(function(e){return e.isBoolean?e.name:e.name+"="+e.value}).join(", ")}},qi={open:null,close:null,omitName:/^div$/i,attributes:fo},ho=/\n|\r/,mo=/\n|\r/,go={none:"[ SECONDARY_ATTRS]",round:"[(SECONDARY_ATTRS)]",curly:"[{SECONDARY_ATTRS}]",square:"[[SECONDARY_ATTRS]"},bo=/\n|\r/,vo={html:function(o,a,e){return e=Object.assign({},e),e.comment=Object.assign({},uo,e.comment),bt(o,e.field,function(n){if(n=qt(n,a),!St(n)){var t=n.node;if(t.name){var r=a.name(t.name),i=Nt(n,a);n.open="<"+r+i+(t.selfClosing?a.selfClose():"")+">",t.selfClosing||(n.close=""),Ut(n,e.comment)}!t.value&&(t.children.length||t.selfClosing)||(n.text=n.renderFields(t.value))}return n})},haml:function(o,a,e){e=e||{};var i={open:"[%NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)][SELF_CLOSE]",selfClose:"/",attributes:{secondary:function(e){return e.map(function(e){return e.isBoolean?e.name+(a.get("compactBooleanAttributes")?"":"=true"):e.name+"="+a.quote(e.value)}).join(" ")}}};return bt(o,e.field,function(e){if(e=It(e,a,i),e=zt(e,a),!St(e)){var t=e.node;!t.value&&(t.children.length||t.selfClosing)||(e.text=e.renderFields(Vt(t,a)))}return e})},slim:function(a,s,e){e=e||{};var t=e.attributeWrap&&go[e.attributeWrap]||go.none,n=t===go.none?function(e){return e.name+"=true"}:function(e){return e.name},i={open:"[NAME][PRIMARY_ATTRS]"+t+"[SELF_CLOSE]",selfClose:"/",attributes:{secondary:function(e){return e.map(function(e){return e.isBoolean?n(e):e.name+"="+s.quote(e.value)}).join(" ")}}};return bt(a,e.field,function(e){if(e=It(e,s,i),e=Ht(e,s),!St(e)){var t=e.node;!t.value&&(t.children.length||t.selfClosing)||(e.text=e.renderFields(Qt(t,s)))}return e})},pug:function(o,a,e){e=e||{};var i={open:"[NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)]",attributes:{secondary:function(e){return e.map(function(e){return e.isBoolean?e.name:e.name+"="+a.quote(e.value)}).join(", ")}}};return bt(o,e.field,function(e){if(e=It(e,a,i),e=Kt(e,a),!St(e)){var t=e.node;!t.value&&(t.children.length||t.selfClosing)||(e.text=e.renderFields(ee(t,a)))}return e})}},yo=function(o,t,e,a){return"object"==typeof e&&(a=e,e=null),ne(e)||(e="html"),vo[e](o,t,a)},xo=function(){this.type="css-value",this.value=[]},wo={size:{}};wo.size.get=function(){return this.value.length},xo.prototype.add=function(e){this.value.push(e)},xo.prototype.has=function(e){return-1!==this.value.indexOf(e)},xo.prototype.toString=function(){return this.value.join(" ")},Object.defineProperties(xo.prototype,wo);var ko=function(n){if(35===n.peek()){n.start=n.pos,n.next(),n.eat(116)||n.eatWhile(re);var t=n.current();if(n.start=n.pos,n.eat(46)&&!n.eatWhile(v))throw n.error("Unexpected character for alpha value of color");return new $o(t,n.current())}},$o=function(o,t){this.type="color",this.raw=o,this.alpha=+(null!=t&&""!==t?t:1),o=o.slice(1);var e=0,n=0,r=0;if("t"===o)this.alpha=0;else switch(o.length){case 0:break;case 1:e=n=r=o+o;break;case 2:e=n=r=o;break;case 3:e=o[0]+o[0],n=o[1]+o[1],r=o[2]+o[2];break;default:o+=o,e=o.slice(0,2),n=o.slice(2,4),r=o.slice(4,6);}this.r=parseInt(e,16),this.g=parseInt(n,16),this.b=parseInt(r,16)};$o.prototype.toHex=function(n){var t=n&&ie(this.r)&&ie(this.g)&&ie(this.b)?oe:ae;return"#"+t(this.r)+t(this.g)+t(this.b)},$o.prototype.toRGB=function(){var 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(", ")+")"},$o.prototype.toString=function(e){return this.r||this.g||this.b||this.alpha?1===this.alpha?this.toHex(e):this.toRGB():"transparent"};var Co=46,Ao=45,Oo=function(n){if(n.start=n.pos,ce(n)){var t=n.current();return n.start=n.pos,n.eat(37)||n.eatWhile(le),new jo(t,n.current())}},jo=function(n,o){this.type="numeric",this.value=+n,this.unit=o||""};jo.prototype.toString=function(){return""+this.value+this.unit};var _o=45,So=function(n,t){return n.start=n.pos,n.eat(36)||n.eat(64)?n.eatWhile(pe):t?n.eatWhile(le):n.eatWhile(fe),n.start===n.pos?null:new Eo(n.current())},Eo=function(e){this.type="keyword",this.value=e};Eo.prototype.toString=function(){return this.value};var qo={throws:!0},zo=function(e){if(Ca(e,qo))return new To(e.current())},To=function(e){this.type="string",this.value=e};To.prototype.toString=function(){return this.value};var Mo=40,Ro=41,Lo=44,No=function(n,t){this.type="function",this.name=n,this.args=t||[]};No.prototype.toString=function(){return this.name+"("+this.args.join(", ")+")"};var Fo=33,Wo=36,Po=45,Uo=58,Io=64,Bo=function(a){for(var t=new Kr,e=new aa(a),n;!e.eof();){n=new Kr(ge(e)),n.value=be(e);var r=he(e);if(r)for(var i=0;isrc: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: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:color}|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"}},oa={latin:{common:["lorem","ipsum","dolor","sit","amet","consectetur","adipisicing","elit"],words:["exercitationem","perferendis","perspiciatis","laborum","eveniet","sunt","iure","nam","nobis","eum","cum","officiis","excepturi","odio","consectetur","quasi","aut","quisquam","vel","eligendi","itaque","non","odit","tempore","quaerat","dignissimos","facilis","neque","nihil","expedita","vitae","vero","ipsum","nisi","animi","cumque","pariatur","velit","modi","natus","iusto","eaque","sequi","illo","sed","ex","et","voluptatibus","tempora","veritatis","ratione","assumenda","incidunt","nostrum","placeat","aliquid","fuga","provident","praesentium","rem","necessitatibus","suscipit","adipisci","quidem","possimus","voluptas","debitis","sint","accusantium","unde","sapiente","voluptate","qui","aspernatur","laudantium","soluta","amet","quo","aliquam","saepe","culpa","libero","ipsa","dicta","reiciendis","nesciunt","doloribus","autem","impedit","minima","maiores","repudiandae","ipsam","obcaecati","ullam","enim","totam","delectus","ducimus","quis","voluptates","dolores","molestiae","harum","dolorem","quia","voluptatem","molestias","magni","distinctio","omnis","illum","dolorum","voluptatum","ea","quas","quam","corporis","quae","blanditiis","atque","deserunt","laboriosam","earum","consequuntur","hic","cupiditate","quibusdam","accusamus","ut","rerum","error","minus","eius","ab","ad","nemo","fugit","officia","at","in","id","quos","reprehenderit","numquam","iste","fugiat","sit","inventore","beatae","repellendus","magnam","recusandae","quod","explicabo","doloremque","aperiam","consequatur","asperiores","commodi","optio","dolor","labore","temporibus","repellat","veniam","architecto","est","esse","mollitia","nulla","a","similique","eos","alias","dolore","tenetur","deleniti","porro","facere","maxime","corrupti"]},ru:{common:["\u0434\u0430\u043B\u0435\u043A\u043E-\u0434\u0430\u043B\u0435\u043A\u043E","\u0437\u0430","\u0441\u043B\u043E\u0432\u0435\u0441\u043D\u044B\u043C\u0438","\u0433\u043E\u0440\u0430\u043C\u0438","\u0432 \u0441\u0442\u0440\u0430\u043D\u0435","\u0433\u043B\u0430\u0441\u043D\u044B\u0445","\u0438 \u0441\u043E\u0433\u043B\u0430\u0441\u043D\u044B\u0445","\u0436\u0438\u0432\u0443\u0442","\u0440\u044B\u0431\u043D\u044B\u0435","\u0442\u0435\u043A\u0441\u0442\u044B"],words:["\u0432\u0434\u0430\u043B\u0438","\u043E\u0442 \u0432\u0441\u0435\u0445","\u043E\u043D\u0438","\u0431\u0443\u043A\u0432\u0435\u043D\u043D\u044B\u0445","\u0434\u043E\u043C\u0430\u0445","\u043D\u0430 \u0431\u0435\u0440\u0435\u0433\u0443","\u0441\u0435\u043C\u0430\u043D\u0442\u0438\u043A\u0430","\u0431\u043E\u043B\u044C\u0448\u043E\u0433\u043E","\u044F\u0437\u044B\u043A\u043E\u0432\u043E\u0433\u043E","\u043E\u043A\u0435\u0430\u043D\u0430","\u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0438\u0439","\u0440\u0443\u0447\u0435\u0435\u043A","\u0434\u0430\u043B\u044C","\u0436\u0443\u0440\u0447\u0438\u0442","\u043F\u043E \u0432\u0441\u0435\u0439","\u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0438\u0432\u0430\u0435\u0442","\u0435\u0435","\u0432\u0441\u0435\u043C\u0438","\u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u043C\u0438","\u043F\u0440\u0430\u0432\u0438\u043B\u0430\u043C\u0438","\u044D\u0442\u0430","\u043F\u0430\u0440\u0430\u0434\u0438\u0433\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0430\u044F","\u0441\u0442\u0440\u0430\u043D\u0430","\u043A\u043E\u0442\u043E\u0440\u043E\u0439","\u0436\u0430\u0440\u0435\u043D\u043D\u044B\u0435","\u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u044F","\u0437\u0430\u043B\u0435\u0442\u0430\u044E\u0442","\u043F\u0440\u044F\u043C\u043E","\u0440\u043E\u0442","\u0434\u0430\u0436\u0435","\u0432\u0441\u0435\u043C\u043E\u0433\u0443\u0449\u0430\u044F","\u043F\u0443\u043D\u043A\u0442\u0443\u0430\u0446\u0438\u044F","\u043D\u0435","\u0438\u043C\u0435\u0435\u0442","\u0432\u043B\u0430\u0441\u0442\u0438","\u043D\u0430\u0434","\u0440\u044B\u0431\u043D\u044B\u043C\u0438","\u0442\u0435\u043A\u0441\u0442\u0430\u043C\u0438","\u0432\u0435\u0434\u0443\u0449\u0438\u043C\u0438","\u0431\u0435\u0437\u043E\u0440\u0444\u043E\u0433\u0440\u0430\u0444\u0438\u0447\u043D\u044B\u0439","\u043E\u0431\u0440\u0430\u0437","\u0436\u0438\u0437\u043D\u0438","\u043E\u0434\u043D\u0430\u0436\u0434\u044B","\u043E\u0434\u043D\u0430","\u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0430\u044F","\u0441\u0442\u0440\u043E\u0447\u043A\u0430","\u0440\u044B\u0431\u043D\u043E\u0433\u043E","\u0442\u0435\u043A\u0441\u0442\u0430","\u0438\u043C\u0435\u043D\u0438","lorem","ipsum","\u0440\u0435\u0448\u0438\u043B\u0430","\u0432\u044B\u0439\u0442\u0438","\u0431\u043E\u043B\u044C\u0448\u043E\u0439","\u043C\u0438\u0440","\u0433\u0440\u0430\u043C\u043C\u0430\u0442\u0438\u043A\u0438","\u0432\u0435\u043B\u0438\u043A\u0438\u0439","\u043E\u043A\u0441\u043C\u043E\u043A\u0441","\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0430\u043B","\u043E","\u0437\u043B\u044B\u0445","\u0437\u0430\u043F\u044F\u0442\u044B\u0445","\u0434\u0438\u043A\u0438\u0445","\u0437\u043D\u0430\u043A\u0430\u0445","\u0432\u043E\u043F\u0440\u043E\u0441\u0430","\u043A\u043E\u0432\u0430\u0440\u043D\u044B\u0445","\u0442\u043E\u0447\u043A\u0430\u0445","\u0437\u0430\u043F\u044F\u0442\u043E\u0439","\u043D\u043E","\u0442\u0435\u043A\u0441\u0442","\u0434\u0430\u043B","\u0441\u0431\u0438\u0442\u044C","\u0441\u0435\u0431\u044F","\u0442\u043E\u043B\u043A\u0443","\u043E\u043D","\u0441\u043E\u0431\u0440\u0430\u043B","\u0441\u0435\u043C\u044C","\u0441\u0432\u043E\u0438\u0445","\u0437\u0430\u0433\u043B\u0430\u0432\u043D\u044B\u0445","\u0431\u0443\u043A\u0432","\u043F\u043E\u0434\u043F\u043E\u044F\u0441\u0430\u043B","\u0438\u043D\u0438\u0446\u0438\u0430\u043B","\u0437\u0430","\u043F\u043E\u044F\u0441","\u043F\u0443\u0441\u0442\u0438\u043B\u0441\u044F","\u0434\u043E\u0440\u043E\u0433\u0443","\u0432\u0437\u043E\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044C","\u043F\u0435\u0440\u0432\u0443\u044E","\u0432\u0435\u0440\u0448\u0438\u043D\u0443","\u043A\u0443\u0440\u0441\u0438\u0432\u043D\u044B\u0445","\u0433\u043E\u0440","\u0431\u0440\u043E\u0441\u0438\u043B","\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439","\u0432\u0437\u0433\u043B\u044F\u0434","\u043D\u0430\u0437\u0430\u0434","\u0441\u0438\u043B\u0443\u044D\u0442","\u0441\u0432\u043E\u0435\u0433\u043E","\u0440\u043E\u0434\u043D\u043E\u0433\u043E","\u0433\u043E\u0440\u043E\u0434\u0430","\u0431\u0443\u043A\u0432\u043E\u0433\u0440\u0430\u0434","\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A","\u0434\u0435\u0440\u0435\u0432\u043D\u0438","\u0430\u043B\u0444\u0430\u0432\u0438\u0442","\u043F\u043E\u0434\u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A","\u0441\u0432\u043E\u0435\u0433\u043E","\u043F\u0435\u0440\u0435\u0443\u043B\u043A\u0430","\u0433\u0440\u0443\u0441\u0442\u043D\u044B\u0439","\u0440\u0435\u0442\u043E\u0440\u0438\u0447\u0435\u0441\u043A\u0438\u0439","\u0432\u043E\u043F\u0440\u043E\u0441","\u0441\u043A\u0430\u0442\u0438\u043B\u0441\u044F","\u0435\u0433\u043E","\u0449\u0435\u043A\u0435","\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u043B","\u0441\u0432\u043E\u0439","\u043F\u0443\u0442\u044C","\u0434\u043E\u0440\u043E\u0433\u0435","\u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043B","\u0440\u0443\u043A\u043E\u043F\u0438\u0441\u044C","\u043E\u043D\u0430","\u043F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0434\u0438\u043B\u0430","\u043C\u043E\u0435\u0439","\u0432\u0441\u0435","\u043F\u0435\u0440\u0435\u043F\u0438\u0441\u044B\u0432\u0430\u0435\u0442\u0441\u044F","\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E","\u0440\u0430\u0437","\u0435\u0434\u0438\u043D\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u0435","\u0447\u0442\u043E","\u043C\u0435\u043D\u044F","\u043E\u0441\u0442\u0430\u043B\u043E\u0441\u044C","\u044D\u0442\u043E","\u043F\u0440\u0438\u0441\u0442\u0430\u0432\u043A\u0430","\u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0439\u0441\u044F","\u0442\u044B","\u043B\u0443\u0447\u0448\u0435","\u0441\u0432\u043E\u044E","\u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0443\u044E","\u0441\u0442\u0440\u0430\u043D\u0443","\u043F\u043E\u0441\u043B\u0443\u0448\u0430\u0432\u0448\u0438\u0441\u044C","\u0440\u0443\u043A\u043E\u043F\u0438\u0441\u0438","\u043D\u0430\u0448","\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u043B","\u0441\u0432\u043E\u0439","\u043F\u0443\u0442\u044C","\u0432\u0441\u043A\u043E\u0440\u0435","\u0435\u043C\u0443","\u043F\u043E\u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043B\u0441\u044F","\u043A\u043E\u0432\u0430\u0440\u043D\u044B\u0439","\u0441\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044C","\u0440\u0435\u043A\u043B\u0430\u043C\u043D\u044B\u0445","\u0442\u0435\u043A\u0441\u0442\u043E\u0432","\u043D\u0430\u043F\u043E\u0438\u0432\u0448\u0438\u0439","\u044F\u0437\u044B\u043A\u043E\u043C","\u0440\u0435\u0447\u044C\u044E","\u0437\u0430\u043C\u0430\u043D\u0438\u0432\u0448\u0438\u0439","\u0441\u0432\u043E\u0435","\u0430\u0433\u0435\u043D\u0442\u0441\u0442\u0432\u043E","\u043A\u043E\u0442\u043E\u0440\u043E\u0435","\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043B\u043E","\u0441\u043D\u043E\u0432\u0430","\u0441\u043D\u043E\u0432\u0430","\u0441\u0432\u043E\u0438\u0445","\u043F\u0440\u043E\u0435\u043A\u0442\u0430\u0445","\u0435\u0441\u043B\u0438","\u043F\u0435\u0440\u0435\u043F\u0438\u0441\u0430\u043B\u0438","\u0442\u043E","\u0436\u0438\u0432\u0435\u0442","\u0442\u0430\u043C","\u0434\u043E","\u0441\u0438\u0445","\u043F\u043E\u0440"]},sp:{common:["mujer","uno","dolor","m\xE1s","de","poder","mismo","si"],words:["ejercicio","preferencia","perspicacia","laboral","pa\xF1o","suntuoso","molde","namibia","planeador","mirar","dem\xE1s","oficinista","excepci\xF3n","odio","consecuencia","casi","auto","chicharra","velo","elixir","ataque","no","odio","temporal","cu\xF3rum","dign\xEDsimo","facilismo","letra","nihilista","expedici\xF3n","alma","alveolar","aparte","le\xF3n","animal","como","paria","belleza","modo","natividad","justo","ataque","s\xE9quito","pillo","sed","ex","y","voluminoso","temporalidad","verdades","racional","asunci\xF3n","incidente","marejada","placenta","amanecer","fuga","previsor","presentaci\xF3n","lejos","necesariamente","sospechoso","adiposidad","quind\xEDo","p\xF3cima","voluble","d\xE9bito","sinti\xF3","accesorio","falda","sapiencia","volutas","queso","permacultura","laudo","soluciones","entero","pan","litro","tonelada","culpa","libertario","mosca","dictado","reincidente","nascimiento","dolor","escolar","impedimento","m\xEDnima","mayores","repugnante","dulce","obcecado","monta\xF1a","enigma","total","delet\xE9reo","d\xE9cima","c\xE1bala","fotograf\xEDa","dolores","molesto","olvido","paciencia","resiliencia","voluntad","molestias","magn\xEDfico","distinci\xF3n","ovni","marejada","cerro","torre","y","abogada","manantial","corporal","agua","crep\xFAsculo","ataque","desierto","laboriosamente","angustia","afortunado","alma","encefalograma","materialidad","cosas","o","renuncia","error","menos","conejo","abad\xEDa","analfabeto","remo","fugacidad","oficio","en","alm\xE1cigo","vos","pan","represi\xF3n","n\xFAmeros","triste","refugiado","trote","inventor","corchea","repelente","magma","recusado","patr\xF3n","expl\xEDcito","paloma","s\xEDndrome","inmune","autoinmune","comodidad","ley","vietnamita","demonio","tasmania","repeler","ap\xE9ndice","arquitecto","columna","yugo","computador","mula","a","prop\xF3sito","fantas\xEDa","alias","rayo","tenedor","deleznable","ventana","cara","anemia","corrupto"]}},la={wordCount:30,skipCommon:!1,lang:"latin"},ca=function(o,t){t=Object.assign({},la,t);var e=oa[t.lang]||oa.latin,n=!t.skipCommon&&!Ze(o);return o.repeat||Ie(o.parent)?(o.value=He(e,t.wordCount,n),o.name=P(o.parent.name)):(o.parent.value=He(e,t.wordCount,n),o.remove()),o},fa=/^lorem([a-z]*)(\d*)$/,pa=function(o,t){var a=[na[o]||na.html];Array.isArray(t)?t.forEach(function(e){a.push("string"==typeof e?na[e]:e)}):"object"==typeof t&&a.push(t);var n=new Qr(a.filter(Boolean));return"css"!==o&&n.get(0).set(fa,$t),n},ha={lang:"en",locale:"en-US",charset:"UTF-8"},da=new Set(["css","sass","scss","less","stylus","sss"]),ma={syntax:"html",field:function(n,t){return t||""},text:null,profile:null,variables:{},snippets:{},addons:null,format:null},ga=new Set(["html","xml","xsl","jsx","js","pug","slim","haml","css","sass","scss","less","sss","stylus"]),ba=function(o,t){var e=o.getTokenTypeAt(t||o.getCursor());return e&&/^property\b/.test(e)},zi={html:function(n,t){return null===n.getTokenTypeAt(t||n.getCursor())},css:ba,less:ba,sass:ba,scss:ba},ya="[[::emmet-cursor::]]",xa=function(n,t){return void 0===t&&(t=""),t},Ki="emmet-abbreviation",Gi=45,Aa=function(e){return jn(e.map(function(e){return new Oa(e.key,e.value)}))},Oa=function(o,t){this.key=o,this.value=t,this.property=null;var e=t&&t.match(/^([a-z\-]+)(?:\s*:\s*([^\n\r]+))?$/);e&&(this.property=e[1],this.value=e[2]),this.dependencies=[]},ja={defaulValue:{}};Oa.prototype.addDependency=function(e){this.dependencies.push(e)},ja.defaulValue.get=function(){return null==this.value?null:Rn(this.value)[0]},Oa.prototype.keywords=function(){var d=[],n=new Set,r=0,i,t;for(this.property&&d.push(this);r=this.end},Ea.prototype.limit=function(n,t){return new this.constructor(this.string,n,t)},Ea.prototype.peek=function(){return this.string.charCodeAt(this.pos)},Ea.prototype.next=function(){if(this.pos"),Xi=function(o){var t=o.pos;if(or(o,Ja,Ka,!0)){var e=Fa(o,t);return e.type="comment",e}return null},Qi=rr(""),Ji=function(o){var t=o.pos;if(or(o,Qi,Yi,!0)){var e=Fa(o,t);return e.type="cdata",e}return null},$i={xml:!1,special:["script","style"],empty:["img","meta","link","br","base","hr","area","wbr"]},Zi=function(o,t,e){this.dom=o,this.type=t,this.syntax=e};Zi.prototype.nodeForPoint=function(o,t){for(var e=this.dom.firstChild,n=null;e;)mn(cr(e),o,t)?(n=e,e=e.firstChild):e=e.nextSibling;return n};var es=function(o,r,e){null==e&&"string"==typeof o&&(e=o.length),this.string=o,this.pos=this.start=r||0,this.end=e};es.prototype.eof=function(){return this.pos>=this.end},es.prototype.limit=function(n,t){return new this.constructor(this.string,n,t)},es.prototype.peek=function(){return this.string.charCodeAt(this.pos)},es.prototype.next=function(){if(this.pos=gn(this.pos,this._sof)},t.prototype.eof=function(){return 0<=gn(this.pos,this._eof)},t.prototype.limit=function(n,o){return new this.constructor(this.editor,n,{from:n,to:o})},t.prototype.peek=function(){var o=this.pos,t=(o.line,o.ch),e=this.editor.getLine(this.pos.line);return t=this._lineLength(this.pos.line)&&(this.pos.line++,this.pos.ch=0),this.eof()&&(this.pos=Object.assign({},this._eof)),e}return NaN},t.prototype.backUp=function(a){var t=this,e=this.editor.constructor,n=this.pos,r=n.line,i=n.ch;for(i-=a||1;0<=r&&0>i;)r--,i+=t._lineLength(r);return this.pos=0>r||0>i?e.Pos(0,0):e.Pos(r,i),this.peek()},t.prototype.current=function(){return this.substring(this.start,this.pos)},t.prototype.substring=function(n,t){return this.editor.getRange(n,t)},t.prototype.error=function(n){var t=new Error(n+" at line "+this.pos.line+", column "+this.pos.ch);return t.originalMessage=n,t.pos=this.pos,t.string=this.string,t},t.prototype._lineLength=function(n){var t=n===this.editor.lastLine();return this.editor.getLine(n).length+(t?0:1)},t}(es),ns="emmet-open-tag",os="emmet-close-tag",rs={emmetExpandAbbreviation:function(a){if(a.somethingSelected())return a.constructor.Pass;var t=a.getCursor(),e=An(a,t),n=!1;if(e)n=xn(a,e.model.ast,e.find());else{var r=bn(a,t);if(r){var i={from:{line:t.line,ch:r.location},to:{line:t.line,ch:r.location+r.abbreviation.length}};n=xn(a,r.abbreviation,i)}}return Sn(a),n||a.constructor.Pass},emmetInsertLineBreak:function(d){var t=d.getCursor();if("xml"===d.getModeAt(t).name){var e=(Object.assign({},t,{ch:t.ch+1}),d.getTokenAt(t)),n=d.getTokenAt(Object.assign({},t,{ch:t.ch+1}));if("tag bracket"===e.type&&">"===e.string&&"tag bracket"===n.type&&"t.alpha||0.5>=t.size))&&(1===A?n(t):2===A&&o(t))}function a(e,t){return t||(t=e,e=0),e+~~(Math.random()*(t-e+1))}function i(e,t){var n=!1;return function(){n||(e.apply(this,arguments),n=!0,setTimeout(function(){n=!1},t))}}function s(){h&&(O.clearRect(0,0,k,T),P=new Date().getTime(),!y&&(y=P),_=(P-y)/1e3,y=P,0=this.size-(this.bMin+p.snapOffset+this.bGutterSize)&&(e=this.size-(this.bMin+this.bGutterSize)),k.call(this,e),p.onDrag&&p.onDrag())},E=function(){var e=t.getComputedStyle(this.parent),n=this.parent[m]-parseFloat(e[b])-parseFloat(e[v]);this.size=this.a[s]()[u]+this.b[s]()[u]+this.aGutterSize+this.bGutterSize,this.percentage=Math.min(100*(this.size/n),100),this.start=this.a[s]()[f]},k=function(e){this.a.style[u]=a+"("+e/this.size*this.percentage+"% - "+this.aGutterSize+"px)",this.b.style[u]=a+"("+(this.percentage-e/this.size*this.percentage)+"% - "+this.bGutterSize+"px)"},T=function(){var e=this,t=e.a,n=e.b;t[s]()[u]n?n+1:16*n?e+6*((t-e)*n):1>2*n?t:2>3*n?e+6*((t-e)*(.66666-n)):e},c=function(t,n,o){var r,a;return a=.5>=o?o*(n+1):o+n-o*n,r=2*o-a,{r:f(r,a,t+.33333),g:f(r,a,t),b:f(r,a,t-.33333)}},x=function(t,n,o){var r,a,s,d,l,p,c;return d=S(t,n,o),l=C(t,n,o),r=d-l,c=d+l,a=l===d?0:t===d?(60*(n-o)/r+360)%360:n===d?60*(o-t)/r+120:60*(t-n)/r+240,s=c/2,p=0===s?0:1===s?1:.5>=s?r/c:r/(2-c),{h:a,s:p,l:s}},y=function(n,o,r,a){return null==a?"hsl("+m(t(180*n/s),360)+","+t(100*o)+"%,"+t(100*r)+"%)":"hsla("+m(t(180*n/s),360)+","+t(100*o)+"%,"+t(100*r)+"%,"+a+")"},u=function(t){var n,o,r,a,e,i;return i=document.createElement("span"),document.body.appendChild(i),i.style.backgroundColor=t,e=getComputedStyle(i).backgroundColor,document.body.removeChild(i),r=/^rgb\((\d+), (\d+), (\d+)\)$/.exec(e),r||(r=/^rgba\((\d+), (\d+), (\d+), ([\d.]+)\)$/.exec(e)),a=parseInt(r[1]),o=parseInt(r[2]),n=parseInt(r[3]),r[4]?{r:a/255,g:o/255,b:n/255,a:parseFloat(r[4])}:{r:a/255,g:o/255,b:n/255}},e=function(e){var t,n;return n=document.createElement("span"),document.body.appendChild(n),n.style.backgroundColor=e,t=0e&&(e+=t),e},v=function(e,t,n){return t+(n-t)*C(1,S(0,e))},p=function(){function e(f,E,b){var T,d,e,g,h,i,I,k,l,m,N,A,p,L,r,R,t,u,v,w,x;for(this.radius=f,this.width=E,this.lightness=b,L=this.radius,v=this.width,d=this.canvas=document.createElement("canvas"),d.width=d.height=2*L,e=d.getContext("2d"),N=e.createImageData(d.width,d.height),h=N.data,(x=m=0,r=d.height);0<=r?mr;x=0<=r?++m:--m)for(w=A=0,R=d.width;0<=R?AR;w=0<=R?++A:--A)I=x-L,i=w-L,g=o(I*I+i*i),g>L+1.5||(g-=10,u=S(0,C(1,g/(L-v/2-10))),l=n(I,i)/(2*s),t=c(l,u,this.lightness),p=t.r,k=t.g,T=t.b,h[4*(x*d.width+w)+0]=255*p,h[4*(x*d.width+w)+1]=255*k,h[4*(x*d.width+w)+2]=255*T,h[4*(x*d.width+w)+3]=255);e.putImageData(N,0,0)}return e.prototype.drawHSLCircle=function(t,n){var o,r,a,e;return t.width=t.height=2*this.radius,o=t.getContext("2d"),e=this.width,a=this.radius,r=v(n,e,a),o.save(),o.fillStyle="rgba(0,0,0,0.3)",o.beginPath(),o.arc(a,a,a,0,2*s),o.fill(),o.fillStyle="black",o.beginPath(),o.arc(a,a,r,0,2*s),o.arc(a,a,r-e,0,2*s,!0),o.fill(),o.globalCompositeOperation="source-in",o.drawImage(this.canvas,0,0),o.restore()},e}(),i=function(e){return"string"==typeof e&&(e=u(e)),null!=e.r&&null!=e.g&&null!=e.b?(e=x(e.r,e.g,e.b),e.h=e.h*s/180):null!=e.h&&null!=e.s&&null!=e.l&&(e.h=e.h*s/180),e},a=function(){function e(e){this.color=i(e),this.refColor=this.color,this.el=E(),this.circleContainer=this.el.appendChild(l.call(this)),this.lSlider=this.el.appendChild(b.call(this)),this.colorPreview=this.el.appendChild(f.call(this)),d.call(this),this.setLightness(this.color.l)}var d,l,f,h,b,E,T,w;return T=80,w=25,e.prototype.setHue=function(e){var n,o,r;return this.color.h=e,r=v(this.color.s,w,T)-w/2,o=T-w/2,g(this.hueKnob,{left:t(o+Math.cos(e)*r+6-1)+"px",top:t(o+Math.sin(e)*r+6-1)+"px"}),this.colorPreview.style.backgroundColor=this.lKnob.style.backgroundColor=this.hueKnob.style.backgroundColor=y(this.color.h,this.color.s,this.color.l),n=y(this.color.h,this.color.s,.5),this.lSlider.style.backgroundImage="-webkit-linear-gradient(bottom, black, "+n+" 50%, white)",this.lSlider.style.backgroundImage="-moz-linear-gradient(bottom, black, "+n+" 50%, white)",this.emit("changed")},e.prototype.setSaturation=function(e){return this.color.s=e,this.circle.drawHSLCircle(this.circleCanvas,e),this.setHue(this.color.h)},e.prototype.setLightness=function(e){return this.color.l=e,this.circle=new p(T,w,e),this.lKnob.style.top=(1-e)*this.lSlider._height-11+"px",this.setSaturation(this.color.s)},e.prototype.setHSL=function(e,t,n){return this.color.h=m(e,360)*s/180,this.color.s=S(0,C(1,t)),n=S(0,C(1,n)),this.setLightness(n)},e.prototype.getHSL=function(){return{h:m(180*this.color.h/s,360),s:this.color.s,l:this.color.l}},e.prototype.setRGB=function(t,n,o){var r,a,e,i;return e=x(t,n,o),r=e.h,i=e.s,a=e.l,this.setHSL(r,i,a)},e.prototype.getRGB=function(){return c(this.color.h/(2*s),this.color.s,this.color.l)},e.prototype.getCSS=function(){return y(this.color.h,this.color.s,this.color.l)},e.prototype.setCSS=function(t){var n,o,r,e;return e=u(t),r=e.r,o=e.g,n=e.b,this.setRGB(r,o,n)},e.prototype.on=function(e,t){var n;return null==this._listeners&&(this._listeners={}),(null==(n=this._listeners)[e]?n[e]=[]:n[e]).push(t)},e.prototype.emit=function(){var t,n,o,a,i,e,s,d;if(n=arguments[0],t=2<=arguments.length?r.call(arguments,1):[],this._listeners){for(s=null==(e=this._listeners[n])?[]:e,d=[],(o=0,i=s.length);o=7*s/8||p<=-7*s/8?t.style.cursor="ew-resize":s/8<=p&&p<3*s/8||-7*s/8HSL":"HEX24>RGB>HSL","HEX32>HSLA":"HEX32>RGBA>HSLA","HEX24>CMYK":"HEX24>RGB>CMY>CMYK","RGB>CMYK":"RGB>CMY>CMYK"},i=Color.Space=function(t,n){s[n]&&(n=s[n]);var o=n.split(">");if("object"==typeof t&&0<=t[0]){for(var r=o[0],d={},l=0,p;l>0)+","+(e.G>>0)+","+(e.B>>0)+")"},i.RGBA_W3=function(e){var t="number"==typeof e.A?e.A/255:1;return"rgba("+(e.R>>0)+","+(e.G>>0)+","+(e.B>>0)+","+t+")"},i.W3_RGB=function(e){return e=e.substr(4,e.length-5).split(","),{R:parseInt(e[0],10),G:parseInt(e[1],10),B:parseInt(e[2],10)}},i.W3_RGBA=function(e){return e=e.substr(5,e.length-6).split(","),{R:parseInt(e[0],10),G:parseInt(e[1],10),B:parseInt(e[2],10),A:255*parseFloat(e[3])}},i.HSL_W3=function(e){return"hsl("+(e.H+.5>>0)+","+(e.S+.5>>0)+"%,"+(e.L+.5>>0)+"%)"},i.HSLA_W3=function(e){var t="number"==typeof e.A?e.A/255:1;return"hsla("+(e.H+.5>>0)+","+(e.S+.5>>0)+"%,"+(e.L+.5>>0)+"%,"+t+")"},i.W3_HSL=function(e){var t=e.indexOf("(")+1,n=e.indexOf(")");return e=e.substr(t,n-t).split(","),{H:parseInt(e[0],10),S:parseInt(e[1],10),L:parseInt(e[2],10)}},i.W3_HSLA=function(e){var t=e.indexOf("(")+1,n=e.indexOf(")");return e=e.substr(t,n-t).split(","),{H:parseInt(e[0],10),S:parseInt(e[1],10),L:parseInt(e[2],10),A:255*parseFloat(e[3],10)}},i.W3_HEX=i.W3_HEX24=function(e){return"#"===e.substr(0,1)&&(e=e.substr(1)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),parseInt("0x"+e,16)},i.W3_HEX32=function(e){return"#"===e.substr(0,1)&&(e=e.substr(1)),6===e.length?parseInt("0xFF"+e,10):parseInt("0x"+e,16)},i.HEX_W3=i.HEX24_W3=function(e,t){t||(t=6),e||(e=0);var n=e.toString(16),o;for(o=n.length;ot;)n=n.substr(1),o--;return"#"+n},i.HEX32_W3=function(e){return i.HEX_W3(e,8)},i.HEX_RGB=i.HEX24_RGB=function(e){return{R:e>>16,G:255&e>>8,B:255&e}},i.HEX32_RGBA=function(e){return{R:255&e>>>16,G:255&e>>>8,B:255&e,A:e>>>24}},i.RGBA_HEX32=function(e){return(e.A<<24|e.R<<16|e.G<<8|e.B)>>>0},i.RGB_HEX24=i.RGB_HEX=function(e){return 0>e.R&&(e.R=0),0>e.G&&(e.G=0),0>e.B&&(e.B=0),255c?p/(e+d):p/(2-e-d);var i=((e-o)/6+p/2)/p,g=((e-a)/6+p/2)/p,l=((e-s)/6+p/2)/p;o===e?u=l-g:a===e?u=1/3+i-l:s===e&&(u=2/3+g-i),0>u&&(u+=1),1c&&(c+=1),1r?r*(1+o):r+o-o*r,d=2*r-l,i=n+1/3,0>i&&(i+=1),16*i?d+6*(l-d)*i:1>2*i?l:2>3*i?d+6*((l-d)*(2/3-i)):d,i=n,0>i&&(i+=1),16*i?d+6*(l-d)*i:1>2*i?l:2>3*i?d+6*((l-d)*(2/3-i)):d,i=n-1/3,0>i&&(i+=1),16*i?d+6*(l-d)*i:1>2*i?l:2>3*i?d+6*((l-d)*(2/3-i)):d),{R:255*a,G:255*e,B:255*s,A:t.A}},i.HSVA_RGBA=i.HSV_RGB=function(t){var r=t.H/360,a=t.S/100,s=t.V/100,d,l,p,c,u,i;if(0==a)d=l=p=o(255*s);else switch(1<=r&&(r=0),r=6*r,c=r-n(r),u=o(255*s*(1-a)),p=o(255*s*(1-a*c)),i=o(255*s*(1-a*(1-c))),s=o(255*s),n(r)){case 0:d=s,l=i,p=u;break;case 1:d=p,l=s,p=u;break;case 2:d=u,l=s,p=i;break;case 3:d=u,l=p,p=s;break;case 4:d=i,l=u,p=s;break;case 5:d=s,l=u,p=p;}return{R:d,G:l,B:p,A:t.A}}}(),Inlet=function(){function e(b,C){function c(){var e=d.value+"",t=N.getCursor(!0),n=w(t,"number");if(n){var o={line:t.line,ch:n.start},r={line:t.line,ch:n.end};N.dragging=!0,N.replaceRange(e,o,r)}}function S(n){if(!N.somethingSelected()){I=n.target;var a=N.getCursor(!0),d=N.getTokenAt(a);cursorOffset=N.cursorCoords(!0,"page");var l=N.cursorCoords(!0,L).left,o=w(a,"number"),p=w(a,"hsl"),r=w(a,"hex"),s=w(a,"rgb"),t=w(a,"boolean"),c=cursorOffset.top-h;cursorOffset.topHSL>RGB>HEX24>W3"),P(picked,"hex")})}else if(p){var g=p.string;e=new thistle.Picker(g),e.setCSS(g),e.presentModal(m,c),e.on("changed",function(){picked=e.getCSS(),P(picked,"hsl")})}else if(s){var g=s.string;e=new thistle.Picker(g),e.setCSS(g),e.presentModal(m,c),e.on("changed",function(){picked=e.getCSS(),picked=Color.Space(picked,"W3>HSL>RGB>W3"),P(picked,"rgb")})}}}function T(e){var t,n;return t=0===e?[-100,100]:[3*-e,5*e],t[0]=d&&t.ch<=l)return e=null,{start:d,end:l,string:a};e=o.exec(r)}}}var N=b,d,e,A;C||(C={}),C.picker||(C.picker={}),C.slider||(C.slider={}),C.clicker||(C.clicker={});var g=C.container||document.body,h=C.picker.topOffset||220,i=C.picker.bottomOffset||16,f=C.picker.topBoundary||250,k=C.picker.leftOffset||75,l=C.slider.yOffset||15,m=C.slider.xOffset||0,n=C.slider.width,L=C.horizontalMode||"page",o=C.fixedContainer,p=C.slider.callback||function(){},r=C.picker.callback||function(){},s=C.clicker.callback||function(){},t=N.getWrapperElement();t.addEventListener("mouseup",S),document.body.addEventListener("mouseup",function(e){e.target===I||e.target===v||e.target===d||e.target===u||e.target===A||(v.style.visibility="hidden",u.style.visibility="hidden")}),N.setOption("onKeyEvent",function(){if(event=1==arguments.length?arguments[0]:arguments[1],event.keyCode==y||event.keyCode==O){if("visible"===v.style.visibility)return d.stepDown(1),c(),!0;event.altKey&&S()}else if(event.keyCode==E||event.keyCode==R){if("visible"===v.style.visibility)return d.stepUp(1),c(),!0;event.altKey&&S()}else v.style.visibility="hidden"});var u=document.createElement("div");u.className="inlet_clicker",u.style.visibility="hidden",u.style.position="absolute",g.appendChild(u);var A=document.createElement("input");A.className="checkbox",A.setAttribute("type","checkbox"),A.addEventListener("change",function(){var t=A.checked+"",n=N.getCursor(!0),o=w(n,"boolean");if(o){var e={line:n.line,ch:o.start},r={line:n.line,ch:o.end};N.replaceRange(t,e,r)}}),u.appendChild(A);var v=document.createElement("div");v.className="inlet_slider",v.style.visibility="hidden",n&&(v.style.width=n),v.style.position=o?"fixed":"absolute",v.style.top=0,g.appendChild(v);var d=document.createElement("input");d.className="range",d.setAttribute("type","range"),d.addEventListener("input",c),d.addEventListener("change",c);var x=-1=a.start&&(n.unshift(a.comment),this.leading.splice(r,1),this.trailing.splice(r,1));n.length&&(e.innerComments=n)}},e.prototype.findTrailingComments=function(e,t){var n=[];if(0=t.end.offset&&n.unshift(r.comment);return this.trailing.length=0,n}var a=this.stack[this.stack.length-1];if(a&&a.node.trailingComments){var i=a.node.trailingComments[0];i&&i.range[0]>=t.end.offset&&(n=a.node.trailingComments,delete a.node.trailingComments)}return n},e.prototype.findLeadingComments=function(e,t){for(var n=[],o,r;0=t.start.offset);)o=this.stack.pop().node;if(o){for(var a=o.leadingComments?o.leadingComments.length:0,s=a-1,i;0<=s;--s)i=o.leadingComments[s],i.range[1]<=t.start.offset&&(n.unshift(i),o.leadingComments.splice(s,1));return o.leadingComments&&0===o.leadingComments.length&&delete o.leadingComments,n}for(var s=this.leading.length-1,r;0<=s;--s)r=this.leading[s],r.start<=t.start.offset&&(n.unshift(r.comment),this.leading.splice(s,1));return n},e.prototype.visitNode=function(e,t){if(!(e.type===o.Syntax.Program&&0":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.sourceType=t&&"module"===t.sourceType?"module":"script",this.lookahead=null,this.hasLineTerminator=!1,this.context={allowIn:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:"module"===this.sourceType},this.tokens=[],this.startMarker={index:0,lineNumber:this.scanner.lineNumber,lineStart:0},this.lastMarker={index:0,lineNumber:this.scanner.lineNumber,lineStart:0},this.nextToken(),this.lastMarker={index:this.scanner.index,lineNumber:this.scanner.lineNumber,lineStart: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&&(this.lookahead.type!==i.Token.EOF&&!this.match("}")&&this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.lineNumber=this.startMarker.lineNumber,this.lastMarker.lineStart=this.startMarker.lineStart)},e.prototype.parsePrimaryExpression=function(){var e=this.createNode(),t,n,o,a;switch(this.lookahead.type){case i.Token.Identifier:"module"===this.sourceType&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),t=this.finalize(e,new l.Identifier(this.nextToken().value));break;case i.Token.NumericLiteral:case i.Token.StringLiteral:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,r.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,o=this.nextToken(),a=this.getTokenRaw(o),t=this.finalize(e,new l.Literal(o.value,a));break;case i.Token.BooleanLiteral:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,o=this.nextToken(),o.value="true"===o.value,a=this.getTokenRaw(o),t=this.finalize(e,new l.Literal(o.value,a));break;case i.Token.NullLiteral:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,o=this.nextToken(),o.value=null,a=this.getTokenRaw(o),t=this.finalize(e,new l.Literal(o.value,a));break;case i.Token.Template:t=this.parseTemplateLiteral();break;case i.Token.Punctuator:n=this.lookahead.value,"("===n?(this.context.isBindingElement=!1,t=this.inheritCoverGrammar(this.parseGroupExpression)):"["===n?t=this.inheritCoverGrammar(this.parseArrayInitializer):"{"===n?t=this.inheritCoverGrammar(this.parseObjectInitializer):"/"===n||"/="===n?(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,o=this.nextRegexToken(),a=this.getTokenRaw(o),t=this.finalize(e,new l.RegexLiteral(o.value,a,o.regex))):this.throwUnexpectedToken(this.nextToken());break;case i.Token.Keyword:!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():this.throwUnexpectedToken(this.nextToken()));break;default: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.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,n},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.parseObjectPropertyKey=function(){var e=this.createNode(),t=this.nextToken(),n=null;switch(t.type){case i.Token.StringLiteral:case i.Token.NumericLiteral:this.context.strict&&t.octal&&this.tolerateUnexpectedToken(t,r.Messages.StrictOctalLiteral);var o=this.getTokenRaw(t);n=this.finalize(e,new l.Literal(t.value,o));break;case i.Token.Identifier:case i.Token.BooleanLiteral:case i.Token.NullLiteral:case i.Token.Keyword:n=this.finalize(e,new l.Identifier(t.value));break;case i.Token.Punctuator:"["===t.value?(n=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):this.throwUnexpectedToken(t);break;default: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=!1,a=!1,s=!1,d,p,c;n.type===i.Token.Identifier?(this.nextToken(),p=this.finalize(t,new l.Identifier(n.value))):this.match("*")?this.nextToken():(o=this.match("["),p=this.parseObjectPropertyKey());var u=this.qualifiedPropertyName(this.lookahead);if(n.type===i.Token.Identifier&&"get"===n.value&&u)d="get",o=this.match("["),p=this.parseObjectPropertyKey(),this.context.allowYield=!1,c=this.parseGetterMethod();else if(n.type===i.Token.Identifier&&"set"===n.value&&u)d="set",o=this.match("["),p=this.parseObjectPropertyKey(),c=this.parseSetterMethod();else if(n.type===i.Token.Punctuator&&"*"===n.value&&u)d="init",o=this.match("["),p=this.parseObjectPropertyKey(),c=this.parseGeneratorMethod(),a=!0;else if(p||this.throwUnexpectedToken(this.lookahead),d="init",this.match(":"))!o&&this.isPropertyKey(p,"__proto__")&&(e.value&&this.tolerateError(r.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),c=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))c=this.parsePropertyMethodFunction(),a=!0;else if(n.type===i.Token.Identifier){var h=this.finalize(t,new l.Identifier(n.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),s=!0;var m=this.isolateCoverGrammar(this.parseAssignmentExpression);c=this.finalize(t,new l.AssignmentPattern(h,m))}else s=!0,c=h}else this.throwUnexpectedToken(this.nextToken());return this.finalize(t,new l.Property(d,p,o,c,a,s))},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={raw:t.value.raw,cooked:t.value.cooked};return this.finalize(e,new l.TemplateElement(n,t.tail))},e.prototype.parseTemplateElement=function(){this.lookahead.type!==i.Token.Template&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),n={raw:t.value.raw,cooked:t.value.cooked};return this.finalize(e,new l.TemplateElement(n,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:[]};else{var t=this.lookahead,n=[];if(this.match("..."))e=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:p,params:[e]};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);this.startMarker.index")||this.expect("=>"),this.context.isBindingElement=!1;for(var a=0;a")&&(e.type===d.Syntax.Identifier&&"yield"===e.name&&(o=!0,e={type:p,params:[e]}),!o)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===d.Syntax.SequenceExpression)for(var a=0;a=o);){for(;2")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var o=this.reinterpretAsCoverFormalsList(e);if(o){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var a=this.context.strict,i=this.context.allowYield;this.context.allowYield=!0;var s=this.startNode(t);this.expect("=>");var c=this.match("{")?this.parseFunctionSourceElements():this.isolateCoverGrammar(this.parseAssignmentExpression),u=c.type!==d.Syntax.BlockStatement;this.context.strict&&o.firstRestricted&&this.throwUnexpectedToken(o.firstRestricted,o.message),this.context.strict&&o.stricted&&this.tolerateUnexpectedToken(o.stricted,o.message),e=this.finalize(s,new l.ArrowFunctionExpression(o.params,c,u)),this.context.strict=a,this.context.allowYield=i}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(r.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===d.Syntax.Identifier){var h=e;this.scanner.isRestrictedWord(h.name)&&this.tolerateUnexpectedToken(n,r.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(h.name)&&this.tolerateUnexpectedToken(n,r.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),n=this.nextToken();var m=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new l.AssignmentExpression(n.value,e,m)),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];this.startMarker.index",t.TokenName[n.Identifier]="Identifier",t.TokenName[n.Keyword]="Keyword",t.TokenName[n.NullLiteral]="Null",t.TokenName[n.NumericLiteral]="Numeric",t.TokenName[n.Punctuator]="Punctuator",t.TokenName[n.StringLiteral]="String",t.TokenName[n.RegularExpression]="RegularExpression",t.TokenName[n.Template]="Template"},function(t,n,o){"use strict";function r(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function a(e){return"01234567".indexOf(e)}var i=o(4),s=o(5),d=o(9),l=o(7),p=function(){function t(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.length=e.length,this.index=0,this.lineNumber=0=this.length},t.prototype.throwUnexpectedToken=function(e){void 0===e&&(e=s.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},t.prototype.tolerateUnexpectedToken=function(){this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,s.Messages.UnexpectedTokenIllegal)},t.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,d.Character.isLineTerminator(r)){if(this.trackComment){o.end={line:this.lineNumber,column:this.index-this.lineStart-1};var a={multiLine:!1,slice:[n+e,this.index-1],range:[n,this.index-1],loc:o};t.push(a)}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 a={multiLine:!1,slice:[n+e,this.index],range:[n,this.index],loc:o};t.push(a)}return t},t.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(d.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},t.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index,n;!this.eof();)if(n=this.source.charCodeAt(this.index),d.Character.isWhiteSpace(n))++this.index;else if(d.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},t.prototype.isFutureReservedWord=function(e){return"enum"===e||"export"===e||"import"===e||"super"===e},t.prototype.isStrictModeReservedWord=function(e){return"implements"===e||"interface"===e||"package"===e||"private"===e||"protected"===e||"public"===e||"static"===e||"yield"===e||"let"===e},t.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},t.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;}},t.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},t.prototype.scanHexEscape=function(t){for(var n="u"===t?4:2,o=0,a=0;at)return this.index=e,this.getComplexIdentifier();if(d.Character.isIdentifierPart(t))++this.index;else break}return this.source.slice(e,this.index)},t.prototype.getComplexIdentifier=function(){var e=this.codePointAt(this.index),t=d.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"),e=n.charCodeAt(0),(!n||"\\"===n||!d.Character.isIdentifierStart(e))&&this.throwUnexpectedToken()),t=n);!this.eof()&&(e=this.codePointAt(this.index),!!d.Character.isIdentifierPart(e));)n=d.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"),e=n.charCodeAt(0),(!n||"\\"===n||!d.Character.isIdentifierPart(e))&&this.throwUnexpectedToken()),t+=n);return t},t.prototype.octalToDecimal=function(e){var t="0"!==e,n=a(e);return!this.eof()&&d.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+a(this.source[this.index++]),0<="0123".indexOf(e)&&!this.eof()&&d.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+a(this.source[this.index++]))),{code:n,octal:t}},t.prototype.scanIdentifier=function(){var e=this.index,t=92===this.source.charCodeAt(e)?this.getComplexIdentifier():this.getIdentifier(),n;return n=1===t.length?l.Token.Identifier:this.isKeyword(t)?l.Token.Keyword:"null"===t?l.Token.NullLiteral:"true"===t||"false"===t?l.Token.BooleanLiteral:l.Token.Identifier,{type:n,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanPunctuator=function(){var e={type:l.Token.Punctuator,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end: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.start&&this.throwUnexpectedToken(),e.end=this.index,e.value=t,e},t.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&!!d.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),d.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:l.Token.NumericLiteral,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.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),(d.Character.isIdentifierStart(n)||d.Character.isDecimalDigit(n))&&this.throwUnexpectedToken()),{type:l.Token.NumericLiteral,value:parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanOctalLiteral=function(e,t){var n="",o=!1;for(d.Character.isOctalDigit(e.charCodeAt(0))?(o=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&!!d.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return o||0!==n.length||this.throwUnexpectedToken(),(d.Character.isIdentifierStart(this.source.charCodeAt(this.index))||d.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:l.Token.NumericLiteral,value:parseInt(n,8),octal:o,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1,t;e=i?e(i):o}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o));try{RegExp(r)}catch(t){this.throwUnexpectedToken(s.Messages.InvalidRegExp)}try{return new RegExp(t,n)}catch(e){return null}},t.prototype.scanRegExpBody=function(){var e=this.source[this.index];i.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++],d.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),t+=e;else if(d.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);else if(n)"]"===e&&(n=!1);else if("/"===e){o=!0;break}else"["===e&&(n=!0);o||this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);var r=t.substr(1,t.length-2);return{value:r,literal:t}},t.prototype.scanRegExpFlags=function(){for(var e="",t="",n;!this.eof()&&(n=this.source[this.index],!!d.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;if(n=this.scanHexEscape("u"),n)for(t+=n,e+="\\u";oe&&d.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},t)}();n.Scanner=p},function(t,n){"use strict";var o={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};n.Character={fromCodePoint:function(t){return 65536>t?e(t):e(55296+(t-65536>>10))+e(56320+(1023&t-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(n.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(n.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";var o=n(2),r=function(){return function(e){this.type=o.Syntax.ArrayExpression,this.elements=e}}();t.ArrayExpression=r;var a=function(){return function(e){this.type=o.Syntax.ArrayPattern,this.elements=e}}();t.ArrayPattern=a;var i=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}}();t.ArrowFunctionExpression=i;var s=function(){return function(e,t,n){this.type=o.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=n}}();t.AssignmentExpression=s;var d=function(){return function(e,t){this.type=o.Syntax.AssignmentPattern,this.left=e,this.right=t}}();t.AssignmentPattern=d;var l=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=l;var p=function(){return function(e){this.type=o.Syntax.BlockStatement,this.body=e}}();t.BlockStatement=p;var c=function(){return function(e){this.type=o.Syntax.BreakStatement,this.label=e}}();t.BreakStatement=c;var u=function(){return function(e,t){this.type=o.Syntax.CallExpression,this.callee=e,this.arguments=t}}();t.CallExpression=u;var h=function(){return function(e,t){this.type=o.Syntax.CatchClause,this.param=e,this.body=t}}();t.CatchClause=h;var m=function(){return function(e){this.type=o.Syntax.ClassBody,this.body=e}}();t.ClassBody=m;var g=function(){return function(e,t,n){this.type=o.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=n}}();t.ClassDeclaration=g;var f=function(){return function(e,t,n){this.type=o.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=n}}();t.ClassExpression=f;var y=function(){return function(e,t){this.type=o.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t}}();t.ComputedMemberExpression=y;var b=function(){return function(e,t,n){this.type=o.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n}}();t.ConditionalExpression=b;var v=function(){return function(e){this.type=o.Syntax.ContinueStatement,this.label=e}}();t.ContinueStatement=v;var x=function(){return function(){this.type=o.Syntax.DebuggerStatement}}();t.DebuggerStatement=x;var C=function(){return function(e,t){this.type=o.Syntax.ExpressionStatement,this.expression=e,this.directive=t}}();t.Directive=C;var S=function(){return function(e,t){this.type=o.Syntax.DoWhileStatement,this.body=e,this.test=t}}();t.DoWhileStatement=S;var E=function(){return function(){this.type=o.Syntax.EmptyStatement}}();t.EmptyStatement=E;var k=function(){return function(e){this.type=o.Syntax.ExportAllDeclaration,this.source=e}}();t.ExportAllDeclaration=k;var T=function(){return function(e){this.type=o.Syntax.ExportDefaultDeclaration,this.declaration=e}}();t.ExportDefaultDeclaration=T;var w=function(){return function(e,t,n){this.type=o.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n}}();t.ExportNamedDeclaration=w;var I=function(){return function(e,t){this.type=o.Syntax.ExportSpecifier,this.exported=t,this.local=e}}();t.ExportSpecifier=I;var N=function(){return function(e){this.type=o.Syntax.ExpressionStatement,this.expression=e}}();t.ExpressionStatement=N;var A=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=A;var L=function(){return function(e,t,n){this.type=o.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=n}}();t.ForOfStatement=L;var R=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=R;var O=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}}();t.FunctionDeclaration=O;var P=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}}();t.FunctionExpression=P;var _=function(){return function(e){this.type=o.Syntax.Identifier,this.name=e}}();t.Identifier=_;var D=function(){return function(e,t,n){this.type=o.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=n}}();t.IfStatement=D;var M=function(){return function(e,t){this.type=o.Syntax.ImportDeclaration,this.specifiers=e,this.source=t}}();t.ImportDeclaration=M;var F=function(){return function(e){this.type=o.Syntax.ImportDefaultSpecifier,this.local=e}}();t.ImportDefaultSpecifier=F;var B=function(){return function(e){this.type=o.Syntax.ImportNamespaceSpecifier,this.local=e}}();t.ImportNamespaceSpecifier=B;var U=function(){return function(e,t){this.type=o.Syntax.ImportSpecifier,this.local=e,this.imported=t}}();t.ImportSpecifier=U;var V=function(){return function(e,t){this.type=o.Syntax.LabeledStatement,this.label=e,this.body=t}}();t.LabeledStatement=V;var W=function(){return function(e,t){this.type=o.Syntax.Literal,this.value=e,this.raw=t}}();t.Literal=W;var H=function(){return function(e,t){this.type=o.Syntax.MetaProperty,this.meta=e,this.property=t}}();t.MetaProperty=H;var j=function(){return function(e,t,n,r,a){this.type=o.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=n,this.kind=r,this.static=a}}();t.MethodDefinition=j;var q=function(){return function(e,t){this.type=o.Syntax.NewExpression,this.callee=e,this.arguments=t}}();t.NewExpression=q;var z=function(){return function(e){this.type=o.Syntax.ObjectExpression,this.properties=e}}();t.ObjectExpression=z;var K=function(){return function(e){this.type=o.Syntax.ObjectPattern,this.properties=e}}();t.ObjectPattern=K;var G=function(){return function(e,t){this.type=o.Syntax.Program,this.body=e,this.sourceType=t}}();t.Program=G;var X=function(){return function(e,t,n,r,a,i){this.type=o.Syntax.Property,this.key=t,this.computed=n,this.value=r,this.kind=e,this.method=a,this.shorthand=i}}();t.Property=X;var Q=function(){return function(e,t,n){this.type=o.Syntax.Literal,this.value=e,this.raw=t,this.regex=n}}();t.RegexLiteral=Q;var Y=function(){return function(e){this.type=o.Syntax.RestElement,this.argument=e}}();t.RestElement=Y;var J=function(){return function(e){this.type=o.Syntax.ReturnStatement,this.argument=e}}();t.ReturnStatement=J;var $=function(){return function(e){this.type=o.Syntax.SequenceExpression,this.expressions=e}}();t.SequenceExpression=$;var Z=function(){return function(e){this.type=o.Syntax.SpreadElement,this.argument=e}}();t.SpreadElement=Z;var ee=function(){return function(e,t){this.type=o.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t}}();t.StaticMemberExpression=ee;var te=function(){return function(){this.type=o.Syntax.Super}}();t.Super=te;var ne=function(){return function(e,t){this.type=o.Syntax.SwitchCase,this.test=e,this.consequent=t}}();t.SwitchCase=ne;var oe=function(){return function(e,t){this.type=o.Syntax.SwitchStatement,this.discriminant=e,this.cases=t}}();t.SwitchStatement=oe;var re=function(){return function(e,t){this.type=o.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t}}();t.TaggedTemplateExpression=re;var ae=function(){return function(e,t){this.type=o.Syntax.TemplateElement,this.value=e,this.tail=t}}();t.TemplateElement=ae;var ie=function(){return function(e,t){this.type=o.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t}}();t.TemplateLiteral=ie;var se=function(){return function(){this.type=o.Syntax.ThisExpression}}();t.ThisExpression=se;var de=function(){return function(e){this.type=o.Syntax.ThrowStatement,this.argument=e}}();t.ThrowStatement=de;var le=function(){return function(e,t,n){this.type=o.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=n}}();t.TryStatement=le;var pe=function(){return function(e,t){this.type=o.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0}}();t.UnaryExpression=pe;var ce=function(){return function(e,t,n){this.type=o.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=n}}();t.UpdateExpression=ce;var ue=function(){return function(e,t){this.type=o.Syntax.VariableDeclaration,this.declarations=e,this.kind=t}}();t.VariableDeclaration=ue;var he=function(){return function(e,t){this.type=o.Syntax.VariableDeclarator,this.id=e,this.init=t}}();t.VariableDeclarator=he;var me=function(){return function(e,t){this.type=o.Syntax.WhileStatement,this.test=e,this.body=t}}();t.WhileStatement=me;var ge=function(){return function(e,t){this.type=o.Syntax.WithStatement,this.object=e,this.body=t}}();t.WithStatement=ge;var fe=function(){return function(e,t){this.type=o.Syntax.YieldExpression,this.argument=e,this.delegate=t}}();t.YieldExpression=fe},function(t,n,o){"use strict";function r(e){var t;switch(e.type){case p.JSXSyntax.JSXIdentifier:t=e.name;break;case p.JSXSyntax.JSXNamespacedName:var n=e;t=r(n.namespace)+":"+r(n.name);break;case p.JSXSyntax.JSXMemberExpression:var o=e;t=r(o.object)+"."+r(o.property);}return t}var a=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=o(9),s=o(7),d=o(3),l=o(12),p=o(13),c=o(10),u=o(14),h;(function(e){e[e.Identifier=100]="Identifier",e[e.Text=101]="Text"})(h||(h={})),s.TokenName[h.Identifier]="JSXIdentifier",s.TokenName[h.Text]="JSXText";var m=function(t){function n(e,n,o){t.call(this,e,n,o)}return a(n,t),n.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():t.prototype.parsePrimaryExpression.call(this)},n.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.lineNumber,this.scanner.lineStart=this.startMarker.lineStart},n.prototype.finishJSX=function(){this.nextToken()},n.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},n.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},n.prototype.scanXHTMLEntity=function(){for(var t="&",n="",o;!this.scanner.eof();){if(o=this.scanner.source[this.scanner.index++],";"===o){if("#"===n[0]){n=n.substr(1);var r="x"===n[0],a=r?parseInt("0"+n,16):parseInt(n,10);t=e(a)}else l.XHTMLEntities[n]?t=l.XHTMLEntities[n]:t+=o;break}n+=o,t+=o}return t},n.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e){var t=this.scanner.source[this.scanner.index++];return{type:s.Token.Punctuator,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(34===e||39===e){for(var n=this.scanner.index,o=this.scanner.source[this.scanner.index++],r="",a;!this.scanner.eof()&&(a=this.scanner.source[this.scanner.index++],a!==o);)r+="&"===a?this.scanXHTMLEntity():a;return{type:s.Token.StringLiteral,value:r,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(46===e){var d=this.scanner.source.charCodeAt(this.scanner.index+1),l=this.scanner.source.charCodeAt(this.scanner.index+2),t=46===d&&46===l?"...":".",n=this.scanner.index;return this.scanner.index+=t.length,{type:s.Token.Punctuator,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(i.Character.isIdentifierStart(e)&&92!==e){var n=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var a=this.scanner.source.charCodeAt(this.scanner.index);if(i.Character.isIdentifierPart(a)&&92!==a)++this.scanner.index;else if(45===a)++this.scanner.index;else break}var p=this.scanner.source.slice(n,this.scanner.index);return{type:h.Identifier,value:p,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}this.scanner.throwUnexpectedToken()},n.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.lineNumber=this.scanner.lineNumber,this.startMarker.lineStart=this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},n.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.lineNumber=this.scanner.lineNumber,this.startMarker.lineStart=this.scanner.lineStart;for(var e=this.scanner.index,t="",n;!this.scanner.eof()&&(n=this.scanner.source[this.scanner.index],"{"!==n&&"<"!==n);)++this.scanner.index,t+=n,i.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index);this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart;var o={type:h.Text,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return 0");)t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute(),e.push(t);return e},n.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 u.JSXOpeningElement(t,o,n))},n.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 u.JSXClosingElement(t))}var n=this.parseJSXElementName(),o=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new u.JSXOpeningElement(n,r,o))},n.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart,this.finalize(e,new u.JSXEmptyExpression)},n.prototype.parseJSXExpression=function(){var e;return this.matchJSX("}")?e=this.parseJSXEmptyExpression():(this.finishJSX(),e=this.parseAssignmentExpression(),this.startJSX()),e},n.prototype.parseJSXExpressionContainer=function(){var e=this.createJSXNode();this.expectJSX("{");var t=this.parseJSXExpression();return this.expectJSX("}"),this.finalize(e,new u.JSXExpressionContainer(t))},n.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),n=this.nextJSXText();if(n.start",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){"use strict";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";var o=n(13),r=function(){return function(e){this.type=o.JSXSyntax.JSXClosingElement,this.name=e}}();t.JSXClosingElement=r;var a=function(){return function(e,t,n){this.type=o.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=n}}();t.JSXElement=a;var i=function(){return function(){this.type=o.JSXSyntax.JSXEmptyExpression}}();t.JSXEmptyExpression=i;var s=function(){return function(e){this.type=o.JSXSyntax.JSXExpressionContainer,this.expression=e}}();t.JSXExpressionContainer=s;var d=function(){return function(e){this.type=o.JSXSyntax.JSXIdentifier,this.name=e}}();t.JSXIdentifier=d;var l=function(){return function(e,t){this.type=o.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t}}();t.JSXMemberExpression=l;var p=function(){return function(e,t){this.type=o.JSXSyntax.JSXAttribute,this.name=e,this.value=t}}();t.JSXAttribute=p;var c=function(){return function(e,t){this.type=o.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t}}();t.JSXNamespacedName=c;var u=function(){return function(e,t,n){this.type=o.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=n}}();t.JSXOpeningElement=u;var h=function(){return function(e){this.type=o.JSXSyntax.JSXSpreadAttribute,this.argument=e}}();t.JSXSpreadAttribute=h;var m=function(){return function(e,t){this.type=o.JSXSyntax.JSXText,this.value=e,this.raw=t}}();t.JSXText=m},function(e,t,n){"use strict";var o=n(8),r=n(6),a=n(7),i=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 r=this.values[this.curly-5];t=!r||!this.beforeFunctionExpression(r)}}return t},(e.prototype.push=function(e){e.type===a.Token.Punctuator||e.type===a.Token.Keyword?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e)}(),s=function(){function e(e,t){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=!!t&&"boolean"==typeof t.tolerant&&t.tolerant,this.scanner=new o.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 i}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;nn?e[t++]=n:2048>n?(e[t++]=192|n>>6,e[t++]=128|63&n):55296==(64512&n)&&r+1>18,e[t++]=128|63&n>>12,e[t++]=128|63&n>>6,e[t++]=128|63&n):(e[t++]=224|n>>12,e[t++]=128|63&n>>6,e[t++]=128|63&n);return e},n=function(l){for(var e=[],t=0,r=0,n;tn)e[r++]=d(n);else if(191n){var o=l[t++];e[r++]=d((31&n)<<6|63&o)}else if(239n){var o=l[t++],i=l[t++],a=l[t++],p=((7&n)<<18|(63&o)<<12|(63&i)<<6|63&a)-65536;e[r++]=d(55296+(p>>10)),e[r++]=d(56320+(1023&p))}else{var o=l[t++],i=l[t++];e[r++]=d((15&n)<<12|(63&o)<<6|63&i)}return e.join("")};a.base64={y:null,b:null,_:null,g: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(d,e){if(!Array.isArray(d))throw Error("encodeByteArray takes an array as a parameter");this.O();for(var t=e?this._:this.y,r=[],n=0;n>6,l=63&s;c||(l=64,i||(u=64)),r.push(t[o>>2],t[(3&o)<<4|a>>4],t[u],t[l])}return r.join("")},encodeString:function(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(i(n),e)},decodeString:function(o,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(o):n(this.decodeStringToByteArray(o,e))},decodeStringToByteArray:function(d,e){this.O();for(var t=e?this.g:this.b,r=[],n=0;n>4),64!=s){if(r.push(240&a<<4|s>>2),64!=c){r.push(192&s<<6|c)}}}return r},O:function(){if(!this.y){this.y={},this.b={},this._={},this.g={};for(var t=0;t=this.ENCODED_VALS_BASE.length&&(this.b[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.g[this.ENCODED_VALS.charAt(t)]=t)}}},a.base64Encode=function(t){var e=i(t);return a.base64.encodeByteArray(e,!0)},a.base64Decode=function(t){try{return a.base64.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null}},function(n,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.jsonEval=function(t){return JSON.parse(t)},e.stringify=function(t){return JSON.stringify(t)}},function(n,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.contains=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},a.safeGet=function(n,e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e]},a.forEach=function(n,e){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(t,n[t])},a.extend=function(n,e){return a.forEach(e,function(e,t){n[e]=t}),n},a.clone=function(t){return a.extend({},t)},a.isNonNullObject=function(t){return"object"==typeof t&&null!==t},a.isEmpty=function(n){for(var e in n)return!1;return!0},a.getCount=function(n){var e=0;for(var t in n)e++;return e},a.map=function(a,e,t){var r={};for(var n in a)r[n]=e.call(t,a[n],n,a);return r},a.findKey=function(o,e,t){for(var r in o)if(e.call(t,o[r],r,o))return r},a.findValue=function(t,e,r){var n=a.findKey(t,e,r);return n&&t[n]},a.getAnyKey=function(n){for(var e in n)return e},a.getValues=function(o){var e=[],t=0;for(var r in o)e[t++]=o[r];return e},a.every=function(n,e){for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&!e(t,n[t]))return!1;return!0}},,,,,,,,,,,,,,,,,,,,,,,,,,function(n,e,t){t(58),n.exports=t(6).default},function(a,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(59),n=(t.n(r),t(63)),o=(t.n(n),t(64));t.n(o)},function(e,t,o){(function(e){var t=function(){if(void 0!==e)return e;if(void 0!==a)return a;if("undefined"!=typeof self)return self;throw Error("unable to locate global object")}();"undefined"==typeof Promise&&(t.Promise=Promise=o(60))}).call(t,o(12))},function(d,e,t){(function(p){!function(e){function m(){}function n(n,e){return function(){n.apply(e,arguments)}}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this.T=[],g(t,this)}function i(i,s){for(;3===i._state;)i=i._value;return 0===i._state?void i.T.push(s):void(i._handled=!0,o.A(function(){var e=1===i._state?s.onFulfilled:s.onRejected;if(null===e)return void(1===i._state?a:c)(s.promise,i._value);var t;try{t=e(i._value)}catch(t){return void c(s.promise,t)}a(s.promise,t)}))}function a(a,e){try{if(e===a)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var i=e.then;if(e instanceof o)return a._state=3,a._value=e,void s(a);if("function"==typeof i)return void g(n(i,e),a)}a._state=1,a._value=e,s(a)}catch(e){c(a,e)}}function c(n,e){n._state=2,n._value=e,s(n)}function s(n){2===n._state&&0===n.T.length&&o.A(function(){n._handled||o.j(n._value)});for(var e=0,t=n.T.length;e>>0;if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var r=arguments[1],n=0,o;n>>0;if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var r=arguments[1],n=0,o;n":""+o}),n=this.serviceName+": "+n+" ("+t+").";var o=new s(t,n);for(var r in d)d.hasOwnProperty(r)&&"_"!==r.slice(-1)&&(o[r]=d[r]);return o},t}();e.ErrorFactory=a},function(a,s,e){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var d=e(29),n=e(30);s.decode=function(o){var e={},s={},l={},p="";try{var u=o.split(".");e=n.jsonEval(d.base64Decode(u[0])||""),s=n.jsonEval(d.base64Decode(u[1])||""),p=u[2],l=s.d||{},delete s.d}catch(t){}return{header:e,claims:s,data:l,signature:p}},s.isValidTimestamp=function(t){var e=s.decode(t).claims,a=Math.floor(new Date().getTime()/1e3),i,r;return"object"==typeof e&&(e.hasOwnProperty("nbf")?i=e.nbf:e.hasOwnProperty("iat")&&(i=e.iat),r=e.hasOwnProperty("exp")?e.exp:i+86400),a&&i&&r&&a>=i&&a<=r},s.issuedAtTime=function(t){var e=s.decode(t).claims;return"object"==typeof e&&e.hasOwnProperty("iat")?e.iat:null},s.isValidFormat=function(t){var e=s.decode(t),o=e.claims;return!!e.signature&&!!o&&"object"==typeof o&&o.hasOwnProperty("iat")},s.isAdmin=function(t){var e=s.decode(t).claims;return"object"==typeof e&&!0===e.admin}},function(o,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(31);e.querystring=function(n){var o=[];return r.forEach(n,function(t,e){Array.isArray(e)?e.forEach(function(e){o.push(encodeURIComponent(t)+"="+encodeURIComponent(e))}):o.push(encodeURIComponent(t)+"="+encodeURIComponent(e))}),o.length?"&"+o.join("&"):""},e.querystringDecode=function(n){var o={};return n.replace(/^\?/,"").split("&").forEach(function(t){if(t){var e=t.split("=");o[e[0]]=e[1]}}),o}},function(a,e,t){"use strict";var r=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t])};return function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=t(72),o=function(n){function e(){var e=n.call(this)||this;e.D=[],e.I=[],e.x=[],e.F=[],e.L=0,e.R=0,e.blockSize=64,e.F[0]=128;for(var o=1;or;r++)t[r]=d.charCodeAt(l)<<24|d.charCodeAt(l+1)<<16|d.charCodeAt(l+2)<<8|d.charCodeAt(l+3),l+=4;else for(var r=0;16>r;r++)t[r]=d[l]<<24|d[l+1]<<16|d[l+2]<<8|d[l+3],l+=4;for(var r=16,n;80>r;r++)n=t[r-3]^t[r-8]^t[r-14]^t[r-16],t[r]=4294967295&(n<<1|n>>>31);for(var o=this.D[0],p=this.D[1],s=this.D[2],c=this.D[3],u=this.D[4],r=0,h,i;80>r;r++){40>r?20>r?(h=c^p&(s^c),i=1518500249):(h=p^s^c,i=1859775393):60>r?(h=p&s|c&(p|s),i=2400959708):(h=p^s^c,i=3395469782);var n=4294967295&(o<<5|o>>>27)+h+u+i+t[r];u=c,c=s,s=4294967295&(p<<30|p>>>2),p=o,o=n}this.D[0]=4294967295&this.D[0]+o,this.D[1]=4294967295&this.D[1]+p,this.D[2]=4294967295&this.D[2]+s,this.D[3]=4294967295&this.D[3]+c,this.D[4]=4294967295&this.D[4]+u},e.prototype.update=function(a,s){if(null!=a){void 0===s&&(s=a.length);for(var t=s-this.blockSize,r=0,n=this.I,o=this.L;rthis.L?this.update(this.F,56-this.L):this.update(this.F,this.blockSize-(this.L-56));for(var t=this.blockSize-1;56<=t;t--)this.I[t]=255&e,e/=256;this.B(this.I);for(var r=0,t=0;5>t;t++)for(var n=24;0<=n;n-=8)a[r]=255&this.D[t]>>n,++r;return a},e}(n.Hash);e.Sha1=o},function(o,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=function(){return function(){this.blockSize=-1}}();e.Hash=t},function(n,e){"use strict";function s(a,i){if("object"!=typeof a||null===a)return!1;for(var t=0,r=i,n;t 4. Need to update it?");}var i=a+" failed: ";return i+=r+" argument "}function t(n,e,t,i){if((!i||t)&&"string"!=typeof t)throw Error(a(n,e,i)+"must be a valid firebase namespace.")}Object.defineProperty(e,"__esModule",{value:!0}),e.validateArgCount=function(a,e,t,r){var n;if(rt&&(n=0===t?"none":"no more than "+t),n){var o=a+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+n+".";throw Error(o)}},e.errorPrefix=a,e.validateNamespace=t,e.validateCallback=function(n,e,t,i){if((!i||t)&&"function"!=typeof t)throw Error(a(n,e,i)+"must be a valid function.")},e.validateContextObject=function(n,e,t,i){if((!i||t)&&("object"!=typeof t||null===t))throw Error(a(n,e,i)+"must be a valid context object.")}},function(o,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(28);e.stringToByteArray=function(n){for(var e=[],t=0,s=0,o;s=o){var i=o-55296;s++,r.assert(so?e[t++]=o:2048>o?(e[t++]=192|o>>6,e[t++]=128|63&o):65536>o?(e[t++]=224|o>>12,e[t++]=128|63&o>>6,e[t++]=128|63&o):(e[t++]=240|o>>18,e[t++]=128|63&o>>12,e[t++]=128|63&o>>6,e[t++]=128|63&o)}return e},e.stringLength=function(o){for(var e=0,t=0,r;tr?e++:2048>r?e+=2:55296<=r&&56319>=r?(e+=4,t++):e+=3;return e}}])}().default;try{webpackJsonpFirebase([4],{76:function(o,t,n){n(77)},77:function(o,t,Kn){var ed=Math.floor,d=Math.max;(function(e){(function(){function td(e){return"string"==typeof e}function e(e){return"boolean"==typeof e}function nd(){}function i(o){var r=typeof o;if("object"==r){if(!o)return"null";if(o instanceof Array)return"array";if(o instanceof Object)return r;var n=Object.prototype.toString.call(o);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof o.length&&void 0!==o.splice&&void 0!==o.propertyIsEnumerable&&!o.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==o.call&&void 0!==o.propertyIsEnumerable&&!o.propertyIsEnumerable("call"))return"function"}else if("function"==r&&void 0===o.call)return"object";return r}function r(e){return null===e}function od(e){return"array"==i(e)}function rd(e){var t=i(e);return"array"==t||"object"==t&&"number"==typeof e.length}function a(e){return"function"==i(e)}function ad(e){var o=typeof e;return"object"==o&&null!=e||"function"==o}function s(e){return e.call.apply(e.bind,arguments)}function h(o,r){if(!o)throw Error();if(2")&&(e=e.replace(Bd,">")),-1!=e.indexOf("\"")&&(e=e.replace(Ud,""")),-1!=e.indexOf("'")&&(e=e.replace(Vd,"'")),-1!=e.indexOf("\0")&&(e=e.replace(Wd,"�")),e):e}function g(e,t){return-1!=e.indexOf(t)}function b(e,t){return et?1:0}function w(e,t){t.unshift(e),p.call(this,v.apply(null,t)),t.shift()}function y(e){throw new w("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1))}function I(t,n){var e=t.length,o=td(t)?t.split(""):t;for(--e;0<=e;--e)e in o&&n.call(void 0,o[e],e,t)}function T(t){t:{for(var n=Te,e=t.length,a=td(t)?t.split(""):t,r=0;rn?null:td(t)?t.charAt(n):t[n]}function A(e,t){return 0<=jd(e,t)}function k(o,t){t=jd(o,t);var n;return(n=0<=t)&&Array.prototype.splice.call(o,t,1),n}function E(o,t){var n=0;I(o,function(e,a){t.call(void 0,e,a,o)&&1==Array.prototype.splice.call(o,a,1).length&&n++})}function N(){return Array.prototype.concat.apply([],arguments)}function S(o){var t=o.length;if(0"),n=n.join("")}return n=t.createElement(n),o&&(td(o)?n.className=o:od(o)?n.className=o.join(" "):Dt(n,o)),2e.keyCode||void 0!=e.returnValue)){t:{var i=!1;if(0==e.keyCode)try{e.keyCode=-1;break t}catch(e){i=!0}(i||void 0==e.returnValue)&&(e.returnValue=!0)}for(e=[],i=t.b;i;i=i.parentNode)e.push(i);for(a=a.type,i=e.length-1;0<=i;i--){t.b=e[i];var r=on(e[i],a,!0,t);s=s&&r}for(i=0;i>4),64!=o&&(t(240&r<<4|o>>2),64!=a&&t(192&o<<6|a))}}function Pn(){if(!Yl){Yl={},Jl={};for(var e=0;65>e;e++)Yl[e]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e),Jl[Yl[e]]=e,62<=e&&(Jl["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(e)]=e)}}function Cn(e,t){this.g=[],this.v=e,this.o=t||null,this.f=this.a=!1,this.c=void 0,this.u=this.w=this.i=!1,this.h=0,this.b=null,this.l=0}function Rn(o,t,r){o.a=!0,o.c=r,o.f=!t,Un(o)}function _n(e){if(e.a){if(!e.u)throw new jn;e.u=!1}}function Dn(e,t){Ln(e,null,t,void 0)}function Ln(o,t,n,e){o.g.push([t,n,e]),o.a&&Un(o)}function xn(e){return Kd(e.g,function(e){return a(e[1])})}function Un(d){if(d.h&&d.a&&xn(d)){var t=d.h,n=$l[t];n&&(Ld.clearTimeout(n.a),delete $l[t]),d.h=0}d.b&&(d.b.l--,delete d.b),t=d.c;for(var e=n=!1;d.g.length&&!d.i;){var i=d.g.shift(),r=i[0],o=i[1];if(i=i[2],r=d.f?o:r)try{var a=r.call(i||d.o,t);void 0!==a&&(d.f=d.f&&(a==t||a instanceof Error),d.c=t=a),(K(t)||"function"==typeof Ld.Promise&&t instanceof Ld.Promise)&&(e=!0,d.i=!0)}catch(e){t=e,d.f=!0,xn(d)||(n=!0)}}d.c=t,e&&(a=f(d.m,d,!0),e=f(d.m,d,!1),t instanceof Cn?(Ln(t,a,e),t.w=!0):t.then(a,e)),n&&(t=new Vn(t),$l[t.a]=t,d.h=t.a)}function jn(){p.call(this)}function Mn(){p.call(this)}function Vn(e){this.a=Ld.setTimeout(f(this.c,this),0),this.b=e}function Fn(e,t){this.b=-1,this.b=ep,this.f=Ld.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=e,this.h=t,this.l=Ld.Int32Array?new Int32Array(64):Array(64),Zl||(Zl=Ld.Int32Array?new Int32Array(rp):rp),this.reset()}function qn(d){for(var t=d.f,n=d.l,e=0,i=0;it;t++){i=0|n[t-15],e=0|n[t-2];var r=0|(0|n[t-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3),o=0|(0|n[t-7])+((e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10);n[t]=0|r+o}e=0|d.a[0],i=0|d.a[1];var a=0|d.a[2],s=0|d.a[3],p=0|d.a[4],u=0|d.a[5],h=0|d.a[6];for(r=0|d.a[7],t=0;64>t;t++){var m=0|((e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10))+(e&i^e&a^i&a);o=p&u^~p&h,r=0|r+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7)),o=0|o+(0|Zl[t]),o=0|r+(0|o+(0|n[t])),r=h,h=u,u=p,p=0|s+o,s=a,a=i,i=e,e=0|o+m}d.a[0]=0|d.a[0]+e,d.a[1]=0|d.a[1]+i,d.a[2]=0|d.a[2]+a,d.a[3]=0|d.a[3]+s,d.a[4]=0|d.a[4]+p,d.a[5]=0|d.a[5]+u,d.a[6]=0|d.a[6]+h,d.a[7]=0|d.a[7]+r}function Xn(t,n,e){void 0===e&&(e=n.length);var i=0,r=t.c;if(td(n))for(;i=o&&o==(0|o)))throw Error("message must be a byte array");t.f[r++]=o,r==t.b&&(qn(t),r=0)}}t.c=r,t.g+=e}function Bn(){Fn.call(this,8,ap)}function Hn(t){if(t.P&&"function"==typeof t.P)return t.P();if(td(t))return t.split("");if(rd(t)){for(var n=[],e=t.length,o=0;ot)throw Error("Bad port number "+t);e.i=t}else e.i=null}function Zn(o,t,n){t instanceof ae?(o.a=t,pe(o.a,o.f)):(n||(t=re(t,pp)),o.a=new ae(t,0,o.f))}function Qn(o,t,n){o.a.set(t,n)}function te(e,t){return e.a.get(t)}function ne(e){return e instanceof Jn?new Jn(e):new Jn(e,void 0)}function ee(o,t){var n=new Jn(null,void 0);return Yn(n,"https"),o&&(n.b=o),t&&(n.g=t),n}function ie(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function re(t,n,e){return td(t)?(t=encodeURI(t).replace(n,oe),e&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function oe(e){return e=e.charCodeAt(0),"%"+(15&e>>4).toString(16)+(15&e).toString(16)}function ae(o,t,n){this.b=this.a=null,this.c=o||null,this.f=!!n}function se(o){o.a||(o.a=new Tn,o.b=0,o.c&&zn(o.c,function(t,n){ce(o,decodeURIComponent(t.replace(/\+/g," ")),n)}))}function ue(a){var t=Wn(a);if(void 0===t)throw Error("Keys are undefined");var n=new ae(null,0,void 0);a=Hn(a);for(var e=0;e2*e.c&&An(e)))}function fe(e,t){return se(e),t=de(e,t),kn(e.a.b,t)}function le(o,t,n){he(o,t),0n;n++){e=t[n];try{return new ActiveXObject(e),o.f=e}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return o.f}function we(e){hn.call(this),this.headers=new Tn,this.w=e||null,this.b=!1,this.v=this.a=null,this.g=this.I=this.i="",this.c=this.G=this.h=this.A=!1,this.f=0,this.m=null,this.l=hp,this.o=this.N=!1}function ye(a,t,n,e,i){if(a.a)throw Error("[goog.net.XhrIo] Object is active with another request="+a.i+"; newUri="+t);n=n?n.toUpperCase():"GET",a.i=t,a.g="",a.I=n,a.A=!1,a.b=!0,a.a=a.w?a.w.a():up.a(),a.v=me(a.w?a.w:up),a.a.onreadystatechange=f(a.Ab,a);try{En(a.J,Re(a,"Opening Xhr")),a.G=!0,a.a.open(n,t+"",!0),a.G=!1}catch(e){return En(a.J,Re(a,"Error opening Xhr: "+e.message)),void Ae(a,e)}t=e||"";var r=new Tn(a.headers);i&&Gn(i,function(e,t){r.set(t,e)}),i=T(r.S()),e=Ld.FormData&&t instanceof Ld.FormData,!A(yp,n)||i||e||r.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),r.forEach(function(e,t){this.a.setRequestHeader(t,e)},a),a.l&&(a.a.responseType=a.l),"withCredentials"in a.a&&a.a.withCredentials!==a.N&&(a.a.withCredentials=a.N);try{Se(a),0e||$d&&ll&&!(9",s=Rt(s),o.document.write(Ct(s)),o.document.close())):o=s.open(Nt(t),d,o),o)try{o.focus()}catch(e){}return o}function ze(o){return new $(function(t){function n(){mn(2e3).then(function(){return o&&!o.closed?n():void t()})}return n()})}function Je(){var e=null;return new $(function(t){"complete"==Ld.document.readyState?t():(e=function(){t()},tn(window,"load",e))}).s(function(t){throw nn(window,"load",e),t})}function Ye(){return $e(void 0)?Je().then(function(){return new $(function(o,t){var n=Ld.document,e=setTimeout(function(){t(Error("Cordova framework is not ready."))},1e3);n.addEventListener("deviceready",function(){clearTimeout(e),o()},!1)})}):nt(Error("Cordova must run in an Android or iOS file scheme."))}function $e(e){return e=e||ii(),"file:"===ui()&&e.toLowerCase().match(/iphone|ipad|ipod|android/)}function Ze(){var e=Ld.window;try{return e&&e!=e.top}catch(e){return!1}}function Qe(){return Nd.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":Nd.INTERNAL.hasOwnProperty("node")?"Node":"Browser"}function ti(){var e=Qe();return"ReactNative"===e||"Node"===e}function ni(e){var t=e.toLowerCase();return g(t,"opera/")||g(t,"opr/")||g(t,"opios/")?"Opera":g(t,"iemobile")?"IEMobile":g(t,"msie")||g(t,"trident/")?"IE":g(t,"edge/")?"Edge":g(t,"firefox/")?Sp:g(t,"silk/")?"Silk":g(t,"blackberry")?"Blackberry":g(t,"webos")?"Webos":!g(t,"safari/")||g(t,"chrome/")||g(t,"crios/")||g(t,"android")?(g(t,"chrome/")||g(t,"crios/"))&&!g(t,"edge/")?Ep:g(t,"android")?"Android":(e=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==e.length?e[1]:"Other":"Safari"}function ei(o,t){t=t||[];var n=[],a={},r;for(r in kp)a[kp[r]]=!0;for(r=0;rt)throw Error("Short delay should be less than long delay!");this.c=o,this.b=t,o=n||ii(),e=e||Qe(),this.a=He(o)||"ReactNative"===e}function bi(){var e=Ld.document;return!e||void 0===e.visibilityState||"visible"==e.visibilityState}function wi(){var o=Ld.document,r=null;return bi()||!o?tt():new $(function(t){r=function(){bi()&&(o.removeEventListener("visibilitychange",r,!1),t())},o.addEventListener("visibilitychange",r,!1)}).s(function(t){throw o.removeEventListener("visibilitychange",r,!1),t})}function yi(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 Ii(o,t,n){wp?Object.defineProperty(o,t,{configurable:!0,enumerable:!0,value:n}):o[t]=n}function Ti(o,t){if(t)for(var n in t)t.hasOwnProperty(n)&&Ii(o,n,t[n])}function Ai(e){var t={};return Ti(t,e),t}function ki(o){var t={},e;for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e]);return t}function Ei(o,r){if(!r||!r.length)return!0;if(!o)return!1;for(var a=0,e;a Auth section -> Sign in method tab.",o):"http"==n||"https"==n?r=v("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.",o):t="operation-not-supported-in-this-environment",Oi.call(this,t,r)}function lr(o,t,n){Oi.call(this,o,n),o=t||{},o.sb&&Ii(this,"email",o.sb),o.Y&&Ii(this,"phoneNumber",o.Y),o.credential&&Ii(this,"credential",o.credential)}function dr(o){if(o.code){var t=o.code||"";0==t.indexOf(Dp)&&(t=t.substring(Dp.length));var n={credential:sr(o)};if(o.email)n.sb=o.email;else{if(!o.phoneNumber)return new Oi(t,o.message||void 0);n.Y=o.phoneNumber}return new lr(t,n,o.message)}return null}function pr(e){this.f=e}function vr(o,t,n){var e="Node"==Qe();if(!(e=Ld.XMLHttpRequest||e&&Nd.INTERNAL.node&&Nd.INTERNAL.node.XMLHttpRequest))throw new Oi("internal-error","The XMLHttpRequest compatibility library was not found.");this.b=o,o=t||{},this.i=o.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.l=o.secureTokenTimeout||Jp,this.c=L(o.secureTokenHeaders||$p),this.g=o.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.h=o.firebaseTimeout||Zp,this.a=L(o.firebaseHeaders||ec),n&&(this.a["X-Client-Version"]=n,this.c["X-Client-Version"]=n),this.f=new je,this.o=new pr(e)}function mr(e,t){t?e.a["X-Firebase-Locale"]=t:delete e.a["X-Firebase-Locale"]}function gr(e,t){t?(e.a["X-Client-Version"]=t,e.c["X-Client-Version"]=t):(delete e.a["X-Client-Version"],delete e.c["X-Client-Version"])}function br(s,t,n,e,i,r,o){mi()?(Be()?s=f(s.m,s):(tc||(tc=new $(function(e,t){wr(e,t)})),s=f(s.u,s)),s(t,n,e,i,r,o)):n&&n(null)}function wr(e,t){((window.gapi||{}).client||{}).request?e():(Ld[oc]=function(){((window.gapi||{}).client||{}).request?e():t(Error("CORS_UNSUPPORTED"))},Dn(_e(At(nc,{onload:oc})),function(){t(Error("CORS_UNSUPPORTED"))}))}function yr(o,t){return new $(function(n,e){"refresh_token"==t.grant_type&&t.refresh_token||"authorization_code"==t.grant_type&&t.code?br(o,o.i+"?key="+encodeURIComponent(o.b),function(o){o?o.error?e(Mr(o)):o.access_token&&o.refresh_token?n(o):e(new Oi("internal-error")):e(new Oi("network-request-failed"))},"POST",""+ue(t),o.c,o.l.get()):e(new Oi("internal-error"))})}function Ir(d,t,l,e,i,n){var r=ne(d.g+t);Qn(r,"key",d.b),n&&Qn(r,"cb",""+Pd());var a="GET"==l;if(a)for(var o in e)e.hasOwnProperty(o)&&Qn(r,o,e[o]);return new $(function(s,n){br(d,""+r,function(e){e?e.error?n(Mr(e,i||{})):s(e):n(new Oi("network-request-failed"))},l,a?void 0:jt(fi(e)),d.a,d.h.get())})}function Tr(e){if(!bp.test(e.email))throw new Oi("invalid-email")}function Ar(e){"email"in e&&Tr(e)}function ud(e,t){return yd(e,dc,{identifier:t,continueUri:si()?Ke():"http://localhost"}).then(function(e){return e.allProviders||[]})}function Er(e){return yd(e,mc,{}).then(function(e){return e.authorizedDomains||[]})}function Nr(e){if(!e[Yp])throw new Oi("internal-error")}function hd(e){if(!(e.phoneNumber||e.temporaryProof)){if(!e.sessionInfo)throw new Oi("missing-verification-id");if(!e.code)throw new Oi("missing-verification-code")}else if(!e.phoneNumber||!e.temporaryProof)throw new Oi("internal-error")}function md(e,t){return yd(e,bc,t)}function Pr(o,t,r){return yd(o,pc,{idToken:t,deleteProvider:r})}function Cr(e){if(!e.requestUri||!e.sessionId&&!e.postBody)throw new Oi("internal-error")}function gd(e){var t=null;if(e.needConfirmation?(e.code="account-exists-with-different-credential",t=dr(e)):"FEDERATED_USER_ID_ALREADY_LINKED"==e.errorMessage?(e.code="credential-already-in-use",t=dr(e)):"EMAIL_EXISTS"==e.errorMessage?(e.code="email-already-in-use",t=dr(e)):e.errorMessage&&(t=jr(e.errorMessage)),t)throw t;if(!e[Yp])throw new Oi("internal-error")}function fd(e,t){return t.returnIdpCredential=!0,yd(e,Ec,t)}function Dr(e,t){return t.returnIdpCredential=!0,yd(e,Tc,t)}function Lr(e,t){return t.returnIdpCredential=!0,t.autoCreate=!1,yd(e,kc,t)}function xr(e){if(!e.oobCode)throw new Oi("invalid-action-code")}function yd(o,t,n){if(!Ei(n,t.ea))return nt(new Oi("internal-error"));var e=t.zb||"POST",r;return tt(n).then(t.D).then(function(){return t.T&&(n.returnSecureToken=!0),Ir(o,t.endpoint,e,n,t.Pb,t.nb||!1)}).then(function(e){return r=e}).then(t.O).then(function(){if(!t.ga)return r;if(!(t.ga in r))throw new Oi("internal-error");return r[t.ga]})}function jr(e){return Mr({error:{errors:[{message:e}],code:400,message:e}})}function Mr(o,t){var a=(o.error&&o.error.errors&&o.error.errors[0]||{}).reason||"",e={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(a=e[a]?new Oi(e[a]):null)return a;for(var i in a=o.error&&o.error.message||"",e={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash"},x(e,t||{}),t=(t=a.match(/^[^\s]+\s*:\s*(.*)$/))&&1t.c?Xn(t,op,56-t.c):Xn(t,op,t.b-(t.c-56));for(var e=63;56<=e;e--)t.f[e]=255&n,n/=256;for(qn(t),e=n=0;e>a;return Nn(o)}function jo(d,t,n,e){var i=xo(),r=new cr(t,e,null,i,new Oi("no-auth-event")),o=ri("BuildInfo.packageName",Ld);if("string"!=typeof o)throw new Oi("invalid-cordova-configuration");var l=ri("BuildInfo.displayName",Ld),s={};if(ii().toLowerCase().match(/iphone|ipad|ipod/))s.ibi=o;else{if(!ii().toLowerCase().match(/android/))return nt(new Oi("operation-not-supported-in-this-environment"));s.apn=o}l&&(s.appDisplayName=l),i=Uo(i),s.sessionId=i;var p=Zr(d.u,d.i,d.l,t,n,null,e,d.m,s,d.o);return d.ba().then(function(){var e=d.h;return d.A.a.set(qc,r.B(),e)}).then(function(){var t=ri("cordova.plugins.browsertab.isAvailable",Ld);if("function"!=typeof t)throw new Oi("invalid-cordova-configuration");var o=null;t(function(e){if(e){if("function"!=typeof(o=ri("cordova.plugins.browsertab.openUrl",Ld)))throw new Oi("invalid-cordova-configuration");o(p)}else{if("function"!=typeof(o=ri("cordova.InAppBrowser.open",Ld)))throw new Oi("invalid-cordova-configuration");e=ii(),e=e.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||e.match(/(iPad|iPhone|iPod).*OS 8_\d/i),d.a=o(p,e?"_blank":"_system","location=yes")}})})}function Mo(o,t){for(var n=0;ne.f&&(e.a=e.f),t)}function la(e,t){da(e),e.b=mn(fa(e,t)).then(function(){return e.l?tt():wi()}).then(function(){return e.h()}).then(function(){la(e,!0)}).s(function(t){e.i(t)&&la(e,!1)})}function da(e){e.b&&(e.b.cancel(),e.b=null)}function pa(e){this.f=e,this.b=this.a=null,this.c=0}function va(o,t){var n=t[Yp],e=t.refreshToken;t=ma(t.expiresIn),o.b=n,o.c=t,o.a=e}function ma(e){return Pd()+1e3*parseInt(e,10)}function ga(e,t){return yr(e.f,t).then(function(t){return e.b=t.access_token,e.c=ma(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 ba(e,t){this.a=e||null,this.b=t||null,Ti(this,{lastSignInTime:yi(t||null),creationTime:yi(e||null)})}function wa(e){return new ba(e.a,e.b)}function ya(a,s,d,e,i,r){Ti(this,{uid:a,displayName:e||null,photoURL:i||null,email:d||null,phoneNumber:r||null,providerId:s})}function Ia(o,t){for(var n in Xt.call(this,o),t)this[n]=t[n]}function Ta(o,t,n){this.A=[],this.G=o.apiKey,this.o=o.appName,this.w=o.authDomain||null,o=Nd.SDK_VERSION?ei(Nd.SDK_VERSION):null,this.c=new vr(this.G,Vr(Oc),o),this.h=new pa(this.c),Ca(this,t[Yp]),va(this.h,t),Ii(this,"refreshToken",this.h.a),La(this,n||{}),hn.call(this),this.I=!1,this.w&&ai()&&(this.a=Zo(this.w,this.G,this.o)),this.N=[],this.i=null,this.l=Sa(this),this.U=f(this.Ga,this);var e=this;this.ha=null,this.ra=function(n){e.na(n.h)},this.W=null,this.R=[],this.qa=function(n){ka(e,n.f)},this.V=null}function Sd(e,t){e.W&&nn(e.W,"languageCodeChanged",e.ra),(e.W=t)&&$t(t,"languageCodeChanged",e.ra)}function ka(e,t){e.R=t,gr(e.c,Nd.SDK_VERSION?ei(Nd.SDK_VERSION,e.R):null)}function Ea(e,t){e.V&&nn(e.V,"frameworkChanged",e.qa),(e.V=t)&&$t(t,"frameworkChanged",e.qa)}function Na(e){try{return Nd.app(e.o).auth()}catch(t){throw new Oi("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+e.o+"'!")}}function Sa(e){return new ha(function(){return e.F(!0)},function(e){return e&&"auth/network-request-failed"==e.code},function(){var t=e.h.c-Pd()-3e5;return 0i||i>=Jc.length)throw new Oi("internal-error","Argument validator received an unsupported number of arguments.");n=Jc[i],e=(e?"":n+" argument ")+(t.name?"\""+t.name+"\" ":"")+"must be "+t.K+".";break t}e=null}}if(e)throw new Oi("argument-error",s+" failed: "+e)}function Ds(o,n){return{name:o||"",K:"a valid string",optional:!!n,M:td}}function Ls(){return{name:"opt_forceRefresh",K:"a boolean",optional:!0,M:e}}function xs(e,t){return{name:e||"",K:"a valid object",optional:!!t,M:ad}}function Us(e,t){return{name:e||"",K:"a function",optional:!!t,M:a}}function js(e,t){return{name:e||"",K:"null",optional:!!t,M:r}}function Ms(){return{name:"",K:"an HTML element",optional:!1,M:function(e){return!!(e&&e instanceof Element)}}}function Vs(){return{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(e){return!!(e&&e instanceof ps)}}}function Fs(){return{name:"app",K:"an instance of Firebase App",optional:!0,M:function(e){return!!(e&&e instanceof Nd.app.App)}}}function Ks(o){return{name:o?o+"Credential":"credential",K:o?"a valid "+o+" credential":"a valid credential",optional:!1,M:function(r){if(!r)return!1;var a=!o||r.providerId===o;return r.wa&&a}}}function qs(){return{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(e){return!!(e&&e.providerId&&e.hasOwnProperty&&e.hasOwnProperty("isOAuthProvider"))}}}function Xs(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(e){return!!(e&&td(e.type)&&a(e.verify))}}}function Bs(o,t,n,e){return{name:n||"",K:o.K+" or "+t.K,optional:!!e,M:function(n){return o.M(n)||t.M(n)}}}function Hs(d,t,n,e,i,r){if(Ii(this,"type","recaptcha"),this.b=this.c=null,this.m=!1,this.l=t,this.a=n||{theme:"light",type:"image"},this.g=[],this.a[eu])throw new Oi("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.h="invisible"===this.a[tu],!_t(t)||!this.h&&_t(t).hasChildNodes())throw new Oi("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.u=new vr(d,r||null,i||null),this.o=e||function(){return null};var o=this;this.i=[];var a=this.a[$c];this.a[$c]=function(e){if(Ws(o,e),"function"==typeof a)a(e);else if("string"==typeof a){var t=ri(a,Ld);"function"==typeof t&&t(e)}};var l=this.a[Zc];this.a[Zc]=function(){if(Ws(o,null),"function"==typeof l)l();else if("string"==typeof l){var e=ri(l,Ld);"function"==typeof e&&e()}}}function Ws(o,t){for(var n=0;n>>0),Od=0,Pd=Date.now||function(){return+new Date},_d;id(p,Error),p.prototype.name="CustomError";var Dd=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Md=/&/g,Fd=//g,Ud=/"/g,Vd=/'/g,Wd=/\x00/g,Hd=/[\x00&<>"']/;id(w,p),w.prototype.name="AssertionError";var jd=Array.prototype.indexOf?function(o,t,n){return Array.prototype.indexOf.call(o,t,n)}:function(t,n,e){if(e=null==e?0:0>e?d(0,t.length+e):e,td(t))return td(n)&&1==n.length?t.indexOf(n,e):-1;for(;eparseFloat(rl)){ol=il+"";break t}}ol=rl}var sl={},dl=Ld.document,ll;ll=dl&&$d?M()||("CSS1Compat"==dl.compatMode?parseInt(ol,10):5):void 0,q.prototype.get=function(){if(0"),Rt(""),Rt("
");var Nl={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"},Al={'"':"\\\"","\\":"\\\\","/":"\\/","":"\\b"," ":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"," ":"\\u000b"},Ll=/\uffff/.test("\uFFFF")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,Rl=0,Ol={};Kt.prototype.oa=!1,Kt.prototype.ta=function(){if(this.Fa)for(;this.Fa.length;)this.Fa.shift()()};var Pl=Object.freeze||function(e){return e},_l=!$d||9<=+ll,Dl=$d&&!V("9"),Ml=function(){if(!Ld.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return Ld.addEventListener("test",nd,t),Ld.removeEventListener("test",nd,t),e}();Xt.prototype.c=function(){this.Bb=!1},id(Bt,Xt);var Fl=Pl({2:"touch",3:"pen",4:"mouse"});Bt.prototype.c=function(){Bt.ib.c.call(this);var e=this.a;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,Dl)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}},Bt.prototype.g=function(){return this.a};var Bl="closure_listenable_"+(0|1e6*Math.random()),Ul=0,Vl="closure_lm_"+(0|1e6*Math.random()),Wl={},Hl=0,jl="__closure_events_fn_"+(1e9*Math.random()>>>0);id(hn,Kt),hn.prototype[Bl]=!0,hn.prototype.removeEventListener=function(o,t,n,e){nn(this,o,t,n,e)},hn.prototype.ta=function(){if(hn.ib.ta.call(this),this.u){var o=this.u,n=0,e;for(e in o.a){for(var t=o.a[e],a=0;a=yn(this).value)for(a(t)&&(t=t()),o=new gn(o,t+"",this.f),n&&(o.a=n),n="log:"+o.b,(o=Ld.console)&&o.timeStamp&&o.timeStamp(n),(o=Ld.msWriteProfilerMark)&&o(n),n=this;n;)n=n.a};var Xl={},Ql=null;_d=Tn.prototype,_d.P=function(){An(this);for(var e=[],t=0;t=--t.l&&t.cancel()}this.v?this.v.call(this.o,this):this.u=!0,this.a||(e=new Mn,_n(this),Rn(this,!1,e))}},Cn.prototype.m=function(e,t){this.i=!1,Rn(this,e,t)},Cn.prototype.A=function(e){_n(this),Rn(this,!0,e)},Cn.prototype.then=function(a,t,n){var e=new $(function(e,t){o=e,i=t}),o,i;return Ln(this,o,function(n){n instanceof Mn?e.cancel():i(n)}),e.then(a,t,n)},F(Cn),id(jn,p),jn.prototype.message="Deferred has already fired",jn.prototype.name="AlreadyCalledError",id(Mn,p),Mn.prototype.message="Deferred was canceled",Mn.prototype.name="CanceledError",Vn.prototype.c=function(){throw delete $l[this.a],this.b};var $l={},Zl;id(Fn,function(){this.b=-1});for(var ep=64,tp=[],np=0;npthis.c-3e4?this.a?ga(this,{grant_type:"refresh_token",refresh_token:this.a}):tt(null):tt({accessToken:this.b,expirationTime:this.c,refreshToken:this.a})},ba.prototype.B=function(){return{lastLoginAt:this.b,createdAt:this.a}},id(Ia,Xt),id(Ta,hn),Ta.prototype.na=function(e){this.ha=e,mr(this.c,e)},Ta.prototype.$=function(){return this.ha},Ta.prototype.Ka=function(){return S(this.R)},Ta.prototype.Ga=function(){this.l.b&&(da(this.l),this.l.start())},Ii(Ta.prototype,"providerId","firebase"),_d=Ta.prototype,_d.reload=function(){var e=this;return Za(this,Ua(this).then(function(){return qa(e).then(function(){return _a(e)}).then(xa)}))},_d.F=function(e){var o=this;return Za(this,Ua(this).then(function(){return o.h.getToken(e)}).then(function(e){if(!e)throw new Oi("internal-error");return e.accessToken!=o.pa&&(Ca(o,e.accessToken),fn(o,new Ia("tokenChanged"))),Fa(o,"refreshToken",e.refreshToken),e.accessToken}))},_d.getToken=function(e){return Tp["firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead."]||(Tp["firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead."]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead.")),this.F(e)},_d.kc=function(o){if(!(o=o.users)||!o.length)throw new Oi("internal-error");o=o[0],La(this,{uid:o.localId,displayName:o.displayName,photoURL:o.photoUrl,email:o.email,emailVerified:!!o.emailVerified,phoneNumber:o.phoneNumber,lastLoginAt:o.lastLoginAt,createdAt:o.createdAt});for(var t=Ha(o),n=0;nthis.o&&(this.o=0),0==this.o&&Ss(this)&&Pa(Ss(this)),this.removeAuthTokenListener(o)},_d.addAuthTokenListener=function(e){var t=this;this.m.push(e),Rs(this,this.i.then(function(){t.l||A(t.m,e)&&e(Os(t))}))},_d.removeAuthTokenListener=function(e){E(this.m,function(t){return t==e})},_d.delete=function(){this.l=!0;for(var e=0;et?n.push(o.substring(r,t)):n.push(o.substring(r,r+e));return n},m.each=function(o,a){if(Array.isArray(o))for(var e=0;er,r=Math.abs(r),2.2250738585072014e-308<=r?(o=Math.min(t(Math.log(r)/Math.LN2),1023),n=o+1023,i=g(r*Math.pow(2,52-o)-4503599627370496)):(n=0,i=g(r/5e-324))),s=[],a=52;a;a-=1)s.push(i%2?1:0),i=t(i/2);for(a=11;a;a-=1)s.push(n%2?1:0),n=t(n/2);s.push(e?1:0),s.reverse(),d=s.join("");var l="";for(a=0;64>a;a+=8){var p=parseInt(d.substr(a,8),2).toString(16);1===p.length&&(p="0"+p),l+=p}return l.toLowerCase()},m.isChromeExtensionContentScript=function(){return"object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href)},m.isWindowsStoreApp=function(){return"object"==typeof Windows&&"object"==typeof Windows.UI},m.errorForServerCode=function(o,e){var t="Unknown Error";"too_big"===o?t="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"==o?t="Client doesn't have permission to access the desired data.":"unavailable"==o&&(t="The service is unavailable");var n=Error(o+" at "+e.path+": "+t);return n.code=o.toUpperCase(),n},m.e=/^-?\d{1,10}$/,m.tryParseInt=function(t){if(m.e.test(t)){var o=+t;if(-2147483648<=o&&2147483647>=o)return o}return null},m.exceptionGuard=function(t){try{t()}catch(t){setTimeout(function(){var e=t.stack||"";throw m.warn("Exception was thrown by user callback.",e),t},0)}},m.callUserCallback=function(t){for(var o=[],n=1;n=this.n.length?null:this.n[this.i]},o.prototype.getLength=function(){return this.n.length-this.i},o.prototype.popFront=function(){var e=this.i;return e=this.n.length)return null;for(var e=[],t=this.i;t=this.n.length},o.relativePath=function(e,t){var n=e.getFront(),r=t.getFront();if(null===n)return t;if(n===r)return o.relativePath(e.popFront(),t.popFront());throw Error("INTERNAL ERROR: innerPath ("+t+") is not within outerPath ("+e+")")},o.comparePaths=function(r,e){for(var t=r.slice(),n=e.slice(),i=0,o;io.getLength())return!1;for(;et.MAX_PATH_LENGTH_BYTES)throw Error(this.o+"has a key path longer than "+t.MAX_PATH_LENGTH_BYTES+" bytes ("+this.l+").");if(this.u.length>t.MAX_PATH_DEPTH)throw Error(this.o+"path specified exceeds the maximum depth that can be written ("+t.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},t.prototype.toErrorString=function(){return 0==this.u.length?"":"in property '"+this.u.join(".")+"'"},t}();e.ValidationPath=o},function(r,e,t){"use strict";var n=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(o,e){for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t])};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=t(15),d=t(1),i=t(5),l=t(16),c,a;e.setNodeFromJSON=function(t){c=t},e.setMaxNode=function(t){a=t};var s=function(o){function e(){return null!==o&&o.apply(this,arguments)||this}return n(e,o),e.prototype.compare=function(o,e){var t=o.node.getPriority(),n=e.node.getPriority(),r=t.compareTo(n);return 0===r?d.nameCompare(o.name,e.name):r},e.prototype.isDefinedOn=function(t){return!t.getPriority().isEmpty()},e.prototype.indexedValueChanged=function(n,e){return!n.getPriority().equals(e.getPriority())},e.prototype.minPost=function(){return i.NamedNode.MIN},e.prototype.maxPost=function(){return new i.NamedNode(d.MAX_NAME,new l.LeafNode("[PRIORITY-POST]",a))},e.prototype.makePost=function(o,e){var t=c(o);return new i.NamedNode(e,new l.LeafNode("[PRIORITY-POST]",t))},e.prototype.toString=function(){return".priority"},e}(o.Index);e.PriorityIndex=s,e.PRIORITY_INDEX=new s},function(m,g,e){"use strict";var n=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(o,e){for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t])};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(g,"__esModule",{value:!0});var b=e(0),t=e(1),o=e(17),v=e(5),r=e(37),l=e(3),a=e(10),s=e(39),p=e(16),d=e(41),c=function(){function p(o,a,t){this._=o,this.y=a,this.g=t,this.m=null,this.y&&r.validatePriorityNode(this.y),this._.isEmpty()&&b.assert(!this.y||this.y.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(p,"EMPTY_NODE",{get:function(){return u||(u=new p(new o.SortedMap(d.NAME_COMPARATOR),null,s.IndexMap.Default))},enumerable:!0,configurable:!0}),p.prototype.isLeafNode=function(){return!1},p.prototype.getPriority=function(){return this.y||u},p.prototype.updatePriority=function(e){return this._.isEmpty()?this:new p(this._,e,this.g)},p.prototype.getImmediateChild=function(n){if(".priority"===n)return this.getPriority();var e=this._.get(n);return null===e?u:e},p.prototype.getChild=function(n){var e=n.getFront();return null===e?this:this.getImmediateChild(e).getChild(n.popFront())},p.prototype.hasChild=function(t){return null!==this._.get(t)},p.prototype.updateImmediateChild=function(e,t){if(b.assert(t,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(t);var n=new v.NamedNode(e,t),o,r,a;return t.isEmpty()?(o=this._.remove(e),r=this.g.removeFromIndexes(n,this._)):(o=this._.insert(e,t),r=this.g.addToIndexes(n,this._)),a=o.isEmpty()?u:this.y,new p(o,a,r)},p.prototype.updateChild=function(o,e){var t=o.getFront();if(null===t)return e;b.assert(".priority"!==o.getFront()||1===o.getLength(),".priority must be the last token in a path");var n=this.getImmediateChild(t).updateChild(o.popFront(),e);return this.updateImmediateChild(t,n)},p.prototype.isEmpty=function(){return this._.isEmpty()},p.prototype.numChildren=function(){return this._.count()},p.prototype.val=function(e){if(this.isEmpty())return null;var d={},n=0,r=0,i=!0;if(this.forEachChild(l.PRIORITY_INDEX,function(t,o){d[t]=o.val(e),n++,i&&p.e.test(t)?r=Math.max(r,+t):i=!1}),!e&&i&&r<2*n){var o=[];for(var a in d)o[a]=d[a];return o}return e&&!this.getPriority().isEmpty()&&(d[".priority"]=this.getPriority().val()),d},p.prototype.hash=function(){if(null===this.m){var o="";this.getPriority().isEmpty()||(o+="priority:"+r.priorityHashText(this.getPriority().val())+":"),this.forEachChild(l.PRIORITY_INDEX,function(e,t){var n=t.hash();""!==n&&(o+=":"+e+":"+n)}),this.m=""==o?"":t.sha1(o)}return this.m},p.prototype.getPredecessorChildName=function(o,e,t){var n=this.C(t);if(n){var r=n.getPredecessorKey(new v.NamedNode(o,e));return r?r.name:null}return this._.getPredecessorKey(o)},p.prototype.getFirstChildName=function(o){var e=this.C(o);if(e){var t=e.minKey();return t&&t.name}return this._.minKey()},p.prototype.getFirstChild=function(n){var e=this.getFirstChildName(n);return e?new v.NamedNode(e,this._.get(e)):null},p.prototype.getLastChildName=function(o){var e=this.C(o);if(e){var t=e.maxKey();return t&&t.name}return this._.maxKey()},p.prototype.getLastChild=function(n){var e=this.getLastChildName(n);return e?new v.NamedNode(e,this._.get(e)):null},p.prototype.forEachChild=function(o,r){var e=this.C(o);return e?e.inorderTraversal(function(t){return r(t.name,t.node)}):this._.inorderTraversal(r)},p.prototype.getIterator=function(t){return this.getIteratorFrom(t.minPost(),t)},p.prototype.getIteratorFrom=function(o,e){var t=this.C(e);if(t)return t.getIteratorFrom(o,function(t){return t});for(var n=this._.getIteratorFrom(o.name,v.NamedNode.Wrap),r=n.peek();null!=r&&0>e.compare(r,o);)n.getNext(),r=n.peek();return n},p.prototype.getReverseIterator=function(t){return this.getReverseIteratorFrom(t.maxPost(),t)},p.prototype.getReverseIteratorFrom=function(o,e){var t=this.C(e);if(t)return t.getReverseIteratorFrom(o,function(t){return t});for(var n=this._.getReverseIteratorFrom(o.name,v.NamedNode.Wrap),r=n.peek();null!=r&&0p.S/3&&o.stringLength(e)>p.S)throw Error(i+"contains a string greater than "+p.S+" utf8 bytes "+a.toErrorString()+" ('"+e.substring(0,50)+"...')");if(e&&"object"==typeof e){var s=!1,d=!1;if(c.forEach(e,function(e,t){if(".value"===e)s=!0;else if(".priority"!==e&&".sv"!==e&&(d=!0,!p.isValidKey(e)))throw Error(i+" contains an invalid key ("+e+") "+a.toErrorString()+". Keys must be non-empty strings and can't contain \".\", \"#\", \"$\", \"/\", \"[\", or \"]\"");a.push(e),p.validateFirebaseData(i,t,a),a.pop()}),s&&d)throw Error(i+" contains \".value\" child "+a.toErrorString()+" in addition to actual children.")}},p.validateFirebaseMergePaths=function(r,e){var n,i;for(n=0;ni)a=this.I?a.left:a.right;else{if(0===i){this.O.push(a);break}this.O.push(a),a=this.I?a.right:a.left}}return t.prototype.getNext=function(){if(0===this.O.length)return null;var n=this.O.pop(),t;if(t=this.R?this.R(n.key,n.value):{key:n.key,value:n.value},this.I)for(n=n.left;!n.isEmpty();)this.O.push(n),n=n.right;else for(n=n.right;!n.isEmpty();)this.O.push(n),n=n.left;return t},t.prototype.hasNext=function(){return 0n?r.copy(null,null,null,r.left.insert(o,e,t),null):0===n?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(o,e,t)),r.D()},a.prototype.M=function(){if(this.left.isEmpty())return d.EMPTY_NODE;var t=this;return t.left.L()||t.left.left.L()||(t=t.F()),t=t.copy(null,null,null,t.left.M(),null),t.D()},a.prototype.remove=function(o,e){var t,n;if(t=this,0>e(o,t.key))t.left.isEmpty()||t.left.L()||t.left.left.L()||(t=t.F()),t=t.copy(null,null,null,t.left.remove(o,e),null);else{if(t.left.L()&&(t=t.x()),t.right.isEmpty()||t.right.L()||t.right.left.L()||(t=t.k()),0===e(o,t.key)){if(t.right.isEmpty())return d.EMPTY_NODE;n=t.right.A(),t=t.copy(n.key,n.value,null,null,t.right.M())}t=t.copy(null,null,null,null,t.right.remove(o,e))}return t.D()},a.prototype.L=function(){return this.color},a.prototype.D=function(){var t=this;return t.right.L()&&!t.left.L()&&(t=t.W()),t.left.L()&&t.left.left.L()&&(t=t.x()),t.left.L()&&t.right.L()&&(t=t.j()),t},a.prototype.F=function(){var t=this.j();return t.right.left.L()&&(t=t.copy(null,null,null,null,t.right.x()),t=t.W(),t=t.j()),t},a.prototype.k=function(){var t=this.j();return t.left.left.L()&&(t=t.x(),t=t.j()),t},a.prototype.W=function(){var e=this.copy(null,null,a.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},a.prototype.x=function(){var e=this.copy(null,null,a.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},a.prototype.j=function(){var n=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,n,e)},a.prototype.V=function(){var t=this.Q();return Math.pow(2,t)<=this.count()+1},a.prototype.Q=function(){var t;if(this.L()&&this.left.L())throw Error("Red node has red child("+this.key+","+this.value+")");if(this.right.L())throw Error("Right child of ("+this.key+","+this.value+") is red");if((t=this.left.Q())!==this.right.Q())throw Error("Black depths differ");return t+(this.L()?0:1)},a.RED=!0,a.BLACK=!1,a}();e.LLRBNode=r;var t=function(){function t(){}return t.prototype.copy=function(){return this},t.prototype.insert=function(n,e){return new r(n,e,null)},t.prototype.remove=function(){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(){return!1},t.prototype.reverseTraversal=function(){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.Q=function(){return 0},t.prototype.L=function(){return!1},t}();e.LLRBEmptyNode=t;var d=function(){function o(e,t){void 0===t&&(t=o.EMPTY_NODE),this.U=e,this.B=t}return o.prototype.insert=function(e,t){return new o(this.U,this.B.insert(e,t,this.U).copy(null,null,r.BLACK,null,null))},o.prototype.remove=function(e){return new o(this.U,this.B.remove(e,this.U).copy(null,null,r.BLACK,null,null))},o.prototype.get=function(o){for(var e=this.B,n;!e.isEmpty();){if(0===(n=this.U(o,e.key)))return e.value;0>n?e=e.left:0r?e=e.left:0.firebaseio.com instead"),n&&"undefined"!=n||o.fatal("Cannot parse Firebase url. Please use https://.firebaseio.com"),e.secure||o.warnIfPageIsSecure();var r="ws"===e.scheme||"wss"===e.scheme;return{repoInfo:new i.RepoInfo(e.host,e.secure,n,r),path:new t.Path(e.pathString)}},d.parseURL=function(r){var d="",m="",g="",f="",y=!0,b="https",v=443;if("string"==typeof r){var x=r.indexOf("//");0<=x&&(b=r.substring(0,x-1),r=r.substring(x+2));var l=r.indexOf("/");-1===l&&(l=r.length),d=r.substring(0,l),f=p(r.substring(l));var h=d.split(".");3===h.length?(m=h[1],g=h[0].toLowerCase()):2===h.length&&(m=h[0]),0<=(x=d.indexOf(":"))&&(y="https"===b||"wss"===b,v=parseInt(d.substring(x+1),10))}return{host:d,port:v,domain:m,subdomain:g,secure:y,scheme:b,pathString:f}}},function(d,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=t(0),r=t(0),p=t(13),i=t(14),n=function(){function t(o,a,t,n,r){void 0===r&&(r=""),this.secure=a,this.namespace=t,this.webSocketOnly=n,this.persistenceKey=r,this.host=o.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=p.PersistentStorage.get("host:"+o)||this.host}return t.prototype.needsQueryParam=function(){return this.host!==this.internalHost},t.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},t.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},t.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},t.prototype.updateHost=function(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&p.PersistentStorage.set("host:"+this.host,this.internalHost))},t.prototype.connectionURL=function(a,s){l.assert("string"==typeof a,"typeof type must == string"),l.assert("object"==typeof s,"typeof params must == object");var d;if(a===i.WEBSOCKET)d=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if(a!==i.LONG_POLLING)throw Error("Unknown connection type: "+a);d=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(s.ns=this.namespace);var n=[];return r.forEach(s,function(o,e){n.push(o+"="+e)}),d+n.join("&")},t.prototype.toString=function(){var t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t},t.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},t}();e.RepoInfo=n},function(d,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=t(0),r=t(7),i=t(1),p=t(0),n=function(){function t(n,o){this.Ie=n,this.Oe=o}return t.prototype.cancel=function(n){l.validateArgCount("OnDisconnect.cancel",0,1,arguments.length),l.validateCallback("OnDisconnect.cancel",1,n,!0);var e=new p.Deferred;return this.Ie.onDisconnectCancel(this.Oe,e.wrapCallback(n)),e.promise},t.prototype.remove=function(n){l.validateArgCount("OnDisconnect.remove",0,1,arguments.length),r.validateWritablePath("OnDisconnect.remove",this.Oe),l.validateCallback("OnDisconnect.remove",1,n,!0);var e=new p.Deferred;return this.Ie.onDisconnectSet(this.Oe,null,e.wrapCallback(n)),e.promise},t.prototype.set=function(o,e){l.validateArgCount("OnDisconnect.set",1,2,arguments.length),r.validateWritablePath("OnDisconnect.set",this.Oe),r.validateFirebaseDataArg("OnDisconnect.set",1,o,this.Oe,!1),l.validateCallback("OnDisconnect.set",2,e,!0);var t=new p.Deferred;return this.Ie.onDisconnectSet(this.Oe,o,t.wrapCallback(e)),t.promise},t.prototype.setWithPriority=function(a,e,t){l.validateArgCount("OnDisconnect.setWithPriority",2,3,arguments.length),r.validateWritablePath("OnDisconnect.setWithPriority",this.Oe),r.validateFirebaseDataArg("OnDisconnect.setWithPriority",1,a,this.Oe,!1),r.validatePriority("OnDisconnect.setWithPriority",2,e,!1),l.validateCallback("OnDisconnect.setWithPriority",3,t,!0);var n=new p.Deferred;return this.Ie.onDisconnectSetWithPriority(this.Oe,a,e,n.wrapCallback(t)),n.promise},t.prototype.update=function(o,e){if(l.validateArgCount("OnDisconnect.update",1,2,arguments.length),r.validateWritablePath("OnDisconnect.update",this.Oe),Array.isArray(o)){for(var t={},n=0;n=e)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.Ae.hasLimit())throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new h(this.repo,this.path,this.Ae.limitToFirst(e),this.De)},h.prototype.limitToLast=function(e){if(c.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!=typeof e||n(e)!==e||0>=e)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.Ae.hasLimit())throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new h(this.repo,this.path,this.Ae.limitToLast(e),this.De)},h.prototype.orderByChild=function(e){if(c.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===e)throw Error("Query.orderByChild: \"$key\" is invalid. Use Query.orderByKey() instead.");if("$priority"===e)throw Error("Query.orderByChild: \"$priority\" is invalid. Use Query.orderByPriority() instead.");if("$value"===e)throw Error("Query.orderByChild: \"$value\" is invalid. Use Query.orderByValue() instead.");y.validatePathString("Query.orderByChild",1,e,!1),this.Fe("Query.orderByChild");var t=new l.Path(e);if(t.isEmpty())throw Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");var n=new s.PathIndex(t),o=this.Ae.orderBy(n);return h.Me(o),new h(this.repo,this.path,o,!0)},h.prototype.orderByKey=function(){c.validateArgCount("Query.orderByKey",0,0,arguments.length),this.Fe("Query.orderByKey");var e=this.Ae.orderBy(i.KEY_INDEX);return h.Me(e),new h(this.repo,this.path,e,!0)},h.prototype.orderByPriority=function(){c.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.Fe("Query.orderByPriority");var e=this.Ae.orderBy(o.PRIORITY_INDEX);return h.Me(e),new h(this.repo,this.path,e,!0)},h.prototype.orderByValue=function(){c.validateArgCount("Query.orderByValue",0,0,arguments.length),this.Fe("Query.orderByValue");var e=this.Ae.orderBy(a.VALUE_INDEX);return h.Me(e),new h(this.repo,this.path,e,!0)},h.prototype.startAt=function(e,t){void 0===e&&(e=null),c.validateArgCount("Query.startAt",0,2,arguments.length),y.validateFirebaseDataArg("Query.startAt",1,e,this.path,!0),y.validateKey("Query.startAt",2,t,!0);var n=this.Ae.startAt(e,t);if(h.Le(n),h.Me(n),this.Ae.hasStart())throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===e&&(e=null,t=null),new h(this.repo,this.path,n,this.De)},h.prototype.endAt=function(e,t){void 0===e&&(e=null),c.validateArgCount("Query.endAt",0,2,arguments.length),y.validateFirebaseDataArg("Query.endAt",1,e,this.path,!0),y.validateKey("Query.endAt",2,t,!0);var n=this.Ae.endAt(e,t);if(h.Le(n),h.Me(n),this.Ae.hasEnd())throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new h(this.repo,this.path,n,this.De)},h.prototype.equalTo=function(n,e){if(c.validateArgCount("Query.equalTo",1,2,arguments.length),y.validateFirebaseDataArg("Query.equalTo",1,n,this.path,!1),y.validateKey("Query.equalTo",2,e,!0),this.Ae.hasStart())throw Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.Ae.hasEnd())throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(n,e).endAt(n,e)},h.prototype.toString=function(){return c.validateArgCount("Query.toString",0,0,arguments.length),""+this.repo+this.path.toUrlEncodedString()},h.prototype.toJSON=function(){return c.validateArgCount("Query.toJSON",0,1,arguments.length),""+this},h.prototype.queryObject=function(){return this.Ae.getQueryObject()},h.prototype.queryIdentifier=function(){var n=this.queryObject(),e=u.ObjectToUniqueKey(n);return"{}"===e?"default":e},h.prototype.isEqual=function(e){if(c.validateArgCount("Query.isEqual",1,1,arguments.length),!(e instanceof h))throw Error("Query.isEqual failed: First argument must be an instance of firebase.database.Query.");var t=this.repo===e.repo,n=this.path.equals(e.path),o=this.queryIdentifier()===e.queryIdentifier();return t&&n&&o},h.xe=function(o,e,a){var n={cancel:null,context:null};if(e&&a)n.cancel=e,c.validateCallback(o,3,n.cancel,!0),n.context=a,c.validateContextObject(o,4,n.context,!0);else if(e)if("object"==typeof e&&null!==e)n.context=e;else{if("function"!=typeof e)throw Error(c.errorPrefix(o,3,!0)+" must either be a cancel callback or a context object.");n.cancel=e}return n},Object.defineProperty(h.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),h}(),f;e.Query=h},function(r,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(0),o=t(1),a=t(0),s;e.setMaxNode=function(t){s=t},e.priorityHashText=function(t){return"number"==typeof t?"number:"+o.doubleToIEEE754String(t):"string:"+t},e.validatePriorityNode=function(o){if(o.isLeafNode()){var e=o.val();n.assert("string"==typeof e||"number"==typeof e||"object"==typeof e&&a.contains(e,".sv"),"Priority must be a string or number.")}else n.assert(o===s||o.isEmpty(),"priority of unexpected type.");n.assert(o===s||o.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")}},function(d,e,t){"use strict";var n=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(o,e){for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t])};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=t(15),i=t(5),o=t(1),a=t(11),s=function(r){function e(){return null!==r&&r.apply(this,arguments)||this}return n(e,r),e.prototype.compare=function(r,e){var t=r.node.compareTo(e.node);return 0===t?o.nameCompare(r.name,e.name):t},e.prototype.isDefinedOn=function(){return!0},e.prototype.indexedValueChanged=function(n,e){return!n.equals(e)},e.prototype.minPost=function(){return i.NamedNode.MIN},e.prototype.maxPost=function(){return i.NamedNode.MAX},e.prototype.makePost=function(o,e){var t=a.nodeFromJSON(o);return new i.NamedNode(e,t)},e.prototype.toString=function(){return".value"},e}(r.Index);e.ValueIndex=s,e.VALUE_INDEX=new s},function(d,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var m=t(0),i=t(40),o=t(0),a=t(5),n=t(3),s=t(10),g={},l=function(){function l(n,o){this.ke=n,this.We=o}return Object.defineProperty(l,"Default",{get:function(){return m.assert(n.PRIORITY_INDEX,"ChildrenNode.ts has not been loaded"),p=p||new l({".priority":g},{".priority":n.PRIORITY_INDEX})},enumerable:!0,configurable:!0}),l.prototype.get=function(n){var e=o.safeGet(this.ke,n);if(!e)throw Error("No index defined for "+n);return e===g?null:e},l.prototype.hasIndex=function(t){return o.contains(this.We,""+t)},l.prototype.addIndex=function(e,t){m.assert(e!==s.KEY_INDEX,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var n=[],r=!1,u=t.getIterator(a.NamedNode.Wrap),c=u.getNext();c;)r=r||e.isDefinedOn(c.node),n.push(c),c=u.getNext();var p=r?i.buildChildSet(n,e.getCompare()):g;var d=""+e,h=o.clone(this.We);h[d]=e;var f=o.clone(this.ke);return f[d]=p,new l(f,h)},l.prototype.addToIndexes=function(s,t){var n=this;return new l(o.map(this.ke,function(r,e){var u=o.safeGet(n.We,e);if(m.assert(u,"Missing index implementation for "+e),r===g){if(u.isDefinedOn(s.node)){for(var l=[],c=t.getIterator(a.NamedNode.Wrap),p=c.getNext();p;)p.name!=s.name&&l.push(p),p=c.getNext();return l.push(s),i.buildChildSet(l,u.getCompare())}return g}var d=t.get(s.name),h=r;return d&&(h=h.remove(new a.NamedNode(s.name,d))),h.insert(s,s.node)}),this.We)},l.prototype.removeFromIndexes=function(i,t){return new l(o.map(this.ke,function(n){if(n===g)return n;var e=t.get(i.name);return e?n.remove(new a.NamedNode(i.name,e)):n}),this.We)},l}(),p;e.IndexMap=l},function(o,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var d=t(17),r=t(17),i=function(){function t(n){this.count=function(t){return parseInt(Math.log(t)/0.6931471805599453,10)}(n+1),this.je=this.count-1;var o=function(t){return parseInt(Array(t+1).join("1"),2)}(this.count);this.Ve=n+1&o}return t.prototype.nextBitIsOne=function(){var t=!(this.Ve&1<=this.pn?(this.de("Secondary connection is healthy."),this.nn=!0,this.tn.markConnectionHealthy(),this.dn()):(this.de("sending ping on secondary."),this.tn.send({t:"c",d:{t:"p",d:{}}}))},t.prototype.dn=function(){this.tn.start(),this.de("sending client ack on secondary"),this.tn.send({t:"c",d:{t:"a",d:{}}}),this.de("Ending transmission on primary"),this.Yt.send({t:"c",d:{t:"n",d:{}}}),this.Zt=this.tn,this.tryCleanupConnection()},t.prototype.sn=function(o){var e=l.requireKey("t",o),t=l.requireKey("d",o);"c"==e?this.fn(t):"d"==e&&this.wt(t)},t.prototype.wt=function(t){this._n(),this.Ut(t)},t.prototype._n=function(){this.nn||0>=--this.zt&&(this.de("Primary connection is healthy."),this.nn=!0,this.Yt.markConnectionHealthy())},t.prototype.fn=function(o){var e=l.requireKey("t",o);if("d"in o){var t=o.d;if("h"===e)this.yn(t);else if("n"===e){this.de("recvd end transmission on primary"),this.en=this.tn;for(var n=0;ndocument.domain=\""+document.domain+"\";");var d=""+s+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(d),this.myIFrame.doc.close()}catch(t){m.log("frame writing exception"),t.stack&&m.log(t.stack),m.log(t)}}}return a.Dn=function(){var n=document.createElement("iframe");if(n.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(n);try{n.contentWindow.document||m.log("No IE domain setting required")}catch(t){var e=document.domain;n.src="javascript:void((function(){document.open();document.domain='"+e+"';document.close();})())"}return n.contentDocument?n.doc=n.contentDocument:n.contentWindow?n.doc=n.contentWindow.document:n.document&&(n.doc=n.document),n},a.prototype.close=function(){var e=this;if(this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout(function(){null!==e.myIFrame&&(document.body.removeChild(e.myIFrame),e.myIFrame=null)},0)),f.isNodeSdk()&&this.myID){var t={};t[p.FIREBASE_LONGPOLL_DISCONN_FRAME_PARAM]="t",t[p.FIREBASE_LONGPOLL_ID_PARAM]=this.myID,t[p.FIREBASE_LONGPOLL_PW_PARAM]=this.myPW;var n=this.urlFn(t);a.nodeRestRequest(n)}var r=this.onDisconnect;r&&(this.onDisconnect=null,r())},a.prototype.startLongPoll=function(n,e){for(this.myID=n,this.myPW=e,this.alive=!0;this.Mn(););},a.prototype.Mn=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.count()<(0=this.pendingSegs[0].d.length+30+n.length;)a=this.pendingSegs.shift(),n=n+"&"+p.FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM+r+"="+a.seg+"&"+p.FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET+r+"="+a.ts+"&"+p.FIREBASE_LONGPOLL_DATA_PARAM+r+"="+a.d,r++;return e+=n,this.Ln(e,this.currentSerial),!0}return!1},a.prototype.enqueueSegment=function(o,r,a){this.pendingSegs.push({seg:o,ts:r,d:a}),this.alive&&this.Mn()},a.prototype.Ln=function(o,e){var t=this;this.outstandingRequests.add(e,1);var n=function(){t.outstandingRequests.remove(e),t.Mn()},r=setTimeout(n,25000);this.addTag(o,function(){clearTimeout(r),n()})},a.prototype.addTag=function(o,r){var e=this;f.isNodeSdk()?this.doNodeLongPoll(o,r):setTimeout(function(){try{if(!e.sendNewPolls)return;var t=e.myIFrame.doc.createElement("script");t.type="text/javascript",t.async=!0,t.src=o,t.onload=t.onreadystatechange=function(){var n=t.readyState;n&&"loaded"!==n&&"complete"!==n||(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),r())},t.onerror=function(){m.log("Long-poll script failed to load: "+o),e.sendNewPolls=!1,e.close()},e.myIFrame.doc.body.appendChild(t)}catch(t){}},1)},a}();p.FirebaseIFrameScriptHolder=l},function(o,r,t){"use strict";(function(n){Object.defineProperty(r,"__esModule",{value:!0});var e=t(6),i=t(0),o=t(1),a=t(25),m=t(14),u=t(0),l=t(13),s=t(0),h=t(0),p=null;"undefined"==typeof MozWebSocket?"undefined"!=typeof WebSocket&&(p=WebSocket):p=MozWebSocket,r.setWebSocketImpl=function(t){p=t};var d=function(){function d(t,e,n,r){this.connId=t,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.de=o.logWrapper(this.connId),this.$=a.StatsManager.getCollection(e),this.connURL=d.Fn(e,n,r)}return d.Fn=function(o,e,t){var n={};return n[m.VERSION_PARAM]=m.PROTOCOL_VERSION,!h.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf(m.FORGE_DOMAIN)&&(n[m.REFERER_PARAM]=m.FORGE_REF),e&&(n[m.TRANSPORT_SESSION_PARAM]=e),t&&(n[m.LAST_SESSION_PARAM]=t),o.connectionURL(m.WEBSOCKET,n)},d.prototype.open=function(i,t){var d=this;this.onDisconnect=t,this.onMessage=i,this.de("Websocket connecting to "+this.connURL),this.bn=!1,l.PersistentStorage.set("previous_websocket_failure",!0);try{if(h.isNodeSdk()){var r=u.CONSTANTS.NODE_ADMIN?"AdminNode":"Node",o={headers:{"User-Agent":"Firebase/"+m.PROTOCOL_VERSION+"/"+e.default.SDK_VERSION+"/"+n.platform+"/"+r}},a=n.env,s=0==this.connURL.indexOf("wss://")?a.HTTPS_PROXY||a.https_proxy:a.HTTP_PROXY||a.http_proxy;s&&(o.proxy={origin:s}),this.mySock=new p(this.connURL,[],o)}else this.mySock=new p(this.connURL)}catch(t){this.de("Error instantiating WebSocket.");var g=t.message||t.data;return g&&this.de(g),void this.wn()}this.mySock.onopen=function(){d.de("Websocket connected."),d.bn=!0},this.mySock.onclose=function(){d.de("Websocket connection was disconnected."),d.mySock=null,d.wn()},this.mySock.onmessage=function(t){d.handleIncomingFrame(t)},this.mySock.onerror=function(n){d.de("WebSocket error. Closing connection.");var e=n.message||n.data;e&&d.de(e),d.wn()}},d.prototype.start=function(){},d.forceDisallow=function(){d.On=!0},d.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var o=/Android ([0-9]{0,}\.[0-9]{0,})/,n=navigator.userAgent.match(o);n&&1parseFloat(n[1])&&(t=!0)}return!t&&null!==p&&!d.On},d.previouslyFailed=function(){return l.PersistentStorage.isInMemoryStorage||!0===l.PersistentStorage.get("previous_websocket_failure")},d.prototype.markConnectionHealthy=function(){l.PersistentStorage.remove("previous_websocket_failure")},d.prototype.xn=function(o){if(this.frames.push(o),this.frames.length==this.totalFrames){var e=this.frames.join("");this.frames=null;var t=s.jsonEval(e);this.onMessage(t)}},d.prototype.kn=function(t){this.totalFrames=t,this.frames=[]},d.prototype.Wn=function(n){if(i.assert(null===this.frames,"We already have a frame buffer"),6>=n.length){var o=+n;if(!isNaN(o))return this.kn(o),null}return this.kn(1),n},d.prototype.handleIncomingFrame=function(o){if(null!==this.mySock){var e=o.data;if(this.bytesReceived+=e.length,this.$.incrementCounter("bytes_received",e.length),this.resetKeepAlive(),null!==this.frames)this.xn(e);else{var t=this.Wn(e);null!==t&&this.xn(t)}}},d.prototype.send=function(a){this.resetKeepAlive();var e=s.stringify(a);this.bytesSent+=e.length,this.$.incrementCounter("bytes_sent",e.length);var t=o.splitStringBySize(e,16384);1=this.me.compare(this.getStartPost(),t)&&0>=this.me.compare(t,this.getEndPost())},r.prototype.updateChild=function(a,e,t,n,r,i){return this.matches(new p.NamedNode(e,t))||(t=o.ChildrenNode.EMPTY_NODE),this.Vn.updateChild(a,e,t,n,r,i)},r.prototype.updateFullNode=function(a,e,t){e.isLeafNode()&&(e=o.ChildrenNode.EMPTY_NODE);var n=e.withIndex(this.me);n=n.updatePriority(o.ChildrenNode.EMPTY_NODE);var r=this;return e.forEachChild(l.PRIORITY_INDEX,function(a,e){r.matches(new p.NamedNode(a,e))||(n=n.updateImmediateChild(a,o.ChildrenNode.EMPTY_NODE))}),this.Vn.updateFullNode(a,n,t)},r.prototype.updatePriority=function(t){return t},r.prototype.filtersNodes=function(){return!0},r.prototype.getIndexedFilter=function(){return this.Vn},r.prototype.getIndex=function(){return this.me},r.qn=function(n){if(n.hasStart()){var e=n.getIndexStartName();return n.getIndex().makePost(n.getIndexStartValue(),e)}return n.getIndex().minPost()},r.Bn=function(n){if(n.hasEnd()){var e=n.getIndexEndName();return n.getIndex().makePost(n.getIndexEndValue(),e)}return n.getIndex().maxPost()},r}();e.RangedFilter=r},,,,,,,,,,,,,,,,,,,,,,function(o,e,t){o.exports=t(79)},function(m,e,t){"use strict";function n(e){var t=e.INTERNAL.registerService("database",function(o,e,t){return u.RepoManager.getInstance().databaseFromApp(o,t)},{Reference:a.Reference,Query:o.Query,Database:i.Database,enableLogging:s.enableLogging,INTERNAL:l,ServerValue:p,TEST_ACCESS:g},null,!0);y.isNodeSdk()&&(m.exports=t)}Object.defineProperty(e,"__esModule",{value:!0});var r=t(6),i=t(32);e.Database=i.Database;var o=t(36);e.Query=o.Query;var a=t(21);e.Reference=a.Reference;var s=t(1);e.enableLogging=s.enableLogging;var u=t(26),l=t(111),g=t(112),y=t(0),p=i.Database.ServerValue;e.ServerValue=p,e.registerDatabase=n,n(r.default);var b=t(22);e.DataSnapshot=b.DataSnapshot;var f=t(35);e.OnDisconnect=f.OnDisconnect},function(o,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(0),r=function(){function t(t){this.Hn=t,this.Gn="firebase:"}return t.prototype.set=function(o,e){null==e?this.Hn.removeItem(this.Kn(o)):this.Hn.setItem(this.Kn(o),n.stringify(e))},t.prototype.get=function(o){var e=this.Hn.getItem(this.Kn(o));return null==e?null:n.jsonEval(e)},t.prototype.remove=function(t){this.Hn.removeItem(this.Kn(t))},t.prototype.Kn=function(t){return this.Gn+t},t.prototype.toString=function(){return""+this.Hn},t}();e.DOMStorageWrapper=r},function(o,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(0),r=function(){function t(){this.Yn={},this.isInMemoryStorage=!0}return t.prototype.set=function(n,e){null==e?delete this.Yn[n]:this.Yn[n]=e},t.prototype.get=function(t){return n.contains(this.Yn,t)?this.Yn[t]:null},t.prototype.remove=function(t){delete this.Yn[t]},t}();e.MemoryStorage=r},function(o,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(0),r=function(){function t(n,o){this.committed=n,this.snapshot=o}return t.prototype.toJSON=function(){return n.validateArgCount("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}();e.TransactionResult=r},function(o,e,t){"use strict";var d=Math.floor;Object.defineProperty(e,"__esModule",{value:!0});var l=t(0);e.nextPushId=function(){var o="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",e=0,t=[];return function(n){var r=n===e;e=n;var i=Array(8),s;for(s=7;0<=s;s--)i[s]=o.charAt(n%64),n=d(n/64);l.assert(0===n,"Cannot push at time == 0");var a=i.join("");if(r){for(s=11;0<=s&&63===t[s];s--)t[s]=0;t[s]++}else for(s=0;12>s;s++)t[s]=d(64*Math.random());for(s=0;12>s;s++)a+=o.charAt(t[s]);return l.assert(20===a.length,"nextPushId: Length should be 20."),a}}()},function(d,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=t(22),r=t(85),p=t(0),i=t(0),n=function(){function n(o,r,t){this.Xn=o,this.zn=r,this.Jn=t}return n.prototype.respondsTo=function(t){return"value"===t},n.prototype.createEvent=function(o,e){var t=e.getQueryParams().getIndex();return new r.DataEvent("value",this,new l.DataSnapshot(o.snapshotNode,e.getRef(),t))},n.prototype.getEventRunner=function(o){var e=this.Jn;if("cancel"===o.getEventType()){i.assert(this.zn,"Raising a cancel event on a listener with no cancel callback");var t=this.zn;return function(){t.call(e,o.error)}}var n=this.Xn;return function(){n.call(e,o.snapshot)}},n.prototype.createCancelEvent=function(n,e){return this.zn?new r.CancelEvent(this,n,e):null},n.prototype.matches=function(e){return e instanceof n&&(!e.Xn||!this.Xn||e.Xn===this.Xn&&e.Jn===this.Jn)},n.prototype.hasAnyCallback=function(){return null!==this.Xn},n}();e.ValueEventRegistration=n;var o=function(){function o(o,r,t){this.$n=o,this.zn=r,this.Jn=t}return o.prototype.respondsTo=function(n){var e="children_added"===n?"child_added":n;return e="children_removed"==e?"child_removed":e,p.contains(this.$n,e)},o.prototype.createCancelEvent=function(n,e){return this.zn?new r.CancelEvent(this,n,e):null},o.prototype.createEvent=function(a,e){i.assert(null!=a.childName,"Child events should have a childName.");var t=e.getRef().child(a.childName),n=e.getQueryParams().getIndex();return new r.DataEvent(a.type,this,new l.DataSnapshot(a.snapshotNode,t,n),a.prevName)},o.prototype.getEventRunner=function(o){var e=this.Jn;if("cancel"===o.getEventType()){i.assert(this.zn,"Raising a cancel event on a listener with no cancel callback");var t=this.zn;return function(){t.call(e,o.error)}}var n=this.$n[o.eventType];return function(){n.call(e,o.snapshot,o.prevName)}},o.prototype.matches=function(a){if(a instanceof o){if(!this.$n||!a.$n)return!0;if(this.Jn===a.Jn){var e=p.getCount(a.$n);if(e===p.getCount(this.$n)){if(1===e){var t=p.getAnyKey(a.$n),n=p.getAnyKey(this.$n);return!(n!==t||a.$n[t]&&this.$n[n]&&a.$n[t]!==this.$n[n])}return p.every(this.$n,function(t,e){return a.$n[t]===e})}}}return!1},o.prototype.hasAnyCallback=function(){return null!==this.$n},o}();e.ChildEventRegistration=o},function(a,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(0),r=function(){function t(o,a,t,n){this.eventType=o,this.eventRegistration=a,this.snapshot=t,this.prevName=n}return t.prototype.getPath=function(){var t=this.snapshot.getRef();return"value"===this.eventType?t.path:t.getParent().path},t.prototype.getEventType=function(){return this.eventType},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.getPath()+":"+this.eventType+":"+n.stringify(this.snapshot.exportVal())},t}();e.DataEvent=r;var i=function(){function t(o,r,t){this.eventRegistration=o,this.error=r,this.path=t}return t.prototype.getPath=function(){return this.path},t.prototype.getEventType=function(){return"cancel"},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.path+":cancel"},t}();e.CancelEvent=i},function(m,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var g=t(0),b=t(1),i=t(87),r=t(4),o=t(0),v=t(23),n=t(88),u=t(89),h=t(8),c=t(46),x=t(2),a=t(47),s=t(95),d=function(){function m(t){this.Zn=t,this.er=v.ImmutableTree.Empty,this.tr=new s.WriteTree,this.nr={},this.rr={}}return m.prototype.applyUserOverwrite=function(o,e,t,n){return this.tr.addOverwrite(o,e,t,n),n?this.ir(new c.Overwrite(h.OperationSource.User,o,e)):[]},m.prototype.applyUserMerge=function(o,e,t){this.tr.addMerge(o,e,t);var n=v.ImmutableTree.fromObject(e);return this.ir(new u.Merge(h.OperationSource.User,o,n))},m.prototype.ackUserWrite=function(a,e){void 0===e&&(e=!1);var t=this.tr.getWrite(a);if(this.tr.removeWrite(a)){var n=v.ImmutableTree.Empty;return null==t.snap?o.forEach(t.children,function(o,e){n=n.set(new x.Path(o),e)}):n=n.set(x.Path.Empty,!0),this.ir(new i.AckUserWrite(t.path,n,e))}return[]},m.prototype.applyServerOverwrite=function(n,e){return this.ir(new c.Overwrite(h.OperationSource.Server,n,e))},m.prototype.applyServerMerge=function(o,e){var t=v.ImmutableTree.fromObject(e);return this.ir(new u.Merge(h.OperationSource.Server,o,t))},m.prototype.applyListenComplete=function(t){return this.ir(new n.ListenComplete(h.OperationSource.Server,t))},m.prototype.applyTaggedQueryOverwrite=function(e,t,n){var r=this.or(n);if(null!=r){var i=m.ar(r),o=i.path,a=i.queryId,s=x.Path.relativePath(o,e),d=new c.Overwrite(h.OperationSource.forServerTaggedQuery(a),s,t);return this.sr(o,d)}return[]},m.prototype.applyTaggedQueryMerge=function(e,t,n){var r=this.or(n);if(r){var i=m.ar(r),o=i.path,a=i.queryId,s=x.Path.relativePath(o,e),d=v.ImmutableTree.fromObject(t),l=new u.Merge(h.OperationSource.forServerTaggedQuery(a),s,d);return this.sr(o,l)}return[]},m.prototype.applyTaggedListenComplete=function(e,t){var d=this.or(t);if(d){var r=m.ar(d),i=r.path,o=r.queryId,a=x.Path.relativePath(i,e),s=new n.ListenComplete(h.OperationSource.forServerTaggedQuery(o),a);return this.sr(i,s)}return[]},m.prototype.addEventRegistration=function(e,t){var d=e.path,i=null,o=!1;this.er.foreachOnPath(d,function(r,e){var t=x.Path.relativePath(r,d);i=i||e.getCompleteServerCache(t),o=o||e.hasCompleteView()});var n=this.er.get(d);n?(o=o||n.hasCompleteView(),i=i||n.getCompleteServerCache(x.Path.Empty)):(n=new a.SyncPoint,this.er=this.er.set(d,n));var u;null==i?(u=!1,i=r.ChildrenNode.EMPTY_NODE,this.er.subtree(d).foreachChild(function(o,e){var t=e.getCompleteServerCache(x.Path.Empty);t&&(i=i.updateImmediateChild(o,t))})):u=!0;var l=n.viewExistsForQuery(e);if(!l&&!e.getQueryParams().loadsAllData()){var f=m.ur(e);g.assert(!(f in this.rr),"View does not exist, but we have a tag");var c=m.lr();this.rr[f]=c,this.nr["_"+c]=f}var p=this.tr.childWrites(d),b=n.addEventRegistration(e,t,p,i,u);if(!l&&!o){var y=n.viewForQuery(e);b=b.concat(this.hr(e,y))}return b},m.prototype.removeEventRegistration=function(e,t,n){var r=this,i=e.path,o=this.er.get(i),a=[];if(o&&("default"===e.queryIdentifier()||o.viewExistsForQuery(e))){var s=o.removeEventRegistration(e,t,n);o.isEmpty()&&(this.er=this.er.remove(i));var u=s.removed;a=s.events;var l=-1!==u.findIndex(function(t){return t.getQueryParams().loadsAllData()}),h=this.er.findOnPath(i,function(n,e){return e.hasCompleteView()});if(l&&!h){var g=this.er.subtree(i);if(!g.isEmpty())for(var p=this.cr(g),d=0;dthis.Gr,"Stacking an older write on top of newer ones"),void 0===s&&(s=!0),this.Hr.push({path:o,snap:a,writeId:i,visible:s}),s&&(this.Br=this.Br.addWrite(o,a)),this.Gr=i},d.prototype.addMerge=function(o,r,a){m.assert(a>this.Gr,"Stacking an older merge on top of newer ones"),this.Hr.push({path:o,children:r,writeId:a,visible:!0}),this.Br=this.Br.addWrites(o,r),this.Gr=a},d.prototype.getWrite=function(o){for(var e=0,t;e=e&&this.Kr(d,t.path)?o=!1:t.path.contains(d.path)&&(a=!0)),s--;if(o){if(a)return this.Yr(),!0;if(t.snap)this.Br=this.Br.removeWrite(t.path);else{var l=t.children;n.forEach(l,function(n){i.Br=i.Br.removeWrite(t.path.child(n))})}return!0}return!1},d.prototype.getCompleteWriteData=function(t){return this.Br.getCompleteNode(t)},d.prototype.calcCompleteEventCache=function(o,e,t,n){if(t||n){var u=this.Br.childCompoundWrite(o);if(!n&&u.isEmpty())return e;if(n||null!=e||u.hasCompleteWrite(g.Path.Empty)){var a=function(a){return(a.visible||n)&&(!t||!~t.indexOf(a.writeId))&&(a.path.contains(o)||o.contains(a.path))},s=d.Xr(this.Hr,a,o),l=e||c.ChildrenNode.EMPTY_NODE;return s.apply(l)}return null}var h=this.Br.getCompleteNode(o);if(null!=h)return h;var m=this.Br.childCompoundWrite(o);if(m.isEmpty())return e;if(null!=e||m.hasCompleteWrite(g.Path.Empty)){var l=e||c.ChildrenNode.EMPTY_NODE;return m.apply(l)}return null},d.prototype.calcCompleteEventChildren=function(o,e){var s=c.ChildrenNode.EMPTY_NODE,t=this.Br.getCompleteNode(o);if(t)return t.isLeafNode()||t.forEachChild(a.PRIORITY_INDEX,function(n,e){s=s.updateImmediateChild(n,e)}),s;if(e){var n=this.Br.childCompoundWrite(o);return e.forEachChild(a.PRIORITY_INDEX,function(o,e){var t=n.childCompoundWrite(new g.Path(o)).apply(e);s=s.updateImmediateChild(o,t)}),n.getCompleteChildren().forEach(function(t){s=s.updateImmediateChild(t.name,t.node)}),s}return this.Br.childCompoundWrite(o).getCompleteChildren().forEach(function(t){s=s.updateImmediateChild(t.name,t.node)}),s},d.prototype.calcEventCacheAfterServerOverwrite=function(i,e,t,n){m.assert(t||n,"Either existingEventSnap or existingServerSnap must exist");var r=i.child(e);if(this.Br.hasCompleteWrite(r))return null;var o=this.Br.childCompoundWrite(r);return o.isEmpty()?n.getChild(e):o.apply(n.getChild(e))},d.prototype.calcCompleteChild=function(o,e,t){var n=o.child(e),r=this.Br.getCompleteNode(n);return null==r?t.isCompleteForChild(e)?this.Br.childCompoundWrite(n).apply(t.getNode().getImmediateChild(e)):null:r},d.prototype.shadowingWrite=function(t){return this.Br.getCompleteNode(t)},d.prototype.calcIndexedSlice=function(o,e,t,n,r,i){var a=this.Br.childCompoundWrite(o),u=a.getCompleteNode(g.Path.Empty),l;if(null!=u)l=u;else{if(null==e)return[];l=a.apply(e)}if(l=l.withIndex(i),l.isEmpty()||l.isLeafNode())return[];for(var s=[],h=i.getCompare(),c=r?l.getReverseIteratorFrom(t,i):l.getIteratorFrom(t,i),p=c.getNext();p&&s.lengthl.status){try{r=o.jsonEval(l.responseText)}catch(t){p.warn("Failed to parse JSON response for "+s+": "+l.responseText)}t(null,r)}else 401!==l.status&&404!==l.status&&p.warn("Got unsuccessful REST response for "+s+" Status: "+l.status),t(l.status);t=null}},l.open("GET",s,!0),l.send()})},d}(i.ServerActions);e.ReadonlyRestClient=s},function(m,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var g=t(0),n=t(1),r=t(10),o=t(3),a=t(38),s=t(42),i=t(24),l=t(108),u=t(56),c=t(0),p=function(){function d(){this.fi=!1,this._i=!1,this.yi=!1,this.vi=!1,this.gi=!1,this.mi=0,this.Ci="",this.Ei=null,this.Ni="",this.Pi=null,this.bi="",this.me=o.PRIORITY_INDEX}return d.prototype.hasStart=function(){return this._i},d.prototype.isViewFromLeft=function(){return""===this.Ci?this._i:this.Ci===d.Si.VIEW_FROM_LEFT},d.prototype.getIndexStartValue=function(){return g.assert(this._i,"Only valid if start has been set"),this.Ei},d.prototype.getIndexStartName=function(){return g.assert(this._i,"Only valid if start has been set"),this.yi?this.Ni:n.MIN_NAME},d.prototype.hasEnd=function(){return this.vi},d.prototype.getIndexEndValue=function(){return g.assert(this.vi,"Only valid if end has been set"),this.Pi},d.prototype.getIndexEndName=function(){return g.assert(this.vi,"Only valid if end has been set"),this.gi?this.bi:n.MAX_NAME},d.prototype.hasLimit=function(){return this.fi},d.prototype.hasAnchoredLimit=function(){return this.fi&&""!==this.Ci},d.prototype.getLimit=function(){return g.assert(this.fi,"Only valid if limit has been set"),this.mi},d.prototype.getIndex=function(){return this.me},d.prototype.Ti=function(){var e=new d;return e.fi=this.fi,e.mi=this.mi,e._i=this._i,e.Ei=this.Ei,e.yi=this.yi,e.Ni=this.Ni,e.vi=this.vi,e.Pi=this.Pi,e.gi=this.gi,e.bi=this.bi,e.me=this.me,e.Ci=this.Ci,e},d.prototype.limit=function(n){var e=this.Ti();return e.fi=!0,e.mi=n,e.Ci="",e},d.prototype.limitToFirst=function(e){var t=this.Ti();return t.fi=!0,t.mi=e,t.Ci=d.Si.VIEW_FROM_LEFT,t},d.prototype.limitToLast=function(e){var t=this.Ti();return t.fi=!0,t.mi=e,t.Ci=d.Si.VIEW_FROM_RIGHT,t},d.prototype.startAt=function(o,e){var t=this.Ti();return t._i=!0,void 0===o&&(o=null),t.Ei=o,null==e?(t.yi=!1,t.Ni=""):(t.yi=!0,t.Ni=e),t},d.prototype.endAt=function(o,e){var t=this.Ti();return t.vi=!0,void 0===o&&(o=null),t.Pi=o,void 0===e?(t.gi=!1,t.bi=""):(t.gi=!0,t.bi=e),t},d.prototype.orderBy=function(n){var e=this.Ti();return e.me=n,e},d.prototype.getQueryObject=function(){var e=d.Si,t={};if(this._i&&(t[e.INDEX_START_VALUE]=this.Ei,this.yi&&(t[e.INDEX_START_NAME]=this.Ni)),this.vi&&(t[e.INDEX_END_VALUE]=this.Pi,this.gi&&(t[e.INDEX_END_NAME]=this.bi)),this.fi){t[e.LIMIT]=this.mi;var n=this.Ci;""===n&&(n=this.isViewFromLeft()?e.VIEW_FROM_LEFT:e.VIEW_FROM_RIGHT),t[e.VIEW_FROM]=n}return this.me!==o.PRIORITY_INDEX&&(t[e.INDEX]=""+this.me),t},d.prototype.loadsAllData=function(){return!(this._i||this.vi||this.fi)},d.prototype.isDefault=function(){return this.loadsAllData()&&this.me==o.PRIORITY_INDEX},d.prototype.getNodeFilter=function(){return this.loadsAllData()?new i.IndexedFilter(this.getIndex()):this.hasLimit()?new l.LimitedFilter(this):new u.RangedFilter(this)},d.prototype.toRestQueryStringParameters=function(){var e=d.wi,t={};if(this.isDefault())return t;var n;return this.me===o.PRIORITY_INDEX?n=e.PRIORITY_INDEX:this.me===a.VALUE_INDEX?n=e.VALUE_INDEX:this.me===r.KEY_INDEX?n=e.KEY_INDEX:(g.assert(this.me instanceof s.PathIndex,"Unrecognized index type!"),n=""+this.me),t[e.ORDER_BY]=c.stringify(n),this._i&&(t[e.START_AT]=c.stringify(this.Ei),this.yi&&(t[e.START_AT]+=","+c.stringify(this.Ni))),this.vi&&(t[e.END_AT]=c.stringify(this.Pi),this.gi&&(t[e.END_AT]+=","+c.stringify(this.bi))),this.fi&&(this.isViewFromLeft()?t[e.LIMIT_TO_FIRST]=this.mi:t[e.LIMIT_TO_LAST]=this.mi),t},d.Si={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},d.wi={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},d.DEFAULT=new d,d}();e.QueryParams=p},function(d,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=t(56),m=t(4),i=t(5),o=t(0),a=t(9),r=function(){function t(t){this.Ii=new n.RangedFilter(t),this.me=t.getIndex(),this.mi=t.getLimit(),this.Ri=!t.isViewFromLeft()}return t.prototype.updateChild=function(o,e,t,n,r,a){return this.Ii.matches(new i.NamedNode(e,t))||(t=m.ChildrenNode.EMPTY_NODE),o.getImmediateChild(e).equals(t)?o:o.numChildren()=this.me.compare(this.Ii.getStartPost(),a):0>=this.me.compare(a,this.Ii.getEndPost())))break;n=n.updateImmediateChild(a.name,a.node),o++}}else{n=e.withIndex(this.me),n=n.updatePriority(m.ChildrenNode.EMPTY_NODE);var r=void 0,u,l,h;if(this.Ri){r=n.getReverseIterator(this.me),u=this.Ii.getEndPost(),l=this.Ii.getStartPost();var c=this.me.getCompare();h=function(n,e){return c(e,n)}}else r=n.getIterator(this.me),u=this.Ii.getStartPost(),l=this.Ii.getEndPost(),h=this.me.getCompare();for(var o=0,p=!1,a;r.hasNext();){a=r.getNext(),!p&&0>=h(u,a)&&(p=!0);var s=p&&o=h(a,l);s?o++:n=n.updateImmediateChild(a.name,m.ChildrenNode.EMPTY_NODE)}}return this.Ii.getIndexedFilter().updateFullNode(i,n,t)},t.prototype.updatePriority=function(t){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.Ii.getIndexedFilter()},t.prototype.getIndex=function(){return this.me},t.prototype.Oi=function(s,e,t,n,r){var u;if(this.Ri){var l=this.me.getCompare();u=function(n,e){return l(e,n)}}else u=this.me.getCompare();var h=s;o.assert(h.numChildren()==this.mi,"");var c=new i.NamedNode(e,t),p=this.Ri?h.getFirstChild(this.me):h.getLastChild(this.me),d=this.Ii.matches(c);if(h.hasChild(e)){for(var f=h.getImmediateChild(e),b=n.getChildAfterChild(this.me,p,this.Ri);null!=b&&(b.name==e||h.hasChild(b.name));)b=n.getChildAfterChild(this.me,b,this.Ri);var y=null==b?1:u(b,c);if(d&&!t.isEmpty()&&0<=y)return null!=r&&r.trackChildChange(a.Change.childChangedChange(e,t,f)),h.updateImmediateChild(e,t);null!=r&&r.trackChildChange(a.Change.childRemovedChange(e,f));var v=h.updateImmediateChild(e,m.ChildrenNode.EMPTY_NODE);return null!=b&&this.Ii.matches(b)?(null!=r&&r.trackChildChange(a.Change.childAddedChange(b.name,b.node)),v.updateImmediateChild(b.name,b.node)):v}return t.isEmpty()?s:d&&0<=u(p,c)?(null!=r&&(r.trackChildChange(a.Change.childRemovedChange(p.name,p.node)),r.trackChildChange(a.Change.childAddedChange(e,t))),h.updateImmediateChild(e,t).updateImmediateChild(p.name,m.ChildrenNode.EMPTY_NODE)):s},t}();e.LimitedFilter=r},function(m,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var x=t(0),i=t(21),o=t(22),a=t(2),n=t(110),s=t(3),l=t(1),h=t(43),c=t(7),p=t(0),d=t(11),u=t(4),f=t(18),k;!function(t){t[t.RUN=0]="RUN",t[t.SENT=1]="SENT",t[t.COMPLETED=2]="COMPLETED",t[t.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",t[t.NEEDS_ABORT=4]="NEEDS_ABORT"}(k=e.TransactionStatus||(e.TransactionStatus={})),f.Repo.Ai=25,f.Repo.prototype.ie=function(){this.Di=new n.Tree},f.Repo.prototype.startTransaction=function(r,a,f,v){this.de("transaction on "+r);var A=function(){},L=new i.Reference(this,r);L.on("value",A);var y={path:r,update:a,onComplete:f,status:null,order:l.LUIDGenerator(),applyLocally:v,retryCount:0,unwatcher:function(){L.off("value",A)},abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},g=this.Mi(r);y.currentInputSnapshot=g;var m=y.update(g.val());if(!(void 0===m)){c.validateFirebaseData("transaction failed: Data returned ",m,y.path),y.status=k.RUN;var R=this.Di.subTree(r),N=R.getValue()||[];N.push(y),R.setValue(N);var O;"object"==typeof m&&null!==m&&p.contains(m,".priority")?(O=p.safeGet(m,".priority"),x.assert(c.isValidPriority(O),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):O=(this.ue.calcCompleteEventCache(r)||u.ChildrenNode.EMPTY_NODE).getPriority().val(),O=O;var b=this.generateServerValues(),S=d.nodeFromJSON(m,O),T=h.resolveDeferredValueSnapshot(S,b);y.currentOutputSnapshotRaw=S,y.currentOutputSnapshotResolved=T,y.currentWriteId=this.pe();var w=this.ue.applyUserOverwrite(r,T,y.currentWriteId,y.applyLocally);this.K.raiseEventsForChangedPath(r,w),this.Li()}else if(y.unwatcher(),y.currentOutputSnapshotRaw=null,y.currentOutputSnapshotResolved=null,y.onComplete){var I=new o.DataSnapshot(y.currentInputSnapshot,new i.Reference(this,y.path),s.PRIORITY_INDEX);y.onComplete(null,!1,I)}},f.Repo.prototype.Mi=function(n,e){return this.ue.calcCompleteEventCache(n,e)||u.ChildrenNode.EMPTY_NODE},f.Repo.prototype.Li=function(o){var r=this;if(void 0===o&&(o=this.Di),o||this.Fi(o),null!==o.getValue()){var e=this.xi(o);x.assert(0=f.Repo.Ai)C=!0,E="maxretry",n=n.concat(this.ue.ackUserWrite(g.currentWriteId,!0));else{var N=this.Mi(g.path,y);g.currentInputSnapshot=N;var L=r[v].update(N.val());if(void 0!==L){c.validateFirebaseData("transaction failed: Data returned ",L,g.path);var P=d.nodeFromJSON(L),S="object"==typeof L&&null!=L&&p.contains(L,".priority");S||(P=P.updatePriority(N.getPriority()));var T=g.currentWriteId,w=this.generateServerValues(),I=h.resolveDeferredValueSnapshot(P,w);g.currentOutputSnapshotRaw=P,g.currentOutputSnapshotResolved=I,g.currentWriteId=this.pe(),y.splice(y.indexOf(T),1),n=n.concat(this.ue.applyUserOverwrite(g.path,I,g.currentWriteId,g.applyLocally)),n=n.concat(this.ue.ackUserWrite(T,!0))}else C=!0,E="nodata",n=n.concat(this.ue.ackUserWrite(g.currentWriteId,!0))}if(this.K.raiseEventsForChangedPath(e,n),n=[],C&&(r[v].status=k.COMPLETED,function(t){setTimeout(t,0)}(r[v].unwatcher),r[v].onComplete))if("nodata"===E){var R=new i.Reference(this,r[v].path),O=r[v].currentInputSnapshot,A=new o.DataSnapshot(O,R,s.PRIORITY_INDEX);t.push(r[v].onComplete.bind(null,null,!1,A))}else t.push(r[v].onComplete.bind(null,Error(E),!1,null))}this.Fi(this.Di);for(var v=0;v=n)t.push(n);else if(2047>=n)t.push(192|n>>6,128|63&n);else if(55296==(64512&n)){var r=e>18,128|63&n>>12,128|63&n>>6,128|63&n)}else t.push(239,191,189)}else 56320==(64512&n)?t.push(239,191,189):t.push(224|n>>12,128|63&n>>6,128|63&n);return new Uint8Array(t)}function w(n){var t;try{t=decodeURIComponent(n)}catch(e){throw g(ee.DATA_URL,"Malformed data URL.")}return E(t)}function T(d,t){switch(d){case ee.BASE64:var e=-1!==t.indexOf("-"),n=-1!==t.indexOf("_");if(e||n){var r=e?"-":"_";throw g(d,"Invalid character '"+r+"' found: is it base64url encoded?")}break;case ee.BASE64URL:var o=-1!==t.indexOf("+"),i=-1!==t.indexOf("/");if(o||i){var r=o?"+":"/";throw g(d,"Invalid character '"+r+"' found: is it base64 encoded?")}t=t.replace(/-/g,"+").replace(/_/g,"/");}var a;try{a=atob(t)}catch(t){throw g(d,"Invalid character found")}for(var s=new Uint8Array(a.length),l=0;l=t.length)&&n.substring(n.length-t.length)===t}function C(e){switch(e){case It.RUNNING:case It.PAUSING:case It.CANCELING:return ae.RUNNING;case It.PAUSED:return ae.PAUSED;case It.SUCCESS:return ae.SUCCESS;case It.CANCELED:return ae.CANCELED;case It.ERROR:default:return ae.ERROR;}}function S(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function k(o,t){for(var e in o)S(o,e)&&t(e,o[e])}function I(n){if(null==n)return{};var o={};return k(n,function(e,t){o[e]=t}),o}function L(e){return new Promise(e)}function O(e){return Promise.resolve(e)}function x(e){return Promise.reject(e)}function P(e){return null!=e}function _(e){return void 0!==e}function D(e){return"function"==typeof e}function M(e){return"object"==typeof e}function B(e){return M(e)&&null!==e}function U(e){return M(e)&&!Array.isArray(e)}function W(e){return"string"==typeof e||e instanceof String}function F(e){return"number"==typeof e||e instanceof Number}function H(e){return j()&&e instanceof Blob}function j(){return"undefined"!=typeof Blob}function q(n){var t;try{t=JSON.parse(n)}catch(e){return null}return U(t)?t:null}function V(n){if(0==n.length)return null;var t=n.lastIndexOf("/");return-1===t?"":n.slice(0,t)}function z(o,t){var e=t.split("/").filter(function(e){return 0e.length?e:(e=e,K(e))}function Z(){function a(n,o){return $(o)}function t(n,t){return P(t)?+t:t}function e(a,t){if(!(W(t)&&0t;t++)n+=(""+Math.random()).slice(2);return n}();i["Content-Type"]="multipart/related; boundary="+a;var s=it(t,n,r),u=De(s,e),c="--"+a+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+u+"\r\n--"+a+"\r\nContent-Type: "+s.contentType+"\r\n\r\n",l=fe.getBlob(c,n,"\r\n--"+a+"--");if(null===l)throw ke();var p={name:s.fullPath},d=Q(o),m=h.maxUploadRetryTime(),g=new de(d,"POST",Ze(h,e),m);return g.urlParams=p,g.headers=i,g.body=l.uploadData(),g.errorHandler=et(t),g}function dt(o,t){var e;try{e=o.getResponseHeader("X-Goog-Upload-Status")}catch(e){$e(!1)}return $e(Qe(t||["active"],e)),e}function lt(i,t,e,n,r){var o=t.bucketOnlyServerUrl(),a=it(t,n,r),s={name:a.fullPath},d=Q(o),c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":n.size(),"X-Goog-Upload-Header-Content-Type":a.contentType,"Content-Type":"application/json; charset=utf-8"},l=De(a,e),u=i.maxUploadRetryTime(),p=new de(d,"POST",function(e){dt(e);var t;try{t=e.getResponseHeader("X-Goog-Upload-URL")}catch(e){$e(!1)}return $e(W(t)),t},u);return p.urlParams=s,p.headers=c,p.body=l,p.errorHandler=et(t),p}function pt(i,t,e,d){function n(e){var t=dt(e,["active","final"]),r;try{r=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(e){$e(!1)}var n=parseInt(r,10);return $e(!isNaN(n)),new _e(n,d.size(),"final"===t)}var o=i.maxUploadRetryTime(),r=new de(e,"POST",n,o);return r.headers={"X-Goog-Upload-Command":"query"},r.errorHandler=et(t),r}function ct(d,x,e,C,t,r,n,o){function a(e,t){var n=dt(e,["active","final"]),a=i.current+l,s=C.size(),d;return d="final"===n?Ze(x,r)(e,t):null,new _e(a,s,"final"===n,d)}var i=new _e(0,0);if(n?(i.current=n.current,i.total=n.total):(i.current=0,i.total=C.size()),C.size()!==i.total)throw f();var s=i.total-i.current,l=s;0s&&(s*=2);var d;1===l?(l=2,d=0):d=1e3*(s+Math.random()),o(d)}}function a(e){m||(m=!0,h||(null===u?e||(l=1):(e||(l=2),clearTimeout(u),o(0))))}var s=1,u=null,c=!1,l=0,h=!1,m=!1;return o(0),setTimeout(function(){c=!0,a(!0)},e),a}function mt(e){e(!1)}function gt(n,t){null!==t&&0][;base64],");var e=r[1]||null;null!=e&&(this.base64=R(e,";base64"),this.contentType=this.base64?e.substring(0,e.length-7):e),this.rest=o.substring(o.indexOf(",")+1)}return e}(),oe={STATE_CHANGED:"state_changed"},It={RUNNING:"running",PAUSING:"pausing",PAUSED:"paused",SUCCESS:"success",CANCELING:"canceling",CANCELED:"canceled",ERROR:"error"},ae={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"},Nt;!function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"}(Nt||(Nt={}));var At=function(){function e(){var n=this;this.o=!1,this.i=new XMLHttpRequest,this.a=Nt.NO_ERROR,this.s=L(function(t){n.i.addEventListener("abort",function(){n.a=Nt.ABORT,t(n)}),n.i.addEventListener("error",function(){n.a=Nt.NETWORK_ERROR,t(n)}),n.i.addEventListener("load",function(){t(n)})})}return e.prototype.send=function(a,t,e,n){var r=this;if(this.o)throw y("cannot .send() more than once");return this.o=!0,this.i.open(t,a,!0),P(n)&&k(n,function(n,t){r.i.setRequestHeader(n,""+t)}),P(e)?this.i.send(e):this.i.send(),this.s},e.prototype.getErrorCode=function(){if(!this.o)throw y("cannot .getErrorCode() before sending");return this.a},e.prototype.getStatus=function(){if(!this.o)throw y("cannot .getStatus() before sending");try{return this.i.status}catch(e){return-1}},e.prototype.getResponseText=function(){if(!this.o)throw y("cannot .getResponseText() before sending");return this.i.responseText},e.prototype.abort=function(){this.i.abort()},e.prototype.getResponseHeader=function(e){return this.i.getResponseHeader(e)},e.prototype.addUploadProgressListener=function(e){P(this.i.upload)&&this.i.upload.addEventListener("progress",e)},e.prototype.removeUploadProgressListener=function(e){P(this.i.upload)&&this.i.upload.removeEventListener("progress",e)},e}(),ue=function(){function e(){}return e.prototype.createXhrIo=function(){return new At},e}(),ce=function(){function r(n,o){this.bucket=n,this.u=o}return Object.defineProperty(r.prototype,"path",{get:function(){return this.u},enumerable:!0,configurable:!0}),r.prototype.fullServerUrl=function(){var e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)},r.prototype.bucketOnlyServerUrl=function(){return"/b/"+encodeURIComponent(this.bucket)+"/o"},r.makeFromBucketSpec=function(t){var e;try{e=r.makeFromUrl(t)}catch(e){return new r(t,"")}if(""===e.path)return e;throw l(t)},r.makeFromUrl=function(t){function e(e){"/"===e.path.charAt(e.path.length-1)&&(e.u=e.u.slice(0,-1))}function h(e){e.u=decodeURIComponent(e.path)}for(var m=null,o=/^gs:\/\/([A-Za-z0-9.\-]+)(\/(.*))?$/i,g={bucket:1,path:3},y=/^https?:\/\/firebasestorage\.googleapis\.com\/v[A-Za-z0-9_]+\/b\/([A-Za-z0-9.\-]+)\/o(\/([^?#]*).*)?$/i,b={bucket:1,path:3},v=[{regex:o,indices:g,postModify:e},{regex:y,indices:b,postModify:h}],c=0;c262144*this.g&&(this.g*=2)},e.prototype.q=function(){var o=this;this.z(function(t){var e=nt(o.U,o.T,o.O),n=o.U.makeRequest(e,t);o.m=n,n.getPromise().then(function(t){o.m=null,o.N=t,o.P(It.SUCCESS)},o.x)})},e.prototype.H=function(){var o=this;this.z(function(t){var e=st(o.U,o.T,o.O,o.A,o.N),n=o.U.makeRequest(e,t);o.m=n,n.getPromise().then(function(t){o.m=null,o.N=t,o.B(o.A.size()),o.P(It.SUCCESS)},o.I)})},e.prototype.B=function(n){var t=this.p;this.p=n,this.p!==t&&this.V()},e.prototype.P=function(n){if(this.k!==n)switch(n){case It.CANCELING:case It.PAUSING:this.k=n,null!==this.m&&this.m.cancel();break;case It.RUNNING:var t=this.k===It.PAUSED;this.k=n,t&&(this.V(),this.M());break;case It.PAUSED:this.k=n,this.V();break;case It.CANCELED:this.v=c(),this.k=n,this.V();break;case It.ERROR:case It.SUCCESS:this.k=n,this.V();}},e.prototype.L=function(){switch(this.k){case It.PAUSING:this.P(It.PAUSED);break;case It.CANCELING:this.P(It.CANCELED);break;case It.RUNNING:this.M();}},Object.defineProperty(e.prototype,"snapshot",{get:function(){var e=C(this.k);return new be(this.p,this.A.size(),e,this.N,this,this.w)},enumerable:!0,configurable:!0}),e.prototype.on=function(o,t,e,s){function n(e){try{return void i(e)}catch(e){}try{if(d(e),!(_(e.next)||_(e.error)||_(e.complete)))throw""}catch(e){throw a}}function r(o){function t(t,r){null!==o&&Fe("on",o,arguments);var n=new ve(t,r,s);return l.K(n),function(){l.Z(n)}}return t}void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===s&&(s=void 0);var a="Expected a function or an Object with one of `next`, `error`, `complete` properties.",i=ze(!0).validator,d=qe(null,!0).validator;Fe("on",[Ve(function(){if(o!==oe.STATE_CHANGED)throw"Expected one of the event types: ["+oe.STATE_CHANGED+"]."}),qe(n,!0),ze(!0),ze(!0)],arguments);var l=this,c=[qe(function(e){if(null===e)throw a;n(e)}),ze(!0),ze(!0)];return _(t)||_(e)||_(s)?r(null)(t,e,s):r(c)},e.prototype.then=function(n,t){return this.D.then(n,t)},e.prototype.catch=function(e){return this.then(null,e)},e.prototype.K=function(e){this._.push(e),this.J(e)},e.prototype.Z=function(e){Je(this._,e)},e.prototype.V=function(){var n=this;this.Q(),Ye(this._).forEach(function(t){n.J(t)})},e.prototype.Q=function(){if(null!==this.y){var e=!0;switch(C(this.k)){case ae.SUCCESS:ut(this.y.bind(null,this.snapshot))();break;case ae.CANCELED:case ae.ERROR:ut(this.R.bind(null,this.v))();break;default:e=!1;}e&&(this.y=null,this.R=null)}},e.prototype.J=function(e){switch(C(this.k)){case ae.RUNNING:case ae.PAUSED:null!==e.next&&ut(e.next.bind(e,this.snapshot))();break;case ae.SUCCESS:null!==e.complete&&ut(e.complete.bind(e))();break;case ae.CANCELED:case ae.ERROR:null!==e.error&&ut(e.error.bind(e,this.v))();break;default:null!==e.error&&ut(e.error.bind(e,this.v))();}},e.prototype.resume=function(){Fe("resume",[],arguments);var e=this.k===It.PAUSED||this.k===It.PAUSING;return e&&this.P(It.RUNNING),e},e.prototype.pause=function(){Fe("pause",[],arguments);var e=this.k===It.RUNNING;return e&&this.P(It.PAUSING),e},e.prototype.cancel=function(){Fe("cancel",[],arguments);var e=this.k===It.RUNNING||this.k===It.PAUSING;return e&&this.P(It.CANCELING),e},e}(),ge=function(){function o(n,o){this.authWrapper=n,this.location=o instanceof ce?o:ce.makeFromUrl(o)}return o.prototype.toString=function(){return Fe("toString",[],arguments),"gs://"+this.location.bucket+"/"+this.location.path},o.prototype.newRef=function(t,e){return new o(t,e)},o.prototype.mappings=function(){return Z()},o.prototype.child=function(o){Fe("child",[Ve()],arguments);var t=z(this.location.path,o),e=new ce(this.location.bucket,t);return this.newRef(this.authWrapper,e)},Object.defineProperty(o.prototype,"parent",{get:function(){var n=V(this.location.path);if(null===n)return null;var t=new ce(this.location.bucket,n);return this.newRef(this.authWrapper,t)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"root",{get:function(){var e=new ce(this.location.bucket,"");return this.newRef(this.authWrapper,e)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"bucket",{get:function(){return this.location.bucket},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"fullPath",{get:function(){return this.location.path},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"name",{get:function(){return K(this.location.path)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"storage",{get:function(){return this.authWrapper.service()},enumerable:!0,configurable:!0}),o.prototype.put=function(n,t){return void 0===t&&(t=null),Fe("put",[We(),He(!0)],arguments),this.Y("put"),new me(this,this.authWrapper,this.location,this.mappings(),new fe(n),t)},o.prototype.putString=function(a,t,e){void 0===t&&(t=ee.RAW),Fe("putString",[Ve(),Ve(b,!0),He(!0)],arguments),this.Y("putString");var n=v(t,a),r=I(e);return!P(r.contentType)&&P(n.contentType)&&(r.contentType=n.contentType),new me(this,this.authWrapper,this.location,this.mappings(),new fe(n.data,!0),r)},o.prototype.delete=function(){Fe("delete",[],arguments),this.Y("delete");var o=this;return this.authWrapper.getAuthToken().then(function(t){var e=rt(o.authWrapper,o.location);return o.authWrapper.makeRequest(e,t).getPromise()})},o.prototype.getMetadata=function(){Fe("getMetadata",[],arguments),this.Y("getMetadata");var o=this;return this.authWrapper.getAuthToken().then(function(t){var e=nt(o.authWrapper,o.location,o.mappings());return o.authWrapper.makeRequest(e,t).getPromise()})},o.prototype.updateMetadata=function(o){Fe("updateMetadata",[He()],arguments),this.Y("updateMetadata");var t=this;return this.authWrapper.getAuthToken().then(function(e){var n=ot(t.authWrapper,t.location,o,t.mappings());return t.authWrapper.makeRequest(n,e).getPromise()})},o.prototype.getDownloadURL=function(){return Fe("getDownloadURL",[],arguments),this.Y("getDownloadURL"),this.getMetadata().then(function(n){var t=n.downloadURLs[0];if(P(t))return t;throw d()})},o.prototype.Y=function(e){if(""===this.location.path)throw m(e)},o}(),Lt=function(){function e(e){this.D=x(e)}return e.prototype.getPromise=function(){return this.D},e.prototype.cancel=function(e){void 0===e&&(e=!1)},e}(),Re=function(){function e(){this.$={},this.tt=-9007199254740991}return e.prototype.addRequest=function(o){function t(){delete n.$[e]}var e=this.tt;this.tt++,this.$[e]=o;var n=this;o.getPromise().then(t,t)},e.prototype.clear=function(){k(this.$,function(n,t){t&&t.cancel(!0)}),this.$={}},e}(),Ee=function(){function e(t,s,n,r,o){if(this.et=null,this.nt=!1,this.rt=t,null!==this.rt){var i=this.rt.options;P(i)&&(this.et=e.ot(i))}this.it=s,this.at=n,this.st=o,this.ut=r,this.ct=12e4,this.lt=6e4,this.ht=new Re}return e.ot=function(n){var t=n.storageBucket||null;return null==t?null:ce.makeFromBucketSpec(t).bucket},e.prototype.getAuthToken=function(){return null!==this.rt&&P(this.rt.INTERNAL)&&P(this.rt.INTERNAL.getToken)?this.rt.INTERNAL.getToken().then(function(e){return null===e?null:e.accessToken},function(){return null}):O(null)},e.prototype.bucket=function(){if(this.nt)throw h();return this.et},e.prototype.service=function(){return this.ut},e.prototype.makeStorageReference=function(e){return this.it(this,e)},e.prototype.makeRequest=function(o,t){if(this.nt)return new Lt(h());var e=this.at(o,t,this.st);return this.ht.addRequest(e),e},e.prototype.deleteApp=function(){this.nt=!0,this.rt=null,this.ht.clear()},e.prototype.maxUploadRetryTime=function(){return this.lt},e.prototype.setMaxUploadRetryTime=function(e){this.lt=e},e.prototype.maxOperationRetryTime=function(){return this.ct},e.prototype.setMaxOperationRetryTime=function(e){this.ct=e},e}(),we=function(){function e(d,p,e,n,r,o,i,a,s,u,c){this.pt=null,this.ft=null,this.y=null,this.R=null,this.dt=!1,this._t=!1,this.vt=d,this.bt=p,this.mt=e,this.gt=n,this.yt=r.slice(),this.Rt=o.slice(),this.Et=i,this.wt=a,this.Ut=u,this.Tt=s,this.st=c;var l=this;this.D=L(function(n,t){l.y=n,l.R=t,l.M()})}return e.prototype.M=function(){function o(n,a){function l(n){var t=n.loaded,e=n.lengthComputable?n.total:-1;null!==d.Ut&&d.Ut(t,e)}if(a)return void n(!1,new Ue(!1,null,!0));var e=d.st.createXhrIo();d.pt=e,null!==d.Ut&&e.addUploadProgressListener(l),e.send(d.vt,d.bt,d.gt,d.mt).then(function(t){null!==d.Ut&&t.removeUploadProgressListener(l),d.pt=null,t=t;var e=t.getErrorCode()===Nt.NO_ERROR,r=t.getStatus();if(!e||d.At(r)){var i=t.getErrorCode()===Nt.ABORT;return void n(!1,new Ue(!1,null,i))}var a=Qe(d.yt,r);n(!0,new Ue(a,t))})}function t(n,t){var o=d.y,l=d.R,i=t.xhr;if(t.wasSuccessCode)try{var a=d.Et(i,i.getResponseText());_(a)?o(a):o()}catch(e){l(e)}else if(null!==i){var p=r();p.setServerResponseProp(i.getResponseText()),l(d.wt?d.wt(i,p):p)}else if(t.canceled){var p=d._t?h():c();l(p)}else{var p=s();l(p)}}var d=this;this.dt?t(!1,new Ue(!1,null,!0)):this.ft=ht(o,t,this.Tt)},e.prototype.getPromise=function(){return this.D},e.prototype.cancel=function(e){this.dt=!0,this._t=e||!1,null!==this.ft&&mt(this.ft),null!==this.pt&&this.pt.abort()},e.prototype.At=function(e){var t=Qe([408,429],e),n=Qe(this.Rt,e);return 500<=e&&600>e||t||n},e}(),Ue=function(){function e(o,r,e){this.wasSuccessCode=o,this.xhr=r,this.canceled=!!e}return e}(),Te=function(){function e(r,a,e){if(this.et=null,this.U=new Ee(r,function(n,t){return new ge(n,t)},yt,this,a),this.rt=r,null!=e)this.et=ce.makeFromBucketSpec(e);else{var n=this.U.bucket();null!=n&&(this.et=new ce(n,""))}this.Nt=new Rt(this)}return e.prototype.ref=function(e){if(Fe("ref",[Ve(function(e){if(/^[A-Za-z]+:\/\//.test(e))throw"Expected child path but got a URL, use refFromURL instead."},!0)],arguments),null==this.et)throw Error("No Storage Bucket defined in Firebase Options.");var t=new ge(this.U,this.et);return null==e?t:t.child(e)},e.prototype.refFromURL=function(e){return Fe("refFromURL",[Ve(function(e){if(!/^[A-Za-z]+:\/\//.test(e))throw"Expected full URL but got a child path, use ref instead.";try{ce.makeFromUrl(e)}catch(e){throw"Expected valid full URL but got an invalid one."}},!1)],arguments),new ge(this.U,e)},Object.defineProperty(e.prototype,"maxUploadRetryTime",{get:function(){return this.U.maxUploadRetryTime()},enumerable:!0,configurable:!0}),e.prototype.setMaxUploadRetryTime=function(e){Fe("setMaxUploadRetryTime",[je()],arguments),this.U.setMaxUploadRetryTime(e)},Object.defineProperty(e.prototype,"maxOperationRetryTime",{get:function(){return this.U.maxOperationRetryTime()},enumerable:!0,configurable:!0}),e.prototype.setMaxOperationRetryTime=function(e){Fe("setMaxOperationRetryTime",[je()],arguments),this.U.setMaxOperationRetryTime(e)},Object.defineProperty(e.prototype,"app",{get:function(){return this.rt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"INTERNAL",{get:function(){return this.Nt},enumerable:!0,configurable:!0}),e}(),Rt=function(){function e(e){this.ut=e}return e.prototype.delete=function(){return this.ut.U.deleteApp(),O(void 0)},e}();t.registerStorage=vt;var Ne="storage";vt(xt.default)}},[118])}catch(e){throw Error("Cannot instantiate firebase-storage.js - be sure to load firebase-app.js first.")}try{webpackJsonpFirebase([1],{113:function(o,t,e){e(114)},114:function(Mn,t,e){"use strict";function n(){return qt}function r(e){qt=e}function So(s,t){for(var e=[],n=2;nn)throw new Ht(Gt.INVALID_ARGUMENT,"Function "+o+"() requires between "+e+" and "+n+" arguments, but was called with "+O(t.length,"argument")+".")}function y(o,t,e,n){if(!(t instanceof Array)||t.lengthr.indexOf(t))throw new Ht(Gt.INVALID_ARGUMENT,"Unknown option '"+t+"' passed to function "+o+"(). Available options: "+r.join(", "))})}function A(a,t,e,n){var r=k(n);return new Ht(Gt.INVALID_ARGUMENT,"Function "+a+"() requires its "+R(e)+" argument to be a "+t+", but it was: "+r)}function R(e){return 1===e?"first":2===e?"second":3===e?"third":e+"th"}function O(n,t){return n+" "+t+(1===n?"":"s")}function P(n,t){return nt?1:0}function L(n,t){return null!==n&&void 0!==n?t&&n.equals(t):n===t}function x(o,t){if(o.length!==t.length)return!1;for(var e=0;et?1:n===t?0:isNaN(n)?isNaN(t)?0:-1:1}function U(n,t){return n===t?0!==n||1/n==1/t:n!==n&&t!==t}function V(e){return null===e||void 0===e}function j(e){return _e(e)&&e<=Me&&e>=Oe}function W(o,t,e){if(e.equals(ge.INSTANCE)){if(t!==Le.EQUAL)throw new Ht(Gt.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on null.");return new Be(o)}if(e.equals(Ie.NAN)){if(t!==Le.EQUAL)throw new Ht(Gt.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on NaN.");return new Ue(o)}return new xe(o,t,e)}function q(e){return e===Gt.OK?Wo("Treated status OK as error"):e===Gt.CANCELLED||e===Gt.UNKNOWN||e===Gt.DEADLINE_EXCEEDED||e===Gt.RESOURCE_EXHAUSTED||e===Gt.INTERNAL||e===Gt.UNAVAILABLE||e===Gt.UNAUTHENTICATED?!1:e===Gt.INVALID_ARGUMENT||e===Gt.NOT_FOUND||e===Gt.ALREADY_EXISTS||e===Gt.PERMISSION_DENIED||e===Gt.FAILED_PRECONDITION||e===Gt.ABORTED||e===Gt.OUT_OF_RANGE||e===Gt.UNIMPLEMENTED||e===Gt.DATA_LOSS||Wo("Unknown status code: "+e)}function H(n){var t=cn[n];if(void 0!==t)return z(t)}function z(e){if(void 0===e)return o("GRPC error has no .code"),Gt.UNKNOWN;return e===cn.OK?Gt.OK:e===cn.CANCELLED?Gt.CANCELLED:e===cn.UNKNOWN?Gt.UNKNOWN:e===cn.DEADLINE_EXCEEDED?Gt.DEADLINE_EXCEEDED:e===cn.RESOURCE_EXHAUSTED?Gt.RESOURCE_EXHAUSTED:e===cn.INTERNAL?Gt.INTERNAL:e===cn.UNAVAILABLE?Gt.UNAVAILABLE:e===cn.UNAUTHENTICATED?Gt.UNAUTHENTICATED:e===cn.INVALID_ARGUMENT?Gt.INVALID_ARGUMENT:e===cn.NOT_FOUND?Gt.NOT_FOUND:e===cn.ALREADY_EXISTS?Gt.ALREADY_EXISTS:e===cn.PERMISSION_DENIED?Gt.PERMISSION_DENIED:e===cn.FAILED_PRECONDITION?Gt.FAILED_PRECONDITION:e===cn.ABORTED?Gt.ABORTED:e===cn.OUT_OF_RANGE?Gt.OUT_OF_RANGE:e===cn.UNIMPLEMENTED?Gt.UNIMPLEMENTED:e===cn.DATA_LOSS?Gt.DATA_LOSS:Wo("Unknown status code: "+e)}function K(e){if(void 0===e)return cn.OK;return e===Gt.OK?cn.OK:e===Gt.CANCELLED?cn.CANCELLED:e===Gt.UNKNOWN?cn.UNKNOWN:e===Gt.DEADLINE_EXCEEDED?cn.DEADLINE_EXCEEDED:e===Gt.RESOURCE_EXHAUSTED?cn.RESOURCE_EXHAUSTED:e===Gt.INTERNAL?cn.INTERNAL:e===Gt.UNAVAILABLE?cn.UNAVAILABLE:e===Gt.UNAUTHENTICATED?cn.UNAUTHENTICATED:e===Gt.INVALID_ARGUMENT?cn.INVALID_ARGUMENT:e===Gt.NOT_FOUND?cn.NOT_FOUND:e===Gt.ALREADY_EXISTS?cn.ALREADY_EXISTS:e===Gt.PERMISSION_DENIED?cn.PERMISSION_DENIED:e===Gt.FAILED_PRECONDITION?cn.FAILED_PRECONDITION:e===Gt.ABORTED?cn.ABORTED:e===Gt.OUT_OF_RANGE?cn.OUT_OF_RANGE:e===Gt.UNIMPLEMENTED?cn.UNIMPLEMENTED:e===Gt.DATA_LOSS?cn.DATA_LOSS:Wo("Unknown status code: "+e)}function G(e){return 200===e?Gt.OK:400===e?Gt.INVALID_ARGUMENT:401===e?Gt.UNAUTHENTICATED:403===e?Gt.PERMISSION_DENIED:404===e?Gt.NOT_FOUND:409===e?Gt.ABORTED:416===e?Gt.OUT_OF_RANGE:429===e?Gt.RESOURCE_EXHAUSTED:499===e?Gt.CANCELLED:500===e?Gt.UNKNOWN:501===e?Gt.UNIMPLEMENTED:503===e?Gt.UNAVAILABLE:504===e?Gt.DEADLINE_EXCEEDED:200<=e&&300>e?Gt.OK:400<=e&&500>e?Gt.FAILED_PRECONDITION:500<=e&&600>e?Gt.INTERNAL:Gt.UNKNOWN}function X(){return ln}function Q(){return fn}function Y(){return dn}function J(){return pn}function $(n,t){0i||i>t-2)&&Wo("Invalid encoded resource path: \""+n+"\""),n.charAt(i+1)){case ir:var a=n.substring(o,i),s=void 0;0===r.length?s=a:(r+=a,s=r,r=""),e.push(s);break;case sr:r+=n.substring(o,i),r+="\0";break;case lr:r+=n.substring(o,i+1);break;default:Wo("Invalid encoded resource path: \""+n+"\"");}o=i+2}return new re(e)}function lt(n,t){Ho(0===t,"Unexpected upgrade from version "+t),n.createObjectStore(pr.store,{keyPath:pr.keyPath}),n.createObjectStore(ur.store,{keyPath:ur.keyPath}),n.createObjectStore(yr.store,{keyPath:yr.keyPath}).createIndex(yr.documentTargetsIndex,yr.documentTargetsKeyPath,{unique:!0}),n.createObjectStore(fr.store,{keyPath:fr.keyPath}).createIndex(fr.queryTargetsIndexName,fr.queryTargetsKeyPath,{unique:!0}),n.createObjectStore(hr.store),n.createObjectStore(gr.store),n.createObjectStore(dr.store),n.createObjectStore(br.store)}function ct(o){return new Gn(function(r,e){o.onsuccess=function(e){var t=e.target.result;r(t)},o.onerror=function(n){e(n.target.error)}})}function dt(e){return Ho("string"==typeof e,"Persisting non-string stream token not supported."),e}function pt(e){return mt(e,ur.store)}function ut(e){return mt(e,hr.store)}function ht(e){return mt(e,pr.store)}function mt(n,t){return n instanceof Cr?n.store(t):Wo("Invalid transaction object provided!")}function gt(e){return bt(e,fr.store)}function ft(e){return bt(e,br.store)}function yt(e){return bt(e,yr.store)}function bt(n,t){return n instanceof Cr?n.store(t):Wo("Invalid transaction object provided!")}function vt(e){return e instanceof Cr?e.store(gr.store):Wo("Invalid transaction object provided!")}function Et(e){return e.path.toArray()}function St(e){return void 0!==e.documents}function Ct(e){if(!e)return new ao;switch(e.type){case"gapi":return new co(e.client,e.sessionIndex||"0");case"provider":return e.client;default:throw new Ht(Gt.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type");}}function Tt(e){return kt(e,["next","error","complete"])}function kt(a,s){if("object"!=typeof a||null===a)return!1;for(var e=a,n=0,r=s,o;nt.query.docComparator(r,a.doc),"Got added events in wrong order"),r=a.doc,{type:"added",doc:o,oldIndex:-1,newIndex:e++}})}var d=t.oldDocs;return t.docChanges.map(function(e){var n=new Oo(s,e.doc.key,e.doc,t.fromCache),o=-1,l=-1;return e.type!==Ln.Added&&(o=d.indexOf(e.doc.key),Ho(0<=o,"Index for document not found"),d=d.delete(e.doc.key)),e.type!==Ln.Removed&&(d=d.add(e.doc),l=d.indexOf(e.doc.key)),{type:_t(e.type),doc:n,oldIndex:o,newIndex:l}})}function _t(e){return e===Ln.Added?"added":e===Ln.Modified||e===Ln.Metadata?"modified":e===Ln.Removed?"removed":Wo("Unknown change type: "+e)}function Dt(e){e.INTERNAL.registerService("firestore",function(e){return new ko(e)},h(na))}function Mt(e){Dt(e)}var Ft=Number.POSITIVE_INFINITY,Bt=String.fromCharCode,Ut=Math.min,Vt=Math.floor;Object.defineProperty(t,"__esModule",{value:!0});var zo=e(6),jt=zo.default.SDK_VERSION,Qt;!function(e){e[e.DEBUG=0]="DEBUG",e[e.ERROR=1]="ERROR",e[e.SILENT=2]="SILENT"}(Qt||(Qt={}));var qt=Qt.ERROR,Kt=function(){function n(){}return n.setPlatform=function(t){n.platform&&Wo("Platform already defined"),n.platform=t},n.getPlatform=function(){return n.platform||Wo("Platform not set"),n.platform},n}(),Wt=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),Gt={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"},Ht=function(o){function t(t,a){var n=o.call(this,a)||this;return n.code=t,n.message=a,n.name="FirebaseError",n.toString=function(){return n.name+": [code="+n.code+"]: "+n.message},n}return Wt(t,o),t}(Error),zt=function(){function e(){}return e.newId=function(){for(var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="",e=0;20>e;e++)t+=o.charAt(Vt(Math.random()*o.length));return Ho(20===t.length,"Invalid auto ID: "+t),t},e}(),Xt=function(){function n(e){F(),this.e=e}return n.fromBase64String=function(t){m("Blob.fromBase64String",arguments,1),b("Blob.fromBase64String","string",1,t),F();try{return new n(Kt.getPlatform().atob(t))}catch(e){throw new Ht(Gt.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+e)}},n.fromUint8Array=function(t){if(m("Blob.fromUint8Array",arguments,1),M(),!(t instanceof Uint8Array))throw A("Blob.fromUint8Array","Uint8Array",1,t);return new n(Array.prototype.map.call(t,function(e){return Bt(e)}).join(""))},n.prototype.toBase64=function(){return m("Blob.toBase64",arguments,0),F(),Kt.getPlatform().btoa(this.e)},n.prototype.toUint8Array=function(){m("Blob.toUint8Array",arguments,0),M();for(var n=new Uint8Array(this.e.length),t=0;tn||90o||180o.length&&Wo("offset "+t+" out of range "+o.length),void 0===e?e=o.length-t:e>o.length-t&&Wo("length "+e+" out of range "+(o.length-t)),this.segments=o,this.offset=t,this.len=e},o.prototype.construct=function(o,t,e){var n=Object.create(Object.getPrototypeOf(this));return n.init(o,t,e),n},Object.defineProperty(o.prototype,"length",{get:function(){return this.len},enumerable:!0,configurable:!0}),o.prototype.equals=function(t){return 0===o.comparator(this,t)},o.prototype.child=function(t){var r=this.segments.slice(this.offset,this.limit());return t instanceof o?t.forEach(function(e){r.push(e)}):"string"==typeof t?r.push(t):Wo("Unknown parameter type for Path.child(): "+t),this.construct(r)},o.prototype.limit=function(){return this.offset+this.length},o.prototype.popFirst=function(e){return e=void 0===e?1:e,Ho(this.length>=e,"Can't call popFirst() with less segments"),this.construct(this.segments,this.offset+e,this.length-e)},o.prototype.popLast=function(){return Ho(!this.isEmpty(),"Can't call popLast() on empty path"),this.construct(this.segments,this.offset,this.length-1)},o.prototype.firstSegment=function(){return Ho(!this.isEmpty(),"Can't call firstSegment() on empty path"),this.segments[this.offset]},o.prototype.lastSegment=function(){return Ho(!this.isEmpty(),"Can't call lastSegment() on empty path"),this.segments[this.limit()-1]},o.prototype.get=function(e){return Ho(eo)return 1}return a.lengtht.length?1:0},o}(),re=function(n){function o(){return null!==n&&n.apply(this,arguments)||this}return ee(o,n),o.prototype.canonicalString=function(){return this.toArray().join("/")},o.prototype.toString=function(){return this.canonicalString()},o.fromString=function(e){if(0<=e.indexOf("//"))throw new Ht(Gt.INVALID_ARGUMENT,"Invalid path ("+e+"). Paths must not contain // in them.");return new o(e.split("/").filter(function(e){return 0e?t=t.left:0n?t=t.left:0n?e=e.left:(t+=e.left.size+1,e=e.right)}return-1},o.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(o.prototype,"size",{get:function(){return this.root.size},enumerable:!0,configurable:!0}),o.prototype.minKey=function(){return this.root.minKey()},o.prototype.maxKey=function(){return this.root.maxKey()},o.prototype.inorderTraversal=function(e){return this.root.inorderTraversal(e)},o.prototype.forEach=function(o){this.inorderTraversal(function(t,e){return o(t,e),!1})},o.prototype.reverseTraversal=function(e){return this.root.reverseTraversal(e)},o.prototype.getIterator=function(e){return new he(this.root,null,this.comparator,!1,e)},o.prototype.getIteratorFrom=function(n,t){return new he(this.root,n,this.comparator,!1,t)},o.prototype.getReverseIterator=function(e){return new he(this.root,null,this.comparator,!0,e)},o.prototype.getReverseIteratorFrom=function(n,t){return new he(this.root,n,this.comparator,!0,t)},o}(),he=function(){function e(a,s,e,n,r){this.resultGenerator=r||null,this.isReverse=n,this.nodeStack=[];for(var o=1;!a.isEmpty();)if(o=s?e(a.key,s):1,n&&(o*=-1),0>o)a=this.isReverse?a.left:a.right;else{if(0===o){this.nodeStack.push(a);break}this.nodeStack.push(a),a=this.isReverse?a.right:a.left}}return e.prototype.getNext=function(){Ho(0r?n.copy(null,null,null,n.left.insert(a,t,e),null):0===r?n.copy(null,t,null,null,null):n.copy(null,null,null,null,n.right.insert(a,t,e)),n.fixUp()},a.prototype.removeMin=function(){if(this.left.isEmpty())return a.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()},a.prototype.remove=function(t,e){var n=this,o;if(0>e(t,n.key))n.left.isEmpty()||n.left.isRed()||n.left.left.isRed()||(n=n.moveRedLeft()),n=n.copy(null,null,null,n.left.remove(t,e),null);else{if(n.left.isRed()&&(n=n.rotateRight()),n.right.isEmpty()||n.right.isRed()||n.right.left.isRed()||(n=n.moveRedRight()),0===e(t,n.key)){if(n.right.isEmpty())return a.EMPTY;o=n.right.min(),n=n.copy(o.key,o.value,null,null,n.right.removeMin())}n=n.copy(null,null,null,null,n.right.remove(t,e))}return n.fixUp()},a.prototype.isRed=function(){return this.color},a.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},a.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},a.prototype.moveRedRight=function(){var e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e},a.prototype.rotateLeft=function(){var t=this.copy(null,null,a.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},a.prototype.rotateRight=function(){var t=this.copy(null,null,a.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},a.prototype.colorFlip=function(){var n=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,n,t)},a.prototype.checkMaxDepth=function(){var e=this.check();return Math.pow(2,e)<=this.size+1},a.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw Wo("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed())throw Wo("Right child of ("+this.key+","+this.value+") is red");var e=this.left.check();if(e!==this.right.check())throw Wo("Black depths differ");return e+(this.isRed()?0:1)},a.EMPTY=null,a.RED=!0,a.BLACK=!1,a}(),fe=function(){function e(){this.size=0}return e.prototype.copy=function(){return this},e.prototype.insert=function(n,t){return new le(n,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}();le.EMPTY=new fe;var de=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),ye;!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"}(ye||(ye={}));var pe=function(){function e(){}return e.prototype.toString=function(){var e=this.value();return null===e?"null":""+e},e.prototype.defaultCompareTo=function(e){return Ho(this.typeOrder!==e.typeOrder,"Default compareTo should not be used for values of same type."),P(this.typeOrder,e.typeOrder)},e}(),ge=function(n){function o(){var t=n.call(this)||this;return t.typeOrder=ye.NullValue,t.internalValue=null,t}return de(o,n),o.prototype.value=function(){return null},o.prototype.equals=function(e){return e instanceof o},o.prototype.compareTo=function(e){return e instanceof o?0:this.defaultCompareTo(e)},o.INSTANCE=new o,o}(pe),ve=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.BooleanValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.equals=function(e){return e instanceof n&&this.internalValue===e.internalValue},n.prototype.compareTo=function(e){return e instanceof n?P(this,e):this.defaultCompareTo(e)},n.of=function(e){return e?n.TRUE:n.FALSE},n.TRUE=new n(!0),n.FALSE=new n(!1),n}(pe),be=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.NumberValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.compareTo=function(e){return e instanceof n?B(this.internalValue,e.internalValue):this.defaultCompareTo(e)},n}(pe),we=function(n){function o(t){return n.call(this,t)||this}return de(o,n),o.prototype.equals=function(e){return e instanceof o&&U(this.internalValue,e.internalValue)},o}(be),Ie=function(o){function n(t){var r=o.call(this,t)||this;return r.internalValue=t,r}return de(n,o),n.prototype.equals=function(e){return e instanceof n&&U(this.internalValue,e.internalValue)},n.NAN=new n(NaN),n.POSITIVE_INFINITY=new n(1/0),n.NEGATIVE_INFINITY=new n(-1/0),n}(be),Te=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.StringValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.equals=function(e){return e instanceof n&&this.internalValue===e.internalValue},n.prototype.compareTo=function(e){return e instanceof n?P(this.internalValue,e.internalValue):this.defaultCompareTo(e)},n}(pe),Ee=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.TimestampValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue.toDate()},n.prototype.equals=function(e){return e instanceof n&&this.internalValue.equals(e.internalValue)},n.prototype.compareTo=function(e){return e instanceof n?this.internalValue.compareTo(e.internalValue):e instanceof Se?-1:this.defaultCompareTo(e)},n}(pe),Se=function(o){function n(t){var r=o.call(this)||this;return r.localWriteTime=t,r.typeOrder=ye.TimestampValue,r}return de(n,o),n.prototype.value=function(){return null},n.prototype.equals=function(e){return e instanceof n&&this.localWriteTime.equals(e.localWriteTime)},n.prototype.compareTo=function(e){return e instanceof n?this.localWriteTime.compareTo(e.localWriteTime):e instanceof Ee?1:this.defaultCompareTo(e)},n.prototype.toString=function(){return""},n}(pe),Ce=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.BlobValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.equals=function(e){return e instanceof n&&this.internalValue.n(e.internalValue)},n.prototype.compareTo=function(e){return e instanceof n?this.internalValue.r(e.internalValue):this.defaultCompareTo(e)},n}(pe),De=function(o){function r(t,a){var n=o.call(this)||this;return n.databaseId=t,n.key=a,n.typeOrder=ye.RefValue,n}return de(r,o),r.prototype.value=function(){return this.key},r.prototype.equals=function(e){return e instanceof r&&this.key.equals(e.key)&&this.databaseId.equals(e.databaseId)},r.prototype.compareTo=function(e){if(e instanceof r){var t=this.databaseId.compareTo(e.databaseId);return 0===t?ae.comparator(this.key,e.key):t}return this.defaultCompareTo(e)},r}(pe),ke=function(o){function n(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.GeoPointValue,r}return de(n,o),n.prototype.value=function(){return this.internalValue},n.prototype.equals=function(e){return e instanceof n&&this.internalValue.n(e.internalValue)},n.prototype.compareTo=function(e){return e instanceof n?this.internalValue.r(e.internalValue):this.defaultCompareTo(e)},n}(pe),Ne=function(o){function s(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.ObjectValue,r}return de(s,o),s.prototype.value=function(){var o={};return this.internalValue.inorderTraversal(function(t,e){o[t]=e.value()}),o},s.prototype.forEach=function(e){this.internalValue.inorderTraversal(e)},s.prototype.equals=function(e){if(e instanceof s){for(var t=this.internalValue.getIterator(),n=e.internalValue.getIterator();t.hasNext()&&n.hasNext();){var r=t.getNext(),o=n.getNext();if(r.key!==o.key||!r.value.equals(o.value))return!1}return!t.hasNext()&&!n.hasNext()}return!1},s.prototype.compareTo=function(e){if(e instanceof s){for(var t=this.internalValue.getIterator(),n=e.internalValue.getIterator();t.hasNext()&&n.hasNext();){var r=t.getNext(),o=n.getNext(),i=P(r.key,o.key)||r.value.compareTo(o.value);if(i)return i}return P(t.hasNext(),n.hasNext())}return this.defaultCompareTo(e)},s.prototype.set=function(e,t){if(Ho(!e.isEmpty(),"Cannot set field for empty path on ObjectValue"),1===e.length)return this.setChild(e.firstSegment(),t);var n=this.child(e.firstSegment());n instanceof s||(n=s.EMPTY);var r=n.set(e.popFirst(),t);return this.setChild(e.firstSegment(),r)},s.prototype.delete=function(e){if(Ho(!e.isEmpty(),"Cannot delete field for empty path on ObjectValue"),1===e.length)return new s(this.internalValue.remove(e.firstSegment()));var t=this.child(e.firstSegment());if(t instanceof s){var n=t.delete(e.popFirst());return new s(this.internalValue.insert(e.firstSegment(),n))}return this},s.prototype.contains=function(e){return void 0!==this.field(e)},s.prototype.field=function(e){Ho(!e.isEmpty(),"Can't get field of empty path");var o=this;return e.forEach(function(e){o=o instanceof s?o.internalValue.get(e)||void 0:void 0}),o},s.prototype.toString=function(){return JSON.stringify(this.value())},s.prototype.child=function(e){return this.internalValue.get(e)||void 0},s.prototype.setChild=function(e,t){return new s(this.internalValue.insert(e,t))},s.EMPTY=new s(new ce(P)),s}(pe),Ae=function(o){function a(t){var r=o.call(this)||this;return r.internalValue=t,r.typeOrder=ye.ArrayValue,r}return de(a,o),a.prototype.value=function(){return this.internalValue.map(function(e){return e.value()})},a.prototype.forEach=function(e){this.internalValue.forEach(e)},a.prototype.equals=function(e){if(e instanceof a){if(this.internalValue.length!==e.internalValue.length)return!1;for(var t=0;t="===t?n.GREATER_THAN_OR_EQUAL:">"===t?n.GREATER_THAN:Wo("Unknown relation: "+t)},n.prototype.toString=function(){return this.name},n.prototype.equals=function(e){return this.name===e.name},n.LESS_THAN=new n("<"),n.LESS_THAN_OR_EQUAL=new n("<="),n.EQUAL=new n("=="),n.GREATER_THAN=new n(">"),n.GREATER_THAN_OR_EQUAL=new n(">="),n}(),xe=function(){function n(o,r,e){this.field=o,this.op=r,this.value=e}return n.prototype.matches=function(o){if(this.field.isKeyField()){Ho(this.value instanceof De,"Comparing on key, but filter value not a RefValue");var t=this.value,e=ae.comparator(o.key,t.key);return this.matchesComparison(e)}var n=o.field(this.field);return void 0!==n&&this.matchesValue(n)},n.prototype.matchesValue=function(e){return this.value.typeOrder===e.typeOrder&&this.matchesComparison(e.compareTo(this.value))},n.prototype.matchesComparison=function(e){switch(this.op){case Le.LESS_THAN:return 0>e;case Le.LESS_THAN_OR_EQUAL:return 0>=e;case Le.EQUAL:return 0===e;case Le.GREATER_THAN:return 0=e:0>e},e.prototype.equals=function(o){if(null===o)return!1;if(this.before!==o.before||this.position.length!==o.position.length)return!1;for(var t=0;to,"timestamp nanoseconds out of range"+o),Ho(-62135596800<=n,"timestamp seconds out of range: "+n),Ho(253402300800>n,"timestamp seconds out of range"+n)}return a.now=function(){return a.fromEpochMilliseconds(Date.now())},a.fromDate=function(t){return a.fromEpochMilliseconds(t.getTime())},a.fromEpochMilliseconds=function(t){var e=Vt(t/1e3);return new a(e,1e6*(t-1e3*e))},a.fromISOString=function(t){var e=0,n=Ke.exec(t);if(Ho(!!n,"invalid timestamp: "+t),n[1]){var s=n[1];s=(s+"000000000").substr(0,9),e=parseInt(s,10)}var o=new Date(t);return new a(Vt(o.getTime()/1e3),e)},a.prototype.toDate=function(){return new Date(this.toEpochMilliseconds())},a.prototype.toEpochMilliseconds=function(){return 1e3*this.seconds+this.nanos/1e6},a.prototype.compareTo=function(e){return this.seconds===e.seconds?P(this.nanos,e.nanos):P(this.seconds,e.seconds)},a.prototype.equals=function(e){return e.seconds===this.seconds&&e.nanos===this.nanos},a.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanos="+this.nanos+")"},a}(),Ge=function(){function o(e){this.timestamp=e}return o.fromMicroseconds=function(t){var e=Vt(t/1e6);return new o(new We(e,1e3*(t%1e6)))},o.fromTimestamp=function(t){return new o(t)},o.forDeletedDoc=function(){return o.MIN},o.prototype.compareTo=function(e){return this.timestamp.compareTo(e.timestamp)},o.prototype.equals=function(e){return this.timestamp.equals(e.timestamp)},o.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanos/1e3},o.prototype.toString=function(){return"SnapshotVersion("+this.timestamp+")"},o.prototype.toTimestamp=function(){return this.timestamp},o.MIN=new o(new We(0,0)),o}(),He;!function(e){e[e.Listen=0]="Listen",e[e.ExistenceFilterMismatch=1]="ExistenceFilterMismatch",e[e.LimboResolution=2]="LimboResolution"}(He||(He={}));var me=function(){function n(a,s,e,n,r){void 0===n&&(n=Ge.MIN),void 0===r&&(r=i()),this.query=a,this.targetId=s,this.purpose=e,this.snapshotVersion=n,this.resumeToken=r}return n.prototype.update=function(t){return new n(this.query,this.targetId,this.purpose,t.snapshotVersion,t.resumeToken)},n.prototype.equals=function(e){return this.targetId===e.targetId&&this.purpose===e.purpose&&this.snapshotVersion.equals(e.snapshotVersion)&&this.resumeToken===e.resumeToken&&this.query.equals(e.query)},n}(),Xe=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ye=function(){function e(e){this.fields=e}return e.prototype.equals=function(e){return x(this.fields,e.fields)},e}(),Je=function(){function n(){}return n.prototype.equals=function(t){return t instanceof n},n.instance=new n,n}(),$e=function(){function e(n,o){this.field=n,this.transform=o}return e.prototype.equals=function(e){return this.field.equals(e.field)&&this.transform.equals(e.transform)},e}(),Ze=function(){function e(n,o){this.version=n,this.transformResults=o}return e}(),tn;!function(e){e[e.Set=0]="Set",e[e.Patch=1]="Patch",e[e.Transform=2]="Transform",e[e.Delete=3]="Delete"}(tn||(tn={}));var ze=function(){function n(n,o){this.updateTime=n,this.exists=o,Ho(void 0===n||void 0===o,"Precondition can specify \"exists\" or \"updateTime\" but not both")}return n.exists=function(t){return new n(void 0,t)},n.updateTime=function(t){return new n(t)},Object.defineProperty(n.prototype,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!0,configurable:!0}),n.prototype.isValidFor=function(e){return void 0===this.updateTime?void 0===this.exists?(Ho(this.isNone,"Precondition should be empty"),!0):this.exists?e instanceof se:null===e||e instanceof ue:e instanceof se&&e.version.equals(this.updateTime)},n.prototype.equals=function(e){return L(this.updateTime,e.updateTime)&&this.exists===e.exists},n.NONE=new n,n}(),nn=function(){function e(){}return e.prototype.verifyKeyMatches=function(e){null!=e&&Ho(e.key.equals(this.key),"Can only apply a mutation to a document with the same key")},e.getPostMutationVersion=function(e){return e instanceof se?e.version:Ge.MIN},e}(),rn=function(a){function n(t,i,n){var r=a.call(this)||this;return r.key=t,r.value=i,r.precondition=n,r.type=tn.Set,r}return Xe(n,a),n.prototype.applyToRemoteDocument=function(o,t){this.verifyKeyMatches(o),Ho(null==t.transformResults,"Transform results received by SetMutation.");var e=nn.getPostMutationVersion(o);return new se(this.key,e,this.value,{hasLocalMutations:!1})},n.prototype.applyToLocalView=function(e){if(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))return e;var t=nn.getPostMutationVersion(e);return new se(this.key,t,this.value,{hasLocalMutations:!0})},n.prototype.equals=function(e){return e instanceof n&&this.key.equals(e.key)&&this.value.equals(e.value)&&this.precondition.equals(e.precondition)},n}(nn),on=function(a){function n(t,s,n,r){var o=a.call(this)||this;return o.key=t,o.data=s,o.fieldMask=n,o.precondition=r,o.type=tn.Patch,o}return Xe(n,a),n.prototype.applyToRemoteDocument=function(o,t){if(this.verifyKeyMatches(o),Ho(null==t.transformResults,"Transform results received by PatchMutation."),!this.precondition.isValidFor(o))return o;var e=nn.getPostMutationVersion(o),n=this.patchDocument(o);return new se(this.key,e,n,{hasLocalMutations:!1})},n.prototype.applyToLocalView=function(e){if(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))return e;var t=nn.getPostMutationVersion(e),n=this.patchDocument(e);return new se(this.key,t,n,{hasLocalMutations:!0})},n.prototype.equals=function(e){return e instanceof n&&this.key.equals(e.key)&&this.fieldMask.equals(e.fieldMask)&&this.precondition.equals(e.precondition)},n.prototype.patchDocument=function(n){var t;return t=n instanceof se?n.data:Ne.EMPTY,this.patchObject(t)},n.prototype.patchObject=function(a){for(var t=0,e=this.fieldMask.fields;t>Jn<=o?e|this.generatorId:(e|this.generatorId)-(1<",o),e=this.store.put(o)):(So("SimpleDb","PUT",this.store.name,o,t),e=this.store.put(t,o)),ct(e)},e.prototype.get=function(o){var t=this;return ct(this.store.get(o)).next(function(e){return void 0===e&&(e=null),So("SimpleDb","GET",t.store.name,o,e),e})},e.prototype.delete=function(e){return So("SimpleDb","DELETE",this.store.name,e),ct(this.store.delete(e))},e.prototype.loadAll=function(o,t){var e=this.cursor(this.options(o,t)),n=[];return this.iterateCursor(e,function(o,t){n.push(t)}).next(function(){return n})},e.prototype.deleteAll=function(o,t){So("SimpleDb","DELETE ALL",this.store.name);var e=this.options(o,t);e.keysOnly=!1;var n=this.cursor(e);return this.iterateCursor(n,function(o,t,e){return e.delete()})},e.prototype.iterate=function(o,t){var e;t?e=o:(e={},t=o);var n=this.cursor(e);return this.iterateCursor(n,t)},e.prototype.iterateCursor=function(a,s){var e=[];return new Gn(function(n,r){a.onerror=function(e){r(e.target.error)},a.onsuccess=function(r){var t=r.target.result;if(!t)return void n();var d=new Sr(t),i=s(t.primaryKey,t.value,d);i instanceof Gn&&e.push(i),d.isDone?n():null===d.skipToKey?t.continue():t.continue(d.skipToKey)}}).next(function(){return Gn.waitFor(e)})},e.prototype.options=function(o,r){var a;return void 0!==o&&("string"==typeof o?a=o:(Ho(void 0===r,"3rd argument must not be defined if 2nd is a range."),r=o)),{index:a,range:r}},e.prototype.cursor=function(o){var t="next";if(o.reverse&&(t="prev"),o.index){var e=this.store.index(o.index);return o.keysOnly?e.openKeyCursor(o.range,t):e.openCursor(o.range,t)}return this.store.openCursor(o.range,t)},e}(),kr=function(){function o(n,o){this.userId=n,this.serializer=o,this.garbageCollector=null}return o.forUser=function(t,e){return Ho(""!==t.uid,"UserID must not be an empty string."),new o(t.isUnauthenticated()?"":t.uid,e)},o.prototype.start=function(r){var e=this;return o.loadNextBatchIdFromDb(r).next(function(n){return e.nextBatchId=n,ht(r).get(e.userId)}).next(function(n){return n||(n=new pr(e.userId,nr,"")),e.metadata=n,e.metadata.lastAcknowledgedBatchId>=e.nextBatchId?e.checkEmpty(r).next(function(n){return Ho(n,"Reset nextBatchID is only possible when the queue is empty"),e.metadata.lastAcknowledgedBatchId=nr,ht(r).put(e.metadata)}):Gn.resolve()})},o.loadNextBatchIdFromDb=function(n){var a=nr;return pt(n).iterate({reverse:!0},function(e,t,n){var r=e[0];if(e[1]>a&&(a=t.batchId),""===r)n.done();else{var o=_(r);n.skip([o])}}).next(function(){return a+1})},o.prototype.checkEmpty=function(o){var a=!0,e=IDBKeyRange.bound(this.keyForBatchId(Number.NEGATIVE_INFINITY),this.keyForBatchId(Number.POSITIVE_INFINITY));return pt(o).iterate({range:e},function(e,t,n){a=!1,n.done()}).next(function(){return a})},o.prototype.getNextBatchId=function(){return Gn.resolve(this.nextBatchId)},o.prototype.getHighestAcknowledgedBatchId=function(){return Gn.resolve(this.metadata.lastAcknowledgedBatchId)},o.prototype.acknowledgeBatch=function(o,t,e){var n=t.batchId;return Ho(n>this.metadata.lastAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order"),this.metadata.lastAcknowledgedBatchId=n,this.metadata.lastStreamToken=dt(e),ht(o).put(this.metadata)},o.prototype.getLastStreamToken=function(){return Gn.resolve(this.metadata.lastStreamToken)},o.prototype.setLastStreamToken=function(n,t){return this.metadata.lastStreamToken=dt(t),ht(n).put(this.metadata)},o.prototype.addMutationBatch=function(d,t,e){var n=this,r=this.nextBatchId;this.nextBatchId++;var o=new or(r,t,e),i=this.serializer.toDbMutationBatch(this.userId,o);return pt(d).put(i).next(function(){for(var t=[],o=0,i=e;os,"Should have found mutation after "+s),n=e.serializer.fromDbMutationBatch(t)),r.done()}).next(function(){return n})},o.prototype.getAllMutationBatches=function(o){var r=this,e=IDBKeyRange.bound(this.keyForBatchId(nr),this.keyForBatchId(Number.POSITIVE_INFINITY));return pt(o).loadAll(e).next(function(e){return e.map(function(e){return r.serializer.fromDbMutationBatch(e)})})},o.prototype.getAllMutationBatchesThroughBatchId=function(o,t){var e=this,n=IDBKeyRange.bound(this.keyForBatchId(nr),this.keyForBatchId(t));return pt(o).loadAll(n).next(function(n){return n.map(function(n){return e.serializer.fromDbMutationBatch(n)})})},o.prototype.getAllMutationBatchesAffectingDocumentKey=function(d,t){var e=this,n=hr.prefixForPath(this.userId,t.path),r=IDBKeyRange.lowerBound(n),a=[];return ut(d).iterate({range:r},function(n,r,o){var i=n[0],s=n[1],p=n[2],c=st(s);if(i!==e.userId||!t.path.equals(c))return void o.done();var l=e.keyForBatchId(p);return pt(d).get(l).next(function(o){null===o&&Wo("Dangling document-mutation reference found: "+n+" which points to "+l),a.push(e.serializer.fromDbMutationBatch(o))})}).next(function(){return a})},o.prototype.getAllMutationBatchesAffectingQuery=function(d,t){var l=this;Ho(!t.isDocumentQuery(),"Document queries shouldn't go down this path");var n=t.path,r=n.length+1,e=hr.prefixForPath(this.userId,n),o=(e[1],IDBKeyRange.lowerBound(e)),p=new en(P);return ut(d).iterate({range:o},function(o,t,e){var i=o[0],a=o[1],s=o[2],d=st(a);return i===l.userId&&n.isPrefixOf(d)?void(d.length===r&&(p=p.add(s))):void e.done()}).next(function(){var n=[],e=[];return p.forEach(function(t){var o=l.keyForBatchId(t);e.push(pt(d).get(o).next(function(e){null===e&&Wo("Dangling document-mutation reference found, which points to "+o),n.push(l.serializer.fromDbMutationBatch(e))}))}),Gn.waitFor(e).next(function(){return n})})},o.prototype.removeMutationBatches=function(d,t){for(var p=pt(d),e=ut(d),n=[],o=this,r=0,a=t,i;rthis.metadata.highestTargetId?(this.metadata.highestTargetId=n,r.next(function(){return ft(a).put(br.key,e.metadata)})):r},e.prototype.removeQueryData=function(n,t){return this.removeMatchingKeysForTargetId(n,t.targetId).next(function(){gt(n).delete(t.targetId)})},e.prototype.getQueryData=function(a,s){var e=this,t=s.canonicalId(),n=IDBKeyRange.bound([t,Number.NEGATIVE_INFINITY],[t,Ft]),d=null;return gt(a).iterate({range:n,index:fr.queryTargetsIndexName},function(n,t,r){var o=e.serializer.fromDbTarget(t);s.equals(o.query)&&(d=o,r.done())}).next(function(){return d})},e.prototype.addMatchingKeys=function(a,t,i){var n=[],r=yt(a);return t.forEach(function(o){var t=rt(o.path);n.push(r.put(new yr(i,t)))}),Gn.waitFor(n)},e.prototype.removeMatchingKeys=function(a,t,s){var n=this,r=[],o=yt(a);return t.forEach(function(a){var t=rt(a.path);r.push(o.delete([s,t])),null!==n.garbageCollector&&n.garbageCollector.addPotentialGarbageKey(a)}),Gn.waitFor(r)},e.prototype.removeMatchingKeysForTargetId=function(o,t){var e=yt(o),n=IDBKeyRange.bound([t],[t+1],!1,!0);return this.notifyGCForRemovedKeys(o,n).next(function(){return e.delete(n)})},e.prototype.notifyGCForRemovedKeys=function(o,t){var a=this,n=yt(o);return null!==this.garbageCollector&&this.garbageCollector.isEager?n.iterate({range:t,keysOnly:!0},function(e){var t=st(e[1]),n=new ae(t);Ho(null!==a.garbageCollector,"GarbageCollector for query cache set to null during key removal."),a.garbageCollector.addPotentialGarbageKey(n)}):Gn.resolve()},e.prototype.getMatchingKeysForTargetId=function(a,t){var e=IDBKeyRange.bound([t],[t+1],!1,!0),i=yt(a),s=J();return i.iterate({range:e,keysOnly:!0},function(e){var t=st(e[1]),n=new ae(t);s=s.add(n)}).next(function(){return s})},e.prototype.setGarbageCollector=function(e){this.garbageCollector=e},e.prototype.containsKey=function(a,t){Ho(null!==a,"Persistence Transaction cannot be null for query cache containsKey");var e=rt(t.path),n=IDBKeyRange.bound([e],[D(e)],!1,!0),i=0;return yt(a).iterate({index:yr.documentTargetsIndex,keysOnly:!0,range:n},function(o,t,e){i++,e.done()}).next(function(){return 0t?(o("Persistence owner-lease is in the future. Discarding.",n),1):n.ownerId===this.getZombiedOwnerId()))},r.prototype.scheduleOwnerLeaseRefreshes=function(){var n=this;this.ownerLeaseRefreshHandle=setInterval(function(){n.runTransaction("Refresh owner timestamp",function(t){return t.store(dr.store).put("owner",new dr(n.ownerId,Date.now()))}).catch(function(t){o(t),n.stopOwnerLeaseRefreshes()})},4e3)},r.prototype.stopOwnerLeaseRefreshes=function(){this.ownerLeaseRefreshHandle&&(clearInterval(this.ownerLeaseRefreshHandle),this.ownerLeaseRefreshHandle=null)},r.prototype.attachWindowUnloadHook=function(){var e=this;this.windowUnloadHandler=function(){e.setZombiedOwnerId(e.ownerId),e.shutdown()},window.addEventListener("unload",this.windowUnloadHandler)},r.prototype.detachWindowUnloadHook=function(){this.windowUnloadHandler&&(window.removeEventListener("unload",this.windowUnloadHandler),this.windowUnloadHandler=null)},r.prototype.getZombiedOwnerId=function(){try{var e=window.localStorage.getItem(this.zombiedOwnerLocalStorageKey());return So("IndexedDbPersistence","Zombied ownerID from LocalStorage:",e),e}catch(e){return o("Failed to get zombie owner id.",e),null}},r.prototype.setZombiedOwnerId=function(e){try{null===e?window.localStorage.removeItem(this.zombiedOwnerLocalStorageKey()):window.localStorage.setItem(this.zombiedOwnerLocalStorageKey(),e)}catch(e){o("Failed to set zombie owner id.",e)}},r.prototype.zombiedOwnerLocalStorageKey=function(){return this.localStoragePrefix+"zombiedOwnerId"},r.prototype.generateOwnerId=function(){return zt.newId()},r.MAIN_DATABASE="main",r}(),Or=function(){function e(n,o){this.remoteDocumentCache=n,this.mutationQueue=o}return e.prototype.getDocument=function(o,t){var e=this;return this.remoteDocumentCache.getEntry(o,t).next(function(n){return e.computeLocalDocument(o,t,n)})},e.prototype.getDocuments=function(a,t){var i=this,n=[],r=X();return t.forEach(function(o){n.push(i.getDocument(a,o).next(function(e){e||(e=new ue(o,Ge.forDeletedDoc())),r=r.insert(o,e)}))}),Gn.waitFor(n).next(function(){return r})},e.prototype.getDocumentsMatchingQuery=function(n,t){return ae.isDocumentKey(t.path)?this.getDocumentsMatchingDocumentQuery(n,t.path):this.getDocumentsMatchingCollectionQuery(n,t)},e.prototype.getDocumentsMatchingDocumentQuery=function(n,t){return this.getDocument(n,new ae(t)).next(function(n){var t=Q();return n instanceof se&&(t=t.insert(n.key,n)),t})},e.prototype.getDocumentsMatchingCollectionQuery=function(a,i){var t=this,e;return this.remoteDocumentCache.getDocumentsMatchingQuery(a,i).next(function(n){return t.computeLocalDocuments(a,n)}).next(function(n){return e=n,t.mutationQueue.getAllMutationBatchesAffectingQuery(a,i)}).next(function(n){for(var r=J(),o=0,i=n;on,"Acknowledged batches can't be rejected."),t})}).next(function(){return i.removeMutationBatch(e,t)}).next(function(o){return n=o,i.mutationQueue.performConsistencyCheck(e)}).next(function(){return i.localDocuments.getDocuments(e,n)})})},e.prototype.getLastStreamToken=function(){var n=this;return this.persistence.runTransaction("Get last stream token",function(t){return n.mutationQueue.getLastStreamToken(t)})},e.prototype.setLastStreamToken=function(o){var t=this;return this.persistence.runTransaction("Set last stream token",function(e){return t.mutationQueue.setLastStreamToken(e,o)})},e.prototype.getLastRemoteSnapshotVersion=function(){return this.queryCache.getLastRemoteSnapshotVersion()},e.prototype.applyRemoteEvent=function(i){var p=this,e=new Pr(this.remoteDocuments);return this.persistence.runTransaction("Apply remote event",function(c){var r=[];d(i.targetChanges,function(e,t){var n=p.targetIds[e];if(n){var o=t.mapping;if(o)if(o instanceof vn)r.push(p.queryCache.removeMatchingKeysForTargetId(c,e).next(function(){return p.queryCache.addMatchingKeys(c,o.documents,e)}));else{if(!(o instanceof bn))return Wo("Unknown mapping type: "+JSON.stringify(o));r.push(p.queryCache.removeMatchingKeys(c,o.removedDocuments,e).next(function(){return p.queryCache.addMatchingKeys(c,o.addedDocuments,e)}))}var a=t.resumeToken;0=n.compareTo(t)||u(this.targetIds)},e.prototype.shouldHoldBatchResult=function(e){return!this.isRemoteUpToVersion(e)||0r.version.compareTo(l))&&(r=n.applyToRemoteDocument(d,r,s),r?e.addEntry(r):Ho(!o,"Mutation batch "+n+" applied to document "+o+" resulted in null"))})}),r},e}(),xr=function(){function e(){this.mutationQueue=[],this.nextBatchId=1,this.highestAcknowledgedBatchId=nr,this.lastStreamToken=i(),this.garbageCollector=null,this.batchesByDocumentKey=new en(Yn.compareByKey)}return e.prototype.start=function(){return 0===this.mutationQueue.length&&(this.nextBatchId=1,this.highestAcknowledgedBatchId=nr),Ho(this.highestAcknowledgedBatchIdthis.highestAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order");var r=this.indexOfExistingBatchId(n,"acknowledged"),o=this.mutationQueue[r];return Ho(n===o.batchId,"Queue ordering failure: expected batch "+n+", got batch "+o.batchId),Ho(!o.isTombstone(),"Can't acknowledge a previously removed batch"),this.highestAcknowledgedBatchId=n,this.lastStreamToken=e,Gn.resolve()},e.prototype.getLastStreamToken=function(){return Gn.resolve(this.lastStreamToken)},e.prototype.setLastStreamToken=function(n,t){return this.lastStreamToken=t,Gn.resolve()},e.prototype.addMutationBatch=function(d,t,e){Ho(0!==e.length,"Mutation batches should not be empty");var n=this.nextBatchId;this.nextBatchId++,0n?0:n,o;rn?n=0:n>=e?n=e:n++,Gn.resolve(this.getAllLiveMutationBatchesBeforeIndex(n))},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(a,s){var e=this,t=new Yn(s,0),n=new Yn(s,Ft),o=[];return this.batchesByDocumentKey.forEachInRange([t,n],function(n){Ho(s.equals(n.key),"Should only iterate over a single key's batches");var t=e.findMutationBatch(n.targetOrBatchId);Ho(null!==t,"Batches in the index must exist in the main table"),o.push(t)}),Gn.resolve(o)},e.prototype.getAllMutationBatchesAffectingQuery=function(d,t){var l=this,n=t.path,r=n.length+1,e=n;ae.isDocumentKey(e)||(e=e.child(""));var o=new Yn(new ae(e),0),a=new en(P);this.batchesByDocumentKey.forEachWhile(function(o){var t=o.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(a=a.add(o.targetOrBatchId)),!0)},o);var i=[];return a.forEach(function(n){var t=l.findMutationBatch(n);null!==t&&i.push(t)}),Gn.resolve(i)},e.prototype.removeMutationBatches=function(c,t){var e=t.length;Ho(0t||t>=this.mutationQueue.length)return null;var e=this.mutationQueue[t];return Ho(e.batchId===o,"If found batch must match"),e.isTombstone()?null:e},e}(),_r=function(){function e(){this.queries=new jn(function(e){return e.canonicalId()}),this.lastRemoteSnapshotVersion=Ge.MIN,this.highestTargetId=0,this.references=new Xn}return e.prototype.start=function(){return Gn.resolve()},e.prototype.getLastRemoteSnapshotVersion=function(){return this.lastRemoteSnapshotVersion},e.prototype.getHighestTargetId=function(){return this.highestTargetId},e.prototype.setLastRemoteSnapshotVersion=function(n,t){return this.lastRemoteSnapshotVersion=t,Gn.resolve()},e.prototype.addQueryData=function(o,t){this.queries.set(t.query,t);var e=t.targetId;return e>this.highestTargetId&&(this.highestTargetId=e),Gn.resolve()},e.prototype.removeQueryData=function(n,t){return this.queries.delete(t.query),this.references.removeReferencesForId(t.targetId),Gn.resolve()},e.prototype.getQueryData=function(o,t){var e=this.queries.get(t)||null;return Gn.resolve(e)},e.prototype.addMatchingKeys=function(o,t,e){return this.references.addReferences(t,e),Gn.resolve()},e.prototype.removeMatchingKeys=function(o,t,e){return this.references.removeReferences(t,e),Gn.resolve()},e.prototype.removeMatchingKeysForTargetId=function(n,t){return this.references.removeReferencesForId(t),Gn.resolve()},e.prototype.getMatchingKeysForTargetId=function(o,t){var e=this.references.referencesForId(t);return Gn.resolve(e)},e.prototype.setGarbageCollector=function(e){this.references.setGarbageCollector(e)},e.prototype.containsKey=function(n,t){return this.references.containsKey(n,t)},e}(),Dr=function(){function e(){this.docs=X()}return e.prototype.addEntry=function(n,t){return this.docs=this.docs.insert(t.key,t),Gn.resolve()},e.prototype.removeEntry=function(n,t){return this.docs=this.docs.remove(t),Gn.resolve()},e.prototype.getEntry=function(n,t){return Gn.resolve(this.docs.get(t))},e.prototype.getDocumentsMatchingQuery=function(d,t){for(var e=Q(),n=new ae(t.path.child("")),r=this.docs.getIteratorFrom(n);r.hasNext();){var o=r.getNext(),i=o.key,a=o.value;if(!t.path.isPrefixOf(i.path))break;a instanceof se&&t.matches(a)&&(e=e.insert(a.key,a))}return Gn.resolve(e)},e}(),Mr=function(){function e(){this.mutationQueues={},this.remoteDocumentCache=new Dr,this.queryCache=new _r,this.started=!1}return e.prototype.start=function(){return Ho(!this.started,"MemoryPersistence double-started!"),this.started=!0,Promise.resolve()},e.prototype.shutdown=function(){return Ho(this.started,"MemoryPersistence shutdown without start!"),this.started=!1,Promise.resolve()},e.prototype.getMutationQueue=function(n){var t=this.mutationQueues[n.toKey()];return t||(t=new xr,this.mutationQueues[n.toKey()]=t),t},e.prototype.getQueryCache=function(){return this.queryCache},e.prototype.getRemoteDocumentCache=function(){return this.remoteDocumentCache},e.prototype.runTransaction=function(n,t){return So("MemoryPersistence","Starting transaction:",n),t(new Fr).toPromise()},e}(),Fr=function(){return function(){}}(),Br=function(){function e(){this.isEager=!1}return e.prototype.addGarbageSource=function(){},e.prototype.removeGarbageSource=function(){},e.prototype.addPotentialGarbageKey=function(){},e.prototype.collectGarbage=function(){return Gn.resolve(J())},e}(),Ur=function(){function e(){var o=this;this.promise=new Promise(function(t,e){o.resolve=t,o.reject=e})}return e}(),Vr=function(){function e(o,r,e){this.initialDelayMs=o,this.backoffFactor=r,this.maxDelayMs=e,this.reset()}return e.prototype.reset=function(){this.currentBaseMs=0},e.prototype.resetToMax=function(){this.currentBaseMs=this.maxDelayMs},e.prototype.backoffAndWait=function(){var n=new Ur,t=this.currentBaseMs+this.jitterDelayMs();return 0this.maxDelayMs&&(this.currentBaseMs=this.maxDelayMs),n.promise},e.prototype.jitterDelayMs=function(){return(Math.random()-.5)*this.currentBaseMs},e}(),Hr=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),Wr;!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"}(Wr||(Wr={}));var Zn=function(){function e(o,a,e,n){this.queue=o,this.connection=a,this.credentialsProvider=e,this.idle=!1,this.stream=null,this.listener=null,this.backoff=new Vr(n||1e3,1.5,6e4),this.state=Wr.Initial}return e.prototype.isStarted=function(){return this.state===Wr.Backoff||this.state===Wr.Auth||this.state===Wr.Open},e.prototype.isOpen=function(){return this.state===Wr.Open},e.prototype.start=function(e){return this.state===Wr.Error?void this.performBackoff(e):void(Ho(this.state===Wr.Initial,"Already started"),this.listener=e,this.auth())},e.prototype.stop=function(){this.isStarted()&&this.close(Wr.Stopped)},e.prototype.inhibitBackoff=function(){Ho(!this.isStarted(),"Can only inhibit backoff in a stopped state"),this.state=Wr.Initial,this.backoff.reset()},e.prototype.markIdle=function(){var e=this;this.idle=!0,this.queue.schedule(function(){return e.handleIdleCloseTimer()},6e4).catch(function(e){Ho(e.code===Gt.CANCELLED,"Received unexpected error in idle timeout closure. Expected CANCELLED, but was: "+e)})},e.prototype.sendRequest=function(e){this.cancelIdleCheck(),this.stream.send(e)},e.prototype.handleIdleCloseTimer=function(){return this.isOpen()&&this.idle?this.close(Wr.Initial):Promise.resolve()},e.prototype.cancelIdleCheck=function(){this.idle=!1},e.prototype.close=function(r,t){Ho(r==Wr.Error||V(t),"Can't provide an error when not in an error state."),this.cancelIdleCheck(),r==Wr.Error?t&&t.code===Gt.RESOURCE_EXHAUSTED&&(o(""+t),o("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=r;var e=this.listener;return this.listener=null,r==Wr.Stopped?Promise.resolve():e.onClose(t)},e.prototype.tearDown=function(){},e.prototype.auth=function(){var o=this;Ho(this.state===Wr.Initial,"Must be in initial state to auth"),this.state=Wr.Auth,this.credentialsProvider.getToken(!1).then(function(t){o.startStream(t)},function(t){o.queue.schedule(function(){if(o.state!==Wr.Stopped){var e=new Ht(Gt.UNKNOWN,"Fetching auth token failed: "+t.message);return o.handleStreamClose(e)}return Promise.resolve()})})},e.prototype.startStream=function(o){var a=this;if(this.state!==Wr.Stopped){Ho(this.state===Wr.Auth,"Trying to start stream in a non-auth state");var e=function(e,t){a.queue.schedule(function(){return a.stream===e?t():Promise.resolve()})};if(null!==this.listener){var n=this.startRpc(o);this.stream=n,this.stream.onOpen(function(){e(n,function(){return Ho(a.state===Wr.Auth,"Expected stream to be in state auth, but was "+a.state),a.state=Wr.Open,a.listener.onOpen()})}),this.stream.onClose(function(o){e(n,function(){return a.handleStreamClose(o)})}),this.stream.onMessage(function(o){e(n,function(){return a.onMessage(o)})})}}},e.prototype.performBackoff=function(n){var t=this;Ho(this.state===Wr.Error,"Should only perform backoff in an error case"),this.state=Wr.Backoff,this.backoff.backoffAndWait().then(function(){t.queue.schedule(function(){return t.state===Wr.Stopped?Promise.resolve():(t.state=Wr.Initial,t.start(n),Ho(t.isStarted(),"PersistentStream should have started"),Promise.resolve())})})},e.prototype.handleStreamClose=function(e){return Ho(this.isStarted(),"Can't handle server close on non-started stream"),So("PersistentStream","close with error: "+e),this.stream=null,this.close(Wr.Error,e)},e}(),jr=function(d){function t(t,l,n,r,o,i){var a=d.call(this,l,n,r,i)||this;return a.databaseInfo=t,a.serializer=o,a}return Hr(t,d),t.prototype.startRpc=function(e){return this.connection.openStream("Listen",e)},t.prototype.onMessage=function(o){this.backoff.reset();var t=this.serializer.fromWatchChange(o),e=this.serializer.versionFromListenResponse(o);return this.listener.onWatchChange(t,e)},t.prototype.watch=function(o){var t={database:this.serializer.encodedDatabaseId,addTarget:this.serializer.toTarget(o)},e=this.serializer.toListenRequestLabels(o);e&&(t.labels=e),this.sendRequest(t)},t.prototype.unwatch=function(n){var t={};t.database=this.serializer.encodedDatabaseId,t.removeTarget=n,this.sendRequest(t)},t}(Zn),qr=function(d){function t(t,l,n,r,o,i){var a=d.call(this,l,n,r,i)||this;return a.databaseInfo=t,a.serializer=o,a.y=!1,a}return Hr(t,d),Object.defineProperty(t.prototype,"handshakeComplete",{get:function(){return this.y},enumerable:!0,configurable:!0}),t.prototype.start=function(t){this.y=!1,d.prototype.start.call(this,t)},t.prototype.tearDown=function(){this.y&&this.writeMutations([])},t.prototype.startRpc=function(e){return this.connection.openStream("Write",e)},t.prototype.onMessage=function(o){if(Ho(!!o.streamToken,"Got a write response without a stream token"),this.lastStreamToken=o.streamToken,this.y){this.backoff.reset();var t=this.serializer.fromWriteResults(o.writeResults),e=this.serializer.fromVersion(o.commitTime);return this.listener.onMutationResult(e,t)}return Ho(!o.writeResults||0===o.writeResults.length,"Got mutation results for handshake"),this.y=!0,this.listener.onHandshakeComplete()},t.prototype.writeHandshake=function(){Ho(this.isOpen(),"Writing handshake requires an opened stream"),Ho(!this.y,"Handshake already completed");var e={};e.database=this.serializer.encodedDatabaseId,this.sendRequest(e)},t.prototype.writeMutations=function(o){var r=this;Ho(this.isOpen(),"Writing mutations requires an opened stream"),Ho(this.y,"Handshake must be complete before writing mutations"),Ho(0this.pendingWrites.length},e.prototype.outstandingWrites=function(){return this.pendingWrites.length},e.prototype.commit=function(e){Ho(this.canWriteMutations(),"commit called when batches can't be written"),this.lastBatchSeen=e.batchId,this.pendingWrites.push(e),this.shouldStartWriteStream()?this.startWriteStream():this.isNetworkEnabled()&&this.writeStream.handshakeComplete&&this.writeStream.writeMutations(e.mutations)},e.prototype.shouldStartWriteStream=function(){return this.isNetworkEnabled()&&!this.writeStream.isStarted()&&0t.indexOf("Firestore Test Simulated Error")&&setTimeout(function(){throw e},0),e}).then(function(){r.operationInProgress=!1})}),this.tail},e.prototype.verifyOperationInProgress=function(){Ho(this.operationInProgress,"verifyOpInProgress() called when no op in progress on this queue.")},e.prototype.drain=function(o){var t=this;return this.delayedOperations.forEach(function(e){e.handle&&(clearTimeout(e.handle),o?t.scheduleInternal(e.op).then(e.deferred.resolve,e.deferred.reject):e.deferred.reject(new Ht(Gt.CANCELLED,"Operation cancelled by shutdown")))}),this.delayedOperations=[],this.delayedOperationsCount=0,this.schedule(function(){return Promise.resolve()})},e}(),oo=function(){function e(e){this.uid=e}return e.prototype.isUnauthenticated=function(){return null==this.uid},e.prototype.toKey=function(){return this.isUnauthenticated()?"anonymous-user":"uid:"+this.uid},e.prototype.equals=function(e){return e.uid===this.uid},e.UNAUTHENTICATED=new e(null),e.GOOGLE_CREDENTIALS=new e("google-credentials-uid"),e.FIRST_PARTY=new e("first-party-uid"),e}(),io=function(){function e(n,o){this.user=o,this.type="OAuth",this.authHeaders={Authorization:"Bearer "+n}}return e}(),ao=function(){function e(){this.userListener=null}return e.prototype.getToken=function(){return Promise.resolve(null)},e.prototype.setUserChangeListener=function(e){Ho(!this.userListener,"Can only call setUserChangeListener() once."),this.userListener=e,e(oo.UNAUTHENTICATED)},e.prototype.removeUserChangeListener=function(){Ho(null!==this.userListener,"removeUserChangeListener() when no listener registered"),this.userListener=null},e}(),so=function(){function e(n){var o=this;this.app=n,this.tokenListener=null,this.userCounter=0,this.userListener=null,this.tokenListener=function(){var e=o.getUser();o.currentUser&&e.equals(o.currentUser)||(o.currentUser=e,o.userCounter++,o.userListener&&o.userListener(o.currentUser))},this.userCounter=0,this.app.INTERNAL.addAuthTokenListener(this.tokenListener)}return e.prototype.getToken=function(o){var r=this;Ho(null!=this.tokenListener,"getToken cannot be called after listener removed.");var e=this.userCounter;return this.app.INTERNAL.getToken(o).then(function(n){if(r.userCounter!==e)throw new Ht(Gt.ABORTED,"getToken aborted due to uid change.");return n?(Ho("string"==typeof n.accessToken,"Invalid tokenData returned from getToken():"+n),new io(n.accessToken,r.currentUser)):null})},e.prototype.setUserChangeListener=function(e){Ho(!this.userListener,"Can only call setUserChangeListener() once."),this.userListener=e,this.currentUser&&e(this.currentUser)},e.prototype.removeUserChangeListener=function(){Ho(null!=this.tokenListener,"removeUserChangeListener() called twice"),Ho(null!==this.userListener,"removeUserChangeListener() called when no listener registered"),this.app.INTERNAL.removeAuthTokenListener(this.tokenListener),this.tokenListener=null,this.userListener=null},e.prototype.getUser=function(){"function"!=typeof this.app.INTERNAL.getUid&&Wo("This version of the Firestore SDK requires at least version 3.7.0 of firebase.js.");var e=this.app.INTERNAL.getUid();return Ho(null===e||"string"==typeof e,"Received invalid UID: "+e),new oo(e)},e}(),uo=function(){function e(n,o){this.gapi=n,this.sessionIndex=o,this.type="FirstParty",this.user=oo.FIRST_PARTY,Ho(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return Object.defineProperty(e.prototype,"authHeaders",{get:function(){return{Authorization:this.gapi.auth.getAuthHeaderValueForFirstParty([]),"X-Goog-AuthUser":this.sessionIndex}},enumerable:!0,configurable:!0}),e}(),co=function(){function e(n,o){this.gapi=n,this.sessionIndex=o,Ho(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return e.prototype.getToken=function(){return Promise.resolve(new uo(this.gapi,this.sessionIndex))},e.prototype.setUserChangeListener=function(e){e(oo.FIRST_PARTY)},e.prototype.removeUserChangeListener=function(){},e}(),ho=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),lo=function(){function e(){}return e.delete=function(){return fo.instance},e.serverTimestamp=function(){return po.instance},e}(),fo=function(n){function t(){return n.call(this)||this}return ho(t,n),t.instance=new t,t}(lo),po=function(n){function t(){return n.call(this)||this}return ho(t,n),t.instance=new t,t}(lo),yo=s(lo,"Use FieldValue.() instead."),Xr=/^__.*__$/,go=function(){function e(o,r,e){this.data=o,this.fieldMask=r,this.fieldTransforms=e}return e.prototype.toMutations=function(o,t){var e=[];return null===this.fieldMask?e.push(new rn(o,this.data,t)):e.push(new on(o,this.data,this.fieldMask,t)),0=n.docs.size,"Too many documents returned on a document query");var t=n.docs.get(e.q);s.next(new Oo(e.firestore,e.q,t,n.fromCache))}},error:t}),o=this._.listen(Pe.atPath(this.q.path),n,a);return function(){n.mute(),e._.unlisten(o)}},o.prototype.get=function(){var o=this;return m("DocumentReference.get",arguments,0),new Promise(function(a,e){var i=o.onSnapshotInternal({includeQueryMetadataChanges:!0,includeDocumentMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(n){i(),!n.exists&&n.metadata.fromCache?e(new Ht(Gt.ABORTED,"Failed to get document because the client is offline.")):a(n)},error:e})})},o}(),Oo=function(){function e(o,a,e,n){this.Q=o,this.q=a,this.nt=e,this.rt=n}return e.prototype.data=function(){if(m("DocumentSnapshot.data",arguments,0),!this.nt)throw new Ht(Gt.NOT_FOUND,"This document doesn't exist. Check doc.exists to make sure the document exists before calling doc.data().");return this.convertObject(this.nt.data)},e.prototype.get=function(n){if(m("DocumentSnapshot.get",arguments,1),!this.nt)throw new Ht(Gt.NOT_FOUND,"This document doesn't exist. Check doc.exists to make sure the document exists before calling doc.get().");var t=this.nt.data.field(At("DocumentSnapshot.get",n));return void 0===t?void 0:this.convertValue(t)},Object.defineProperty(e.prototype,"id",{get:function(){return this.q.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new Ro(this.q,this.Q)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"exists",{get:function(){return null!==this.nt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return{hasPendingWrites:null!==this.nt&&this.nt.hasLocalMutations,fromCache:this.rt}},enumerable:!0,configurable:!0}),e.prototype.convertObject=function(o){var a=this,e={};return o.forEach(function(n,t){e[n]=a.convertValue(t)}),e},e.prototype.convertValue=function(r){if(r instanceof Ne)return this.convertObject(r);if(r instanceof Ae)return this.convertArray(r);if(r instanceof De){var t=r.value(),e=this.Q.ensureClientConfigured().databaseId();return r.databaseId.equals(e)||o("Document "+this.q.path+" contains a document reference within a different database ("+r.databaseId.projectId+"/"+r.databaseId.database+") which is not supported. It will be treated as a reference in the current database ("+e.projectId+"/"+e.database+") instead."),new Ro(t,this.Q)}return r.value()},e.prototype.convertArray=function(n){var o=this;return n.internalValue.map(function(e){return o.convertValue(e)})},e}(),Mo=function(){function s(n,o){this.ot=n,this.firestore=o}return s.prototype.where=function(t,e,n){m("Query.where",arguments,3),b("Query.where","string",2,e),I("Query.where",3,n);var d=At("Query.where",t),i;if(!d.isKeyField())i=this.firestore._dataConverter.parseQueryValue("Query.where",n);else if("string"==typeof n){if(-1!==n.indexOf("/"))throw new Ht(Gt.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(""===n)throw new Ht(Gt.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 o=this.ot.path.child(new re([n]));Ho(0==o.length%2,"Path should be a document key"),i=new De(this.firestore._databaseId,new ae(o))}else{if(!(n instanceof Ro))throw new Ht(Gt.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: "+k(n)+".");i=new De(this.firestore._databaseId,n.q)}var a=W(d,Le.fromString(e),i);return this.validateNewFilter(a),new s(this.ot.addFilter(a),this.firestore)},s.prototype.orderBy=function(t,e){f("Query.orderBy",arguments,1,2),v("Query.orderBy","string",2,e);var n;if(void 0===e||"asc"===e)n=Fe.ASCENDING;else{if("desc"!==e)throw new Ht(Gt.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+e+"', expected 'asc' or 'desc'.");n=Fe.DESCENDING}if(null!==this.ot.startAt)throw new Ht(Gt.INVALID_ARGUMENT,"Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");if(null!==this.ot.endAt)throw new Ht(Gt.INVALID_ARGUMENT,"Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");var r=At("Query.orderBy",t),o=new qe(r,n);return this.validateNewOrderBy(o),new s(this.ot.addOrderBy(o),this.firestore)},s.prototype.limit=function(t){if(m("Query.limit",arguments,1),b("Query.limit","number",1,t),0>=t)throw new Ht(Gt.INVALID_ARGUMENT,"Invalid Query. Query limit ("+t+") is invalid. Limit must be positive.");return new s(this.ot.withLimit(t),this.firestore)},s.prototype.startAt=function(t){for(var e=[],n=1;nn.length)throw new Ht(Gt.INVALID_ARGUMENT,"Too many arguments provided to "+d+"(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");for(var r=[],o=0,i;o, or >=) must be on the same field. But you have inequality filters on '"+t+"' and '"+o.field+"'");var e=this.ot.getFirstOrderByField();null!==e&&this.validateOrderByAndInequalityMatch(o.field,e)}},s.prototype.validateNewOrderBy=function(n){if(null===this.ot.getFirstOrderByField()){var t=this.ot.getInequalityFilterField();null!==t&&this.validateOrderByAndInequalityMatch(t,n.field)}},s.prototype.validateOrderByAndInequalityMatch=function(n,t){if(!t.equals(n))throw new Ht(Gt.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+n+"' and so you must also use '"+n+"' as your first Query.orderBy(), but your first Query.orderBy() is on field '"+t+"' instead.")},s}(),_o=function(){function e(o,r,e){this.Q=o,this.it=r,this.at=e,this._cachedChanges=null,this.metadata={fromCache:e.fromCache,hasPendingWrites:e.hasPendingWrites}}return Object.defineProperty(e.prototype,"docs",{get:function(){var n=[];return this.forEach(function(t){return n.push(t)}),n},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return this.at.docs.isEmpty()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.at.docs.size},enumerable:!0,configurable:!0}),e.prototype.forEach=function(o,t){var e=this;f("QuerySnapshot.forEach",arguments,1,2),b("QuerySnapshot.forEach","function",1,o),this.at.docs.forEach(function(n){o.call(t,e.convertToDocumentImpl(n))})},Object.defineProperty(e.prototype,"query",{get:function(){return new Mo(this.it,this.Q)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"docChanges",{get:function(){return this._cachedChanges||(this._cachedChanges=xt(this.Q,this.at)),this._cachedChanges},enumerable:!0,configurable:!0}),e.prototype.convertToDocumentImpl=function(e){return new Oo(this.Q,e.key,e,this.metadata.fromCache)},e}(),Po=function(o){function t(t,a){var n=o.call(this,Pe.atPath(t),a)||this;if(1!=t.length%2)throw new Ht(Gt.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t.canonicalString()+" has "+t.length);return n}return To(t,o),Object.defineProperty(t.prototype,"id",{get:function(){return this.ot.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this.ot.path.popLast();return e.isEmpty()?null:new Ro(new ae(e),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this.ot.path.canonicalString()},enumerable:!0,configurable:!0}),t.prototype.doc=function(n){if(f("CollectionReference.doc",arguments,0,1),0===arguments.length&&(n=zt.newId()),b("CollectionReference.doc","string",1,n),""===n)throw new Ht(Gt.INVALID_ARGUMENT,"Document path must be a non-empty string");var t=re.fromString(n);return Ro.forPath(this.ot.path.child(t),this.firestore)},t.prototype.add=function(n){m("CollectionReference.add",arguments,1),b("CollectionReference.add","object",1,n);var t=this.doc();return t.set(n).then(function(){return t})},t}(Mo),Lo=s(ko,"Use firebase.firestore() instead."),Qr=s(No,"Use firebase.firestore().runTransaction() instead."),Yr=s(Ao,"Use firebase.firestore().batch() instead."),Jr=s(Ro,"Use firebase.firestore().doc() instead."),$r=s(Oo),Zr=s(Mo),ea=s(_o),ta=s(Po,"Use firebase.firestore().collection() instead."),na={Firestore:Lo,GeoPoint:Go,Blob:Yt,Transaction:Qr,WriteBatch:Yr,DocumentReference:Jr,DocumentSnapshot:$r,Query:Zr,QuerySnapshot:ea,CollectionReference:ta,FieldPath:Pn,FieldValue:yo,setLogLevel:ko.setLogLevel};t.registerFirestore=Mt,Mt(zo.default)},115:function(e,t,n){var a=Math.floor,d=Math.max;(function(t){(function(){function s(e){return"string"==typeof e}function o(){}function i(o){var r=typeof o;if("object"==r){if(!o)return"null";if(o instanceof Array)return"array";if(o instanceof Object)return r;var e=Object.prototype.toString.call(o);if("[object Window]"==e)return"object";if("[object Array]"==e||"number"==typeof o.length&&void 0!==o.splice&&void 0!==o.propertyIsEnumerable&&!o.propertyIsEnumerable("splice"))return"array";if("[object Function]"==e||void 0!==o.call&&void 0!==o.propertyIsEnumerable&&!o.propertyIsEnumerable("call"))return"function"}else if("function"==r&&void 0===o.call)return"object";return r}function l(e){return"array"==i(e)}function c(n){var t=i(n);return"array"==t||"object"==t&&"number"==typeof n.length}function h(e){return"function"==i(e)}function m(n){var o=typeof n;return"object"==o&&null!=n||"function"==o}function n(e){return e.call.apply(e.bind,arguments)}function p(o,a){if(!o)throw Error();if(2t?1:0}function j(n,t){t.unshift(n),u.call(this,v.apply(null,t)),t.shift()}function G(e){throw new j("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1))}function $(){0!=Ao&&(Lo[this[k]||(this[k]=++q)]=this),this.i=this.i,this.w=this.w}function w(a){t:{for(var t=qe,e=a.length,n=s(a)?a.split(""):a,r=0;rt?null:s(a)?a.charAt(t):a[t]}function Z(n){if(!l(n))for(var t=n.length-1;0<=t;t--)delete n[t];n.length=0}function _e(){return Array.prototype.concat.apply([],arguments)}function et(o){var t=o.length;if(0n.keyCode||void 0!=n.returnValue)){t:{var r=!1;if(0==n.keyCode)try{n.keyCode=-1;break t}catch(e){r=!0}(r||void 0==n.returnValue)&&(n.returnValue=!0)}for(n=[],r=t.a;r;r=r.parentNode)n.push(r);for(a=a.type,r=n.length-1;0<=r;r--){t.a=n[r];var o=Tt(n[r],a,!0,t);s=s&&o}for(r=0;rt.b&&(t.b++,n.next=t.a,t.a=n)}dr=!1}function zt(t,e){Lt.call(this),this.b=t||1,this.a=e||Io,this.f=f(this.ib,this),this.g=No()}function Kt(e){e.$=!1,e.K&&(e.a.clearTimeout(e.K),e.K=null)}function Gt(o,r,a){if(h(o))a&&(o=f(o,a));else{if(!o||"function"!=typeof o.handleEvent)throw Error("Invalid listener argument");o=f(o.handleEvent,o)}return 2147483647<+r?-1:Io.setTimeout(o,r||0)}function Xt(o,t,e){$.call(this),this.f=null==e?o:f(o,e),this.c=t,this.b=f(this.bb,this),this.a=[]}function Qt(e){e.X=Gt(e.b,e.c),e.f.apply(null,e.a)}function Yt(e){$.call(this),this.b=e,this.a={}}function C(e){y(e.a,function(n,t){this.a.hasOwnProperty(t)&&Et(n)},e),e.a={}}function Jt(o,t,e){this.reset(o,t,e,void 0,void 0)}function $t(e){this.f=e,this.b=this.c=this.a=null}function Zt(n,t){this.name=n,this.value=t}function D(e){return e.c?e.c:e.a?D(e.a):(G("Root logger has no level set."),null)}function en(o){xr||(xr=new $t(""),vr[""]=xr,xr.c=yr);var t;if(!(t=vr[o])){t=new $t(o);var e=o.lastIndexOf("."),n=o.substr(e+1);e=en(o.substr(0,e)),e.b||(e.b={}),e.b[n]=t,t.a=e,vr[o]=t}return t}function tn(n,t){n&&n.log(gr,t,void 0)}function E(n,t){n&&n.log(fr,t,void 0)}function nn(n,t){n&&n.log(br,t,void 0)}function F(){this.a=en("goog.labs.net.webChannel.WebChannelDebug"),this.b=!0}function on(d,t,e,n,r,o){ln(d,function(){if(!d.b)i=o;else if(o){for(var i="",a=o.split("&"),s=0,p;so.length)){var i=o[1];if(l(i)&&!(1>i.length)){var a=i[0];if("noop"!=a&&"stop"!=a&&"close"!=a)for(var s=1;se;e++){n=t[e];try{return new ActiveXObject(n),o.b=n}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return o.b}function Sn(o,t,e,n){this.i=o,this.b=t,this.f=e,this.T=n||1,this.N=new Yt(this),this.S=Tr,o=this.H=new zt,o.b=wr,o.K&&o.$?(Kt(o),o.start()):o.K&&Kt(o),this.j=null,this.c=!1,this.m=this.g=this.h=this.J=this.D=this.U=this.w=null,this.s=[],this.a=null,this.F=0,this.l=this.o=null,this.C=-1,this.B=!1,this.P=0,this.I=null,this.M=!1}function K(n,t){return 0===n?"Non-200 return code ("+t+")":1===n?"XMLHTTP failure (no data)":2===n?"HttpConnection timeout":"Unknown error"}function En(o,t,e){o.J=1,o.h=Gn(P(t)),o.m=e,o.M=!0,Tn(o,null)}function kn(o,t,e,n){o.J=1,o.h=Gn(P(t)),o.m=null,o.M=e,Tn(o,n)}function Tn(t,e){t.D=No(),Ln(t),t.g=P(t.h),Q(t.g,"t",t.T),t.F=0,t.a=t.i.da(t.i.ia()?e:null),0t)&&(3!=t||Mo||a.a.V())){a.B||4!=t||7==e||un(8==e||0>=n?3:2),On(a);var r=a.a.W();a.C=r,(e=a.a.V())||dn(a.b,function(){return"No response text for uri "+a.g+" status "+r}),a.c=200==r,rn(a.b,a.o,a.g,a.f,a.T,t,r),a.c?(a.M?(In(a,t,e),Mo&&a.c&&3==t&&Nn(a)):(an(a.b,a.f,e,null),Dn(a,e)),4==t&&_n(a),a.c&&!a.B&&(4==t?a.i.ua(a):(a.c=!1,Ln(a)))):(400==r&&0t.length?Nr:(t=t.substr(n,e),o.F=n+e,t))}function Ln(t){t.U=No()+t.S,Rn(t,t.S)}function Rn(n,t){if(null!=n.w)throw Error("WatchDog timer not null");n.w=fn(f(n.cb,n),t)}function On(e){e.w&&(Io.clearTimeout(e.w),e.w=null)}function Pn(e){e.i.Ja()||e.B||e.i.ua(e)}function _n(n){On(n);var t=n.I;t&&"function"==typeof t.Z&&t.Z(),n.I=null,Kt(n.H),C(n.N),n.a&&(t=n.a,n.a=null,t.abort(),t.Z())}function Dn(n,t){try{n.i.Ma(n,t),un(4)}catch(t){I(n.b,t,"Error in httprequest callback")}}function Mn(o){if(o.v&&"function"==typeof o.v)return o.v();if(s(o))return o.split("");if(c(o)){for(var t=[],e=o.length,n=0;n2*n.c&&Vn(n),!0)}function Vn(a){if(a.c!=a.a.length){for(var t=0,e=0,n;tt)throw Error("Bad port number "+t);n.i=t}else n.i=null}function zn(o,t,e){t instanceof Zn?(o.c=t,ao(o.c,o.h)):(e||(t=Jn(t,Pr)),o.c=new Zn(t,o.h))}function Kn(o,t,e){o.c.set(t,e)}function Q(n,t,e){l(e)||(e=[e+""]),no(n.c,t,e)}function Gn(t){return Kn(t,"zx",a(2147483648*Math.random()).toString(36)+Math.abs(a(2147483648*Math.random())^No()).toString(36)),t}function Xn(e){return e instanceof Hn?P(e):new Hn(e,void 0)}function Qn(a,t,e,n){var r=new Hn(null,void 0);return a&&L(r,a),t&&jn(r,t),e&&qn(r,e),n&&(r.a=n),r}function Yn(n,t){return n?t?decodeURI(n.replace(/%25/g,"%2525")):decodeURIComponent(n):""}function Jn(o,t,e){return s(o)?(o=encodeURI(o).replace(t,$n),e&&(o=o.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),o):null}function $n(e){return e=e.charCodeAt(0),"%"+(15&e>>4).toString(16)+(15&e).toString(16)}function Zn(n,t){this.b=this.a=null,this.c=n||null,this.f=!!t}function eo(o){o.a||(o.a=new Bn,o.b=0,o.c&&O(o.c,function(t,e){o.add(decodeURIComponent(t.replace(/\+/g," ")),e)}))}function R(n,t){eo(n),t=ro(n,t),Wn(n.a.b,t)&&(n.c=null,n.b-=n.a.get(t).length,Un(n.a,t))}function to(n,t){return eo(n),t=ro(n,t),Wn(n.a.b,t)}function no(o,t,e){R(o,t),0=e.f}function be(n,t){return n.b?n.b==t:!!n.a&&n.a.contains(t)}function ce(n,t){n.a?n.a.add(t):n.b=t}function ae(n,t){n.b&&n.b==t?n.b=null:n.a&&n.a.contains(t)&&Un(n.a.a,S(t))}function de(n){if(null!=n.b)return n.c.concat(n.b.s);if(null!=n.a&&0!=n.a.a.c){var o=n.c;return Oo(n.a.v(),function(e){o=o.concat(e.s)}),o}return et(n.c)}function ee(n,t){n.c=n.c.concat(t)}function fe(){}function ge(){this.a=new fe}function he(o,a,e){var i=e||"";try{Fn(o,function(e,t){var n=e;m(e)&&(n=Pt(e)),a.push(i+t+"="+encodeURIComponent(n))})}catch(e){throw a.push(i+"type="+encodeURIComponent("_badmap")),e}}function ie(o,t){var e=new F;dn(e,"TestLoadImage: loading "+o);var n=new Image;n.onload=b(je,e,n,"TestLoadImage: loaded",!0,t),n.onerror=b(je,e,n,"TestLoadImage: error",!1,t),n.onabort=b(je,e,n,"TestLoadImage: abort",!1,t),n.ontimeout=b(je,e,n,"TestLoadImage: timeout",!1,t),Io.setTimeout(function(){n.ontimeout&&n.ontimeout()},1e4),n.src=o}function je(a,t,e,n,r){try{dn(a,e),t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,r(n)}catch(t){I(a,t)}}function ke(e){Lt.call(this),this.headers=new Bn,this.F=e||null,this.f=!1,this.D=this.a=null,this.M=this.s="",this.j=0,this.g="",this.h=this.I=this.o=this.H=!1,this.l=0,this.B=null,this.N=Br,this.C=this.m=!1}function T(e){return Fo&<(9)&&"number"==typeof e.timeout&&void 0!==e.ontimeout}function qe(e){return"content-type"==e.toLowerCase()}function Co(n,t){n.f=!1,n.a&&(n.h=!0,n.a.abort(),n.h=!1),n.g=t,n.j=5,oe(n),te(n)}function oe(e){e.H||(e.H=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function re(s){if(s.f&&void 0!==wo)if(s.D[1]&&4==pe(s)&&2==s.W())nn(s.b,M(s,"Local request error detected and ignored"));else if(s.o&&4==pe(s))Gt(s.La,0,s);else if(s.dispatchEvent("readystatechange"),4==pe(s)){nn(s.b,M(s,"Request complete")),s.f=!1;try{var t=s.W();t:switch(t){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break t;default:e=!1;}var n;if(!(n=e)){var r;if(r=0===t){var o=(s.s+"").match(Ar)[1]||null;if(!o&&Io.self&&Io.self.location){var d=Io.self.location.protocol;o=d.substr(0,d.length-1)}r=!le.test(o?o.toLowerCase():"")}n=r}n?(s.dispatchEvent("complete"),s.dispatchEvent("success")):(s.j=6,s.g=s.Ga()+" ["+s.W()+"]",oe(s))}finally{te(s)}}}function te(a,t){if(a.a){se(a);var e=a.a,n=a.D[0]?o:null;a.a=null,a.D=null,t||a.dispatchEvent("ready");try{e.onreadystatechange=n}catch(t){(a=a.b)&&a.log(mr,"Problem encountered resetting onreadystatechange: "+t.message,void 0)}}}function se(e){e.a&&e.C&&(e.a.ontimeout=null),e.B&&(Io.clearTimeout(e.B),e.B=null)}function pe(e){return e.a?e.a.readyState:0}function M(n,t){return t+" ["+n.M+" "+n.s+" "+n.W()+"]"}function U(n){var o="";return y(n,function(e,t){o+=t,o+=":",o+=e,o+="\r\n"}),o}function ue(a,t,e){t:{for(n in e){var n=!1;break t}n=!0}if(n)return a;if(e=U(e),s(a)){if(t=encodeURIComponent(t+""),e=null==e?"":"="+encodeURIComponent(e+""),t+=e){if(e=a.indexOf("#"),0>e&&(e=a.length),0>(n=a.indexOf("?"))||n>e){n=e;var r=""}else r=a.substring(n+1,e);a=[a.substr(0,n),r,a.substr(e)],e=a[1],a[1]=t?e?e+"&"+t:t:e,a=a[0]+(a[1]?"?"+a[1]:"")+a[2]}return a}return Kn(a,t,e),a}function ve(e){this.ya=0,this.g=[],this.a=new F,this.H=new go,this.ja=this.wa=this.F=this.ka=this.b=this.J=this.j=this.U=this.h=this.M=this.i=null,this.Ua=this.P=0,this.la=this.B=this.o=this.m=this.l=this.f=null,this.s=this.xa=this.N=-1,this.T=this.w=this.C=0,this.S=e&&e.supportsCrossDomainXhr||!1,this.I="",this.c=new bo(e&&e.concurrentRequestLimit),this.ma=new ge,this.D=!e||void 0===e.backgroundChannelTest||e.backgroundChannelTest,this.Ta=e&&e.fastHandshake||!1,e&&e.Ea&&this.a.Ea()}function we(t){if(dn(t.a,"disconnect()"),xe(t),3==t.G){var e=t.P++,n=P(t.F);Kn(n,"SID",t.I),Kn(n,"RID",e),Kn(n,"TYPE","terminate"),He(t,n),e=new Sn(t,t.a,e,void 0),e.J=2,e.h=Gn(P(n)),n=!1,Io.navigator&&Io.navigator.sendBeacon&&(n=Io.navigator.sendBeacon(""+e.h,"")),!n&&Io.Image&&(new Image().src=e.h,n=!0),n||(e.a=e.i.da(null),e.a.fa(e.h)),e.D=No(),Ln(e)}V(t)}function xe(e){e.B&&(e.B.abort(),e.B=null),e.b&&(e.b.cancel(),e.b=null),e.m&&(Io.clearTimeout(e.m),e.m=null),Eo(e),e.c.cancel(),e.l&&(Io.clearTimeout(e.l),e.l=null)}function ye(n,t){1e3==n.g.length&&H(n.a,function(){return"Already have 1000 queued maps upon queueing "+Pt(t)}),n.g.push(new yo(n.Ua++,t)),3==n.G&&Ce(n)}function Ce(e){xo(e.c)||e.l||(e.l=fn(f(e.Oa,e),0),e.C=0)}function De(o,t){var e=o.c;return(e.b?1:e.a?e.a.u():0)>=o.c.f-(o.l?1:0)?(H(o.a,"Unexpected retry request is scheduled."),!1):o.l?(dn(o.a,"Use the retry request that is already scheduled."),o.g=t.s.concat(o.g),!0):!(1==o.G||2==o.G||2<=o.C||(dn(o.a,"Going to retry POST"),o.l=fn(f(o.Oa,o,t),Be(o,o.C)),o.C++,0))}function Ee(o,t){var e=t?t.f:o.P++;var n=P(o.F);Kn(n,"SID",o.I),Kn(n,"RID",e),Kn(n,"AID",o.N),He(o,n),o.h&&o.i&&ue(n,o.h,o.i),e=new Sn(o,o.a,e,o.C+1),null===o.h&&(e.j=o.i),t&&(o.g=t.s.concat(o.g)),t=ze(o,e),e.setTimeout(10000+Math.round(1e4*Math.random())),ce(o.c,e),En(e,n,t)}function He(n,o){n.f&&Fn({},function(e,t){Kn(o,t,e)})}function ze(r,t){var e=Math.min(r.g.length,1e3),n=r.f?f(r.f.Va,r.f,r):null;t:for(var o=r.g,i=-1,a;;){a=["count="+e],-1==i?0(c-=i))i=d(0,o[p].a-100),s=!1;else try{he(u,a,"req"+c+"_")}catch(e){n&&n(u)}}if(s){n=a.join("&");break t}}return r=r.g.splice(0,e),t.s=r,n}function Ge(n){if(!n.b&&!n.m){n.T=1;var t=n.Na;cr||jt(),dr||(cr(),dr=!0),lr.add(t,n),n.w=0}}function Ie(e){return e.b||e.m?(H(e.a,"Request already in progress"),!1):!(3<=e.w||(dn(e.a,"Going to retry GET"),e.T++,e.m=fn(f(e.Na,e),Be(e,e.w)),e.w++,0))}function Je(o,t,e){dn(o.a,"Test Connection Finished");var n=t.m;n&&vo(o.c,n),o.la=e,o.s=t.f,dn(o.a,"connectChannel_()"),o.F=Ae(o,o.ka),Ce(o)}function So(n,t){dn(n.a,"Test Connection Failed"),n.s=t.f,Fe(n,2)}function Eo(e){null!=e.o&&(Io.clearTimeout(e.o),e.o=null)}function Be(o,t){var e=5e3+a(1e4*Math.random());return o.ra()||(dn(o.a,"Inactive channel"),e*=2),e*t}function Fe(r,t){if(ln(r.a,"Error code "+t),2==t){var e=null;r.f&&(e=null);var n=f(r.hb,r);e||(e=new Hn("//www.google.com/images/cleardot.gif"),Io.location&&"http"==Io.location.protocol||L(e,"https"),Gn(e)),ie(""+e,n)}else mn(2);dn(r.a,"HttpChannel: error - "+t),r.G=0,r.f&&r.f.Ba(t),V(r),xe(r)}function V(n){if(n.G=0,n.s=-1,n.f){var t=de(n.c);0==t.length&&0==n.g.length||(dn(n.a,function(){return"Number of undelivered maps, pending: "+t.length+", outgoing: "+n.g.length}),n.c.c.length=0,et(n.g),n.g.length=0),n.f.Aa()}}function Ae(n,t){return t=ko(n,null,t),dn(n.a,"GetForwardChannelUri: "+t),t}function Ke(o,t,e){return t=ko(o,o.ia()?t:null,e),dn(o.a,"GetBackChannelUri: "+t),t}function ko(a,t,e){var n=Xn(e);if(""!=n.b)t&&jn(n,t+"."+n.b),qn(n,n.i);else{var r=Io.location,i;i=t?t+"."+r.hostname:r.hostname,n=Qn(r.protocol,i,r.port,e)}return a.U&&y(a.U,function(o,t){Kn(n,t,o)}),t=a.j,e=a.J,t&&e&&Kn(n,t,e),Kn(n,"VER",a.oa),He(a,n),n}function Le(){}function Me(){for(var t=arguments[0],e=1,n;ethis.c)throw Error(Ur);this.a=new Pe,this.b=new fo,this.g=null,this.ba()}function Ve(n){if("function"==typeof n.Z)n.Z();else for(var t in n)n[t]=null}function Xe(n,t){this.a=n,this.b=t}function Ye(o){if(this.a=[],o)t:{if(o instanceof Ye){var t=o.O();if(o=o.v(),0>=this.u()){for(var e=this.a,n=0;n>1,o[n].a>e.a);)o[t]=o[n],t=n;o[t]=e}function $e(){Ye.call(this)}function To(n,t){this.f=new $e,Ue.call(this,n,t)}function X(o,t,e,n){this.l=o,this.j=!!n,To.call(this,t,e)}var wo=wo||{},Io=this,k="closure_uid_"+(1e9*Math.random()>>>0),q=0,No=Date.now||function(){return+new Date},t;r(u,Error),u.prototype.name="CustomError";var g=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};r(j,u),j.prototype.name="AssertionError";var Ao=0,Lo={};$.prototype.i=!1,$.prototype.Z=function(){},$.prototype.A=function(){if(this.w)for(;this.w.length;)this.w.shift()()};var Ro=Array.prototype.indexOf?function(n,t){return Array.prototype.indexOf.call(n,t,void 0)}:function(o,t){if(s(o))return s(t)&&1==t.length?o.indexOf(t,0):-1;for(var e=0;eparseFloat(Ho)){Wo=qo+"";break t}}Wo=Ho}var zo={},Ko=Io.document,Go;Go=Ko&&Fo?dt()||("CSS1Compat"==Ko.compatMode?parseInt(Wo,10):5):void 0;var Xo=Object.freeze||function(e){return e},Qo=!Fo||9<=+Go,Yo=Fo&&!lt("9"),Jo=function(){if(!Io.addEventListener||!Object.defineProperty)return!1;var n=!1,t=Object.defineProperty({},"passive",{get:function(){n=!0}});return Io.addEventListener("test",o,t),Io.removeEventListener("test",o,t),n}();pt.prototype.b=function(){this.Pa=!1},r(A,pt);var $o=Xo({2:"touch",3:"pen",4:"mouse"});A.prototype.b=function(){A.L.b.call(this);var e=this.c;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,Yo)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}};var Zo="closure_listenable_"+(0|1e6*Math.random()),er=0;mt.prototype.add=function(s,t,e,n,d){var o=""+s;(s=this.a[o])||(s=this.a[o]=[],this.b++);var i=yt(s,t,n,d);return-1>>0);r(Lt,$),Lt.prototype[Zo]=!0,t=Lt.prototype,t.addEventListener=function(o,t,e,n){bt(this,o,t,e,n)},t.removeEventListener=function(o,t,e,n){St(this,o,t,e,n)},t.dispatchEvent=function(d){var t=this.J,n;if(t)for(n=[];t;t=t.J)n.push(t);t=this.P;var e=d.type||d;if(s(d))d=new pt(d,t);else if(d instanceof pt)d.target=d.target||t;else{var r=d;d=new pt(e,t),at(d,r)}if(r=!0,n)for(var o=n.length-1,i;0<=o;o--)i=d.a=n[o],r=B(i,e,!0,d)&&r;if(i=d.a=t,r=B(i,e,!0,d)&&r,r=B(i,e,!1,d)&&r,n)for(o=0;o=D(this).value)for(h(t)&&(t=t()),o=new Jt(o,t+"",this.f),e&&(o.a=e),e=this;e;)e=e.a};var vr={},xr=null;F.prototype.Ea=function(){this.b=!1};var Cr=new Lt;r(cn,pt),r(hn,pt),r(J,pt);var Sr={NO_ERROR:0,jb:1,qb:2,pb:3,mb:4,ob:5,rb:6,Ra:7,TIMEOUT:8,ub:9},Er={lb:"complete",yb:"success",Sa:"error",Ra:"abort",wb:"ready",xb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",vb:"progress",nb:"downloadprogress",zb:"uploadprogress"};yn.prototype.a=null;var kr;r(vn,yn),kr=new vn;var Tr=45e3,wr=250,Ir={},Nr={};t=Sn.prototype,t.setTimeout=function(e){this.S=e},t.fb=function(n){n=n.target;var t=this.I;t&&3==pe(n)?(dn(this.b,"Throttling readystatechange."),t.Xa()):this.Qa(n)},t.Qa=function(n){try{n==this.a?wn(this):tn(this.b.a,"Called back with an unexpected xmlhttp")}catch(e){if(dn(this.b,"Failed call to OnXmlHttpReadyStateChanged_"),this.a&&this.a.V()){var t=this;I(this.b,e,function(){return"ResponseText: "+t.a.V()})}else I(this.b,e,"No response text")}},t.eb=function(){var n=pe(this.a),t=this.a.V();this.Ft&&this.la&&0==this.w&&!this.o&&(this.o=fn(f(this.$a,this),6e3)))}else if(this.b==n&&Eo(this),!/^[\s\xa0]*$/.test(t))for(t=e=this.ma.a.parse(t),e=0;et-this.g)){for(var e;0this.c&&0=r)o=void 0;else{if(1==r)Z(n);else{n[0]=n.pop(),n=0,l=l.a,r=l.length;for(var i=l[n];n>1;){var a=2*n+1,s=2*n+2;if(a=si.a)break;l[n]=l[a],n=a}l[n]=i}o=o.b}o.apply(this,[t])}},t.na=function(e){To.L.na.call(this,e),this.sa()},t.ba=function(){To.L.ba.call(this),this.sa()},t.A=function(){To.L.A.call(this),Io.clearTimeout(void 0),Z(this.f.a),this.f=null},r(X,To),X.prototype.qa=function(){var o=new ke,t=this.l;return t&&t.forEach(function(t,e){o.headers.set(e,t)}),this.j&&(o.m=!0),o},X.prototype.ta=function(e){return!e.i&&!e.a},Ne.prototype.createWebChannel=Ne.prototype.a,Oe.prototype.send=Oe.prototype.l,Oe.prototype.open=Oe.prototype.j,Oe.prototype.close=Oe.prototype.close,Sr.NO_ERROR=0,Sr.TIMEOUT=8,Sr.HTTP_ERROR=6,Er.COMPLETE="complete",po.EventType=Mr,Mr.OPEN="a",Mr.CLOSE="b",Mr.ERROR="c",Mr.MESSAGE="d",Lt.prototype.listen=Lt.prototype.aa,X.prototype.getObject=X.prototype.ea,X.prototype.releaseObject=X.prototype.gb,ke.prototype.listenOnce=ke.prototype.Ha,ke.prototype.getLastError=ke.prototype.Za,ke.prototype.getLastErrorCode=ke.prototype.Fa,ke.prototype.getStatus=ke.prototype.W,ke.prototype.getStatusText=ke.prototype.Ga,ke.prototype.getResponseJson=ke.prototype.Ya,ke.prototype.getResponseText=ke.prototype.V,ke.prototype.getResponseText=ke.prototype.V,ke.prototype.send=ke.prototype.fa,e.exports={createWebChannelTransport:ne,ErrorCode:Sr,EventType:Er,WebChannel:po,XhrIoPool:X}}).call(void 0===t?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:t)}).call(t,n(12))}},[113])}catch(e){throw Error("Cannot instantiate firebase-firestore.js - be sure to load firebase-app.js first.")}