mirror of
https://github.com/chinchang/web-maker.git
synced 2025-05-06 10:35:30 +02:00
1 line
1.7 MiB
1 line
1.7 MiB
(function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var parentJsonpFunction=window.webpackJsonp;window.webpackJsonp=function(chunkIds,moreModules,executeModules){for(var i=0,resolves=[],moduleId,chunkId,result;i<chunkIds.length;i++)chunkId=chunkIds[i],installedChunks[chunkId]&&resolves.push(installedChunks[chunkId][0]),installedChunks[chunkId]=0;for(moduleId in moreModules)Object.prototype.hasOwnProperty.call(moreModules,moduleId)&&(modules[moduleId]=moreModules[moduleId]);for(parentJsonpFunction&&parentJsonpFunction(chunkIds,moreModules,executeModules);resolves.length;)resolves.shift()();if(executeModules)for(i=0;i<executeModules.length;i++)result=__webpack_require__(__webpack_require__.s=executeModules[i]);return result};var installedModules={},installedChunks={2:0};__webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module["default"]}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="/",__webpack_require__.oe=function(err){throw console.error(err),err}})({"+BLB":function(module,exports,__webpack_require__){"use strict";function err(strm,errorCode){return strm.msg=msg[errorCode],errorCode}function rank(f){return(f<<1)-(4<f?9:0)}function zero(buf){for(var len=buf.length;0<=--len;)buf[len]=0}function flush_pending(strm){var s=strm.state,len=s.pending;len>strm.avail_out&&(len=strm.avail_out),0===len||(utils.arraySet(strm.output,s.pending_buf,s.pending_out,len,strm.next_out),strm.next_out+=len,s.pending_out+=len,strm.total_out+=len,strm.avail_out-=len,s.pending-=len,0===s.pending&&(s.pending_out=0))}function flush_block_only(s,last){trees._tr_flush_block(s,0<=s.block_start?s.block_start:-1,s.strstart-s.block_start,last),s.block_start=s.strstart,flush_pending(s.strm)}function put_byte(s,b){s.pending_buf[s.pending++]=b}function putShortMSB(s,b){s.pending_buf[s.pending++]=255&b>>>8,s.pending_buf[s.pending++]=255&b}function read_buf(strm,buf,start,size){var len=strm.avail_in;return(len>size&&(len=size),0===len)?0:(strm.avail_in-=len,utils.arraySet(buf,strm.input,strm.next_in,len,start),1===strm.state.wrap?strm.adler=adler32(strm.adler,buf,len,start):2===strm.state.wrap&&(strm.adler=crc32(strm.adler,buf,len,start)),strm.next_in+=len,strm.total_in+=len,len)}function longest_match(s,cur_match){var chain_length=s.max_chain_length,scan=s.strstart,best_len=s.prev_length,nice_match=s.nice_match,limit=s.strstart>s.w_size-MIN_LOOKAHEAD?s.strstart-(s.w_size-MIN_LOOKAHEAD):0,_win=s.window,wmask=s.w_mask,prev=s.prev,strend=s.strstart+MAX_MATCH,scan_end1=_win[scan+best_len-1],scan_end=_win[scan+best_len],match,len;s.prev_length>=s.good_match&&(chain_length>>=2),nice_match>s.lookahead&&(nice_match=s.lookahead);do{if(match=cur_match,_win[match+best_len]!==scan_end||_win[match+best_len-1]!==scan_end1||_win[match]!==_win[scan]||_win[++match]!==_win[scan+1])continue;scan+=2,match++;do;while(_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&scan<strend);if(len=MAX_MATCH-(strend-scan),scan=strend-MAX_MATCH,len>best_len){if(s.match_start=cur_match,best_len=len,len>=nice_match)break;scan_end1=_win[scan+best_len-1],scan_end=_win[scan+best_len]}}while((cur_match=prev[cur_match&wmask])>limit&&0!=--chain_length);return best_len<=s.lookahead?best_len:s.lookahead}function fill_window(s){var _w_size=s.w_size,p,n,m,more,str;do{if(more=s.window_size-s.lookahead-s.strstart,s.strstart>=_w_size+(_w_size-MIN_LOOKAHEAD)){utils.arraySet(s.window,s.window,_w_size,_w_size,0),s.match_start-=_w_size,s.strstart-=_w_size,s.block_start-=_w_size,n=s.hash_size,p=n;do m=s.head[--p],s.head[p]=m>=_w_size?m-_w_size:0;while(--n);n=_w_size,p=n;do m=s.prev[--p],s.prev[p]=m>=_w_size?m-_w_size:0;while(--n);more+=_w_size}if(0===s.strm.avail_in)break;if(n=read_buf(s.strm,s.window,s.strstart+s.lookahead,more),s.lookahead+=n,s.lookahead+s.insert>=MIN_MATCH)for(str=s.strstart-s.insert,s.ins_h=s.window[str],s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+1])&s.hash_mask;s.insert&&(s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+MIN_MATCH-1])&s.hash_mask,s.prev[str&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=str,str++,s.insert--,!(s.lookahead+s.insert<MIN_MATCH)););}while(s.lookahead<MIN_LOOKAHEAD&&0!==s.strm.avail_in)}function deflate_fast(s,flush){for(var hash_head,bflush;;){if(s.lookahead<MIN_LOOKAHEAD){if(fill_window(s),s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}if(hash_head=0,s.lookahead>=MIN_MATCH&&(s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask,hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=s.strstart),0!==hash_head&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD&&(s.match_length=longest_match(s,hash_head)),!(s.match_length>=MIN_MATCH))bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++;else if(bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH),s.lookahead-=s.match_length,s.match_length<=s.max_lazy_match&&s.lookahead>=MIN_MATCH){s.match_length--;do s.strstart++,s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask,hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=s.strstart;while(0!=--s.match_length);s.strstart++}else s.strstart+=s.match_length,s.match_length=0,s.ins_h=s.window[s.strstart],s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+1])&s.hash_mask;if(bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_slow(s,flush){for(var hash_head,bflush,max_insert;;){if(s.lookahead<MIN_LOOKAHEAD){if(fill_window(s),s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}if(hash_head=0,s.lookahead>=MIN_MATCH&&(s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask,hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=s.strstart),s.prev_length=s.match_length,s.prev_match=s.match_start,s.match_length=MIN_MATCH-1,0!==hash_head&&s.prev_length<s.max_lazy_match&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD&&(s.match_length=longest_match(s,hash_head),5>=s.match_length&&(s.strategy===Z_FILTERED||s.match_length===MIN_MATCH&&4096<s.strstart-s.match_start)&&(s.match_length=MIN_MATCH-1)),s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH,bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length-MIN_MATCH),s.lookahead-=s.prev_length-1,s.prev_length-=2;do++s.strstart<=max_insert&&(s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask,hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=s.strstart);while(0!=--s.prev_length);if(s.match_available=0,s.match_length=MIN_MATCH-1,s.strstart++,bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}else if(!s.match_available)s.match_available=1,s.strstart++,s.lookahead--;else if(bflush=trees._tr_tally(s,0,s.window[s.strstart-1]),bflush&&flush_block_only(s,!1),s.strstart++,s.lookahead--,0===s.strm.avail_out)return BS_NEED_MORE}return s.match_available&&(bflush=trees._tr_tally(s,0,s.window[s.strstart-1]),s.match_available=0),s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_rle(s,flush){for(var _win=s.window,bflush,prev,scan,strend;;){if(s.lookahead<=MAX_MATCH){if(fill_window(s),s.lookahead<=MAX_MATCH&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}if(s.match_length=0,s.lookahead>=MIN_MATCH&&0<s.strstart&&(scan=s.strstart-1,prev=_win[scan],prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan])){strend=s.strstart+MAX_MATCH;do;while(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&scan<strend);s.match_length=MAX_MATCH-(strend-scan),s.match_length>s.lookahead&&(s.match_length=s.lookahead)}if(s.match_length>=MIN_MATCH?(bflush=trees._tr_tally(s,1,s.match_length-MIN_MATCH),s.lookahead-=s.match_length,s.strstart+=s.match_length,s.match_length=0):(bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++),bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_huff(s,flush){for(var bflush;;){if(0===s.lookahead&&(fill_window(s),0===s.lookahead)){if(flush===Z_NO_FLUSH)return BS_NEED_MORE;break}if(s.match_length=0,bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++,bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}function Config(good_length,max_lazy,nice_length,max_chain,func){this.good_length=good_length,this.max_lazy=max_lazy,this.nice_length=nice_length,this.max_chain=max_chain,this.func=func}function lm_init(s){s.window_size=2*s.w_size,zero(s.head),s.max_lazy_match=configuration_table[s.level].max_lazy,s.good_match=configuration_table[s.level].good_length,s.nice_match=configuration_table[s.level].nice_length,s.max_chain_length=configuration_table[s.level].max_chain,s.strstart=0,s.block_start=0,s.lookahead=0,s.insert=0,s.match_length=s.prev_length=MIN_MATCH-1,s.match_available=0,s.ins_h=0}function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new utils.Buf16(2*HEAP_SIZE),this.dyn_dtree=new utils.Buf16(2*(2*D_CODES+1)),this.bl_tree=new utils.Buf16(2*(2*BL_CODES+1)),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new utils.Buf16(MAX_BITS+1),this.heap=new utils.Buf16(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new utils.Buf16(2*L_CODES+1),zero(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function deflateResetKeep(strm){var s;return strm&&strm.state?(strm.total_in=strm.total_out=0,strm.data_type=Z_UNKNOWN,s=strm.state,s.pending=0,s.pending_out=0,0>s.wrap&&(s.wrap=-s.wrap),s.status=s.wrap?INIT_STATE:BUSY_STATE,strm.adler=2===s.wrap?0:1,s.last_flush=Z_NO_FLUSH,trees._tr_init(s),Z_OK):err(strm,Z_STREAM_ERROR)}function deflateReset(strm){var ret=deflateResetKeep(strm);return ret===Z_OK&&lm_init(strm.state),ret}function deflateInit2(strm,level,method,windowBits,memLevel,strategy){if(!strm)return Z_STREAM_ERROR;var wrap=1;if(level===Z_DEFAULT_COMPRESSION&&(level=6),0>windowBits?(wrap=0,windowBits=-windowBits):15<windowBits&&(wrap=2,windowBits-=16),1>memLevel||memLevel>MAX_MEM_LEVEL||method!==Z_DEFLATED||8>windowBits||15<windowBits||0>level||9<level||0>strategy||strategy>Z_FIXED)return err(strm,Z_STREAM_ERROR);8===windowBits&&(windowBits=9);var s=new DeflateState;return strm.state=s,s.strm=strm,s.wrap=wrap,s.gzhead=null,s.w_bits=windowBits,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=memLevel+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+MIN_MATCH-1)/MIN_MATCH),s.window=new utils.Buf8(2*s.w_size),s.head=new utils.Buf16(s.hash_size),s.prev=new utils.Buf16(s.w_size),s.lit_bufsize=1<<memLevel+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new utils.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=level,s.strategy=strategy,s.method=method,deflateReset(strm)}var utils=__webpack_require__("tbG5"),trees=__webpack_require__("+sRJ"),adler32=__webpack_require__("uxo6"),crc32=__webpack_require__("X4kj"),msg=__webpack_require__("gMAY"),Z_NO_FLUSH=0,Z_FINISH=4,Z_BLOCK=5,Z_OK=0,Z_STREAM_END=1,Z_STREAM_ERROR=-2,Z_BUF_ERROR=-5,Z_DEFAULT_COMPRESSION=-1,Z_FILTERED=1,Z_HUFFMAN_ONLY=2,Z_FIXED=4,Z_UNKNOWN=2,Z_DEFLATED=8,MAX_MEM_LEVEL=9,L_CODES=256+1+29,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,INIT_STATE=42,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,configuration_table;configuration_table=[new Config(0,0,0,0,function(s,flush){var max_block_size=65535;for(max_block_size>s.pending_buf_size-5&&(max_block_size=s.pending_buf_size-5);;){if(1>=s.lookahead){if(fill_window(s),0===s.lookahead&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}s.strstart+=s.lookahead,s.lookahead=0;var max_start=s.block_start+max_block_size;if((0===s.strstart||s.strstart>=max_start)&&(s.lookahead=s.strstart-max_start,s.strstart=max_start,flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE;if(s.strstart-s.block_start>=s.w_size-MIN_LOOKAHEAD&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.strstart>s.block_start&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_NEED_MORE}),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],exports.deflateInit=function(strm,level){return deflateInit2(strm,level,Z_DEFLATED,15,8,0)},exports.deflateInit2=deflateInit2,exports.deflateReset=deflateReset,exports.deflateResetKeep=deflateResetKeep,exports.deflateSetHeader=function(strm,head){return strm&&strm.state?2===strm.state.wrap?(strm.state.gzhead=head,Z_OK):Z_STREAM_ERROR:Z_STREAM_ERROR},exports.deflate=function(strm,flush){var old_flush,s,beg,val;if(!strm||!strm.state||flush>Z_BLOCK||0>flush)return strm?err(strm,Z_STREAM_ERROR):Z_STREAM_ERROR;if(s=strm.state,!strm.output||!strm.input&&0!==strm.avail_in||s.status===FINISH_STATE&&flush!==Z_FINISH)return err(strm,0===strm.avail_out?Z_BUF_ERROR:Z_STREAM_ERROR);if(s.strm=strm,old_flush=s.last_flush,s.last_flush=flush,s.status===INIT_STATE)if(2===s.wrap)strm.adler=0,put_byte(s,31),put_byte(s,139),put_byte(s,8),s.gzhead?(put_byte(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),put_byte(s,255&s.gzhead.time),put_byte(s,255&s.gzhead.time>>8),put_byte(s,255&s.gzhead.time>>16),put_byte(s,255&s.gzhead.time>>24),put_byte(s,9===s.level?2:s.strategy>=Z_HUFFMAN_ONLY||2>s.level?4:0),put_byte(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(put_byte(s,255&s.gzhead.extra.length),put_byte(s,255&s.gzhead.extra.length>>8)),s.gzhead.hcrc&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=EXTRA_STATE):(put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,9===s.level?2:s.strategy>=Z_HUFFMAN_ONLY||2>s.level?4:0),put_byte(s,3),s.status=BUSY_STATE);else{var header=Z_DEFLATED+(s.w_bits-8<<4)<<8,level_flags=-1;level_flags=s.strategy>=Z_HUFFMAN_ONLY||2>s.level?0:6>s.level?1:6===s.level?2:3,header|=level_flags<<6,0!==s.strstart&&(header|=32),header+=31-header%31,s.status=BUSY_STATE,putShortMSB(s,header),0!==s.strstart&&(putShortMSB(s,strm.adler>>>16),putShortMSB(s,65535&strm.adler)),strm.adler=1}if(s.status===EXTRA_STATE)if(s.gzhead.extra){for(beg=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&!(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending===s.pending_buf_size));)put_byte(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=NAME_STATE)}else s.status=NAME_STATE;if(s.status===NAME_STATE)if(s.gzhead.name){beg=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending===s.pending_buf_size)){val=1;break}val=s.gzindex<s.gzhead.name.length?255&s.gzhead.name.charCodeAt(s.gzindex++):0,put_byte(s,val)}while(0!==val);s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),0===val&&(s.gzindex=0,s.status=COMMENT_STATE)}else s.status=COMMENT_STATE;if(s.status===COMMENT_STATE)if(s.gzhead.comment){beg=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending===s.pending_buf_size)){val=1;break}val=s.gzindex<s.gzhead.comment.length?255&s.gzhead.comment.charCodeAt(s.gzindex++):0,put_byte(s,val)}while(0!==val);s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),0===val&&(s.status=HCRC_STATE)}else s.status=HCRC_STATE;if(s.status===HCRC_STATE&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&flush_pending(strm),s.pending+2<=s.pending_buf_size&&(put_byte(s,255&strm.adler),put_byte(s,255&strm.adler>>8),strm.adler=0,s.status=BUSY_STATE)):s.status=BUSY_STATE),0!==s.pending){if(flush_pending(strm),0===strm.avail_out)return s.last_flush=-1,Z_OK;}else if(0===strm.avail_in&&rank(flush)<=rank(old_flush)&&flush!==Z_FINISH)return err(strm,Z_BUF_ERROR);if(s.status===FINISH_STATE&&0!==strm.avail_in)return err(strm,Z_BUF_ERROR);if(0!==strm.avail_in||0!==s.lookahead||flush!==Z_NO_FLUSH&&s.status!==FINISH_STATE){var bstate=s.strategy===Z_HUFFMAN_ONLY?deflate_huff(s,flush):s.strategy===3?deflate_rle(s,flush):configuration_table[s.level].func(s,flush);if((bstate===BS_FINISH_STARTED||bstate===BS_FINISH_DONE)&&(s.status=FINISH_STATE),bstate===BS_NEED_MORE||bstate===BS_FINISH_STARTED)return 0===strm.avail_out&&(s.last_flush=-1),Z_OK;if(bstate===BS_BLOCK_DONE&&(flush===1?trees._tr_align(s):flush!==Z_BLOCK&&(trees._tr_stored_block(s,0,0,!1),flush===3&&(zero(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),flush_pending(strm),0===strm.avail_out))return s.last_flush=-1,Z_OK}return flush===Z_FINISH?0>=s.wrap?Z_STREAM_END:(2===s.wrap?(put_byte(s,255&strm.adler),put_byte(s,255&strm.adler>>8),put_byte(s,255&strm.adler>>16),put_byte(s,255&strm.adler>>24),put_byte(s,255&strm.total_in),put_byte(s,255&strm.total_in>>8),put_byte(s,255&strm.total_in>>16),put_byte(s,255&strm.total_in>>24)):(putShortMSB(s,strm.adler>>>16),putShortMSB(s,65535&strm.adler)),flush_pending(strm),0<s.wrap&&(s.wrap=-s.wrap),0===s.pending?Z_STREAM_END:Z_OK):Z_OK},exports.deflateEnd=function(strm){var status;return strm&&strm.state?(status=strm.state.status,status!==INIT_STATE&&status!==EXTRA_STATE&&status!==NAME_STATE&&status!==COMMENT_STATE&&status!==HCRC_STATE&&status!==BUSY_STATE&&status!==FINISH_STATE)?err(strm,Z_STREAM_ERROR):(strm.state=null,status===BUSY_STATE?err(strm,-3):Z_OK):Z_STREAM_ERROR},exports.deflateSetDictionary=function(strm,dictionary){var dictLength=dictionary.length,s,str,n,wrap,avail,next,input,tmpDict;if(!strm||!strm.state)return Z_STREAM_ERROR;if(s=strm.state,wrap=s.wrap,2===wrap||1===wrap&&s.status!==INIT_STATE||s.lookahead)return Z_STREAM_ERROR;for(1===wrap&&(strm.adler=adler32(strm.adler,dictionary,dictLength,0)),s.wrap=0,dictLength>=s.w_size&&(0===wrap&&(zero(s.head),s.strstart=0,s.block_start=0,s.insert=0),tmpDict=new utils.Buf8(s.w_size),utils.arraySet(tmpDict,dictionary,dictLength-s.w_size,s.w_size,0),dictionary=tmpDict,dictLength=s.w_size),avail=strm.avail_in,next=strm.next_in,input=strm.input,strm.avail_in=dictLength,strm.next_in=0,strm.input=dictionary,fill_window(s);s.lookahead>=MIN_MATCH;){str=s.strstart,n=s.lookahead-(MIN_MATCH-1);do s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+MIN_MATCH-1])&s.hash_mask,s.prev[str&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=str,str++;while(--n);s.strstart=str,s.lookahead=MIN_MATCH-1,fill_window(s)}return s.strstart+=s.lookahead,s.block_start=s.strstart,s.insert=s.lookahead,s.lookahead=0,s.match_length=s.prev_length=MIN_MATCH-1,s.match_available=0,strm.next_in=next,strm.input=input,strm.avail_in=avail,s.wrap=wrap,Z_OK},exports.deflateInfo="pako deflate (from Nodeca project)"},"+sRJ":function(module,exports,__webpack_require__){"use strict";function zero(buf){for(var len=buf.length;0<=--len;)buf[len]=0}function StaticTreeDesc(static_tree,extra_bits,extra_base,elems,max_length){this.static_tree=static_tree,this.extra_bits=extra_bits,this.extra_base=extra_base,this.elems=elems,this.max_length=max_length,this.has_stree=static_tree&&static_tree.length}function TreeDesc(dyn_tree,stat_desc){this.dyn_tree=dyn_tree,this.max_code=0,this.stat_desc=stat_desc}function d_code(dist){return 256>dist?_dist_code[dist]:_dist_code[256+(dist>>>7)]}function put_short(s,w){s.pending_buf[s.pending++]=255&w,s.pending_buf[s.pending++]=255&w>>>8}function send_bits(s,value,length){s.bi_valid>Buf_size-length?(s.bi_buf|=65535&value<<s.bi_valid,put_short(s,s.bi_buf),s.bi_buf=value>>Buf_size-s.bi_valid,s.bi_valid+=length-Buf_size):(s.bi_buf|=65535&value<<s.bi_valid,s.bi_valid+=length)}function send_code(s,c,tree){send_bits(s,tree[2*c],tree[2*c+1])}function bi_reverse(code,len){var res=0;do res|=1&code,code>>>=1,res<<=1;while(0<--len);return res>>>1}function bi_flush(s){16===s.bi_valid?(put_short(s,s.bi_buf),s.bi_buf=0,s.bi_valid=0):8<=s.bi_valid&&(s.pending_buf[s.pending++]=255&s.bi_buf,s.bi_buf>>=8,s.bi_valid-=8)}function gen_bitlen(s,desc){var tree=desc.dyn_tree,max_code=desc.max_code,stree=desc.stat_desc.static_tree,has_stree=desc.stat_desc.has_stree,extra=desc.stat_desc.extra_bits,base=desc.stat_desc.extra_base,max_length=desc.stat_desc.max_length,overflow=0,h,n,m,bits,xbits,f;for(bits=0;bits<=MAX_BITS;bits++)s.bl_count[bits]=0;for(tree[2*s.heap[s.heap_max]+1]=0,h=s.heap_max+1;h<HEAP_SIZE;h++)(n=s.heap[h],bits=tree[2*tree[2*n+1]+1]+1,bits>max_length&&(bits=max_length,overflow++),tree[2*n+1]=bits,!(n>max_code))&&(s.bl_count[bits]++,xbits=0,n>=base&&(xbits=extra[n-base]),f=tree[2*n],s.opt_len+=f*(bits+xbits),has_stree&&(s.static_len+=f*(stree[2*n+1]+xbits)));if(0!=overflow){do{for(bits=max_length-1;0===s.bl_count[bits];)bits--;s.bl_count[bits]--,s.bl_count[bits+1]+=2,s.bl_count[max_length]--,overflow-=2}while(0<overflow);for(bits=max_length;0!==bits;bits--)for(n=s.bl_count[bits];0!==n;)(m=s.heap[--h],!(m>max_code))&&(tree[2*m+1]!==bits&&(s.opt_len+=(bits-tree[2*m+1])*tree[2*m],tree[2*m+1]=bits),n--)}}function gen_codes(tree,max_code,bl_count){var next_code=Array(MAX_BITS+1),code=0,bits,n;for(bits=1;bits<=MAX_BITS;bits++)next_code[bits]=code=code+bl_count[bits-1]<<1;for(n=0;n<=max_code;n++){var len=tree[2*n+1];0!==len&&(tree[2*n]=bi_reverse(next_code[len]++,len))}}function tr_static_init(){var bl_count=Array(MAX_BITS+1),n,bits,length,code,dist;for(length=0,code=0;code<LENGTH_CODES-1;code++)for(base_length[code]=length,n=0;n<1<<extra_lbits[code];n++)_length_code[length++]=code;for(_length_code[length-1]=code,dist=0,code=0;16>code;code++)for(base_dist[code]=dist,n=0;n<1<<extra_dbits[code];n++)_dist_code[dist++]=code;for(dist>>=7;code<D_CODES;code++)for(base_dist[code]=dist<<7,n=0;n<1<<extra_dbits[code]-7;n++)_dist_code[256+dist++]=code;for(bits=0;bits<=MAX_BITS;bits++)bl_count[bits]=0;for(n=0;143>=n;)static_ltree[2*n+1]=8,n++,bl_count[8]++;for(;255>=n;)static_ltree[2*n+1]=9,n++,bl_count[9]++;for(;279>=n;)static_ltree[2*n+1]=7,n++,bl_count[7]++;for(;287>=n;)static_ltree[2*n+1]=8,n++,bl_count[8]++;for(gen_codes(static_ltree,L_CODES+1,bl_count),n=0;n<D_CODES;n++)static_dtree[2*n+1]=5,static_dtree[2*n]=bi_reverse(n,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS+1,L_CODES,MAX_BITS),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES,MAX_BITS),static_bl_desc=new StaticTreeDesc([],extra_blbits,0,BL_CODES,MAX_BL_BITS)}function init_block(s){var n;for(n=0;n<L_CODES;n++)s.dyn_ltree[2*n]=0;for(n=0;n<D_CODES;n++)s.dyn_dtree[2*n]=0;for(n=0;n<BL_CODES;n++)s.bl_tree[2*n]=0;s.dyn_ltree[2*END_BLOCK]=1,s.opt_len=s.static_len=0,s.last_lit=s.matches=0}function bi_windup(s){8<s.bi_valid?put_short(s,s.bi_buf):0<s.bi_valid&&(s.pending_buf[s.pending++]=s.bi_buf),s.bi_buf=0,s.bi_valid=0}function copy_block(s,buf,len,header){bi_windup(s),header&&(put_short(s,len),put_short(s,~len)),utils.arraySet(s.pending_buf,s.window,buf,len,s.pending),s.pending+=len}function smaller(tree,n,m,depth){var _n2=2*n,_m2=2*m;return tree[_n2]<tree[_m2]||tree[_n2]===tree[_m2]&&depth[n]<=depth[m]}function pqdownheap(s,tree,k){for(var v=s.heap[k],j=k<<1;j<=s.heap_len&&(j<s.heap_len&&smaller(tree,s.heap[j+1],s.heap[j],s.depth)&&j++,!smaller(tree,v,s.heap[j],s.depth));)s.heap[k]=s.heap[j],k=j,j<<=1;s.heap[k]=v}function compress_block(s,ltree,dtree){var lx=0,dist,lc,code,extra;if(0!==s.last_lit)do dist=s.pending_buf[s.d_buf+2*lx]<<8|s.pending_buf[s.d_buf+2*lx+1],lc=s.pending_buf[s.l_buf+lx],lx++,0===dist?send_code(s,lc,ltree):(code=_length_code[lc],send_code(s,code+LITERALS+1,ltree),extra=extra_lbits[code],0!==extra&&(lc-=base_length[code],send_bits(s,lc,extra)),dist--,code=d_code(dist),send_code(s,code,dtree),extra=extra_dbits[code],0!==extra&&(dist-=base_dist[code],send_bits(s,dist,extra)));while(lx<s.last_lit);send_code(s,END_BLOCK,ltree)}function build_tree(s,desc){var tree=desc.dyn_tree,stree=desc.stat_desc.static_tree,has_stree=desc.stat_desc.has_stree,elems=desc.stat_desc.elems,max_code=-1,n,m,node;for(s.heap_len=0,s.heap_max=HEAP_SIZE,n=0;n<elems;n++)0===tree[2*n]?tree[2*n+1]=0:(s.heap[++s.heap_len]=max_code=n,s.depth[n]=0);for(;2>s.heap_len;)node=s.heap[++s.heap_len]=2>max_code?++max_code:0,tree[2*node]=1,s.depth[node]=0,s.opt_len--,has_stree&&(s.static_len-=stree[2*node+1]);for(desc.max_code=max_code,n=s.heap_len>>1;1<=n;n--)pqdownheap(s,tree,n);node=elems;do n=s.heap[1],s.heap[1]=s.heap[s.heap_len--],pqdownheap(s,tree,1),m=s.heap[1],s.heap[--s.heap_max]=n,s.heap[--s.heap_max]=m,tree[2*node]=tree[2*n]+tree[2*m],s.depth[node]=(s.depth[n]>=s.depth[m]?s.depth[n]:s.depth[m])+1,tree[2*n+1]=tree[2*m+1]=node,s.heap[1]=node++,pqdownheap(s,tree,1);while(2<=s.heap_len);s.heap[--s.heap_max]=s.heap[1],gen_bitlen(s,desc),gen_codes(tree,max_code,s.bl_count)}function scan_tree(s,tree,max_code){var prevlen=-1,nextlen=tree[1],count=0,max_count=7,min_count=4,n,curlen;for(0===nextlen&&(max_count=138,min_count=3),tree[2*(max_code+1)+1]=65535,n=0;n<=max_code;n++){if(curlen=nextlen,nextlen=tree[2*(n+1)+1],++count<max_count&&curlen===nextlen)continue;else count<min_count?s.bl_tree[2*curlen]+=count:0===curlen?10>=count?s.bl_tree[2*REPZ_3_10]++:s.bl_tree[2*REPZ_11_138]++:(curlen!==prevlen&&s.bl_tree[2*curlen]++,s.bl_tree[2*REP_3_6]++);count=0,prevlen=curlen,0===nextlen?(max_count=138,min_count=3):curlen===nextlen?(max_count=6,min_count=3):(max_count=7,min_count=4)}}function send_tree(s,tree,max_code){var prevlen=-1,nextlen=tree[1],count=0,max_count=7,min_count=4,n,curlen;for(0===nextlen&&(max_count=138,min_count=3),n=0;n<=max_code;n++){if(curlen=nextlen,nextlen=tree[2*(n+1)+1],++count<max_count&&curlen===nextlen)continue;else if(count<min_count)do send_code(s,curlen,s.bl_tree);while(0!=--count);else 0===curlen?10>=count?(send_code(s,REPZ_3_10,s.bl_tree),send_bits(s,count-3,3)):(send_code(s,REPZ_11_138,s.bl_tree),send_bits(s,count-11,7)):(curlen!==prevlen&&(send_code(s,curlen,s.bl_tree),count--),send_code(s,REP_3_6,s.bl_tree),send_bits(s,count-3,2));count=0,prevlen=curlen,0===nextlen?(max_count=138,min_count=3):curlen===nextlen?(max_count=6,min_count=3):(max_count=7,min_count=4)}}function build_bl_tree(s){var max_blindex;for(scan_tree(s,s.dyn_ltree,s.l_desc.max_code),scan_tree(s,s.dyn_dtree,s.d_desc.max_code),build_tree(s,s.bl_desc),max_blindex=BL_CODES-1;3<=max_blindex&&0===s.bl_tree[2*bl_order[max_blindex]+1];max_blindex--);return s.opt_len+=3*(max_blindex+1)+5+5+4,max_blindex}function send_all_trees(s,lcodes,dcodes,blcodes){var rank;for(send_bits(s,lcodes-257,5),send_bits(s,dcodes-1,5),send_bits(s,blcodes-4,4),rank=0;rank<blcodes;rank++)send_bits(s,s.bl_tree[2*bl_order[rank]+1],3);send_tree(s,s.dyn_ltree,lcodes-1),send_tree(s,s.dyn_dtree,dcodes-1)}function detect_data_type(s){var black_mask=4093624447,n;for(n=0;31>=n;n++,black_mask>>>=1)if(1&black_mask&&0!==s.dyn_ltree[2*n])return Z_BINARY;if(0!==s.dyn_ltree[18]||0!==s.dyn_ltree[20]||0!==s.dyn_ltree[26])return Z_TEXT;for(n=32;n<LITERALS;n++)if(0!==s.dyn_ltree[2*n])return Z_TEXT;return Z_BINARY}function _tr_stored_block(s,buf,stored_len,last){send_bits(s,(STORED_BLOCK<<1)+(last?1:0),3),copy_block(s,buf,stored_len,!0)}var utils=__webpack_require__("tbG5"),Z_BINARY=0,Z_TEXT=1,STORED_BLOCK=0,STATIC_TREES=1,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],static_ltree=Array(2*(L_CODES+2));zero(static_ltree);var static_dtree=Array(2*D_CODES);zero(static_dtree);var _dist_code=Array(512);zero(_dist_code);var _length_code=Array(258-3+1);zero(_length_code);var base_length=Array(LENGTH_CODES);zero(base_length);var base_dist=Array(D_CODES);zero(base_dist);var static_init_done=!1,static_l_desc,static_d_desc,static_bl_desc;exports._tr_init=function(s){static_init_done||(tr_static_init(),static_init_done=!0),s.l_desc=new TreeDesc(s.dyn_ltree,static_l_desc),s.d_desc=new TreeDesc(s.dyn_dtree,static_d_desc),s.bl_desc=new TreeDesc(s.bl_tree,static_bl_desc),s.bi_buf=0,s.bi_valid=0,init_block(s)},exports._tr_stored_block=_tr_stored_block,exports._tr_flush_block=function(s,buf,stored_len,last){var max_blindex=0,opt_lenb,static_lenb;0<s.level?(s.strm.data_type===2&&(s.strm.data_type=detect_data_type(s)),build_tree(s,s.l_desc),build_tree(s,s.d_desc),max_blindex=build_bl_tree(s),opt_lenb=s.opt_len+3+7>>>3,static_lenb=s.static_len+3+7>>>3,static_lenb<=opt_lenb&&(opt_lenb=static_lenb)):opt_lenb=static_lenb=stored_len+5,stored_len+4<=opt_lenb&&-1!==buf?_tr_stored_block(s,buf,stored_len,last):s.strategy===4||static_lenb===opt_lenb?(send_bits(s,(STATIC_TREES<<1)+(last?1:0),3),compress_block(s,static_ltree,static_dtree)):(send_bits(s,(2<<1)+(last?1:0),3),send_all_trees(s,s.l_desc.max_code+1,s.d_desc.max_code+1,max_blindex+1),compress_block(s,s.dyn_ltree,s.dyn_dtree)),init_block(s),last&&bi_windup(s)},exports._tr_tally=function(s,dist,lc){return s.pending_buf[s.d_buf+2*s.last_lit]=255&dist>>>8,s.pending_buf[s.d_buf+2*s.last_lit+1]=255&dist,s.pending_buf[s.l_buf+s.last_lit]=255&lc,s.last_lit++,0===dist?s.dyn_ltree[2*lc]++:(s.matches++,dist--,s.dyn_ltree[2*(_length_code[lc]+LITERALS+1)]++,s.dyn_dtree[2*d_code(dist)]++),s.last_lit===s.lit_bufsize-1},exports._tr_align=function(s){send_bits(s,STATIC_TREES<<1,3),send_code(s,END_BLOCK,static_ltree),bi_flush(s)}},"/+WI":function(module){"use strict";module.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},"/QFk":function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return call&&("object"==typeof call||"function"==typeof call)?call:self}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}function createConfig(editor,pos,options){pos=pos||editor.getCursor();var syntax=getSyntax(editor,pos),config=(0,_config2.default)(_extends({field:editorField},editor.getOption("emmet"),options),{syntax:syntax}),mode=editor.getModeAt(pos);return"jsx"===syntax?(config.profile=_extends({selfClosingStyle:"xml"},config.profile),config.options=_extends({jsx:!0},config.options)):"xml"===mode.name&&(config.profile=_extends({selfClosingStyle:mode.configuration},config.profile)),config}function getSyntax(editor,pos){var rootMode=editor.getMode();if("jsx"===rootMode.name||"javascript"===rootMode.name)return rootMode.name;var mode=editor.getModeAt(pos);return"xml"===mode.name?"html":mode.name}function comparePos(a,b){return a.line-b.line||a.ch-b.ch}function getIndentation(editor){return editor.getOption("indentWithTabs")?"\t":repeatString(" ",editor.getOption("indentUnit"))}function normalizeText(editor,text,indentation){var lines=splitByLines(text),indent=getIndentation(editor);return"\t"!==indent&&(lines=lines.map(function(line){return line.replace(/^\t+/,function(tabs){return repeatString(indent,tabs.length)})})),indentation&&(lines=lines.map(function(line,i){return i?indentation+line:line})),lines.join("\n")}function splitByLines(text){return Array.isArray(text)?text:text.split(/\r\n|\r|\n/g)}function repeatString(str,count){for(var result="";0<count--;)result+=str;return result}function removeFields(str){return(0,_fieldParser2.default)(str).string}function containsPos(range,pos,exclude){return exclude?0<comparePos$1(pos,range.from)&&0>comparePos$1(pos,range.to):0<=comparePos$1(pos,range.from)&&0>=comparePos$1(pos,range.to)}function comparePos$1(a,b){return a.line-b.line||a.ch-b.ch}function rangeFromNode(node){return{from:node.start,to:node.end}}function narrowToNonSpace(editor,from,to){var stream=new CodeMirrorStreamReader(editor,from);if(stream.eatWhile(_streamReaderUtils.isSpace),from=stream.pos,to){for(stream.pos=to,stream.backUp();!stream.sof()&&(0,_streamReaderUtils.isSpace)(stream.peek());)stream.backUp();stream.next(),to=stream.pos}else to=from;return{from:from,to:to}}function getCSSPropertyName(editor,pos){for(var line=pos.line,ch=pos.ch,token=void 0;0<=ch;){if(token=editor.getTokenAt({line:line,ch:ch}),"property"===token.type)return token.string;if(token.start!==ch)ch=token.start;else break}}function isCSSPropertyValue(editor,pos){var mode=editor.getModeAt(pos);if(mode&&"css"===mode.name){var token=editor.getTokenAt(pos),state=token.state&&token.state.localState||token.state;return state&&state.context&&"prop"===state.context.type}return!1}function extractAbbreviation(editor,pos,contextAware){var config=createConfig(editor,pos);if(contextAware&&!canExtract(editor,pos,config))return null;var extracted=(0,_extractAbbreviation2.default)(editor.getLine(pos.line),pos.ch,{lookAhead:!0,syntax:config.type,prefix:"jsx"===config.syntax&&editor.getOption("jsxBracket")?"<":""});if(extracted){var from={line:pos.line,ch:extracted.start},to={line:pos.line,ch:extracted.end};return"stylesheet"===config.type&&contextAware&&isCSSPropertyValue(editor,pos)&&(config.options=_extends({property:getCSSPropertyName(editor,pos)},config.options)),{abbreviation:extracted.abbreviation,range:{from:from,to:to},config:config}}}function canExtract(editor,pos,config){var tokenType=editor.getTokenTypeAt(pos);return"stylesheet"===config.type?"comment"!==tokenType&&"string"!==tokenType:"html"===config.syntax?null===tokenType:"slim"===config.syntax||"pug"===config.syntax?null===tokenType||"tag"===tokenType||tokenType&&/attribute/.test(tokenType):"haml"===config.syntax?null===tokenType||"attribute"===tokenType:"jsx"===config.syntax}function insertSnippet(editor,range,text){var line=editor.getLine(range.from.line),matchIndent=line.match(/^\s+/),snippet=normalizeText(editor,text,matchIndent&&matchIndent[0]),fieldModel=(0,_fieldParser2.default)(snippet);return editor.operation(function(){editor.replaceRange(fieldModel.string,range.from,range.to);var startIx=editor.indexFromPos(range.from);if(fieldModel.fields.length){var field=fieldModel.fields[0],from=editor.posFromIndex(field.location+startIx),to=editor.posFromIndex(field.location+field.length+startIx);editor.setSelection(from,to)}else editor.setCursor(editor.posFromIndex(startIx+fieldModel.string.length));return!0})}function abbreviationFromPosition(editor,pos,contextAware){var marker=findMarker(editor,pos);if(marker&&marker.model)return marker.model;var extracted=extractAbbreviation(editor,pos,contextAware);if(extracted)try{var abbr=new Abbreviation(extracted.abbreviation,extracted.range,extracted.config);return abbr.valid(editor,contextAware)?abbr:null}catch(err){}}function findMarker(editor,pos){for(var markers=editor.findMarksAt(pos),i=0,marker;i<markers.length;i++)if(marker=markers[i],marker.className===emmetMarkerClass){if(isValidMarker(editor,marker))return marker;marker.clear()}}function clearMarkers(editor){for(var markers=editor.getAllMarks(),i=0;i<markers.length;i++)markers[i].className===emmetMarkerClass&&markers[i].clear()}function createMarker(editor,model){var _model$range=model.range,from=_model$range.from,to=_model$range.to,marker=editor.markText(from,to,{inclusiveLeft:!0,inclusiveRight:!0,clearWhenEmpty:!0,className:emmetMarkerClass});return marker.model=model,marker}function isValidMarker(editor,marker){var range=marker.find();if(range.from.line!==range.to.line)return!1;var text=editor.getRange(range.from,range.to);if(!text||/^\s|\s$/g.test(text))return!1;if(marker.model&&"jsx"===marker.model.config.syntax&&"<"===text[0]&&(text=text.slice(1)),!marker.model||marker.model.abbreviation!==text)try{marker.model=new Abbreviation(text,range,marker.model.config),marker.model.valid(editor,!0)||(marker.model=null)}catch(err){console.warn(err),marker.model=null}return!!(marker.model&&marker.model.snippet)}function expandAbbreviation(editor,contextAware){if(editor.somethingSelected())return editor.constructor.Pass;var abbr=abbreviationFromPosition(editor,editor.getCursor(),contextAware);return abbr?(abbr.insert(editor),clearMarkers(editor),!0):editor.constructor.Pass}function emmetInsertLineBreak(editor){var between=editor.listSelections().map(function(sel){return betweenTags(editor,sel)});return between.some(Boolean)?void editor.operation(function(){for(var sels=editor.listSelections(),singleSep=editor.doc.lineSeparator(),i=sels.length-1;0<=i;i--)editor.replaceRange(between[i]?singleSep+singleSep:singleSep,sels[i].anchor,sels[i].head,"+newline");sels=editor.listSelections();for(var _i=0;_i<sels.length;_i++)editor.indentLine(sels[_i].from().line,null,!0),between[_i]&&editor.indentLine(sels[_i].from().line-1,null,!0);editor.setSelections(editor.listSelections().map(function(sel,i){if(between[i]){var line=sel.from().line-1,cursor={line:line,ch:editor.getLine(line).length};return{anchor:cursor,head:cursor}}return sel}))}):editor.constructor.Pass}function betweenTags(editor,range){if(equalCursorPos(range.anchor,range.head)){var cursor=range.anchor,mode=editor.getModeAt(cursor);if("xml"===mode.name){var left=editor.getTokenAt(cursor),right=editor.getTokenAt(_extends({},cursor,{ch:cursor.ch+1}));return"tag bracket"===left.type&&">"===left.string&&"tag bracket"===right.type&&"</"===right.string}}}function cmp(a,b){return a.line-b.line||a.ch-b.ch}function equalCursorPos(a,b){return a.sticky===b.sticky&&0===cmp(a,b)}function wrapWithAbbreviation(editor){var range=getWrappingContentRange(editor);if(range){var prompt=editor.getOption("emmetPrompt")||defaultPrompt,_text=editor.getRange(range.from,range.to,"\n").split("\n").map(function(line){return line.trim()});prompt(editor,"Enter abbreviation to wrap with:",function(abbr){if(abbr){var model=new Abbreviation(abbr,range,createConfig(editor,range.from,{text:_text}));model.insert(editor)}})}else console.warn("Nothing to wrap")}function getWrappingContentRange(editor){if(editor.somethingSelected()){var sel=editor.listSelections().filter(function(sel){return sel.anchor!==sel.head})[0];if(sel)return 0>comparePos$1(sel.anchor,sel.head)?{from:sel.anchor,to:sel.head}:{from:sel.head,to:sel.anchor}}return getTagRangeForPos(editor,editor.getCursor())}function getTagRangeForPos(editor,pos){var model=editor.getEmmetDocumentModel(),tag=model&&model.nodeForPoint(pos);if(!tag)return null;if(inRange(tag.open,pos)||inRange(tag.close,pos))return rangeFromNode(tag);var from=tag.open.end,to=tag.close?tag.close.start:tag.open.end;return narrowToNonSpace(editor,from,to)}function inRange(tag,pos){return tag&&containsPos(rangeFromNode(tag),pos)}function defaultPrompt(editor,message,callback){callback(window.prompt(message))}function markAbbreviation(editor,pos){var marker=findMarker(editor,pos);if(marker)return marker;clearMarkers(editor);var model=abbreviationFromPosition(editor,pos,!0);if(model)return createMarker(editor,model)}function autocompleteProvider(editor,pos){pos=pos||editor.getCursor();var completions=[],abbreviation=abbreviationFromPosition(editor,pos,!0);abbreviation&&abbreviation.abbreviation!==abbreviation.snippet&&completions.push(expandedAbbreviationCompletion(editor,pos,abbreviation));var config=abbreviation?abbreviation.config:createConfig(editor,pos);return completions="stylesheet"===config.type?completions.concat(getStylesheetCompletions(editor,pos,config)):completions.concat(getMarkupCompletions(editor,pos,config)),{type:config.type,syntax:config.syntax,abbreviation:abbreviation,completions:completions.filter(Boolean)}}function getMarkupCompletions(editor,pos,config){var line=editor.getLine(pos.line).slice(0,pos.ch),prefix=extractPrefix(line,/[\w:\-$@]/);if(prefix){var prefixRange={from:{line:pos.line,ch:pos.ch-prefix.length},to:pos};return getSnippetCompletions(editor,pos,config).filter(function(completion){return completion.key!==prefix&&0===completion.key.indexOf(prefix)}).map(function(completion){return new EmmetCompletion("snippet",editor,prefixRange,completion.key,completion.preview,completion.snippet)})}return[]}function getStylesheetCompletions(editor,pos,config){var line=editor.getLine(pos.line).slice(0,pos.ch),prefix=extractPrefix(line,/[\w-@$]/);if(prefix){var prefixRange={from:{line:pos.line,ch:pos.ch-prefix.length},to:pos};if(config.options&&config.options.property){var lowerProp=config.options.property.toLowerCase(),completion=getSnippetCompletions(editor,pos,config).find(function(item){return item.property&&item.property===lowerProp});if(completion&&completion.keywords.length)return completion.keywords.map(function(kw){return 0===kw.key.indexOf(prefix)&&new EmmetCompletion("value",editor,prefixRange,kw.key,kw.preview,kw.snippet)}).filter(Boolean)}else return getSnippetCompletions(editor,pos,config).filter(function(completion){return completion.key!==prefix&&0===completion.key.indexOf(prefix)}).map(function(completion){return new EmmetCompletion("snippet",editor,prefixRange,completion.key,completion.preview,completion.snippet)})}return[]}function getSnippetCompletions(editor,pos,config){var type=config.type,syntax=config.syntax;editor.state.emmetCompletions||(editor.state.emmetCompletions={});var cache=editor.state.emmetCompletions;if(!(syntax in cache)){var registry=(0,_expandAbbreviation.createSnippetsRegistry)(type,syntax,config.snippets);cache[syntax]="stylesheet"===type?getStylesheetSnippets(registry,config):getMarkupSnippets(registry,config)}return cache[syntax]}function getStylesheetSnippets(registry){return(0,_cssSnippetsResolver.convertToCSSSnippets)(registry).map(function(snippet){var preview=snippet.property,keywords=snippet.keywords();return keywords.length?preview+=": "+removeFields(keywords.join(" | ")):snippet.value&&(preview+=": "+removeFields(snippet.value)),{key:snippet.key,value:snippet.value,snippet:snippet.key,property:snippet.property,keywords:keywords.map(function(kw){var m=kw.match(/^[\w-]+/);return m&&{key:m[0],preview:removeFields(kw),snippet:kw}}).filter(Boolean),preview:preview}})}function getMarkupSnippets(registry,config){return registry.all({type:"string"}).map(function(snippet){return{key:snippet.key,value:snippet.value,preview:removeFields((0,_expandAbbreviation.expand)(snippet.value,config)),snippet:snippet.key}})}function expandedAbbreviationCompletion(editor,pos,abbrModel){var preview=abbrModel.preview;return 500<preview.length&&(preview=preview.slice(0,500)+"..."),new EmmetCompletion("expanded-abbreviation",editor,abbrModel.range,"Expand abbreviation",preview,function(editor,range){return abbrModel.insert(editor,range)})}function extractPrefix(str,match){for(var offset=str.length;0<offset&&!!match.test(str[offset-1]);)offset--;return str.slice(offset)}function create(editor,syntax){var stream=new CodeMirrorStreamReader(editor);try{return new SyntaxModel((0,_htmlMatcher2.default)(stream,{xml:"xml"===syntax}),"html",syntax||"html")}catch(err){console.warn(err)}}function getModel(editor){var syntax=getSyntax$1(editor);return create(editor,syntax)}function getCachedModel(editor){return editor.state._emmetModel||(editor.state._emmetModel=getModel(editor)),editor.state._emmetModel}function resetCachedModel(editor){editor.state._emmetModel=null}function getSyntax$1(editor){var mode=editor.getMode();return"htmlmixed"===mode.name?"html":"xml"===mode.name?mode.configuration:mode.name}function matchTag(editor,pos){pos=pos||editor.getCursor();var marked=getMarkedTag(editor);if(marked)if(containsPos(marked.open.find(),pos)){if(!marked.close||text(editor,marked.open)===text(editor,marked.close))return marked;}else if(marked.close&&containsPos(marked.close.find(),pos)&&text(editor,marked.open)===text(editor,marked.close))return marked;clearTagMatch(editor);var node=findTagPair(editor,pos);if(node&&"tag"===node.type)return{open:createTagMark(editor,node.open.name,openTagMark),close:node.close&&createTagMark(editor,node.close.name,closeTagMark)}}function getMarkedTag(editor){var open,close;return editor.getAllMarks().forEach(function(mark){mark.className===openTagMark?open=mark:mark.className===closeTagMark&&(close=mark)}),open?{open:open,close:close}:null}function clearTagMatch(editor){editor.getAllMarks().forEach(function(mark){(mark.className===openTagMark||mark.className===closeTagMark)&&mark.clear()})}function findTagPair(editor,pos){var model=editor.getEmmetDocumentModel();return model&&model.nodeForPoint(pos||editor.getCursor())}function createTagMark(editor,tag,className){return editor.markText(tag.start,tag.end,{className:className,inclusiveLeft:!0,inclusiveRight:!0,clearWhenEmpty:!1})}function text(editor,mark){var range=mark.find();return range?editor.getRange(range.from,range.to):""}function renameTag(editor,obj){var tag=getMarkedTag(editor),pos=obj.from;tag&&(containsPos(tag.open.find(),pos)&&tag.close?updateTag(editor,tag.open,tag.close):tag.close&&containsPos(tag.close.find(),pos)&&updateTag(editor,tag.close,tag.open))}function updateTag(editor,source,dest){var name=text$1(editor,source),range=dest.find(),m=name.match(/[\w:.-]+/),newName=name?m&&m[0]:"";null==newName?clearTagMatch(editor):editor.getRange(range.from,range.to)!==newName&&editor.replaceRange(newName,range.from,range.to)}function text$1(editor,mark){var range=mark.find();return range?editor.getRange(range.from,range.to):""}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_config=__webpack_require__("k0dc"),_config2=_interopRequireDefault(_config),_streamReader=__webpack_require__("Lu2N"),_streamReader2=_interopRequireDefault(_streamReader),_fieldParser=__webpack_require__("R0uB"),_fieldParser2=_interopRequireDefault(_fieldParser),_streamReaderUtils=__webpack_require__("rc1b"),_extractAbbreviation=__webpack_require__("ZTma"),_extractAbbreviation2=_interopRequireDefault(_extractAbbreviation),_expandAbbreviation=__webpack_require__("k/hd"),_cssSnippetsResolver=__webpack_require__("ad/k"),_htmlMatcher=__webpack_require__("k0gZ"),_htmlMatcher2=_interopRequireDefault(_htmlMatcher),editorField=function(index){var placeholder=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return"${"+index+(placeholder?":"+placeholder:"")+"}"},CodeMirrorStreamReader=function(_StreamReader){function CodeMirrorStreamReader(editor,pos,limit){_classCallCheck(this,CodeMirrorStreamReader);var _this=_possibleConstructorReturn(this,_StreamReader.call(this)),CodeMirror=editor.constructor;_this.editor=editor,_this.start=_this.pos=pos||CodeMirror.Pos(0,0);var lastLine=editor.lastLine();return _this._eof=limit?limit.to:CodeMirror.Pos(lastLine,_this._lineLength(lastLine)),_this._sof=limit?limit.from:CodeMirror.Pos(0,0),_this}return _inherits(CodeMirrorStreamReader,_StreamReader),CodeMirrorStreamReader.prototype.sof=function(){return 0>=comparePos(this.pos,this._sof)},CodeMirrorStreamReader.prototype.eof=function(){return 0<=comparePos(this.pos,this._eof)},CodeMirrorStreamReader.prototype.limit=function(from,to){return new this.constructor(this.editor,from,{from:from,to:to})},CodeMirrorStreamReader.prototype.peek=function(){var _pos=this.pos,line=_pos.line,ch=_pos.ch,lineStr=this.editor.getLine(line);return ch<lineStr.length?lineStr.charCodeAt(ch):10},CodeMirrorStreamReader.prototype.next=function(){if(!this.eof()){var code=this.peek();return this.pos=_extends({},this.pos,{ch:this.pos.ch+1}),this.pos.ch>=this._lineLength(this.pos.line)&&(this.pos.line++,this.pos.ch=0),this.eof()&&(this.pos=_extends({},this._eof)),code}return NaN},CodeMirrorStreamReader.prototype.backUp=function(n){var CodeMirror=this.editor.constructor,_pos2=this.pos,line=_pos2.line,ch=_pos2.ch;for(ch-=n||1;0<=line&&0>ch;)line--,ch+=this._lineLength(line);return this.pos=0>line||0>ch?CodeMirror.Pos(0,0):CodeMirror.Pos(line,ch),this.peek()},CodeMirrorStreamReader.prototype.current=function(){return this.substring(this.start,this.pos)},CodeMirrorStreamReader.prototype.substring=function(from,to){return this.editor.getRange(from,to)},CodeMirrorStreamReader.prototype.error=function(message){var err=new Error(message+" at line "+this.pos.line+", column "+this.pos.ch);return err.originalMessage=message,err.pos=this.pos,err.string=this.string,err},CodeMirrorStreamReader.prototype._lineLength=function(line){var isLast=line===this.editor.lastLine();return this.editor.getLine(line).length+(isLast?0:1)},CodeMirrorStreamReader}(_streamReader2.default),emmetMarkerClass="emmet-abbreviation",Abbreviation=function(){function Abbreviation(abbreviation,range,config){_classCallCheck(this,Abbreviation),this.abbreviation=abbreviation,this.range=range,this.config=config,this.ast=(0,_expandAbbreviation.parse)(abbreviation,config),this.snippet=(0,_expandAbbreviation.expand)(this.ast,config),this.preview=removeFields(this.snippet)}return Abbreviation.prototype.insert=function(editor,range){return insertSnippet(editor,range||this.range,this.snippet)},Abbreviation.prototype.valid=function(editor,contextAware){return this.preview&&this.abbreviation!==this.preview&&(contextAware&&"stylesheet"===this.config.type?this._isValidForStylesheet(editor):!0)},Abbreviation.prototype._isValidForStylesheet=function(editor){var pos=this.range.from,token=editor.getTokenAt(pos);if(/^[#!]/.test(this.abbreviation))return isCSSPropertyValue(editor,pos);var isProperty=this.ast.children.every(function(node){return node.name}),state=token.state&&token.state.localState||token.state;return!isProperty||"sass"===this.config.syntax||state&&state.context&&"block"===state.context.type},Abbreviation}(),EmmetCompletion=function(){function EmmetCompletion(type,editor,range,name,preview,snippet){_classCallCheck(this,EmmetCompletion),this.type=type,this.editor=editor,this.range=range,this.name=name,this.preview=preview,this.snippet=snippet,this._inserted=!1}return EmmetCompletion.prototype.insert=function(){this._inserted||(this._inserted=!0,"function"==typeof this.snippet?this.snippet(this.editor,this.range):insertSnippet(this.editor,this.range,this.snippet),clearMarkers(this.editor))},EmmetCompletion}(),SyntaxModel=function(){function SyntaxModel(dom,type,syntax){_classCallCheck(this,SyntaxModel),this.dom=dom,this.type=type,this.syntax=syntax}return SyntaxModel.prototype.nodeForPoint=function(pos,exclude){for(var ctx=this.dom.firstChild,found=null;ctx;)containsPos(rangeFromNode(ctx),pos,exclude)?(found=ctx,ctx=ctx.firstChild):ctx=ctx.nextSibling;return found},SyntaxModel}(),openTagMark="emmet-open-tag",closeTagMark="emmet-close-tag";exports.default=function(CodeMirror){_extends(CodeMirror.commands,{emmetExpandAbbreviation:function(editor){return expandAbbreviation(editor,!0)},emmetExpandAbbreviationAll:function(editor){return expandAbbreviation(editor,!1)},emmetInsertLineBreak:emmetInsertLineBreak,emmetWrapWithAbbreviation:wrapWithAbbreviation});var markOnEditorChange=function(editor){return markAbbreviation(editor,editor.getCursor())};CodeMirror.defineOption("markEmmetAbbreviation",!0,function(editor,value){value?editor.on("change",markOnEditorChange):(editor.off("change",markOnEditorChange),clearMarkers(editor))}),CodeMirror.defineOption("autoRenameTags",!0,function(editor,value){value?editor.on("change",renameTag):editor.off("change",renameTag)}),CodeMirror.defineOption("jsxBracket",!0),CodeMirror.defineOption("markTagPairs",!1,function(editor,value){value?(editor.on("cursorActivity",matchTag),editor.on("change",resetCachedModel)):(editor.off("cursorActivity",matchTag),editor.off("change",resetCachedModel),resetCachedModel(editor),clearTagMatch(editor))}),CodeMirror.defineOption("emmet",{}),CodeMirror.defineExtension("getEmmetCompletions",function(pos,force){var editor=this;"boolean"==typeof pos&&(force=pos,pos=null),pos=pos||editor.getCursor();var autocomplete=autocompleteProvider(editor,pos);if(autocomplete&&autocomplete.completions.length)return editor.getOption("markEmmetAbbreviation")&&!findMarker(editor,pos)&&force&&(clearMarkers(editor),createMarker(autocomplete.model)),{from:autocomplete.abbreviation.range.from,to:autocomplete.abbreviation.range.to,list:autocomplete.completions}}),CodeMirror.defineExtension("getEmmetAbbreviation",function(pos,contextAware){return abbreviationFromPosition(this,pos||this.getCursor(),contextAware)}),CodeMirror.defineExtension("findEmmetMarker",function(pos){return findMarker(this,pos||this.getCursor())}),CodeMirror.defineExtension("getEmmetDocumentModel",function(){var editor=this;return editor.getOption("markTagPairs")?getCachedModel(editor):getModel(editor)})}},"/rE2":function(module,exports,__webpack_require__){"use strict";function resolveNode(node,registry){var stack=new Set;(function resolve(node){var snippet=registry.resolve(node.name);if(snippet&&!stack.has(snippet)){if("function"==typeof snippet.value)return snippet.value(node,registry,resolve);var tree=(0,_abbreviation2.default)(snippet.value);stack.add(snippet),tree.walk(resolve),stack.delete(snippet);var childTarget=findDeepestNode(tree);for(merge(childTarget,node);tree.firstChild;)node.parent.insertBefore(tree.firstChild,node);childTarget.parent.insertBefore(node,childTarget),childTarget.remove()}})(node)}function merge(from,to){return to.name=from.name,from.selfClosing&&(to.selfClosing=!0),null!=from.value&&(to.value=from.value),from.repeat&&(to.repeat=_extends({},from.repeat)),mergeAttributes(from,to)}function mergeAttributes(from,to){mergeClassNames(from,to);for(var attrMap=new Map,attrs=from.attributes,i=0;i<attrs.length;i++)attrMap.set(attrs[i].name,attrs[i].clone());attrs=to.attributes.slice();for(var _i=0,attr,a;_i<attrs.length;_i++)attr=attrs[_i],attrMap.has(attr.name)?(a=attrMap.get(attr.name),a.value=attr.value,a.options.implied&&(a.options.implied=!1)):attrMap.set(attr.name,attr),to.removeAttribute(attr);for(var newAttrs=Array.from(attrMap.values()),_i2=0;_i2<newAttrs.length;_i2++)to.setAttribute(newAttrs[_i2]);return to}function mergeClassNames(from,to){for(var classNames=from.classList,i=0;i<classNames.length;i++)to.addClass(classNames[i]);return to}function findDeepestNode(node){for(;node.children.length;)node=node.children[node.children.length-1];return node}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_abbreviation=__webpack_require__("A9O4"),_abbreviation2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_abbreviation);exports.default=function(tree,registry){return tree.walk(function(node){return resolveNode(node,registry)}),tree}},"0gyT":function(module){"use strict";module.exports=function(it){return"object"==typeof it?null!==it:"function"==typeof it}},"1ExO":function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__("FRpO").EventEmitter},"1JcR":function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){function cmp(a,b){return a.line-b.line||a.ch-b.ch}function Iter(cm,line,ch,range){this.line=line,this.ch=ch,this.cm=cm,this.text=cm.getLine(line),this.min=range?Math.max(range.from,cm.firstLine()):cm.firstLine(),this.max=range?Math.min(range.to-1,cm.lastLine()):cm.lastLine()}function tagAt(iter,ch){var type=iter.cm.getTokenTypeAt(Pos(iter.line,ch));return type&&/\btag\b/.test(type)}function nextLine(iter){if(!(iter.line>=iter.max))return iter.ch=0,iter.text=iter.cm.getLine(++iter.line),!0}function prevLine(iter){if(!(iter.line<=iter.min))return iter.text=iter.cm.getLine(--iter.line),iter.ch=iter.text.length,!0}function toTagEnd(iter){for(;;){var gt=iter.text.indexOf(">",iter.ch);if(-1==gt)if(nextLine(iter))continue;else return;if(!tagAt(iter,gt+1)){iter.ch=gt+1;continue}var lastSlash=iter.text.lastIndexOf("/",gt),selfClose=-1<lastSlash&&!/\S/.test(iter.text.slice(lastSlash+1,gt));return iter.ch=gt+1,selfClose?"selfClose":"regular"}}function toTagStart(iter){for(;;){var lt=iter.ch?iter.text.lastIndexOf("<",iter.ch-1):-1;if(-1==lt)if(prevLine(iter))continue;else return;if(!tagAt(iter,lt+1)){iter.ch=lt;continue}xmlTagStart.lastIndex=lt,iter.ch=lt;var match=xmlTagStart.exec(iter.text);if(match&&match.index==lt)return match}}function toNextTag(iter){for(;;){xmlTagStart.lastIndex=iter.ch;var found=xmlTagStart.exec(iter.text);if(!found)if(nextLine(iter))continue;else return;if(!tagAt(iter,found.index+1)){iter.ch=found.index+1;continue}return iter.ch=found.index+found[0].length,found}}function toPrevTag(iter){for(;;){var gt=iter.ch?iter.text.lastIndexOf(">",iter.ch-1):-1;if(-1==gt)if(prevLine(iter))continue;else return;if(!tagAt(iter,gt+1)){iter.ch=gt;continue}var lastSlash=iter.text.lastIndexOf("/",gt),selfClose=-1<lastSlash&&!/\S/.test(iter.text.slice(lastSlash+1,gt));return iter.ch=gt+1,selfClose?"selfClose":"regular"}}function findMatchingClose(iter,tag){for(var stack=[];;){var next=toNextTag(iter),startLine=iter.line,startCh=iter.ch-(next?next[0].length:0),end;if(!next||!(end=toTagEnd(iter)))return;if("selfClose"!=end)if(next[1]){for(var i=stack.length-1;0<=i;--i)if(stack[i]==next[2]){stack.length=i;break}if(0>i&&(!tag||tag==next[2]))return{tag:next[2],from:Pos(startLine,startCh),to:Pos(iter.line,iter.ch)}}else stack.push(next[2])}}function findMatchingOpen(iter,tag){for(var stack=[],prev;;){if(prev=toPrevTag(iter),!prev)return;if("selfClose"==prev){toTagStart(iter);continue}var endLine=iter.line,endCh=iter.ch,start=toTagStart(iter);if(!start)return;if(start[1])stack.push(start[2]);else{for(var i=stack.length-1;0<=i;--i)if(stack[i]==start[2]){stack.length=i;break}if(0>i&&(!tag||tag==start[2]))return{tag:start[2],from:Pos(iter.line,iter.ch),to:Pos(endLine,endCh)}}}}var Pos=CodeMirror.Pos,xmlTagStart=/<(\/?)([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;CodeMirror.registerHelper("fold","xml",function(cm,start){for(var iter=new Iter(cm,start.line,0),openTag;;){if(openTag=toNextTag(iter),!openTag||iter.line!=start.line)return;var end=toTagEnd(iter);if(!end)return;if(!openTag[1]&&"selfClose"!=end){var startPos=Pos(iter.line,iter.ch),endPos=findMatchingClose(iter,openTag[2]);return endPos&&0<cmp(endPos.from,startPos)?{from:startPos,to:endPos.from}:null}}}),CodeMirror.findMatchingTag=function(cm,pos,range){var iter=new Iter(cm,pos.line,pos.ch,range);if(-1!=iter.text.indexOf(">")||-1!=iter.text.indexOf("<")){var end=toTagEnd(iter),to=end&&Pos(iter.line,iter.ch),start=end&&toTagStart(iter);if(end&&start&&!(0<cmp(iter,pos))){var here={from:Pos(iter.line,iter.ch),to:to,tag:start[2]};return"selfClose"==end?{open:here,close:null,at:"open"}:start[1]?{open:findMatchingOpen(iter,start[2]),close:here,at:"close"}:(iter=new Iter(cm,to.line,to.ch,range),{open:here,close:findMatchingClose(iter,start[2]),at:"open"})}}},CodeMirror.findEnclosingTag=function(cm,pos,range,tag){for(var iter=new Iter(cm,pos.line,pos.ch,range),open;;){if(open=findMatchingOpen(iter,tag),!open)break;var forward=new Iter(cm,pos.line,pos.ch,range),close=findMatchingClose(forward,open.tag);if(close)return{open:open,close:close}}},CodeMirror.scanForClosingTag=function(cm,pos,name,end){var iter=new Iter(cm,pos.line,pos.ch,end?{from:0,to:end}:null);return findMatchingClose(iter,name)}})},"1ROC":function(module){"use strict";var toString={}.toString;module.exports=function(it){return toString.call(it).slice(8,-1)}},"1miM":function(module,exports,__webpack_require__){"use strict";function JSZip(){if(!(this instanceof JSZip))return new JSZip;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var newObj=new JSZip;for(var i in this)"function"!=typeof this[i]&&(newObj[i]=this[i]);return newObj}}JSZip.prototype=__webpack_require__("e4aZ"),JSZip.prototype.loadAsync=__webpack_require__("2/gt"),JSZip.support=__webpack_require__("untT"),JSZip.defaults=__webpack_require__("lUr3"),JSZip.version="3.1.5",JSZip.loadAsync=function(content,options){return new JSZip().loadAsync(content,options)},JSZip.external=__webpack_require__("8JlO"),module.exports=JSZip},"2/gt":function(module,exports,__webpack_require__){"use strict";function checkEntryCRC32(zipEntry){return new external.Promise(function(resolve,reject){var worker=zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe);worker.on("error",function(e){reject(e)}).on("end",function(){worker.streamInfo.crc32===zipEntry.decompressed.crc32?resolve():reject(new Error("Corrupted zip : CRC32 mismatch"))}).resume()})}var utils=__webpack_require__("dvMn"),external=__webpack_require__("8JlO"),utf8=__webpack_require__("Sm7/"),utils=__webpack_require__("dvMn"),ZipEntries=__webpack_require__("rAgE"),Crc32Probe=__webpack_require__("gpbE"),nodejsUtils=__webpack_require__("c5OX");module.exports=function(data,options){var zip=this;return options=utils.extend(options||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:utf8.utf8decode}),nodejsUtils.isNode&&nodejsUtils.isStream(data)?external.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):utils.prepareContent("the loaded zip file",data,!0,options.optimizedBinaryString,options.base64).then(function(data){var zipEntries=new ZipEntries(options);return zipEntries.load(data),zipEntries}).then(function(zipEntries){var promises=[external.Promise.resolve(zipEntries)],files=zipEntries.files;if(options.checkCRC32)for(var i=0;i<files.length;i++)promises.push(checkEntryCRC32(files[i]));return external.Promise.all(promises)}).then(function(results){for(var zipEntries=results.shift(),files=zipEntries.files,i=0,input;i<files.length;i++)input=files[i],zip.file(input.fileNameStr,input.decompressed,{binary:!0,optimizedBinaryString:!0,date:input.date,dir:input.dir,comment:input.fileCommentStr.length?input.fileCommentStr:null,unixPermissions:input.unixPermissions,dosPermissions:input.dosPermissions,createFolders:options.createFolders});return zipEntries.zipComment.length&&(zip.comment=zipEntries.zipComment),zip})}},"29F7":function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){function regexpFlags(regexp){var flags=regexp.flags;return null==flags?(regexp.ignoreCase?"i":"")+(regexp.global?"g":"")+(regexp.multiline?"m":""):flags}function ensureFlags(regexp,flags){for(var current=regexpFlags(regexp),target=current,i=0;i<flags.length;i++)-1==target.indexOf(flags.charAt(i))&&(target+=flags.charAt(i));return current==target?regexp:new RegExp(regexp.source,target)}function maybeMultiline(regexp){return /\\s|\\n|\n|\\W|\\D|\[\^/.test(regexp.source)}function searchRegexpForward(doc,regexp,start){regexp=ensureFlags(regexp,"g");for(var line=start.line,ch=start.ch,last=doc.lastLine();line<=last;line++,ch=0){regexp.lastIndex=ch;var string=doc.getLine(line),match=regexp.exec(string);if(match)return{from:Pos(line,match.index),to:Pos(line,match.index+match[0].length),match:match}}}function searchRegexpForwardMultiline(doc,regexp,start){if(!maybeMultiline(regexp))return searchRegexpForward(doc,regexp,start);regexp=ensureFlags(regexp,"gm");for(var chunk=1,line=start.line,last=doc.lastLine(),string;line<=last;){for(var i=0,curLine;i<chunk&&!(line>last);i++)curLine=doc.getLine(line++),string=null==string?curLine:string+"\n"+curLine;chunk*=2,regexp.lastIndex=start.ch;var match=regexp.exec(string);if(match){var before=string.slice(0,match.index).split("\n"),inside=match[0].split("\n"),startLine=start.line+before.length-1,startCh=before[before.length-1].length;return{from:Pos(startLine,startCh),to:Pos(startLine+inside.length-1,1==inside.length?startCh+inside[0].length:inside[inside.length-1].length),match:match}}}}function lastMatchIn(string,regexp){for(var cutOff=0,match;;){regexp.lastIndex=cutOff;var newMatch=regexp.exec(string);if(!newMatch)return match;if(match=newMatch,cutOff=match.index+(match[0].length||1),cutOff==string.length)return match}}function searchRegexpBackward(doc,regexp,start){regexp=ensureFlags(regexp,"g");for(var line=start.line,ch=start.ch,first=doc.firstLine(),string;line>=first;line--,ch=-1){string=doc.getLine(line),-1<ch&&(string=string.slice(0,ch));var match=lastMatchIn(string,regexp);if(match)return{from:Pos(line,match.index),to:Pos(line,match.index+match[0].length),match:match}}}function searchRegexpBackwardMultiline(doc,regexp,start){regexp=ensureFlags(regexp,"gm");for(var chunk=1,line=start.line,first=doc.firstLine(),string;line>=first;){for(var i=0,curLine;i<chunk;i++)curLine=doc.getLine(line--),string=null==string?curLine.slice(0,start.ch):curLine+"\n"+string;chunk*=2;var match=lastMatchIn(string,regexp);if(match){var before=string.slice(0,match.index).split("\n"),inside=match[0].split("\n"),startLine=line+before.length,startCh=before[before.length-1].length;return{from:Pos(startLine,startCh),to:Pos(startLine+inside.length-1,1==inside.length?startCh+inside[0].length:inside[inside.length-1].length),match:match}}}}function adjustPos(orig,folded,pos,foldFunc){if(orig.length==folded.length)return pos;for(var min=0,max=pos+Math.max(0,orig.length-folded.length);;){if(min==max)return min;var mid=min+max>>1,len=foldFunc(orig.slice(0,mid)).length;if(len==pos)return mid;len>pos?max=mid:min=mid+1}}function searchStringForward(doc,query,start,caseFold){if(!query.length)return null;var fold=caseFold?doFold:noFold,lines=fold(query).split(/\r|\n\r?/);search:for(var line=start.line,ch=start.ch,last=doc.lastLine()+1-lines.length;line<=last;line++,ch=0){var orig=doc.getLine(line).slice(ch),string=fold(orig);if(1==lines.length){var found=string.indexOf(lines[0]);if(-1==found)continue search;var start=adjustPos(orig,string,found,fold)+ch;return{from:Pos(line,adjustPos(orig,string,found,fold)+ch),to:Pos(line,adjustPos(orig,string,found+lines[0].length,fold)+ch)}}var cutFrom=string.length-lines[0].length;if(string.slice(cutFrom)!=lines[0])continue search;for(var i=1;i<lines.length-1;i++)if(fold(doc.getLine(line+i))!=lines[i])continue search;var end=doc.getLine(line+lines.length-1),endString=fold(end),lastLine=lines[lines.length-1];if(endString.slice(0,lastLine.length)!=lastLine)continue search;return{from:Pos(line,adjustPos(orig,string,cutFrom,fold)+ch),to:Pos(line+lines.length-1,adjustPos(end,endString,lastLine.length,fold))}}}function searchStringBackward(doc,query,start,caseFold){if(!query.length)return null;var fold=caseFold?doFold:noFold,lines=fold(query).split(/\r|\n\r?/);search:for(var line=start.line,ch=start.ch,first=doc.firstLine()-1+lines.length,orig;line>=first;line--,ch=-1){orig=doc.getLine(line),-1<ch&&(orig=orig.slice(0,ch));var string=fold(orig);if(1==lines.length){var found=string.lastIndexOf(lines[0]);if(-1==found)continue search;return{from:Pos(line,adjustPos(orig,string,found,fold)),to:Pos(line,adjustPos(orig,string,found+lines[0].length,fold))}}var lastLine=lines[lines.length-1];if(string.slice(0,lastLine.length)!=lastLine)continue search;for(var i=1,start=line-lines.length+1;i<lines.length-1;i++)if(fold(doc.getLine(start+i))!=lines[i])continue search;var top=doc.getLine(line+1-lines.length),topString=fold(top);if(topString.slice(topString.length-lines[0].length)!=lines[0])continue search;return{from:Pos(line+1-lines.length,adjustPos(top,topString,top.length-lines[0].length,fold)),to:Pos(line,adjustPos(orig,string,lastLine.length,fold))}}}function SearchCursor(doc,query,pos,options){this.atOccurrence=!1,this.doc=doc,pos=pos?doc.clipPos(pos):Pos(0,0),this.pos={from:pos,to:pos};var caseFold;"object"==typeof options?caseFold=options.caseFold:(caseFold=options,options=null),"string"==typeof query?(null==caseFold&&(caseFold=!1),this.matches=function(reverse,pos){return(reverse?searchStringBackward:searchStringForward)(doc,query,pos,caseFold)}):(query=ensureFlags(query,"gm"),this.matches=options&&!1===options.multiline?function(reverse,pos){return(reverse?searchRegexpBackward:searchRegexpForward)(doc,query,pos)}:function(reverse,pos){return(reverse?searchRegexpBackwardMultiline:searchRegexpForwardMultiline)(doc,query,pos)})}var Pos=CodeMirror.Pos,doFold,noFold;String.prototype.normalize?(doFold=function(str){return str.normalize("NFD").toLowerCase()},noFold=function(str){return str.normalize("NFD")}):(doFold=function(str){return str.toLowerCase()},noFold=function(str){return str}),SearchCursor.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(reverse){for(var result=this.matches(reverse,this.doc.clipPos(reverse?this.pos.from:this.pos.to));result&&0==CodeMirror.cmpPos(result.from,result.to);)reverse?result.from.ch?result.from=Pos(result.from.line,result.from.ch-1):result.from.line==this.doc.firstLine()?result=null:result=this.matches(reverse,this.doc.clipPos(Pos(result.from.line-1))):result.to.ch<this.doc.getLine(result.to.line).length?result.to=Pos(result.to.line,result.to.ch+1):result.to.line==this.doc.lastLine()?result=null:result=this.matches(reverse,Pos(result.to.line+1,0));if(result)return this.pos=result,this.atOccurrence=!0,this.pos.match||!0;var end=Pos(reverse?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:end,to:end},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(newText,origin){if(this.atOccurrence){var lines=CodeMirror.splitLines(newText);this.doc.replaceRange(lines,this.pos.from,this.pos.to,origin),this.pos.to=Pos(this.pos.from.line+lines.length-1,lines[lines.length-1].length+(1==lines.length?this.pos.from.ch:0))}}},CodeMirror.defineExtension("getSearchCursor",function(query,pos,caseFold){return new SearchCursor(this.doc,query,pos,caseFold)}),CodeMirror.defineDocExtension("getSearchCursor",function(query,pos,caseFold){return new SearchCursor(this,query,pos,caseFold)}),CodeMirror.defineExtension("selectMatches",function(query,caseFold){for(var ranges=[],cur=this.getSearchCursor(query,this.getCursor("from"),caseFold);cur.findNext()&&!(0<CodeMirror.cmpPos(cur.to(),this.getCursor("to")));)ranges.push({anchor:cur.from(),head:cur.to()});ranges.length&&this.setSelections(ranges,0)})})},"2P9T":function(module,exports,__webpack_require__){"use strict";function transformZipOutput(type,content,mimeType){return"blob"===type?utils.newBlob(utils.transformTo("arraybuffer",content),mimeType):"base64"===type?base64.encode(content):utils.transformTo(type,content)}function concat(type,dataArray){var index=0,res=null,totalLength=0,i;for(i=0;i<dataArray.length;i++)totalLength+=dataArray[i].length;switch(type){case"string":return dataArray.join("");case"array":return Array.prototype.concat.apply([],dataArray);case"uint8array":for(res=new Uint8Array(totalLength),i=0;i<dataArray.length;i++)res.set(dataArray[i],index),index+=dataArray[i].length;return res;case"nodebuffer":return Buffer.concat(dataArray);default:throw new Error("concat : unsupported type '"+type+"'");}}function _accumulate(helper,updateCallback){return new external.Promise(function(resolve,reject){var dataArray=[],chunkType=helper._internalType,resultType=helper._outputType,mimeType=helper._mimeType;helper.on("data",function(data,meta){dataArray.push(data),updateCallback&&updateCallback(meta)}).on("error",function(err){dataArray=[],reject(err)}).on("end",function(){try{var result=transformZipOutput(resultType,concat(chunkType,dataArray),mimeType);resolve(result)}catch(e){reject(e)}dataArray=[]}).resume()})}function StreamHelper(worker,outputType,mimeType){var internalType=outputType;"blob"===outputType||"arraybuffer"===outputType?internalType="uint8array":"base64"===outputType?internalType="string":void 0;try{this._internalType=internalType,this._outputType=outputType,this._mimeType=mimeType,utils.checkSupport(internalType),this._worker=worker.pipe(new ConvertWorker(internalType)),worker.lock()}catch(e){this._worker=new GenericWorker("error"),this._worker.error(e)}}var utils=__webpack_require__("dvMn"),ConvertWorker=__webpack_require__("yPXq"),GenericWorker=__webpack_require__("ZKdc"),base64=__webpack_require__("Ps3q"),support=__webpack_require__("untT"),external=__webpack_require__("8JlO"),NodejsStreamOutputAdapter=null;if(support.nodestream)try{NodejsStreamOutputAdapter=__webpack_require__("LZfN")}catch(e){}StreamHelper.prototype={accumulate:function(updateCb){return _accumulate(this,updateCb)},on:function(evt,fn){var self=this;return"data"===evt?this._worker.on(evt,function(chunk){fn.call(self,chunk.data,chunk.meta)}):this._worker.on(evt,function(){utils.delay(fn,arguments,self)}),this},resume:function(){return utils.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(updateCb){if(utils.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new NodejsStreamOutputAdapter(this,{objectMode:"nodebuffer"!==this._outputType},updateCb)}},module.exports=StreamHelper},"2u+n":function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__("tbG5"),MAXBITS=15,ENOUGH_LENS=852,ENOUGH_DISTS=592,CODES=0,LENS=1,DISTS=2,lbase=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],lext=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],dbase=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],dext=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];module.exports=function(type,lens,lens_index,codes,table,table_index,work,opts){var bits=opts.bits,len=0,sym=0,min=0,max=0,root=0,curr=0,drop=0,left=0,used=0,huff=0,base=null,base_index=0,count=new utils.Buf16(MAXBITS+1),offs=new utils.Buf16(MAXBITS+1),extra=null,extra_index=0,incr,fill,low,mask,next,end,here_bits,here_op,here_val;for(len=0;len<=MAXBITS;len++)count[len]=0;for(sym=0;sym<codes;sym++)count[lens[lens_index+sym]]++;for(root=bits,max=MAXBITS;1<=max&&0===count[max];max--);if(root>max&&(root=max),0==max)return table[table_index++]=20971520,table[table_index++]=20971520,opts.bits=1,0;for(min=1;min<max&&0===count[min];min++);for(root<min&&(root=min),left=1,len=1;len<=MAXBITS;len++)if(left<<=1,left-=count[len],0>left)return-1;if(0<left&&(type===CODES||1!=max))return-1;for(offs[1]=0,len=1;len<MAXBITS;len++)offs[len+1]=offs[len]+count[len];for(sym=0;sym<codes;sym++)0!==lens[lens_index+sym]&&(work[offs[lens[lens_index+sym]]++]=sym);if(type===CODES?(base=extra=work,end=19):type===LENS?(base=lbase,base_index-=257,extra=lext,extra_index-=257,end=256):(base=dbase,extra=dext,end=-1),huff=0,sym=0,len=min,next=table_index,curr=root,drop=0,low=-1,used=1<<root,mask=used-1,type===LENS&&used>ENOUGH_LENS||type===DISTS&&used>ENOUGH_DISTS)return 1;for(;;){here_bits=len-drop,work[sym]<end?(here_op=0,here_val=work[sym]):work[sym]>end?(here_op=extra[extra_index+work[sym]],here_val=base[base_index+work[sym]]):(here_op=96,here_val=0),incr=1<<len-drop,fill=1<<curr,min=fill;do fill-=incr,table[next+(huff>>drop)+fill]=0|(here_bits<<24|here_op<<16|here_val);while(0!==fill);for(incr=1<<len-1;huff&incr;)incr>>=1;if(0===incr?huff=0:(huff&=incr-1,huff+=incr),sym++,0==--count[len]){if(len==max)break;len=lens[lens_index+work[sym]]}if(len>root&&(huff&mask)!==low){for(0==drop&&(drop=root),next+=min,curr=len-drop,left=1<<curr;curr+drop<max&&(left-=count[curr+drop],!(0>=left));)curr++,left<<=1;if(used+=1<<curr,type===LENS&&used>ENOUGH_LENS||type===DISTS&&used>ENOUGH_DISTS)return 1;low=huff&mask,table[low]=0|(root<<24|curr<<16|next-table_index)}}return 0!==huff&&(table[next+huff]=0|(4194304|len-drop<<24)),opts.bits=root,0}},"34Q3":function(module,exports,__webpack_require__){"use strict";function buf2binstring(buf,len){if(65537>len&&(buf.subarray&&STR_APPLY_UIA_OK||!buf.subarray&&STR_APPLY_OK))return _StringfromCharCode.apply(null,utils.shrinkBuf(buf,len));for(var result="",i=0;i<len;i++)result+=_StringfromCharCode(buf[i]);return result}var _StringfromCharCode=String.fromCharCode,utils=__webpack_require__("tbG5"),STR_APPLY_OK=!0,STR_APPLY_UIA_OK=!0;try{_StringfromCharCode.apply(null,[0])}catch(__){STR_APPLY_OK=!1}try{_StringfromCharCode.apply(null,new Uint8Array(1))}catch(__){STR_APPLY_UIA_OK=!1}for(var _utf8len=new utils.Buf8(256),q=0;256>q;q++)_utf8len[q]=252<=q?6:248<=q?5:240<=q?4:224<=q?3:192<=q?2:1;_utf8len[254]=_utf8len[254]=1,exports.string2buf=function(str){var str_len=str.length,buf_len=0,buf,c,c2,m_pos,i;for(m_pos=0;m_pos<str_len;m_pos++)c=str.charCodeAt(m_pos),55296==(64512&c)&&m_pos+1<str_len&&(c2=str.charCodeAt(m_pos+1),56320==(64512&c2)&&(c=65536+(c-55296<<10)+(c2-56320),m_pos++)),buf_len+=128>c?1:2048>c?2:65536>c?3:4;for(buf=new utils.Buf8(buf_len),i=0,m_pos=0;i<buf_len;m_pos++)c=str.charCodeAt(m_pos),55296==(64512&c)&&m_pos+1<str_len&&(c2=str.charCodeAt(m_pos+1),56320==(64512&c2)&&(c=65536+(c-55296<<10)+(c2-56320),m_pos++)),128>c?buf[i++]=c:2048>c?(buf[i++]=192|c>>>6,buf[i++]=128|63&c):65536>c?(buf[i++]=224|c>>>12,buf[i++]=128|63&c>>>6,buf[i++]=128|63&c):(buf[i++]=240|c>>>18,buf[i++]=128|63&c>>>12,buf[i++]=128|63&c>>>6,buf[i++]=128|63&c);return buf},exports.buf2binstring=function(buf){return buf2binstring(buf,buf.length)},exports.binstring2buf=function(str){for(var buf=new utils.Buf8(str.length),i=0,len=buf.length;i<len;i++)buf[i]=str.charCodeAt(i);return buf},exports.buf2string=function(buf,max){var len=max||buf.length,utf16buf=Array(2*len),i,out,c,c_len;for(out=0,i=0;i<len;){if(c=buf[i++],128>c){utf16buf[out++]=c;continue}if(c_len=_utf8len[c],4<c_len){utf16buf[out++]=65533,i+=c_len-1;continue}for(c&=2===c_len?31:3===c_len?15:7;1<c_len&&i<len;)c=c<<6|63&buf[i++],c_len--;if(1<c_len){utf16buf[out++]=65533;continue}65536>c?utf16buf[out++]=c:(c-=65536,utf16buf[out++]=55296|1023&c>>10,utf16buf[out++]=56320|1023&c)}return buf2binstring(utf16buf,out)},exports.utf8border=function(buf,max){var pos;for(max=max||buf.length,max>buf.length&&(max=buf.length),pos=max-1;0<=pos&&128==(192&buf[pos]);)pos--;return 0>pos?max:0===pos?max:pos+_utf8len[buf[pos]]>max?pos:max}},"38Wu":function(module,exports,__webpack_require__){"use strict";function copyProps(src,dst){for(var key in src)dst[key]=src[key]}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length)}var buffer=__webpack_require__("dskh"),Buffer=buffer.Buffer;Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(arg,encodingOrOffset,length){if("number"==typeof arg)throw new TypeError("Argument must not be a number");return Buffer(arg,encodingOrOffset,length)},SafeBuffer.alloc=function(size,fill,encoding){if("number"!=typeof size)throw new TypeError("Argument must be a number");var buf=Buffer(size);return void 0===fill?buf.fill(0):"string"==typeof encoding?buf.fill(fill,encoding):buf.fill(fill),buf},SafeBuffer.allocUnsafe=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return Buffer(size)},SafeBuffer.allocUnsafeSlow=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}},"3Rhr":function(module){"use strict";module.exports=function(fn,args,that){var un=void 0===that;switch(args.length){case 0:return un?fn():fn.call(that);case 1:return un?fn(args[0]):fn.call(that,args[0]);case 2:return un?fn(args[0],args[1]):fn.call(that,args[0],args[1]);case 3:return un?fn(args[0],args[1],args[2]):fn.call(that,args[0],args[1],args[2]);case 4:return un?fn(args[0],args[1],args[2],args[3]):fn.call(that,args[0],args[1],args[2],args[3]);}return fn.apply(that,args)}},"3Vd+":function(module){"use strict";var global=module.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=global)},"3bh8":function(module,exports,__webpack_require__){"use strict";var dP=__webpack_require__("z3uY"),createDesc=__webpack_require__("HyWd");module.exports=__webpack_require__("s0rf")?function(object,key,value){return dP.f(object,key,createDesc(1,value))}:function(object,key,value){return object[key]=value,object}},"4Bm0":function(module){"use strict";module.exports="function"==typeof Object.create?function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})}:function(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}},"4E2n":function(module,exports){"use strict";var _StringfromCharCode2=String.fromCharCode;(function(root,factory){module.exports=factory()})(void 0,function(){return function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:!1};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="",__webpack_require__(0)}([function(module,exports,__webpack_require__){function parse(code,options,delegate){var commentHandler=null,proxyDelegate=function(node,metadata){delegate&&delegate(node,metadata),commentHandler&&commentHandler.visit(node,metadata)},parserDelegate="function"==typeof delegate?proxyDelegate:null,collectComment=!1;if(options){collectComment="boolean"==typeof options.comment&&options.comment;var attachComment="boolean"==typeof options.attachComment&&options.attachComment;(collectComment||attachComment)&&(commentHandler=new comment_handler_1.CommentHandler,commentHandler.attach=attachComment,options.comment=!0,parserDelegate=proxyDelegate)}var isModule=!1;options&&"string"==typeof options.sourceType&&(isModule="module"===options.sourceType);var parser=options&&"boolean"==typeof options.jsx&&options.jsx?new jsx_parser_1.JSXParser(code,options,parserDelegate):new parser_1.Parser(code,options,parserDelegate);var program=isModule?parser.parseModule():parser.parseScript(),ast=program;return collectComment&&commentHandler&&(ast.comments=commentHandler.comments),parser.config.tokens&&(ast.tokens=parser.tokens),parser.config.tolerant&&(ast.errors=parser.errorHandler.errors),ast}Object.defineProperty(exports,"__esModule",{value:!0});var comment_handler_1=__webpack_require__(1),jsx_parser_1=__webpack_require__(3),parser_1=__webpack_require__(8),tokenizer_1=__webpack_require__(15);exports.parse=parse,exports.parseModule=function(code,options,delegate){var parsingOptions=options||{};return parsingOptions.sourceType="module",parse(code,parsingOptions,delegate)},exports.parseScript=function(code,options,delegate){var parsingOptions=options||{};return parsingOptions.sourceType="script",parse(code,parsingOptions,delegate)},exports.tokenize=function(code,options,delegate){var tokenizer=new tokenizer_1.Tokenizer(code,options),tokens;tokens=[];try{for(;;){var token=tokenizer.getNextToken();if(!token)break;delegate&&(token=delegate(token)),tokens.push(token)}}catch(e){tokenizer.errorHandler.tolerate(e)}return tokenizer.errorHandler.tolerant&&(tokens.errors=tokenizer.errors()),tokens};var syntax_1=__webpack_require__(2);exports.Syntax=syntax_1.Syntax,exports.version="4.0.0"},function(module,exports,__webpack_require__){Object.defineProperty(exports,"__esModule",{value:!0});var syntax_1=__webpack_require__(2),CommentHandler=function(){function CommentHandler(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return CommentHandler.prototype.insertInnerComments=function(node,metadata){if(node.type===syntax_1.Syntax.BlockStatement&&0===node.body.length){for(var innerComments=[],i=this.leading.length-1,entry;0<=i;--i)entry=this.leading[i],metadata.end.offset>=entry.start&&(innerComments.unshift(entry.comment),this.leading.splice(i,1),this.trailing.splice(i,1));innerComments.length&&(node.innerComments=innerComments)}},CommentHandler.prototype.findTrailingComments=function(metadata){var trailingComments=[];if(0<this.trailing.length){for(var i=this.trailing.length-1,entry_1;0<=i;--i)entry_1=this.trailing[i],entry_1.start>=metadata.end.offset&&trailingComments.unshift(entry_1.comment);return this.trailing.length=0,trailingComments}var entry=this.stack[this.stack.length-1];if(entry&&entry.node.trailingComments){var firstComment=entry.node.trailingComments[0];firstComment&&firstComment.range[0]>=metadata.end.offset&&(trailingComments=entry.node.trailingComments,delete entry.node.trailingComments)}return trailingComments},CommentHandler.prototype.findLeadingComments=function(metadata){for(var leadingComments=[],target,entry;0<this.stack.length&&(entry=this.stack[this.stack.length-1],entry&&entry.start>=metadata.start.offset);)target=entry.node,this.stack.pop();if(target){for(var count=target.leadingComments?target.leadingComments.length:0,i=count-1,comment;0<=i;--i)comment=target.leadingComments[i],comment.range[1]<=metadata.start.offset&&(leadingComments.unshift(comment),target.leadingComments.splice(i,1));return target.leadingComments&&0===target.leadingComments.length&&delete target.leadingComments,leadingComments}for(var i=this.leading.length-1,entry;0<=i;--i)entry=this.leading[i],entry.start<=metadata.start.offset&&(leadingComments.unshift(entry.comment),this.leading.splice(i,1));return leadingComments},CommentHandler.prototype.visitNode=function(node,metadata){if(!(node.type===syntax_1.Syntax.Program&&0<node.body.length)){this.insertInnerComments(node,metadata);var trailingComments=this.findTrailingComments(metadata),leadingComments=this.findLeadingComments(metadata);0<leadingComments.length&&(node.leadingComments=leadingComments),0<trailingComments.length&&(node.trailingComments=trailingComments),this.stack.push({node:node,start:metadata.start.offset})}},CommentHandler.prototype.visitComment=function(node,metadata){var type="L"===node.type[0]?"Line":"Block",comment={type:type,value:node.value};if(node.range&&(comment.range=node.range),node.loc&&(comment.loc=node.loc),this.comments.push(comment),this.attach){var entry={comment:{type:type,value:node.value,range:[metadata.start.offset,metadata.end.offset]},start:metadata.start.offset};node.loc&&(entry.comment.loc=node.loc),node.type=type,this.leading.push(entry),this.trailing.push(entry)}},CommentHandler.prototype.visit=function(node,metadata){"LineComment"===node.type?this.visitComment(node,metadata):"BlockComment"===node.type?this.visitComment(node,metadata):this.attach&&this.visitNode(node,metadata)},CommentHandler}();exports.CommentHandler=CommentHandler},function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(module,exports,__webpack_require__){function getQualifiedElementName(elementName){var qualifiedName;switch(elementName.type){case jsx_syntax_1.JSXSyntax.JSXIdentifier:qualifiedName=elementName.name;break;case jsx_syntax_1.JSXSyntax.JSXNamespacedName:var ns=elementName;qualifiedName=getQualifiedElementName(ns.namespace)+":"+getQualifiedElementName(ns.name);break;case jsx_syntax_1.JSXSyntax.JSXMemberExpression:var expr=elementName;qualifiedName=getQualifiedElementName(expr.object)+"."+getQualifiedElementName(expr.property);break;default:}return qualifiedName}var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])};return function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:!0});var character_1=__webpack_require__(4),JSXNode=__webpack_require__(5),jsx_syntax_1=__webpack_require__(6),Node=__webpack_require__(7),parser_1=__webpack_require__(8),token_1=__webpack_require__(13),xhtml_entities_1=__webpack_require__(14);token_1.TokenName[100]="JSXIdentifier",token_1.TokenName[101]="JSXText";var JSXParser=function(_super){function JSXParser(code,options,delegate){return _super.call(this,code,options,delegate)||this}return __extends(JSXParser,_super),JSXParser.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():_super.prototype.parsePrimaryExpression.call(this)},JSXParser.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},JSXParser.prototype.finishJSX=function(){this.nextToken()},JSXParser.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},JSXParser.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},JSXParser.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},JSXParser.prototype.scanXHTMLEntity=function(quote){for(var result="&",valid=!0,terminated=!1,numeric=!1,hex=!1,ch;!this.scanner.eof()&&valid&&!terminated&&(ch=this.scanner.source[this.scanner.index],ch!==quote);)if(terminated=";"===ch,result+=ch,++this.scanner.index,!terminated)switch(result.length){case 2:numeric="#"===ch;break;case 3:numeric&&(hex="x"===ch,valid=hex||character_1.Character.isDecimalDigit(ch.charCodeAt(0)),numeric=numeric&&!hex);break;default:valid=valid&&(!numeric||character_1.Character.isDecimalDigit(ch.charCodeAt(0))),valid=valid&&(!hex||character_1.Character.isHexDigit(ch.charCodeAt(0)));}if(valid&&terminated&&2<result.length){var str=result.substr(1,result.length-2);numeric&&1<str.length?result=_StringfromCharCode2(parseInt(str.substr(1),10)):hex&&2<str.length?result=_StringfromCharCode2(parseInt("0"+str.substr(1),16)):!numeric&&!hex&&xhtml_entities_1.XHTMLEntities[str]&&(result=xhtml_entities_1.XHTMLEntities[str])}return result},JSXParser.prototype.lexJSX=function(){var cp=this.scanner.source.charCodeAt(this.scanner.index);if(60===cp||62===cp||47===cp||58===cp||61===cp||123===cp||125===cp){var value=this.scanner.source[this.scanner.index++];return{type:7,value:value,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(34===cp||39===cp){for(var start=this.scanner.index,quote=this.scanner.source[this.scanner.index++],str="",ch;!this.scanner.eof()&&(ch=this.scanner.source[this.scanner.index++],ch!==quote);)str+="&"===ch?this.scanXHTMLEntity(quote):ch;return{type:8,value:str,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:start,end:this.scanner.index}}if(46===cp){var n1=this.scanner.source.charCodeAt(this.scanner.index+1),n2=this.scanner.source.charCodeAt(this.scanner.index+2),value=46===n1&&46===n2?"...":".",start=this.scanner.index;return this.scanner.index+=value.length,{type:7,value:value,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:start,end:this.scanner.index}}if(96===cp)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(character_1.Character.isIdentifierStart(cp)&&92!==cp){var start=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var ch=this.scanner.source.charCodeAt(this.scanner.index);if(character_1.Character.isIdentifierPart(ch)&&92!==ch)++this.scanner.index;else if(45===ch)++this.scanner.index;else break}var id=this.scanner.source.slice(start,this.scanner.index);return{type:100,value:id,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:start,end:this.scanner.index}}return this.scanner.lex()},JSXParser.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var token=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(token)),token},JSXParser.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var start=this.scanner.index,text="",ch;!this.scanner.eof()&&(ch=this.scanner.source[this.scanner.index],"{"!==ch&&"<"!==ch);)++this.scanner.index,text+=ch,character_1.Character.isLineTerminator(ch.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===ch&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index);this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var token={type:101,value:text,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:start,end:this.scanner.index};return 0<text.length&&this.config.tokens&&this.tokens.push(this.convertToken(token)),token},JSXParser.prototype.peekJSXToken=function(){var state=this.scanner.saveState();this.scanner.scanComments();var next=this.lexJSX();return this.scanner.restoreState(state),next},JSXParser.prototype.expectJSX=function(value){var token=this.nextJSXToken();(7!==token.type||token.value!==value)&&this.throwUnexpectedToken(token)},JSXParser.prototype.matchJSX=function(value){var next=this.peekJSXToken();return 7===next.type&&next.value===value},JSXParser.prototype.parseJSXIdentifier=function(){var node=this.createJSXNode(),token=this.nextJSXToken();return 100!==token.type&&this.throwUnexpectedToken(token),this.finalize(node,new JSXNode.JSXIdentifier(token.value))},JSXParser.prototype.parseJSXElementName=function(){var node=this.createJSXNode(),elementName=this.parseJSXIdentifier();if(this.matchJSX(":")){var namespace=elementName;this.expectJSX(":");var name_1=this.parseJSXIdentifier();elementName=this.finalize(node,new JSXNode.JSXNamespacedName(namespace,name_1))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var object=elementName;this.expectJSX(".");var property=this.parseJSXIdentifier();elementName=this.finalize(node,new JSXNode.JSXMemberExpression(object,property))}return elementName},JSXParser.prototype.parseJSXAttributeName=function(){var node=this.createJSXNode(),identifier=this.parseJSXIdentifier(),attributeName;if(this.matchJSX(":")){this.expectJSX(":");var name_2=this.parseJSXIdentifier();attributeName=this.finalize(node,new JSXNode.JSXNamespacedName(identifier,name_2))}else attributeName=identifier;return attributeName},JSXParser.prototype.parseJSXStringLiteralAttribute=function(){var node=this.createJSXNode(),token=this.nextJSXToken();8!==token.type&&this.throwUnexpectedToken(token);var raw=this.getTokenRaw(token);return this.finalize(node,new Node.Literal(token.value,raw))},JSXParser.prototype.parseJSXExpressionAttribute=function(){var node=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var expression=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(node,new JSXNode.JSXExpressionContainer(expression))},JSXParser.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},JSXParser.prototype.parseJSXNameValueAttribute=function(){var node=this.createJSXNode(),name=this.parseJSXAttributeName(),value=null;return this.matchJSX("=")&&(this.expectJSX("="),value=this.parseJSXAttributeValue()),this.finalize(node,new JSXNode.JSXAttribute(name,value))},JSXParser.prototype.parseJSXSpreadAttribute=function(){var node=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var argument=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(node,new JSXNode.JSXSpreadAttribute(argument))},JSXParser.prototype.parseJSXAttributes=function(){for(var attributes=[],attribute;!this.matchJSX("/")&&!this.matchJSX(">");)attribute=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute(),attributes.push(attribute);return attributes},JSXParser.prototype.parseJSXOpeningElement=function(){var node=this.createJSXNode();this.expectJSX("<");var name=this.parseJSXElementName(),attributes=this.parseJSXAttributes(),selfClosing=this.matchJSX("/");return selfClosing&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(node,new JSXNode.JSXOpeningElement(name,selfClosing,attributes))},JSXParser.prototype.parseJSXBoundaryElement=function(){var node=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var name_3=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(node,new JSXNode.JSXClosingElement(name_3))}var name=this.parseJSXElementName(),attributes=this.parseJSXAttributes(),selfClosing=this.matchJSX("/");return selfClosing&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(node,new JSXNode.JSXOpeningElement(name,selfClosing,attributes))},JSXParser.prototype.parseJSXEmptyExpression=function(){var node=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(node,new JSXNode.JSXEmptyExpression)},JSXParser.prototype.parseJSXExpressionContainer=function(){var node=this.createJSXNode();this.expectJSX("{");var expression;return this.matchJSX("}")?(expression=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),expression=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(node,new JSXNode.JSXExpressionContainer(expression))},JSXParser.prototype.parseJSXChildren=function(){for(var children=[];!this.scanner.eof();){var node=this.createJSXChildNode(),token=this.nextJSXText();if(token.start<token.end){var raw=this.getTokenRaw(token),child=this.finalize(node,new JSXNode.JSXText(token.value,raw));children.push(child)}if("{"===this.scanner.source[this.scanner.index]){var container=this.parseJSXExpressionContainer();children.push(container)}else break}return children},JSXParser.prototype.parseComplexJSXElement=function(el){for(var stack=[];!this.scanner.eof();){el.children=el.children.concat(this.parseJSXChildren());var node=this.createJSXChildNode(),element=this.parseJSXBoundaryElement();if(element.type===jsx_syntax_1.JSXSyntax.JSXOpeningElement){var opening=element;if(opening.selfClosing){var child=this.finalize(node,new JSXNode.JSXElement(opening,[],null));el.children.push(child)}else stack.push(el),el={node:node,opening:opening,closing:null,children:[]}}if(element.type===jsx_syntax_1.JSXSyntax.JSXClosingElement){el.closing=element;var open_1=getQualifiedElementName(el.opening.name),close_1=getQualifiedElementName(el.closing.name);if(open_1!==close_1&&this.tolerateError("Expected corresponding JSX closing tag for %0",open_1),0<stack.length){var child=this.finalize(el.node,new JSXNode.JSXElement(el.opening,el.children,el.closing));el=stack[stack.length-1],el.children.push(child),stack.pop()}else break}}return el},JSXParser.prototype.parseJSXElement=function(){var node=this.createJSXNode(),opening=this.parseJSXOpeningElement(),children=[],closing=null;if(!opening.selfClosing){var el=this.parseComplexJSXElement({node:node,opening:opening,closing:closing,children:children});children=el.children,closing=el.closing}return this.finalize(node,new JSXNode.JSXElement(opening,children,closing))},JSXParser.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var element=this.parseJSXElement();return this.finishJSX(),element},JSXParser.prototype.isStartOfExpression=function(){return _super.prototype.isStartOfExpression.call(this)||this.match("<")},JSXParser}(parser_1.Parser);exports.JSXParser=JSXParser},function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});var Regex={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]/};exports.Character={fromCodePoint:function(cp){return 65536>cp?_StringfromCharCode2(cp):_StringfromCharCode2(55296+(cp-65536>>10))+_StringfromCharCode2(56320+(1023&cp-65536))},isWhiteSpace:function(cp){return 32===cp||9===cp||11===cp||12===cp||160===cp||5760<=cp&&0<=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(cp)},isLineTerminator:function(cp){return 10===cp||13===cp||8232===cp||8233===cp},isIdentifierStart:function(cp){return 36===cp||95===cp||65<=cp&&90>=cp||97<=cp&&122>=cp||92===cp||128<=cp&&Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp))},isIdentifierPart:function(cp){return 36===cp||95===cp||65<=cp&&90>=cp||97<=cp&&122>=cp||48<=cp&&57>=cp||92===cp||128<=cp&&Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp))},isDecimalDigit:function(cp){return 48<=cp&&57>=cp},isHexDigit:function(cp){return 48<=cp&&57>=cp||65<=cp&&70>=cp||97<=cp&&102>=cp},isOctalDigit:function(cp){return 48<=cp&&55>=cp}}},function(module,exports,__webpack_require__){Object.defineProperty(exports,"__esModule",{value:!0});var jsx_syntax_1=__webpack_require__(6),JSXClosingElement=function(){return function(name){this.type=jsx_syntax_1.JSXSyntax.JSXClosingElement,this.name=name}}();exports.JSXClosingElement=JSXClosingElement;var JSXElement=function(){return function(openingElement,children,closingElement){this.type=jsx_syntax_1.JSXSyntax.JSXElement,this.openingElement=openingElement,this.children=children,this.closingElement=closingElement}}();exports.JSXElement=JSXElement;var JSXEmptyExpression=function(){return function(){this.type=jsx_syntax_1.JSXSyntax.JSXEmptyExpression}}();exports.JSXEmptyExpression=JSXEmptyExpression;var JSXExpressionContainer=function(){return function(expression){this.type=jsx_syntax_1.JSXSyntax.JSXExpressionContainer,this.expression=expression}}();exports.JSXExpressionContainer=JSXExpressionContainer;var JSXIdentifier=function(){return function(name){this.type=jsx_syntax_1.JSXSyntax.JSXIdentifier,this.name=name}}();exports.JSXIdentifier=JSXIdentifier;var JSXMemberExpression=function(){return function(object,property){this.type=jsx_syntax_1.JSXSyntax.JSXMemberExpression,this.object=object,this.property=property}}();exports.JSXMemberExpression=JSXMemberExpression;var JSXAttribute=function(){return function(name,value){this.type=jsx_syntax_1.JSXSyntax.JSXAttribute,this.name=name,this.value=value}}();exports.JSXAttribute=JSXAttribute;var JSXNamespacedName=function(){return function(namespace,name){this.type=jsx_syntax_1.JSXSyntax.JSXNamespacedName,this.namespace=namespace,this.name=name}}();exports.JSXNamespacedName=JSXNamespacedName;var JSXOpeningElement=function(){return function(name,selfClosing,attributes){this.type=jsx_syntax_1.JSXSyntax.JSXOpeningElement,this.name=name,this.selfClosing=selfClosing,this.attributes=attributes}}();exports.JSXOpeningElement=JSXOpeningElement;var JSXSpreadAttribute=function(){return function(argument){this.type=jsx_syntax_1.JSXSyntax.JSXSpreadAttribute,this.argument=argument}}();exports.JSXSpreadAttribute=JSXSpreadAttribute;var JSXText=function(){return function(value,raw){this.type=jsx_syntax_1.JSXSyntax.JSXText,this.value=value,this.raw=raw}}();exports.JSXText=JSXText},function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(module,exports,__webpack_require__){Object.defineProperty(exports,"__esModule",{value:!0});var syntax_1=__webpack_require__(2),ArrayExpression=function(){return function(elements){this.type=syntax_1.Syntax.ArrayExpression,this.elements=elements}}();exports.ArrayExpression=ArrayExpression;var ArrayPattern=function(){return function(elements){this.type=syntax_1.Syntax.ArrayPattern,this.elements=elements}}();exports.ArrayPattern=ArrayPattern;var ArrowFunctionExpression=function(){return function(params,body,expression){this.type=syntax_1.Syntax.ArrowFunctionExpression,this.id=null,this.params=params,this.body=body,this.generator=!1,this.expression=expression,this.async=!1}}();exports.ArrowFunctionExpression=ArrowFunctionExpression;var AssignmentExpression=function(){return function(operator,left,right){this.type=syntax_1.Syntax.AssignmentExpression,this.operator=operator,this.left=left,this.right=right}}();exports.AssignmentExpression=AssignmentExpression;var AssignmentPattern=function(){return function(left,right){this.type=syntax_1.Syntax.AssignmentPattern,this.left=left,this.right=right}}();exports.AssignmentPattern=AssignmentPattern;var AsyncArrowFunctionExpression=function(){return function(params,body,expression){this.type=syntax_1.Syntax.ArrowFunctionExpression,this.id=null,this.params=params,this.body=body,this.generator=!1,this.expression=expression,this.async=!0}}();exports.AsyncArrowFunctionExpression=AsyncArrowFunctionExpression;var AsyncFunctionDeclaration=function(){return function(id,params,body){this.type=syntax_1.Syntax.FunctionDeclaration,this.id=id,this.params=params,this.body=body,this.generator=!1,this.expression=!1,this.async=!0}}();exports.AsyncFunctionDeclaration=AsyncFunctionDeclaration;var AsyncFunctionExpression=function(){return function(id,params,body){this.type=syntax_1.Syntax.FunctionExpression,this.id=id,this.params=params,this.body=body,this.generator=!1,this.expression=!1,this.async=!0}}();exports.AsyncFunctionExpression=AsyncFunctionExpression;var AwaitExpression=function(){return function(argument){this.type=syntax_1.Syntax.AwaitExpression,this.argument=argument}}();exports.AwaitExpression=AwaitExpression;var BinaryExpression=function(){return function(operator,left,right){this.type="||"===operator||"&&"===operator?syntax_1.Syntax.LogicalExpression:syntax_1.Syntax.BinaryExpression,this.operator=operator,this.left=left,this.right=right}}();exports.BinaryExpression=BinaryExpression;var BlockStatement=function(){return function(body){this.type=syntax_1.Syntax.BlockStatement,this.body=body}}();exports.BlockStatement=BlockStatement;var BreakStatement=function(){return function(label){this.type=syntax_1.Syntax.BreakStatement,this.label=label}}();exports.BreakStatement=BreakStatement;var CallExpression=function(){return function(callee,args){this.type=syntax_1.Syntax.CallExpression,this.callee=callee,this.arguments=args}}();exports.CallExpression=CallExpression;var CatchClause=function(){return function(param,body){this.type=syntax_1.Syntax.CatchClause,this.param=param,this.body=body}}();exports.CatchClause=CatchClause;var ClassBody=function(){return function(body){this.type=syntax_1.Syntax.ClassBody,this.body=body}}();exports.ClassBody=ClassBody;var ClassDeclaration=function(){return function(id,superClass,body){this.type=syntax_1.Syntax.ClassDeclaration,this.id=id,this.superClass=superClass,this.body=body}}();exports.ClassDeclaration=ClassDeclaration;var ClassExpression=function(){return function(id,superClass,body){this.type=syntax_1.Syntax.ClassExpression,this.id=id,this.superClass=superClass,this.body=body}}();exports.ClassExpression=ClassExpression;var ComputedMemberExpression=function(){return function(object,property){this.type=syntax_1.Syntax.MemberExpression,this.computed=!0,this.object=object,this.property=property}}();exports.ComputedMemberExpression=ComputedMemberExpression;var ConditionalExpression=function(){return function(test,consequent,alternate){this.type=syntax_1.Syntax.ConditionalExpression,this.test=test,this.consequent=consequent,this.alternate=alternate}}();exports.ConditionalExpression=ConditionalExpression;var ContinueStatement=function(){return function(label){this.type=syntax_1.Syntax.ContinueStatement,this.label=label}}();exports.ContinueStatement=ContinueStatement;var DebuggerStatement=function(){return function(){this.type=syntax_1.Syntax.DebuggerStatement}}();exports.DebuggerStatement=DebuggerStatement;var Directive=function(){return function(expression,directive){this.type=syntax_1.Syntax.ExpressionStatement,this.expression=expression,this.directive=directive}}();exports.Directive=Directive;var DoWhileStatement=function(){return function(body,test){this.type=syntax_1.Syntax.DoWhileStatement,this.body=body,this.test=test}}();exports.DoWhileStatement=DoWhileStatement;var EmptyStatement=function(){return function(){this.type=syntax_1.Syntax.EmptyStatement}}();exports.EmptyStatement=EmptyStatement;var ExportAllDeclaration=function(){return function(source){this.type=syntax_1.Syntax.ExportAllDeclaration,this.source=source}}();exports.ExportAllDeclaration=ExportAllDeclaration;var ExportDefaultDeclaration=function(){return function(declaration){this.type=syntax_1.Syntax.ExportDefaultDeclaration,this.declaration=declaration}}();exports.ExportDefaultDeclaration=ExportDefaultDeclaration;var ExportNamedDeclaration=function(){return function(declaration,specifiers,source){this.type=syntax_1.Syntax.ExportNamedDeclaration,this.declaration=declaration,this.specifiers=specifiers,this.source=source}}();exports.ExportNamedDeclaration=ExportNamedDeclaration;var ExportSpecifier=function(){return function(local,exported){this.type=syntax_1.Syntax.ExportSpecifier,this.exported=exported,this.local=local}}();exports.ExportSpecifier=ExportSpecifier;var ExpressionStatement=function(){return function(expression){this.type=syntax_1.Syntax.ExpressionStatement,this.expression=expression}}();exports.ExpressionStatement=ExpressionStatement;var ForInStatement=function(){return function(left,right,body){this.type=syntax_1.Syntax.ForInStatement,this.left=left,this.right=right,this.body=body,this.each=!1}}();exports.ForInStatement=ForInStatement;var ForOfStatement=function(){return function(left,right,body){this.type=syntax_1.Syntax.ForOfStatement,this.left=left,this.right=right,this.body=body}}();exports.ForOfStatement=ForOfStatement;var ForStatement=function(){return function(init,test,update,body){this.type=syntax_1.Syntax.ForStatement,this.init=init,this.test=test,this.update=update,this.body=body}}();exports.ForStatement=ForStatement;var FunctionDeclaration=function(){return function(id,params,body,generator){this.type=syntax_1.Syntax.FunctionDeclaration,this.id=id,this.params=params,this.body=body,this.generator=generator,this.expression=!1,this.async=!1}}();exports.FunctionDeclaration=FunctionDeclaration;var FunctionExpression=function(){return function(id,params,body,generator){this.type=syntax_1.Syntax.FunctionExpression,this.id=id,this.params=params,this.body=body,this.generator=generator,this.expression=!1,this.async=!1}}();exports.FunctionExpression=FunctionExpression;var Identifier=function(){return function(name){this.type=syntax_1.Syntax.Identifier,this.name=name}}();exports.Identifier=Identifier;var IfStatement=function(){return function(test,consequent,alternate){this.type=syntax_1.Syntax.IfStatement,this.test=test,this.consequent=consequent,this.alternate=alternate}}();exports.IfStatement=IfStatement;var ImportDeclaration=function(){return function(specifiers,source){this.type=syntax_1.Syntax.ImportDeclaration,this.specifiers=specifiers,this.source=source}}();exports.ImportDeclaration=ImportDeclaration;var ImportDefaultSpecifier=function(){return function(local){this.type=syntax_1.Syntax.ImportDefaultSpecifier,this.local=local}}();exports.ImportDefaultSpecifier=ImportDefaultSpecifier;var ImportNamespaceSpecifier=function(){return function(local){this.type=syntax_1.Syntax.ImportNamespaceSpecifier,this.local=local}}();exports.ImportNamespaceSpecifier=ImportNamespaceSpecifier;var ImportSpecifier=function(){return function(local,imported){this.type=syntax_1.Syntax.ImportSpecifier,this.local=local,this.imported=imported}}();exports.ImportSpecifier=ImportSpecifier;var LabeledStatement=function(){return function(label,body){this.type=syntax_1.Syntax.LabeledStatement,this.label=label,this.body=body}}();exports.LabeledStatement=LabeledStatement;var Literal=function(){return function(value,raw){this.type=syntax_1.Syntax.Literal,this.value=value,this.raw=raw}}();exports.Literal=Literal;var MetaProperty=function(){return function(meta,property){this.type=syntax_1.Syntax.MetaProperty,this.meta=meta,this.property=property}}();exports.MetaProperty=MetaProperty;var MethodDefinition=function(){return function(key,computed,value,kind,isStatic){this.type=syntax_1.Syntax.MethodDefinition,this.key=key,this.computed=computed,this.value=value,this.kind=kind,this.static=isStatic}}();exports.MethodDefinition=MethodDefinition;var Module=function(){return function(body){this.type=syntax_1.Syntax.Program,this.body=body,this.sourceType="module"}}();exports.Module=Module;var NewExpression=function(){return function(callee,args){this.type=syntax_1.Syntax.NewExpression,this.callee=callee,this.arguments=args}}();exports.NewExpression=NewExpression;var ObjectExpression=function(){return function(properties){this.type=syntax_1.Syntax.ObjectExpression,this.properties=properties}}();exports.ObjectExpression=ObjectExpression;var ObjectPattern=function(){return function(properties){this.type=syntax_1.Syntax.ObjectPattern,this.properties=properties}}();exports.ObjectPattern=ObjectPattern;var Property=function(){return function(kind,key,computed,value,method,shorthand){this.type=syntax_1.Syntax.Property,this.key=key,this.computed=computed,this.value=value,this.kind=kind,this.method=method,this.shorthand=shorthand}}();exports.Property=Property;var RegexLiteral=function(){return function(value,raw,pattern,flags){this.type=syntax_1.Syntax.Literal,this.value=value,this.raw=raw,this.regex={pattern:pattern,flags:flags}}}();exports.RegexLiteral=RegexLiteral;var RestElement=function(){return function(argument){this.type=syntax_1.Syntax.RestElement,this.argument=argument}}();exports.RestElement=RestElement;var ReturnStatement=function(){return function(argument){this.type=syntax_1.Syntax.ReturnStatement,this.argument=argument}}();exports.ReturnStatement=ReturnStatement;var Script=function(){return function(body){this.type=syntax_1.Syntax.Program,this.body=body,this.sourceType="script"}}();exports.Script=Script;var SequenceExpression=function(){return function(expressions){this.type=syntax_1.Syntax.SequenceExpression,this.expressions=expressions}}();exports.SequenceExpression=SequenceExpression;var SpreadElement=function(){return function(argument){this.type=syntax_1.Syntax.SpreadElement,this.argument=argument}}();exports.SpreadElement=SpreadElement;var StaticMemberExpression=function(){return function(object,property){this.type=syntax_1.Syntax.MemberExpression,this.computed=!1,this.object=object,this.property=property}}();exports.StaticMemberExpression=StaticMemberExpression;var Super=function(){return function(){this.type=syntax_1.Syntax.Super}}();exports.Super=Super;var SwitchCase=function(){return function(test,consequent){this.type=syntax_1.Syntax.SwitchCase,this.test=test,this.consequent=consequent}}();exports.SwitchCase=SwitchCase;var SwitchStatement=function(){return function(discriminant,cases){this.type=syntax_1.Syntax.SwitchStatement,this.discriminant=discriminant,this.cases=cases}}();exports.SwitchStatement=SwitchStatement;var TaggedTemplateExpression=function(){return function(tag,quasi){this.type=syntax_1.Syntax.TaggedTemplateExpression,this.tag=tag,this.quasi=quasi}}();exports.TaggedTemplateExpression=TaggedTemplateExpression;var TemplateElement=function(){return function(value,tail){this.type=syntax_1.Syntax.TemplateElement,this.value=value,this.tail=tail}}();exports.TemplateElement=TemplateElement;var TemplateLiteral=function(){return function(quasis,expressions){this.type=syntax_1.Syntax.TemplateLiteral,this.quasis=quasis,this.expressions=expressions}}();exports.TemplateLiteral=TemplateLiteral;var ThisExpression=function(){return function(){this.type=syntax_1.Syntax.ThisExpression}}();exports.ThisExpression=ThisExpression;var ThrowStatement=function(){return function(argument){this.type=syntax_1.Syntax.ThrowStatement,this.argument=argument}}();exports.ThrowStatement=ThrowStatement;var TryStatement=function(){return function(block,handler,finalizer){this.type=syntax_1.Syntax.TryStatement,this.block=block,this.handler=handler,this.finalizer=finalizer}}();exports.TryStatement=TryStatement;var UnaryExpression=function(){return function(operator,argument){this.type=syntax_1.Syntax.UnaryExpression,this.operator=operator,this.argument=argument,this.prefix=!0}}();exports.UnaryExpression=UnaryExpression;var UpdateExpression=function(){return function(operator,argument,prefix){this.type=syntax_1.Syntax.UpdateExpression,this.operator=operator,this.argument=argument,this.prefix=prefix}}();exports.UpdateExpression=UpdateExpression;var VariableDeclaration=function(){return function(declarations,kind){this.type=syntax_1.Syntax.VariableDeclaration,this.declarations=declarations,this.kind=kind}}();exports.VariableDeclaration=VariableDeclaration;var VariableDeclarator=function(){return function(id,init){this.type=syntax_1.Syntax.VariableDeclarator,this.id=id,this.init=init}}();exports.VariableDeclarator=VariableDeclarator;var WhileStatement=function(){return function(test,body){this.type=syntax_1.Syntax.WhileStatement,this.test=test,this.body=body}}();exports.WhileStatement=WhileStatement;var WithStatement=function(){return function(object,body){this.type=syntax_1.Syntax.WithStatement,this.object=object,this.body=body}}();exports.WithStatement=WithStatement;var YieldExpression=function(){return function(argument,delegate){this.type=syntax_1.Syntax.YieldExpression,this.argument=argument,this.delegate=delegate}}();exports.YieldExpression=YieldExpression},function(module,exports,__webpack_require__){Object.defineProperty(exports,"__esModule",{value:!0});var assert_1=__webpack_require__(9),error_handler_1=__webpack_require__(10),messages_1=__webpack_require__(11),Node=__webpack_require__(7),scanner_1=__webpack_require__(12),syntax_1=__webpack_require__(2),token_1=__webpack_require__(13),ArrowParameterPlaceHolder="ArrowParameterPlaceHolder",Parser=function(){function Parser(code,options,delegate){void 0===options&&(options={}),this.config={range:"boolean"==typeof options.range&&options.range,loc:"boolean"==typeof options.loc&&options.loc,source:null,tokens:"boolean"==typeof options.tokens&&options.tokens,comment:"boolean"==typeof options.comment&&options.comment,tolerant:"boolean"==typeof options.tolerant&&options.tolerant},this.config.loc&&options.source&&null!==options.source&&(this.config.source=options.source+""),this.delegate=delegate,this.errorHandler=new error_handler_1.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new scanner_1.Scanner(code,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return Parser.prototype.throwError=function(messageFormat){for(var values=[],_i=1;_i<arguments.length;_i++)values[_i-1]=arguments[_i];var args=Array.prototype.slice.call(arguments,1),msg=messageFormat.replace(/%(\d)/g,function(whole,idx){return assert_1.assert(idx<args.length,"Message reference must be in range"),args[idx]}),index=this.lastMarker.index,line=this.lastMarker.line,column=this.lastMarker.column+1;throw this.errorHandler.createError(index,line,column,msg)},Parser.prototype.tolerateError=function(messageFormat){for(var values=[],_i=1;_i<arguments.length;_i++)values[_i-1]=arguments[_i];var args=Array.prototype.slice.call(arguments,1),msg=messageFormat.replace(/%(\d)/g,function(whole,idx){return assert_1.assert(idx<args.length,"Message reference must be in range"),args[idx]}),index=this.lastMarker.index,line=this.scanner.lineNumber,column=this.lastMarker.column+1;this.errorHandler.tolerateError(index,line,column,msg)},Parser.prototype.unexpectedTokenError=function(token,message){var msg=message||messages_1.Messages.UnexpectedToken,value;if(token?(!message&&(msg=2===token.type?messages_1.Messages.UnexpectedEOS:3===token.type?messages_1.Messages.UnexpectedIdentifier:6===token.type?messages_1.Messages.UnexpectedNumber:8===token.type?messages_1.Messages.UnexpectedString:10===token.type?messages_1.Messages.UnexpectedTemplate:messages_1.Messages.UnexpectedToken,4===token.type&&(this.scanner.isFutureReservedWord(token.value)?msg=messages_1.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(token.value)&&(msg=messages_1.Messages.StrictReservedWord))),value=token.value):value="ILLEGAL",msg=msg.replace("%0",value),token&&"number"==typeof token.lineNumber){var index=token.start,line=token.lineNumber,lastMarkerLineStart=this.lastMarker.index-this.lastMarker.column,column=token.start-lastMarkerLineStart+1;return this.errorHandler.createError(index,line,column,msg)}var index=this.lastMarker.index,line=this.lastMarker.line,column=this.lastMarker.column+1;return this.errorHandler.createError(index,line,column,msg)},Parser.prototype.throwUnexpectedToken=function(token,message){throw this.unexpectedTokenError(token,message)},Parser.prototype.tolerateUnexpectedToken=function(token,message){this.errorHandler.tolerate(this.unexpectedTokenError(token,message))},Parser.prototype.collectComments=function(){if(!this.config.comment)this.scanner.scanComments();else{var comments=this.scanner.scanComments();if(0<comments.length&&this.delegate)for(var i=0;i<comments.length;++i){var e=comments[i],node=void 0;node={type:e.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(e.slice[0],e.slice[1])},this.config.range&&(node.range=e.range),this.config.loc&&(node.loc=e.loc);var metadata={start:{line:e.loc.start.line,column:e.loc.start.column,offset:e.range[0]},end:{line:e.loc.end.line,column:e.loc.end.column,offset:e.range[1]}};this.delegate(node,metadata)}}},Parser.prototype.getTokenRaw=function(token){return this.scanner.source.slice(token.start,token.end)},Parser.prototype.convertToken=function(token){var t={type:token_1.TokenName[token.type],value:this.getTokenRaw(token)};if(this.config.range&&(t.range=[token.start,token.end]),this.config.loc&&(t.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),9===token.type){var pattern=token.pattern,flags=token.flags;t.regex={pattern:pattern,flags:flags}}return t},Parser.prototype.nextToken=function(){var token=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var next=this.scanner.lex();return this.hasLineTerminator=token.lineNumber!==next.lineNumber,next&&this.context.strict&&3===next.type&&this.scanner.isStrictModeReservedWord(next.value)&&(next.type=4),this.lookahead=next,this.config.tokens&&2!==next.type&&this.tokens.push(this.convertToken(next)),token},Parser.prototype.nextRegexToken=function(){this.collectComments();var token=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(token))),this.lookahead=token,this.nextToken(),token},Parser.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},Parser.prototype.startNode=function(token){return{index:token.start,line:token.lineNumber,column:token.start-token.lineStart}},Parser.prototype.finalize=function(marker,node){if(this.config.range&&(node.range=[marker.index,this.lastMarker.index]),this.config.loc&&(node.loc={start:{line:marker.line,column:marker.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(node.loc.source=this.config.source)),this.delegate){var metadata={start:{line:marker.line,column:marker.column,offset:marker.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(node,metadata)}return node},Parser.prototype.expect=function(value){var token=this.nextToken();(7!==token.type||token.value!==value)&&this.throwUnexpectedToken(token)},Parser.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var token=this.lookahead;7===token.type&&","===token.value?this.nextToken():7===token.type&&";"===token.value?(this.nextToken(),this.tolerateUnexpectedToken(token)):this.tolerateUnexpectedToken(token,messages_1.Messages.UnexpectedToken)}else this.expect(",")},Parser.prototype.expectKeyword=function(keyword){var token=this.nextToken();(4!==token.type||token.value!==keyword)&&this.throwUnexpectedToken(token)},Parser.prototype.match=function(value){return 7===this.lookahead.type&&this.lookahead.value===value},Parser.prototype.matchKeyword=function(keyword){return 4===this.lookahead.type&&this.lookahead.value===keyword},Parser.prototype.matchContextualKeyword=function(keyword){return 3===this.lookahead.type&&this.lookahead.value===keyword},Parser.prototype.matchAssign=function(){if(7!==this.lookahead.type)return!1;var op=this.lookahead.value;return"="===op||"*="===op||"**="===op||"/="===op||"%="===op||"+="===op||"-="===op||"<<="===op||">>="===op||">>>="===op||"&="===op||"^="===op||"|="===op},Parser.prototype.isolateCoverGrammar=function(parseFunction){var previousIsBindingElement=this.context.isBindingElement,previousIsAssignmentTarget=this.context.isAssignmentTarget,previousFirstCoverInitializedNameError=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var result=parseFunction.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=previousIsBindingElement,this.context.isAssignmentTarget=previousIsAssignmentTarget,this.context.firstCoverInitializedNameError=previousFirstCoverInitializedNameError,result},Parser.prototype.inheritCoverGrammar=function(parseFunction){var previousIsBindingElement=this.context.isBindingElement,previousIsAssignmentTarget=this.context.isAssignmentTarget,previousFirstCoverInitializedNameError=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var result=parseFunction.call(this);return this.context.isBindingElement=this.context.isBindingElement&&previousIsBindingElement,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&previousIsAssignmentTarget,this.context.firstCoverInitializedNameError=previousFirstCoverInitializedNameError||this.context.firstCoverInitializedNameError,result},Parser.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():!this.hasLineTerminator&&(2!==this.lookahead.type&&!this.match("}")&&this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},Parser.prototype.parsePrimaryExpression=function(){var node=this.createNode(),expr,token,raw;switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),expr=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(node,new Node.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,messages_1.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,token=this.nextToken(),raw=this.getTokenRaw(token),expr=this.finalize(node,new Node.Literal(token.value,raw));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,token=this.nextToken(),raw=this.getTokenRaw(token),expr=this.finalize(node,new Node.Literal("true"===token.value,raw));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,token=this.nextToken(),raw=this.getTokenRaw(token),expr=this.finalize(node,new Node.Literal(null,raw));break;case 10:expr=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,expr=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":expr=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":expr=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,token=this.nextRegexToken(),raw=this.getTokenRaw(token),expr=this.finalize(node,new Node.RegexLiteral(token.regex,raw,token.pattern,token.flags));break;default:expr=this.throwUnexpectedToken(this.nextToken());}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?expr=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?expr=this.finalize(node,new Node.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?expr=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),expr=this.finalize(node,new Node.ThisExpression)):this.matchKeyword("class")?expr=this.parseClassExpression():expr=this.throwUnexpectedToken(this.nextToken()));break;default:expr=this.throwUnexpectedToken(this.nextToken());}return expr},Parser.prototype.parseSpreadElement=function(){var node=this.createNode();this.expect("...");var arg=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(node,new Node.SpreadElement(arg))},Parser.prototype.parseArrayInitializer=function(){var node=this.createNode(),elements=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),elements.push(null);else if(this.match("...")){var element=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),elements.push(element)}else elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(node,new Node.ArrayExpression(elements))},Parser.prototype.parsePropertyMethod=function(params){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var previousStrict=this.context.strict,previousAllowStrictDirective=this.context.allowStrictDirective;this.context.allowStrictDirective=params.simple;var body=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&¶ms.firstRestricted&&this.tolerateUnexpectedToken(params.firstRestricted,params.message),this.context.strict&¶ms.stricted&&this.tolerateUnexpectedToken(params.stricted,params.message),this.context.strict=previousStrict,this.context.allowStrictDirective=previousAllowStrictDirective,body},Parser.prototype.parsePropertyMethodFunction=function(){var node=this.createNode(),previousAllowYield=this.context.allowYield;this.context.allowYield=!1;var params=this.parseFormalParameters(),method=this.parsePropertyMethod(params);return this.context.allowYield=previousAllowYield,this.finalize(node,new Node.FunctionExpression(null,params.params,method,!1))},Parser.prototype.parsePropertyMethodAsyncFunction=function(){var node=this.createNode(),previousAllowYield=this.context.allowYield,previousAwait=this.context.await;this.context.allowYield=!1,this.context.await=!0;var params=this.parseFormalParameters(),method=this.parsePropertyMethod(params);return this.context.allowYield=previousAllowYield,this.context.await=previousAwait,this.finalize(node,new Node.AsyncFunctionExpression(null,params.params,method))},Parser.prototype.parseObjectPropertyKey=function(){var node=this.createNode(),token=this.nextToken(),key;switch(token.type){case 8:case 6:this.context.strict&&token.octal&&this.tolerateUnexpectedToken(token,messages_1.Messages.StrictOctalLiteral);var raw=this.getTokenRaw(token);key=this.finalize(node,new Node.Literal(token.value,raw));break;case 3:case 1:case 5:case 4:key=this.finalize(node,new Node.Identifier(token.value));break;case 7:"["===token.value?(key=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):key=this.throwUnexpectedToken(token);break;default:key=this.throwUnexpectedToken(token);}return key},Parser.prototype.isPropertyKey=function(key,value){return key.type===syntax_1.Syntax.Identifier&&key.name===value||key.type===syntax_1.Syntax.Literal&&key.value===value},Parser.prototype.parseObjectProperty=function(hasProto){var node=this.createNode(),token=this.lookahead,key=null,value=null,computed=!1,method=!1,shorthand=!1,isAsync=!1,kind;if(3===token.type){var id=token.value;this.nextToken(),computed=this.match("["),isAsync=!this.hasLineTerminator&&"async"===id&&!this.match(":")&&!this.match("(")&&!this.match("*"),key=isAsync?this.parseObjectPropertyKey():this.finalize(node,new Node.Identifier(id))}else this.match("*")?this.nextToken():(computed=this.match("["),key=this.parseObjectPropertyKey());var lookaheadPropertyKey=this.qualifiedPropertyName(this.lookahead);if(3===token.type&&!isAsync&&"get"===token.value&&lookaheadPropertyKey)kind="get",computed=this.match("["),key=this.parseObjectPropertyKey(),this.context.allowYield=!1,value=this.parseGetterMethod();else if(3===token.type&&!isAsync&&"set"===token.value&&lookaheadPropertyKey)kind="set",computed=this.match("["),key=this.parseObjectPropertyKey(),value=this.parseSetterMethod();else if(7===token.type&&"*"===token.value&&lookaheadPropertyKey)kind="init",computed=this.match("["),key=this.parseObjectPropertyKey(),value=this.parseGeneratorMethod(),method=!0;else if(key||this.throwUnexpectedToken(this.lookahead),kind="init",this.match(":")&&!isAsync)!computed&&this.isPropertyKey(key,"__proto__")&&(hasProto.value&&this.tolerateError(messages_1.Messages.DuplicateProtoProperty),hasProto.value=!0),this.nextToken(),value=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))value=isAsync?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),method=!0;else if(3===token.type){var id=this.finalize(node,new Node.Identifier(token.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),shorthand=!0;var init=this.isolateCoverGrammar(this.parseAssignmentExpression);value=this.finalize(node,new Node.AssignmentPattern(id,init))}else shorthand=!0,value=id}else this.throwUnexpectedToken(this.nextToken());return this.finalize(node,new Node.Property(kind,key,computed,value,method,shorthand))},Parser.prototype.parseObjectInitializer=function(){var node=this.createNode();this.expect("{");for(var properties=[],hasProto={value:!1};!this.match("}");)properties.push(this.parseObjectProperty(hasProto)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(node,new Node.ObjectExpression(properties))},Parser.prototype.parseTemplateHead=function(){assert_1.assert(this.lookahead.head,"Template literal must start with a template head");var node=this.createNode(),token=this.nextToken(),raw=token.value,cooked=token.cooked;return this.finalize(node,new Node.TemplateElement({raw:raw,cooked:cooked},token.tail))},Parser.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var node=this.createNode(),token=this.nextToken(),raw=token.value,cooked=token.cooked;return this.finalize(node,new Node.TemplateElement({raw:raw,cooked:cooked},token.tail))},Parser.prototype.parseTemplateLiteral=function(){var node=this.createNode(),expressions=[],quasis=[],quasi=this.parseTemplateHead();for(quasis.push(quasi);!quasi.tail;)expressions.push(this.parseExpression()),quasi=this.parseTemplateElement(),quasis.push(quasi);return this.finalize(node,new Node.TemplateLiteral(quasis,expressions))},Parser.prototype.reinterpretExpressionAsPattern=function(expr){switch(expr.type){case syntax_1.Syntax.Identifier:case syntax_1.Syntax.MemberExpression:case syntax_1.Syntax.RestElement:case syntax_1.Syntax.AssignmentPattern:break;case syntax_1.Syntax.SpreadElement:expr.type=syntax_1.Syntax.RestElement,this.reinterpretExpressionAsPattern(expr.argument);break;case syntax_1.Syntax.ArrayExpression:expr.type=syntax_1.Syntax.ArrayPattern;for(var i=0;i<expr.elements.length;i++)null!==expr.elements[i]&&this.reinterpretExpressionAsPattern(expr.elements[i]);break;case syntax_1.Syntax.ObjectExpression:expr.type=syntax_1.Syntax.ObjectPattern;for(var i=0;i<expr.properties.length;i++)this.reinterpretExpressionAsPattern(expr.properties[i].value);break;case syntax_1.Syntax.AssignmentExpression:expr.type=syntax_1.Syntax.AssignmentPattern,delete expr.operator,this.reinterpretExpressionAsPattern(expr.left);break;default:}},Parser.prototype.parseGroupExpression=function(){var expr;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),expr={type:ArrowParameterPlaceHolder,params:[],async:!1};else{var startToken=this.lookahead,params=[];if(this.match("..."))expr=this.parseRestElement(params),this.expect(")"),this.match("=>")||this.expect("=>"),expr={type:ArrowParameterPlaceHolder,params:[expr],async:!1};else{var arrow=!1;if(this.context.isBindingElement=!0,expr=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var expressions=[];for(this.context.isAssignmentTarget=!1,expressions.push(expr);2!==this.lookahead.type&&!!this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var i=0;i<expressions.length;i++)this.reinterpretExpressionAsPattern(expressions[i]);arrow=!0,expr={type:ArrowParameterPlaceHolder,params:expressions,async:!1}}else if(this.match("...")){this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),expressions.push(this.parseRestElement(params)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1;for(var i=0;i<expressions.length;i++)this.reinterpretExpressionAsPattern(expressions[i]);arrow=!0,expr={type:ArrowParameterPlaceHolder,params:expressions,async:!1}}else expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(arrow)break}arrow||(expr=this.finalize(this.startNode(startToken),new Node.SequenceExpression(expressions)))}if(!arrow){if(this.expect(")"),this.match("=>")&&(expr.type===syntax_1.Syntax.Identifier&&"yield"===expr.name&&(arrow=!0,expr={type:ArrowParameterPlaceHolder,params:[expr],async:!1}),!arrow)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),expr.type===syntax_1.Syntax.SequenceExpression)for(var i=0;i<expr.expressions.length;i++)this.reinterpretExpressionAsPattern(expr.expressions[i]);else this.reinterpretExpressionAsPattern(expr);var parameters=expr.type===syntax_1.Syntax.SequenceExpression?expr.expressions:[expr];expr={type:ArrowParameterPlaceHolder,params:parameters,async:!1}}this.context.isBindingElement=!1}}}return expr},Parser.prototype.parseArguments=function(){this.expect("(");var args=[];if(!this.match(")"))for(;;){var expr=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(args.push(expr),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),args},Parser.prototype.isIdentifierName=function(token){return 3===token.type||4===token.type||1===token.type||5===token.type},Parser.prototype.parseIdentifierName=function(){var node=this.createNode(),token=this.nextToken();return this.isIdentifierName(token)||this.throwUnexpectedToken(token),this.finalize(node,new Node.Identifier(token.value))},Parser.prototype.parseNewExpression=function(){var node=this.createNode(),id=this.parseIdentifierName();assert_1.assert("new"===id.name,"New expression must start with `new`");var expr;if(!this.match(".")){var callee=this.isolateCoverGrammar(this.parseLeftHandSideExpression),args=this.match("(")?this.parseArguments():[];expr=new Node.NewExpression(callee,args),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(this.nextToken(),3===this.lookahead.type&&this.context.inFunctionBody&&"target"===this.lookahead.value){var property=this.parseIdentifierName();expr=new Node.MetaProperty(id,property)}else this.throwUnexpectedToken(this.lookahead);return this.finalize(node,expr)},Parser.prototype.parseAsyncArgument=function(){var arg=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,arg},Parser.prototype.parseAsyncArguments=function(){this.expect("(");var args=[];if(!this.match(")"))for(;;){var expr=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(args.push(expr),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),args},Parser.prototype.parseLeftHandSideExpressionAllowCall=function(){var startToken=this.lookahead,maybeAsync=this.matchContextualKeyword("async"),previousAllowIn=this.context.allowIn;this.context.allowIn=!0;var expr;for(this.matchKeyword("super")&&this.context.inFunctionBody?(expr=this.createNode(),this.nextToken(),expr=this.finalize(expr,new Node.Super),!this.match("(")&&!this.match(".")&&!this.match("[")&&this.throwUnexpectedToken(this.lookahead)):expr=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var property=this.parseIdentifierName();expr=this.finalize(this.startNode(startToken),new Node.StaticMemberExpression(expr,property))}else if(this.match("(")){var asyncArrow=maybeAsync&&startToken.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var args=asyncArrow?this.parseAsyncArguments():this.parseArguments();if(expr=this.finalize(this.startNode(startToken),new Node.CallExpression(expr,args)),asyncArrow&&this.match("=>")){for(var i=0;i<args.length;++i)this.reinterpretExpressionAsPattern(args[i]);expr={type:ArrowParameterPlaceHolder,params:args,async:!0}}}else if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var property=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),expr=this.finalize(this.startNode(startToken),new Node.ComputedMemberExpression(expr,property))}else if(10===this.lookahead.type&&this.lookahead.head){var quasi=this.parseTemplateLiteral();expr=this.finalize(this.startNode(startToken),new Node.TaggedTemplateExpression(expr,quasi))}else break;return this.context.allowIn=previousAllowIn,expr},Parser.prototype.parseSuper=function(){var node=this.createNode();return this.expectKeyword("super"),this.match("[")||this.match(".")||this.throwUnexpectedToken(this.lookahead),this.finalize(node,new Node.Super)},Parser.prototype.parseLeftHandSideExpression=function(){assert_1.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var node=this.startNode(this.lookahead),expr=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var property=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),expr=this.finalize(node,new Node.ComputedMemberExpression(expr,property))}else if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var property=this.parseIdentifierName();expr=this.finalize(node,new Node.StaticMemberExpression(expr,property))}else if(10===this.lookahead.type&&this.lookahead.head){var quasi=this.parseTemplateLiteral();expr=this.finalize(node,new Node.TaggedTemplateExpression(expr,quasi))}else break;return expr},Parser.prototype.parseUpdateExpression=function(){var startToken=this.lookahead,expr;if(this.match("++")||this.match("--")){var node=this.startNode(startToken),token=this.nextToken();expr=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&expr.type===syntax_1.Syntax.Identifier&&this.scanner.isRestrictedWord(expr.name)&&this.tolerateError(messages_1.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);var prefix=!0;expr=this.finalize(node,new Node.UpdateExpression(token.value,expr,prefix)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(expr=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&7===this.lookahead.type&&(this.match("++")||this.match("--"))){this.context.strict&&expr.type===syntax_1.Syntax.Identifier&&this.scanner.isRestrictedWord(expr.name)&&this.tolerateError(messages_1.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(messages_1.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var operator=this.nextToken().value,prefix=!1;expr=this.finalize(this.startNode(startToken),new Node.UpdateExpression(operator,expr,prefix))}return expr},Parser.prototype.parseAwaitExpression=function(){var node=this.createNode();this.nextToken();var argument=this.parseUnaryExpression();return this.finalize(node,new Node.AwaitExpression(argument))},Parser.prototype.parseUnaryExpression=function(){var expr;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var node=this.startNode(this.lookahead),token=this.nextToken();expr=this.inheritCoverGrammar(this.parseUnaryExpression),expr=this.finalize(node,new Node.UnaryExpression(token.value,expr)),this.context.strict&&"delete"===expr.operator&&expr.argument.type===syntax_1.Syntax.Identifier&&this.tolerateError(messages_1.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else expr=this.context.await&&this.matchContextualKeyword("await")?this.parseAwaitExpression():this.parseUpdateExpression();return expr},Parser.prototype.parseExponentiationExpression=function(){var startToken=this.lookahead,expr=this.inheritCoverGrammar(this.parseUnaryExpression);if(expr.type!==syntax_1.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var left=expr,right=this.isolateCoverGrammar(this.parseExponentiationExpression);expr=this.finalize(this.startNode(startToken),new Node.BinaryExpression("**",left,right))}return expr},Parser.prototype.binaryPrecedence=function(token){var op=token.value,precedence;return precedence=7===token.type?this.operatorPrecedence[op]||0:4===token.type?"instanceof"===op||this.context.allowIn&&"in"===op?7:0:0,precedence},Parser.prototype.parseBinaryExpression=function(){var startToken=this.lookahead,expr=this.inheritCoverGrammar(this.parseExponentiationExpression),token=this.lookahead,prec=this.binaryPrecedence(token);if(0<prec){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var markers=[startToken,this.lookahead],left=expr,right=this.isolateCoverGrammar(this.parseExponentiationExpression),stack=[left,token.value,right],precedences=[prec];prec=this.binaryPrecedence(this.lookahead),!(0>=prec);){for(;2<stack.length&&prec<=precedences[precedences.length-1];){right=stack.pop();var operator=stack.pop();precedences.pop(),left=stack.pop(),markers.pop();var node=this.startNode(markers[markers.length-1]);stack.push(this.finalize(node,new Node.BinaryExpression(operator,left,right)))}stack.push(this.nextToken().value),precedences.push(prec),markers.push(this.lookahead),stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var i=stack.length-1;for(expr=stack[i],markers.pop();1<i;){var node=this.startNode(markers.pop()),operator=stack[i-1];expr=this.finalize(node,new Node.BinaryExpression(operator,stack[i-2],expr)),i-=2}}return expr},Parser.prototype.parseConditionalExpression=function(){var startToken=this.lookahead,expr=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var previousAllowIn=this.context.allowIn;this.context.allowIn=!0;var consequent=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=previousAllowIn,this.expect(":");var alternate=this.isolateCoverGrammar(this.parseAssignmentExpression);expr=this.finalize(this.startNode(startToken),new Node.ConditionalExpression(expr,consequent,alternate)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return expr},Parser.prototype.checkPatternParam=function(options,param){switch(param.type){case syntax_1.Syntax.Identifier:this.validateParam(options,param,param.name);break;case syntax_1.Syntax.RestElement:this.checkPatternParam(options,param.argument);break;case syntax_1.Syntax.AssignmentPattern:this.checkPatternParam(options,param.left);break;case syntax_1.Syntax.ArrayPattern:for(var i=0;i<param.elements.length;i++)null!==param.elements[i]&&this.checkPatternParam(options,param.elements[i]);break;case syntax_1.Syntax.ObjectPattern:for(var i=0;i<param.properties.length;i++)this.checkPatternParam(options,param.properties[i].value);break;default:}options.simple=options.simple&¶m instanceof Node.Identifier},Parser.prototype.reinterpretAsCoverFormalsList=function(expr){var params=[expr],asyncArrow=!1,options;switch(expr.type){case syntax_1.Syntax.Identifier:break;case ArrowParameterPlaceHolder:params=expr.params,asyncArrow=expr.async;break;default:return null;}options={simple:!0,paramSet:{}};for(var i=0,param;i<params.length;++i)param=params[i],param.type===syntax_1.Syntax.AssignmentPattern?param.right.type===syntax_1.Syntax.YieldExpression&&(param.right.argument&&this.throwUnexpectedToken(this.lookahead),param.right.type=syntax_1.Syntax.Identifier,param.right.name="yield",delete param.right.argument,delete param.right.delegate):asyncArrow&¶m.type===syntax_1.Syntax.Identifier&&"await"===param.name&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(options,param),params[i]=param;if(this.context.strict||!this.context.allowYield)for(var i=0,param;i<params.length;++i)param=params[i],param.type===syntax_1.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead);if(options.message===messages_1.Messages.StrictParamDupe){var token=this.context.strict?options.stricted:options.firstRestricted;this.throwUnexpectedToken(token,options.message)}return{simple:options.simple,params:params,stricted:options.stricted,firstRestricted:options.firstRestricted,message:options.message}},Parser.prototype.parseAssignmentExpression=function(){var expr;if(!this.context.allowYield&&this.matchKeyword("yield"))expr=this.parseYieldExpression();else{var startToken=this.lookahead,token=startToken;if(expr=this.parseConditionalExpression(),3===token.type&&token.lineNumber===this.lookahead.lineNumber&&"async"===token.value&&(3===this.lookahead.type||this.matchKeyword("yield"))){var arg=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(arg),expr={type:ArrowParameterPlaceHolder,params:[arg],async:!0}}if(expr.type===ArrowParameterPlaceHolder||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var isAsync=expr.async,list=this.reinterpretAsCoverFormalsList(expr);if(list){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var previousStrict=this.context.strict,previousAllowStrictDirective=this.context.allowStrictDirective;this.context.allowStrictDirective=list.simple;var previousAllowYield=this.context.allowYield,previousAwait=this.context.await;this.context.allowYield=!0,this.context.await=isAsync;var node=this.startNode(startToken);this.expect("=>");var body;if(this.match("{")){var previousAllowIn=this.context.allowIn;this.context.allowIn=!0,body=this.parseFunctionSourceElements(),this.context.allowIn=previousAllowIn}else body=this.isolateCoverGrammar(this.parseAssignmentExpression);var expression=body.type!==syntax_1.Syntax.BlockStatement;this.context.strict&&list.firstRestricted&&this.throwUnexpectedToken(list.firstRestricted,list.message),this.context.strict&&list.stricted&&this.tolerateUnexpectedToken(list.stricted,list.message),expr=isAsync?this.finalize(node,new Node.AsyncArrowFunctionExpression(list.params,body,expression)):this.finalize(node,new Node.ArrowFunctionExpression(list.params,body,expression)),this.context.strict=previousStrict,this.context.allowStrictDirective=previousAllowStrictDirective,this.context.allowYield=previousAllowYield,this.context.await=previousAwait}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(messages_1.Messages.InvalidLHSInAssignment),this.context.strict&&expr.type===syntax_1.Syntax.Identifier){var id=expr;this.scanner.isRestrictedWord(id.name)&&this.tolerateUnexpectedToken(token,messages_1.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(id.name)&&this.tolerateUnexpectedToken(token,messages_1.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(expr):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),token=this.nextToken();var operator=token.value,right=this.isolateCoverGrammar(this.parseAssignmentExpression);expr=this.finalize(this.startNode(startToken),new Node.AssignmentExpression(operator,expr,right)),this.context.firstCoverInitializedNameError=null}}return expr},Parser.prototype.parseExpression=function(){var startToken=this.lookahead,expr=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){for(var expressions=[expr];2!==this.lookahead.type&&!!this.match(",");)this.nextToken(),expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression));expr=this.finalize(this.startNode(startToken),new Node.SequenceExpression(expressions))}return expr},Parser.prototype.parseStatementListItem=function(){var statement;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,messages_1.Messages.IllegalExportDeclaration),statement=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,messages_1.Messages.IllegalImportDeclaration),statement=this.parseImportDeclaration();break;case"const":statement=this.parseLexicalDeclaration({inFor:!1});break;case"function":statement=this.parseFunctionDeclaration();break;case"class":statement=this.parseClassDeclaration();break;case"let":statement=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:statement=this.parseStatement();}else statement=this.parseStatement();return statement},Parser.prototype.parseBlock=function(){var node=this.createNode();this.expect("{");for(var block=[];!this.match("}");)block.push(this.parseStatementListItem());return this.expect("}"),this.finalize(node,new Node.BlockStatement(block))},Parser.prototype.parseLexicalBinding=function(kind,options){var node=this.createNode(),id=this.parsePattern([],kind);this.context.strict&&id.type===syntax_1.Syntax.Identifier&&this.scanner.isRestrictedWord(id.name)&&this.tolerateError(messages_1.Messages.StrictVarName);var init=null;return"const"===kind?!this.matchKeyword("in")&&!this.matchContextualKeyword("of")&&(this.match("=")?(this.nextToken(),init=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(messages_1.Messages.DeclarationMissingInitializer,"const")):(!options.inFor&&id.type!==syntax_1.Syntax.Identifier||this.match("="))&&(this.expect("="),init=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(node,new Node.VariableDeclarator(id,init))},Parser.prototype.parseBindingList=function(kind,options){for(var list=[this.parseLexicalBinding(kind,options)];this.match(",");)this.nextToken(),list.push(this.parseLexicalBinding(kind,options));return list},Parser.prototype.isLexicalDeclaration=function(){var state=this.scanner.saveState();this.scanner.scanComments();var next=this.scanner.lex();return this.scanner.restoreState(state),3===next.type||7===next.type&&"["===next.value||7===next.type&&"{"===next.value||4===next.type&&"let"===next.value||4===next.type&&"yield"===next.value},Parser.prototype.parseLexicalDeclaration=function(options){var node=this.createNode(),kind=this.nextToken().value;assert_1.assert("let"===kind||"const"===kind,"Lexical declaration must be either let or const");var declarations=this.parseBindingList(kind,options);return this.consumeSemicolon(),this.finalize(node,new Node.VariableDeclaration(declarations,kind))},Parser.prototype.parseBindingRestElement=function(params,kind){var node=this.createNode();this.expect("...");var arg=this.parsePattern(params,kind);return this.finalize(node,new Node.RestElement(arg))},Parser.prototype.parseArrayPattern=function(params,kind){var node=this.createNode();this.expect("[");for(var elements=[];!this.match("]");)if(this.match(","))this.nextToken(),elements.push(null);else{if(this.match("...")){elements.push(this.parseBindingRestElement(params,kind));break}else elements.push(this.parsePatternWithDefault(params,kind));this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(node,new Node.ArrayPattern(elements))},Parser.prototype.parsePropertyPattern=function(params,kind){var node=this.createNode(),computed=!1,shorthand=!1,key,value;if(3===this.lookahead.type){var keyToken=this.lookahead;key=this.parseVariableIdentifier();var init=this.finalize(node,new Node.Identifier(keyToken.value));if(this.match("=")){params.push(keyToken),shorthand=!0,this.nextToken();var expr=this.parseAssignmentExpression();value=this.finalize(this.startNode(keyToken),new Node.AssignmentPattern(init,expr))}else this.match(":")?(this.expect(":"),value=this.parsePatternWithDefault(params,kind)):(params.push(keyToken),shorthand=!0,value=init)}else computed=this.match("["),key=this.parseObjectPropertyKey(),this.expect(":"),value=this.parsePatternWithDefault(params,kind);return this.finalize(node,new Node.Property("init",key,computed,value,!1,shorthand))},Parser.prototype.parseObjectPattern=function(params,kind){var node=this.createNode(),properties=[];for(this.expect("{");!this.match("}");)properties.push(this.parsePropertyPattern(params,kind)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(node,new Node.ObjectPattern(properties))},Parser.prototype.parsePattern=function(params,kind){var pattern;return this.match("[")?pattern=this.parseArrayPattern(params,kind):this.match("{")?pattern=this.parseObjectPattern(params,kind):(this.matchKeyword("let")&&("const"===kind||"let"===kind)&&this.tolerateUnexpectedToken(this.lookahead,messages_1.Messages.LetInLexicalBinding),params.push(this.lookahead),pattern=this.parseVariableIdentifier(kind)),pattern},Parser.prototype.parsePatternWithDefault=function(params,kind){var startToken=this.lookahead,pattern=this.parsePattern(params,kind);if(this.match("=")){this.nextToken();var previousAllowYield=this.context.allowYield;this.context.allowYield=!0;var right=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=previousAllowYield,pattern=this.finalize(this.startNode(startToken),new Node.AssignmentPattern(pattern,right))}return pattern},Parser.prototype.parseVariableIdentifier=function(kind){var node=this.createNode(),token=this.nextToken();return 4===token.type&&"yield"===token.value?this.context.strict?this.tolerateUnexpectedToken(token,messages_1.Messages.StrictReservedWord):!this.context.allowYield&&this.throwUnexpectedToken(token):3===token.type?(this.context.isModule||this.context.await)&&3===token.type&&"await"===token.value&&this.tolerateUnexpectedToken(token):this.context.strict&&4===token.type&&this.scanner.isStrictModeReservedWord(token.value)?this.tolerateUnexpectedToken(token,messages_1.Messages.StrictReservedWord):(this.context.strict||"let"!==token.value||"var"!==kind)&&this.throwUnexpectedToken(token),this.finalize(node,new Node.Identifier(token.value))},Parser.prototype.parseVariableDeclaration=function(options){var node=this.createNode(),id=this.parsePattern([],"var");this.context.strict&&id.type===syntax_1.Syntax.Identifier&&this.scanner.isRestrictedWord(id.name)&&this.tolerateError(messages_1.Messages.StrictVarName);var init=null;return this.match("=")?(this.nextToken(),init=this.isolateCoverGrammar(this.parseAssignmentExpression)):id.type!==syntax_1.Syntax.Identifier&&!options.inFor&&this.expect("="),this.finalize(node,new Node.VariableDeclarator(id,init))},Parser.prototype.parseVariableDeclarationList=function(options){var opt={inFor:options.inFor},list=[];for(list.push(this.parseVariableDeclaration(opt));this.match(",");)this.nextToken(),list.push(this.parseVariableDeclaration(opt));return list},Parser.prototype.parseVariableStatement=function(){var node=this.createNode();this.expectKeyword("var");var declarations=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(node,new Node.VariableDeclaration(declarations,"var"))},Parser.prototype.parseEmptyStatement=function(){var node=this.createNode();return this.expect(";"),this.finalize(node,new Node.EmptyStatement)},Parser.prototype.parseExpressionStatement=function(){var node=this.createNode(),expr=this.parseExpression();return this.consumeSemicolon(),this.finalize(node,new Node.ExpressionStatement(expr))},Parser.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(messages_1.Messages.StrictFunction),this.parseStatement()},Parser.prototype.parseIfStatement=function(){var node=this.createNode(),alternate=null,consequent;this.expectKeyword("if"),this.expect("(");var test=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),consequent=this.finalize(this.createNode(),new Node.EmptyStatement)):(this.expect(")"),consequent=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),alternate=this.parseIfClause())),this.finalize(node,new Node.IfStatement(test,consequent,alternate))},Parser.prototype.parseDoWhileStatement=function(){var node=this.createNode();this.expectKeyword("do");var previousInIteration=this.context.inIteration;this.context.inIteration=!0;var body=this.parseStatement();this.context.inIteration=previousInIteration,this.expectKeyword("while"),this.expect("(");var test=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(node,new Node.DoWhileStatement(body,test))},Parser.prototype.parseWhileStatement=function(){var node=this.createNode(),body;this.expectKeyword("while"),this.expect("(");var test=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),body=this.finalize(this.createNode(),new Node.EmptyStatement);else{this.expect(")");var previousInIteration=this.context.inIteration;this.context.inIteration=!0,body=this.parseStatement(),this.context.inIteration=previousInIteration}return this.finalize(node,new Node.WhileStatement(test,body))},Parser.prototype.parseForStatement=function(){var init=null,test=null,update=null,forIn=!0,node=this.createNode(),left,right;if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){init=this.createNode(),this.nextToken();var previousAllowIn=this.context.allowIn;this.context.allowIn=!1;var declarations=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=previousAllowIn,1===declarations.length&&this.matchKeyword("in")){var decl=declarations[0];decl.init&&(decl.id.type===syntax_1.Syntax.ArrayPattern||decl.id.type===syntax_1.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(messages_1.Messages.ForInOfLoopInitializer,"for-in"),init=this.finalize(init,new Node.VariableDeclaration(declarations,"var")),this.nextToken(),left=init,right=this.parseExpression(),init=null}else 1===declarations.length&&null===declarations[0].init&&this.matchContextualKeyword("of")?(init=this.finalize(init,new Node.VariableDeclaration(declarations,"var")),this.nextToken(),left=init,right=this.parseAssignmentExpression(),init=null,forIn=!1):(init=this.finalize(init,new Node.VariableDeclaration(declarations,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){init=this.createNode();var kind=this.nextToken().value;if(!this.context.strict&&"in"===this.lookahead.value)init=this.finalize(init,new Node.Identifier(kind)),this.nextToken(),left=init,right=this.parseExpression(),init=null;else{var previousAllowIn=this.context.allowIn;this.context.allowIn=!1;var declarations=this.parseBindingList(kind,{inFor:!0});this.context.allowIn=previousAllowIn,1===declarations.length&&null===declarations[0].init&&this.matchKeyword("in")?(init=this.finalize(init,new Node.VariableDeclaration(declarations,kind)),this.nextToken(),left=init,right=this.parseExpression(),init=null):1===declarations.length&&null===declarations[0].init&&this.matchContextualKeyword("of")?(init=this.finalize(init,new Node.VariableDeclaration(declarations,kind)),this.nextToken(),left=init,right=this.parseAssignmentExpression(),init=null,forIn=!1):(this.consumeSemicolon(),init=this.finalize(init,new Node.VariableDeclaration(declarations,kind)))}}else{var initStartToken=this.lookahead,previousAllowIn=this.context.allowIn;if(this.context.allowIn=!1,init=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=previousAllowIn,this.matchKeyword("in"))this.context.isAssignmentTarget&&init.type!==syntax_1.Syntax.AssignmentExpression||this.tolerateError(messages_1.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(init),left=init,right=this.parseExpression(),init=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&init.type!==syntax_1.Syntax.AssignmentExpression||this.tolerateError(messages_1.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(init),left=init,right=this.parseAssignmentExpression(),init=null,forIn=!1;else{if(this.match(",")){for(var initSeq=[init];this.match(",");)this.nextToken(),initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));init=this.finalize(this.startNode(initStartToken),new Node.SequenceExpression(initSeq))}this.expect(";")}}"undefined"==typeof left&&(!this.match(";")&&(test=this.parseExpression()),this.expect(";"),!this.match(")")&&(update=this.parseExpression()));var body;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),body=this.finalize(this.createNode(),new Node.EmptyStatement);else{this.expect(")");var previousInIteration=this.context.inIteration;this.context.inIteration=!0,body=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=previousInIteration}return"undefined"==typeof left?this.finalize(node,new Node.ForStatement(init,test,update,body)):forIn?this.finalize(node,new Node.ForInStatement(left,right,body)):this.finalize(node,new Node.ForOfStatement(left,right,body))},Parser.prototype.parseContinueStatement=function(){var node=this.createNode();this.expectKeyword("continue");var label=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var id=this.parseVariableIdentifier();label=id;var key="$"+id.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,key)||this.throwError(messages_1.Messages.UnknownLabel,id.name)}return this.consumeSemicolon(),null!==label||this.context.inIteration||this.throwError(messages_1.Messages.IllegalContinue),this.finalize(node,new Node.ContinueStatement(label))},Parser.prototype.parseBreakStatement=function(){var node=this.createNode();this.expectKeyword("break");var label=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var id=this.parseVariableIdentifier(),key="$"+id.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,key)||this.throwError(messages_1.Messages.UnknownLabel,id.name),label=id}return this.consumeSemicolon(),null!==label||this.context.inIteration||this.context.inSwitch||this.throwError(messages_1.Messages.IllegalBreak),this.finalize(node,new Node.BreakStatement(label))},Parser.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(messages_1.Messages.IllegalReturn);var node=this.createNode();this.expectKeyword("return");var hasArgument=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&2!==this.lookahead.type,argument=hasArgument?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(node,new Node.ReturnStatement(argument))},Parser.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(messages_1.Messages.StrictModeWith);var node=this.createNode(),body;this.expectKeyword("with"),this.expect("(");var object=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),body=this.finalize(this.createNode(),new Node.EmptyStatement)):(this.expect(")"),body=this.parseStatement()),this.finalize(node,new Node.WithStatement(object,body))},Parser.prototype.parseSwitchCase=function(){var node=this.createNode(),test;this.matchKeyword("default")?(this.nextToken(),test=null):(this.expectKeyword("case"),test=this.parseExpression()),this.expect(":");for(var consequent=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)consequent.push(this.parseStatementListItem());return this.finalize(node,new Node.SwitchCase(test,consequent))},Parser.prototype.parseSwitchStatement=function(){var node=this.createNode();this.expectKeyword("switch"),this.expect("(");var discriminant=this.parseExpression();this.expect(")");var previousInSwitch=this.context.inSwitch;this.context.inSwitch=!0;var cases=[],defaultFound=!1;for(this.expect("{");!this.match("}");){var clause=this.parseSwitchCase();null===clause.test&&(defaultFound&&this.throwError(messages_1.Messages.MultipleDefaultsInSwitch),defaultFound=!0),cases.push(clause)}return this.expect("}"),this.context.inSwitch=previousInSwitch,this.finalize(node,new Node.SwitchStatement(discriminant,cases))},Parser.prototype.parseLabelledStatement=function(){var node=this.createNode(),expr=this.parseExpression(),statement;if(expr.type===syntax_1.Syntax.Identifier&&this.match(":")){this.nextToken();var id=expr,key="$"+id.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,key)&&this.throwError(messages_1.Messages.Redeclaration,"Label",id.name),this.context.labelSet[key]=!0;var body;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),body=this.parseClassDeclaration();else if(this.matchKeyword("function")){var token=this.lookahead,declaration=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(token,messages_1.Messages.StrictFunction):declaration.generator&&this.tolerateUnexpectedToken(token,messages_1.Messages.GeneratorInLegacyContext),body=declaration}else body=this.parseStatement();delete this.context.labelSet[key],statement=new Node.LabeledStatement(id,body)}else this.consumeSemicolon(),statement=new Node.ExpressionStatement(expr);return this.finalize(node,statement)},Parser.prototype.parseThrowStatement=function(){var node=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(messages_1.Messages.NewlineAfterThrow);var argument=this.parseExpression();return this.consumeSemicolon(),this.finalize(node,new Node.ThrowStatement(argument))},Parser.prototype.parseCatchClause=function(){var node=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var params=[],param=this.parsePattern(params),paramMap={},i=0,key;i<params.length;i++)key="$"+params[i].value,Object.prototype.hasOwnProperty.call(paramMap,key)&&this.tolerateError(messages_1.Messages.DuplicateBinding,params[i].value),paramMap[key]=!0;this.context.strict&¶m.type===syntax_1.Syntax.Identifier&&this.scanner.isRestrictedWord(param.name)&&this.tolerateError(messages_1.Messages.StrictCatchVariable),this.expect(")");var body=this.parseBlock();return this.finalize(node,new Node.CatchClause(param,body))},Parser.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},Parser.prototype.parseTryStatement=function(){var node=this.createNode();this.expectKeyword("try");var block=this.parseBlock(),handler=this.matchKeyword("catch")?this.parseCatchClause():null,finalizer=this.matchKeyword("finally")?this.parseFinallyClause():null;return handler||finalizer||this.throwError(messages_1.Messages.NoCatchOrFinally),this.finalize(node,new Node.TryStatement(block,handler,finalizer))},Parser.prototype.parseDebuggerStatement=function(){var node=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(node,new Node.DebuggerStatement)},Parser.prototype.parseStatement=function(){var statement;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:statement=this.parseExpressionStatement();break;case 7:var value=this.lookahead.value;statement="{"===value?this.parseBlock():"("===value?this.parseExpressionStatement():";"===value?this.parseEmptyStatement():this.parseExpressionStatement();break;case 3:statement=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":statement=this.parseBreakStatement();break;case"continue":statement=this.parseContinueStatement();break;case"debugger":statement=this.parseDebuggerStatement();break;case"do":statement=this.parseDoWhileStatement();break;case"for":statement=this.parseForStatement();break;case"function":statement=this.parseFunctionDeclaration();break;case"if":statement=this.parseIfStatement();break;case"return":statement=this.parseReturnStatement();break;case"switch":statement=this.parseSwitchStatement();break;case"throw":statement=this.parseThrowStatement();break;case"try":statement=this.parseTryStatement();break;case"var":statement=this.parseVariableStatement();break;case"while":statement=this.parseWhileStatement();break;case"with":statement=this.parseWithStatement();break;default:statement=this.parseExpressionStatement();}break;default:statement=this.throwUnexpectedToken(this.lookahead);}return statement},Parser.prototype.parseFunctionSourceElements=function(){var node=this.createNode();this.expect("{");var body=this.parseDirectivePrologues(),previousLabelSet=this.context.labelSet,previousInIteration=this.context.inIteration,previousInSwitch=this.context.inSwitch,previousInFunctionBody=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;2!==this.lookahead.type&&!this.match("}");)body.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=previousLabelSet,this.context.inIteration=previousInIteration,this.context.inSwitch=previousInSwitch,this.context.inFunctionBody=previousInFunctionBody,this.finalize(node,new Node.BlockStatement(body))},Parser.prototype.validateParam=function(options,param,name){var key="$"+name;this.context.strict?(this.scanner.isRestrictedWord(name)&&(options.stricted=param,options.message=messages_1.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(options.paramSet,key)&&(options.stricted=param,options.message=messages_1.Messages.StrictParamDupe)):!options.firstRestricted&&(this.scanner.isRestrictedWord(name)?(options.firstRestricted=param,options.message=messages_1.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(name)?(options.firstRestricted=param,options.message=messages_1.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(options.paramSet,key)&&(options.stricted=param,options.message=messages_1.Messages.StrictParamDupe)),"function"==typeof Object.defineProperty?Object.defineProperty(options.paramSet,key,{value:!0,enumerable:!0,writable:!0,configurable:!0}):options.paramSet[key]=!0},Parser.prototype.parseRestElement=function(params){var node=this.createNode();this.expect("...");var arg=this.parsePattern(params);return this.match("=")&&this.throwError(messages_1.Messages.DefaultRestParameter),this.match(")")||this.throwError(messages_1.Messages.ParameterAfterRestParameter),this.finalize(node,new Node.RestElement(arg))},Parser.prototype.parseFormalParameter=function(options){for(var params=[],param=this.match("...")?this.parseRestElement(params):this.parsePatternWithDefault(params),i=0;i<params.length;i++)this.validateParam(options,params[i],params[i].value);options.simple=options.simple&¶m instanceof Node.Identifier,options.params.push(param)},Parser.prototype.parseFormalParameters=function(firstRestricted){var options;if(options={simple:!0,params:[],firstRestricted:firstRestricted},this.expect("("),!this.match(")"))for(options.paramSet={};2!==this.lookahead.type&&(this.parseFormalParameter(options),!this.match(")"))&&(this.expect(","),!this.match(")")););return this.expect(")"),{simple:options.simple,params:options.params,stricted:options.stricted,firstRestricted:options.firstRestricted,message:options.message}},Parser.prototype.matchAsyncFunction=function(){var match=this.matchContextualKeyword("async");if(match){var state=this.scanner.saveState();this.scanner.scanComments();var next=this.scanner.lex();this.scanner.restoreState(state),match=state.lineNumber===next.lineNumber&&4===next.type&&"function"===next.value}return match},Parser.prototype.parseFunctionDeclaration=function(identifierIsOptional){var node=this.createNode(),isAsync=this.matchContextualKeyword("async");isAsync&&this.nextToken(),this.expectKeyword("function");var isGenerator=!isAsync&&this.match("*");isGenerator&&this.nextToken();var id=null,firstRestricted=null,message;if(!identifierIsOptional||!this.match("(")){var token=this.lookahead;id=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(token.value)&&this.tolerateUnexpectedToken(token,messages_1.Messages.StrictFunctionName):this.scanner.isRestrictedWord(token.value)?(firstRestricted=token,message=messages_1.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(token.value)&&(firstRestricted=token,message=messages_1.Messages.StrictReservedWord)}var previousAllowAwait=this.context.await,previousAllowYield=this.context.allowYield;this.context.await=isAsync,this.context.allowYield=!isGenerator;var formalParameters=this.parseFormalParameters(firstRestricted),params=formalParameters.params,stricted=formalParameters.stricted;firstRestricted=formalParameters.firstRestricted,formalParameters.message&&(message=formalParameters.message);var previousStrict=this.context.strict,previousAllowStrictDirective=this.context.allowStrictDirective;this.context.allowStrictDirective=formalParameters.simple;var body=this.parseFunctionSourceElements();return this.context.strict&&firstRestricted&&this.throwUnexpectedToken(firstRestricted,message),this.context.strict&&stricted&&this.tolerateUnexpectedToken(stricted,message),this.context.strict=previousStrict,this.context.allowStrictDirective=previousAllowStrictDirective,this.context.await=previousAllowAwait,this.context.allowYield=previousAllowYield,isAsync?this.finalize(node,new Node.AsyncFunctionDeclaration(id,params,body)):this.finalize(node,new Node.FunctionDeclaration(id,params,body,isGenerator))},Parser.prototype.parseFunctionExpression=function(){var node=this.createNode(),isAsync=this.matchContextualKeyword("async");isAsync&&this.nextToken(),this.expectKeyword("function");var isGenerator=!isAsync&&this.match("*");isGenerator&&this.nextToken();var id=null,previousAllowAwait=this.context.await,previousAllowYield=this.context.allowYield,message,firstRestricted;if(this.context.await=isAsync,this.context.allowYield=!isGenerator,!this.match("(")){var token=this.lookahead;id=this.context.strict||isGenerator||!this.matchKeyword("yield")?this.parseVariableIdentifier():this.parseIdentifierName(),this.context.strict?this.scanner.isRestrictedWord(token.value)&&this.tolerateUnexpectedToken(token,messages_1.Messages.StrictFunctionName):this.scanner.isRestrictedWord(token.value)?(firstRestricted=token,message=messages_1.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(token.value)&&(firstRestricted=token,message=messages_1.Messages.StrictReservedWord)}var formalParameters=this.parseFormalParameters(firstRestricted),params=formalParameters.params,stricted=formalParameters.stricted;firstRestricted=formalParameters.firstRestricted,formalParameters.message&&(message=formalParameters.message);var previousStrict=this.context.strict,previousAllowStrictDirective=this.context.allowStrictDirective;this.context.allowStrictDirective=formalParameters.simple;var body=this.parseFunctionSourceElements();return this.context.strict&&firstRestricted&&this.throwUnexpectedToken(firstRestricted,message),this.context.strict&&stricted&&this.tolerateUnexpectedToken(stricted,message),this.context.strict=previousStrict,this.context.allowStrictDirective=previousAllowStrictDirective,this.context.await=previousAllowAwait,this.context.allowYield=previousAllowYield,isAsync?this.finalize(node,new Node.AsyncFunctionExpression(id,params,body)):this.finalize(node,new Node.FunctionExpression(id,params,body,isGenerator))},Parser.prototype.parseDirective=function(){var token=this.lookahead,node=this.createNode(),expr=this.parseExpression(),directive=expr.type===syntax_1.Syntax.Literal?this.getTokenRaw(token).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(node,directive?new Node.Directive(expr,directive):new Node.ExpressionStatement(expr))},Parser.prototype.parseDirectivePrologues=function(){for(var firstRestricted=null,body=[],token,statement;token=this.lookahead,8===token.type;){statement=this.parseDirective(),body.push(statement);var directive=statement.directive;if("string"!=typeof directive)break;"use strict"===directive?(this.context.strict=!0,firstRestricted&&this.tolerateUnexpectedToken(firstRestricted,messages_1.Messages.StrictOctalLiteral),!this.context.allowStrictDirective&&this.tolerateUnexpectedToken(token,messages_1.Messages.IllegalLanguageModeDirective)):!firstRestricted&&token.octal&&(firstRestricted=token)}return body},Parser.prototype.qualifiedPropertyName=function(token){switch(token.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return"["===token.value;default:}return!1},Parser.prototype.parseGetterMethod=function(){var node=this.createNode(),previousAllowYield=this.context.allowYield;this.context.allowYield=!1;var formalParameters=this.parseFormalParameters();0<formalParameters.params.length&&this.tolerateError(messages_1.Messages.BadGetterArity);var method=this.parsePropertyMethod(formalParameters);return this.context.allowYield=previousAllowYield,this.finalize(node,new Node.FunctionExpression(null,formalParameters.params,method,!1))},Parser.prototype.parseSetterMethod=function(){var node=this.createNode(),previousAllowYield=this.context.allowYield;this.context.allowYield=!1;var formalParameters=this.parseFormalParameters();1===formalParameters.params.length?formalParameters.params[0]instanceof Node.RestElement&&this.tolerateError(messages_1.Messages.BadSetterRestParameter):this.tolerateError(messages_1.Messages.BadSetterArity);var method=this.parsePropertyMethod(formalParameters);return this.context.allowYield=previousAllowYield,this.finalize(node,new Node.FunctionExpression(null,formalParameters.params,method,!1))},Parser.prototype.parseGeneratorMethod=function(){var node=this.createNode(),previousAllowYield=this.context.allowYield;this.context.allowYield=!0;var params=this.parseFormalParameters();this.context.allowYield=!1;var method=this.parsePropertyMethod(params);return this.context.allowYield=previousAllowYield,this.finalize(node,new Node.FunctionExpression(null,params.params,method,!0))},Parser.prototype.isStartOfExpression=function(){var start=!0,value=this.lookahead.value;switch(this.lookahead.type){case 7:start="["===value||"("===value||"{"===value||"+"===value||"-"===value||"!"===value||"~"===value||"++"===value||"--"===value||"/"===value||"/="===value;break;case 4:start="class"===value||"delete"===value||"function"===value||"let"===value||"new"===value||"super"===value||"this"===value||"typeof"===value||"void"===value||"yield"===value;break;default:}return start},Parser.prototype.parseYieldExpression=function(){var node=this.createNode();this.expectKeyword("yield");var argument=null,delegate=!1;if(!this.hasLineTerminator){var previousAllowYield=this.context.allowYield;this.context.allowYield=!1,delegate=this.match("*"),delegate?(this.nextToken(),argument=this.parseAssignmentExpression()):this.isStartOfExpression()&&(argument=this.parseAssignmentExpression()),this.context.allowYield=previousAllowYield}return this.finalize(node,new Node.YieldExpression(argument,delegate))},Parser.prototype.parseClassElement=function(hasConstructor){var token=this.lookahead,node=this.createNode(),kind="",key=null,value=null,computed=!1,method=!1,isStatic=!1,isAsync=!1;if(this.match("*"))this.nextToken();else{computed=this.match("["),key=this.parseObjectPropertyKey();var id=key;if("static"===id.name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(token=this.lookahead,isStatic=!0,computed=this.match("["),this.match("*")?this.nextToken():key=this.parseObjectPropertyKey()),3===token.type&&!this.hasLineTerminator&&"async"===token.value){var punctuator=this.lookahead.value;":"!==punctuator&&"("!==punctuator&&"*"!==punctuator&&(isAsync=!0,token=this.lookahead,key=this.parseObjectPropertyKey(),3===token.type&&("get"===token.value||"set"===token.value?this.tolerateUnexpectedToken(token):"constructor"===token.value&&this.tolerateUnexpectedToken(token,messages_1.Messages.ConstructorIsAsync)))}}var lookaheadPropertyKey=this.qualifiedPropertyName(this.lookahead);return 3===token.type?"get"===token.value&&lookaheadPropertyKey?(kind="get",computed=this.match("["),key=this.parseObjectPropertyKey(),this.context.allowYield=!1,value=this.parseGetterMethod()):"set"===token.value&&lookaheadPropertyKey&&(kind="set",computed=this.match("["),key=this.parseObjectPropertyKey(),value=this.parseSetterMethod()):7===token.type&&"*"===token.value&&lookaheadPropertyKey&&(kind="init",computed=this.match("["),key=this.parseObjectPropertyKey(),value=this.parseGeneratorMethod(),method=!0),!kind&&key&&this.match("(")&&(kind="init",value=isAsync?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),method=!0),kind||this.throwUnexpectedToken(this.lookahead),"init"==kind&&(kind="method"),computed||(isStatic&&this.isPropertyKey(key,"prototype")&&this.throwUnexpectedToken(token,messages_1.Messages.StaticPrototype),!isStatic&&this.isPropertyKey(key,"constructor")&&(("method"!=kind||!method||value&&value.generator)&&this.throwUnexpectedToken(token,messages_1.Messages.ConstructorSpecialMethod),hasConstructor.value?this.throwUnexpectedToken(token,messages_1.Messages.DuplicateConstructor):hasConstructor.value=!0,kind="constructor")),this.finalize(node,new Node.MethodDefinition(key,computed,value,kind,isStatic))},Parser.prototype.parseClassElementList=function(){var body=[],hasConstructor={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():body.push(this.parseClassElement(hasConstructor));return this.expect("}"),body},Parser.prototype.parseClassBody=function(){var node=this.createNode(),elementList=this.parseClassElementList();return this.finalize(node,new Node.ClassBody(elementList))},Parser.prototype.parseClassDeclaration=function(identifierIsOptional){var node=this.createNode(),previousStrict=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var id=identifierIsOptional&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),superClass=null;this.matchKeyword("extends")&&(this.nextToken(),superClass=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var classBody=this.parseClassBody();return this.context.strict=previousStrict,this.finalize(node,new Node.ClassDeclaration(id,superClass,classBody))},Parser.prototype.parseClassExpression=function(){var node=this.createNode(),previousStrict=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var id=3===this.lookahead.type?this.parseVariableIdentifier():null,superClass=null;this.matchKeyword("extends")&&(this.nextToken(),superClass=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var classBody=this.parseClassBody();return this.context.strict=previousStrict,this.finalize(node,new Node.ClassExpression(id,superClass,classBody))},Parser.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0;for(var node=this.createNode(),body=this.parseDirectivePrologues();2!==this.lookahead.type;)body.push(this.parseStatementListItem());return this.finalize(node,new Node.Module(body))},Parser.prototype.parseScript=function(){for(var node=this.createNode(),body=this.parseDirectivePrologues();2!==this.lookahead.type;)body.push(this.parseStatementListItem());return this.finalize(node,new Node.Script(body))},Parser.prototype.parseModuleSpecifier=function(){var node=this.createNode();8!==this.lookahead.type&&this.throwError(messages_1.Messages.InvalidModuleSpecifier);var token=this.nextToken(),raw=this.getTokenRaw(token);return this.finalize(node,new Node.Literal(token.value,raw))},Parser.prototype.parseImportSpecifier=function(){var node=this.createNode(),imported,local;return 3===this.lookahead.type?(imported=this.parseVariableIdentifier(),local=imported,this.matchContextualKeyword("as")&&(this.nextToken(),local=this.parseVariableIdentifier())):(imported=this.parseIdentifierName(),local=imported,this.matchContextualKeyword("as")?(this.nextToken(),local=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(node,new Node.ImportSpecifier(local,imported))},Parser.prototype.parseNamedImports=function(){this.expect("{");for(var specifiers=[];!this.match("}");)specifiers.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),specifiers},Parser.prototype.parseImportDefaultSpecifier=function(){var node=this.createNode(),local=this.parseIdentifierName();return this.finalize(node,new Node.ImportDefaultSpecifier(local))},Parser.prototype.parseImportNamespaceSpecifier=function(){var node=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(messages_1.Messages.NoAsAfterImportNamespace),this.nextToken();var local=this.parseIdentifierName();return this.finalize(node,new Node.ImportNamespaceSpecifier(local))},Parser.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(messages_1.Messages.IllegalImportDeclaration);var node=this.createNode();this.expectKeyword("import");var specifiers=[],src;if(8===this.lookahead.type)src=this.parseModuleSpecifier();else{if(this.match("{")?specifiers=specifiers.concat(this.parseNamedImports()):this.match("*")?specifiers.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(specifiers.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?specifiers.push(this.parseImportNamespaceSpecifier()):this.match("{")?specifiers=specifiers.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var message=this.lookahead.value?messages_1.Messages.UnexpectedToken:messages_1.Messages.MissingFromClause;this.throwError(message,this.lookahead.value)}this.nextToken(),src=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(node,new Node.ImportDeclaration(specifiers,src))},Parser.prototype.parseExportSpecifier=function(){var node=this.createNode(),local=this.parseIdentifierName(),exported=local;return this.matchContextualKeyword("as")&&(this.nextToken(),exported=this.parseIdentifierName()),this.finalize(node,new Node.ExportSpecifier(local,exported))},Parser.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(messages_1.Messages.IllegalExportDeclaration);var node=this.createNode();this.expectKeyword("export");var exportDeclaration;if(this.matchKeyword("default")){if(this.nextToken(),this.matchKeyword("function")){var declaration=this.parseFunctionDeclaration(!0);exportDeclaration=this.finalize(node,new Node.ExportDefaultDeclaration(declaration))}else if(this.matchKeyword("class")){var declaration=this.parseClassDeclaration(!0);exportDeclaration=this.finalize(node,new Node.ExportDefaultDeclaration(declaration))}else if(this.matchContextualKeyword("async")){var declaration=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();exportDeclaration=this.finalize(node,new Node.ExportDefaultDeclaration(declaration))}else{this.matchContextualKeyword("from")&&this.throwError(messages_1.Messages.UnexpectedToken,this.lookahead.value);var declaration=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),exportDeclaration=this.finalize(node,new Node.ExportDefaultDeclaration(declaration))}}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var message=this.lookahead.value?messages_1.Messages.UnexpectedToken:messages_1.Messages.MissingFromClause;this.throwError(message,this.lookahead.value)}this.nextToken();var src=this.parseModuleSpecifier();this.consumeSemicolon(),exportDeclaration=this.finalize(node,new Node.ExportAllDeclaration(src))}else if(4===this.lookahead.type){var declaration=void 0;switch(this.lookahead.value){case"let":case"const":declaration=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":declaration=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead);}exportDeclaration=this.finalize(node,new Node.ExportNamedDeclaration(declaration,[],null))}else if(this.matchAsyncFunction()){var declaration=this.parseFunctionDeclaration();exportDeclaration=this.finalize(node,new Node.ExportNamedDeclaration(declaration,[],null))}else{var specifiers=[],source=null,isExportFromIdentifier=!1;for(this.expect("{");!this.match("}");)isExportFromIdentifier=isExportFromIdentifier||this.matchKeyword("default"),specifiers.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),source=this.parseModuleSpecifier(),this.consumeSemicolon();else if(isExportFromIdentifier){var message=this.lookahead.value?messages_1.Messages.UnexpectedToken:messages_1.Messages.MissingFromClause;this.throwError(message,this.lookahead.value)}else this.consumeSemicolon();exportDeclaration=this.finalize(node,new Node.ExportNamedDeclaration(null,specifiers,source))}return exportDeclaration},Parser}();exports.Parser=Parser},function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.assert=function(condition,message){if(!condition)throw new Error("ASSERT: "+message)}},function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});var ErrorHandler=function(){function ErrorHandler(){this.errors=[],this.tolerant=!1}return ErrorHandler.prototype.recordError=function(error){this.errors.push(error)},ErrorHandler.prototype.tolerate=function(error){if(this.tolerant)this.recordError(error);else throw error},ErrorHandler.prototype.constructError=function(msg,column){var error=new Error(msg);try{throw error}catch(base){Object.create&&Object.defineProperty&&(error=Object.create(base),Object.defineProperty(error,"column",{value:column}))}return error},ErrorHandler.prototype.createError=function(index,line,col,description){var error=this.constructError("Line "+line+": "+description,col);return error.index=index,error.lineNumber=line,error.description=description,error},ErrorHandler.prototype.throwError=function(index,line,col,description){throw this.createError(index,line,col,description)},ErrorHandler.prototype.tolerateError=function(index,line,col,description){var error=this.createError(index,line,col,description);if(this.tolerant)this.recordError(error);else throw error},ErrorHandler}();exports.ErrorHandler=ErrorHandler},function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(module,exports,__webpack_require__){function hexValue(ch){return"0123456789abcdef".indexOf(ch.toLowerCase())}function octalValue(ch){return"01234567".indexOf(ch)}Object.defineProperty(exports,"__esModule",{value:!0});var assert_1=__webpack_require__(9),character_1=__webpack_require__(4),messages_1=__webpack_require__(11),Scanner=function(){function Scanner(code,handler){this.source=code,this.errorHandler=handler,this.trackComment=!1,this.length=code.length,this.index=0,this.lineNumber=0<code.length?1:0,this.lineStart=0,this.curlyStack=[]}return Scanner.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},Scanner.prototype.restoreState=function(state){this.index=state.index,this.lineNumber=state.lineNumber,this.lineStart=state.lineStart},Scanner.prototype.eof=function(){return this.index>=this.length},Scanner.prototype.throwUnexpectedToken=function(message){return void 0===message&&(message=messages_1.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,message)},Scanner.prototype.tolerateUnexpectedToken=function(message){void 0===message&&(message=messages_1.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,message)},Scanner.prototype.skipSingleLineComment=function(offset){var comments=[],start,loc;for(this.trackComment&&(comments=[],start=this.index-offset,loc={start:{line:this.lineNumber,column:this.index-this.lineStart-offset},end:{}});!this.eof();){var ch=this.source.charCodeAt(this.index);if(++this.index,character_1.Character.isLineTerminator(ch)){if(this.trackComment){loc.end={line:this.lineNumber,column:this.index-this.lineStart-1};var entry={multiLine:!1,slice:[start+offset,this.index-1],range:[start,this.index-1],loc:loc};comments.push(entry)}return 13===ch&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,comments}}if(this.trackComment){loc.end={line:this.lineNumber,column:this.index-this.lineStart};var entry={multiLine:!1,slice:[start+offset,this.index],range:[start,this.index],loc:loc};comments.push(entry)}return comments},Scanner.prototype.skipMultiLineComment=function(){var comments=[],start,loc;for(this.trackComment&&(comments=[],start=this.index-2,loc={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var ch=this.source.charCodeAt(this.index);if(character_1.Character.isLineTerminator(ch))13===ch&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===ch){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){loc.end={line:this.lineNumber,column:this.index-this.lineStart};var entry={multiLine:!0,slice:[start+2,this.index-2],range:[start,this.index],loc:loc};comments.push(entry)}return comments}++this.index}else++this.index}if(this.trackComment){loc.end={line:this.lineNumber,column:this.index-this.lineStart};var entry={multiLine:!0,slice:[start+2,this.index],range:[start,this.index],loc:loc};comments.push(entry)}return this.tolerateUnexpectedToken(),comments},Scanner.prototype.scanComments=function(){var comments;this.trackComment&&(comments=[]);for(var start=0===this.index,ch;!this.eof();)if(ch=this.source.charCodeAt(this.index),character_1.Character.isWhiteSpace(ch))++this.index;else if(character_1.Character.isLineTerminator(ch))++this.index,13===ch&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,start=!0;else if(47===ch){if(ch=this.source.charCodeAt(this.index+1),47===ch){this.index+=2;var comment=this.skipSingleLineComment(2);this.trackComment&&(comments=comments.concat(comment)),start=!0}else if(42===ch){this.index+=2;var comment=this.skipMultiLineComment();this.trackComment&&(comments=comments.concat(comment))}else break;}else if(start&&45===ch){if(45===this.source.charCodeAt(this.index+1)&&62===this.source.charCodeAt(this.index+2)){this.index+=3;var comment=this.skipSingleLineComment(3);this.trackComment&&(comments=comments.concat(comment))}else break;}else if(60!==ch)break;else if("!--"===this.source.slice(this.index+1,this.index+4)){this.index+=4;var comment=this.skipSingleLineComment(4);this.trackComment&&(comments=comments.concat(comment))}else break;return comments},Scanner.prototype.isFutureReservedWord=function(id){return"enum"===id||"export"===id||"import"===id||"super"===id},Scanner.prototype.isStrictModeReservedWord=function(id){return"implements"===id||"interface"===id||"package"===id||"private"===id||"protected"===id||"public"===id||"static"===id||"yield"===id||"let"===id},Scanner.prototype.isRestrictedWord=function(id){return"eval"===id||"arguments"===id},Scanner.prototype.isKeyword=function(id){switch(id.length){case 2:return"if"===id||"in"===id||"do"===id;case 3:return"var"===id||"for"===id||"new"===id||"try"===id||"let"===id;case 4:return"this"===id||"else"===id||"case"===id||"void"===id||"with"===id||"enum"===id;case 5:return"while"===id||"break"===id||"catch"===id||"throw"===id||"const"===id||"yield"===id||"class"===id||"super"===id;case 6:return"return"===id||"typeof"===id||"delete"===id||"switch"===id||"export"===id||"import"===id;case 7:return"default"===id||"finally"===id||"extends"===id;case 8:return"function"===id||"continue"===id||"debugger"===id;case 10:return"instanceof"===id;default:return!1;}},Scanner.prototype.codePointAt=function(i){var cp=this.source.charCodeAt(i);if(55296<=cp&&56319>=cp){var second=this.source.charCodeAt(i+1);if(56320<=second&&57343>=second){var first=cp;cp=1024*(first-55296)+second-56320+65536}}return cp},Scanner.prototype.scanHexEscape=function(prefix){for(var len="u"===prefix?4:2,code=0,i=0;i<len;++i)if(!this.eof()&&character_1.Character.isHexDigit(this.source.charCodeAt(this.index)))code=16*code+hexValue(this.source[this.index++]);else return null;return _StringfromCharCode2(code)},Scanner.prototype.scanUnicodeCodePointEscape=function(){var ch=this.source[this.index],code=0;for("}"===ch&&this.throwUnexpectedToken();!this.eof()&&(ch=this.source[this.index++],!!character_1.Character.isHexDigit(ch.charCodeAt(0)));)code=16*code+hexValue(ch);return(1114111<code||"}"!==ch)&&this.throwUnexpectedToken(),character_1.Character.fromCodePoint(code)},Scanner.prototype.getIdentifier=function(){for(var start=this.index++,ch;!this.eof();){if(ch=this.source.charCodeAt(this.index),92===ch)return this.index=start,this.getComplexIdentifier();if(55296<=ch&&57343>ch)return this.index=start,this.getComplexIdentifier();if(character_1.Character.isIdentifierPart(ch))++this.index;else break}return this.source.slice(start,this.index)},Scanner.prototype.getComplexIdentifier=function(){var cp=this.codePointAt(this.index),id=character_1.Character.fromCodePoint(cp);this.index+=id.length;var ch;for(92===cp&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,ch=this.scanUnicodeCodePointEscape()):(ch=this.scanHexEscape("u"),(null===ch||"\\"===ch||!character_1.Character.isIdentifierStart(ch.charCodeAt(0)))&&this.throwUnexpectedToken()),id=ch);!this.eof()&&(cp=this.codePointAt(this.index),!!character_1.Character.isIdentifierPart(cp));)ch=character_1.Character.fromCodePoint(cp),id+=ch,this.index+=ch.length,92===cp&&(id=id.substr(0,id.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,ch=this.scanUnicodeCodePointEscape()):(ch=this.scanHexEscape("u"),(null===ch||"\\"===ch||!character_1.Character.isIdentifierPart(ch.charCodeAt(0)))&&this.throwUnexpectedToken()),id+=ch);return id},Scanner.prototype.octalToDecimal=function(ch){var octal="0"!==ch,code=octalValue(ch);return!this.eof()&&character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(octal=!0,code=8*code+octalValue(this.source[this.index++]),0<="0123".indexOf(ch)&&!this.eof()&&character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(code=8*code+octalValue(this.source[this.index++]))),{code:code,octal:octal}},Scanner.prototype.scanIdentifier=function(){var start=this.index,id=92===this.source.charCodeAt(start)?this.getComplexIdentifier():this.getIdentifier(),type;if(type=1===id.length?3:this.isKeyword(id)?4:"null"===id?5:"true"===id||"false"===id?1:3,3!==type&&start+id.length!==this.index){var restore=this.index;this.index=start,this.tolerateUnexpectedToken(messages_1.Messages.InvalidEscapedReservedWord),this.index=restore}return{type:type,value:id,lineNumber:this.lineNumber,lineStart:this.lineStart,start:start,end:this.index}},Scanner.prototype.scanPunctuator=function(){var start=this.index,str=this.source[this.index];return"("===str||"{"===str?("{"===str&&this.curlyStack.push("{"),++this.index):"."===str?(++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,str="...")):"}"===str?(++this.index,this.curlyStack.pop()):")"===str||";"===str||","===str||"["===str||"]"===str||":"===str||"?"===str||"~"===str?++this.index:(str=this.source.substr(this.index,4),">>>="===str?this.index+=4:(str=str.substr(0,3),"==="===str||"!=="===str||">>>"===str||"<<="===str||">>="===str||"**="===str?this.index+=3:(str=str.substr(0,2),"&&"===str||"||"===str||"=="===str||"!="===str||"+="===str||"-="===str||"*="===str||"/="===str||"++"===str||"--"===str||"<<"===str||">>"===str||"&="===str||"|="===str||"^="===str||"%="===str||"<="===str||">="===str||"=>"===str||"**"===str?this.index+=2:(str=this.source[this.index],0<="<>=!+-*%&|^/".indexOf(str)&&++this.index)))),this.index===start&&this.throwUnexpectedToken(),{type:7,value:str,lineNumber:this.lineNumber,lineStart:this.lineStart,start:start,end:this.index}},Scanner.prototype.scanHexLiteral=function(start){for(var num="";!this.eof()&&!!character_1.Character.isHexDigit(this.source.charCodeAt(this.index));)num+=this.source[this.index++];return 0===num.length&&this.throwUnexpectedToken(),character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+num,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:start,end:this.index}},Scanner.prototype.scanBinaryLiteral=function(start){for(var num="",ch;!this.eof()&&(ch=this.source[this.index],"0"===ch||"1"===ch);)num+=this.source[this.index++];return 0===num.length&&this.throwUnexpectedToken(),this.eof()||(ch=this.source.charCodeAt(this.index),(character_1.Character.isIdentifierStart(ch)||character_1.Character.isDecimalDigit(ch))&&this.throwUnexpectedToken()),{type:6,value:parseInt(num,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:start,end:this.index}},Scanner.prototype.scanOctalLiteral=function(prefix,start){var num="",octal=!1;for(character_1.Character.isOctalDigit(prefix.charCodeAt(0))?(octal=!0,num="0"+this.source[this.index++]):++this.index;!this.eof()&&!!character_1.Character.isOctalDigit(this.source.charCodeAt(this.index));)num+=this.source[this.index++];return octal||0!==num.length||this.throwUnexpectedToken(),(character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))||character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(num,8),octal:octal,lineNumber:this.lineNumber,lineStart:this.lineStart,start:start,end:this.index}},Scanner.prototype.isImplicitOctalLiteral=function(){for(var i=this.index+1,ch;i<this.length;++i){if(ch=this.source[i],"8"===ch||"9"===ch)return!1;if(!character_1.Character.isOctalDigit(ch.charCodeAt(0)))return!0}return!0},Scanner.prototype.scanNumericLiteral=function(){var start=this.index,ch=this.source[start];assert_1.assert(character_1.Character.isDecimalDigit(ch.charCodeAt(0))||"."===ch,"Numeric literal must start with a decimal digit or a decimal point");var num="";if("."!==ch){if(num=this.source[this.index++],ch=this.source[this.index],"0"===num){if("x"===ch||"X"===ch)return++this.index,this.scanHexLiteral(start);if("b"===ch||"B"===ch)return++this.index,this.scanBinaryLiteral(start);if("o"===ch||"O"===ch)return this.scanOctalLiteral(ch,start);if(ch&&character_1.Character.isOctalDigit(ch.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(ch,start)}for(;character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index));)num+=this.source[this.index++];ch=this.source[this.index]}if("."===ch){for(num+=this.source[this.index++];character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index));)num+=this.source[this.index++];ch=this.source[this.index]}if("e"===ch||"E"===ch)if(num+=this.source[this.index++],ch=this.source[this.index],("+"===ch||"-"===ch)&&(num+=this.source[this.index++]),character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index));)num+=this.source[this.index++];else this.throwUnexpectedToken();return character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(num),lineNumber:this.lineNumber,lineStart:this.lineStart,start:start,end:this.index}},Scanner.prototype.scanStringLiteral=function(){var start=this.index,quote=this.source[start];assert_1.assert("'"===quote||"\""===quote,"String literal must starts with a quote"),++this.index;for(var octal=!1,str="",ch;!this.eof();)if(ch=this.source[this.index++],ch===quote){quote="";break}else if("\\"===ch){if(ch=this.source[this.index++],!ch||!character_1.Character.isLineTerminator(ch.charCodeAt(0)))switch(ch){case"u":if("{"===this.source[this.index])++this.index,str+=this.scanUnicodeCodePointEscape();else{var unescaped_1=this.scanHexEscape(ch);null===unescaped_1&&this.throwUnexpectedToken(),str+=unescaped_1}break;case"x":var unescaped=this.scanHexEscape(ch);null===unescaped&&this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence),str+=unescaped;break;case"n":str+="\n";break;case"r":str+="\r";break;case"t":str+="\t";break;case"b":str+="\b";break;case"f":str+="\f";break;case"v":str+="\x0B";break;case"8":case"9":str+=ch,this.tolerateUnexpectedToken();break;default:if(ch&&character_1.Character.isOctalDigit(ch.charCodeAt(0))){var octToDec=this.octalToDecimal(ch);octal=octToDec.octal||octal,str+=_StringfromCharCode2(octToDec.code)}else str+=ch;}else++this.lineNumber,"\r"===ch&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;}else if(character_1.Character.isLineTerminator(ch.charCodeAt(0)))break;else str+=ch;return""!==quote&&(this.index=start,this.throwUnexpectedToken()),{type:8,value:str,octal:octal,lineNumber:this.lineNumber,lineStart:this.lineStart,start:start,end:this.index}},Scanner.prototype.scanTemplate=function(){var cooked="",terminated=!1,start=this.index,head="`"===this.source[start],tail=!1,rawOffset=2;for(++this.index;!this.eof();){var ch=this.source[this.index++];if("`"===ch){rawOffset=1,tail=!0,terminated=!0;break}else if("$"===ch){if("{"===this.source[this.index]){this.curlyStack.push("${"),++this.index,terminated=!0;break}cooked+=ch}else if("\\"!==ch)character_1.Character.isLineTerminator(ch.charCodeAt(0))?(++this.lineNumber,"\r"===ch&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index,cooked+="\n"):cooked+=ch;else if(ch=this.source[this.index++],!character_1.Character.isLineTerminator(ch.charCodeAt(0)))switch(ch){case"n":cooked+="\n";break;case"r":cooked+="\r";break;case"t":cooked+="\t";break;case"u":if("{"===this.source[this.index])++this.index,cooked+=this.scanUnicodeCodePointEscape();else{var restore=this.index,unescaped_2=this.scanHexEscape(ch);null===unescaped_2?(this.index=restore,cooked+=ch):cooked+=unescaped_2}break;case"x":var unescaped=this.scanHexEscape(ch);null===unescaped&&this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence),cooked+=unescaped;break;case"b":cooked+="\b";break;case"f":cooked+="\f";break;case"v":cooked+="\x0B";break;default:"0"===ch?(character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral),cooked+="\0"):character_1.Character.isOctalDigit(ch.charCodeAt(0))?this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral):cooked+=ch;}else++this.lineNumber,"\r"===ch&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index}return terminated||this.throwUnexpectedToken(),head||this.curlyStack.pop(),{type:10,value:this.source.slice(start+1,this.index-rawOffset),cooked:cooked,head:head,tail:tail,lineNumber:this.lineNumber,lineStart:this.lineStart,start:start,end:this.index}},Scanner.prototype.testRegExp=function(pattern,flags){var astralSubstitute="\uFFFF",tmp=pattern,self=this;0<=flags.indexOf("u")&&(tmp=tmp.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function($0,$1,$2){var codePoint=parseInt($1||$2,16);return 1114111<codePoint&&self.throwUnexpectedToken(messages_1.Messages.InvalidRegExp),65535>=codePoint?_StringfromCharCode2(codePoint):astralSubstitute}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,astralSubstitute));try{RegExp(tmp)}catch(e){this.throwUnexpectedToken(messages_1.Messages.InvalidRegExp)}try{return new RegExp(pattern,flags)}catch(exception){return null}},Scanner.prototype.scanRegExpBody=function(){var ch=this.source[this.index];assert_1.assert("/"===ch,"Regular expression literal must start with a slash");for(var str=this.source[this.index++],classMarker=!1,terminated=!1;!this.eof();)if(ch=this.source[this.index++],str+=ch,"\\"===ch)ch=this.source[this.index++],character_1.Character.isLineTerminator(ch.charCodeAt(0))&&this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp),str+=ch;else if(character_1.Character.isLineTerminator(ch.charCodeAt(0)))this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);else if(classMarker)"]"===ch&&(classMarker=!1);else if("/"===ch){terminated=!0;break}else"["===ch&&(classMarker=!0);return terminated||this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp),str.substr(1,str.length-2)},Scanner.prototype.scanRegExpFlags=function(){for(var str="",flags="",ch;!this.eof()&&(ch=this.source[this.index],!!character_1.Character.isIdentifierPart(ch.charCodeAt(0)));)if(++this.index,"\\"!==ch||this.eof())flags+=ch,str+=ch;else if(ch=this.source[this.index],"u"===ch){++this.index;var restore=this.index,char=this.scanHexEscape("u");if(null!==char)for(flags+=char,str+="\\u";restore<this.index;++restore)str+=this.source[restore];else this.index=restore,flags+="u",str+="\\u";this.tolerateUnexpectedToken()}else str+="\\",this.tolerateUnexpectedToken();return flags},Scanner.prototype.scanRegExp=function(){var start=this.index,pattern=this.scanRegExpBody(),flags=this.scanRegExpFlags(),value=this.testRegExp(pattern,flags);return{type:9,value:"",pattern:pattern,flags:flags,regex:value,lineNumber:this.lineNumber,lineStart:this.lineStart,start:start,end:this.index}},Scanner.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var cp=this.source.charCodeAt(this.index);return character_1.Character.isIdentifierStart(cp)?this.scanIdentifier():40===cp||41===cp||59===cp?this.scanPunctuator():39===cp||34===cp?this.scanStringLiteral():46===cp?character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():character_1.Character.isDecimalDigit(cp)?this.scanNumericLiteral():96===cp||125===cp&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():55296<=cp&&57343>cp&&character_1.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},Scanner}();exports.Scanner=Scanner},function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.TokenName={},exports.TokenName[1]="Boolean",exports.TokenName[2]="<end>",exports.TokenName[3]="Identifier",exports.TokenName[4]="Keyword",exports.TokenName[5]="Null",exports.TokenName[6]="Numeric",exports.TokenName[7]="Punctuator",exports.TokenName[8]="String",exports.TokenName[9]="RegularExpression",exports.TokenName[10]="Template"},function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.XHTMLEntities={quot:"\"",amp:"&",apos:"'",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27E8",rang:"\u27E9"}},function(module,exports,__webpack_require__){Object.defineProperty(exports,"__esModule",{value:!0});var error_handler_1=__webpack_require__(10),scanner_1=__webpack_require__(12),token_1=__webpack_require__(13),Reader=function(){function Reader(){this.values=[],this.curly=this.paren=-1}return Reader.prototype.beforeFunctionExpression=function(t){return 0<=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(t)},Reader.prototype.isRegexStart=function(){var previous=this.values[this.values.length-1],regex=null!==previous;switch(previous){case"this":case"]":regex=!1;break;case")":var keyword=this.values[this.paren-1];regex="if"===keyword||"while"===keyword||"for"===keyword||"with"===keyword;break;case"}":if(regex=!1,"function"===this.values[this.curly-3]){var check=this.values[this.curly-4];regex=!!check&&!this.beforeFunctionExpression(check)}else if("function"===this.values[this.curly-4]){var check=this.values[this.curly-5];regex=!check||!this.beforeFunctionExpression(check)}break;default:}return regex},Reader.prototype.push=function(token){7===token.type||4===token.type?("{"===token.value?this.curly=this.values.length:"("===token.value&&(this.paren=this.values.length),this.values.push(token.value)):this.values.push(null)},Reader}(),Tokenizer=function(){function Tokenizer(code,config){this.errorHandler=new error_handler_1.ErrorHandler,this.errorHandler.tolerant=!!config&&"boolean"==typeof config.tolerant&&config.tolerant,this.scanner=new scanner_1.Scanner(code,this.errorHandler),this.scanner.trackComment=!!config&&"boolean"==typeof config.comment&&config.comment,this.trackRange=!!config&&"boolean"==typeof config.range&&config.range,this.trackLoc=!!config&&"boolean"==typeof config.loc&&config.loc,this.buffer=[],this.reader=new Reader}return Tokenizer.prototype.errors=function(){return this.errorHandler.errors},Tokenizer.prototype.getNextToken=function(){if(0===this.buffer.length){var comments=this.scanner.scanComments();if(this.scanner.trackComment)for(var i=0;i<comments.length;++i){var e=comments[i],value=this.scanner.source.slice(e.slice[0],e.slice[1]),comment={type:e.multiLine?"BlockComment":"LineComment",value:value};this.trackRange&&(comment.range=e.range),this.trackLoc&&(comment.loc=e.loc),this.buffer.push(comment)}if(!this.scanner.eof()){var loc;this.trackLoc&&(loc={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}});var startRegex="/"===this.scanner.source[this.scanner.index]&&this.reader.isRegexStart(),token=startRegex?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(token);var entry={type:token_1.TokenName[token.type],value:this.scanner.source.slice(token.start,token.end)};if(this.trackRange&&(entry.range=[token.start,token.end]),this.trackLoc&&(loc.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},entry.loc=loc),9===token.type){var pattern=token.pattern,flags=token.flags;entry.regex={pattern:pattern,flags:flags}}this.buffer.push(entry)}}return this.buffer.shift()},Tokenizer}();exports.Tokenizer=Tokenizer}])})},"4McY":function(module,exports,__webpack_require__){"use strict";var isObject=__webpack_require__("0gyT");module.exports=function(it){if(!isObject(it))throw TypeError(it+" is not an object!");return it}},"4e7A":function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){function dialogDiv(cm,template,bottom){var wrap=cm.getWrapperElement(),dialog;return dialog=wrap.appendChild(document.createElement("div")),dialog.className=bottom?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof template?dialog.innerHTML=template:dialog.appendChild(template),CodeMirror.addClass(wrap,"dialog-opened"),dialog}function closeNotification(cm,newVal){cm.state.currentNotificationClose&&cm.state.currentNotificationClose(),cm.state.currentNotificationClose=newVal}CodeMirror.defineExtension("openDialog",function(template,callback,options){function close(newVal){if("string"==typeof newVal)inp.value=newVal;else{if(closed)return;closed=!0,CodeMirror.rmClass(dialog.parentNode,"dialog-opened"),dialog.parentNode.removeChild(dialog),me.focus(),options.onClose&&options.onClose(dialog)}}options||(options={}),closeNotification(this,null);var dialog=dialogDiv(this,template,options.bottom),closed=!1,me=this,inp=dialog.getElementsByTagName("input")[0],button;return inp?(inp.focus(),options.value&&(inp.value=options.value,!1!==options.selectValueOnOpen&&inp.select()),options.onInput&&CodeMirror.on(inp,"input",function(e){options.onInput(e,inp.value,close)}),options.onKeyUp&&CodeMirror.on(inp,"keyup",function(e){options.onKeyUp(e,inp.value,close)}),CodeMirror.on(inp,"keydown",function(e){options&&options.onKeyDown&&options.onKeyDown(e,inp.value,close)||((27==e.keyCode||!1!==options.closeOnEnter&&13==e.keyCode)&&(inp.blur(),CodeMirror.e_stop(e),close()),13==e.keyCode&&callback(inp.value,e))}),!1!==options.closeOnBlur&&CodeMirror.on(inp,"blur",close)):(button=dialog.getElementsByTagName("button")[0])&&(CodeMirror.on(button,"click",function(){close(),me.focus()}),!1!==options.closeOnBlur&&CodeMirror.on(button,"blur",close),button.focus()),close}),CodeMirror.defineExtension("openConfirm",function(template,callbacks,options){function close(){closed||(closed=!0,CodeMirror.rmClass(dialog.parentNode,"dialog-opened"),dialog.parentNode.removeChild(dialog),me.focus())}closeNotification(this,null);var dialog=dialogDiv(this,template,options&&options.bottom),buttons=dialog.getElementsByTagName("button"),closed=!1,me=this,blurring=1;buttons[0].focus();for(var i=0,b;i<buttons.length;++i)b=buttons[i],function(callback){CodeMirror.on(b,"click",function(e){CodeMirror.e_preventDefault(e),close(),callback&&callback(me)})}(callbacks[i]),CodeMirror.on(b,"blur",function(){--blurring,setTimeout(function(){0>=blurring&&close()},200)}),CodeMirror.on(b,"focus",function(){++blurring})}),CodeMirror.defineExtension("openNotification",function(template,options){function close(){closed||(closed=!0,clearTimeout(doneTimer),CodeMirror.rmClass(dialog.parentNode,"dialog-opened"),dialog.parentNode.removeChild(dialog))}closeNotification(this,close);var dialog=dialogDiv(this,template,options&&options.bottom),closed=!1,duration=options&&"undefined"!=typeof options.duration?options.duration:5e3,doneTimer;return CodeMirror.on(dialog,"click",function(e){CodeMirror.e_preventDefault(e),close()}),duration&&(doneTimer=setTimeout(close,duration)),close})})},"58xA":function(module,exports,__webpack_require__){"use strict";function deepExtend(target,source){if(!(source instanceof Object))return source;switch(source.constructor){case Date:return new Date(source.getTime());case Object:void 0===target&&(target={});break;case Array:target=[];break;default:return source;}for(var prop in source)source.hasOwnProperty(prop)&&(target[prop]=deepExtend(target[prop],source[prop]));return target}function jsonEval(str){return JSON.parse(str)}function implementsAnyMethods(obj,methods){if("object"!=typeof obj||null===obj)return!1;for(var _i=0,methods_1=methods,method;_i<methods_1.length;_i++)if(method=methods_1[_i],method in obj&&"function"==typeof obj[method])return!0;return!1}function noop(){}function errorPrefix(fnName,argumentNumber,optional){var argName="";switch(argumentNumber){case 1:argName=optional?"first":"First";break;case 2:argName=optional?"second":"Second";break;case 3:argName=optional?"third":"Third";break;case 4:argName=optional?"fourth":"Fourth";break;default:throw new Error("errorPrefix called with argumentNumber > 4. Need to update it?");}var error=fnName+" failed: ";return error+=argName+" argument ",error}var _StringfromCharCode3=String.fromCharCode;Object.defineProperty(exports,"__esModule",{value:!0});var tslib_1=__webpack_require__("vCxL"),CONSTANTS={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},assert=function(assertion,message){if(!assertion)throw assertionError(message)},assertionError=function(message){return new Error("Firebase Database ("+CONSTANTS.SDK_VERSION+") INTERNAL ASSERT FAILED: "+message)},stringToByteArray=function(str){for(var out=[],p=0,i=0,c;i<str.length;i++)c=str.charCodeAt(i),128>c?out[p++]=c:2048>c?(out[p++]=192|c>>6,out[p++]=128|63&c):55296==(64512&c)&&i+1<str.length&&56320==(64512&str.charCodeAt(i+1))?(c=65536+((1023&c)<<10)+(1023&str.charCodeAt(++i)),out[p++]=240|c>>18,out[p++]=128|63&c>>12,out[p++]=128|63&c>>6,out[p++]=128|63&c):(out[p++]=224|c>>12,out[p++]=128|63&c>>6,out[p++]=128|63&c);return out},byteArrayToString=function(bytes){for(var out=[],pos=0,c=0,c1;pos<bytes.length;)if(c1=bytes[pos++],128>c1)out[c++]=_StringfromCharCode3(c1);else if(191<c1&&224>c1){var c2=bytes[pos++];out[c++]=_StringfromCharCode3((31&c1)<<6|63&c2)}else if(239<c1&&365>c1){var c2=bytes[pos++],c3=bytes[pos++],c4=bytes[pos++],u=((7&c1)<<18|(63&c2)<<12|(63&c3)<<6|63&c4)-65536;out[c++]=_StringfromCharCode3(55296+(u>>10)),out[c++]=_StringfromCharCode3(56320+(1023&u))}else{var c2=bytes[pos++],c3=bytes[pos++];out[c++]=_StringfromCharCode3((15&c1)<<12|(63&c2)<<6|63&c3)}return out.join("")},base64={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(input,opt_webSafe){if(!Array.isArray(input))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var byteToCharMap=opt_webSafe?this.byteToCharMapWebSafe_:this.byteToCharMap_,output=[],i=0;i<input.length;i+=3){var byte1=input[i],haveByte2=i+1<input.length,byte2=haveByte2?input[i+1]:0,haveByte3=i+2<input.length,byte3=haveByte3?input[i+2]:0,outByte3=(15&byte2)<<2|byte3>>6,outByte4=63&byte3;haveByte3||(outByte4=64,!haveByte2&&(outByte3=64)),output.push(byteToCharMap[byte1>>2],byteToCharMap[(3&byte1)<<4|byte2>>4],byteToCharMap[outByte3],byteToCharMap[outByte4])}return output.join("")},encodeString:function(input,opt_webSafe){return this.HAS_NATIVE_SUPPORT&&!opt_webSafe?btoa(input):this.encodeByteArray(stringToByteArray(input),opt_webSafe)},decodeString:function(input,opt_webSafe){return this.HAS_NATIVE_SUPPORT&&!opt_webSafe?atob(input):byteArrayToString(this.decodeStringToByteArray(input,opt_webSafe))},decodeStringToByteArray:function(input,opt_webSafe){this.init_();for(var charToByteMap=opt_webSafe?this.charToByteMapWebSafe_:this.charToByteMap_,output=[],i=0;i<input.length;){var byte1=charToByteMap[input.charAt(i++)],haveByte2=i<input.length,byte2=haveByte2?charToByteMap[input.charAt(i)]:0;++i;var haveByte3=i<input.length,byte3=haveByte3?charToByteMap[input.charAt(i)]:64;++i;var haveByte4=i<input.length,byte4=haveByte4?charToByteMap[input.charAt(i)]:64;if(++i,null==byte1||null==byte2||null==byte3||null==byte4)throw Error();if(output.push(byte1<<2|byte2>>4),64!=byte3){if(output.push(240&byte2<<4|byte3>>2),64!=byte4){output.push(192&byte3<<6|byte4)}}}return output},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var i=0;i<this.ENCODED_VALS.length;i++)this.byteToCharMap_[i]=this.ENCODED_VALS.charAt(i),this.charToByteMap_[this.byteToCharMap_[i]]=i,this.byteToCharMapWebSafe_[i]=this.ENCODED_VALS_WEBSAFE.charAt(i),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]]=i,i>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)]=i,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)]=i)}}},base64Decode=function(str){try{return base64.decodeString(str,!0)}catch(e){console.error("base64Decode failed: ",e)}return null},Deferred=function(){function Deferred(){var _this=this;this.promise=new Promise(function(resolve,reject){_this.resolve=resolve,_this.reject=reject})}return Deferred.prototype.wrapCallback=function(callback){var _this=this;return function(error,value){error?_this.reject(error):_this.resolve(value),"function"==typeof callback&&(_this.promise.catch(function(){}),1===callback.length?callback(error):callback(error,value))}},Deferred}(),getUA=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""},ERROR_NAME="FirebaseError",captureStackTrace=Error.captureStackTrace,FirebaseError=function(){return function(code,message){if(this.code=code,this.message=message,captureStackTrace)captureStackTrace(this,ErrorFactory.prototype.create);else try{throw Error.apply(this,arguments)}catch(err){this.name=ERROR_NAME,Object.defineProperty(this,"stack",{get:function(){return err.stack}})}}}();FirebaseError.prototype=Object.create(Error.prototype),FirebaseError.prototype.constructor=FirebaseError,FirebaseError.prototype.name=ERROR_NAME;var ErrorFactory=function(){function ErrorFactory(service,serviceName,errors){this.service=service,this.serviceName=serviceName,this.errors=errors,this.pattern=/\{\$([^}]+)}/g}return ErrorFactory.prototype.create=function(code,data){void 0===data&&(data={});var template=this.errors[code],fullCode=this.service+"/"+code,message;message=void 0===template?"Error":template.replace(this.pattern,function(match,key){var value=data[key];return void 0===value?"<"+key+"?>":value.toString()}),message=this.serviceName+": "+message+" ("+fullCode+").";var err=new FirebaseError(fullCode,message);for(var prop in data)data.hasOwnProperty(prop)&&"_"!==prop.slice(-1)&&(err[prop]=data[prop]);return err},ErrorFactory}(),decode=function(token){var header={},claims={},data={},signature="";try{var parts=token.split(".");header=jsonEval(base64Decode(parts[0])||""),claims=jsonEval(base64Decode(parts[1])||""),signature=parts[2],data=claims.d||{},delete claims.d}catch(e){}return{header:header,claims:claims,data:data,signature:signature}},forEach=function(obj,fn){for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&fn(key,obj[key])},extend=function(objTo,objFrom){return forEach(objFrom,function(key,value){objTo[key]=value}),objTo},findKey=function(obj,fn,opt_this){for(var key in obj)if(fn.call(opt_this,obj[key],key,obj))return key},Hash=function(){return function(){this.blockSize=-1}}(),Sha1=function(_super){function Sha1(){var _this=_super.call(this)||this;_this.chain_=[],_this.buf_=[],_this.W_=[],_this.pad_=[],_this.inbuf_=0,_this.total_=0,_this.blockSize=64,_this.pad_[0]=128;for(var i=1;i<_this.blockSize;++i)_this.pad_[i]=0;return _this.reset(),_this}return tslib_1.__extends(Sha1,_super),Sha1.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},Sha1.prototype.compress_=function(buf,opt_offset){opt_offset||(opt_offset=0);var W=this.W_;if("string"==typeof buf)for(var i=0;16>i;i++)W[i]=buf.charCodeAt(opt_offset)<<24|buf.charCodeAt(opt_offset+1)<<16|buf.charCodeAt(opt_offset+2)<<8|buf.charCodeAt(opt_offset+3),opt_offset+=4;else for(var i=0;16>i;i++)W[i]=buf[opt_offset]<<24|buf[opt_offset+1]<<16|buf[opt_offset+2]<<8|buf[opt_offset+3],opt_offset+=4;for(var i=16,t;80>i;i++)t=W[i-3]^W[i-8]^W[i-14]^W[i-16],W[i]=4294967295&(t<<1|t>>>31);for(var a=this.chain_[0],b=this.chain_[1],c=this.chain_[2],d=this.chain_[3],e=this.chain_[4],i=0,f,k;80>i;i++){40>i?20>i?(f=d^b&(c^d),k=1518500249):(f=b^c^d,k=1859775393):60>i?(f=b&c|d&(b|c),k=2400959708):(f=b^c^d,k=3395469782);var t=4294967295&(a<<5|a>>>27)+f+e+k+W[i];e=d,d=c,c=4294967295&(b<<30|b>>>2),b=a,a=t}this.chain_[0]=4294967295&this.chain_[0]+a,this.chain_[1]=4294967295&this.chain_[1]+b,this.chain_[2]=4294967295&this.chain_[2]+c,this.chain_[3]=4294967295&this.chain_[3]+d,this.chain_[4]=4294967295&this.chain_[4]+e},Sha1.prototype.update=function(bytes,opt_length){if(null!=bytes){void 0===opt_length&&(opt_length=bytes.length);for(var lengthMinusBlock=opt_length-this.blockSize,n=0,buf=this.buf_,inbuf=this.inbuf_;n<opt_length;){if(0==inbuf)for(;n<=lengthMinusBlock;)this.compress_(bytes,n),n+=this.blockSize;if("string"==typeof bytes){for(;n<opt_length;)if(buf[inbuf]=bytes.charCodeAt(n),++inbuf,++n,inbuf==this.blockSize){this.compress_(buf),inbuf=0;break}}else for(;n<opt_length;)if(buf[inbuf]=bytes[n],++inbuf,++n,inbuf==this.blockSize){this.compress_(buf),inbuf=0;break}}this.inbuf_=inbuf,this.total_+=opt_length}},Sha1.prototype.digest=function(){var digest=[],totalBits=8*this.total_;56>this.inbuf_?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var i=this.blockSize-1;56<=i;i--)this.buf_[i]=255&totalBits,totalBits/=256;this.compress_(this.buf_);for(var n=0,i=0;5>i;i++)for(var j=24;0<=j;j-=8)digest[n]=255&this.chain_[i]>>j,++n;return digest},Sha1}(Hash),ObserverProxy=function(){function ObserverProxy(executor,onNoObservers){var _this=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=onNoObservers,this.task.then(function(){executor(_this)}).catch(function(e){_this.error(e)})}return ObserverProxy.prototype.next=function(value){this.forEachObserver(function(observer){observer.next(value)})},ObserverProxy.prototype.error=function(error){this.forEachObserver(function(observer){observer.error(error)}),this.close(error)},ObserverProxy.prototype.complete=function(){this.forEachObserver(function(observer){observer.complete()}),this.close()},ObserverProxy.prototype.subscribe=function(nextOrObserver,error,complete){var _this=this,observer;if(void 0===nextOrObserver&&void 0===error&&void 0===complete)throw new Error("Missing Observer.");observer=implementsAnyMethods(nextOrObserver,["next","error","complete"])?nextOrObserver:{next:nextOrObserver,error:error,complete:complete},void 0===observer.next&&(observer.next=noop),void 0===observer.error&&(observer.error=noop),void 0===observer.complete&&(observer.complete=noop);var unsub=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{_this.finalError?observer.error(_this.finalError):observer.complete()}catch(e){}}),this.observers.push(observer),unsub},ObserverProxy.prototype.unsubscribeOne=function(i){void 0===this.observers||void 0===this.observers[i]||(delete this.observers[i],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},ObserverProxy.prototype.forEachObserver=function(fn){if(!this.finalized)for(var i=0;i<this.observers.length;i++)this.sendOne(i,fn)},ObserverProxy.prototype.sendOne=function(i,fn){var _this=this;this.task.then(function(){if(void 0!==_this.observers&&void 0!==_this.observers[i])try{fn(_this.observers[i])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})},ObserverProxy.prototype.close=function(err){var _this=this;this.finalized||(this.finalized=!0,void 0!==err&&(this.finalError=err),this.task.then(function(){_this.observers=void 0,_this.onNoObservers=void 0}))},ObserverProxy}();exports.assert=assert,exports.assertionError=assertionError,exports.base64=base64,exports.base64Decode=base64Decode,exports.base64Encode=function(str){var utf8Bytes=stringToByteArray(str);return base64.encodeByteArray(utf8Bytes,!0)},exports.CONSTANTS=CONSTANTS,exports.deepCopy=function(value){return deepExtend(void 0,value)},exports.deepExtend=deepExtend,exports.patchProperty=function(obj,prop,value){obj[prop]=value},exports.Deferred=Deferred,exports.getUA=getUA,exports.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA())},exports.isNodeSdk=function(){return!0===CONSTANTS.NODE_CLIENT||!0===CONSTANTS.NODE_ADMIN},exports.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},exports.ErrorFactory=ErrorFactory,exports.FirebaseError=FirebaseError,exports.patchCapture=function(captureFake){var result=captureStackTrace;return captureStackTrace=captureFake,result},exports.jsonEval=jsonEval,exports.stringify=function(data){return JSON.stringify(data)},exports.decode=decode,exports.isAdmin=function(token){var claims=decode(token).claims;return"object"==typeof claims&&!0===claims.admin},exports.issuedAtTime=function(token){var claims=decode(token).claims;return"object"==typeof claims&&claims.hasOwnProperty("iat")?claims.iat:null},exports.isValidFormat=function(token){var decoded=decode(token),claims=decoded.claims;return!!claims&&"object"==typeof claims&&claims.hasOwnProperty("iat")},exports.isValidTimestamp=function(token){var claims=decode(token).claims,now=Math.floor(new Date().getTime()/1e3),validSince,validUntil;return"object"==typeof claims&&(claims.hasOwnProperty("nbf")?validSince=claims.nbf:claims.hasOwnProperty("iat")&&(validSince=claims.iat),validUntil=claims.hasOwnProperty("exp")?claims.exp:validSince+86400),now&&validSince&&validUntil&&now>=validSince&&now<=validUntil},exports.clone=function(obj){return extend({},obj)},exports.contains=function(obj,key){return Object.prototype.hasOwnProperty.call(obj,key)},exports.every=function(obj,fn){for(var key in obj)if(Object.prototype.hasOwnProperty.call(obj,key)&&!fn(key,obj[key]))return!1;return!0},exports.extend=extend,exports.findKey=findKey,exports.findValue=function(obj,fn,opt_this){var key=findKey(obj,fn,opt_this);return key&&obj[key]},exports.forEach=forEach,exports.getAnyKey=function(obj){for(var key in obj)return key},exports.getCount=function(obj){var rv=0;for(var key in obj)rv++;return rv},exports.getValues=function(obj){var res=[],i=0;for(var key in obj)res[i++]=obj[key];return res},exports.isEmpty=function(obj){for(var key in obj)return!1;return!0},exports.isNonNullObject=function(obj){return"object"==typeof obj&&null!==obj},exports.map=function(obj,f,opt_obj){var res={};for(var key in obj)res[key]=f.call(opt_obj,obj[key],key,obj);return res},exports.safeGet=function(obj,key){if(Object.prototype.hasOwnProperty.call(obj,key))return obj[key]},exports.querystring=function(querystringParams){var params=[];return forEach(querystringParams,function(key,value){Array.isArray(value)?value.forEach(function(arrayVal){params.push(encodeURIComponent(key)+"="+encodeURIComponent(arrayVal))}):params.push(encodeURIComponent(key)+"="+encodeURIComponent(value))}),params.length?"&"+params.join("&"):""},exports.querystringDecode=function(querystring){var obj={},tokens=querystring.replace(/^\?/,"").split("&");return tokens.forEach(function(token){if(token){var key=token.split("=");obj[key[0]]=key[1]}}),obj},exports.Sha1=Sha1,exports.async=function(fn,onError){return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];Promise.resolve(!0).then(function(){fn.apply(void 0,args)}).catch(function(error){onError&&onError(error)})}},exports.createSubscribe=function(executor,onNoObservers){var proxy=new ObserverProxy(executor,onNoObservers);return proxy.subscribe.bind(proxy)},exports.errorPrefix=errorPrefix,exports.validateArgCount=function(fnName,minCount,maxCount,argCount){var argError;if(argCount<minCount?argError="at least "+minCount:argCount>maxCount&&(argError=0===maxCount?"none":"no more than "+maxCount),argError){var error=fnName+" failed: Was called with "+argCount+(1===argCount?" argument.":" arguments.")+" Expects "+argError+".";throw new Error(error)}},exports.validateCallback=function(fnName,argumentNumber,callback,optional){if((!optional||callback)&&"function"!=typeof callback)throw new Error(errorPrefix(fnName,argumentNumber,optional)+"must be a valid function.")},exports.validateContextObject=function(fnName,argumentNumber,context,optional){if((!optional||context)&&("object"!=typeof context||null===context))throw new Error(errorPrefix(fnName,argumentNumber,optional)+"must be a valid context object.")},exports.validateNamespace=function(fnName,argumentNumber,namespace,optional){if((!optional||namespace)&&"string"!=typeof namespace)throw new Error(errorPrefix(fnName,argumentNumber,optional)+"must be a valid firebase namespace.")},exports.stringLength=function(str){for(var p=0,i=0,c;i<str.length;i++)c=str.charCodeAt(i),128>c?p++:2048>c?p+=2:55296<=c&&56319>=c?(p+=4,i++):p+=3;return p},exports.stringToByteArray=function(str){for(var out=[],p=0,i=0,c;i<str.length;i++){if(c=str.charCodeAt(i),55296<=c&&56319>=c){var high=c-55296;i++,assert(i<str.length,"Surrogate pair missing trail surrogate.");var low=str.charCodeAt(i)-56320;c=65536+(high<<10)+low}128>c?out[p++]=c:2048>c?(out[p++]=192|c>>6,out[p++]=128|63&c):65536>c?(out[p++]=224|c>>12,out[p++]=128|63&c>>6,out[p++]=128|63&c):(out[p++]=240|c>>18,out[p++]=128|63&c>>12,out[p++]=128|63&c>>6,out[p++]=128|63&c)}return out}},"5E0L":function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var _createClass=function(){function defineProperties(target,props){for(var i=0,descriptor;i<props.length;i++)descriptor=props[i],descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),Snippet=function Snippet(key,value){_classCallCheck(this,Snippet),this.key=key,this.value=value},SnippetsStorage=function(){function SnippetsStorage(data){_classCallCheck(this,SnippetsStorage),this._string=new Map,this._regexp=new Map,this._disabled=!1,this.load(data)}return SnippetsStorage.prototype.disable=function(){this._disabled=!0},SnippetsStorage.prototype.enable=function(){this._disabled=!1},SnippetsStorage.prototype.set=function(key,value){var _this=this;if("string"==typeof key)key.split("|").forEach(function(k){return _this._string.set(k,new Snippet(k,value))});else if(key instanceof RegExp)this._regexp.set(key,new Snippet(key,value));else throw new Error("Unknow snippet key: "+key);return this},SnippetsStorage.prototype.get=function(key){if(!this.disabled){if(this._string.has(key))return this._string.get(key);for(var keys=Array.from(this._regexp.keys()),i=0,il=keys.length;i<il;i++)if(keys[i].test(key))return this._regexp.get(keys[i])}},SnippetsStorage.prototype.load=function(data){var _this2=this;this.reset(),data instanceof Map?data.forEach(function(value,key){return _this2.set(key,value)}):data&&"object"==typeof data&&Object.keys(data).forEach(function(key){return _this2.set(key,data[key])})},SnippetsStorage.prototype.reset=function(){this._string.clear(),this._regexp.clear()},SnippetsStorage.prototype.values=function(){if(this.disabled)return[];var string=Array.from(this._string.values()),regexp=Array.from(this._regexp.values());return string.concat(regexp)},_createClass(SnippetsStorage,[{key:"disabled",get:function(){return this._disabled}}]),SnippetsStorage}(),SnippetsRegistry=function(){function SnippetsRegistry(data){var _this3=this;_classCallCheck(this,SnippetsRegistry),this._registry=[],Array.isArray(data)?data.forEach(function(snippets,level){return _this3.add(level,snippets)}):"object"==typeof data&&this.add(data)}return SnippetsRegistry.prototype.get=function(level){for(var i=0,item;i<this._registry.length;i++)if(item=this._registry[i],item.level===level)return item.store},SnippetsRegistry.prototype.add=function(level,snippets){null!=level&&"object"==typeof level&&(snippets=level,level=0);var store=new SnippetsStorage(snippets);return this.remove(level),this._registry.push({level:level,store:store}),this._registry.sort(function(a,b){return b.level-a.level}),store},SnippetsRegistry.prototype.remove=function(data){this._registry=this._registry.filter(function(item){return item.level!==data&&item.store!==data})},SnippetsRegistry.prototype.resolve=function(name){for(var i=0,snippet;i<this._registry.length;i++)if(snippet=this._registry[i].store.get(name),snippet)return snippet},SnippetsRegistry.prototype.all=function(options){options=options||{};var result=new Map,fillResult=function(snippet){var type=snippet.key instanceof RegExp?"regexp":"string";options.type&&options.type!==type||result.has(snippet.key)||result.set(snippet.key,snippet)};return this._registry.forEach(function(item){item.store.values().forEach(fillResult)}),Array.from(result.values())},SnippetsRegistry.prototype.clear=function(){this._registry.length=0},SnippetsRegistry}();exports.default=SnippetsRegistry},"5gBI":function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){function lineIndent(cm,lineNo){var text=cm.getLine(lineNo),spaceTo=text.search(/\S/);return-1==spaceTo||/\bcomment\b/.test(cm.getTokenTypeAt(CodeMirror.Pos(lineNo,spaceTo+1)))?-1:CodeMirror.countColumn(text,null,cm.getOption("tabSize"))}CodeMirror.registerHelper("fold","indent",function(cm,start){var myIndent=lineIndent(cm,start.line);if(!(0>myIndent)){for(var lastLineInFold=null,i=start.line+1,end=cm.lastLine(),indent;i<=end;++i)if(indent=lineIndent(cm,i),-1==indent);else if(indent>myIndent)lastLineInFold=i;else break;if(lastLineInFold)return{from:CodeMirror.Pos(start.line,cm.getLine(start.line).length),to:CodeMirror.Pos(lastLineInFold,cm.getLine(lastLineInFold).length)}}})})},"6TpT":function(module){"use strict";module.exports=function(exec){try{return!!exec()}catch(e){return!0}}},"6r0S":function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){function forEach(arr,f){for(var i=0,e=arr.length;i<e;++i)f(arr[i])}function arrayContains(arr,item){if(!Array.prototype.indexOf){for(var i=arr.length;i--;)if(arr[i]===item)return!0;return!1}return-1!=arr.indexOf(item)}function scriptHint(editor,keywords,getToken,options){var cur=editor.getCursor(),token=getToken(editor,cur);if(!/\b(?:string|comment)\b/.test(token.type)){var innerMode=CodeMirror.innerMode(editor.getMode(),token.state);if("json"!==innerMode.mode.helperType){token.state=innerMode.state,/^[\w$_]*$/.test(token.string)?token.end>cur.ch&&(token.end=cur.ch,token.string=token.string.slice(0,cur.ch-token.start)):token={start:cur.ch,end:cur.ch,string:"",state:token.state,type:"."==token.string?"property":null};for(var tprop=token;"property"==tprop.type;){if(tprop=getToken(editor,Pos(cur.line,tprop.start)),"."!=tprop.string)return;if(tprop=getToken(editor,Pos(cur.line,tprop.start)),!context)var context=[];context.push(tprop)}return{list:getCompletions(token,context,keywords,options),from:Pos(cur.line,token.start),to:Pos(cur.line,token.end)}}}}function getCoffeeScriptToken(editor,cur){var token=editor.getTokenAt(cur);return cur.ch==token.start+1&&"."==token.string.charAt(0)?(token.end=token.start,token.string=".",token.type="property"):/^\.[\w$_]*$/.test(token.string)&&(token.type="property",token.start++,token.string=token.string.replace(/\./,"")),token}function forAllProps(obj,callback){if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)for(var name in obj)callback(name);else for(var o=obj;o;o=Object.getPrototypeOf(o))Object.getOwnPropertyNames(o).forEach(callback)}function getCompletions(token,context,keywords,options){function maybeAdd(str){0!=str.lastIndexOf(start,0)||arrayContains(found,str)||found.push(str)}function gatherCompletions(obj){"string"==typeof obj?forEach(stringProps,maybeAdd):obj instanceof Array?forEach(arrayProps,maybeAdd):obj instanceof Function&&forEach(funcProps,maybeAdd),forAllProps(obj,maybeAdd)}var found=[],start=token.string,global=options&&options.globalScope||window;if(context&&context.length){var obj=context.pop(),base;for(obj.type&&0===obj.type.indexOf("variable")?(options&&options.additionalContext&&(base=options.additionalContext[obj.string]),(!options||!1!==options.useGlobalScope)&&(base=base||global[obj.string])):"string"==obj.type?base="":"atom"==obj.type?base=1:"function"==obj.type&&(null!=global.jQuery&&("$"==obj.string||"jQuery"==obj.string)&&"function"==typeof global.jQuery?base=global.jQuery():null!=global._&&"_"==obj.string&&"function"==typeof global._&&(base=global._()));null!=base&&context.length;)base=base[context.pop().string];null!=base&&gatherCompletions(base)}else{for(var v=token.state.localVars;v;v=v.next)maybeAdd(v.name);for(var v=token.state.globalVars;v;v=v.next)maybeAdd(v.name);options&&!1===options.useGlobalScope||gatherCompletions(global),forEach(keywords,maybeAdd)}return found}var Pos=CodeMirror.Pos;CodeMirror.registerHelper("hint","javascript",function(editor,options){return scriptHint(editor,javascriptKeywords,function(e,cur){return e.getTokenAt(cur)},options)}),CodeMirror.registerHelper("hint","coffeescript",function(editor,options){return scriptHint(editor,coffeescriptKeywords,getCoffeeScriptToken,options)});var stringProps=["charAt","charCodeAt","indexOf","lastIndexOf","substring","substr","slice","trim","trimLeft","trimRight","toUpperCase","toLowerCase","split","concat","match","replace","search"],arrayProps=["length","concat","join","splice","push","pop","shift","unshift","slice","reverse","sort","indexOf","lastIndexOf","every","some","filter","forEach","map","reduce","reduceRight",""],funcProps=["prototype","apply","call","bind"],javascriptKeywords=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","in","import","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield"],coffeescriptKeywords=["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"]})},"7EAy":function(module,exports){"use strict";exports.__esModule=!0;var inlineElements=new Set(["a","abbr","acronym","applet","b","basefont","bdo","big","br","button","cite","code","del","dfn","em","font","i","iframe","img","input","ins","kbd","label","map","object","q","s","samp","select","small","span","strike","strong","sub","sup","textarea","tt","u","var"]),elementMap={p:"span",ul:"li",ol:"li",table:"tr",tr:"td",tbody:"tr",thead:"tr",tfoot:"tr",colgroup:"col",select:"option",optgroup:"option",audio:"source",video:"source",object:"param",map:"area"};exports.default=function(parentName){return parentName=(parentName||"").toLowerCase(),elementMap[parentName]||(inlineElements.has(parentName)?"span":"div")}},"7tlB":function(module,exports,__webpack_require__){"use strict";function afterTransform(er,data){var ts=this._transformState;ts.transforming=!1;var cb=ts.writecb;if(!cb)return this.emit("error",new Error("write callback called multiple times"));ts.writechunk=null,ts.writecb=null,null!=data&&this.push(data),cb(er);var rs=this._readableState;rs.reading=!1,(rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}function Transform(options){return this instanceof Transform?void(Duplex.call(this,options),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,options&&("function"==typeof options.transform&&(this._transform=options.transform),"function"==typeof options.flush&&(this._flush=options.flush)),this.on("prefinish",prefinish)):new Transform(options)}function prefinish(){var _this=this;"function"==typeof this._flush?this._flush(function(er,data){done(_this,er,data)}):done(this,null,null)}function done(stream,er,data){if(er)return stream.emit("error",er);if(null!=data&&stream.push(data),stream._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(stream._transformState.transforming)throw new Error("Calling transform done when still transforming");return stream.push(null)}module.exports=Transform;var Duplex=__webpack_require__("Hba+"),util=__webpack_require__("Q14w");util.inherits=__webpack_require__("4Bm0"),util.inherits(Transform,Duplex),Transform.prototype.push=function(chunk,encoding){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,chunk,encoding)},Transform.prototype._transform=function(){throw new Error("_transform() is not implemented")},Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;if(ts.writecb=cb,ts.writechunk=chunk,ts.writeencoding=encoding,!ts.transforming){var rs=this._readableState;(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}},Transform.prototype._read=function(){var ts=this._transformState;null!==ts.writechunk&&ts.writecb&&!ts.transforming?(ts.transforming=!0,this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)):ts.needTransform=!0},Transform.prototype._destroy=function(err,cb){var _this2=this;Duplex.prototype._destroy.call(this,err,function(err2){cb(err2),_this2.emit("close")})}},"7vHL":function(module,exports,__webpack_require__){"use strict";__webpack_require__("eA7g")},"8Agl":function(module,exports,__webpack_require__){"use strict";var isObject=__webpack_require__("0gyT");module.exports=function(it,S){if(!isObject(it))return it;var fn,val;if(S&&"function"==typeof(fn=it.toString)&&!isObject(val=fn.call(it)))return val;if("function"==typeof(fn=it.valueOf)&&!isObject(val=fn.call(it)))return val;if(!S&&"function"==typeof(fn=it.toString)&&!isObject(val=fn.call(it)))return val;throw TypeError("Can't convert object to primitive value")}},"8JlO":function(module,exports,__webpack_require__){"use strict";var ES6Promise=null;ES6Promise="undefined"==typeof Promise?__webpack_require__("xz3w"):Promise,module.exports={Promise:ES6Promise}},"9Uuy":function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__("dvMn"),support=__webpack_require__("untT"),ArrayReader=__webpack_require__("TCoK"),StringReader=__webpack_require__("wOgZ"),NodeBufferReader=__webpack_require__("daDe"),Uint8ArrayReader=__webpack_require__("nR4t");module.exports=function(data){var type=utils.getTypeOf(data);return utils.checkSupport(type),"string"!==type||support.uint8array?"nodebuffer"===type?new NodeBufferReader(data):support.uint8array?new Uint8ArrayReader(utils.transformTo("uint8array",data)):new ArrayReader(utils.transformTo("array",data)):new StringReader(data)}},"A9/K":function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__("tzeh").Transform},A9O4:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function consumeRepeat(stream){if(stream.eat(ASTERISK))return stream.start=stream.pos,{count:stream.eatWhile(_streamReaderUtils.isNumber)?+stream.current():null}}function consumeQuoted(stream){if((0,_streamReaderUtils.eatQuoted)(stream,opt))return stream.current().slice(1,-1)}function consumeText(stream){var start=stream.pos;if(stream.eat(TEXT_START)){for(var stack=1,ch=void 0,result="",offset=stream.pos;!stream.eof();)if(ch=stream.next(),ch===TEXT_START)stack++;else if(ch!==TEXT_END)ch===ESCAPE&&(ch=stream.next(),(ch===TEXT_START||ch===TEXT_END)&&(result+=stream.substring(offset,stream.pos-2)+String.fromCharCode(ch),offset=stream.pos));else if(stack--,!stack)return stream.start=start,result+stream.substring(offset,stream.pos-1);throw stream.pos=start,stream.error("Unable to find closing } for text start")}return null}function consumeAttributes(stream){if(!stream.eat(ATTR_OPEN))return null;for(var result=[],token=void 0,attr=void 0;!stream.eof();){if(stream.eatWhile(_streamReaderUtils.isWhiteSpace),stream.eat(ATTR_CLOSE))return result;if(null!=(token=consumeQuoted(stream)))result.push({name:null,value:token});else if(eatUnquoted(stream))token=stream.current(),reAttributeName.test(token)?(attr=parseAttributeName(token),result.push(attr),stream.eat(EQUALS)&&(null==(token=consumeQuoted(stream))?null==(token=consumeText(stream))?eatUnquoted(stream)&&(attr.value=stream.current()):(attr.value=token,attr.options={before:"{",after:"}"}):attr.value=token)):result.push({name:null,value:token});else throw stream.error("Expected attribute name")}throw stream.error("Expected closing \"]\" brace")}function parseAttributeName(name){var options={};name.charCodeAt(0)===EXCL&&(name=name.slice(1),options.implied=!0),name.charCodeAt(name.length-1)===DOT&&(name=name.slice(0,name.length-1),options.boolean=!0);var attr={name:name};return Object.keys(options).length&&(attr.options=options),attr}function eatUnquoted(stream){var start=stream.pos;if(stream.eatWhile(isUnquoted))return stream.start=start,!0}function isUnquoted(code){return!(0,_streamReaderUtils.isSpace)(code)&&!(0,_streamReaderUtils.isQuote)(code)&&code!==ATTR_OPEN&&code!==ATTR_CLOSE&&code!==EQUALS}function consumeElement(stream){for(var start=stream.pos,node=new _node4.default(eatName(stream)),next=void 0;!stream.eof();)if(stream.eat(DOT$1))node.addClass(eatName(stream));else if(stream.eat(HASH))node.setAttribute("id",eatName(stream));else if(stream.eat(SLASH)){if(node.isGroup)throw stream.backUp(1),stream.error("Unexpected self-closing indicator");node.selfClosing=!0,(next=consumeRepeat(stream))&&(node.repeat=next);break}else if(next=consumeAttributes(stream))for(var i=0,il=next.length;i<il;i++)node.setAttribute(next[i]);else if(null!==(next=consumeText(stream)))node.value=next;else if(next=consumeRepeat(stream))node.repeat=next;else break;if(start===stream.pos)throw stream.error("Unable to consume abbreviation node, unexpected "+stream.peek());return node}function eatName(stream){return stream.start=stream.pos,stream.eatWhile(isName),stream.current()}function isName(code){return(0,_streamReaderUtils.isAlphaNumeric)(code)||45===code||58===code||36===code||64===code||33===code||95===code||37===code}function parse(str){for(var stream=new _streamReader2.default(str.trim()),root=new _node4.default,ctx=root,groupStack=[],ch=void 0;!stream.eof();){if(ch=stream.peek(),ch===GROUP_START){var _node=new _node4.default;groupStack.push([_node,ctx,stream.pos]),ctx=_node,stream.next();continue}else if(ch===GROUP_END){var lastGroup=groupStack.pop();if(!lastGroup)throw stream.error("Unexpected \")\" group end");var _node2=lastGroup[0];if(ctx=lastGroup[1],stream.next(),_node2.repeat=consumeRepeat(stream))ctx.appendChild(_node2);else for(;_node2.firstChild;)ctx.appendChild(_node2.firstChild);stream.eat(OP_SIBLING);continue}var node=consumeElement(stream);if(ctx.appendChild(node),stream.eof())break;switch(stream.peek()){case OP_SIBLING:stream.next();continue;case OP_CHILD:stream.next(),ctx=node;continue;case OP_CLIMB:for(;stream.eat(OP_CLIMB);)ctx=ctx.parent||ctx;continue;}}if(groupStack.length)throw stream.pos=groupStack.pop()[2],stream.error("Expected group close");return root}function unroll(node){if(node.repeat&&node.repeat.count){for(var parent=node.parent,ix=parent.children.indexOf(node),i=0,clone;i<node.repeat.count;i++)if(clone=node.clone(!0),clone.repeat.value=i+1,clone.walk(unroll),clone.isGroup)for(;0<clone.children.length;)clone.firstChild.repeat=clone.repeat,parent.insertAt(clone.firstChild,ix++);else parent.insertAt(clone,ix++);node.parent.removeChild(node)}}exports.__esModule=!0;var _streamReaderUtils=__webpack_require__("rc1b"),_node3=__webpack_require__("aBJ1"),_node4=_interopRequireDefault(_node3),_streamReader=__webpack_require__("Lu2N"),_streamReader2=_interopRequireDefault(_streamReader),ASTERISK=42,opt={throws:!0},TEXT_START=123,TEXT_END=125,ESCAPE=92,EXCL=33,DOT=46,EQUALS=61,ATTR_OPEN=91,ATTR_CLOSE=93,reAttributeName=/^\!?[\w\-:\$@]+\.?$/,HASH=35,DOT$1=46,SLASH=47,GROUP_START=40,GROUP_END=41,OP_SIBLING=43,OP_CHILD=62,OP_CLIMB=94;exports.default=function(abbr){var tree=parse(abbr);return tree.walk(unroll),tree}},ABU1:function(module,exports,__webpack_require__){"use strict";function DataWorker(dataP){GenericWorker.call(this,"DataWorker");var self=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,dataP.then(function(data){self.dataIsReady=!0,self.data=data,self.max=data&&data.length||0,self.type=utils.getTypeOf(data),self.isPaused||self._tickAndRepeat()},function(e){self.error(e)})}var utils=__webpack_require__("dvMn"),GenericWorker=__webpack_require__("ZKdc");utils.inherits(DataWorker,GenericWorker),DataWorker.prototype.cleanUp=function(){GenericWorker.prototype.cleanUp.call(this),this.data=null},DataWorker.prototype.resume=function(){return!!GenericWorker.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,utils.delay(this._tickAndRepeat,[],this)),!0)},DataWorker.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),!this.isFinished&&(utils.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},DataWorker.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var data=null,nextIndex=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":data=this.data.substring(this.index,nextIndex);break;case"uint8array":data=this.data.subarray(this.index,nextIndex);break;case"array":case"nodebuffer":data=this.data.slice(this.index,nextIndex);}return this.index=nextIndex,this.push({data:data,meta:{percent:this.max?100*(this.index/this.max):0}})},module.exports=DataWorker},AIXc:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"),__webpack_require__("HeB0"),__webpack_require__("qqFR"),__webpack_require__("ggoL"))})(function(CodeMirror){function maybeBackup(stream,pat,style){var cur=stream.current(),close=cur.search(pat);return-1<close?stream.backUp(cur.length-close):cur.match(/<\/?$/)&&(stream.backUp(cur.length),!stream.match(pat,!1)&&stream.match(cur)),style}function getAttrRegexp(attr){var regexp=attrRegexpCache[attr];return regexp?regexp:attrRegexpCache[attr]=new RegExp("\\s+"+attr+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function getAttrValue(text,attr){var match=text.match(getAttrRegexp(attr));return match?/^\s*(.*?)\s*$/.exec(match[2])[1]:""}function getTagRegexp(tagName,anchored){return new RegExp((anchored?"^":"")+"</s*"+tagName+"s*>","i")}function addTags(from,to){for(var tag in from)for(var dest=to[tag]||(to[tag]=[]),source=from[tag],i=source.length-1;0<=i;i--)dest.unshift(source[i])}function findMatchingMode(tagInfo,tagText){for(var i=0,spec;i<tagInfo.length;i++)if(spec=tagInfo[i],!spec[0]||spec[1].test(getAttrValue(tagText,spec[0])))return spec[2]}var defaultTags={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},attrRegexpCache={};CodeMirror.defineMode("htmlmixed",function(config,parserConfig){function html(stream,state){var style=htmlMode.token(stream,state.htmlState),tag=/\btag\b/.test(style),tagName;if(tag&&!/[<>\s\/]/.test(stream.current())&&(tagName=state.htmlState.tagName&&state.htmlState.tagName.toLowerCase())&&tags.hasOwnProperty(tagName))state.inTag=tagName+" ";else if(state.inTag&&tag&&/>$/.test(stream.current())){var inTag=/^([\S]+) (.*)/.exec(state.inTag);state.inTag=null;var modeSpec=">"==stream.current()&&findMatchingMode(tags[inTag[1]],inTag[2]),mode=CodeMirror.getMode(config,modeSpec),endTagA=getTagRegexp(inTag[1],!0),endTag=getTagRegexp(inTag[1],!1);state.token=function(stream,state){return stream.match(endTagA,!1)?(state.token=html,state.localState=state.localMode=null,null):maybeBackup(stream,endTag,state.localMode.token(stream,state.localState))},state.localMode=mode,state.localState=CodeMirror.startState(mode,htmlMode.indent(state.htmlState,""))}else state.inTag&&(state.inTag+=stream.current(),stream.eol()&&(state.inTag+=" "));return style}var htmlMode=CodeMirror.getMode(config,{name:"xml",htmlMode:!0,multilineTagIndentFactor:parserConfig.multilineTagIndentFactor,multilineTagIndentPastTag:parserConfig.multilineTagIndentPastTag}),tags={},configTags=parserConfig&&parserConfig.tags,configScript=parserConfig&&parserConfig.scriptTypes;if(addTags(defaultTags,tags),configTags&&addTags(configTags,tags),configScript)for(var i=configScript.length-1;0<=i;i--)tags.script.unshift(["type",configScript[i].matches,configScript[i].mode]);return{startState:function(){var state=CodeMirror.startState(htmlMode);return{token:html,inTag:null,localMode:null,localState:null,htmlState:state}},copyState:function(state){var local;return state.localState&&(local=CodeMirror.copyState(state.localMode,state.localState)),{token:state.token,inTag:state.inTag,localMode:state.localMode,localState:local,htmlState:CodeMirror.copyState(htmlMode,state.htmlState)}},token:function(stream,state){return state.token(stream,state)},indent:function(state,textAfter,line){return!state.localMode||/^\s*<\//.test(textAfter)?htmlMode.indent(state.htmlState,textAfter):state.localMode.indent?state.localMode.indent(state.localState,textAfter,line):CodeMirror.Pass},innerMode:function(state){return{state:state.localState||state.htmlState,mode:state.localMode||htmlMode}}}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed")})},AhD2:function(){"use strict";var _Mathround=Math.round;(function(){function getRGBComponents(node){var color=getComputedStyle(node).color;if(color)try{return color.match(/(\d+), (\d+), (\d+)/).slice(1)}catch(e){return[255,255,255]}else return[255,255,255]}function createParticle(x,y,color){var p={x:x,y:y+10,alpha:1,color:color};return 1===effect?(p.size=random(2,4),p.vx=PARTICLE_VELOCITY_RANGE.x[0]+Math.random()*(PARTICLE_VELOCITY_RANGE.x[1]-PARTICLE_VELOCITY_RANGE.x[0]),p.vy=PARTICLE_VELOCITY_RANGE.y[0]+Math.random()*(PARTICLE_VELOCITY_RANGE.y[1]-PARTICLE_VELOCITY_RANGE.y[0])):2===effect&&(p.size=random(2,8),p.drag=0.92,p.vx=random(-3,3),p.vy=random(-3,3),p.wander=0.15,p.theta=random(0,360)*_MathPI/180),p}function effect1(particle){particle.vy+=PARTICLE_GRAVITY,particle.x+=particle.vx,particle.y+=particle.vy,particle.alpha*=PARTICLE_ALPHA_FADEOUT,ctx.fillStyle="rgba("+particle.color[0]+","+particle.color[1]+","+particle.color[2]+","+particle.alpha+")",ctx.fillRect(_Mathround(particle.x-1),_Mathround(particle.y-1),particle.size,particle.size)}function effect2(particle){particle.x+=particle.vx,particle.y+=particle.vy,particle.vx*=particle.drag,particle.vy*=particle.drag,particle.theta+=random(-0.5,0.5),particle.vx+=0.1*Math.sin(particle.theta),particle.vy+=0.1*Math.cos(particle.theta),particle.size*=0.96,ctx.fillStyle="rgba("+particle.color[0]+","+particle.color[1]+","+particle.color[2]+","+particle.alpha+")",ctx.beginPath(),ctx.arc(_Mathround(particle.x-1),_Mathround(particle.y-1),particle.size,0,2*_MathPI),ctx.fill()}function drawParticles(){for(var i=particles.length,particle;i--;)(particle=particles[i],!(!particle||0.01>particle.alpha||0.5>=particle.size))&&(1===effect?effect1(particle):2===effect&&effect2(particle))}function random(min,max){return max||(max=min,min=0),min+~~(Math.random()*(max-min+1))}function throttle(callback,limit){var wait=!1;return function(){wait||(callback.apply(this,arguments),wait=!0,setTimeout(function(){wait=!1},limit))}}function loop(){isActive&&(ctx.clearRect(0,0,w,h),current_time=new Date().getTime(),!lastTime&&(lastTime=current_time),dt=(current_time-lastTime)/1e3,lastTime=current_time,0<shakeTime&&(shakeTime-=dt,magnitude=shakeTime/shakeTimeMax*shakeIntensity,shakeX=random(-magnitude,magnitude),shakeY=random(-magnitude,magnitude),cmNode.style.transform="translate("+shakeX+"px,"+shakeY+"px)"),drawParticles(),requestAnimationFrame(loop))}function onCodeMirrorChange(editor,change){"+input"!==change.origin&&"+delete"!==change.origin||((!0===editor.getOption("blastCode")||void 0===editor.getOption("blastCode").shake)&&throttledShake(editor,0.3),throttledSpawnParticles(editor))}function init(editor){isActive=!0,canvas||(canvas=document.createElement("canvas"),ctx=canvas.getContext("2d"),canvas.id="code-blast-canvas",canvas.style.position="absolute",canvas.style.top=0,canvas.style.left=0,canvas.style.zIndex=1,canvas.style.pointerEvents="none",canvas.width=w,canvas.height=h,document.body.appendChild(canvas),loop()),editor.on("change",onCodeMirrorChange)}function destroy(editor){editor.off("change",onCodeMirrorChange),codemirrors.splice(codemirrors.indexOf(editor),1),codemirrors.length||(isActive=!1,canvas&&(canvas.remove(),canvas=null))}var _MathPI=Math.PI,shakeTime=0,shakeTimeMax=0,shakeIntensity=5,lastTime=0,particles=[],particlePointer=0,PARTICLE_NUM_RANGE={min:2,max:7},PARTICLE_GRAVITY=0.08,PARTICLE_ALPHA_FADEOUT=0.96,PARTICLE_VELOCITY_RANGE={x:[-1,1],y:[-3.5,-1.5]},w=window.innerWidth,h=window.innerHeight,isActive=!1,codemirrors=[],throttledShake=throttle(function(editor,time){cmNode=editor.getWrapperElement(),shakeTime=shakeTimeMax=time},100),throttledSpawnParticles=throttle(function(cm,type){var cursorPos=cm.getCursor(),pos=cm.cursorCoords(),node=document.elementFromPoint(pos.left-5,pos.top+5);type=cm.getTokenAt(cursorPos),type&&(type=type.type);for(var numParticles=random(PARTICLE_NUM_RANGE.min,PARTICLE_NUM_RANGE.max),color=getRGBComponents(node),i=numParticles;i--;)particles[particlePointer]=createParticle(pos.left+10,pos.top,color),particlePointer=(particlePointer+1)%100},100),effect,cmNode,canvas,ctx,current_time,dt,magnitude,shakeX,shakeY;CodeMirror.defineOption("blastCode",!1,function(editor,val){val?(codemirrors.push(editor),effect=val.effect||2,init(editor)):destroy(editor)})})()},AsaI:function(module,exports,__webpack_require__){"use strict";function NodejsStreamInputAdapter(filename,stream){GenericWorker.call(this,"Nodejs stream input adapter for "+filename),this._upstreamEnded=!1,this._bindStream(stream)}var utils=__webpack_require__("dvMn"),GenericWorker=__webpack_require__("ZKdc");utils.inherits(NodejsStreamInputAdapter,GenericWorker),NodejsStreamInputAdapter.prototype._bindStream=function(stream){var self=this;this._stream=stream,stream.pause(),stream.on("data",function(chunk){self.push({data:chunk,meta:{percent:0}})}).on("error",function(e){self.isPaused?this.generatedError=e:self.error(e)}).on("end",function(){self.isPaused?self._upstreamEnded=!0:self.end()})},NodejsStreamInputAdapter.prototype.pause=function(){return!!GenericWorker.prototype.pause.call(this)&&(this._stream.pause(),!0)},NodejsStreamInputAdapter.prototype.resume=function(){return!!GenericWorker.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},module.exports=NodejsStreamInputAdapter},B9y7:function(module,exports){"use strict";exports.__esModule=!0;exports.default={html:{a:"a[href]","a:link":"a[href='http://${0}']","a:mail":"a[href='mailto:${0}']","a:tel":"a[href='tel:+${0}']",abbr:"abbr[title]","acr|acronym":"acronym[title]",base:"base[href]/",basefont:"basefont/",br:"br/",frame:"frame/",hr:"hr/",bdo:"bdo[dir]","bdo:r":"bdo[dir=rtl]","bdo:l":"bdo[dir=ltr]",col:"col/",link:"link[rel=stylesheet href]/","link:css":"link[href='${1:style}.css']","link:print":"link[href='${1:print}.css' media=print]","link:favicon":"link[rel='shortcut icon' type=image/x-icon href='${1:favicon.ico}']","link:touch":"link[rel=apple-touch-icon href='${1:favicon.png}']","link:rss":"link[rel=alternate type=application/rss+xml title=RSS href='${1:rss.xml}']","link:atom":"link[rel=alternate type=application/atom+xml title=Atom href='${1:atom.xml}']","link:im|link:import":"link[rel=import href='${1:component}.html']",meta:"meta/","meta:utf":"meta[http-equiv=Content-Type content='text/html;charset=UTF-8']","meta:vp":"meta[name=viewport content='width=${1:device-width}, initial-scale=${2:1.0}']","meta:compat":"meta[http-equiv=X-UA-Compatible content='${1:IE=7}']","meta:edge":"meta:compat[content='${1:ie=edge}']","meta:redirect":"meta[http-equiv=refresh content='0; url=${1:http://example.com}']",style:"style",script:"script[!src]","script:src":"script[src]",img:"img[src alt]/","img:s|img:srcset":"img[srcset src alt]","img:z|img:sizes":"img[sizes srcset src alt]",picture:"picture","src|source":"source/","src:sc|source:src":"source[src type]","src:s|source:srcset":"source[srcset]","src:t|source:type":"source[srcset type='${1:image/}']","src:z|source:sizes":"source[sizes srcset]","src:m|source:media":"source[media='(${1:min-width: })' srcset]","src:mt|source:media:type":"source:media[type='${2:image/}']","src:mz|source:media:sizes":"source:media[sizes srcset]","src:zt|source:sizes:type":"source[sizes srcset type='${1:image/}']",iframe:"iframe[src frameborder=0]",embed:"embed[src type]/",object:"object[data type]",param:"param[name value]/",map:"map[name]",area:"area[shape coords href alt]/","area:d":"area[shape=default]","area:c":"area[shape=circle]","area:r":"area[shape=rect]","area:p":"area[shape=poly]",form:"form[action]","form:get":"form[method=get]","form:post":"form[method=post]",label:"label[for]",input:"input[type=${1:text}]/",inp:"input[name=${1} id=${1}]","input:h|input:hidden":"input[type=hidden name]","input:t|input:text":"inp[type=text]","input:search":"inp[type=search]","input:email":"inp[type=email]","input:url":"inp[type=url]","input:p|input:password":"inp[type=password]","input:datetime":"inp[type=datetime]","input:date":"inp[type=date]","input:datetime-local":"inp[type=datetime-local]","input:month":"inp[type=month]","input:week":"inp[type=week]","input:time":"inp[type=time]","input:tel":"inp[type=tel]","input:number":"inp[type=number]","input:color":"inp[type=color]","input:c|input:checkbox":"inp[type=checkbox]","input:r|input:radio":"inp[type=radio]","input:range":"inp[type=range]","input:f|input:file":"inp[type=file]","input:s|input:submit":"input[type=submit value]","input:i|input:image":"input[type=image src alt]","input:b|input:button":"input[type=button value]","input:reset":"input:button[type=reset]",isindex:"isindex/",select:"select[name=${1} id=${1}]","select:d|select:disabled":"select[disabled.]","opt|option":"option[value]",textarea:"textarea[name=${1} id=${1} cols=${2:30} rows=${3:10}]",marquee:"marquee[behavior direction]","menu:c|menu:context":"menu[type=context]","menu:t|menu:toolbar":"menu[type=toolbar]",video:"video[src]",audio:"audio[src]","html:xml":"html[xmlns=http://www.w3.org/1999/xhtml]",keygen:"keygen/",command:"command/","btn:s|button:s|button:submit":"button[type=submit]","btn:r|button:r|button:reset":"button[type=reset]","btn:d|button:d|button:disabled":"button[disabled.]","fst:d|fset:d|fieldset:d|fieldset:disabled":"fieldset[disabled.]",bq:"blockquote",fig:"figure",figc:"figcaption",pic:"picture",ifr:"iframe",emb:"embed",obj:"object",cap:"caption",colg:"colgroup",fst:"fieldset",btn:"button",optg:"optgroup",tarea:"textarea",leg:"legend",sect:"section",art:"article",hdr:"header",ftr:"footer",adr:"address",dlg:"dialog",str:"strong",prog:"progress",mn:"main",tem:"template",fset:"fieldset",datag:"datagrid",datal:"datalist",kg:"keygen",out:"output",det:"details",cmd:"command","ri:d|ri:dpr":"img:s","ri:v|ri:viewport":"img:z","ri:a|ri:art":"pic>src:m+img","ri:t|ri:type":"pic>src:t+img","!!!":"{<!DOCTYPE html>}",doc:"html[lang=${lang}]>(head>meta[charset=${charset}]+meta:vp+meta:edge+title{${1:Document}})+body","!|html:5":"!!!+doc",c:"{<!-- ${0} -->}","cc:ie":"{<!--[if IE]>${0}<![endif]-->}","cc:noie":"{<!--[if !IE]><!-->${0}<!--<![endif]-->}"},css:{"@f":"@font-face {\n\tfont-family: ${1};\n\tsrc: url(${1});\n}","@ff":"@font-face {\n\tfont-family: '${1:FontName}';\n\tsrc: url('${2:FileName}.eot');\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\n\t\t url('${2:FileName}.woff') format('woff'),\n\t\t url('${2:FileName}.ttf') format('truetype'),\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}","@i|@import":"@import url(${0});","@kf":"@keyframes ${1:identifier} {\n\t${2}\n}","@m|@media":"@media ${1:screen} {\n\t${0}\n}",ac:"align-content:flex-start|flex-end|center|space-between|space-around|stretch",ai:"align-items:flex-start|flex-end|center|baseline|stretch",anim:"animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}",animdel:"animation-delay:${1:time}",animdir:"animation-direction:normal|reverse|alternate|alternate-reverse",animdur:"animation-duration:${1:0}s",animfm:"animation-fill-mode:both|forwards|backwards",animic:"animation-iteration-count:1|infinite",animn:"animation-name",animps:"animation-play-state:running|paused",animtf:"animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})",ap:"appearance:none",as:"align-self:auto|flex-start|flex-end|center|baseline|stretch",b:"bottom",bd:"border:${1:1px} ${2:solid} ${3:#000}",bdb:"border-bottom:${1:1px} ${2:solid} ${3:#000}",bdbc:"border-bottom-color:#${1:000}",bdbi:"border-bottom-image:url(${0})",bdbk:"border-break:close",bdbli:"border-bottom-left-image:url(${0})|continue",bdblrs:"border-bottom-left-radius",bdbri:"border-bottom-right-image:url(${0})|continue",bdbrrs:"border-bottom-right-radius",bdbs:"border-bottom-style",bdbw:"border-bottom-width",bdc:"border-color:#${1:000}",bdci:"border-corner-image:url(${0})|continue",bdcl:"border-collapse:collapse|separate",bdf:"border-fit:repeat|clip|scale|stretch|overwrite|overflow|space",bdi:"border-image:url(${0})",bdl:"border-left:${1:1px} ${2:solid} ${3:#000}",bdlc:"border-left-color:#${1:000}",bdlen:"border-length",bdli:"border-left-image:url(${0})",bdls:"border-left-style",bdlw:"border-left-width",bdr:"border-right:${1:1px} ${2:solid} ${3:#000}",bdrc:"border-right-color:#${1:000}",bdri:"border-right-image:url(${0})",bdrs:"border-radius",bdrst:"border-right-style",bdrw:"border-right-width",bds:"border-style:none|hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset",bdsp:"border-spacing",bdt:"border-top:${1:1px} ${2:solid} ${3:#000}",bdtc:"border-top-color:#${1:000}",bdti:"border-top-image:url(${0})",bdtli:"border-top-left-image:url(${0})|continue",bdtlrs:"border-top-left-radius",bdtri:"border-top-right-image:url(${0})|continue",bdtrrs:"border-top-right-radius",bdts:"border-top-style",bdtw:"border-top-width",bdw:"border-width",bfv:"backface-visibility:hidden|visible",bg:"background:#${1:000}",bga:"background-attachment:fixed|scroll",bgbk:"background-break:bounding-box|each-box|continuous",bgc:"background-color:#${1:fff}",bgcp:"background-clip:padding-box|border-box|content-box|no-clip",bgi:"background-image:url(${0})",bgo:"background-origin:padding-box|border-box|content-box",bgp:"background-position:${1:0} ${2:0}",bgpx:"background-position-x",bgpy:"background-position-y",bgr:"background-repeat:no-repeat|repeat-x|repeat-y|space|round",bgsz:"background-size:contain|cover",bxsh:"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} #${5:000}|none",bxsz:"box-sizing:border-box|content-box|border-box",c:"color:#${1:000}",cl:"clear:both|left|right|none",cm:"/* ${0} */",cnt:"content:'${0}'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters({$0})",coi:"counter-increment",colm:"columns",colmc:"column-count",colmf:"column-fill",colmg:"column-gap",colmr:"column-rule",colmrc:"column-rule-color",colmrs:"column-rule-style",colmrw:"column-rule-width",colms:"column-span",colmw:"column-width",cor:"counter-reset",cp:"clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})",cps:"caption-side:top|bottom",cur:"cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text",d:"display:block|none|flex|inline-flex|inline|inline-block|list-item|run-in|compact|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group",ec:"empty-cells:show|hide",f:"font:${1:1em} ${2:sans-serif}",fef:"font-effect:none|engrave|emboss|outline",fem:"font-emphasize",femp:"font-emphasize-position:before|after",fems:"font-emphasize-style:none|accent|dot|circle|disc",ff:"font-family:serif|sans-serif|cursive|fantasy|monospace",fl:"float:left|right|none",fs:"font-style:italic|normal|oblique",fsm:"font-smoothing:antialiased|subpixel-antialiased|none",fst:"font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",fv:"font-variant:normal|small-caps",fw:"font-weight:normal|bold|bolder|lighter",fx:"flex",fxb:"flex-basis:fill|max-content|min-content|fit-content|content",fxd:"flex-direction:row|row-reverse|column|column-reverse",fxf:"flex-flow",fxg:"flex-grow",fxsh:"flex-shrink",fxw:"flex-wrap:nowrap|wrap|wrap-reverse",fz:"font-size",fza:"font-size-adjust",h:"height",jc:"justify-content:flex-start|flex-end|center|space-between|space-around",l:"left",lg:"background-image:linear-gradient(${1})",lh:"line-height",lis:"list-style",lisi:"list-style-image",lisp:"list-style-position:inside|outside",list:"list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman",lts:"letter-spacing:normal",m:"margin",mah:"max-height",mar:"max-resolution",maw:"max-width",mb:"margin-bottom",mih:"min-height",mir:"min-resolution",miw:"min-width",ml:"margin-left",mr:"margin-right",mt:"margin-top",ol:"outline",olc:"outline-color:#${1:000}|invert",olo:"outline-offset",ols:"outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset",olw:"outline-width|thin|medium|thick",op:"opacity",ord:"order",ori:"orientation:landscape|portrait",orp:"orphans",ov:"overflow:hidden|visible|hidden|scroll|auto",ovs:"overflow-style:scrollbar|auto|scrollbar|panner|move|marquee",ovx:"overflow-x:hidden|visible|hidden|scroll|auto",ovy:"overflow-y:hidden|visible|hidden|scroll|auto",p:"padding",pb:"padding-bottom",pgba:"page-break-after:auto|always|left|right",pgbb:"page-break-before:auto|always|left|right",pgbi:"page-break-inside:auto|avoid",pl:"padding-left",pos:"position:relative|absolute|relative|fixed|static",pr:"padding-right",pt:"padding-top",q:"quotes",qen:"quotes:'\\201C' '\\201D' '\\2018' '\\2019'",qru:"quotes:'\\00AB' '\\00BB' '\\201E' '\\201C'",r:"right",rsz:"resize:none|both|horizontal|vertical",t:"top",ta:"text-align:left|center|right|justify",tal:"text-align-last:left|center|right",tbl:"table-layout:fixed",td:"text-decoration:none|underline|overline|line-through",te:"text-emphasis:none|accent|dot|circle|disc|before|after",th:"text-height:auto|font-size|text-size|max-size",ti:"text-indent",tj:"text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan",to:"text-outline:${1:0} ${2:0} ${3:#000}",tov:"text-overflow:ellipsis|clip",tr:"text-replace",trf:"transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})",trfo:"transform-origin",trfs:"transform-style:preserve-3d",trs:"transition:${1:prop} ${2:time}",trsde:"transition-delay:${1:time}",trsdu:"transition-duration:${1:time}",trsp:"transition-property:${1:prop}",trstf:"transition-timing-function:${1:fn}",tsh:"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}",tt:"text-transform:uppercase|lowercase|capitalize|none",tw:"text-wrap:none|normal|unrestricted|suppress",us:"user-select:none",v:"visibility:hidden|visible|collapse",va:"vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub",w:"width",whs:"white-space:nowrap|pre|pre-wrap|pre-line|normal",whsc:"white-space-collapse:normal|keep-all|loose|break-strict|break-all",wid:"widows",wm:"writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl",wob:"word-break:normal|keep-all|break-all",wos:"word-spacing",wow:"word-wrap:none|unrestricted|suppress|break-word|normal",z:"z-index",zom:"zoom:1"},xsl:{"tm|tmatch":"xsl:template[match mode]","tn|tname":"xsl:template[name]",call:"xsl:call-template[name]",ap:"xsl:apply-templates[select mode]",api:"xsl:apply-imports",imp:"xsl:import[href]",inc:"xsl:include[href]",ch:"xsl:choose","wh|xsl:when":"xsl:when[test]",ot:"xsl:otherwise",if:"xsl:if[test]",par:"xsl:param[name]",pare:"xsl:param[name select]",var:"xsl:variable[name]",vare:"xsl:variable[name select]",wp:"xsl:with-param[name select]",key:"xsl:key[name match use]",elem:"xsl:element[name]",attr:"xsl:attribute[name]",attrs:"xsl:attribute-set[name]",cp:"xsl:copy[select]",co:"xsl:copy-of[select]",val:"xsl:value-of[select]","for|each":"xsl:for-each[select]",tex:"xsl:text",com:"xsl:comment",msg:"xsl:message[terminate=no]",fall:"xsl:fallback",num:"xsl:number[value]",nam:"namespace-alias[stylesheet-prefix result-prefix]",pres:"xsl:preserve-space[elements]",strip:"xsl:strip-space[elements]",proc:"xsl:processing-instruction[name]",sort:"xsl:sort[select order]",choose:"xsl:choose>xsl:when+xsl:otherwise",xsl:"!!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform]>{\n|}","!!!":"{<?xml version=\"1.0\" encoding=\"UTF-8\"?>}"}}},BVSg:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"),__webpack_require__("1JcR"))})(function(CodeMirror){function autoCloseGT(cm){if(cm.getOption("disableInput"))return CodeMirror.Pass;for(var ranges=cm.listSelections(),replacements=[],opt=cm.getOption("autoCloseTags"),i=0;i<ranges.length;i++){if(!ranges[i].empty())return CodeMirror.Pass;var pos=ranges[i].head,tok=cm.getTokenAt(pos),inner=CodeMirror.innerMode(cm.getMode(),tok.state),state=inner.state;if("xml"!=inner.mode.name||!state.tagName)return CodeMirror.Pass;var html="html"==inner.mode.configuration,dontCloseTags="object"==typeof opt&&opt.dontCloseTags||html&&htmlDontClose,indentTags="object"==typeof opt&&opt.indentTags||html&&htmlIndent,tagName=state.tagName;tok.end>pos.ch&&(tagName=tagName.slice(0,tagName.length-tok.end+pos.ch));var lowerTagName=tagName.toLowerCase();if(!tagName||"string"==tok.type&&(tok.end!=pos.ch||!/[\"\']/.test(tok.string.charAt(tok.string.length-1))||1==tok.string.length)||"tag"==tok.type&&"closeTag"==state.type||tok.string.indexOf("/")==tok.string.length-1||dontCloseTags&&-1<indexOf(dontCloseTags,lowerTagName)||closingTagExists(cm,tagName,pos,state,!0))return CodeMirror.Pass;var indent=indentTags&&-1<indexOf(indentTags,lowerTagName);replacements[i]={indent:indent,text:">"+(indent?"\n\n":"")+"</"+tagName+">",newPos:indent?CodeMirror.Pos(pos.line+1,0):CodeMirror.Pos(pos.line,pos.ch+1)}}for(var dontIndentOnAutoClose="object"==typeof opt&&opt.dontIndentOnAutoClose,i=ranges.length-1,info;0<=i;i--){info=replacements[i],cm.replaceRange(info.text,ranges[i].head,ranges[i].anchor,"+insert");var sel=cm.listSelections().slice(0);sel[i]={head:info.newPos,anchor:info.newPos},cm.setSelections(sel),!dontIndentOnAutoClose&&info.indent&&(cm.indentLine(info.newPos.line,null,!0),cm.indentLine(info.newPos.line+1,null,!0))}}function autoCloseCurrent(cm,typingSlash){for(var ranges=cm.listSelections(),replacements=[],head=typingSlash?"/":"</",opt=cm.getOption("autoCloseTags"),dontIndentOnAutoClose="object"==typeof opt&&opt.dontIndentOnSlash,i=0;i<ranges.length;i++){if(!ranges[i].empty())return CodeMirror.Pass;var pos=ranges[i].head,tok=cm.getTokenAt(pos),inner=CodeMirror.innerMode(cm.getMode(),tok.state),state=inner.state;if(typingSlash&&("string"==tok.type||"<"!=tok.string.charAt(0)||tok.start!=pos.ch-1))return CodeMirror.Pass;var replacement;if("xml"==inner.mode.name){if(!state.context||!state.context.tagName||closingTagExists(cm,state.context.tagName,pos,state))return CodeMirror.Pass;replacement=head+state.context.tagName}else if("htmlmixed"==cm.getMode().name&&"javascript"==inner.mode.name)replacement=head+"script";else if("htmlmixed"==cm.getMode().name&&"css"==inner.mode.name)replacement=head+"style";else return CodeMirror.Pass;">"!=cm.getLine(pos.line).charAt(tok.end)&&(replacement+=">"),replacements[i]=replacement}if(cm.replaceSelections(replacements),ranges=cm.listSelections(),!dontIndentOnAutoClose)for(var i=0;i<ranges.length;i++)(i==ranges.length-1||ranges[i].head.line<ranges[i+1].head.line)&&cm.indentLine(ranges[i].head.line)}function autoCloseSlash(cm){return cm.getOption("disableInput")?CodeMirror.Pass:autoCloseCurrent(cm,!0)}function indexOf(collection,elt){if(collection.indexOf)return collection.indexOf(elt);for(var i=0,e=collection.length;i<e;++i)if(collection[i]==elt)return i;return-1}function closingTagExists(cm,tagName,pos,state,newTag){if(!CodeMirror.scanForClosingTag)return!1;var end=Math.min(cm.lastLine()+1,pos.line+500),nextClose=CodeMirror.scanForClosingTag(cm,pos,null,end);if(!nextClose||nextClose.tag!=tagName)return!1;for(var cx=state.context,onCx=newTag?1:0;cx&&cx.tagName==tagName;cx=cx.prev)++onCx;pos=nextClose.to;for(var i=1,next;i<onCx;i++){if(next=CodeMirror.scanForClosingTag(cm,pos,null,end),!next||next.tag!=tagName)return!1;pos=next.to}return!0}CodeMirror.defineOption("autoCloseTags",!1,function(cm,val,old){if(old!=CodeMirror.Init&&old&&cm.removeKeyMap("autoCloseTags"),!!val){var map={name:"autoCloseTags"};("object"!=typeof val||val.whenClosing)&&(map["'/'"]=function(cm){return autoCloseSlash(cm)}),("object"!=typeof val||val.whenOpening)&&(map["'>'"]=function(cm){return autoCloseGT(cm)}),cm.addKeyMap(map)}});var htmlDontClose=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],htmlIndent=["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"];CodeMirror.commands.closeTag=function(cm){return autoCloseCurrent(cm)}})},BtxX:function(module){"use strict";(function(root){function noop(){}function bind(fn,thisArg){return function(){fn.apply(thisArg,arguments)}}function Promise(fn){if(!(this instanceof Promise))throw new TypeError("Promises must be constructed via new");if("function"!=typeof fn)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],doResolve(fn,this)}function handle(self,deferred){for(;3===self._state;)self=self._value;return 0===self._state?void self._deferreds.push(deferred):void(self._handled=!0,Promise._immediateFn(function(){var cb=1===self._state?deferred.onFulfilled:deferred.onRejected;if(null===cb)return void(1===self._state?resolve:reject)(deferred.promise,self._value);var ret;try{ret=cb(self._value)}catch(e){return void reject(deferred.promise,e)}resolve(deferred.promise,ret)}))}function resolve(self,newValue){try{if(newValue===self)throw new TypeError("A promise cannot be resolved with itself.");if(newValue&&("object"==typeof newValue||"function"==typeof newValue)){var then=newValue.then;if(newValue instanceof Promise)return self._state=3,self._value=newValue,void finale(self);if("function"==typeof then)return void doResolve(bind(then,newValue),self)}self._state=1,self._value=newValue,finale(self)}catch(e){reject(self,e)}}function reject(self,newValue){self._state=2,self._value=newValue,finale(self)}function finale(self){2===self._state&&0===self._deferreds.length&&Promise._immediateFn(function(){self._handled||Promise._unhandledRejectionFn(self._value)});for(var i=0,len=self._deferreds.length;i<len;i++)handle(self,self._deferreds[i]);self._deferreds=null}function Handler(onFulfilled,onRejected,promise){this.onFulfilled="function"==typeof onFulfilled?onFulfilled:null,this.onRejected="function"==typeof onRejected?onRejected:null,this.promise=promise}function doResolve(fn,self){var done=!1;try{fn(function(value){done||(done=!0,resolve(self,value))},function(reason){done||(done=!0,reject(self,reason))})}catch(ex){if(done)return;done=!0,reject(self,ex)}}var setTimeoutFunc=setTimeout;Promise.prototype["catch"]=function(onRejected){return this.then(null,onRejected)},Promise.prototype.then=function(onFulfilled,onRejected){var prom=new this.constructor(noop);return handle(this,new Handler(onFulfilled,onRejected,prom)),prom},Promise.all=function(arr){return new Promise(function(resolve,reject){function res(i,val){try{if(val&&("object"==typeof val||"function"==typeof val)){var then=val.then;if("function"==typeof then)return void then.call(val,function(val){res(i,val)},reject)}args[i]=val,0==--remaining&&resolve(args)}catch(ex){reject(ex)}}if(!arr||"undefined"==typeof arr.length)throw new TypeError("Promise.all accepts an array");var args=Array.prototype.slice.call(arr);if(0===args.length)return resolve([]);for(var remaining=args.length,i=0;i<args.length;i++)res(i,args[i])})},Promise.resolve=function(value){return value&&"object"==typeof value&&value.constructor===Promise?value:new Promise(function(resolve){resolve(value)})},Promise.reject=function(value){return new Promise(function(resolve,reject){reject(value)})},Promise.race=function(values){return new Promise(function(resolve,reject){for(var i=0,len=values.length;i<len;i++)values[i].then(resolve,reject)})},Promise._immediateFn="function"==typeof setImmediate&&function(fn){setImmediate(fn)}||function(fn){setTimeoutFunc(fn,0)},Promise._unhandledRejectionFn=function(err){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",err)},Promise._setImmediateFn=function(fn){Promise._immediateFn=fn},Promise._setUnhandledRejectionFn=function(fn){Promise._unhandledRejectionFn=fn},"undefined"!=typeof module&&module.exports?module.exports=Promise:!root.Promise&&(root.Promise=Promise)})(void 0)},C6nS:function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__("tzeh").PassThrough},Ctqd:function(module,exports){"use strict";exports.LOCAL_FILE_HEADER="PK\x03\x04",exports.CENTRAL_FILE_HEADER="PK\x01\x02",exports.CENTRAL_DIRECTORY_END="PK\x05\x06",exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",exports.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",exports.DATA_DESCRIPTOR="PK\x07\b"},DHrQ:function(module,exports,__webpack_require__){"use strict";(function(global){function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk)}function _isUint8Array(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array}function prependListener(emitter,event,fn){return"function"==typeof emitter.prependListener?emitter.prependListener(event,fn):void(emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn))}function ReadableState(options,stream){Duplex=Duplex||__webpack_require__("Hba+"),options=options||{};var isDuplex=stream instanceof Duplex;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,readableHwm=options.readableHighWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:isDuplex&&(readableHwm||0===readableHwm)?readableHwm:defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(!StringDecoder&&(StringDecoder=__webpack_require__("ES0U").StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){return Duplex=Duplex||__webpack_require__("Hba+"),this instanceof Readable?void(this._readableState=new ReadableState(options,this),this.readable=!0,options&&("function"==typeof options.read&&(this._read=options.read),"function"==typeof options.destroy&&(this._destroy=options.destroy)),Stream.call(this)):new Readable(options)}function readableAddChunk(stream,chunk,encoding,addToFront,skipChunkCheck){var state=stream._readableState;if(null===chunk)state.reading=!1,onEofChunk(stream,state);else{var er;skipChunkCheck||(er=chunkInvalid(state,chunk)),er?stream.emit("error",er):state.objectMode||chunk&&0<chunk.length?("string"!=typeof chunk&&!state.objectMode&&Object.getPrototypeOf(chunk)!==Buffer.prototype&&(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream.emit("error",new Error("stream.unshift() after end event")):addChunk(stream,state,chunk,!0):state.ended?stream.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||0!==chunk.length?addChunk(stream,state,chunk,!1):maybeReadMore(stream,state)):addChunk(stream,state,chunk,!1))):!addToFront&&(state.reading=!1)}return needMoreData(state)}function addChunk(stream,state,chunk,addToFront){state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state)}function chunkInvalid(state,chunk){var er;return _isUint8Array(chunk)||"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||0===state.length)}function computeNewHighWaterMark(n){return n>=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return 0>=n||0===state.length&&state.ended?0:state.objectMode?1:n===n?(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0)):state.flowing&&state.length?state.buffer.head.data.length:state.length}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark&&(debug("maybeReadMore read 0"),stream.read(0),len!==state.length);)len=state.length;state.readingMore=!1}function pipeOnDrain(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain),state.awaitDrain&&state.awaitDrain--,0===state.awaitDrain&&EElistenerCount(src,"data")&&(state.flowing=!0,flow(src))}}function nReadingNextTick(self){debug("readable nexttick read 0"),self.read(0)}function resume(stream,state){state.resumeScheduled||(state.resumeScheduled=!0,pna.nextTick(resume_,stream,state))}function resume_(stream,state){state.reading||(debug("resume read 0"),stream.read(0)),state.resumeScheduled=!1,state.awaitDrain=0,stream.emit("resume"),flow(stream),state.flowing&&!state.reading&&stream.read(0)}function flow(stream){var state=stream._readableState;for(debug("flow",state.flowing);state.flowing&&null!==stream.read(););}function fromList(n,state){if(0===state.length)return null;var ret;return state.objectMode?ret=state.buffer.shift():!n||n>=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return n<list.head.data.length?(ret=list.head.data.slice(0,n),list.head.data=list.head.data.slice(n)):n===list.head.data.length?ret=list.shift():ret=hasStrings?copyFromBufferString(n,list):copyFromBuffer(n,list),ret}function copyFromBufferString(n,list){var p=list.head,c=1,ret=p.data;for(n-=ret.length;p=p.next;){var str=p.data,nb=n>str.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),n-=nb,0===n){nb===str.length?(++c,list.head=p.next?p.next:list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),n-=nb,0===n){nb===buf.length?(++c,list.head=p.next?p.next:list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(0<state.length)throw new Error("\"endReadable()\" called on non-empty stream");state.endEmitted||(state.ended=!0,pna.nextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++)if(xs[i]===x)return i;return-1}var pna=__webpack_require__("Yj0v");module.exports=Readable;var isArray=__webpack_require__("REa7"),Duplex;Readable.ReadableState=ReadableState;var EE=__webpack_require__("FRpO").EventEmitter,EElistenerCount=function(emitter,type){return emitter.listeners(type).length},Stream=__webpack_require__("1ExO"),Buffer=__webpack_require__("38Wu").Buffer,OurUint8Array=global.Uint8Array||function(){},util=__webpack_require__("Q14w");util.inherits=__webpack_require__("4Bm0");var debugUtil=__webpack_require__(0),debug=void 0;debug=debugUtil&&debugUtil.debuglog?debugUtil.debuglog("stream"):function(){};var BufferList=__webpack_require__("wl+m"),destroyImpl=__webpack_require__("GRUB"),StringDecoder;util.inherits(Readable,Stream);var kProxyEvents=["error","close","destroy","pause","resume"];Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(value){this._readableState&&(this._readableState.destroyed=value)}}),Readable.prototype.destroy=destroyImpl.destroy,Readable.prototype._undestroy=destroyImpl.undestroy,Readable.prototype._destroy=function(err,cb){this.push(null),cb(err)},Readable.prototype.push=function(chunk,encoding){var state=this._readableState,skipChunkCheck;return state.objectMode?skipChunkCheck=!0:"string"==typeof chunk&&(encoding=encoding||state.defaultEncoding,encoding!==state.encoding&&(chunk=Buffer.from(chunk,encoding),encoding=""),skipChunkCheck=!0),readableAddChunk(this,chunk,encoding,!1,skipChunkCheck)},Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,!0,!1)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(enc){return StringDecoder||(StringDecoder=__webpack_require__("ES0U").StringDecoder),this._readableState.decoder=new StringDecoder(enc),this._readableState.encoding=enc,this};var MAX_HWM=8388608;Readable.prototype.read=function(n){debug("read",n),n=parseInt(n,10);var state=this._readableState,nOrig=n;if(0!==n&&(state.emittedReadable=!1),0===n&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(n=howMuchToRead(n,state),0===n&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n<state.highWaterMark)&&(doRead=!0,debug("length less than watermark",doRead)),state.ended||state.reading?(doRead=!1,debug("reading or ended",doRead)):doRead&&(debug("do read"),state.reading=!0,state.sync=!0,0===state.length&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1,!state.reading&&(n=howMuchToRead(nOrig,state)));var ret;return ret=0<n?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(!state.ended&&(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&!1===unpipeInfo.hasUnpiped&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,state.awaitDrain&&(!dest._writableState||dest._writableState.needDrain)&&ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1;var ret=dest.write(chunk);!1!==ret||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||1<state.pipesCount&&-1!==indexOf(state.pipes,dest))&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||!1!==pipeOpts.end)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?pna.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i<len;i++)dests[i].emit("unpipe",this,unpipeInfo);return this}var index=indexOf(state.pipes,dest);return-1===index?this:(state.pipes.splice(index,1),state.pipesCount-=1,1===state.pipesCount&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this,unpipeInfo),this)},Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if("data"===ev)!1!==this._readableState.flowing&&this.resume();else if("readable"===ev){var state=this._readableState;state.endEmitted||state.readableListening||(state.readableListening=state.needReadable=!0,state.emittedReadable=!1,state.reading?state.length&&emitReadable(this):pna.nextTick(nReadingNextTick,this))}return res},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.resume=function(){var state=this._readableState;return state.flowing||(debug("resume"),state.flowing=!0,resume(this,state)),this},Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Readable.prototype.wrap=function(stream){var _this=this,state=this._readableState,paused=!1;for(var i in stream.on("end",function(){if(debug("wrapped end"),state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&_this.push(chunk)}_this.push(null)}),stream.on("data",function(chunk){if((debug("wrapped data"),state.decoder&&(chunk=state.decoder.write(chunk)),!(state.objectMode&&(null===chunk||void 0===chunk)))&&(state.objectMode||chunk&&chunk.length)){var ret=_this.push(chunk);ret||(paused=!0,stream.pause())}}),stream)void 0===this[i]&&"function"==typeof stream[i]&&(this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i));for(var n=0;n<kProxyEvents.length;n++)stream.on(kProxyEvents[n],this.emit.bind(this,kProxyEvents[n]));return this._read=function(n){debug("wrapped _read",n),paused&&(paused=!1,stream.resume())},this},Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Readable._fromList=fromList}).call(exports,__webpack_require__("h6ac"))},Dxv2:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function css(tree,profile,options){options=options||{};var formatOpt=_extends({},defaultFormatOptions,options&&options.format);return(0,_outputRenderer2.default)(tree,options.field,function(outNode){var node=outNode.node,value=stringifyValue(node,formatOpt);if(node.attributes.length){var fieldValues=node.attributes.map(function(attr){return stringifyValue(attr,formatOpt)});value=injectFields(value,fieldValues)}return outNode.open=node.name&&profile.name(node.name),outNode.afterOpen=formatOpt.between,outNode.text=outNode.renderFields(value||null),!outNode.open||outNode.text&&outNode.text.endsWith(";")||(outNode.afterText=formatOpt.after),profile.get("format")&&(outNode.newline="\n",tree.lastChild!==node&&(outNode.afterText+=outNode.newline)),outNode})}function injectFields(string,values){var fieldsModel=(0,_fieldParser2.default)(string),fieldsAmount=fieldsModel.fields.length;if(fieldsAmount)for(values=values.slice(),values.length>fieldsAmount&&(values=values.slice(0,fieldsAmount-1).concat(values.slice(fieldsAmount-1).join(", ")));values.length;){var value=values.shift(),field=fieldsModel.fields.shift(),delta=value.length-field.length;fieldsModel.string=fieldsModel.string.slice(0,field.location)+value+fieldsModel.string.slice(field.location+field.length);for(var i=0,il=fieldsModel.fields.length;i<il;i++)fieldsModel.fields[i].location+=delta}return fieldsModel}function stringifyValue(node,options){return node.value&&"object"==typeof node.value&&"css-value"===node.value.type?node.value.value.map(function(token){return token&&"object"==typeof token?"color"===token.type?token.toString(options.shortHex):token.toString():token+""}).join(" "):null==node.value?"":node.value+""}function supports(syntax){return!!syntax&&syntax in syntaxFormat}function getFormat(syntax,options){var format=syntaxFormat[syntax];return"string"==typeof format&&(format=syntaxFormat[format]),_extends({},format,options&&options.format)}exports.__esModule=!0,exports.supports=void 0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_outputRenderer=__webpack_require__("iOMi"),_outputRenderer2=_interopRequireDefault(_outputRenderer),_fieldParser=__webpack_require__("R0uB"),_fieldParser2=_interopRequireDefault(_fieldParser),defaultFormatOptions={shortHex:!0,between:": ",after:";"},syntaxFormat={css:{between:": ",after:";"},scss:"css",less:"css",sass:{between:": ",after:""},stylus:{between:" ",after:""}};exports.default=function(tree,profile,syntax,options){return"object"==typeof syntax&&(options=syntax,syntax=null),supports(syntax)||(syntax="css"),options=_extends({},options,{format:getFormat(syntax,options)}),css(tree,profile,options)},exports.supports=supports},EJg2:function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function strcase(string,type){return type?"upper"===type?string.toUpperCase():string.toLowerCase():string}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},defaultOptions={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"]},Profile=function(){function Profile(options){_classCallCheck(this,Profile),this.options=_extends({},defaultOptions,options),this.quoteChar="single"===this.options.attributeQuotes?"'":"\""}return Profile.prototype.get=function(name){return this.options[name]},Profile.prototype.quote=function(str){return""+this.quoteChar+(null==str?"":str)+this.quoteChar},Profile.prototype.name=function(_name){return strcase(_name,this.options.tagCase)},Profile.prototype.attribute=function(attr){return strcase(attr,this.options.attributeCase)},Profile.prototype.isBooleanAttribute=function(attr){return attr.options.boolean||-1!==this.get("booleanAttributes").indexOf((attr.name||"").toLowerCase())},Profile.prototype.selfClose=function(){switch(this.options.selfClosingStyle){case"xhtml":return" /";case"xml":return"/";default:return"";}},Profile.prototype.indent=function(level){level=level||0;for(var output="";level--;)output+=this.options.indent;return output},Profile.prototype.isInline=function(node){return"string"==typeof node?-1!==this.get("inlineElements").indexOf(node.toLowerCase()):null==node.name?node.isTextOnly:this.isInline(node.name)},Profile.prototype.field=function(index,placeholder){return this.options.field(index,placeholder)},Profile}();exports.default=Profile},ES0U:function(module,exports,__webpack_require__){"use strict";function _normalizeEncoding(enc){if(!enc)return"utf8";for(var retried;;)switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase(),retried=!0;}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if("string"!=typeof nenc&&(Buffer.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,nb=4;break;case"utf8":this.fillLast=utf8FillLast,nb=4;break;case"base64":this.text=base64Text,this.end=base64End,nb=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd);}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer.allocUnsafe(nb)}function utf8CheckByte(byte){return 127>=byte?0:6==byte>>5?2:14==byte>>4?3:30==byte>>3?4:2==byte>>6?-1:-2}function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);return 0<=nb?(0<nb&&(self.lastNeed=nb-1),nb):--j<i||-2===nb?0:(nb=utf8CheckByte(buf[j]),0<=nb)?(0<nb&&(self.lastNeed=nb-2),nb):--j<i||-2===nb?0:(nb=utf8CheckByte(buf[j]),0<=nb?(0<nb&&(2===nb?nb=0:self.lastNeed=nb-3),nb):0)}function utf8CheckExtraBytes(self,buf){if(128!=(192&buf[0]))return self.lastNeed=0,"\uFFFD";if(1<self.lastNeed&&1<buf.length){if(128!=(192&buf[1]))return self.lastNeed=1,"\uFFFD";if(2<self.lastNeed&&2<buf.length&&128!=(192&buf[2]))return self.lastNeed=2,"\uFFFD"}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r=utf8CheckExtraBytes(this,buf,p);return void 0===r?this.lastNeed<=buf.length?(buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(buf.copy(this.lastChar,p,0,buf.length),this.lastNeed-=buf.length):r}function utf16Text(buf,i){if(0==(buf.length-i)%2){var r=buf.toString("utf16le",i);if(r){var c=r.charCodeAt(r.length-1);if(55296<=c&&56319>=c)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i,buf.length-1)}function utf16End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,end)}return r}function base64Text(buf,i){var n=(buf.length-i)%3;return 0==n?buf.toString("base64",i):(this.lastNeed=3-n,this.lastTotal=3,1==n?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i,buf.length-n))}function base64End(buf){var r=buf&&buf.length?this.write(buf):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}var Buffer=__webpack_require__("38Wu").Buffer,isEncoding=Buffer.isEncoding||function(encoding){switch(encoding=""+encoding,encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1;}};exports.StringDecoder=StringDecoder,StringDecoder.prototype.write=function(buf){if(0===buf.length)return"";var r,i;if(this.lastNeed){if(r=this.fillLast(buf),void 0===r)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<buf.length?r?r+this.text(buf,i):this.text(buf,i):r||""},StringDecoder.prototype.end=function(buf){var r=buf&&buf.length?this.write(buf):"";return this.lastNeed?r+"\uFFFD":r},StringDecoder.prototype.text=function(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString("utf8",i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i,end)},StringDecoder.prototype.fillLast=function(buf){return this.lastNeed<=buf.length?(buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length),this.lastNeed-=buf.length)}},EkFk:function(module,exports,__webpack_require__){"use strict";var _Mathfloor=Math.floor,_Mathmax=Math.max;(function(global){var _app=__webpack_require__("dP58"),_app2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_app);(function(){function l(a){return"string"==typeof a}function ba(a){return"boolean"==typeof a}function ca(){}function da(a){var b=typeof a;if("object"==b){if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";}else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ea(a){return null===a}function fa(a){return"array"==da(a)}function ha(a){var b=da(a);return"array"==b||"object"==b&&"number"==typeof a.length}function n(a){return"function"==da(a)}function q(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ka(a){return a.call.apply(a.bind,arguments)}function ma(a,b){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(c,d),a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function r(){return r=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ka:ma,r.apply(null,arguments)}function na(a){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();return b.push.apply(b,arguments),a.apply(this,b)}}function t(a,b){function c(){}c.prototype=b.prototype,a.nb=b.prototype,a.prototype=new c,a.prototype.constructor=a,a.dd=function(a,c){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}}function pa(a){a.prototype.then=a.prototype.then,a.prototype.$goog_Thenable=!0}function qa(a){if(!a)return!1;try{return!!a.$goog_Thenable}catch(b){return!1}}function u(a){if(Error.captureStackTrace)Error.captureStackTrace(this,u);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=a+"")}function ra(a,b){a=a.split("%s");for(var c="",d=a.length-1,e=0;e<d;e++)c+=a[e]+(e<b.length?b[e]:"%s");u.call(this,c+a[d])}function sa(a){throw new ra("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1))}function ta(a,b){this.c=a,this.f=b,this.b=0,this.a=null}function ua(a,b){a.f(b),100>a.b&&(a.b++,b.next=a.a,a.a=b)}function va(){this.b=this.a=null}function ya(){var a=za,b=null;return a.a&&(b=a.a,a.a=a.a.next,a.a||(a.b=null),b.next=null),b}function wa(){this.next=this.b=this.a=null}function Ba(a,b){var c=a.length,d=l(a)?a.split(""):a;for(--c;0<=c;--c)c in d&&b.call(void 0,d[c],c,a)}function Ea(a){a:{for(var b=Fa,c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:l(a)?a.charAt(b):a[b]}function Ga(a,b){return 0<=Aa(a,b)}function Ha(a,b){b=Aa(a,b);var c;return(c=0<=b)&&Array.prototype.splice.call(a,b,1),c}function w(a,b){var c=0;Ba(a,function(d,e){b.call(void 0,d,e,a)&&1==Array.prototype.splice.call(a,e,1).length&&c++})}function Ia(){return Array.prototype.concat.apply([],arguments)}function Ja(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]}function Ka(a){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")}function Ma(a){return Na.test(a)?(-1!=a.indexOf("&")&&(a=a.replace(Oa,"&")),-1!=a.indexOf("<")&&(a=a.replace(Pa,"<")),-1!=a.indexOf(">")&&(a=a.replace(Qa,">")),-1!=a.indexOf("\"")&&(a=a.replace(Ra,""")),-1!=a.indexOf("'")&&(a=a.replace(Sa,"'")),-1!=a.indexOf("\0")&&(a=a.replace(Ta,"�")),a):a}function y(a,b){return-1!=a.indexOf(b)}function Ua(a,b){return a<b?-1:a>b?1:0}function z(a){return y(Va,a)}function Ya(a,b){for(var c in a)b.call(void 0,a[c],c,a)}function Za(a){for(var b in a)return!1;return!0}function $a(a){var b={},c;for(c in a)b[c]=a[c];return b}function bb(a){for(var e=1,c,d;e<arguments.length;e++){for(c in d=arguments[e],d)a[c]=d[c];for(var f=0;f<ab.length;f++)c=ab[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}}function cb(a){k.setTimeout(function(){throw a},0)}function fb(){var a=k.MessageChannel;if("undefined"==typeof a&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!z("Presto")&&(a=function(){var a=document.createElement("IFRAME");a.style.display="none",a.src="",document.documentElement.appendChild(a);var b=a.contentWindow;a=b.document,a.open(),a.write(""),a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+"//"+b.location.host;a=r(function(a){("*"==d||a.origin==d)&&a.data==c&&this.port1.onmessage()},this),b.addEventListener("message",a,!1),this.port1={},this.port2={postMessage:function(){b.postMessage(c,d)}}}),"undefined"!=typeof a&&!z("Trident")&&!z("MSIE")){var b=new a,c={},d=c;return b.port1.onmessage=function(){if(void 0!==c.next){c=c.next;var a=c.vb;c.vb=null,a()}},function(a){d.next={vb:a},d=d.next,b.port2.postMessage(0)}}return"undefined"!=typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?function(a){var b=document.createElement("SCRIPT");b.onreadystatechange=function(){b.onreadystatechange=null,b.parentNode.removeChild(b),b=null,a(),a=null},document.documentElement.appendChild(b)}:function(a){k.setTimeout(a,0)}}function gb(a,b){hb||ib(),jb||(hb(),jb=!0),za.add(a,b)}function ib(){if(k.Promise&&k.Promise.resolve){var a=k.Promise.resolve(void 0);hb=function(){a.then(kb)}}else hb=function(){var a=kb;!n(k.setImmediate)||k.Window&&k.Window.prototype&&!z("Edge")&&k.Window.prototype.setImmediate==k.setImmediate?(eb||(eb=fb()),eb(a)):k.setImmediate(a)}}function kb(){for(var a;a=ya();){try{a.a.call(a.b)}catch(b){cb(b)}ua(xa,a)}jb=!1}function A(a,b){if(this.a=lb,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,a!=ca)try{var c=this;a.call(b,function(a){mb(c,nb,a)},function(a){if(!(a instanceof ob))try{if(a instanceof Error)throw a;throw Error("Promise rejected.")}catch(e){}mb(c,pb,a)})}catch(d){mb(this,pb,d)}}function qb(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}function sb(a,b,c){var d=rb.get();return d.g=a,d.b=b,d.f=c,d}function B(a){if(a instanceof A)return a;var b=new A(ca);return mb(b,nb,a),b}function C(a){return new A(function(b,c){c(a)})}function tb(a,b,c){ub(a,b,c,null)||gb(na(b,a))}function vb(a){return new A(function(b,c){var d=a.length,e=[];if(d)for(var f=function(a,c){d--,e[a]=c,0==d&&b(e)},h=function(a){c(a)},m=0,p;m<a.length;m++)p=a[m],tb(p,na(f,m),h);else b(e)})}function wb(a){return new A(function(b){var c=a.length,d=[];if(c)for(var e=function(a,_e,f){c--,d[a]=_e?{Cb:!0,value:f}:{Cb:!1,reason:f},0==c&&b(d)},f=0,h;f<a.length;f++)h=a[f],tb(h,na(e,f,!0),na(e,f,!1));else b(d)})}function zb(a,b){if(a.a==lb)if(a.c){var c=a.c;if(c.b){for(var d=0,e=null,f=null,h=c.b;h&&(h.c||(d++,h.a==a&&(e=h),!(e&&1<d)));h=h.next)e||(f=h);e&&(c.a==lb&&1==d?zb(c,b):(f?(d=f,d.next==c.f&&(c.f=d),d.next=d.next.next):Ab(c),Bb(c,e,pb,b)))}a.c=null}else mb(a,pb,b)}function yb(a,b){a.b||a.a!=nb&&a.a!=pb||Cb(a),a.f?a.f.next=b:a.b=b,a.f=b}function xb(a,b,c,d){var e=sb(null,null,null);return e.a=new A(function(a,h){e.g=b?function(c){try{var e=b.call(d,c);a(e)}catch(x){h(x)}}:a,e.b=c?function(b){try{var e=c.call(d,b);void 0===e&&b instanceof ob?h(b):a(e)}catch(x){h(x)}}:h}),e.a.c=a,yb(a,e),e.a}function mb(a,b,c){a.a==lb&&(a===c&&(b=pb,c=new TypeError("Promise cannot resolve to itself")),a.a=1,ub(c,a.Mc,a.Nc,a)||(a.i=c,a.a=b,a.c=null,Cb(a),b!=pb||c instanceof ob||Db(a,c)))}function ub(a,b,c,d){if(a instanceof A)return yb(a,sb(b||ca,c||null,d)),!0;if(qa(a))return a.then(b,c,d),!0;if(q(a))try{var e=a.then;if(n(e))return Eb(a,e,b,c,d),!0}catch(f){return c.call(d,f),!0}return!1}function Eb(a,b,c,d,e){function f(a){m||(m=!0,d.call(e,a))}function h(a){m||(m=!0,c.call(e,a))}var m=!1;try{b.call(a,h,f)}catch(p){f(p)}}function Cb(a){a.h||(a.h=!0,gb(a.Xb,a))}function Ab(a){var b=null;return a.b&&(b=a.b,a.b=b.next,b.next=null),a.b||(a.f=null),b}function Bb(a,b,c,d){if(c==pb&&b.b&&!b.c)for(;a&&a.g;a=a.c)a.g=!1;if(b.a)b.a.c=null,Fb(b,c,d);else try{b.c?b.g.call(b.f):Fb(b,c,d)}catch(e){Gb.call(null,e)}ua(rb,b)}function Fb(a,b,c){b==nb?a.g.call(a.f,c):a.b&&a.b.call(a.f,c)}function Db(a,b){a.g=!0,gb(function(){a.g&&Gb.call(null,b)})}function ob(a){u.call(this,a)}function Hb(){0!=Ib&&(Jb[this[ia]||(this[ia]=++ja)]=this),this.pa=this.pa,this.ja=this.ja}function Kb(){}function Lb(a){return Lb[" "](a),a}function Mb(a,b){var c=Nb;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)}function Ub(){var a=k.document;return a?a.documentMode:void 0}function Zb(a){return Mb(a,function(){for(var b=0,c=La(Vb+"").split("."),d=La(a+"").split("."),e=_Mathmax(c.length,d.length),f=0;0==b&&f<e;f++){var h=c[f]||"",m=d[f]||"";do{if(h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""],m=/(\d*)(\D*)(.*)/.exec(m)||["","","",""],0==h[0].length&&0==m[0].length)break;b=Ua(0==h[1].length?0:parseInt(h[1],10),0==m[1].length?0:parseInt(m[1],10))||Ua(0==h[2].length,0==m[2].length)||Ua(h[2],m[2]),h=h[3],m=m[3]}while(0==b)}return 0<=b})}function D(a,b){this.type=a,this.b=this.target=b,this.Jb=!0}function fc(a,b){if(D.call(this,a?a.type:""),this.relatedTarget=this.b=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.a=null,a){var c=this.type=a.type,d=a.changedTouches?a.changedTouches[0]:null;if(this.target=a.target||a.srcElement,this.b=b,!(b=a.relatedTarget))"mouseover"==c?b=a.fromElement:"mouseout"==c&&(b=a.toElement);else if(Sb){a:{try{Lb(b.nodeName);var e=!0;break a}catch(f){}e=!1}e||(b=null)}this.relatedTarget=b,null===d?(this.clientX=void 0===a.clientX?a.pageX:a.clientX,this.clientY=void 0===a.clientY?a.pageY:a.clientY,this.screenX=a.screenX||0,this.screenY=a.screenY||0):(this.clientX=void 0===d.clientX?d.pageX:d.clientX,this.clientY=void 0===d.clientY?d.pageY:d.clientY,this.screenX=d.screenX||0,this.screenY=d.screenY||0),this.button=a.button,this.key=a.key||"",this.ctrlKey=a.ctrlKey,this.altKey=a.altKey,this.shiftKey=a.shiftKey,this.metaKey=a.metaKey,this.pointerId=a.pointerId||0,this.pointerType=l(a.pointerType)?a.pointerType:gc[a.pointerType]||"",this.a=a,a.defaultPrevented&&this.preventDefault()}}function jc(a,b,c,d,e){this.listener=a,this.proxy=null,this.src=b,this.type=c,this.capture=!!d,this.La=e,this.key=++ic,this.na=this.Ia=!1}function kc(a){a.na=!0,a.listener=null,a.proxy=null,a.src=null,a.La=null}function lc(a){this.src=a,this.a={},this.b=0}function nc(a,b){var c=b.type;c in a.a&&Ha(a.a[c],b)&&(kc(b),0==a.a[c].length&&(delete a.a[c],a.b--))}function mc(a,b,c,d){for(var e=0,f;e<a.length;++e)if(f=a[e],!f.na&&f.listener==b&&f.capture==!!c&&f.La==d)return e;return-1}function rc(a,b,c,d,e){if(d&&d.once)sc(a,b,c,d,e);else if(fa(b))for(var f=0;f<b.length;f++)rc(a,b[f],c,d,e);else c=tc(c),a&&a[hc]?uc(a,b,c,q(d)?!!d.capture:!!d,e):vc(a,b,c,!1,d,e)}function vc(a,b,c,d,e,f){if(!b)throw Error("Invalid event type");var h=q(e)?!!e.capture:!!e,m=wc(a);if(m||(a[oc]=m=new lc(a)),c=m.add(b,c,d,h,f),!c.proxy){if(d=xc(),c.proxy=d,d.src=a,d.listener=c,a.addEventListener)ec||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(yc(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error("addEventListener and attachEvent are unavailable.");qc++}}function xc(){var a=zc,b=cc?function(c){return a.call(b.src,b.listener,c)}:function(c){if(c=a.call(b.src,b.listener,c),!c)return c};return b}function sc(a,b,c,d,e){if(fa(b))for(var f=0;f<b.length;f++)sc(a,b[f],c,d,e);else c=tc(c),a&&a[hc]?Ac(a,b,c,q(d)?!!d.capture:!!d,e):vc(a,b,c,!0,d,e)}function E(a,b,c,d,e){if(fa(b))for(var f=0;f<b.length;f++)E(a,b[f],c,d,e);else(d=q(d)?!!d.capture:!!d,c=tc(c),a&&a[hc])?(a=a.l,b=(b+"").toString(),b in a.a&&(f=a.a[b],c=mc(f,c,d,e),-1<c&&(kc(f[c]),Array.prototype.splice.call(f,c,1),0==f.length&&(delete a.a[b],a.b--)))):a&&(a=wc(a))&&(b=a.a[b.toString()],a=-1,b&&(a=mc(b,c,d,e)),(c=-1<a?b[a]:null)&&Bc(c))}function Bc(a){if("number"!=typeof a&&a&&!a.na){var b=a.src;if(b&&b[hc])nc(b.l,a);else{var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(yc(c),d):b.addListener&&b.removeListener&&b.removeListener(d),qc--,(c=wc(b))?(nc(c,a),0==c.b&&(c.src=null,b[oc]=null)):kc(a)}}}function yc(a){return a in pc?pc[a]:pc[a]="on"+a}function Cc(a,b,c,d){var e=!0;if((a=wc(a))&&(b=a.a[b.toString()]))for(b=b.concat(),a=0;a<b.length;a++){var f=b[a];f&&f.capture==c&&!f.na&&(f=Dc(f,d),e=e&&!1!==f)}return e}function Dc(a,b){var c=a.listener,d=a.La||a.src;return a.Ia&&Bc(a),c.call(d,b)}function zc(a,b){if(a.na)return!0;if(!cc){if(!b)a:{b=["window","event"];for(var c=k,d=0;d<b.length;d++)if(c=c[b[d]],null==c){b=null;break a}b=c}if(d=b,b=new fc(d,this),c=!0,!(0>d.keyCode||void 0!=d.returnValue)){a:{var e=!1;if(0==d.keyCode)try{d.keyCode=-1;break a}catch(h){e=!0}(e||void 0==d.returnValue)&&(d.returnValue=!0)}for(d=[],e=b.b;e;e=e.parentNode)d.push(e);for(a=a.type,e=d.length-1;0<=e;e--){b.b=d[e];var f=Cc(d[e],a,!0,b);c=c&&f}for(e=0;e<d.length;e++)b.b=d[e],f=Cc(d[e],a,!1,b),c=c&&f}return c}return Dc(a,new fc(b,this))}function wc(a){return a=a[oc],a instanceof lc?a:null}function tc(a){return n(a)?a:(a[Ec]||(a[Ec]=function(b){return a.handleEvent(b)}),a[Ec])}function F(){Hb.call(this),this.l=new lc(this),this.Qb=this,this.Ua=null}function uc(a,b,c,d,e){a.l.add(b+"",c,!1,d,e)}function Ac(a,b,c,d,e){a.l.add(b+"",c,!0,d,e)}function Fc(a,b,c,d){if(b=a.l.a[b+""],!b)return!0;b=b.concat();for(var e=!0,f=0,h;f<b.length;++f)if(h=b[f],h&&!h.na&&h.capture==c){var m=h.listener,p=h.La||h.src;h.Ia&&nc(a.l,h),e=!1!==m.call(p,d)&&e}return e&&0!=d.Jb}function Gc(a,b,c){if(n(a))c&&(a=r(a,c));else if(a&&"function"==typeof a.handleEvent)a=r(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<+b?-1:k.setTimeout(a,b||0)}function Hc(a){var b=null;return new A(function(c,d){b=Gc(function(){c(void 0)},a),-1==b&&d(Error("Failed to schedule timer."))}).s(function(a){throw k.clearTimeout(b),a})}function Ic(a){if(a.S&&"function"==typeof a.S)return a.S();if(l(a))return a.split("");if(ha(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}for(d in b=[],c=0,a)b[c++]=a[d];return b}function Jc(a){if(a.U&&"function"==typeof a.U)return a.U();if(!a.S||"function"!=typeof a.S){if(ha(a)||l(a)){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}for(var d in b=[],c=0,a)b[c++]=d;return b}}function Kc(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0);else if(ha(a)||l(a))v(a,b,void 0);else for(var c=Jc(a),d=Ic(a),e=d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}function Lc(a){this.b={},this.a=[],this.c=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a)if(a instanceof Lc)for(c=a.U(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d])}function Mc(a){if(a.c!=a.a.length){for(var b=0,c=0,d;b<a.a.length;)d=a.a[b],Nc(a.b,d)&&(a.a[c++]=d),b++;a.a.length=c}if(a.c!=a.a.length){var e={};for(c=b=0;b<a.a.length;)d=a.a[b],Nc(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}}function Nc(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function Pc(a,b){if(a){a=a.split("&");for(var c=0;c<a.length;c++){var d=a[c].indexOf("="),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1)}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\+/g," ")):"")}}}function Qc(a,b){if(this.b=this.l=this.c="",this.i=null,this.h=this.g="",this.f=!1,a instanceof Qc){this.f=void 0===b?a.f:b,Rc(this,a.c),this.l=a.l,this.b=a.b,Sc(this,a.i),this.g=a.g,b=a.a;var c=new Tc;c.c=b.c,b.a&&(c.a=new Lc(b.a),c.b=b.b),Uc(this,c),this.h=a.h}else a&&(c=(a+"").match(Oc))?(this.f=!!b,Rc(this,c[1]||"",!0),this.l=Vc(c[2]||""),this.b=Vc(c[3]||"",!0),Sc(this,c[4]),this.g=Vc(c[5]||"",!0),Uc(this,c[6]||"",!0),this.h=Vc(c[7]||"")):(this.f=!!b,this.a=new Tc(null,this.f))}function Rc(a,b,c){a.c=c?Vc(b,!0):b,a.c&&(a.c=a.c.replace(/:$/,""))}function Sc(a,b){if(b){if(b=+b,isNaN(b)||0>b)throw Error("Bad port number "+b);a.i=b}else a.i=null}function Uc(a,b,c){b instanceof Tc?(a.a=b,ad(a.a,a.f)):(c||(b=Wc(b,bd)),a.a=new Tc(b,a.f))}function G(a,b,c){a.a.set(b,c)}function cd(a,b){return a.a.get(b)}function dd(a){return a instanceof Qc?new Qc(a):new Qc(a,void 0)}function ed(a,b){var c=new Qc(null,void 0);return Rc(c,"https"),a&&(c.b=a),b&&(c.g=b),c}function Vc(a,b){return a?b?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""}function Wc(a,b,c){return l(a)?(a=encodeURI(a).replace(b,fd),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function fd(a){return a=a.charCodeAt(0),"%"+(15&a>>4).toString(16)+(15&a).toString(16)}function Tc(a,b){this.b=this.a=null,this.c=a||null,this.f=!!b}function gd(a){a.a||(a.a=new Lc,a.b=0,a.c&&Pc(a.c,function(b,c){a.add(decodeURIComponent(b.replace(/\+/g," ")),c)}))}function hd(a){var b=Jc(a);if("undefined"==typeof b)throw Error("Keys are undefined");var c=new Tc(null,void 0);a=Ic(a);for(var d=0;d<b.length;d++){var e=b[d],f=a[d];fa(f)?id(c,e,f):c.add(e,f)}return c}function kd(a,b){gd(a),b=jd(a,b),Nc(a.a.b,b)&&(a.c=null,a.b-=a.a.get(b).length,a=a.a,Nc(a.b,b)&&(delete a.b[b],a.c--,a.a.length>2*a.c&&Mc(a)))}function ld(a,b){return gd(a),b=jd(a,b),Nc(a.a.b,b)}function id(a,b,c){kd(a,b),0<c.length&&(a.c=null,a.a.set(jd(a,b),Ja(c)),a.b+=c.length)}function jd(a,b){return b+="",a.f&&(b=b.toLowerCase()),b}function ad(a,b){b&&!a.f&&(gd(a),a.c=null,a.a.forEach(function(a,b){var c=b.toLowerCase();b!=c&&(kd(this,b),id(this,c,a))},a)),a.f=b}function nd(){this.a="",this.b=od}function pd(a){return a instanceof nd&&a.constructor===nd&&a.b===od?a.a:(sa("expected object of type Const, got '"+a+"'"),"type_error:Const")}function qd(a){var b=new nd;return b.a=a,b}function rd(){this.a="",this.b=sd}function td(a){return a instanceof rd&&a.constructor===rd&&a.b===sd?a.a:(sa("expected object of type TrustedResourceUrl, got '"+a+"' of type "+da(a)),"type_error:TrustedResourceUrl")}function ud(a,b){var c=pd(a);if(!vd.test(c))throw Error("Invalid TrustedResourceUrl format: "+c);return a=c.replace(wd,function(a,e){if(!Object.prototype.hasOwnProperty.call(b,e))throw Error("Found marker, \""+e+"\", in format string, \""+c+"\", but no valid label mapping found in args: "+JSON.stringify(b));return a=b[e],a instanceof nd?pd(a):encodeURIComponent(a+"")}),xd(a)}function xd(a){var b=new rd;return b.a=a,b}function yd(){this.a="",this.b=zd}function Ad(a){return a instanceof yd&&a.constructor===yd&&a.b===zd?a.a:(sa("expected object of type SafeUrl, got '"+a+"' of type "+da(a)),"type_error:SafeUrl")}function Cd(a){return a instanceof yd?a:(a=a.ma?a.la():a+"",Bd.test(a)||(a="about:invalid#zClosurez"),Dd(a))}function Dd(a){var b=new yd;return b.a=a,b}function Ed(){this.a="",this.b=Fd}function Gd(a){return a instanceof Ed&&a.constructor===Ed&&a.b===Fd?a.a:(sa("expected object of type SafeHtml, got '"+a+"' of type "+da(a)),"type_error:SafeHtml")}function Hd(a){var b=new Ed;return b.a=a,b}function Id(a){var b=document;return l(a)?b.getElementById(a):a}function Jd(a,b){Ya(b,function(b,d){b&&b.ma&&(b=b.la()),"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:Kd.hasOwnProperty(d)?a.setAttribute(Kd[d],b):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,b):a[d]=b})}function Ld(){var d=arguments,e=document,f=d[0]+"",h=d[1];if(!md&&h&&(h.name||h.type)){if(f=["<",f],h.name&&f.push(" name=\"",Ma(h.name),"\""),h.type){f.push(" type=\"",Ma(h.type),"\"");var m={};bb(m,h),delete m.type,h=m}f.push(">"),f=f.join("")}return f=e.createElement(f),h&&(l(h)?f.className=h:fa(h)?f.className=h.join(" "):Jd(f,h)),2<d.length&&Md(e,f,d),f}function Md(a,b,c){function d(c){c&&b.appendChild(l(c)?a.createTextNode(c):c)}for(var e=2,f;e<c.length;e++)f=c[e],!ha(f)||q(f)&&0<f.nodeType?d(f):v(Nd(f)?Ja(f):f,d)}function Nd(a){if(a&&"number"==typeof a.length){if(q(a))return"function"==typeof a.item||"string"==typeof a.item;if(n(a))return"function"==typeof a.item}return!1}function Od(a){var b=[];return Pd(new Qd,a,b),b.join("")}function Qd(){}function Pd(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if(fa(b)){var d=b;b=d.length,c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Pd(a,d[f],c),e=",";return void c.push("]")}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{for(d in c.push("{"),e="",b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Rd(d,c),c.push(":"),Pd(a,f,c),e=","));return void c.push("}")}}switch(typeof b){case"string":Rd(b,c);break;case"number":c.push(isFinite(b)&&!isNaN(b)?b+"":"null");break;case"boolean":c.push(b+"");break;case"function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}function Rd(a,b){b.push("\"",a.replace(Td,function(a){var b=Sd[a];return b||(b="\\u"+(65536|a.charCodeAt(0)).toString(16).substr(1),Sd[a]=b),b}),"\"")}function Ud(){var a=H();return Pb&&!!$b&&11==$b||/Edge\/\d+/.test(a)}function Vd(){return k.window&&k.window.location.href||self&&self.location&&self.location.href||""}function Wd(a,b){b=b||k.window;var c="about:blank";a&&(c=Ad(Cd(a))),b.location.href=c}function Xd(a,b){var c=[],d;for(d in a)d in b?typeof a[d]==typeof b[d]?"object"==typeof a[d]&&null!=a[d]&&null!=b[d]?0<Xd(a[d],b[d]).length&&c.push(d):a[d]!==b[d]&&c.push(d):c.push(d):c.push(d);for(d in b)d in a||c.push(d);return c}function Yd(){var a=H();return a=Zd(a)==$d?(a=a.match(/\sChrome\/(\d+)/i))&&2==a.length?parseInt(a[1],10):null:null,a&&30>a?!1:!Pb||!$b||9<$b}function ae(a){return a=(a||H()).toLowerCase(),a.match(/android/)||a.match(/webos/)||a.match(/iphone|ipad|ipod/)||a.match(/blackberry/)||a.match(/windows phone/)||a.match(/iemobile/)}function be(a){a=a||k.window;try{a.close()}catch(b){}}function ce(a,b,c){var d=_Mathfloor(1E9*Math.random()).toString();b=b||500,c=c||600;var e=(window.screen.availHeight-c)/2,f=(window.screen.availWidth-b)/2;for(h in b={width:b,height:c,top:0<e?e:0,left:0<f?f:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},c=H().toLowerCase(),d&&(b.target=d,y(c,"crios/")&&(b.target="_blank")),Zd(H())==de&&(a=a||"http://localhost",b.scrollbars=!0),c=a||"",(a=b)||(a={}),d=window,b=c instanceof yd?c:Cd("undefined"==typeof c.href?c+"":c.href),c=a.target||c.target,e=[],a)switch(h){case"width":case"height":case"top":case"left":e.push(h+"="+a[h]);break;case"target":case"noopener":case"noreferrer":break;default:e.push(h+"="+(a[h]?1:0));}var h=e.join(",");if((z("iPhone")&&!z("iPod")&&!z("iPad")||z("iPad")||z("iPod"))&&d.navigator&&d.navigator.standalone&&c&&"_self"!=c?(h=d.document.createElement("A"),b instanceof yd||b instanceof yd||(b=b.ma?b.la():b+"",Bd.test(b)||(b="about:invalid#zClosurez"),b=Dd(b)),h.href=Ad(b),h.setAttribute("target",c),a.noreferrer&&h.setAttribute("rel","noreferrer"),a=document.createEvent("MouseEvent"),a.initMouseEvent("click",!0,!0,d,1),h.dispatchEvent(a),h={}):a.noreferrer?(h=d.open("",c,h),a=Ad(b),h&&(Rb&&y(a,";")&&(a="'"+a.replace(/'/g,"%27")+"'"),h.opener=null,qd("b/12014412, meta tag with sanitized URL"),a="<meta name=\"referrer\" content=\"no-referrer\"><meta http-equiv=\"refresh\" content=\"0; url="+Ma(a)+"\">",a=Hd(a),h.document.write(Gd(a)),h.document.close())):(h=d.open(Ad(b),c,h))&&a.noopener&&(h.opener=null),h)try{h.focus()}catch(m){}return h}function ee(a){return new A(function(b){function c(){Hc(2E3).then(function(){return!a||a.closed?void b():c()})}return c()})}function ge(){var a=null;return new A(function(b){"complete"==k.document.readyState?b():(a=function(){b()},sc(window,"load",a))}).s(function(b){throw E(window,"load",a),b})}function he(){return ie(void 0)?ge().then(function(){return new A(function(a,b){var c=k.document,d=setTimeout(function(){b(Error("Cordova framework is not ready."))},1E3);c.addEventListener("deviceready",function(){clearTimeout(d),a()},!1)})}):C(Error("Cordova must run in an Android or iOS file scheme."))}function ie(a){return a=a||H(),"file:"===je()&&a.toLowerCase().match(/iphone|ipad|ipod|android/)}function ke(){var a=k.window;try{return a&&a!=a.top}catch(b){return!1}}function le(){return"object"!=typeof k.window&&"function"==typeof k.importScripts}function me(){return _app2.default.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":_app2.default.INTERNAL.hasOwnProperty("node")?"Node":le()?"Worker":"Browser"}function ne(){var a=me();return"ReactNative"===a||"Node"===a}function oe(){for(var a=50,b=[];0<a;)b.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(_Mathfloor(62*Math.random()))),a--;return b.join("")}function Zd(a){var b=a.toLowerCase();if(y(b,"opera/")||y(b,"opr/")||y(b,"opios/"))return"Opera";if(y(b,"iemobile"))return"IEMobile";if(y(b,"msie")||y(b,"trident/"))return"IE";if(y(b,"edge/"))return"Edge";if(y(b,"firefox/"))return de;if(y(b,"silk/"))return"Silk";if(y(b,"blackberry"))return"Blackberry";if(y(b,"webos"))return"Webos";if(!(!y(b,"safari/")||y(b,"chrome/")||y(b,"crios/")||y(b,"android")))return"Safari";if(!y(b,"chrome/")&&!y(b,"crios/")||y(b,"edge/")){if(y(b,"android"))return"Android";if((a=a.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==a.length)return a[1]}else return $d;return"Other"}function qe(a,b){b=b||[];var c=[],d={},e;for(e in pe)d[pe[e]]=!0;for(e=0;e<b.length;e++)"undefined"!=typeof d[b[e]]&&(delete d[b[e]],c.push(b[e]));return c.sort(),b=c,b.length||(b=["FirebaseCore-web"]),c=me(),"Browser"===c?(d=H(),c=Zd(d)):"Worker"==c&&(d=H(),c=Zd(d)+"-"+c),c+"/JsCore/"+a+"/"+b.join(",")}function H(){return k.navigator&&k.navigator.userAgent||""}function I(a,b){a=a.split("."),b=b||k;for(var c=0;c<a.length&&"object"==typeof b&&null!=b;c++)b=b[a[c]];return c!=a.length&&(b=void 0),b}function re(){try{var a=k.localStorage,b=se();if(a)return a.setItem(b,"1"),a.removeItem(b),!Ud()||!!k.indexedDB}catch(c){return le()&&!!k.indexedDB}return!1}function te(){return(ue()||"chrome-extension:"===je()||ie())&&!ne()&&re()&&!le()}function ue(){return"http:"===je()||"https:"===je()}function je(){return k.location&&k.location.protocol||null}function ve(a){return a=a||H(),ae(a)||Zd(a)==de?!1:!0}function we(a){return"undefined"==typeof a?null:Od(a)}function xe(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&null!==a[c]&&void 0!==a[c]&&(b[c]=a[c]);return b}function ye(a){if(null!==a)return JSON.parse(a)}function se(a){return a?a:_Mathfloor(1E9*Math.random()).toString()}function ze(a){return a=a||H(),"Safari"==Zd(a)||a.toLowerCase().match(/iphone|ipad|ipod/)?!1:!0}function Ae(){var a=k.___jsl;if(a&&a.H)for(var b in a.H)if(a.H[b].r=a.H[b].r||[],a.H[b].L=a.H[b].L||[],a.H[b].r=a.H[b].L.concat(),a.CP)for(var c=0;c<a.CP.length;c++)a.CP[c]=null}function Be(a,b){if(a>b)throw Error("Short delay should be less than long delay!");this.a=a,this.c=b,a=H(),b=me(),this.b=ae(a)||"ReactNative"===b}function Ce(){var a=k.document;return a&&"undefined"!=typeof a.visibilityState?"visible"==a.visibilityState:!0}function De(){var a=k.document,_b=null;return Ce()||!a?B():new A(function(c){_b=function(){Ce()&&(a.removeEventListener("visibilitychange",_b,!1),c())},a.addEventListener("visibilitychange",_b,!1)}).s(function(c){throw a.removeEventListener("visibilitychange",_b,!1),c})}function Ee(a){try{var b=new Date(parseInt(a,10));if(!isNaN(b.getTime())&&!/[^0-9]/.test(a))return b.toUTCString()}catch(c){}return null}function Fe(){return I("fireauth.oauthhelper",k)||I("fireauth.iframe",k)}function Ge(){var a=k.navigator;return a&&a.serviceWorker&&a.serviceWorker.controller||null}function He(){var a=k.navigator;return a&&a.serviceWorker?B().then(function(){return a.serviceWorker.ready}).then(function(a){return a.active||null}).s(function(){return null}):B(null)}function Je(a){Ie[a]||(Ie[a]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(a))}function J(a,b,c){Ke?Object.defineProperty(a,b,{configurable:!0,enumerable:!0,value:c}):a[b]=c}function K(a,b){if(b)for(var c in b)b.hasOwnProperty(c)&&J(a,c,b[c])}function Me(a){var b={};return K(b,a),b}function Ne(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function Oe(a,b){if(!b||!b.length)return!0;if(!a)return!1;for(var c=0,d;c<b.length;c++)if(d=a[b[c]],void 0===d||null===d||""===d)return!1;return!0}function Pe(a){var b=a;if("object"==typeof a&&null!=a)for(var c in b="length"in a?[]:{},a)J(b,c,Pe(a[c]));return b}function Qe(a){var b={},c=a[Re],d=a[Se];if(a=a[Te],!a||a!=Ue&&!c)throw Error("Invalid provider user info!");b[Ve]=d||null,b[We]=c||null,J(this,Xe,a),J(this,Ye,Pe(b))}function L(a,b){this.code=Ze+a,this.message=b||$e[a]||""}function af(a){var b=a&&a.code;return b?new L(b.substring(Ze.length),a.message):null}function bf(a){var b=a[cf];if("undefined"==typeof b)throw new L("missing-continue-uri");if("string"!=typeof b||"string"==typeof b&&!b.length)throw new L("invalid-continue-uri");this.h=b,this.b=this.a=null,this.g=!1;var c=a[df];if(c&&"object"==typeof c){b=c[ef];var d=c[ff];if(c=c[gf],"string"==typeof b&&b.length){if(this.a=b,"undefined"!=typeof d&&"boolean"!=typeof d)throw new L("argument-error",ff+" property must be a boolean when specified.");if(this.g=!!d,"undefined"!=typeof c&&("string"!=typeof c||"string"==typeof c&&!c.length))throw new L("argument-error",gf+" property must be a non empty string when specified.");this.b=c||null}else{if("undefined"!=typeof b)throw new L("argument-error",ef+" property must be a non empty string when specified.");if("undefined"!=typeof d||"undefined"!=typeof c)throw new L("missing-android-pkg-name")}}else if("undefined"!=typeof c)throw new L("argument-error",df+" property must be a non null object when specified.");if(this.f=null,(b=a[hf])&&"object"==typeof b){if(b=b[jf],"string"==typeof b&&b.length)this.f=b;else if("undefined"!=typeof b)throw new L("argument-error",jf+" property must be a non empty string when specified.");}else if("undefined"!=typeof b)throw new L("argument-error",hf+" property must be a non null object when specified.");if(a=a[kf],"undefined"!=typeof a&&"boolean"!=typeof a)throw new L("argument-error",kf+" property must be a boolean when specified.");this.c=!!a}function lf(a){var b={};for(var c in b.continueUrl=a.h,b.canHandleCodeInApp=a.c,(b.androidPackageName=a.a)&&(b.androidMinimumVersion=a.b,b.androidInstallApp=a.g),b.iOSBundleId=a.f,b)null===b[c]&&delete b[c];return b}function mf(a){return Ca(a,function(a){return a=a.toString(16),1<a.length?a:"0"+a}).join("")}function pf(a){var b="";return qf(a,function(a){b+=String.fromCharCode(a)}),b}function qf(a,b){function c(b){for(;d<a.length;){var c=a.charAt(d++),e=of[c];if(null!=e)return e;if(!/^[\s\xa0]*$/.test(c))throw Error("Unknown base64 encoding at char: "+c)}return b}rf();for(var d=0;;){var e=c(-1),f=c(0),h=c(64),m=c(64);if(64===m&&-1===e)break;b(e<<2|f>>4),64!=h&&(b(240&f<<4|h>>2),64!=m&&b(192&h<<6|m))}}function rf(){if(!nf){nf={},of={};for(var a=0;65>a;a++)nf[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a),of[nf[a]]=a,62<=a&&(of["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(a)]=a)}}function sf(a){this.c=a.sub,oa(),this.a=a.provider_id||a.firebase&&a.firebase.sign_in_provider||null,this.b=!!a.is_anonymous||"anonymous"==this.a}function tf(a){return(a=uf(a))&&a.sub&&a.iss&&a.aud&&a.exp?new sf(a):null}function uf(a){if(!a)return null;if(a=a.split("."),3!=a.length)return null;a=a[1];for(var b=(4-a.length%4)%4,c=0;c<b;c++)a+=".";try{return JSON.parse(pf(a))}catch(d){}return null}function yf(a){for(var b in xf)if(xf[b].Na==a)return xf[b];return null}function zf(a){var b={"facebook.com":Af,"google.com":Bf,"github.com":Cf,"twitter.com":Df},c=a&&a[Ef];try{if(c)return b[c]?new b[c](a):new Ff(a);if("undefined"!=typeof a[Gf])return new Hf(a)}catch(d){}return null}function Hf(a){var b=a[Ef];if(!b&&a[Gf]){var c=tf(a[Gf]);c&&c.a&&(b=c.a)}if(!b)throw Error("Invalid additional user info!");("anonymous"==b||"custom"==b)&&(b=null),c=!1,"undefined"==typeof a.isNewUser?"identitytoolkit#SignupNewUserResponse"===a.kind&&(c=!0):c=!!a.isNewUser,J(this,"providerId",b),J(this,"isNewUser",c)}function Ff(a){Hf.call(this,a),a=ye(a.rawUserInfo||"{}"),J(this,"profile",Pe(a||{}))}function Af(a){if(Ff.call(this,a),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function Cf(a){if(Ff.call(this,a),"github.com"!=this.providerId)throw Error("Invalid provider ID!");J(this,"username",this.profile&&this.profile.login||null)}function Bf(a){if(Ff.call(this,a),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function Df(a){if(Ff.call(this,a),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");J(this,"username",a.screenName||null)}function If(a){this.a=dd(a)}function Jf(a){var b=dd(a),c=cd(b,"link"),d=cd(dd(c),"link");return b=cd(b,"deep_link_id"),cd(dd(b),"link")||b||d||c||a}function Kf(a,b){return a.then(function(a){if(a[M]){var c=tf(a[M]);if(!c||b!=c.c)throw new L("user-mismatch");return a}throw new L("user-mismatch")}).s(function(a){throw a&&a.code&&a.code==Ze+"user-not-found"?new L("user-mismatch"):a})}function Lf(a,b,c){if(b.idToken||b.accessToken)b.idToken&&J(this,"idToken",b.idToken),b.accessToken&&J(this,"accessToken",b.accessToken);else if(b.oauthToken&&b.oauthTokenSecret)J(this,"accessToken",b.oauthToken),J(this,"secret",b.oauthTokenSecret);else throw new L("internal-error","failed to construct a credential");J(this,"providerId",a),J(this,"signInMethod",c)}function Nf(a){var b={};return a.idToken&&(b.id_token=a.idToken),a.accessToken&&(b.access_token=a.accessToken),a.secret&&(b.oauth_token_secret=a.secret),b.providerId=a.providerId,{postBody:hd(b).toString(),requestUri:"http://localhost"}}function Qf(a,b){this.Cc=b||[],K(this,{providerId:a,isOAuthProvider:!0}),this.xb={},this.bb=(yf(a)||{}).Ma||null,this.Za=null}function N(a){Qf.call(this,a,wf),this.a=[]}function Rf(){N.call(this,"facebook.com")}function Sf(a){if(!a)throw new L("argument-error","credential failed: expected 1 argument (the OAuth access token).");var b=a;return q(a)&&(b=a.accessToken),new Rf().credential(null,b)}function Tf(){N.call(this,"github.com")}function Uf(a){if(!a)throw new L("argument-error","credential failed: expected 1 argument (the OAuth access token).");var b=a;return q(a)&&(b=a.accessToken),new Tf().credential(null,b)}function Vf(){N.call(this,"google.com"),this.ta("profile")}function Wf(a,b){var c=a;return q(a)&&(c=a.idToken,b=a.accessToken),new Vf().credential(c,b)}function Xf(){Qf.call(this,"twitter.com",vf)}function Yf(a,b){var c=a;if(q(c)||(c={oauthToken:a,oauthTokenSecret:b}),!c.oauthToken||!c.oauthTokenSecret)throw new L("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new Lf("twitter.com",c,"twitter.com")}function Zf(a,b,c){this.a=a,this.b=b,J(this,"providerId","password"),J(this,"signInMethod",c===O.EMAIL_LINK_SIGN_IN_METHOD?O.EMAIL_LINK_SIGN_IN_METHOD:O.EMAIL_PASSWORD_SIGN_IN_METHOD)}function O(){K(this,{providerId:"password",isOAuthProvider:!1})}function dg(a,b){if(b=eg(b),!b)throw new L("argument-error","Invalid email link!");return new Zf(a,b,O.EMAIL_LINK_SIGN_IN_METHOD)}function eg(a){a=Jf(a),a=new If(a);var b=cd(a.a,"oobCode")||null;return"signIn"===(cd(a.a,"mode")||null)&&b?b:null}function fg(a){if(!(a.Sa&&a.Ra||a.Fa&&a.$))throw new L("internal-error");this.a=a,J(this,"providerId","phone"),J(this,"signInMethod","phone")}function gg(a){return a.a.Fa&&a.a.$?{temporaryProof:a.a.Fa,phoneNumber:a.a.$}:{sessionInfo:a.a.Sa,code:a.a.Ra}}function jg(a){try{this.a=a||_app2.default.auth()}catch(b){throw new L("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}K(this,{providerId:"phone",isOAuthProvider:!1})}function lg(a,b){if(!a)throw new L("missing-verification-id");if(!b)throw new L("missing-verification-code");return new fg({Sa:a,Ra:b})}function mg(a){if(a.temporaryProof&&a.phoneNumber)return new fg({Fa:a.temporaryProof,$:a.phoneNumber});var b=a&&a.providerId;if(!b||"password"===b)return null;var c=a&&a.oauthAccessToken,d=a&&a.oauthTokenSecret;a=a&&a.oauthIdToken;try{return"google.com"===b?Wf(a,c):"facebook.com"===b?Sf(c):"github.com"===b?Uf(c):"twitter.com"===b?Yf(c,d):new N(b).credential(a,c)}catch(e){return null}}function ng(a){if(!a.isOAuthProvider)throw new L("invalid-oauth-provider")}function og(a,b,c,d,e){if(this.b=a,this.c=b||null,this.f=c||null,this.g=d||null,this.a=e||null,this.f||this.a){if(this.f&&this.a)throw new L("invalid-auth-event");if(this.f&&!this.g)throw new L("invalid-auth-event")}else throw new L("invalid-auth-event")}function pg(a){return a=a||{},a.type?new og(a.type,a.eventId,a.urlResponse,a.sessionId,a.error&&af(a.error)):null}function qg(){this.b=null,this.a=[]}function sg(a){var b="unauthorized-domain",d=dd(a),c;a=d.b,d=d.c,"chrome-extension"==d?c=Ka("This chrome extension ID (chrome-extension://%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.",a):"http"==d||"https"==d?c=Ka("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.",a):b="operation-not-supported-in-this-environment",L.call(this,b,c)}function tg(a,b,c){L.call(this,a,c),a=b||{},a.yb&&J(this,"email",a.yb),a.$&&J(this,"phoneNumber",a.$),a.credential&&J(this,"credential",a.credential)}function ug(a){if(a.code){var b=a.code||"";0==b.indexOf(Ze)&&(b=b.substring(Ze.length));var c={credential:mg(a)};if(a.email)c.yb=a.email;else if(a.phoneNumber)c.$=a.phoneNumber;else if(!c.credential)return new L(b,a.message||void 0);return new tg(b,c,a.message)}return null}function wg(){}function xg(a){return a.c||(a.c=a.b())}function zg(){}function Ag(a){if(!a.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0,d;c<b.length;c++){d=b[c];try{return new ActiveXObject(d),a.f=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return a.f}function Bg(){}function Cg(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseText="",this.status=-1,this.statusText="",this.a.onload=r(this.dc,this),this.a.onerror=r(this.Eb,this),this.a.onprogress=r(this.ec,this),this.a.ontimeout=r(this.hc,this)}function Dg(a,b){a.readyState=b,a.onreadystatechange&&a.onreadystatechange()}function Eg(a,b,c){this.reset(a,b,c,void 0,void 0)}function Gg(a){this.f=a,this.b=this.c=this.a=null}function Hg(a,b){this.name=a,this.value=b}function Mg(a){return a.c?a.c:a.a?Mg(a.a):(sa("Root logger has no level set."),null)}function Pg(a){Og||(Og=new Gg(""),Ng[""]=Og,Og.c=Kg);var b;if(!(b=Ng[a])){b=new Gg(a);var c=a.lastIndexOf("."),d=a.substr(c+1);c=Pg(a.substr(0,c)),c.b||(c.b={}),c.b[d]=b,b.a=c,Ng[a]=b}return b}function Qg(a,b){a&&a.log(Lg,b,void 0)}function Rg(a){this.f=a}function Sg(a){F.call(this),this.i=a,this.readyState=Tg,this.status=0,this.responseText=this.statusText="",this.onreadystatechange=null,this.g=new Headers,this.b=null,this.h="GET",this.c="",this.a=!1,this.f=Pg("goog.net.FetchXmlHttp")}function Ug(a){a.onreadystatechange&&a.onreadystatechange.call(a)}function Vg(a){F.call(this),this.headers=new Lc,this.C=a||null,this.c=!1,this.w=this.a=null,this.h=this.N=this.m="",this.f=this.I=this.i=this.G=!1,this.g=0,this.u=null,this.o=Wg,this.v=this.O=!1}function Zg(a,b,c,d,e){if(a.a)throw Error("[goog.net.XhrIo] Object is active with another request="+a.m+"; newUri="+b);c=c?c.toUpperCase():"GET",a.m=b,a.h="",a.N=c,a.G=!1,a.c=!0,a.a=a.C?a.C.a():yg.a(),a.w=a.C?xg(a.C):xg(yg),a.a.onreadystatechange=r(a.Ib,a);try{Qg(a.b,$g(a,"Opening Xhr")),a.I=!0,a.a.open(c,b+"",!0),a.I=!1}catch(h){return Qg(a.b,$g(a,"Error opening Xhr: "+h.message)),void ah(a,h)}b=d||"";var f=new Lc(a.headers);e&&Kc(e,function(a,b){f.set(b,a)}),e=Ea(f.U()),d=k.FormData&&b instanceof k.FormData,!Ga(Yg,c)||e||d||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),f.forEach(function(a,b){this.a.setRequestHeader(b,a)},a),a.o&&(a.a.responseType=a.o),"withCredentials"in a.a&&a.a.withCredentials!==a.O&&(a.a.withCredentials=a.O);try{bh(a),0<a.g&&(a.v=ch(a.a),Qg(a.b,$g(a,"Will abort after "+a.g+"ms if incomplete, xhr2 "+a.v)),a.v?(a.a.timeout=a.g,a.a.ontimeout=r(a.Ga,a)):a.u=Gc(a.Ga,a.g,a)),Qg(a.b,$g(a,"Sending request")),a.i=!0,a.a.send(b),a.i=!1}catch(h){Qg(a.b,$g(a,"Send error: "+h.message)),ah(a,h)}}function ch(a){return Pb&&Zb(9)&&"number"==typeof a.timeout&&void 0!==a.ontimeout}function Fa(a){return"content-type"==a.toLowerCase()}function ah(a,b){a.c=!1,a.a&&(a.f=!0,a.a.abort(),a.f=!1),a.h=b,dh(a),eh(a)}function dh(a){a.G||(a.G=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))}function fh(a){if(a.c&&"undefined"!=typeof aa)if(a.w[1]&&4==gh(a)&&2==hh(a))Qg(a.b,$g(a,"Local request error detected and ignored"));else if(a.i&&4==gh(a))Gc(a.Ib,0,a);else if(a.dispatchEvent("readystatechange"),4==gh(a)){Qg(a.b,$g(a,"Request complete")),a.c=!1;try{var b=hh(a);a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1;}var d;if(!(d=c)){var e;if(e=0===b){var f=(a.m+"").match(Oc)[1]||null;if(!f&&k.self&&k.self.location){var h=k.self.location.protocol;f=h.substr(0,h.length-1)}e=!Xg.test(f?f.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success");else{try{var m=2<gh(a)?a.a.statusText:""}catch(p){Qg(a.b,"Can not get status: "+p.message),m=""}a.h=m+" ["+hh(a)+"]",dh(a)}}finally{eh(a)}}}function eh(a,b){if(a.a){bh(a);var c=a.a,d=a.w[0]?ca:null;a.a=null,a.w=null,b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){(a=a.b)&&a.log(Ig,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}}function bh(a){a.a&&a.v&&(a.a.ontimeout=null),a.u&&(k.clearTimeout(a.u),a.u=null)}function gh(a){return a.a?a.a.readyState:0}function hh(a){try{return 2<gh(a)?a.a.status:-1}catch(b){return-1}}function ih(a){try{return a.a?a.a.responseText:""}catch(b){return Qg(a.b,"Can not get responseText: "+b.message),""}}function $g(a,b){return b+" ["+a.N+" "+a.m+" "+hh(a)+"]"}function jh(a,b){this.g=[],this.v=a,this.u=b||null,this.f=this.a=!1,this.c=void 0,this.m=this.w=this.i=!1,this.h=0,this.b=null,this.l=0}function mh(a,b,c){a.a=!0,a.c=c,a.f=!b,nh(a)}function lh(a){if(a.a){if(!a.m)throw new oh(a);a.m=!1}}function ph(a,b){qh(a,null,b,void 0)}function qh(a,b,c,d){a.g.push([b,c,d]),a.a&&nh(a)}function rh(a){return Da(a.g,function(a){return n(a[1])})}function nh(a){if(a.h&&a.a&&rh(a)){var b=a.h,c=sh[b];c&&(k.clearTimeout(c.a),delete sh[b]),a.h=0}a.b&&(a.b.l--,delete a.b),b=a.c;for(var d=c=!1;a.g.length&&!a.i;){var e=a.g.shift(),f=e[0],h=e[1];if(e=e[2],f=a.f?h:f)try{var m=f.call(e||a.u,b);void 0!==m&&(a.f=a.f&&(m==b||m instanceof Error),a.c=b=m),(qa(b)||"function"==typeof k.Promise&&b instanceof k.Promise)&&(d=!0,a.i=!0)}catch(p){b=p,a.f=!0,rh(a)||(c=!0)}}a.c=b,d&&(m=r(a.o,a,!0),d=r(a.o,a,!1),b instanceof jh?(qh(b,m,d),b.w=!0):b.then(m,d)),c&&(b=new th(b),sh[b.a]=b,a.h=b.a)}function oh(){u.call(this)}function kh(){u.call(this)}function th(a){this.a=k.setTimeout(r(this.c,this),0),this.b=a}function uh(a){var b={},c=b.document||document,d=td(a),e=document.createElement("SCRIPT"),f={Kb:e,Ga:void 0},h=new jh(vh,f),m=null,p=null==b.timeout?5E3:b.timeout;return 0<p&&(m=window.setTimeout(function(){wh(e,!0);var a=new xh(yh,"Timeout reached for loading script "+d);lh(h),mh(h,!1,a)},p),f.Ga=m),e.onload=e.onreadystatechange=function(){e.readyState&&"loaded"!=e.readyState&&"complete"!=e.readyState||(wh(e,b.ed||!1,m),h.C())},e.onerror=function(){wh(e,!0,m);var a=new xh(zh,"Error while loading script "+d);lh(h),mh(h,!1,a)},f=b.attributes||{},bb(f,{type:"text/javascript",charset:"UTF-8"}),Jd(e,f),e.src=td(a),Ah(c).appendChild(e),h}function Ah(a){var b;return(b=(a||document).getElementsByTagName("HEAD"))&&0!=b.length?b[0]:a.documentElement}function vh(){if(this&&this.Kb){var a=this.Kb;a&&"SCRIPT"==a.tagName&&wh(a,!0,this.Ga)}}function wh(a,b,c){null!=c&&k.clearTimeout(c),a.onload=ca,a.onerror=ca,a.onreadystatechange=ca,b&&window.setTimeout(function(){a&&a.parentNode&&a.parentNode.removeChild(a)},0)}function xh(a,b){var c="Jsloader error (code #"+a+")";b&&(c+=": "+b),u.call(this,c),this.code=a}function Bh(a){this.f=a}function Ch(a,b,c){if(this.b=a,a=b||{},this.i=a.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.l=a.secureTokenTimeout||Dh,this.f=$a(a.secureTokenHeaders||Eh),this.g=a.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.h=a.firebaseTimeout||Fh,this.a=$a(a.firebaseHeaders||Gh),c&&(this.a["X-Client-Version"]=c,this.f["X-Client-Version"]=c),c="Node"==me(),c=k.XMLHttpRequest||c&&_app2.default.INTERNAL.node&&_app2.default.INTERNAL.node.XMLHttpRequest,!c&&!le())throw new L("internal-error","The XMLHttpRequest compatibility library was not found.");this.c=void 0,this.c=le()?new Rg(self):ne()?new Bh(c):new Bg}function Ih(a,b){b?a.a["X-Firebase-Locale"]=b:delete a.a["X-Firebase-Locale"]}function Jh(a,b){b?(a.a["X-Client-Version"]=b,a.f["X-Client-Version"]=b):(delete a.a["X-Client-Version"],delete a.f["X-Client-Version"])}function Kh(a,b,c,d,e,f,h){Yd()||le()?a=r(a.o,a):(Hh||(Hh=new A(function(a,b){Lh(a,b)})),a=r(a.m,a)),a(b,c,d,e,f,h)}function Lh(a,b){if(((window.gapi||{}).client||{}).request)a();else{k[Nh]=function(){((window.gapi||{}).client||{}).request?a():b(Error("CORS_UNSUPPORTED"))};var c=ud(Mh,{onload:Nh});ph(uh(c),function(){b(Error("CORS_UNSUPPORTED"))})}}function Oh(a,b){return new A(function(c,d){"refresh_token"==b.grant_type&&b.refresh_token||"authorization_code"==b.grant_type&&b.code?Kh(a,a.i+"?key="+encodeURIComponent(a.b),function(a){a?a.error?d(Ph(a)):a.access_token&&a.refresh_token?c(a):d(new L("internal-error")):d(new L("network-request-failed"))},"POST",hd(b).toString(),a.f,a.l.get()):d(new L("internal-error"))})}function Qh(a,b,c,d,e,f){var h=dd(a.g+b);G(h,"key",a.b),f&&G(h,"cb",oa().toString());var m="GET"==c;if(m)for(var p in d)d.hasOwnProperty(p)&&G(h,p,d[p]);return new A(function(b,f){Kh(a,h.toString(),function(a){a?a.error?f(Ph(a,e||{})):b(a):f(new L("network-request-failed"))},c,m?void 0:Od(xe(d)),a.a,a.h.get())})}function Rh(a){if(!vg.test(a.email))throw new L("invalid-email")}function Sh(a){"email"in a&&Rh(a)}function Th(a,b){return P(a,Uh,{identifier:b,continueUri:ue()?Vd():"http://localhost"}).then(function(a){return a.allProviders||[]})}function Vh(a,b){return P(a,Uh,{identifier:b,continueUri:ue()?Vd():"http://localhost"}).then(function(a){return a.signinMethods||[]})}function Wh(a){return P(a,Xh,{}).then(function(a){return a.authorizedDomains||[]})}function Yh(a){if(!a[M])throw new L("internal-error")}function Zh(a){if(!(a.phoneNumber||a.temporaryProof)){if(!a.sessionInfo)throw new L("missing-verification-id");if(!a.code)throw new L("missing-verification-code")}else if(!a.phoneNumber||!a.temporaryProof)throw new L("internal-error")}function kg(a,b){return P(a,fi,b)}function hi(a,b,c){return P(a,ii,{idToken:b,deleteProvider:c})}function ji(a){if(!a.requestUri||!a.sessionId&&!a.postBody)throw new L("internal-error")}function ki(a){var b=null;if(a.needConfirmation?(a.code="account-exists-with-different-credential",b=ug(a)):"FEDERATED_USER_ID_ALREADY_LINKED"==a.errorMessage?(a.code="credential-already-in-use",b=ug(a)):"EMAIL_EXISTS"==a.errorMessage?(a.code="email-already-in-use",b=ug(a)):a.errorMessage&&(b=li(a.errorMessage)),b)throw b;if(!a[M])throw new L("internal-error")}function Mf(a,b){return b.returnIdpCredential=!0,P(a,mi,b)}function Of(a,b){return b.returnIdpCredential=!0,P(a,ni,b)}function Pf(a,b){return b.returnIdpCredential=!0,b.autoCreate=!1,P(a,oi,b)}function pi(a){if(!a.oobCode)throw new L("invalid-action-code")}function P(a,b,c){if(!Oe(c,b.T))return C(new L("internal-error"));var d=b.Hb||"POST",e;return B(c).then(b.B).then(function(){return b.R&&(c.returnSecureToken=!0),Qh(a,b.endpoint,d,c,b.Wb,b.tb||!1)}).then(function(a){return e=a}).then(b.J).then(function(){if(!b.da)return e;if(!(b.da in e))throw new L("internal-error");return e[b.da]})}function li(a){return Ph({error:{errors:[{message:a}],code:400,message:a}})}function Ph(a,b){var c=(a.error&&a.error.errors&&a.error.errors[0]||{}).reason||"",d={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(c=d[c]?new L(d[c]):null)return c;for(var e in c=a.error&&a.error.message||"",d={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",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",INVALID_PROVIDER_ID:"invalid-provider-id",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",REJECTED_CREDENTIAL:"rejected-credential",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"},bb(d,b||{}),b=(b=c.match(/^[^\s]+\s*:\s*(.*)$/))&&1<b.length?b[1]:void 0,d)if(0===c.indexOf(e))return new L(d[e],b);return!b&&a&&(b=we(a)),new L("internal-error",b)}function zi(a){for(var b in yi)if(yi[b].id===a)return a=yi[b],{firebaseEndpoint:a.$a,secureTokenEndpoint:a.hb};return null}function Bi(a){this.b=a,this.a=null,this.eb=Ci(this)}function Ci(a){return Di().then(function(){return new A(function(b,c){I("gapi.iframes.getContext")().open({where:document.body,url:a.b,messageHandlersFilter:I("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},function(d){function e(){clearTimeout(f),b()}a.a=d,a.a.restyle({setHideOnLeave:!1});var f=setTimeout(function(){c(Error("Network Error"))},Ei.get());d.ping(e).then(e,function(){c(Error("Network Error"))})})})})}function Fi(a,b){return a.eb.then(function(){return new A(function(c){a.a.send(b.type,b,c,I("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})})}function Gi(a,b){a.eb.then(function(){a.a.register("authEvent",b,I("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})}function Di(){return Ji?Ji:Ji=new A(function(a,b){function c(){Ae(),I("gapi.load")("gapi.iframes",{callback:a,ontimeout:function(){Ae(),b(Error("Network Error"))},timeout:Ii.get()})}if(I("gapi.iframes.Iframe"))a();else if(I("gapi.load"))c();else{var d="__iframefcb"+_Mathfloor(1E6*Math.random()).toString();k[d]=function(){I("gapi.load")?c():b(Error("Network Error"))},d=ud(Hi,{onload:d}),B(uh(d)).s(function(){b(Error("Network Error"))})}}).s(function(a){throw Ji=null,a})}function Ki(a,b,c){this.i=a,this.g=b,this.h=c,this.f=null,this.a=ed(this.i,"/__/auth/iframe"),G(this.a,"apiKey",this.g),G(this.a,"appName",this.h),this.b=null,this.c=[]}function Li(a,b,c,d,e){this.o=a,this.m=b,this.c=c,this.l=d,this.h=this.g=this.i=null,this.a=e,this.f=null}function Mi(a){try{return _app2.default.app(a).auth().xa()}catch(b){return[]}}function Ni(a,b,c,d,e){this.m=a,this.f=b,this.b=c,this.c=d||null,this.h=e||null,this.o=this.u=this.v=null,this.g=[],this.l=this.a=null}function Oi(a){var b=Vd();return Wh(a).then(function(a){a:{var c=dd(b),e=c.c;c=c.b;for(var f=0;f<a.length;f++){var h=a[f],m=c,p=e;if(0==h.indexOf("chrome-extension://")?m=dd(h).b==m&&"chrome-extension"==p:"http"!=p&&"https"!=p?m=!1:fe.test(h)?m=m==h:(h=h.split(".").join("\\."),m=new RegExp("^(.+\\."+h+"|"+h+")$","i").test(m)),m){a=!0;break a}}a=!1}if(!a)throw new sg(Vd())})}function Pi(a){return a.l?a.l:(a.l=ge().then(function(){if(!a.u){var b=a.c,c=a.h,d=Mi(a.b),e=new Ki(a.m,a.f,a.b);e.f=b,e.b=c,e.c=Ja(d||[]),a.u=e.toString()}a.i=new Bi(a.u),Qi(a)}),a.l)}function Si(a){return a.o||(a.v=a.c?qe(a.c,Mi(a.b)):null,a.o=new Ch(a.f,zi(a.h),a.v)),a.o}function Ti(a,b,c,d,e,f,h,m,p,x){return a=new Li(a,b,c,d,e),a.i=f,a.g=h,a.h=m,a.b=$a(p||null),a.f=x,a.toString()}function Qi(a){if(!a.i)throw Error("IfcHandler must be initialized!");Gi(a.i,function(b){var c={};if(b&&b.authEvent){var d=!1;for(b=pg(b.authEvent),c=0;c<a.g.length;c++)d=a.g[c](b)||d;return c={},c.status=d?"ACK":"ERROR",B(c)}return c.status="ERROR",B(c)})}function Ri(a){var b={type:"webStorageSupport"};return Pi(a).then(function(){return Fi(a.i,b)}).then(function(a){if(a&&a.length&&"undefined"!=typeof a[0].webStorageSupport)return a[0].webStorageSupport;throw Error()})}function Ui(a){if(this.a=a||_app2.default.INTERNAL.reactNative&&_app2.default.INTERNAL.reactNative.AsyncStorage,!this.a)throw new L("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function Vi(a){this.b=a,this.a={},this.c=r(this.f,this)}function Xi(){var a=le()?self:null;if(v(Wi,function(c){c.b==a&&(b=c)}),!b){var b=new Vi(a);Wi.push(b)}return b}function Yi(a){this.a=a}function Zi(a){this.c=a,this.b=!1,this.a=[]}function $i(a,b,c,d){var f=c||{},x=null,e,h,m,p;if(a.b)return C(Error("connection_unavailable"));var db=d?800:50,la="undefined"==typeof MessageChannel?null:new MessageChannel;return new A(function(c,d){la?(e=_Mathfloor(100000000000000000000*Math.random()).toString(),la.port1.start(),m=setTimeout(function(){d(Error("unsupported_event"))},db),h=function(a){a.data.eventId===e&&("ack"===a.data.status?(clearTimeout(m),p=setTimeout(function(){d(Error("timeout"))},3E3)):"done"===a.data.status?(clearTimeout(p),"undefined"==typeof a.data.response?d(Error("unknown_error")):c(a.data.response)):(clearTimeout(m),clearTimeout(p),d(Error("invalid_response"))))},x={messageChannel:la,onMessage:h},a.a.push(x),la.port1.addEventListener("message",h),a.c.postMessage({eventType:b,eventId:e,data:f},[la.port2])):d(Error("connection_unavailable"))}).then(function(b){return aj(a,x),b}).s(function(b){throw aj(a,x),b})}function aj(a,b){if(b){var c=b.messageChannel,d=b.onMessage;c&&(c.port1.removeEventListener("message",d),c.port1.close()),w(a.a,function(a){return a==b})}}function bj(){if(!cj())throw new L("web-storage-unsupported");this.c={},this.a=[],this.b=0,this.m=k.indexedDB,this.type="indexedDB",this.g=this.l=this.f=this.i=null,this.u=!1,this.h=null;var a=this;le()&&self?(this.l=Xi(),this.l.subscribe("keyChanged",function(b,c){return dj(a).then(function(b){return 0<b.length&&v(a.a,function(a){a(b)}),{keyProcessed:Ga(b,c.key)}})}),this.l.subscribe("ping",function(){return B(["keyChanged"])})):He().then(function(b){(a.h=b)&&(a.g=new Zi(new Yi(b)),$i(a.g,"ping",null,!0).then(function(b){b[0].fulfilled&&Ga(b[0].value,"keyChanged")&&(a.u=!0)}).s(function(){}))})}function fj(a){return new A(function(b,c){var d=a.m.deleteDatabase("firebaseLocalStorageDb");d.onsuccess=function(){b()},d.onerror=function(a){c(Error(a.target.error))}})}function gj(a){return new A(function(b,c){var d=a.m.open("firebaseLocalStorageDb",1);d.onerror=function(a){try{a.preventDefault()}catch(f){}c(Error(a.target.error))},d.onupgradeneeded=function(a){a=a.target.result;try{a.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(f){c(f)}},d.onsuccess=function(d){d=d.target.result,d.objectStoreNames.contains("firebaseLocalStorage")?b(d):fj(a).then(function(){return gj(a)}).then(function(a){b(a)}).s(function(a){c(a)})}})}function hj(a){return a.o||(a.o=gj(a)),a.o}function cj(){try{return!!k.indexedDB}catch(a){return!1}}function ij(a){return a.objectStore("firebaseLocalStorage")}function jj(a,b){return a.transaction(["firebaseLocalStorage"],b?"readwrite":"readonly")}function kj(a){return new A(function(b,c){a.onsuccess=function(a){a&&a.target?b(a.target.result):b()},a.onerror=function(a){c(Error(a.target.errorCode))}})}function lj(a,b){return a.g&&a.h&&Ge()===a.h?$i(a.g,"keyChanged",{key:b},a.u).then(function(){}).s(function(){}):B()}function dj(a){return hj(a).then(function(a){var b=ij(jj(a,!1));return b.getAll?kj(b.getAll()):new A(function(a,c){var d=[],e=b.openCursor();e.onsuccess=function(b){(b=b.target.result)?(d.push(b.value),b["continue"]()):a(d)},e.onerror=function(a){c(Error(a.target.errorCode))}})}).then(function(b){var c={},d=[];if(0==a.b){for(d=0;d<b.length;d++)c[b[d].fbase_key]=b[d].value;d=Xd(a.c,c),a.c=c}return d})}function mj(a){function b(){a.f=setTimeout(function(){a.i=dj(a).then(function(b){0<b.length&&v(a.a,function(a){a(b)})}).then(function(){b()}).s(function(a){"STOP_EVENT"!=a.message&&b()})},800)}nj(a),b()}function nj(a){a.i&&a.i.cancel("STOP_EVENT"),a.f&&(clearTimeout(a.f),a.f=null)}function oj(a){var b=this,c=null;this.a=[],this.type="indexedDB",this.c=a,this.b=B().then(function(){if(cj()){var a=se(),e="__sak"+a;return ej||(ej=new bj),c=ej,c.set(e,a).then(function(){return c.get(e)}).then(function(b){if(b!==a)throw Error("indexedDB not supported!");return c.P(e)}).then(function(){return c}).s(function(){return b.c})}return b.c}).then(function(a){return b.type=a.type,a.Y(function(a){v(b.a,function(b){b(a)})}),a})}function pj(){this.a={},this.type="inMemory"}function qj(){if(!rj()){if("Node"==me())throw new L("internal-error","The LocalStorage compatibility library was not found.");throw new L("web-storage-unsupported")}this.a=sj()||_app2.default.INTERNAL.node.localStorage,this.type="localStorage"}function sj(){try{var a=k.localStorage,b=se();return a&&(a.setItem(b,"1"),a.removeItem(b)),a}catch(c){return null}}function rj(){var a="Node"==me();if(a=sj()||a&&_app2.default.INTERNAL.node&&_app2.default.INTERNAL.node.localStorage,!a)return!1;try{return a.setItem("__sak","1"),a.removeItem("__sak"),!0}catch(b){return!1}}function tj(){this.type="nullStorage"}function uj(){if(!vj()){if("Node"==me())throw new L("internal-error","The SessionStorage compatibility library was not found.");throw new L("web-storage-unsupported")}this.a=wj()||_app2.default.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function wj(){try{var a=k.sessionStorage,b=se();return a&&(a.setItem(b,"1"),a.removeItem(b)),a}catch(c){return null}}function vj(){var a="Node"==me();if(a=wj()||a&&_app2.default.INTERNAL.node&&_app2.default.INTERNAL.node.sessionStorage,!a)return!1;try{return a.setItem("__sak","1"),a.removeItem("__sak"),!0}catch(b){return!1}}function xj(){var a={};a.Browser=yj,a.Node=zj,a.ReactNative=Aj,a.Worker=Bj,this.a=a[me()]}function Ej(a){var b=new L("invalid-persistence-type"),c=new L("unsupported-persistence-type");a:{for(d in Dj)if(Dj[d]==a){var d=!0;break a}d=!1}if(!d||"string"!=typeof a)throw b;switch(me()){case"ReactNative":if("session"===a)throw c;break;case"Node":if("none"!==a)throw c;break;default:if(!re()&&"none"!==a)throw c;}}function Fj(){var a=!ze(H())&&ke(),b=ve(),c=re();this.o=a,this.h=b,this.l=c,this.a={},Cj||(Cj=new xj),a=Cj;try{this.g=(Ud()||!Fe())&&k.indexedDB?new oj(le()?new pj:new a.a.A):new a.a.A}catch(d){this.g=new pj,this.h=!0}try{this.i=new a.a.Qa}catch(d){this.i=new pj}this.m=new pj,this.f=r(this.Ob,this),this.b={}}function Hj(){return Gj||(Gj=new Fj),Gj}function Ij(a,b){return"session"===b?a.i:"none"===b?a.m:a.g}function Jj(a,b){return"firebase:"+a.name+(b?":"+b:"")}function Kj(a,b,c){var d=Jj(b,c),e=Ij(a,b.A);return a.get(b,c).then(function(f){var h=null;try{h=ye(k.localStorage.getItem(d))}catch(m){}return h&&!f?(k.localStorage.removeItem(d),a.set(b,h,c)):void(h&&f&&"localStorage"!=e.type&&k.localStorage.removeItem(d))})}function Lj(a,b,c){return c=Jj(b,c),"local"==b.A&&(a.b[c]=null),Ij(a,b.A).P(c)}function Mj(a){Nj(a),a.c=setInterval(function(){for(var b in a.a){var c=k.localStorage.getItem(b),d=a.b[b];c!=d&&(a.b[b]=c,c=new fc({type:"storage",key:b,target:window,oldValue:d,newValue:c,a:!0}),a.Ob(c))}},1E3)}function Nj(a){a.c&&(clearInterval(a.c),a.c=null)}function Oj(a){this.a=a,this.b=Hj()}function Qj(a){return a.b.get(Pj,a.a).then(function(a){return pg(a)})}function Rj(){this.a=Hj()}function Tj(a,b){this.b=Uj,this.f=k.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=a,this.h=b,this.l=k.Int32Array?new Int32Array(64):Array(64),void 0!==Vj||(k.Int32Array?Vj=new Int32Array(Wj):Vj=Wj),this.reset()}function bk(a){for(var b=a.f,c=a.l,d=0,e=0;e<b.length;)c[d++]=b[e]<<24|b[e+1]<<16|b[e+2]<<8|b[e+3],e=4*d;for(b=16;64>b;b++){e=0|c[b-15],d=0|c[b-2];var f=0|(0|c[b-16])+((e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3),h=0|(0|c[b-7])+((d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10);c[b]=0|f+h}d=0|a.a[0],e=0|a.a[1];var m=0|a.a[2],p=0|a.a[3],x=0|a.a[4],db=0|a.a[5],la=0|a.a[6];for(f=0|a.a[7],b=0;64>b;b++){var Ml=0|((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&e^d&m^e&m);h=x&db^~x&la,f=0|f+((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)),h=0|h+(0|Vj[b]),h=0|f+(0|h+(0|c[b])),f=la,la=db,db=x,x=0|p+h,p=m,m=e,e=d,d=0|h+Ml}a.a[0]=0|a.a[0]+d,a.a[1]=0|a.a[1]+e,a.a[2]=0|a.a[2]+m,a.a[3]=0|a.a[3]+p,a.a[4]=0|a.a[4]+x,a.a[5]=0|a.a[5]+db,a.a[6]=0|a.a[6]+la,a.a[7]=0|a.a[7]+f}function ck(a,b,c){void 0===c&&(c=b.length);var d=0,e=a.c;if(l(b))for(;d<c;)a.f[e++]=b.charCodeAt(d++),e==a.b&&(bk(a),e=0);else if(ha(b))for(;d<c;){var f=b[d++];if(!("number"==typeof f&&0<=f&&255>=f&&f==(0|f)))throw Error("message must be a byte array");a.f[e++]=f,e==a.b&&(bk(a),e=0)}else throw Error("message must be string or array");a.c=e,a.g+=c}function dk(){Tj.call(this,8,ek)}function fk(a,b,c,d,e){this.m=a,this.i=b,this.l=c,this.o=d||null,this.u=e||null,this.h=b+":"+c,this.v=new Rj,this.g=new Oj(this.h),this.f=null,this.b=[],this.a=this.c=null}function gk(a){return new L("invalid-cordova-configuration",a)}function hk(){for(var a=20,b=[];0<a;)b.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(_Mathfloor(62*Math.random()))),a--;return b.join("")}function ik(a){var b=new dk;ck(b,a),a=[];var c=8*b.g;56>b.c?ck(b,ak,56-b.c):ck(b,ak,b.b-(b.c-56));for(var d=63;56<=d;d--)b.f[d]=255&c,c/=256;for(bk(b),d=c=0;d<b.i;d++)for(var e=24;0<=e;e-=8)a[c++]=255&b.a[d]>>e;return mf(a)}function kk(a,b,c,d){var e=hk(),f=new og(b,d,null,e,new L("no-auth-event")),h=I("BuildInfo.packageName",k);if("string"!=typeof h)throw new L("invalid-cordova-configuration");var m=I("BuildInfo.displayName",k),p={};if(H().toLowerCase().match(/iphone|ipad|ipod/))p.ibi=h;else if(H().toLowerCase().match(/android/))p.apn=h;else return C(new L("operation-not-supported-in-this-environment"));m&&(p.appDisplayName=m),e=ik(e),p.sessionId=e;var x=Ti(a.m,a.i,a.l,b,c,null,d,a.o,p,a.u);return a.ga().then(function(){var b=a.h;return a.v.a.set(Pj,f.D(),b)}).then(function(){var b=I("cordova.plugins.browsertab.isAvailable",k);if("function"!=typeof b)throw new L("invalid-cordova-configuration");var c=null;b(function(b){if(b){if(c=I("cordova.plugins.browsertab.openUrl",k),"function"!=typeof c)throw new L("invalid-cordova-configuration");c(x)}else{if(c=I("cordova.InAppBrowser.open",k),"function"!=typeof c)throw new L("invalid-cordova-configuration");b=H(),b=b.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||b.match(/(iPad|iPhone|iPod).*OS 8_\d/i),a.a=c(x,b?"_blank":"_system","location=yes")}})})}function mk(a,b){for(var c=0;c<a.b.length;c++)try{a.b[c](b)}catch(d){}}function jk(a){return a.f||(a.f=a.ga().then(function(){return new A(function(b){function c(d){return b(d),a.Ka(c),!1}a.va(c),nk(a)})})),a.f}function lk(a){var b=null;return Qj(a.g).then(function(c){return b=c,c=a.g,Lj(c.b,Pj,c.a)}).then(function(){return b})}function nk(a){function b(b){d=!0,e&&e.cancel(),lk(a).then(function(d){var e=c;if(d&&b&&b.url){var f=null;e=Jf(b.url),-1!=e.indexOf("/__/auth/callback")&&(f=dd(e),f=ye(cd(f,"firebaseError")||null),f=(f="object"==typeof f?af(f):null)?new og(d.b,d.c,null,null,f):new og(d.b,d.c,e,d.g)),e=f||c}mk(a,e)})}var c=new og("unknown",null,null,null,new L("no-auth-event")),d=!1,e=Hc(500).then(function(){return lk(a).then(function(){d||mk(a,c)})}),f=k.handleOpenURL;k.handleOpenURL=function(a){if(0==a.toLowerCase().indexOf(I("BuildInfo.packageName",k).toLowerCase()+"://")&&b({url:a}),"function"==typeof f)try{f(a)}catch(m){console.error(m)}},rg||(rg=new qg),rg.subscribe(b)}function ok(a){this.a=a,this.b=Hj()}function qk(a){return a.b.set(pk,"pending",a.a)}function rk(a){return Lj(a.b,pk,a.a)}function sk(a){return a.b.get(pk,a.a).then(function(a){return"pending"==a})}function tk(a,b,c){this.u=a,this.l=b,this.m=c,this.h=[],this.f=!1,this.i=r(this.ab,this),this.b=new uk,this.o=new vk,this.g=new ok(this.l+":"+this.m),this.c={},this.c.unknown=this.b,this.c.signInViaRedirect=this.b,this.c.linkViaRedirect=this.b,this.c.reauthViaRedirect=this.b,this.c.signInViaPopup=this.o,this.c.linkViaPopup=this.o,this.c.reauthViaPopup=this.o,this.a=wk(this.u,this.l,this.m,Ai)}function wk(a,b,c,d){var e=_app2.default.SDK_VERSION||null;return ie()?new fk(a,b,c,e,d):new Ni(a,b,c,e,d)}function xk(a){a.f||(a.f=!0,a.a.va(a.i));var b=a.a;return a.a.ga().s(function(c){throw a.a==b&&a.reset(),c})}function yk(a){a.a.Lb()&&xk(a).s(function(b){var c=new og("unknown",null,null,null,new L("operation-not-supported-in-this-environment"));zk(b)&&a.ab(c)}),a.a.Gb()||Ak(a.b)}function Dk(a,b,c,d,e,f){return a.a.Bb(b,c,d,function(){a.f||(a.f=!0,a.a.va(a.i))},function(){a.reset()},e,f)}function zk(a){return a&&"auth/cordova-not-ready"==a.code}function Fk(a,b,c){var d=b+":"+c;return Ek[d]||(Ek[d]=new tk(a,b,c)),Ek[d]}function uk(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function Ak(a){a.g||(a.g=!0,Gk(a,!1,null,null))}function Hk(a,b,c){c=c.wa(b.b,b.c);var d=b.f,e=b.g,f=!!b.b.match(/Redirect$/);c(d,e).then(function(b){Gk(a,f,b,null)}).s(function(b){Gk(a,f,null,b)})}function Ik(a,b){if(a.b=function(){return C(b)},a.c.length)for(var c=0;c<a.c.length;c++)a.c[c](b)}function Jk(a,b){if(a.b=function(){return B(b)},a.f.length)for(var c=0;c<a.f.length;c++)a.f[c](b)}function Gk(a,b,c,d){b?d?Ik(a,d):Jk(a,c):Jk(a,{user:null}),a.f=[],a.c=[]}function Kk(a){var b=new L("timeout");a.a&&a.a.cancel(),a.a=Hc(Ck.get()).then(function(){a.b||(a.g=!0,Gk(a,!0,null,b))})}function vk(){}function Lk(a,b){var c=a.c,d=a.b;b.wa(d,c)(a.f,a.g).then(function(a){b.ha(d,a,null,c)}).s(function(a){b.ha(d,null,a,c)})}function Mk(){this.rb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.rb},set:function(a){this.rb=a},enumerable:!1})}function Nk(a,b){this.a=b,J(this,"verificationId",a)}function Ok(a,b,c,d){return new jg(a).Ta(b,c).then(function(a){return new Nk(a,d)})}function Pk(a){var b=uf(a);if(!(b&&b.exp&&b.auth_time&&b.iat))throw new L("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");K(this,{token:a,expirationTime:Ee(1E3*b.exp),authTime:Ee(1E3*b.auth_time),issuedAtTime:Ee(1E3*b.iat),signInProvider:b.firebase&&b.firebase.sign_in_provider?b.firebase.sign_in_provider:null,claims:b})}function Qk(a,b,c){if(this.h=a,this.i=b,this.g=c,this.c=3E4,this.f=96E4,this.b=null,this.a=this.c,this.f<this.c)throw Error("Proactive refresh lower bound greater than upper bound!")}function Sk(a,b){return b?(a.a=a.c,a.g()):(b=a.a,a.a*=2,a.a>a.f&&(a.a=a.f),b)}function Rk(a,b){a.stop(),a.b=Hc(Sk(a,b)).then(function(){return De()}).then(function(){return a.h()}).then(function(){Rk(a,!0)}).s(function(b){a.i(b)&&Rk(a,!1)})}function Tk(a){this.f=a,this.b=this.a=null,this.c=0}function Uk(a,b){var c=b[M],d=b.refreshToken;b=Vk(b.expiresIn),a.b=c,a.c=b,a.a=d}function Wk(a,b){a.b=b.b,a.a=b.a,a.c=b.c}function Vk(a){return oa()+1E3*parseInt(a,10)}function Xk(a,b){return Oh(a.f,b).then(function(b){return a.b=b.access_token,a.c=Vk(b.expires_in),a.a=b.refresh_token,{accessToken:a.b,expirationTime:a.c,refreshToken:a.a}}).s(function(b){throw"auth/user-token-expired"==b.code&&(a.a=null),b})}function Yk(a,b){this.a=a||null,this.b=b||null,K(this,{lastSignInTime:Ee(b||null),creationTime:Ee(a||null)})}function Zk(a){return new Yk(a.a,a.b)}function $k(a,b,c,d,e,f){K(this,{uid:a,displayName:d||null,photoURL:e||null,email:c||null,phoneNumber:f||null,providerId:b})}function al(a,b){for(var c in D.call(this,a),b)this[c]=b[c]}function Q(a,b,c){this.G=[],this.m=a.apiKey,this.o=a.appName,this.u=a.authDomain||null,a=_app2.default.SDK_VERSION?qe(_app2.default.SDK_VERSION):null,this.b=new Ch(this.m,zi(Ai),a),this.h=new Tk(this.b),bl(this,b[M]),Uk(this.h,b),J(this,"refreshToken",this.h.a),cl(this,c||{}),F.call(this),this.I=!1,this.u&&te()&&(this.a=Fk(this.u,this.m,this.o)),this.N=[],this.i=null,this.w=dl(this),this.V=r(this.Ha,this);var d=this;this.ka=null,this.sa=function(a){d.oa(a.g)},this.X=null,this.O=[],this.ra=function(a){el(d,a.c)},this.W=null}function fl(a,b){a.X&&E(a.X,"languageCodeChanged",a.sa),(a.X=b)&&rc(b,"languageCodeChanged",a.sa)}function el(a,b){a.O=b,Jh(a.b,_app2.default.SDK_VERSION?qe(_app2.default.SDK_VERSION,a.O):null)}function gl(a,b){a.W&&E(a.W,"frameworkChanged",a.ra),(a.W=b)&&rc(b,"frameworkChanged",a.ra)}function hl(a){try{return _app2.default.app(a.o).auth()}catch(b){throw new L("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+a.o+"'!")}}function dl(a){return new Qk(function(){return a.F(!0)},function(a){return a&&"auth/network-request-failed"==a.code},function(){var b=a.h.c-oa()-3E5;return 0<b?b:0})}function il(a){a.C||a.w.b||(a.w.start(),E(a,"tokenChanged",a.V),rc(a,"tokenChanged",a.V))}function jl(a){E(a,"tokenChanged",a.V),a.w.stop()}function bl(a,b){a.qa=b,J(a,"_lat",b)}function kl(a,b){w(a.N,function(a){return a==b})}function ll(a){for(var b=[],c=0;c<a.N.length;c++)b.push(a.N[c](a));return wb(b).then(function(){return a})}function ml(a){a.a&&!a.I&&(a.I=!0,a.a.subscribe(a))}function cl(a,b){K(a,{uid:b.uid,displayName:b.displayName||null,photoURL:b.photoURL||null,email:b.email||null,emailVerified:b.emailVerified||!1,phoneNumber:b.phoneNumber||null,isAnonymous:b.isAnonymous||!1,metadata:new Yk(b.createdAt,b.lastLoginAt),providerData:[]})}function nl(){}function ol(a){return B().then(function(){if(a.C)throw new L("app-deleted")})}function pl(a){return Ca(a.providerData,function(a){return a.providerId})}function ql(a,b){b&&(rl(a,b.providerId),a.providerData.push(b))}function rl(a,b){w(a.providerData,function(a){return a.providerId==b})}function sl(a,b,c){("uid"!=b||c)&&a.hasOwnProperty(b)&&J(a,b,c)}function tl(a,b){a!=b&&(K(a,{uid:b.uid,displayName:b.displayName,photoURL:b.photoURL,email:b.email,emailVerified:b.emailVerified,phoneNumber:b.phoneNumber,isAnonymous:b.isAnonymous,providerData:[]}),b.metadata?J(a,"metadata",Zk(b.metadata)):J(a,"metadata",new Yk),v(b.providerData,function(b){ql(a,b)}),Wk(a.h,b.h),J(a,"refreshToken",a.h.a))}function ul(a){return a.F().then(function(b){var c=a.isAnonymous;return vl(a,b).then(function(){return c||sl(a,"isAnonymous",!1),b})})}function wl(a,b){b[M]&&a.qa!=b[M]&&(Uk(a.h,b),a.dispatchEvent(new al("tokenChanged")),bl(a,b[M]),sl(a,"refreshToken",a.h.a))}function vl(a,b){return P(a.b,vi,{idToken:b}).then(r(a.wc,a))}function xl(a){return(a=a.providerUserInfo)&&a.length?Ca(a,function(a){return new $k(a.rawId,a.providerId,a.email,a.displayName,a.photoUrl,a.phoneNumber)}):[]}function zl(a,b){return ul(a).then(function(){if(Ga(pl(a),b))return ll(a).then(function(){throw new L("provider-already-linked")})})}function yl(a,b,c){var d=mg(b);return b=zf(b),Me({user:a,credential:d,additionalUserInfo:b,operationType:c})}function Al(a,b){return wl(a,b),a.reload().then(function(){return a})}function Bl(a,b,c,d,e){if(!te())return C(new L("operation-not-supported-in-this-environment"));if(a.i&&!e)return C(a.i);var f=yf(c.providerId),h=se(a.uid+":::"),m=null;(!ve()||ke())&&a.u&&c.isOAuthProvider&&(m=Ti(a.u,a.m,a.o,b,c,null,h,_app2.default.SDK_VERSION||null));var p=ce(m,f&&f.Ba,f&&f.Aa);return d=d().then(function(){if(Cl(a),!e)return a.F().then(function(){})}).then(function(){return Dk(a.a,p,b,c,h,!!m)}).then(function(){return new A(function(c,d){a.ha(b,null,new L("cancelled-popup-request"),a.g||null),a.f=c,a.v=d,a.g=h,a.c=a.a.Ea(a,b,p,h)})}).then(function(a){return p&&be(p),a?Me(a):null}).s(function(a){throw p&&be(p),a}),R(a,d,e)}function Dl(a,b,c,d,e){if(!te())return C(new L("operation-not-supported-in-this-environment"));if(a.i&&!e)return C(a.i);var f=null,h=se(a.uid+":::");return d=d().then(function(){if(Cl(a),!e)return a.F().then(function(){})}).then(function(){return a.aa=h,ll(a)}).then(function(b){return a.ba&&(b=a.ba,b=b.b.set(El,a.D(),b.a)),b}).then(function(){return a.a.Ca(b,c,h)}).s(function(b){if(f=b,a.ba)return Fl(a.ba);throw f}).then(function(){if(f)throw f}),R(a,d,e)}function Cl(a){if(!a.a||!a.I){if(a.a&&!a.I)throw new L("internal-error");throw new L("auth-domain-config-required")}}function R(a,b,c){var d=Gl(a,b,c);return a.G.push(d),d.ia(function(){Ha(a.G,d)}),d}function Gl(a,b,c){return a.i&&!c?(b.cancel(),C(a.i)):b.s(function(b){throw b&&("auth/user-disabled"==b.code||"auth/user-token-expired"==b.code)&&(a.i||a.dispatchEvent(new al("userInvalidated")),a.i=b),b})}function Hl(a){if(!a.apiKey)return null;var b={apiKey:a.apiKey,authDomain:a.authDomain,appName:a.appName},c={};if(a.stsTokenManager&&a.stsTokenManager.accessToken&&a.stsTokenManager.expirationTime)c[M]=a.stsTokenManager.accessToken,c.refreshToken=a.stsTokenManager.refreshToken||null,c.expiresIn=(a.stsTokenManager.expirationTime-oa())/1E3;else return null;var d=new Q(b,c,a);return a.providerData&&v(a.providerData,function(a){a&&ql(d,Me(a))}),a.redirectEventId&&(d.aa=a.redirectEventId),d}function Il(a,b,c,d){var e=new Q(a,b);return c&&(e.ba=c),d&&el(e,d),e.reload().then(function(){return e})}function Jl(a,b,c,d){b=b||{apiKey:a.m,authDomain:a.u,appName:a.o};var e=a.h,f={};return f[M]=e.b,f.refreshToken=e.a,f.expiresIn=(e.c-oa())/1E3,b=new Q(b,f),c&&(b.ba=c),d&&el(b,d),tl(b,a),b}function Kl(a){this.a=a,this.b=Hj()}function Fl(a){return Lj(a.b,El,a.a)}function Ll(a,b){return a.b.get(El,a.a).then(function(a){return a&&b&&(a.authDomain=b),Hl(a||{})})}function Nl(a){this.a=a,this.b=Hj(),this.c=null,this.f=Ol(this),this.b.addListener(Pl("local"),this.a,r(this.g,this))}function Rl(a,b){var c=[],d;for(d in Dj)Dj[d]!==b&&c.push(Lj(a.b,Pl(Dj[d]),a.a));return c.push(Lj(a.b,Sl,a.a)),vb(c)}function Ol(a){var b=Pl("local"),c=Pl("session"),d=Pl("none");return Kj(a.b,b,a.a).then(function(){return a.b.get(c,a.a)}).then(function(e){return e?c:a.b.get(d,a.a).then(function(c){return c?d:a.b.get(b,a.a).then(function(c){return c?b:a.b.get(Sl,a.a).then(function(a){return a?Pl(a):b})})})}).then(function(b){return a.c=b,Rl(a,b.A)}).s(function(){a.c||(a.c=b)})}function Pl(a){return{name:"authUser",A:a}}function Tl(a){return Ql(a,function(){return a.b.set(Sl,a.c.A,a.a)})}function Ul(a,b){return Ql(a,function(){return a.b.set(a.c,b.D(),a.a)})}function Vl(a){return Ql(a,function(){return Lj(a.b,a.c,a.a)})}function Wl(a,b){return Ql(a,function(){return a.b.get(a.c,a.a).then(function(a){return a&&b&&(a.authDomain=b),Hl(a||{})})})}function Ql(a,b){return a.f=a.f.then(b,b),a.f}function Xl(a){if(this.m=!1,J(this,"settings",new Mk),J(this,"app",a),S(this).options&&S(this).options.apiKey)a=_app2.default.SDK_VERSION?qe(_app2.default.SDK_VERSION):null,this.b=new Ch(S(this).options&&S(this).options.apiKey,zi(Ai),a);else throw new L("invalid-api-key");this.N=[],this.o=[],this.I=[],this.Sb=_app2.default.INTERNAL.createSubscribe(r(this.kc,this)),this.O=void 0,this.Tb=_app2.default.INTERNAL.createSubscribe(r(this.mc,this)),Yl(this,null),this.h=new Nl(S(this).options.apiKey+":"+S(this).name),this.w=new Kl(S(this).options.apiKey+":"+S(this).name),this.V=T(this,Zl(this)),this.i=T(this,$l(this)),this.X=!1,this.ka=r(this.Lc,this),this.Ha=r(this.Z,this),this.qa=r(this.ac,this),this.ra=r(this.ic,this),this.sa=r(this.jc,this),am(this),this.INTERNAL={},this.INTERNAL["delete"]=r(this.delete,this),this.INTERNAL.logFramework=r(this.sc,this),this.u=0,F.call(this),bm(this),this.G=[]}function cm(a){D.call(this,"languageCodeChanged"),this.g=a}function dm(a){D.call(this,"frameworkChanged"),this.c=a}function bm(a){Object.defineProperty(a,"lc",{get:function(){return this.ea()},set:function(a){this.oa(a)},enumerable:!1}),a.W=null}function em(a){return a.Rb||C(new L("auth-domain-config-required"))}function am(a){var b=S(a).options.authDomain,c=S(a).options.apiKey;b&&te()&&(a.Rb=a.V.then(function(){if(!a.m){if(a.a=Fk(b,c,S(a).name),a.a.subscribe(a),U(a)&&ml(U(a)),a.C){ml(a.C);var d=a.C;d.oa(a.ea()),fl(d,a),d=a.C,el(d,a.G),gl(d,a),a.C=null}return a.a}}))}function fm(a,b){var c={apiKey:S(a).options.apiKey,authDomain:S(a).options.authDomain,appName:S(a).name};return a.V.then(function(){return Il(c,b,a.w,a.xa())}).then(function(b){return U(a)&&b.uid==U(a).uid?(tl(U(a),b),a.Z(b)):(Yl(a,b),ml(b),a.Z(b))}).then(function(){gm(a)})}function Yl(a,b){U(a)&&(kl(U(a),a.Ha),E(U(a),"tokenChanged",a.qa),E(U(a),"userDeleted",a.ra),E(U(a),"userInvalidated",a.sa),jl(U(a))),b&&(b.N.push(a.Ha),rc(b,"tokenChanged",a.qa),rc(b,"userDeleted",a.ra),rc(b,"userInvalidated",a.sa),0<a.u&&il(b)),J(a,"currentUser",b),b&&(b.oa(a.ea()),fl(b,a),el(b,a.G),gl(b,a))}function hm(a){var b=Ll(a.w,S(a).options.authDomain).then(function(b){return(a.C=b)&&(b.ba=a.w),Fl(a.w)});return T(a,b)}function Zl(a){var b=S(a).options.authDomain,c=hm(a).then(function(){return Wl(a.h,b)}).then(function(b){return b?(b.ba=a.w,a.C&&(a.C.aa||null)==(b.aa||null)?b:b.reload().then(function(){return Ul(a.h,b).then(function(){return b})}).s(function(c){return"auth/network-request-failed"==c.code?b:Vl(a.h)})):null}).then(function(b){Yl(a,b||null)});return T(a,c)}function $l(a){return a.V.then(function(){return a.fa()}).s(function(){}).then(function(){if(!a.m)return a.ka()}).s(function(){}).then(function(){if(!a.m){a.X=!0;var b=a.h;b.b.addListener(Pl("local"),b.a,a.ka)}})}function im(a,b){var c=null,d=null;return T(a,b.then(function(b){return c=mg(b),d=zf(b),fm(a,b)}).then(function(){return Me({user:U(a),credential:c,additionalUserInfo:d,operationType:"signIn"})}))}function S(a){return a.app}function U(a){return a.currentUser}function km(a){return U(a)&&U(a)._lat||null}function gm(a){if(a.X){for(var b=0;b<a.o.length;b++)a.o[b]&&a.o[b](km(a));if(a.O!==a.getUid()&&a.I.length)for(a.O=a.getUid(),b=0;b<a.I.length;b++)a.I[b]&&a.I[b](km(a))}}function jm(a,b){a.I.push(b),T(a,a.i.then(function(){!a.m&&Ga(a.I,b)&&a.O!==a.getUid()&&(a.O=a.getUid(),b(km(a)))}))}function T(a,b){return a.N.push(b),b.ia(function(){Ha(a.N,b)}),b}function lm(){}function mm(){this.a={},this.b=1E12}function pm(a,b){return(b=qm(b))?a.a[b]||null:null}function qm(a){return(a="undefined"==typeof a?1E12:a)?a.toString():null}function om(a,b){this.g=!1,this.c=b,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=Id(a);var c=this;this.i=function(){c.execute()},this.h?this.execute():rc(this.f,"click",this.i)}function rm(a){if(a.g)throw Error("reCAPTCHA mock was already deleted!")}function sm(){}function um(){this.b=k.grecaptcha?Infinity:0,this.f=null,this.a="__rcb"+_Mathfloor(1E6*Math.random()).toString()}function ym(a,b,c,d,e,f,h){if(J(this,"type","recaptcha"),this.c=this.f=null,this.C=!1,this.m=b,this.g=null,h?(tm||(tm=new sm),h=tm):(xm||(xm=new um),h=xm),this.o=h,this.a=c||{theme:"light",type:"image"},this.h=[],this.a[zm])throw new L("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[Am],!k.document)throw new L("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!Id(b)||!this.i&&Id(b).hasChildNodes())throw new L("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.u=new Ch(a,f||null,e||null),this.v=d||function(){return null};var m=this;this.l=[];var p=this.a[Bm];this.a[Bm]=function(a){if(Cm(m,a),"function"==typeof p)p(a);else if("string"==typeof p){var b=I(p,k);"function"==typeof b&&b(a)}};var x=this.a[Dm];this.a[Dm]=function(){if(Cm(m,null),"function"==typeof x)x();else if("string"==typeof x){var a=I(x,k);"function"==typeof a&&a()}}}function Cm(a,b){for(var c=0;c<a.l.length;c++)try{a.l[c](b)}catch(d){}}function Em(a,b){w(a.l,function(a){return a==b})}function Fm(a,b){return a.h.push(b),b.ia(function(){Ha(a.h,b)}),b}function Gm(a){if(a.C)throw new L("internal-error","RecaptchaVerifier instance has been destroyed.")}function Hm(a,b,c){var d=!1;try{this.b=c||_app2.default.app()}catch(h){throw new L("argument-error","No firebase.app.App instance is currently initialized.")}if(this.b.options&&this.b.options.apiKey)c=this.b.options.apiKey;else throw new L("invalid-api-key");var e=this,f=null;try{f=this.b.auth().xa()}catch(h){}try{d=this.b.auth().settings.appVerificationDisabledForTesting}catch(h){}f=_app2.default.SDK_VERSION?qe(_app2.default.SDK_VERSION,f):null,ym.call(this,c,a,b,function(){try{var a=e.b.auth().ea()}catch(m){a=null}return a},f,zi(Ai),d)}function Im(a,b,c,d){a:{c=Array.prototype.slice.call(c);for(var e=0,f=!1,h=0;h<b.length;h++)if(b[h].optional)f=!0;else{if(f)throw new L("internal-error","Argument validator encountered a required argument after an optional argument.");e++}if(f=b.length,c.length<e||f<c.length)d="Expected "+(e==f?1==e?"1 argument":e+" arguments":e+"-"+f+" arguments")+" but got "+c.length+".";else{for(e=0;e<c.length;e++)if(f=b[e].optional&&void 0===c[e],!b[e].M(c[e])&&!f){if(b=b[e],0>e||e>=Jm.length)throw new L("internal-error","Argument validator received an unsupported number of arguments.");c=Jm[e],d=(d?"":c+" argument ")+(b.name?"\""+b.name+"\" ":"")+"must be "+b.K+".";break a}d=null}}if(d)throw new L("argument-error",a+" failed: "+d)}function V(a,b){return{name:a||"",K:"a valid string",optional:!!b,M:l}}function Km(a,b){return{name:a||"",K:"a boolean",optional:!!b,M:ba}}function W(a,b){return{name:a||"",K:"a valid object",optional:!!b,M:q}}function Lm(a,b){return{name:a||"",K:"a function",optional:!!b,M:n}}function Mm(a,b){return{name:a||"",K:"null",optional:!!b,M:ea}}function Nm(){return{name:"",K:"an HTML element",optional:!1,M:function(a){return!!(a&&a instanceof Element)}}}function Om(){return{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(a){return!!(a&&a instanceof Xl)}}}function Pm(){return{name:"app",K:"an instance of Firebase App",optional:!0,M:function(a){return!!(a&&a instanceof _app2.default.app.App)}}}function Qm(a){return{name:a?a+"Credential":"credential",K:a?"a valid "+a+" credential":"a valid credential",optional:!1,M:function(b){if(!b)return!1;var c=!a||b.providerId===a;return b.ya&&c}}}function Rm(){return{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(a){return!!(a&&a.providerId&&a.hasOwnProperty&&a.hasOwnProperty("isOAuthProvider"))}}}function Sm(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(a){return!!(a&&l(a.type)&&n(a.verify))}}}function X(a,b,c,d){return{name:c||"",K:a.K+" or "+b.K,optional:!!d,M:function(c){return a.M(c)||b.M(c)}}}function Y(a,b){for(var c in b){var d=b[c].name;a[d]=Tm(d,a[c],b[c].j)}}function Um(a,b){for(var c in b){var d=b[c].name;d!==c&&Object.defineProperty(a,d,{get:na(function(a){return this[a]},c),set:na(function(a,b,c,d){Im(a,[c],[d],!0),this[b]=d},d,c,b[c].sb),enumerable:!0})}}function Z(a,b,c,d){a[b]=Tm(b,c,d)}function Tm(a,b,c){function d(){var a=Array.prototype.slice.call(arguments);return Im(e,c,a),b.apply(this,a)}if(!c)return b;var e=Vm(a),f;for(f in b)d[f]=b[f];for(f in b.prototype)d.prototype[f]=b.prototype[f];return d}function Vm(a){return a=a.split("."),a[a.length-1]}var aa=aa||{},k=this,ia="closure_uid_"+(1E9*Math.random()>>>0),ja=0,oa=Date.now||function(){return+new Date},g;t(u,Error),u.prototype.name="CustomError",t(ra,u),ra.prototype.name="AssertionError",ta.prototype.get=function(){if(0<this.b){this.b--;var a=this.a;this.a=a.next,a.next=null}else a=this.c();return a};var xa=new ta(function(){return new wa},function(a){a.reset()});va.prototype.add=function(a,b){var c=xa.get();c.set(a,b),this.b?this.b.next=c:this.a=c,this.b=c},wa.prototype.set=function(a,b){this.a=a,this.b=b,this.next=null},wa.prototype.reset=function(){this.next=this.b=this.a=null};var Aa=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(l(a))return l(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},v=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=l(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},Ca=Array.prototype.map?function(a,b){return Array.prototype.map.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=Array(c),e=l(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d},Da=Array.prototype.some?function(a,b){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1},La=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]},Oa=/&/g,Pa=/</g,Qa=/>/g,Ra=/"/g,Sa=/'/g,Ta=/\x00/g,Na=/[\x00&<>"']/,Va;a:{var Wa=k.navigator;if(Wa){var Xa=Wa.userAgent;if(Xa){Va=Xa;break a}}Va=""}var ab=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],jb=!1,za=new va,lb=0,nb=2,pb=3,eb,hb;qb.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var rb=new ta(function(){return new qb},function(a){a.reset()});A.prototype.then=function(a,b,c){return xb(this,n(a)?a:null,n(b)?b:null,c)},pa(A),g=A.prototype,g.ia=function(a,b){return a=sb(a,a,b),a.c=!0,yb(this,a),this},g.s=function(a,b){return xb(this,null,a,b)},g.cancel=function(a){this.a==lb&&gb(function(){var b=new ob(a);zb(this,b)},this)},g.Mc=function(a){this.a=lb,mb(this,nb,a)},g.Nc=function(a){this.a=lb,mb(this,pb,a)},g.Xb=function(){for(var a;a=Ab(this);)Bb(this,a,this.a,this.i);this.h=!1};var Gb=cb;t(ob,u),ob.prototype.name="cancel";var Ib=0,Jb={};Hb.prototype.pa=!1,Hb.prototype.ua=function(){if(this.ja)for(;this.ja.length;)this.ja.shift()()},Lb[" "]=ca;var Ob=z("Opera"),Pb=z("Trident")||z("MSIE"),Qb=z("Edge"),Rb=Qb||Pb,Sb=z("Gecko")&&(!y(Va.toLowerCase(),"webkit")||z("Edge"))&&!(z("Trident")||z("MSIE"))&&!z("Edge"),Tb=y(Va.toLowerCase(),"webkit")&&!z("Edge"),Vb;a:{var Wb="",Xb=function(){var a=Va;return Sb?/rv:([^\);]+)(\)|;)/.exec(a):Qb?/Edge\/([\d\.]+)/.exec(a):Pb?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a):Tb?/WebKit\/(\S+)/.exec(a):Ob?/(?:Version)[ \/]?(\S+)/.exec(a):void 0}();if(Xb&&(Wb=Xb?Xb[1]:""),Pb){var Yb=Ub();if(null!=Yb&&Yb>parseFloat(Wb)){Vb=Yb+"";break a}}Vb=Wb}var Nb={},ac=k.document,$b;$b=ac&&Pb?Ub()||("CSS1Compat"==ac.compatMode?parseInt(Vb,10):5):void 0;var bc=Object.freeze||function(a){return a},cc=!Pb||9<=+$b,dc=Pb&&!Zb("9"),ec=function(){if(!k.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},"passive",{get:function(){a=!0}});return k.addEventListener("test",ca,b),k.removeEventListener("test",ca,b),a}();D.prototype.preventDefault=function(){this.Jb=!1},t(fc,D);var gc=bc({2:"touch",3:"pen",4:"mouse"});fc.prototype.preventDefault=function(){fc.nb.preventDefault.call(this);var a=this.a;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,dc)try{(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)&&(a.keyCode=-1)}catch(b){}},fc.prototype.f=function(){return this.a};var hc="closure_listenable_"+(0|1E6*Math.random()),ic=0;lc.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.a[f],a||(a=this.a[f]=[],this.b++);var h=mc(a,b,d,e);return-1<h?(b=a[h],c||(b.Ia=!1)):(b=new jc(b,this.src,f,!!d,e),b.Ia=c,a.push(b)),b};var oc="closure_lm_"+(0|1E6*Math.random()),pc={},qc=0,Ec="__closure_events_fn_"+(1E9*Math.random()>>>0);t(F,Hb),F.prototype[hc]=!0,F.prototype.addEventListener=function(a,b,c,d){rc(this,a,b,c,d)},F.prototype.removeEventListener=function(a,b,c,d){E(this,a,b,c,d)},F.prototype.dispatchEvent=function(a){var c=this.Ua,b;if(c)for(b=[];c;c=c.Ua)b.push(c);c=this.Qb;var d=a.type||a;if(l(a))a=new D(a,c);else if(a instanceof D)a.target=a.target||c;else{var e=a;a=new D(d,c),bb(a,e)}if(e=!0,b)for(var f=b.length-1,h;0<=f;f--)h=a.b=b[f],e=Fc(h,d,!0,a)&&e;if(h=a.b=c,e=Fc(h,d,!0,a)&&e,e=Fc(h,d,!1,a)&&e,b)for(f=0;f<b.length;f++)h=a.b=b[f],e=Fc(h,d,!1,a)&&e;return e},F.prototype.ua=function(){if(F.nb.ua.call(this),this.l){var a=this.l,b=0,c;for(c in a.a){for(var d=a.a[c],e=0;e<d.length;e++)++b,kc(d[e]);delete a.a[c],a.b--}}this.Ua=null},g=Lc.prototype,g.S=function(){Mc(this);for(var a=[],b=0;b<this.a.length;b++)a.push(this.b[this.a[b]]);return a},g.U=function(){return Mc(this),this.a.concat()},g.clear=function(){this.b={},this.c=this.a.length=0},g.get=function(a,b){return Nc(this.b,a)?this.b[a]:b},g.set=function(a,b){Nc(this.b,a)||(this.c++,this.a.push(a)),this.b[a]=b},g.forEach=function(a,b){for(var c=this.U(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};var Oc=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;Qc.prototype.toString=function(){var a=[],b=this.c;b&&a.push(Wc(b,Xc,!0),":");var c=this.b;return(c||"file"==b)&&(a.push("//"),(b=this.l)&&a.push(Wc(b,Xc,!0),"@"),a.push(encodeURIComponent(c+"").replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c=this.i,null!=c&&a.push(":",c+"")),(c=this.g)&&(this.b&&"/"!=c.charAt(0)&&a.push("/"),a.push(Wc(c,"/"==c.charAt(0)?Yc:Zc,!0))),(c=this.a.toString())&&a.push("?",c),(c=this.h)&&a.push("#",Wc(c,$c)),a.join("")};var Xc=/[#\/\?@]/g,Zc=/[#\?:]/g,Yc=/[#\?]/g,bd=/[#\?@]/g,$c=/#/g;g=Tc.prototype,g.add=function(a,b){gd(this),this.c=null,a=jd(this,a);var c=this.a.get(a);return c||this.a.set(a,c=[]),c.push(b),this.b+=1,this},g.clear=function(){this.a=this.c=null,this.b=0},g.forEach=function(a,b){gd(this),this.a.forEach(function(c,d){v(c,function(c){a.call(b,c,d,this)},this)},this)},g.U=function(){gd(this);for(var a=this.a.S(),b=this.a.U(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c},g.S=function(a){gd(this);var b=[];if(l(a))ld(this,a)&&(b=Ia(b,this.a.get(jd(this,a))));else{a=this.a.S();for(var c=0;c<a.length;c++)b=Ia(b,a[c])}return b},g.set=function(a,b){return gd(this),this.c=null,a=jd(this,a),ld(this,a)&&(this.b-=this.a.get(a).length),this.a.set(a,[b]),this.b+=1,this},g.get=function(a,b){return a=a?this.S(a):[],0<a.length?a[0]+"":b},g.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var a=[],b=this.a.U(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(d+"");d=this.S(d);for(var f=0,h;f<d.length;f++)h=e,""!==d[f]&&(h+="="+encodeURIComponent(d[f]+"")),a.push(h)}return this.c=a.join("&")};var md=!Pb||9<=+$b;nd.prototype.ma=!0,nd.prototype.la=function(){return this.a},nd.prototype.toString=function(){return"Const{"+this.a+"}"};var od={};qd(""),rd.prototype.ma=!0,rd.prototype.la=function(){return this.a},rd.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var wd=/%{(\w+)}/g,vd=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank#/i,sd={};yd.prototype.ma=!0,yd.prototype.la=function(){return this.a},yd.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Bd=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,zd={};Dd("about:blank"),Ed.prototype.ma=!0,Ed.prototype.la=function(){return this.a},Ed.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Fd={};Hd("<!DOCTYPE html>"),Hd(""),Hd("<br>");var Kd={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"},Sd={'"':"\\\"","\\":"\\\\","/":"\\/","":"\\b","":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","":"\\u000b"},Td=/\uffff/.test("\uFFFF")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g,fe=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,de="Firefox",$d="Chrome",pe={Tc:"FirebaseCore-web",Vc:"FirebaseUI-web"};Be.prototype.get=function(){var a=k.navigator;return(a&&"boolean"==typeof a.onLine&&(ue()||"chrome-extension:"===je()||"undefined"!=typeof a.connection)?a.onLine:1)?this.b?this.c:this.a:Math.min(5E3,this.a)};var Ie={},Ke;try{var Le={};Object.defineProperty(Le,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Le,"abcd",{configurable:!0,enumerable:!0,value:2}),Ke=2==Le.abcd}catch(a){Ke=!1}var Ue="EMAIL_SIGNIN",Re="email",Se="newEmail",Te="requestType",We="email",Ve="fromEmail",Ye="data",Xe="operation";t(L,Error),L.prototype.D=function(){return{code:this.code,message:this.message}},L.prototype.toJSON=function(){return this.D()};var Ze="auth/",$e={"argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":"This operation is not supported in the environment this application is running on. \"location.protocol\" must be http, https or chrome-extension and web storage must be enabled.","popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","user-cancelled":"User did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."},df="android",kf="handleCodeInApp",hf="iOS",cf="url",ff="installApp",gf="minimumVersion",ef="packageName",jf="bundleId",nf=null,of=null;sf.prototype.f=function(){return this.b};var vf=["oauth_consumer_key","oauth_nonce","oauth_signature","oauth_signature_method","oauth_timestamp","oauth_token","oauth_version"],wf=["client_id","response_type","scope","redirect_uri","state"],xf={Uc:{Ma:"locale",Ba:500,Aa:600,Na:"facebook.com",gb:wf},Wc:{Ma:null,Ba:500,Aa:620,Na:"github.com",gb:wf},Xc:{Ma:"hl",Ba:515,Aa:680,Na:"google.com",gb:wf},cd:{Ma:"lang",Ba:485,Aa:705,Na:"twitter.com",gb:vf}},Gf="idToken",Ef="providerId";t(Ff,Hf),t(Af,Ff),t(Cf,Ff),t(Bf,Ff),t(Df,Ff),Lf.prototype.ya=function(a){return Mf(a,Nf(this))},Lf.prototype.c=function(a,b){var c=Nf(this);return c.idToken=b,Of(a,c)},Lf.prototype.f=function(a,b){var c=Nf(this);return Kf(Pf(a,c),b)},Lf.prototype.D=function(){var a={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(a.oauthIdToken=this.idToken),this.accessToken&&(a.oauthAccessToken=this.accessToken),this.secret&&(a.oauthTokenSecret=this.secret),a},Qf.prototype.Da=function(a){return this.xb=$a(a),this},t(N,Qf),N.prototype.ta=function(a){return Ga(this.a,a)||this.a.push(a),this},N.prototype.Db=function(){return Ja(this.a)},N.prototype.credential=function(a,b){if(!a&&!b)throw new L("argument-error","credential failed: must provide the ID token and/or the access token.");return new Lf(this.providerId,{idToken:a||null,accessToken:b||null},this.providerId)},t(Rf,N),J(Rf,"PROVIDER_ID","facebook.com"),J(Rf,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),t(Tf,N),J(Tf,"PROVIDER_ID","github.com"),J(Tf,"GITHUB_SIGN_IN_METHOD","github.com"),t(Vf,N),J(Vf,"PROVIDER_ID","google.com"),J(Vf,"GOOGLE_SIGN_IN_METHOD","google.com"),t(Xf,Qf),J(Xf,"PROVIDER_ID","twitter.com"),J(Xf,"TWITTER_SIGN_IN_METHOD","twitter.com"),Zf.prototype.ya=function(a){return this.signInMethod==O.EMAIL_LINK_SIGN_IN_METHOD?P(a,$f,{email:this.a,oobCode:this.b}):P(a,ag,{email:this.a,password:this.b})},Zf.prototype.c=function(a,b){return this.signInMethod==O.EMAIL_LINK_SIGN_IN_METHOD?P(a,bg,{idToken:b,email:this.a,oobCode:this.b}):P(a,cg,{idToken:b,email:this.a,password:this.b})},Zf.prototype.f=function(a,b){return Kf(this.ya(a),b)},Zf.prototype.D=function(){return{email:this.a,password:this.b,signInMethod:this.signInMethod}},K(O,{PROVIDER_ID:"password"}),K(O,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),K(O,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),fg.prototype.ya=function(a){return a.Ta(gg(this))},fg.prototype.c=function(a,b){var c=gg(this);return c.idToken=b,P(a,hg,c)},fg.prototype.f=function(a,b){var c=gg(this);return c.operation="REAUTH",a=P(a,ig,c),Kf(a,b)},fg.prototype.D=function(){var a={providerId:"phone"};return this.a.Sa&&(a.verificationId=this.a.Sa),this.a.Ra&&(a.verificationCode=this.a.Ra),this.a.Fa&&(a.temporaryProof=this.a.Fa),this.a.$&&(a.phoneNumber=this.a.$),a},jg.prototype.Ta=function(a,b){var c=this.a.b;return B(b.verify()).then(function(d){if(!l(d))throw new L("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(b.type){case"recaptcha":return kg(c,{phoneNumber:a,recaptchaToken:d}).then(function(a){return"function"==typeof b.reset&&b.reset(),a},function(a){throw"function"==typeof b.reset&&b.reset(),a});default:throw new L("argument-error","Only firebase.auth.ApplicationVerifiers with type=\"recaptcha\" are currently supported.");}})},K(jg,{PROVIDER_ID:"phone"}),K(jg,{PHONE_SIGN_IN_METHOD:"phone"}),og.prototype.D=function(){return{type:this.b,eventId:this.c,urlResponse:this.f,sessionId:this.g,error:this.a&&this.a.D()}};var rg=null;qg.prototype.subscribe=function(a){var b=this;this.a.push(a),this.b||(this.b=function(a){for(var c=0;c<b.a.length;c++)b.a[c](a)},a=I("universalLinks.subscribe",k),"function"==typeof a&&a(null,this.b))},qg.prototype.unsubscribe=function(a){w(this.a,function(b){return b==a})},t(sg,L),t(tg,L),tg.prototype.D=function(){var a={code:this.code,message:this.message};this.email&&(a.email=this.email),this.phoneNumber&&(a.phoneNumber=this.phoneNumber);var b=this.credential&&this.credential.D();return b&&bb(a,b),a},tg.prototype.toJSON=function(){return this.D()};var vg=/^[+a-zA-Z0-9_.!#$%&'*\/=?^`{|}~-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9]{2,63}$/;wg.prototype.c=null;var yg;t(zg,wg),zg.prototype.a=function(){var a=Ag(this);return a?new ActiveXObject(a):new XMLHttpRequest},zg.prototype.b=function(){var a={};return Ag(this)&&(a[0]=!0,a[1]=!0),a},yg=new zg,t(Bg,wg),Bg.prototype.a=function(){var a=new XMLHttpRequest;if("withCredentials"in a)return a;if("undefined"!=typeof XDomainRequest)return new Cg;throw Error("Unsupported browser")},Bg.prototype.b=function(){return{}},g=Cg.prototype,g.open=function(a,b,c){if(null!=c&&!c)throw Error("Only async requests are supported.");this.a.open(a,b)},g.send=function(a){if(!a)this.a.send();else if("string"==typeof a)this.a.send(a);else throw Error("Only string data is supported")},g.abort=function(){this.a.abort()},g.setRequestHeader=function(){},g.getResponseHeader=function(a){return"content-type"==a.toLowerCase()?this.a.contentType:""},g.dc=function(){this.status=200,this.responseText=this.a.responseText,Dg(this,4)},g.Eb=function(){this.status=500,this.responseText="",Dg(this,4)},g.hc=function(){this.Eb()},g.ec=function(){this.status=200,Dg(this,1)},g.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},Eg.prototype.a=null;var Fg=0;Eg.prototype.reset=function(a,b,c,d,e){"number"==typeof e||Fg++,d||oa(),delete this.a},Hg.prototype.toString=function(){return this.name};var Ig=new Hg("SEVERE",1E3),Jg=new Hg("WARNING",900),Kg=new Hg("CONFIG",700),Lg=new Hg("FINE",500);Gg.prototype.log=function(a,b,c){if(a.value>=Mg(this).value)for(n(b)&&(b=b()),a=new Eg(a,b+"",this.f),c&&(a.a=c),c=this;c;)c=c.a};var Ng={},Og=null;t(Rg,wg),Rg.prototype.a=function(){return new Sg(this.f)},Rg.prototype.b=function(a){return function(){return a}}({}),t(Sg,F);var Tg=0;g=Sg.prototype,g.open=function(a,b){if(this.readyState!=Tg)throw this.abort(),Error("Error reopening a connection");this.h=a,this.c=b,this.readyState=1,Ug(this)},g.send=function(a){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var b={headers:this.g,method:this.h,credentials:void 0,cache:void 0};a&&(b.body=a),this.i.fetch(new Request(this.c,b)).then(this.gc.bind(this),this.Fb.bind(this))},g.abort=function(){this.responseText="",this.g=new Headers,this.status=0,1<=this.readyState&&this.a&&4!=this.readyState&&(this.readyState=4,this.a=!1,Ug(this)),this.readyState=Tg},g.gc=function(a){this.a&&(this.b||(this.b=a.headers,this.readyState=2,Ug(this)),this.a&&(this.readyState=3,Ug(this),this.a&&a.text().then(this.fc.bind(this,a),this.Fb.bind(this))))},g.fc=function(a,b){this.a&&(this.status=a.status,this.statusText=a.statusText,this.responseText=b,this.readyState=4,Ug(this))},g.Fb=function(a){var b=this.f;b&&b.log(Jg,"Failed to fetch url "+this.c,a instanceof Error?a:Error(a)),this.a&&(this.readyState=4,Ug(this))},g.setRequestHeader=function(a,b){this.g.append(a,b)},g.getResponseHeader=function(a){return this.b?this.b.get(a.toLowerCase())||"":((a=this.f)&&a.log(Jg,"Attempting to get response header but no headers have been received for url: "+this.c,void 0),"")},g.getAllResponseHeaders=function(){if(!this.b){var a=this.f;return a&&a.log(Jg,"Attempting to get all response headers but no headers have been received for url: "+this.c,void 0),""}a=[];for(var b=this.b.entries(),c=b.next();!c.done;)c=c.value,a.push(c[0]+": "+c[1]),c=b.next();return a.join("\r\n")},t(Vg,F);var Wg="";Vg.prototype.b=Pg("goog.net.XhrIo");var Xg=/^https?$/i,Yg=["POST","PUT"];g=Vg.prototype,g.Ga=function(){"undefined"!=typeof aa&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",Qg(this.b,$g(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},g.abort=function(){this.a&&this.c&&(Qg(this.b,$g(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),eh(this))},g.ua=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),eh(this,!0)),Vg.nb.ua.call(this)},g.Ib=function(){this.pa||(this.I||this.i||this.f?fh(this):this.vc())},g.vc=function(){fh(this)},g.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.o){case Wg:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer;}var a=this.b;return a&&a.log(Ig,"Response type "+this.o+" is not supported on this browser",void 0),null}catch(b){return Qg(this.b,"Can not get response: "+b.message),null}},jh.prototype.cancel=function(a){if(this.a)this.c instanceof jh&&this.c.cancel();else{if(this.b){var b=this.b;delete this.b,a?b.cancel(a):(b.l--,0>=b.l&&b.cancel())}this.v?this.v.call(this.u,this):this.m=!0,this.a||(a=new kh(this),lh(this),mh(this,!1,a))}},jh.prototype.o=function(a,b){this.i=!1,mh(this,a,b)},jh.prototype.C=function(){lh(this),mh(this,!0,null)},jh.prototype.then=function(a,b,c){var f=new A(function(a,b){d=a,e=b}),d,e;return qh(this,d,function(a){a instanceof kh?f.cancel():e(a)}),f.then(a,b,c)},pa(jh),t(oh,u),oh.prototype.message="Deferred has already fired",oh.prototype.name="AlreadyCalledError",t(kh,u),kh.prototype.message="Deferred was canceled",kh.prototype.name="CanceledError",th.prototype.c=function(){throw delete sh[this.a],this.b};var sh={},zh=0,yh=1;t(xh,u),t(Bh,wg),Bh.prototype.a=function(){return new this.f},Bh.prototype.b=function(){return{}};var M="idToken",Dh=new Be(3E4,6E4),Eh={"Content-Type":"application/x-www-form-urlencoded"},Fh=new Be(3E4,6E4),Gh={"Content-Type":"application/json"},Hh;Ch.prototype.o=function(a,b,c,d,e,f){if(le()&&("undefined"==typeof k.fetch||"undefined"==typeof k.Headers||"undefined"==typeof k.Request))throw new L("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var h=new Vg(this.c);if(f){h.g=_Mathmax(0,f);var m=setTimeout(function(){h.dispatchEvent("timeout")},f)}uc(h,"complete",function(){m&&clearTimeout(m);var a=null;try{a=JSON.parse(ih(this))||null}catch(x){a=null}b&&b(a)}),Ac(h,"ready",function(){m&&clearTimeout(m),Kb(this)}),Ac(h,"timeout",function(){m&&clearTimeout(m),Kb(this),b&&b(null)}),Zg(h,a,c,d,e)};var Mh=qd("https://apis.google.com/js/client.js?onload=%{onload}"),Nh="__fcb"+_Mathfloor(1E6*Math.random()).toString();Ch.prototype.m=function(a,b,c,d,e){var f=this;Hh.then(function(){window.gapi.client.setApiKey(f.b);var h=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:a,method:c,body:d,headers:e,authType:"none",callback:function(a){window.gapi.auth.setToken(h),b&&b(a)}})}).s(function(a){b&&b({error:{message:a&&a.message||"CORS_UNSUPPORTED"}})})},Ch.prototype.Pa=function(){return P(this,$h,{})},Ch.prototype.ob=function(a,b){return P(this,ai,{idToken:a,email:b})},Ch.prototype.pb=function(a,b){return P(this,cg,{idToken:a,password:b})};var bi={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};g=Ch.prototype,g.qb=function(a,b){var c={idToken:a},d=[];return Ya(bi,function(a,f){var e=b[f];null===e?d.push(a):f in b&&(c[f]=e)}),d.length&&(c.deleteAttribute=d),P(this,ai,c)},g.jb=function(a,b){return a={requestType:"PASSWORD_RESET",email:a},bb(a,b),P(this,ci,a)},g.kb=function(a,b){return a={requestType:"EMAIL_SIGNIN",email:a},bb(a,b),P(this,di,a)},g.ib=function(a,b){return a={requestType:"VERIFY_EMAIL",idToken:a},bb(a,b),P(this,ei,a)},g.Ta=function(a){return P(this,gi,a)},g.Ya=function(a,b){return P(this,qi,{oobCode:a,newPassword:b})},g.Ja=function(a){return P(this,ri,{oobCode:a})},g.Va=function(a){return P(this,si,{oobCode:a})};var si={endpoint:"setAccountInfo",B:pi,da:"email"},ri={endpoint:"resetPassword",B:pi,J:function(a){var b=a.requestType;if(!b||!a.email&&"EMAIL_SIGNIN"!=b)throw new L("internal-error")}},ti={endpoint:"signupNewUser",B:function(a){if(Rh(a),!a.password)throw new L("weak-password")},J:Yh,R:!0},Uh={endpoint:"createAuthUri"},ui={endpoint:"deleteAccount",T:["idToken"]},ii={endpoint:"setAccountInfo",T:["idToken","deleteProvider"],B:function(a){if(!fa(a.deleteProvider))throw new L("internal-error")}},$f={endpoint:"emailLinkSignin",T:["email","oobCode"],B:Rh,J:Yh,R:!0},bg={endpoint:"emailLinkSignin",T:["idToken","email","oobCode"],B:Rh,J:Yh,R:!0},vi={endpoint:"getAccountInfo"},di={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(a){if("EMAIL_SIGNIN"!=a.requestType)throw new L("internal-error");Rh(a)},da:"email"},ei={endpoint:"getOobConfirmationCode",T:["idToken","requestType"],B:function(a){if("VERIFY_EMAIL"!=a.requestType)throw new L("internal-error")},da:"email"},ci={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(a){if("PASSWORD_RESET"!=a.requestType)throw new L("internal-error");Rh(a)},da:"email"},Xh={tb:!0,endpoint:"getProjectConfig",Hb:"GET"},wi={tb:!0,endpoint:"getRecaptchaParam",Hb:"GET",J:function(a){if(!a.recaptchaSiteKey)throw new L("internal-error")}},qi={endpoint:"resetPassword",B:pi,da:"email"},fi={endpoint:"sendVerificationCode",T:["phoneNumber","recaptchaToken"],da:"sessionInfo"},ai={endpoint:"setAccountInfo",T:["idToken"],B:Sh,R:!0},cg={endpoint:"setAccountInfo",T:["idToken"],B:function(a){if(Sh(a),!a.password)throw new L("weak-password")},J:Yh,R:!0},$h={endpoint:"signupNewUser",J:Yh,R:!0},mi={endpoint:"verifyAssertion",B:ji,J:ki,R:!0},oi={endpoint:"verifyAssertion",B:ji,J:function(a){if(a.errorMessage&&"USER_NOT_FOUND"==a.errorMessage)throw new L("user-not-found");if(a.errorMessage)throw li(a.errorMessage);if(!a[M])throw new L("internal-error")},R:!0},ni={endpoint:"verifyAssertion",B:function(a){if(ji(a),!a.idToken)throw new L("internal-error")},J:ki,R:!0},xi={endpoint:"verifyCustomToken",B:function(a){if(!a.token)throw new L("invalid-custom-token")},J:Yh,R:!0},ag={endpoint:"verifyPassword",B:function(a){if(Rh(a),!a.password)throw new L("wrong-password")},J:Yh,R:!0},gi={endpoint:"verifyPhoneNumber",B:Zh,J:Yh},hg={endpoint:"verifyPhoneNumber",B:function(a){if(!a.idToken)throw new L("internal-error");Zh(a)},J:function(a){if(a.temporaryProof)throw a.code="credential-already-in-use",ug(a);Yh(a)}},ig={Wb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",B:Zh,J:Yh},yi={Zc:{$a:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",hb:"https://securetoken.googleapis.com/v1/token",id:"p"},ad:{$a:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",hb:"https://staging-securetoken.sandbox.googleapis.com/v1/token",id:"s"},bd:{$a:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",hb:"https://test-securetoken.sandbox.googleapis.com/v1/token",id:"t"}},Ai;Ai=zi("__EID__")?"__EID__":void 0;var Hi=qd("https://apis.google.com/js/api.js?onload=%{onload}"),Ii=new Be(3E4,6E4),Ei=new Be(5E3,15E3),Ji=null;Ki.prototype.toString=function(){return this.f?G(this.a,"v",this.f):kd(this.a.a,"v"),this.b?G(this.a,"eid",this.b):kd(this.a.a,"eid"),this.c.length?G(this.a,"fw",this.c.join(",")):kd(this.a.a,"fw"),this.a.toString()},Li.prototype.toString=function(){var a=ed(this.o,"/__/auth/handler");if(G(a,"apiKey",this.m),G(a,"appName",this.c),G(a,"authType",this.l),this.a.isOAuthProvider){var b=this.a;try{var c=_app2.default.app(this.c).auth().ea()}catch(m){c=null}for(var d in b.Za=c,G(a,"providerId",this.a.providerId),b=this.a,c=xe(b.xb),c)c[d]=c[d].toString();d=b.Cc,c=$a(c);for(var e=0,f;e<d.length;e++)f=d[e],f in c&&delete c[f];b.bb&&b.Za&&!c[b.bb]&&(c[b.bb]=b.Za),Za(c)||G(a,"customParameters",we(c))}if("function"==typeof this.a.Db&&(b=this.a.Db(),b.length&&G(a,"scopes",b.join(","))),this.i?G(a,"redirectUrl",this.i):kd(a.a,"redirectUrl"),this.g?G(a,"eventId",this.g):kd(a.a,"eventId"),this.h?G(a,"v",this.h):kd(a.a,"v"),this.b)for(var h in this.b)this.b.hasOwnProperty(h)&&!cd(a,h)&&G(a,h,this.b[h]);return this.f?G(a,"eid",this.f):kd(a.a,"eid"),h=Mi(this.c),h.length&&G(a,"fw",h.join(",")),a.toString()},g=Ni.prototype,g.Ea=function(a,b,c){var d=new L("popup-closed-by-user"),e=new L("web-storage-unsupported"),f=this,h=!1;return this.ga().then(function(){Ri(f).then(function(c){c||(a&&be(a),b(e),h=!0)})}).s(function(){}).then(function(){if(!h)return ee(a)}).then(function(){if(!h)return Hc(c).then(function(){b(d)})})},g.Lb=function(){var a=H();return!ve(a)&&!ze(a)},g.Gb=function(){return!1},g.Bb=function(a,b,c,d,e,f,h){if(!a)return C(new L("popup-blocked"));if(h&&!ve())return this.ga().s(function(b){be(a),e(b)}),d(),B();this.a||(this.a=Oi(Si(this)));var m=this;return this.a.then(function(){var b=m.ga().s(function(b){throw be(a),e(b),b});return d(),b}).then(function(){if(ng(c),!h){var d=Ti(m.m,m.f,m.b,b,c,null,f,m.c,void 0,m.h);Wd(d,a)}}).s(function(a){throw"auth/network-request-failed"==a.code&&(m.a=null),a})},g.Ca=function(a,b,c){this.a||(this.a=Oi(Si(this)));var d=this;return this.a.then(function(){ng(b);var e=Ti(d.m,d.f,d.b,a,b,Vd(),c,d.c,void 0,d.h);Wd(e)}).s(function(a){throw"auth/network-request-failed"==a.code&&(d.a=null),a})},g.ga=function(){var a=this;return Pi(this).then(function(){return a.i.eb}).s(function(){throw a.a=null,new L("network-request-failed")})},g.Pb=function(){return!0},g.va=function(a){this.g.push(a)},g.Ka=function(a){w(this.g,function(b){return b==a})},g=Ui.prototype,g.get=function(a){return B(this.a.getItem(a)).then(function(a){return a&&ye(a)})},g.set=function(a,b){return B(this.a.setItem(a,we(b)))},g.P=function(a){return B(this.a.removeItem(a))},g.Y=function(){},g.ca=function(){};var Wi=[];Vi.prototype.f=function(a){var b=a.data.eventType,c=a.data.eventId,d=this.a[b];if(d&&0<d.length){a.ports[0].postMessage({status:"ack",eventId:c,eventType:b,response:null});var e=[];v(d,function(b){e.push(B().then(function(){return b(a.origin,a.data.data)}))}),wb(e).then(function(d){var e=[];v(d,function(a){e.push({fulfilled:a.Cb,value:a.value,reason:a.reason?a.reason.message:void 0})}),v(e,function(a){for(var b in a)"undefined"==typeof a[b]&&delete a[b]}),a.ports[0].postMessage({status:"done",eventId:c,eventType:b,response:e})})}},Vi.prototype.subscribe=function(a,b){Za(this.a)&&this.b.addEventListener("message",this.c),"undefined"==typeof this.a[a]&&(this.a[a]=[]),this.a[a].push(b)},Vi.prototype.unsubscribe=function(a,b){"undefined"!=typeof this.a[a]&&b?(w(this.a[a],function(a){return a==b}),0==this.a[a].length&&delete this.a[a]):b||delete this.a[a],Za(this.a)&&this.b.removeEventListener("message",this.c)},Yi.prototype.postMessage=function(a,b){this.a.postMessage(a,b)},Zi.prototype.close=function(){for(;0<this.a.length;)aj(this,this.a[0]);this.b=!0};var ej;g=bj.prototype,g.set=function(a,b){var c=!1,e=this,d;return hj(this).then(function(b){return d=b,b=ij(jj(d,!0)),kj(b.get(a))}).then(function(f){var h=ij(jj(d,!0));return f?(f.value=b,kj(h.put(f))):(e.b++,c=!0,f={},f.fbase_key=a,f.value=b,kj(h.add(f)))}).then(function(){return e.c[a]=b,lj(e,a)}).ia(function(){c&&e.b--})},g.get=function(a){return hj(this).then(function(b){return kj(ij(jj(b,!1)).get(a))}).then(function(a){return a&&a.value})},g.P=function(a){var b=!1,c=this;return hj(this).then(function(d){return b=!0,c.b++,kj(ij(jj(d,!0))["delete"](a))}).then(function(){return delete c.c[a],lj(c,a)}).ia(function(){b&&c.b--})},g.Y=function(a){0==this.a.length&&mj(this),this.a.push(a)},g.ca=function(a){w(this.a,function(b){return b==a}),0==this.a.length&&nj(this)},g=oj.prototype,g.get=function(a){return this.b.then(function(b){return b.get(a)})},g.set=function(a,b){return this.b.then(function(c){return c.set(a,b)})},g.P=function(a){return this.b.then(function(b){return b.P(a)})},g.Y=function(a){this.a.push(a)},g.ca=function(a){w(this.a,function(b){return b==a})},g=pj.prototype,g.get=function(a){return B(this.a[a])},g.set=function(a,b){return this.a[a]=b,B()},g.P=function(a){return delete this.a[a],B()},g.Y=function(){},g.ca=function(){},g=qj.prototype,g.get=function(a){var b=this;return B().then(function(){var c=b.a.getItem(a);return ye(c)})},g.set=function(a,b){var c=this;return B().then(function(){var d=we(b);null===d?c.P(a):c.a.setItem(a,d)})},g.P=function(a){var b=this;return B().then(function(){b.a.removeItem(a)})},g.Y=function(a){k.window&&rc(k.window,"storage",a)},g.ca=function(a){k.window&&E(k.window,"storage",a)},g=tj.prototype,g.get=function(){return B(null)},g.set=function(){return B()},g.P=function(){return B()},g.Y=function(){},g.ca=function(){},g=uj.prototype,g.get=function(a){var b=this;return B().then(function(){var c=b.a.getItem(a);return ye(c)})},g.set=function(a,b){var c=this;return B().then(function(){var d=we(b);null===d?c.P(a):c.a.setItem(a,d)})},g.P=function(a){var b=this;return B().then(function(){b.a.removeItem(a)})},g.Y=function(){},g.ca=function(){};var yj={A:qj,Qa:uj},zj={A:qj,Qa:uj},Aj={A:Ui,Qa:tj},Bj={A:qj,Qa:tj},Dj={Yc:"local",NONE:"none",$c:"session"},Cj,Gj;g=Fj.prototype,g.get=function(a,b){return Ij(this,a.A).get(Jj(a,b))},g.set=function(a,b,c){var d=Jj(a,c),e=this,f=Ij(this,a.A);return f.set(d,b).then(function(){return f.get(d)}).then(function(b){"local"==a.A&&(e.b[d]=b)})},g.addListener=function(a,b,c){a=Jj(a,b),this.l&&(this.b[a]=k.localStorage.getItem(a)),Za(this.a)&&(Ij(this,"local").Y(this.f),this.h||(Ud()||!Fe())&&k.indexedDB||!this.l||Mj(this)),this.a[a]||(this.a[a]=[]),this.a[a].push(c)},g.removeListener=function(a,b,c){a=Jj(a,b),this.a[a]&&(w(this.a[a],function(a){return a==c}),0==this.a[a].length&&delete this.a[a]),Za(this.a)&&(Ij(this,"local").ca(this.f),Nj(this))},g.Ob=function(a){if(a&&a.f){var b=a.a.key;if(null==b)for(var c in this.a){var d=this.b[c];"undefined"==typeof d&&(d=null);var e=k.localStorage.getItem(c);e!==d&&(this.b[c]=e,this.Wa(c))}else if(0==b.indexOf("firebase:")&&this.a[b]){if("undefined"==typeof a.a.a?Nj(this):Ij(this,"local").ca(this.f),this.o)if(c=k.localStorage.getItem(b),d=a.a.newValue,d!==c)null===d?k.localStorage.removeItem(b):k.localStorage.setItem(b,d);else if(this.b[b]===d&&"undefined"==typeof a.a.a)return;var f=this;c=function(){("undefined"!=typeof a.a.a||f.b[b]!==k.localStorage.getItem(b))&&(f.b[b]=k.localStorage.getItem(b),f.Wa(b))},Pb&&$b&&10==$b&&k.localStorage.getItem(b)!==a.a.newValue&&a.a.newValue!==a.a.oldValue?setTimeout(c,10):c()}}else v(a,r(this.Wa,this))},g.Wa=function(a){this.a[a]&&v(this.a[a],function(a){a()})};var Pj={name:"authEvent",A:"local"},Vj;t(Tj,function(){this.b=-1});for(var Uj=64,Yj=[],Zj=0;Zj<Uj-1;Zj++)Yj[Zj]=0;var ak=Ia(128,Yj);Tj.prototype.reset=function(){this.g=this.c=0,this.a=k.Int32Array?new Int32Array(this.h):Ja(this.h)};var Wj=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];t(dk,Tj);var ek=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];g=fk.prototype,g.ga=function(){return this.za?this.za:this.za=he().then(function(){if("function"!=typeof I("universalLinks.subscribe",k))throw gk("cordova-universal-links-plugin-fix is not installed");if("undefined"==typeof I("BuildInfo.packageName",k))throw gk("cordova-plugin-buildinfo is not installed");if("function"!=typeof I("cordova.plugins.browsertab.openUrl",k))throw gk("cordova-plugin-browsertab is not installed");if("function"!=typeof I("cordova.InAppBrowser.open",k))throw gk("cordova-plugin-inappbrowser is not installed")},function(){throw new L("cordova-not-ready")})},g.Ea=function(a,b){return b(new L("operation-not-supported-in-this-environment")),B()},g.Bb=function(){return C(new L("operation-not-supported-in-this-environment"))},g.Pb=function(){return!1},g.Lb=function(){return!0},g.Gb=function(){return!0},g.Ca=function(a,b,c){if(this.c)return C(new L("redirect-operation-pending"));var d=this,e=k.document,f=null,h=null,m=null,p=null;return this.c=B().then(function(){return ng(b),jk(d)}).then(function(){return kk(d,a,b,c)}).then(function(){return new A(function(a,b){h=function(){var b=I("cordova.plugins.browsertab.close",k);return a(),"function"==typeof b&&b(),d.a&&"function"==typeof d.a.close&&(d.a.close(),d.a=null),!1},d.va(h),m=function(){f||(f=Hc(2E3).then(function(){b(new L("redirect-cancelled-by-user"))}))},p=function(){Ce()&&m()},e.addEventListener("resume",m,!1),H().toLowerCase().match(/android/)||e.addEventListener("visibilitychange",p,!1)}).s(function(a){return lk(d).then(function(){throw a})})}).ia(function(){m&&e.removeEventListener("resume",m,!1),p&&e.removeEventListener("visibilitychange",p,!1),f&&f.cancel(),h&&d.Ka(h),d.c=null})},g.va=function(a){this.b.push(a),jk(this).s(function(b){"auth/invalid-cordova-configuration"===b.code&&(b=new og("unknown",null,null,null,new L("no-auth-event")),a(b))})},g.Ka=function(a){w(this.b,function(b){return b==a})};var pk={name:"pendingRedirect",A:"session"};g=tk.prototype,g.reset=function(){this.f=!1,this.a.Ka(this.i),this.a=wk(this.u,this.l,this.m)},g.Xa=function(){this.b.Xa()},g.subscribe=function(a){if(Ga(this.h,a)||this.h.push(a),!this.f){var b=this;sk(this.g).then(function(a){a?rk(b.g).then(function(){xk(b).s(function(a){var c=new og("unknown",null,null,null,new L("operation-not-supported-in-this-environment"));zk(a)&&b.ab(c)})}):yk(b)}).s(function(){yk(b)})}},g.unsubscribe=function(a){w(this.h,function(b){return b==a})},g.ab=function(a){if(!a)throw new L("invalid-auth-event");for(var b=!1,c=0,d;c<this.h.length;c++)if(d=this.h[c],d.ub(a.b,a.c)){(b=this.c[a.b])&&b.h(a,d),b=!0;break}return Ak(this.b),b};var Bk=new Be(2E3,1E4),Ck=new Be(3E4,6E4);tk.prototype.fa=function(){return this.b.fa()},tk.prototype.Ca=function(a,b,c){var d=this,e;return qk(this.g).then(function(){return d.a.Ca(a,b,c).s(function(a){if(zk(a))throw new L("operation-not-supported-in-this-environment");return e=a,rk(d.g).then(function(){throw e})}).then(function(){return d.a.Pb()?new A(function(){}):rk(d.g).then(function(){return d.fa()}).then(function(){}).s(function(){})})})},tk.prototype.Ea=function(a,b,c,d){return this.a.Ea(c,function(c){a.ha(b,null,c,d)},Bk.get())};var Ek={};uk.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},uk.prototype.h=function(a,b){if(a){this.reset(),this.g=!0;var c=a.b,d=a.c,e=a.a&&"auth/web-storage-unsupported"==a.a.code,f=a.a&&"auth/operation-not-supported-in-this-environment"==a.a.code;this.i=e||f,"unknown"!=c||e||f?a.a?(Gk(this,!0,null,a.a),B()):b.wa(c,d)?Hk(this,a,b):C(new L("invalid-auth-event")):(Gk(this,!1,null,null),B())}else C(new L("invalid-auth-event"))},uk.prototype.Xa=function(){this.g&&!this.i&&Gk(this,!1,null,null)},uk.prototype.fa=function(){var a=this;return new A(function(b,c){a.b?a.b().then(b,c):(a.f.push(b),a.c.push(c),Kk(a))})},vk.prototype.h=function(a,b){if(a){var c=a.b,d=a.c;a.a?(b.ha(a.b,null,a.a,a.c),B()):b.wa(c,d)?Lk(a,b):C(new L("invalid-auth-event"))}else C(new L("invalid-auth-event"))},Nk.prototype.confirm=function(a){return a=lg(this.verificationId,a),this.a(a)},Qk.prototype.start=function(){this.a=this.c,Rk(this,!0)},Qk.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},Tk.prototype.D=function(){return{apiKey:this.f.b,refreshToken:this.a,accessToken:this.b,expirationTime:this.c}},Tk.prototype.getToken=function(a){return a=!!a,this.b&&!this.a?C(new L("user-token-expired")):a||!this.b||oa()>this.c-3E4?this.a?Xk(this,{grant_type:"refresh_token",refresh_token:this.a}):B(null):B({accessToken:this.b,expirationTime:this.c,refreshToken:this.a})},Yk.prototype.D=function(){return{lastLoginAt:this.b,createdAt:this.a}},t(al,D),t(Q,F),Q.prototype.oa=function(a){this.ka=a,Ih(this.b,a)},Q.prototype.ea=function(){return this.ka},Q.prototype.xa=function(){return Ja(this.O)},Q.prototype.Ha=function(){this.w.b&&(this.w.stop(),this.w.start())},J(Q.prototype,"providerId","firebase"),g=Q.prototype,g.reload=function(){var a=this;return R(this,ol(this).then(function(){return ul(a).then(function(){return ll(a)}).then(nl)}))},g.cc=function(a){return this.F(a).then(function(a){return new Pk(a)})},g.F=function(a){var b=this;return R(this,ol(this).then(function(){return b.h.getToken(a)}).then(function(a){if(!a)throw new L("internal-error");return a.accessToken!=b.qa&&(bl(b,a.accessToken),b.dispatchEvent(new al("tokenChanged"))),sl(b,"refreshToken",a.refreshToken),a.accessToken}))},g.wc=function(a){if(a=a.users,!a||!a.length)throw new L("internal-error");a=a[0],cl(this,{uid:a.localId,displayName:a.displayName,photoURL:a.photoUrl,email:a.email,emailVerified:!!a.emailVerified,phoneNumber:a.phoneNumber,lastLoginAt:a.lastLoginAt,createdAt:a.createdAt});for(var b=xl(a),c=0;c<b.length;c++)ql(this,b[c]);sl(this,"isAnonymous",!(this.email&&a.passwordHash)&&!(this.providerData&&this.providerData.length))},g.fb=function(a){var b=this,c=null;return R(this,a.f(this.b,this.uid).then(function(a){return wl(b,a),c=yl(b,a,"reauthenticate"),b.i=null,b.reload()}).then(function(){return c}),!0)},g.xc=function(a){return Je("firebase.User.prototype.reauthenticateWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential instead."),this.fb(a).then(function(){})},g.cb=function(a){var b=this,c=null;return R(this,zl(this,a.providerId).then(function(){return b.F()}).then(function(c){return a.c(b.b,c)}).then(function(a){return c=yl(b,a,"link"),Al(b,a)}).then(function(){return c}))},g.oc=function(a){return Je("firebase.User.prototype.linkWithCredential is deprecated. Please use firebase.User.prototype.linkAndRetrieveDataWithCredential instead."),this.cb(a).then(function(a){return a.user})},g.pc=function(a,b){var c=this;return R(this,zl(this,"phone").then(function(){return Ok(hl(c),a,b,r(c.cb,c))}))},g.yc=function(a,b){var c=this;return R(this,B().then(function(){return Ok(hl(c),a,b,r(c.fb,c))}),!0)},g.ob=function(a){var b=this;return R(this,this.F().then(function(c){return b.b.ob(c,a)}).then(function(a){return wl(b,a),b.reload()}))},g.Qc=function(a){var b=this;return R(this,this.F().then(function(c){return a.c(b.b,c)}).then(function(a){return wl(b,a),b.reload()}))},g.pb=function(a){var b=this;return R(this,this.F().then(function(c){return b.b.pb(c,a)}).then(function(a){return wl(b,a),b.reload()}))},g.qb=function(a){if(void 0===a.displayName&&void 0===a.photoURL)return ol(this);var b=this;return R(this,this.F().then(function(c){return b.b.qb(c,{displayName:a.displayName,photoUrl:a.photoURL})}).then(function(a){return wl(b,a),sl(b,"displayName",a.displayName||null),sl(b,"photoURL",a.photoUrl||null),v(b.providerData,function(a){"password"===a.providerId&&(J(a,"displayName",b.displayName),J(a,"photoURL",b.photoURL))}),ll(b)}).then(nl))},g.Oc=function(a){var b=this;return R(this,ul(this).then(function(c){return Ga(pl(b),a)?hi(b.b,c,[a]).then(function(a){var c={};return v(a.providerUserInfo||[],function(a){c[a.providerId]=!0}),v(pl(b),function(a){c[a]||rl(b,a)}),c[jg.PROVIDER_ID]||J(b,"phoneNumber",null),ll(b)}):ll(b).then(function(){throw new L("no-such-provider")})}))},g.delete=function(){var a=this;return R(this,this.F().then(function(b){return P(a.b,ui,{idToken:b})}).then(function(){a.dispatchEvent(new al("userDeleted"))})).then(function(){for(var b=0;b<a.G.length;b++)a.G[b].cancel("app-deleted");fl(a,null),gl(a,null),a.G=[],a.C=!0,jl(a),J(a,"refreshToken",null),a.a&&a.a.unsubscribe(a)})},g.ub=function(a,b){return"linkViaPopup"==a&&(this.g||null)==b&&this.f||"reauthViaPopup"==a&&(this.g||null)==b&&this.f||"linkViaRedirect"==a&&(this.aa||null)==b||"reauthViaRedirect"==a&&(this.aa||null)==b},g.ha=function(a,b,c,d){"linkViaPopup"!=a&&"reauthViaPopup"!=a||d!=(this.g||null)||(c&&this.v?this.v(c):b&&!c&&this.f&&this.f(b),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.v)},g.wa=function(a,b){return"linkViaPopup"==a&&b==(this.g||null)?r(this.zb,this):"reauthViaPopup"==a&&b==(this.g||null)?r(this.Ab,this):"linkViaRedirect"==a&&(this.aa||null)==b?r(this.zb,this):"reauthViaRedirect"==a&&(this.aa||null)==b?r(this.Ab,this):null},g.qc=function(a){var b=this;return Bl(this,"linkViaPopup",a,function(){return zl(b,a.providerId).then(function(){return ll(b)})},!1)},g.zc=function(a){return Bl(this,"reauthViaPopup",a,function(){return B()},!0)},g.rc=function(a){var b=this;return Dl(this,"linkViaRedirect",a,function(){return zl(b,a.providerId)},!1)},g.Ac=function(a){return Dl(this,"reauthViaRedirect",a,function(){return B()},!0)},g.zb=function(a,b){var c=this;this.c&&(this.c.cancel(),this.c=null);var d=null,e=this.F().then(function(d){return Of(c.b,{requestUri:a,sessionId:b,idToken:d})}).then(function(a){return d=yl(c,a,"link"),Al(c,a)}).then(function(){return d});return R(this,e)},g.Ab=function(a,b){var c=this;this.c&&(this.c.cancel(),this.c=null);var d=null,e=B().then(function(){return Kf(Pf(c.b,{requestUri:a,sessionId:b}),c.uid)}).then(function(a){return d=yl(c,a,"reauthenticate"),wl(c,a),c.i=null,c.reload()}).then(function(){return d});return R(this,e,!0)},g.ib=function(a){var b=this,c=null;return R(this,this.F().then(function(b){return c=b,"undefined"==typeof a||Za(a)?{}:lf(new bf(a))}).then(function(a){return b.b.ib(c,a)}).then(function(a){if(b.email!=a)return b.reload()}).then(function(){}))},g.toJSON=function(){return this.D()},g.D=function(){var a={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,providerData:[],apiKey:this.m,appName:this.o,authDomain:this.u,stsTokenManager:this.h.D(),redirectEventId:this.aa||null};return this.metadata&&bb(a,this.metadata.D()),v(this.providerData,function(b){a.providerData.push(Ne(b))}),a};var El={name:"redirectUser",A:"session"};Nl.prototype.g=function(){var a=this,b=Pl("local");Ql(this,function(){return B().then(function(){return a.c&&"local"!=a.c.A?a.b.get(b,a.a):null}).then(function(c){if(c)return Rl(a,"local").then(function(){a.c=b})})})};var Sl={name:"persistence",A:"session"};Nl.prototype.lb=function(a){var b=null,c=this;return Ej(a),Ql(this,function(){return a==c.c.A?B():c.b.get(c.c,c.a).then(function(d){return b=d,Rl(c,a)}).then(function(){if(c.c=Pl(a),b)return c.b.set(c.c,b,c.a)})})},t(Xl,F),t(cm,D),t(dm,D),g=Xl.prototype,g.lb=function(a){return a=this.h.lb(a),T(this,a)},g.oa=function(a){this.W===a||this.m||(this.W=a,Ih(this.b,this.W),this.dispatchEvent(new cm(this.ea())))},g.ea=function(){return this.W},g.Rc=function(){var a=k.navigator;this.oa(a?a.languages&&a.languages[0]||a.language||a.userLanguage||null:null)},g.sc=function(a){this.G.push(a),Jh(this.b,_app2.default.SDK_VERSION?qe(_app2.default.SDK_VERSION,this.G):null),this.dispatchEvent(new dm(this.G))},g.xa=function(){return Ja(this.G)},g.toJSON=function(){return{apiKey:S(this).options.apiKey,authDomain:S(this).options.authDomain,appName:S(this).name,currentUser:U(this)&&U(this).D()}},g.ub=function(a,b){return"unknown"===a||"signInViaRedirect"===a||"signInViaPopup"===a&&this.g==b&&!!this.f},g.ha=function(a,b,c,d){"signInViaPopup"==a&&this.g==d&&(c&&this.v?this.v(c):b&&!c&&this.f&&this.f(b),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.v)},g.wa=function(a,b){return"signInViaRedirect"==a||"signInViaPopup"==a&&this.g==b&&this.f?r(this.$b,this):null},g.$b=function(a,b){var c=this;a={requestUri:a,sessionId:b},this.c&&(this.c.cancel(),this.c=null);var d=null,e=null,f=Mf(c.b,a).then(function(a){return d=mg(a),e=zf(a),a});return a=c.V.then(function(){return f}).then(function(a){return fm(c,a)}).then(function(){return Me({user:U(c),credential:d,additionalUserInfo:e,operationType:"signIn"})}),T(this,a)},g.Jc=function(a){if(!te())return C(new L("operation-not-supported-in-this-environment"));var b=this,c=yf(a.providerId),d=se(),e=null;(!ve()||ke())&&S(this).options.authDomain&&a.isOAuthProvider&&(e=Ti(S(this).options.authDomain,S(this).options.apiKey,S(this).name,"signInViaPopup",a,null,d,_app2.default.SDK_VERSION||null));var f=ce(e,c&&c.Ba,c&&c.Aa);return c=em(this).then(function(b){return Dk(b,f,"signInViaPopup",a,d,!!e)}).then(function(){return new A(function(a,c){b.ha("signInViaPopup",null,new L("cancelled-popup-request"),b.g),b.f=a,b.v=c,b.g=d,b.c=b.a.Ea(b,"signInViaPopup",f,d)})}).then(function(a){return f&&be(f),a?Me(a):null}).s(function(a){throw f&&be(f),a}),T(this,c)},g.Kc=function(a){if(!te())return C(new L("operation-not-supported-in-this-environment"));var b=this,c=em(this).then(function(){return Tl(b.h)}).then(function(){return b.a.Ca("signInViaRedirect",a)});return T(this,c)},g.fa=function(){if(!te())return C(new L("operation-not-supported-in-this-environment"));var a=this,b=em(this).then(function(){return a.a.fa()}).then(function(a){return a?Me(a):null});return T(this,b)},g.Pc=function(a){if(!a)return C(new L("null-user"));var b=this,c={};c.apiKey=S(this).options.apiKey,c.authDomain=S(this).options.authDomain,c.appName=S(this).name;var d=Jl(a,c,b.w,b.xa());return T(this,this.i.then(function(){if(S(b).options.apiKey!=a.m)return d.reload()}).then(function(){return U(b)&&a.uid==U(b).uid?(tl(U(b),a),b.Z(a)):(Yl(b,d),ml(d),b.Z(d))}).then(function(){gm(b)}))},g.mb=function(){var a=this,b=this.i.then(function(){return U(a)?(Yl(a,null),Vl(a.h).then(function(){gm(a)})):B()});return T(this,b)},g.Lc=function(){var a=this;return Wl(this.h,S(this).options.authDomain).then(function(b){if(!a.m){var c;if(c=U(a)&&b){c=U(a).uid;var d=b.uid;c=void 0===c||null===c||""===c||void 0===d||null===d||""===d?!1:c==d}if(c)return tl(U(a),b),U(a).F();(U(a)||b)&&(Yl(a,b),b&&(ml(b),b.ba=a.w),a.a&&a.a.subscribe(a),gm(a))}})},g.Z=function(a){return Ul(this.h,a)},g.ac=function(){gm(this),this.Z(U(this))},g.ic=function(){this.mb()},g.jc=function(){this.mb()},g.kc=function(a){var b=this;this.addAuthTokenListener(function(){a.next(U(b))})},g.mc=function(a){var b=this;jm(this,function(){a.next(U(b))})},g.uc=function(a,b,c){var d=this;return this.X&&_app2.default.Promise.resolve().then(function(){n(a)?a(U(d)):n(a.next)&&a.next(U(d))}),this.Sb(a,b,c)},g.tc=function(a,b,c){var d=this;return this.X&&_app2.default.Promise.resolve().then(function(){d.O=d.getUid(),n(a)?a(U(d)):n(a.next)&&a.next(U(d))}),this.Tb(a,b,c)},g.bc=function(a){var b=this,c=this.i.then(function(){return U(b)?U(b).F(a).then(function(a){return{accessToken:a}}):null});return T(this,c)},g.Mb=function(a){var b=this;return this.i.then(function(){return im(b,P(b.b,xi,{token:a}))}).then(function(a){var c=a.user;return sl(c,"isAnonymous",!1),b.Z(c),a})},g.Dc=function(a){return Je("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCustomToken is deprecated. Please use firebase.auth.Auth.prototype.signInWithCustomToken instead."),this.Mb(a)},g.Ec=function(a,b){return Je("firebase.auth.Auth.prototype.signInAndRetrieveDataWithEmailAndPassword is deprecated. Please use firebase.auth.Auth.prototype.signInWithEmailAndPassword instead."),this.Nb(a,b)},g.Nb=function(a,b){var c=this;return this.i.then(function(){return im(c,P(c.b,ag,{email:a,password:b}))})},g.wb=function(a,b){var c=this;return this.i.then(function(){return im(c,P(c.b,ti,{email:a,password:b}))})},g.Vb=function(a,b){return Je("firebase.auth.Auth.prototype.createUserAndRetrieveDataWithEmailAndPassword is deprecated. Please use firebase.auth.Auth.prototype.createUserWithEmailAndPassword instead."),this.wb(a,b)},g.Gc=function(a){return Je("firebase.auth.Auth.prototype.signInWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential instead."),this.Oa(a).then(function(a){return a.user})},g.Oa=function(a){var b=this;return this.i.then(function(){return im(b,a.ya(b.b))})},g.Pa=function(){var a=this;return this.i.then(function(){var b=U(a);if(b&&b.isAnonymous){var c=Me({providerId:null,isNewUser:!1});return Me({user:b,credential:null,additionalUserInfo:c,operationType:"signIn"})}return im(a,a.b.Pa()).then(function(b){var c=b.user;return sl(c,"isAnonymous",!0),a.Z(c),b})})},g.Fc=function(){return Je("firebase.auth.Auth.prototype.signInAnonymouslyAndRetrieveData is deprecated. Please use firebase.auth.Auth.prototype.signInAnonymously instead."),this.Pa()},g.getUid=function(){return U(this)&&U(this).uid||null},g.Ub=function(a){this.addAuthTokenListener(a),this.u++,0<this.u&&U(this)&&il(U(this))},g.Bc=function(a){var b=this;v(this.o,function(c){c==a&&b.u--}),0>this.u&&(this.u=0),0==this.u&&U(this)&&jl(U(this)),this.removeAuthTokenListener(a)},g.addAuthTokenListener=function(a){var b=this;this.o.push(a),T(this,this.i.then(function(){b.m||Ga(b.o,a)&&a(km(b))}))},g.removeAuthTokenListener=function(a){w(this.o,function(b){return b==a})},g.delete=function(){this.m=!0;for(var a=0;a<this.N.length;a++)this.N[a].cancel("app-deleted");return this.N=[],this.h&&(a=this.h,a.b.removeListener(Pl("local"),a.a,this.ka)),this.a&&(this.a.unsubscribe(this),this.a.Xa()),_app2.default.Promise.resolve()},g.Yb=function(a){return Je("firebase.auth.Auth.prototype.fetchProvidersForEmail is deprecated. Please use firebase.auth.Auth.prototype.fetchSignInMethodsForEmail instead."),T(this,Th(this.b,a))},g.Zb=function(a){return T(this,Vh(this.b,a))},g.nc=function(a){return!!eg(a)},g.kb=function(a,b){var c=this;return T(this,B().then(function(){var a=new bf(b);if(!a.c)throw new L("argument-error",kf+" must be true when sending sign in link to email");return lf(a)}).then(function(b){return c.b.kb(a,b)}).then(function(){}))},g.Sc=function(a){return this.Ja(a).then(function(a){return a.data.email})},g.Ya=function(a,b){return T(this,this.b.Ya(a,b).then(function(){}))},g.Ja=function(a){return T(this,this.b.Ja(a).then(function(a){return new Qe(a)}))},g.Va=function(a){return T(this,this.b.Va(a).then(function(){}))},g.jb=function(a,b){var c=this;return T(this,B().then(function(){return"undefined"==typeof b||Za(b)?{}:lf(new bf(b))}).then(function(b){return c.b.jb(a,b)}).then(function(){}))},g.Ic=function(a,b){return T(this,Ok(this,a,b,r(this.Oa,this)))},g.Hc=function(a,b){var c=this;return T(this,B().then(function(){var d=dg(a,b||Vd());return c.Oa(d)}))},lm.prototype.render=function(){},lm.prototype.reset=function(){},lm.prototype.getResponse=function(){},lm.prototype.execute=function(){};var nm=null;mm.prototype.render=function(a,b){return this.a[this.b.toString()]=new om(a,b),this.b++},mm.prototype.reset=function(a){var b=pm(this,a);a=qm(a),b&&a&&(b.delete(),delete this.a[a])},mm.prototype.getResponse=function(a){return(a=pm(this,a))?a.getResponse():null},mm.prototype.execute=function(a){(a=pm(this,a))&&a.execute()},om.prototype.getResponse=function(){return rm(this),this.b},om.prototype.execute=function(){rm(this);var a=this;this.a||(this.a=setTimeout(function(){a.b=oe();var b=a.c.callback,c=a.c["expired-callback"];if(b)try{b(a.b)}catch(d){}a.a=setTimeout(function(){if(a.a=null,a.b=null,c)try{c()}catch(d){}a.h&&a.execute()},6E4)},500))},om.prototype.delete=function(){rm(this),this.g=!0,clearTimeout(this.a),this.a=null,E(this.f,"click",this.i)},sm.prototype.g=function(){return nm||(nm=new mm),B(nm)},sm.prototype.c=function(){};var tm=null,vm=qd("https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),wm=new Be(3E4,6E4);um.prototype.g=function(a){var b=this;return new A(function(c,d){var e=setTimeout(function(){d(new L("network-request-failed"))},wm.get());if(!k.grecaptcha||a!==b.f&&!b.b){k[b.a]=function(){if(k.grecaptcha){b.f=a;var f=k.grecaptcha.render;k.grecaptcha.render=function(a,c){return a=f(a,c),b.b++,a},clearTimeout(e),c(k.grecaptcha)}else clearTimeout(e),d(new L("internal-error"));delete k[b.a]};var f=ud(vm,{onload:b.a,hl:a||""});B(uh(f)).s(function(){clearTimeout(e),d(new L("internal-error","Unable to load external reCAPTCHA dependencies!"))})}else clearTimeout(e),c(k.grecaptcha)})},um.prototype.c=function(){this.b--};var xm=null,Bm="callback",Dm="expired-callback",zm="sitekey",Am="size";g=ym.prototype,g.za=function(){var a=this;return this.f?this.f:this.f=Fm(this,B().then(function(){if(ue()&&!le())return ge();throw new L("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")}).then(function(){return a.o.g(a.v())}).then(function(b){return a.g=b,P(a.u,wi,{})}).then(function(b){a.a[zm]=b.recaptchaSiteKey}).s(function(b){throw a.f=null,b}))},g.render=function(){Gm(this);var a=this;return Fm(this,this.za().then(function(){if(null===a.c){var b=a.m;if(!a.i){var c=Id(b);b=Ld("DIV"),c.appendChild(b)}a.c=a.g.render(b,a.a)}return a.c}))},g.verify=function(){Gm(this);var a=this;return Fm(this,this.render().then(function(b){return new A(function(c){var d=a.g.getResponse(b);if(d)c(d);else{var e=function e(b){b&&(Em(a,e),c(b))};a.l.push(e),a.i&&a.g.execute(a.c)}})}))},g.reset=function(){Gm(this),null!==this.c&&this.g.reset(this.c)},g.clear=function(){Gm(this),this.C=!0,this.o.c();for(var a=0;a<this.h.length;a++)this.h[a].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i){a=Id(this.m);for(var b;b=a.firstChild;)a.removeChild(b)}},t(Hm,ym);var Jm=["First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth"];Y(Xl.prototype,{Va:{name:"applyActionCode",j:[V("code")]},Ja:{name:"checkActionCode",j:[V("code")]},Ya:{name:"confirmPasswordReset",j:[V("code"),V("newPassword")]},wb:{name:"createUserWithEmailAndPassword",j:[V("email"),V("password")]},Vb:{name:"createUserAndRetrieveDataWithEmailAndPassword",j:[V("email"),V("password")]},Yb:{name:"fetchProvidersForEmail",j:[V("email")]},Zb:{name:"fetchSignInMethodsForEmail",j:[V("email")]},fa:{name:"getRedirectResult",j:[]},nc:{name:"isSignInWithEmailLink",j:[V("emailLink")]},tc:{name:"onAuthStateChanged",j:[X(W(),Lm(),"nextOrObserver"),Lm("opt_error",!0),Lm("opt_completed",!0)]},uc:{name:"onIdTokenChanged",j:[X(W(),Lm(),"nextOrObserver"),Lm("opt_error",!0),Lm("opt_completed",!0)]},jb:{name:"sendPasswordResetEmail",j:[V("email"),X(W("opt_actionCodeSettings",!0),Mm(null,!0),"opt_actionCodeSettings",!0)]},kb:{name:"sendSignInLinkToEmail",j:[V("email"),W("actionCodeSettings")]},lb:{name:"setPersistence",j:[V("persistence")]},Oa:{name:"signInAndRetrieveDataWithCredential",j:[Qm()]},Pa:{name:"signInAnonymously",j:[]},Fc:{name:"signInAnonymouslyAndRetrieveData",j:[]},Gc:{name:"signInWithCredential",j:[Qm()]},Mb:{name:"signInWithCustomToken",j:[V("token")]},Dc:{name:"signInAndRetrieveDataWithCustomToken",j:[V("token")]},Nb:{name:"signInWithEmailAndPassword",j:[V("email"),V("password")]},Hc:{name:"signInWithEmailLink",j:[V("email"),V("emailLink",!0)]},Ec:{name:"signInAndRetrieveDataWithEmailAndPassword",j:[V("email"),V("password")]},Ic:{name:"signInWithPhoneNumber",j:[V("phoneNumber"),Sm()]},Jc:{name:"signInWithPopup",j:[Rm()]},Kc:{name:"signInWithRedirect",j:[Rm()]},Pc:{name:"updateCurrentUser",j:[X(function(a){return{name:"user",K:"an instance of Firebase User",optional:!!a,M:function(a){return!!(a&&a instanceof Q)}}}(),Mm(),"user")]},mb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[V(null,!0)]},Rc:{name:"useDeviceLanguage",j:[]},Sc:{name:"verifyPasswordResetCode",j:[V("code")]}}),Um(Xl.prototype,{lc:{name:"languageCode",sb:X(V(),Mm(),"languageCode")}}),Xl.Persistence=Dj,Xl.Persistence.LOCAL="local",Xl.Persistence.SESSION="session",Xl.Persistence.NONE="none",Y(Q.prototype,{delete:{name:"delete",j:[]},cc:{name:"getIdTokenResult",j:[Km("opt_forceRefresh",!0)]},F:{name:"getIdToken",j:[Km("opt_forceRefresh",!0)]},cb:{name:"linkAndRetrieveDataWithCredential",j:[Qm()]},oc:{name:"linkWithCredential",j:[Qm()]},pc:{name:"linkWithPhoneNumber",j:[V("phoneNumber"),Sm()]},qc:{name:"linkWithPopup",j:[Rm()]},rc:{name:"linkWithRedirect",j:[Rm()]},fb:{name:"reauthenticateAndRetrieveDataWithCredential",j:[Qm()]},xc:{name:"reauthenticateWithCredential",j:[Qm()]},yc:{name:"reauthenticateWithPhoneNumber",j:[V("phoneNumber"),Sm()]},zc:{name:"reauthenticateWithPopup",j:[Rm()]},Ac:{name:"reauthenticateWithRedirect",j:[Rm()]},reload:{name:"reload",j:[]},ib:{name:"sendEmailVerification",j:[X(W("opt_actionCodeSettings",!0),Mm(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[V(null,!0)]},Oc:{name:"unlink",j:[V("provider")]},ob:{name:"updateEmail",j:[V("email")]},pb:{name:"updatePassword",j:[V("password")]},Qc:{name:"updatePhoneNumber",j:[Qm("phone")]},qb:{name:"updateProfile",j:[W("profile")]}}),Y(mm.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Y(lm.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Y(A.prototype,{ia:{name:"finally"},s:{name:"catch"},then:{name:"then"}}),Um(Mk.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",sb:Km("appVerificationDisabledForTesting")}}),Y(Nk.prototype,{confirm:{name:"confirm",j:[V("verificationCode")]}}),Z(O,"credential",function(a,b){return new Zf(a,b)},[V("email"),V("password")]),Y(Rf.prototype,{ta:{name:"addScope",j:[V("scope")]},Da:{name:"setCustomParameters",j:[W("customOAuthParameters")]}}),Z(Rf,"credential",Sf,[X(V(),W(),"token")]),Z(O,"credentialWithLink",dg,[V("email"),V("emailLink")]),Y(Tf.prototype,{ta:{name:"addScope",j:[V("scope")]},Da:{name:"setCustomParameters",j:[W("customOAuthParameters")]}}),Z(Tf,"credential",Uf,[X(V(),W(),"token")]),Y(Vf.prototype,{ta:{name:"addScope",j:[V("scope")]},Da:{name:"setCustomParameters",j:[W("customOAuthParameters")]}}),Z(Vf,"credential",Wf,[X(V(),X(W(),Mm()),"idToken"),X(V(),Mm(),"accessToken",!0)]),Y(Xf.prototype,{Da:{name:"setCustomParameters",j:[W("customOAuthParameters")]}}),Z(Xf,"credential",Yf,[X(V(),W(),"token"),V("secret",!0)]),Y(N.prototype,{ta:{name:"addScope",j:[V("scope")]},credential:{name:"credential",j:[X(V(),Mm(),"idToken",!0),X(V(),Mm(),"accessToken",!0)]},Da:{name:"setCustomParameters",j:[W("customOAuthParameters")]}}),Z(jg,"credential",lg,[V("verificationId"),V("verificationCode")]),Y(jg.prototype,{Ta:{name:"verifyPhoneNumber",j:[V("phoneNumber"),Sm()]}}),Y(L.prototype,{toJSON:{name:"toJSON",j:[V(null,!0)]}}),Y(tg.prototype,{toJSON:{name:"toJSON",j:[V(null,!0)]}}),Y(sg.prototype,{toJSON:{name:"toJSON",j:[V(null,!0)]}}),Y(Hm.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),function(){if("undefined"!=typeof _app2.default&&_app2.default.INTERNAL&&_app2.default.INTERNAL.registerService){var a={Auth:Xl,Error:L};Z(a,"EmailAuthProvider",O,[]),Z(a,"FacebookAuthProvider",Rf,[]),Z(a,"GithubAuthProvider",Tf,[]),Z(a,"GoogleAuthProvider",Vf,[]),Z(a,"TwitterAuthProvider",Xf,[]),Z(a,"OAuthProvider",N,[V("providerId")]),Z(a,"PhoneAuthProvider",jg,[Om()]),Z(a,"RecaptchaVerifier",Hm,[X(V(),Nm(),"recaptchaContainer"),W("recaptchaParameters",!0),Pm()]),_app2.default.INTERNAL.registerService("auth",function(a,c){return a=new Xl(a),c({INTERNAL:{getUid:r(a.getUid,a),getToken:r(a.bc,a),addAuthTokenListener:r(a.Ub,a),removeAuthTokenListener:r(a.Bc,a)}}),a},a,function(a,c){if("create"===a)try{c.auth()}catch(d){}}),_app2.default.INTERNAL.extendNamespace({User:Q})}else throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.")}()}).apply("undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)}).call(exports,__webpack_require__("h6ac"))},FFEI:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function consumeColor(stream){if(stream.peek()===HASH){stream.start=stream.pos,stream.next(),stream.eat(116)||stream.eatWhile(isHex);var base=stream.current();if(stream.start=stream.pos,stream.eat(DOT)&&!stream.eatWhile(_streamReaderUtils.isNumber))throw stream.error("Unexpected character for alpha value of color");return new Color(base,stream.current())}}function isHex(code){return(0,_streamReaderUtils.isNumber)(code)||(0,_streamReaderUtils.isAlpha)(code,65,70)}function isShortHex(hex){return!(hex%17)}function toShortHex(num){return(num>>4).toString(16)}function _toHex(num){return pad(num.toString(16),2)}function pad(value,len){for(;value.length<len;)value="0"+value;return value}function isAlphaNumericWord(code){return(0,_streamReaderUtils.isNumber)(code)||isAlphaWord(code)}function isAlphaWord(code){return 95===code||(0,_streamReaderUtils.isAlpha)(code)}function consumeNumericValue(stream){if(stream.start=stream.pos,eatNumber(stream)){var num=stream.current();return stream.start=stream.pos,stream.eat(PERCENT)||stream.eatWhile(isAlphaWord),new NumericValue(num,stream.current())}}function eatNumber(stream){var start=stream.pos,negative=stream.eat(DASH),afterNegative=stream.pos;stream.eatWhile(_streamReaderUtils.isNumber);var prevPos=stream.pos;return stream.eat(DOT$1)&&!stream.eatWhile(_streamReaderUtils.isNumber)&&(stream.pos=prevPos),stream.pos===afterNegative&&(stream.pos=start),stream.pos!==start}function consumeKeyword(stream,short){return stream.start=stream.pos,stream.eat(DOLLAR)||stream.eat(AT)?stream.eatWhile(isVariableName):short?stream.eatWhile(isAlphaWord):stream.eatWhile(isKeyword),stream.start===stream.pos?null:new Keyword(stream.current())}function isKeyword(code){return isAlphaNumericWord(code)||code===DASH$1}function isVariableName(code){return 45===code||isAlphaNumericWord(code)}function consumeQuoted(stream){if((0,_streamReaderUtils.eatQuoted)(stream,opt))return new QuotedString(stream.current())}function consumeArgumentList(stream){if(!stream.eat(LBRACE))return null;for(var arg=void 0,argsList=[];!stream.eof();)if(arg=consumeArgument(stream))argsList.push(arg);else{if(stream.eatWhile(_streamReaderUtils.isWhiteSpace),stream.eat(RBRACE))break;if(!stream.eat(COMMA))throw stream.error("Expected , or )")}return argsList}function consumeArgument(stream){for(var result=new CSSValue,value=void 0;!stream.eof()&&(stream.eatWhile(_streamReaderUtils.isWhiteSpace),value=consumeNumericValue(stream)||consumeColor(stream)||consumeQuoted(stream)||consumeKeywordOrFunction(stream),!!value);)result.add(value);return result.size?result:null}function consumeKeywordOrFunction(stream){var kw=consumeKeyword(stream);if(kw){var args=consumeArgumentList(stream);return args?new FunctionCall(kw.toString(),args):kw}}function consumeIdent(stream){return stream.start=stream.pos,stream.eatWhile(isIdentPrefix),stream.eatWhile(isIdent),stream.start===stream.pos?null:stream.current()}function consumeValue(stream){for(var values=new CSSValue,value=void 0;!stream.eof()&&(stream.eat(COLON),(value=consumeNumericValue(stream)||consumeColor(stream))?!value.unit&&stream.eat(DASH$2):(stream.eat(DASH$2),value=consumeKeyword(stream,!0)),!!value);)values.add(value);return values}function isIdent(code){return isAlphaWord(code)}function isIdentPrefix(code){return code===AT$1||code===DOLLAR$1||code===EXCL}exports.__esModule=!0;var _createClass=function(){function defineProperties(target,props){for(var i=0,descriptor;i<props.length;i++)descriptor=props[i],descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_streamReaderUtils=__webpack_require__("rc1b"),_node=__webpack_require__("aBJ1"),_node2=_interopRequireDefault(_node),_streamReader=__webpack_require__("Lu2N"),_streamReader2=_interopRequireDefault(_streamReader),CSSValue=function(){function CSSValue(){_classCallCheck(this,CSSValue),this.type="css-value",this.value=[]}return CSSValue.prototype.add=function(value){this.value.push(value)},CSSValue.prototype.has=function(value){return-1!==this.value.indexOf(value)},CSSValue.prototype.toString=function(){return this.value.join(" ")},_createClass(CSSValue,[{key:"size",get:function(){return this.value.length}}]),CSSValue}(),HASH=35,DOT=46,Color=function(){function Color(value,alpha){_classCallCheck(this,Color),this.type="color",this.raw=value,this.alpha=+(null!=alpha&&""!==alpha?alpha:1),value=value.slice(1);var r=0,g=0,b=0;if("t"===value)this.alpha=0;else switch(value.length){case 0:break;case 1:r=g=b=value+value;break;case 2:r=g=b=value;break;case 3:r=value[0]+value[0],g=value[1]+value[1],b=value[2]+value[2];break;default:value+=value,r=value.slice(0,2),g=value.slice(2,4),b=value.slice(4,6);}this.r=parseInt(r,16),this.g=parseInt(g,16),this.b=parseInt(b,16)}return Color.prototype.toHex=function(short){var fn=short&&isShortHex(this.r)&&isShortHex(this.g)&&isShortHex(this.b)?toShortHex:_toHex;return"#"+fn(this.r)+fn(this.g)+fn(this.b)},Color.prototype.toRGB=function(){var values=[this.r,this.g,this.b];return 1!==this.alpha&&values.push(this.alpha.toFixed(8).replace(/\.?0+$/,"")),(3===values.length?"rgb":"rgba")+"("+values.join(", ")+")"},Color.prototype.toString=function(short){return this.r||this.g||this.b||this.alpha?1===this.alpha?this.toHex(short):this.toRGB():"transparent"},Color}(),PERCENT=37,DOT$1=46,DASH=45,NumericValue=function(){function NumericValue(value,unit){_classCallCheck(this,NumericValue),this.type="numeric",this.value=+value,this.unit=unit||""}return NumericValue.prototype.toString=function(){return""+this.value+this.unit},NumericValue}(),DOLLAR=36,DASH$1=45,AT=64,Keyword=function(){function Keyword(value){_classCallCheck(this,Keyword),this.type="keyword",this.value=value}return Keyword.prototype.toString=function(){return this.value},Keyword}(),opt={throws:!0},QuotedString=function(){function QuotedString(value){_classCallCheck(this,QuotedString),this.type="string",this.value=value}return QuotedString.prototype.toString=function(){return this.value},QuotedString}(),LBRACE=40,RBRACE=41,COMMA=44,FunctionCall=function(){function FunctionCall(name,args){_classCallCheck(this,FunctionCall),this.type="function",this.name=name,this.args=args||[]}return FunctionCall.prototype.toString=function(){return this.name+"("+this.args.join(", ")+")"},FunctionCall}(),EXCL=33,DOLLAR$1=36,DASH$2=45,COLON=58,AT$1=64;exports.default=function(abbr){for(var root=new _node2.default,stream=new _streamReader2.default(abbr),node;!stream.eof();){node=new _node2.default(consumeIdent(stream)),node.value=consumeValue(stream);var args=consumeArgumentList(stream);if(args)for(var i=0;i<args.length;i++)node.setAttribute(i+"",args[i]);if(stream.eat(EXCL)&&node.value.add("!"),root.appendChild(node),!stream.eat(43))break}if(!stream.eof())throw stream.error("Unexpected character");return root}},FRpO:function(module){"use strict";function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||0>n||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length))if(er=arguments[1],er instanceof Error)throw er;else{var err=new Error("Uncaught, unspecified \"error\" event. ("+er+")");throw err.context=er,err}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1),handler.apply(this,args);}else if(isObject(handler))for(args=Array.prototype.slice.call(arguments,1),listeners=handler.slice(),len=listeners.length,i=0;i<len;i++)listeners[i].apply(this,args);return!0},EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener),this._events[type]?isObject(this._events[type])?this._events[type].push(listener):this._events[type]=[this._events[type],listener]:this._events[type]=listener,isObject(this._events[type])&&!this._events[type].warned&&(m=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,m&&0<m&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace())),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;0<i--;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(0>position)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){var ret;return ret=this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[],ret},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},GIDK:function(module,exports,__webpack_require__){"use strict";function zswap32(q){return(255&q>>>24)+(65280&q>>>8)+((65280&q)<<8)+((255&q)<<24)}function InflateState(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new utils.Buf16(320),this.work=new utils.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function inflateResetKeep(strm){var state;return strm&&strm.state?(state=strm.state,strm.total_in=strm.total_out=state.total=0,strm.msg="",state.wrap&&(strm.adler=1&state.wrap),state.mode=HEAD,state.last=0,state.havedict=0,state.dmax=32768,state.head=null,state.hold=0,state.bits=0,state.lencode=state.lendyn=new utils.Buf32(ENOUGH_LENS),state.distcode=state.distdyn=new utils.Buf32(ENOUGH_DISTS),state.sane=1,state.back=-1,Z_OK):Z_STREAM_ERROR}function inflateReset(strm){var state;return strm&&strm.state?(state=strm.state,state.wsize=0,state.whave=0,state.wnext=0,inflateResetKeep(strm)):Z_STREAM_ERROR}function inflateReset2(strm,windowBits){var wrap,state;return strm&&strm.state?(state=strm.state,0>windowBits?(wrap=0,windowBits=-windowBits):(wrap=(windowBits>>4)+1,48>windowBits&&(windowBits&=15)),windowBits&&(8>windowBits||15<windowBits))?Z_STREAM_ERROR:(null!==state.window&&state.wbits!==windowBits&&(state.window=null),state.wrap=wrap,state.wbits=windowBits,inflateReset(strm)):Z_STREAM_ERROR}function inflateInit2(strm,windowBits){var ret,state;return strm?(state=new InflateState,strm.state=state,state.window=null,ret=inflateReset2(strm,windowBits),ret!==Z_OK&&(strm.state=null),ret):Z_STREAM_ERROR}function fixedtables(state){if(virgin){var sym;for(lenfix=new utils.Buf32(512),distfix=new utils.Buf32(32),sym=0;144>sym;)state.lens[sym++]=8;for(;256>sym;)state.lens[sym++]=9;for(;280>sym;)state.lens[sym++]=7;for(;288>sym;)state.lens[sym++]=8;for(inflate_table(LENS,state.lens,0,288,lenfix,0,state.work,{bits:9}),sym=0;32>sym;)state.lens[sym++]=5;inflate_table(DISTS,state.lens,0,32,distfix,0,state.work,{bits:5}),virgin=!1}state.lencode=lenfix,state.lenbits=9,state.distcode=distfix,state.distbits=5}function updatewindow(strm,src,end,copy){var state=strm.state,dist;return null===state.window&&(state.wsize=1<<state.wbits,state.wnext=0,state.whave=0,state.window=new utils.Buf8(state.wsize)),copy>=state.wsize?(utils.arraySet(state.window,src,end-state.wsize,state.wsize,0),state.wnext=0,state.whave=state.wsize):(dist=state.wsize-state.wnext,dist>copy&&(dist=copy),utils.arraySet(state.window,src,end-copy,dist,state.wnext),copy-=dist,copy?(utils.arraySet(state.window,src,end-copy,copy,0),state.wnext=copy,state.whave=state.wsize):(state.wnext+=dist,state.wnext===state.wsize&&(state.wnext=0),state.whave<state.wsize&&(state.whave+=dist))),0}var _StringfromCharCode4=String.fromCharCode,utils=__webpack_require__("tbG5"),adler32=__webpack_require__("uxo6"),crc32=__webpack_require__("X4kj"),inflate_fast=__webpack_require__("LP5M"),inflate_table=__webpack_require__("2u+n"),LENS=1,DISTS=2,Z_FINISH=4,Z_TREES=6,Z_OK=0,Z_STREAM_ERROR=-2,Z_DATA_ERROR=-3,Z_MEM_ERROR=-4,Z_DEFLATED=8,HEAD=1,FLAGS=2,TIME=3,OS=4,EXLEN=5,EXTRA=6,NAME=7,COMMENT=8,HCRC=9,DICTID=10,DICT=11,TYPE=12,TYPEDO=13,STORED=14,COPY_=15,COPY=16,TABLE=17,LENLENS=18,CODELENS=19,LEN_=20,LEN=21,LENEXT=22,DIST=23,DISTEXT=24,MATCH=25,LIT=26,CHECK=27,LENGTH=28,DONE=29,BAD=30,MEM=31,ENOUGH_LENS=852,ENOUGH_DISTS=592,virgin=!0,lenfix,distfix;exports.inflateReset=inflateReset,exports.inflateReset2=inflateReset2,exports.inflateResetKeep=inflateResetKeep,exports.inflateInit=function(strm){return inflateInit2(strm,15)},exports.inflateInit2=inflateInit2,exports.inflate=function(strm,flush){var here=0,hbuf=new utils.Buf8(4),order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],state,input,output,next,put,have,left,hold,bits,_in,_out,copy,from,from_source,here_bits,here_op,here_val,last_bits,last_op,last_val,len,ret,opts,n;if(!strm||!strm.state||!strm.output||!strm.input&&0!==strm.avail_in)return Z_STREAM_ERROR;state=strm.state,state.mode===TYPE&&(state.mode=TYPEDO),put=strm.next_out,output=strm.output,left=strm.avail_out,next=strm.next_in,input=strm.input,have=strm.avail_in,hold=state.hold,bits=state.bits,_in=have,_out=left,ret=Z_OK;inf_leave:for(;;)switch(state.mode){case HEAD:if(0===state.wrap){state.mode=TYPEDO;break}for(;16>bits;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(2&state.wrap&&35615===hold){state.check=0,hbuf[0]=255&hold,hbuf[1]=255&hold>>>8,state.check=crc32(state.check,hbuf,2,0),hold=0,bits=0,state.mode=FLAGS;break}if(state.flags=0,state.head&&(state.head.done=!1),!(1&state.wrap)||(((255&hold)<<8)+(hold>>8))%31){strm.msg="incorrect header check",state.mode=BAD;break}if((15&hold)!=Z_DEFLATED){strm.msg="unknown compression method",state.mode=BAD;break}if(hold>>>=4,bits-=4,len=(15&hold)+8,0===state.wbits)state.wbits=len;else if(len>state.wbits){strm.msg="invalid window size",state.mode=BAD;break}state.dmax=1<<len,strm.adler=state.check=1,state.mode=512&hold?DICTID:TYPE,hold=0,bits=0;break;case FLAGS:for(;16>bits;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(state.flags=hold,(255&state.flags)!=Z_DEFLATED){strm.msg="unknown compression method",state.mode=BAD;break}if(57344&state.flags){strm.msg="unknown header flags set",state.mode=BAD;break}state.head&&(state.head.text=1&hold>>8),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=255&hold>>>8,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0,state.mode=TIME;case TIME:for(;32>bits;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.head&&(state.head.time=hold),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=255&hold>>>8,hbuf[2]=255&hold>>>16,hbuf[3]=255&hold>>>24,state.check=crc32(state.check,hbuf,4,0)),hold=0,bits=0,state.mode=OS;case OS:for(;16>bits;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.head&&(state.head.xflags=255&hold,state.head.os=hold>>8),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=255&hold>>>8,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0,state.mode=EXLEN;case EXLEN:if(1024&state.flags){for(;16>bits;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.length=hold,state.head&&(state.head.extra_len=hold),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=255&hold>>>8,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0}else state.head&&(state.head.extra=null);state.mode=EXTRA;case EXTRA:if(1024&state.flags&&(copy=state.length,copy>have&&(copy=have),copy&&(state.head&&(len=state.head.extra_len-state.length,!state.head.extra&&(state.head.extra=Array(state.head.extra_len)),utils.arraySet(state.head.extra,input,next,copy,len)),512&state.flags&&(state.check=crc32(state.check,input,copy,next)),have-=copy,next+=copy,state.length-=copy),state.length))break inf_leave;state.length=0,state.mode=NAME;case NAME:if(2048&state.flags){if(0===have)break inf_leave;copy=0;do len=input[next+copy++],state.head&&len&&65536>state.length&&(state.head.name+=_StringfromCharCode4(len));while(len&©<have);if(512&state.flags&&(state.check=crc32(state.check,input,copy,next)),have-=copy,next+=copy,len)break inf_leave}else state.head&&(state.head.name=null);state.length=0,state.mode=COMMENT;case COMMENT:if(4096&state.flags){if(0===have)break inf_leave;copy=0;do len=input[next+copy++],state.head&&len&&65536>state.length&&(state.head.comment+=_StringfromCharCode4(len));while(len&©<have);if(512&state.flags&&(state.check=crc32(state.check,input,copy,next)),have-=copy,next+=copy,len)break inf_leave}else state.head&&(state.head.comment=null);state.mode=HCRC;case HCRC:if(512&state.flags){for(;16>bits;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(hold!==(65535&state.check)){strm.msg="header crc mismatch",state.mode=BAD;break}hold=0,bits=0}state.head&&(state.head.hcrc=1&state.flags>>9,state.head.done=!0),strm.adler=state.check=0,state.mode=TYPE;break;case DICTID:for(;32>bits;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}strm.adler=state.check=zswap32(hold),hold=0,bits=0,state.mode=DICT;case DICT:if(0===state.havedict)return strm.next_out=put,strm.avail_out=left,strm.next_in=next,strm.avail_in=have,state.hold=hold,state.bits=bits,2;strm.adler=state.check=1,state.mode=TYPE;case TYPE:if(flush===5||flush===Z_TREES)break inf_leave;case TYPEDO:if(state.last){hold>>>=7&bits,bits-=7&bits,state.mode=CHECK;break}for(;3>bits;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}switch(state.last=1&hold,hold>>>=1,bits-=1,3&hold){case 0:state.mode=STORED;break;case 1:if(fixedtables(state),state.mode=LEN_,flush===Z_TREES){hold>>>=2,bits-=2;break inf_leave}break;case 2:state.mode=TABLE;break;case 3:strm.msg="invalid block type",state.mode=BAD;}hold>>>=2,bits-=2;break;case STORED:for(hold>>>=7&bits,bits-=7&bits;32>bits;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if((65535&hold)!=(65535^hold>>>16)){strm.msg="invalid stored block lengths",state.mode=BAD;break}if(state.length=65535&hold,hold=0,bits=0,state.mode=COPY_,flush===Z_TREES)break inf_leave;case COPY_:state.mode=COPY;case COPY:if(copy=state.length,copy){if(copy>have&&(copy=have),copy>left&&(copy=left),0===copy)break inf_leave;utils.arraySet(output,input,next,copy,put),have-=copy,next+=copy,left-=copy,put+=copy,state.length-=copy;break}state.mode=TYPE;break;case TABLE:for(;14>bits;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(state.nlen=(31&hold)+257,hold>>>=5,bits-=5,state.ndist=(31&hold)+1,hold>>>=5,bits-=5,state.ncode=(15&hold)+4,hold>>>=4,bits-=4,286<state.nlen||30<state.ndist){strm.msg="too many length or distance symbols",state.mode=BAD;break}state.have=0,state.mode=LENLENS;case LENLENS:for(;state.have<state.ncode;){for(;3>bits;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.lens[order[state.have++]]=7&hold,hold>>>=3,bits-=3}for(;19>state.have;)state.lens[order[state.have++]]=0;if(state.lencode=state.lendyn,state.lenbits=7,opts={bits:state.lenbits},ret=inflate_table(0,state.lens,0,19,state.lencode,0,state.work,opts),state.lenbits=opts.bits,ret){strm.msg="invalid code lengths set",state.mode=BAD;break}state.have=0,state.mode=CODELENS;case CODELENS:for(;state.have<state.nlen+state.ndist;){for(;;){if(here=state.lencode[hold&(1<<state.lenbits)-1],here_bits=here>>>24,here_op=255&here>>>16,here_val=65535&here,here_bits<=bits)break;if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(16>here_val)hold>>>=here_bits,bits-=here_bits,state.lens[state.have++]=here_val;else{if(16===here_val){for(n=here_bits+2;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(hold>>>=here_bits,bits-=here_bits,0===state.have){strm.msg="invalid bit length repeat",state.mode=BAD;break}len=state.lens[state.have-1],copy=3+(3&hold),hold>>>=2,bits-=2}else if(17===here_val){for(n=here_bits+3;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}hold>>>=here_bits,bits-=here_bits,len=0,copy=3+(7&hold),hold>>>=3,bits-=3}else{for(n=here_bits+7;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}hold>>>=here_bits,bits-=here_bits,len=0,copy=11+(127&hold),hold>>>=7,bits-=7}if(state.have+copy>state.nlen+state.ndist){strm.msg="invalid bit length repeat",state.mode=BAD;break}for(;copy--;)state.lens[state.have++]=len}}if(state.mode===BAD)break;if(0===state.lens[256]){strm.msg="invalid code -- missing end-of-block",state.mode=BAD;break}if(state.lenbits=9,opts={bits:state.lenbits},ret=inflate_table(LENS,state.lens,0,state.nlen,state.lencode,0,state.work,opts),state.lenbits=opts.bits,ret){strm.msg="invalid literal/lengths set",state.mode=BAD;break}if(state.distbits=6,state.distcode=state.distdyn,opts={bits:state.distbits},ret=inflate_table(DISTS,state.lens,state.nlen,state.ndist,state.distcode,0,state.work,opts),state.distbits=opts.bits,ret){strm.msg="invalid distances set",state.mode=BAD;break}if(state.mode=LEN_,flush===Z_TREES)break inf_leave;case LEN_:state.mode=LEN;case LEN:if(6<=have&&258<=left){strm.next_out=put,strm.avail_out=left,strm.next_in=next,strm.avail_in=have,state.hold=hold,state.bits=bits,inflate_fast(strm,_out),put=strm.next_out,output=strm.output,left=strm.avail_out,next=strm.next_in,input=strm.input,have=strm.avail_in,hold=state.hold,bits=state.bits,state.mode===TYPE&&(state.back=-1);break}for(state.back=0;;){if(here=state.lencode[hold&(1<<state.lenbits)-1],here_bits=here>>>24,here_op=255&here>>>16,here_val=65535&here,here_bits<=bits)break;if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(here_op&&0==(240&here_op)){for(last_bits=here_bits,last_op=here_op,last_val=here_val;;){if(here=state.lencode[last_val+((hold&(1<<last_bits+last_op)-1)>>last_bits)],here_bits=here>>>24,here_op=255&here>>>16,here_val=65535&here,last_bits+here_bits<=bits)break;if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}hold>>>=last_bits,bits-=last_bits,state.back+=last_bits}if(hold>>>=here_bits,bits-=here_bits,state.back+=here_bits,state.length=here_val,0===here_op){state.mode=LIT;break}if(32&here_op){state.back=-1,state.mode=TYPE;break}if(64&here_op){strm.msg="invalid literal/length code",state.mode=BAD;break}state.extra=15&here_op,state.mode=LENEXT;case LENEXT:if(state.extra){for(n=state.extra;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.length+=hold&(1<<state.extra)-1,hold>>>=state.extra,bits-=state.extra,state.back+=state.extra}state.was=state.length,state.mode=DIST;case DIST:for(;;){if(here=state.distcode[hold&(1<<state.distbits)-1],here_bits=here>>>24,here_op=255&here>>>16,here_val=65535&here,here_bits<=bits)break;if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(0==(240&here_op)){for(last_bits=here_bits,last_op=here_op,last_val=here_val;;){if(here=state.distcode[last_val+((hold&(1<<last_bits+last_op)-1)>>last_bits)],here_bits=here>>>24,here_op=255&here>>>16,here_val=65535&here,last_bits+here_bits<=bits)break;if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}hold>>>=last_bits,bits-=last_bits,state.back+=last_bits}if(hold>>>=here_bits,bits-=here_bits,state.back+=here_bits,64&here_op){strm.msg="invalid distance code",state.mode=BAD;break}state.offset=here_val,state.extra=15&here_op,state.mode=DISTEXT;case DISTEXT:if(state.extra){for(n=state.extra;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.offset+=hold&(1<<state.extra)-1,hold>>>=state.extra,bits-=state.extra,state.back+=state.extra}if(state.offset>state.dmax){strm.msg="invalid distance too far back",state.mode=BAD;break}state.mode=MATCH;case MATCH:if(0===left)break inf_leave;if(copy=_out-left,state.offset>copy){if(copy=state.offset-copy,copy>state.whave&&state.sane){strm.msg="invalid distance too far back",state.mode=BAD;break}copy>state.wnext?(copy-=state.wnext,from=state.wsize-copy):from=state.wnext-copy,copy>state.length&&(copy=state.length),from_source=state.window}else from_source=output,from=put-state.offset,copy=state.length;copy>left&&(copy=left),left-=copy,state.length-=copy;do output[put++]=from_source[from++];while(--copy);0===state.length&&(state.mode=LEN);break;case LIT:if(0===left)break inf_leave;output[put++]=state.length,left--,state.mode=LEN;break;case CHECK:if(state.wrap){for(;32>bits;){if(0===have)break inf_leave;have--,hold|=input[next++]<<bits,bits+=8}if(_out-=left,strm.total_out+=_out,state.total+=_out,_out&&(strm.adler=state.check=state.flags?crc32(state.check,output,_out,put-_out):adler32(state.check,output,_out,put-_out)),_out=left,(state.flags?hold:zswap32(hold))!==state.check){strm.msg="incorrect data check",state.mode=BAD;break}hold=0,bits=0}state.mode=LENGTH;case LENGTH:if(state.wrap&&state.flags){for(;32>bits;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(hold!==(4294967295&state.total)){strm.msg="incorrect length check",state.mode=BAD;break}hold=0,bits=0}state.mode=DONE;case DONE:ret=1;break inf_leave;case BAD:ret=Z_DATA_ERROR;break inf_leave;case MEM:return Z_MEM_ERROR;case 32:default:return Z_STREAM_ERROR;}return(strm.next_out=put,strm.avail_out=left,strm.next_in=next,strm.avail_in=have,state.hold=hold,state.bits=bits,(state.wsize||_out!==strm.avail_out&&state.mode<BAD&&(state.mode<CHECK||flush!==Z_FINISH))&&updatewindow(strm,strm.output,strm.next_out,_out-strm.avail_out))?(state.mode=MEM,Z_MEM_ERROR):(_in-=strm.avail_in,_out-=strm.avail_out,strm.total_in+=_in,strm.total_out+=_out,state.total+=_out,state.wrap&&_out&&(strm.adler=state.check=state.flags?crc32(state.check,output,_out,strm.next_out-_out):adler32(state.check,output,_out,strm.next_out-_out)),strm.data_type=state.bits+(state.last?64:0)+(state.mode===TYPE?128:0)+(state.mode===LEN_||state.mode===COPY_?256:0),(0===_in&&0===_out||flush===Z_FINISH)&&ret===Z_OK&&(ret=-5),ret)},exports.inflateEnd=function(strm){if(!strm||!strm.state)return Z_STREAM_ERROR;var state=strm.state;return state.window&&(state.window=null),strm.state=null,Z_OK},exports.inflateGetHeader=function(strm,head){var state;return strm&&strm.state?(state=strm.state,0==(2&state.wrap))?Z_STREAM_ERROR:(state.head=head,head.done=!1,Z_OK):Z_STREAM_ERROR},exports.inflateSetDictionary=function(strm,dictionary){var dictLength=dictionary.length,state,dictid,ret;return strm&&strm.state?(state=strm.state,0!==state.wrap&&state.mode!==DICT)?Z_STREAM_ERROR:state.mode===DICT&&(dictid=1,dictid=adler32(dictid,dictionary,dictLength,0),dictid!==state.check)?Z_DATA_ERROR:(ret=updatewindow(strm,dictionary,dictLength,dictLength),ret)?(state.mode=MEM,Z_MEM_ERROR):(state.havedict=1,Z_OK):Z_STREAM_ERROR},exports.inflateInfo="pako inflate (from Nodeca project)"},GRUB:function(module,exports,__webpack_require__){"use strict";function emitErrorNT(self,err){self.emit("error",err)}var pna=__webpack_require__("Yj0v");module.exports={destroy:function(err,cb){var _this=this,readableDestroyed=this._readableState&&this._readableState.destroyed,writableDestroyed=this._writableState&&this._writableState.destroyed;return readableDestroyed||writableDestroyed?(cb?cb(err):err&&(!this._writableState||!this._writableState.errorEmitted)&&pna.nextTick(emitErrorNT,this,err),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(err||null,function(err){!cb&&err?(pna.nextTick(emitErrorNT,_this,err),_this._writableState&&(_this._writableState.errorEmitted=!0)):cb&&cb(err)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},GTg1:function(module,exports,__webpack_require__){"use strict";var compressions=__webpack_require__("XfO6"),ZipFileWorker=__webpack_require__("xtj2"),getCompression=function(fileCompression,zipCompression){var compressionName=fileCompression||zipCompression,compression=compressions[compressionName];if(!compression)throw new Error(compressionName+" is not a valid compression method !");return compression};exports.generateWorker=function(zip,options,comment){var zipFileWorker=new ZipFileWorker(options.streamFiles,comment,options.platform,options.encodeFileName),entriesCount=0;try{zip.forEach(function(relativePath,file){entriesCount++;var compression=getCompression(file.options.compression,options.compression),compressionOptions=file.options.compressionOptions||options.compressionOptions||{},dir=file.dir,date=file.date;file._compressWorker(compression,compressionOptions).withStreamInfo("file",{name:relativePath,dir:dir,date:date,comment:file.comment||"",unixPermissions:file.unixPermissions,dosPermissions:file.dosPermissions}).pipe(zipFileWorker)}),zipFileWorker.entriesCount=entriesCount}catch(e){zipFileWorker.error(e)}return zipFileWorker}},"H+g/":function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){function doFold(cm,pos,options,force){function getRange(allowFolded){var range=finder(cm,pos);if(!range||range.to.line-range.from.line<minSize)return null;for(var marks=cm.findMarksAt(range.from),i=0;i<marks.length;++i)if(marks[i].__isFold&&"fold"!==force){if(!allowFolded)return null;range.cleared=!0,marks[i].clear()}return range}if(options&&options.call){var finder=options;options=null}else var finder=getOption(cm,options,"rangeFinder");"number"==typeof pos&&(pos=CodeMirror.Pos(pos,0));var minSize=getOption(cm,options,"minFoldSize"),range=getRange(!0);if(getOption(cm,options,"scanUp"))for(;!range&&pos.line>cm.firstLine();)pos=CodeMirror.Pos(pos.line-1,0),range=getRange(!1);if(range&&!range.cleared&&"unfold"!==force){var myWidget=makeWidget(cm,options);CodeMirror.on(myWidget,"mousedown",function(e){myRange.clear(),CodeMirror.e_preventDefault(e)});var myRange=cm.markText(range.from,range.to,{replacedWith:myWidget,clearOnEnter:getOption(cm,options,"clearOnEnter"),__isFold:!0});myRange.on("clear",function(from,to){CodeMirror.signal(cm,"unfold",cm,from,to)}),CodeMirror.signal(cm,"fold",cm,range.from,range.to)}}function makeWidget(cm,options){var widget=getOption(cm,options,"widget");if("string"==typeof widget){var text=document.createTextNode(widget);widget=document.createElement("span"),widget.appendChild(text),widget.className="CodeMirror-foldmarker"}else widget&&(widget=widget.cloneNode(!0));return widget}function getOption(cm,options,name){if(options&&void 0!==options[name])return options[name];var editorOptions=cm.options.foldOptions;return editorOptions&&void 0!==editorOptions[name]?editorOptions[name]:defaultOptions[name]}CodeMirror.newFoldFunction=function(rangeFinder,widget){return function(cm,pos){doFold(cm,pos,{rangeFinder:rangeFinder,widget:widget})}},CodeMirror.defineExtension("foldCode",function(pos,options,force){doFold(this,pos,options,force)}),CodeMirror.defineExtension("isFolded",function(pos){for(var marks=this.findMarksAt(pos),i=0;i<marks.length;++i)if(marks[i].__isFold)return!0}),CodeMirror.commands.toggleFold=function(cm){cm.foldCode(cm.getCursor())},CodeMirror.commands.fold=function(cm){cm.foldCode(cm.getCursor(),null,"fold")},CodeMirror.commands.unfold=function(cm){cm.foldCode(cm.getCursor(),null,"unfold")},CodeMirror.commands.foldAll=function(cm){cm.operation(function(){for(var i=cm.firstLine(),e=cm.lastLine();i<=e;i++)cm.foldCode(CodeMirror.Pos(i,0),null,"fold")})},CodeMirror.commands.unfoldAll=function(cm){cm.operation(function(){for(var i=cm.firstLine(),e=cm.lastLine();i<=e;i++)cm.foldCode(CodeMirror.Pos(i,0),null,"unfold")})},CodeMirror.registerHelper("fold","combine",function(){var funcs=Array.prototype.slice.call(arguments,0);return function(cm,start){for(var i=0,found;i<funcs.length;++i)if(found=funcs[i](cm,start),found)return found}}),CodeMirror.registerHelper("fold","auto",function(cm,start){for(var helpers=cm.getHelpers(start,"fold"),i=0,cur;i<helpers.length;i++)if(cur=helpers[i](cm,start),cur)return cur});var defaultOptions={rangeFinder:CodeMirror.fold.auto,widget:"\u2194",minFoldSize:0,scanUp:!1,clearOnEnter:!0};CodeMirror.defineOption("foldOptions",null),CodeMirror.defineExtension("foldOption",function(options,name){return getOption(this,options,name)})})},"Hba+":function(module,exports,__webpack_require__){"use strict";function Duplex(options){return this instanceof Duplex?void(Readable.call(this,options),Writable.call(this,options),options&&!1===options.readable&&(this.readable=!1),options&&!1===options.writable&&(this.writable=!1),this.allowHalfOpen=!0,options&&!1===options.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",onend)):new Duplex(options)}function onend(){this.allowHalfOpen||this._writableState.ended||pna.nextTick(onEndNT,this)}function onEndNT(self){self.end()}var pna=__webpack_require__("Yj0v"),objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};module.exports=Duplex;var util=__webpack_require__("Q14w");util.inherits=__webpack_require__("4Bm0");var Readable=__webpack_require__("DHrQ"),Writable=__webpack_require__("WSyY");util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0,method;v<keys.length;v++)method=keys[v],Duplex.prototype[method]||(Duplex.prototype[method]=Writable.prototype[method]);Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){return void 0===this._readableState||void 0===this._writableState?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(value){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=value,this._writableState.destroyed=value)}}),Duplex.prototype._destroy=function(err,cb){this.push(null),this.end(),pna.nextTick(cb,err)}},HeB0:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){var htmlConfig={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},xmlConfig={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};CodeMirror.defineMode("xml",function(editorConf,config_){function inText(stream,state){function chain(parser){return state.tokenize=parser,parser(stream,state)}var ch=stream.next();if("<"==ch)return stream.eat("!")?stream.eat("[")?stream.match("CDATA[")?chain(inBlock("atom","]]>")):null:stream.match("--")?chain(inBlock("comment","-->")):stream.match("DOCTYPE",!0,!0)?(stream.eatWhile(/[\w\._\-]/),chain(doctype(1))):null:stream.eat("?")?(stream.eatWhile(/[\w\._\-]/),state.tokenize=inBlock("meta","?>"),"meta"):(type=stream.eat("/")?"closeTag":"openTag",state.tokenize=inTag,"tag bracket");if("&"==ch){var ok;return ok=stream.eat("#")?stream.eat("x")?stream.eatWhile(/[a-fA-F\d]/)&&stream.eat(";"):stream.eatWhile(/[\d]/)&&stream.eat(";"):stream.eatWhile(/[\w\.\-:]/)&&stream.eat(";"),ok?"atom":"error"}return stream.eatWhile(/[^&<]/),null}function inTag(stream,state){var ch=stream.next();if(">"==ch||"/"==ch&&stream.eat(">"))return state.tokenize=inText,type=">"==ch?"endTag":"selfcloseTag","tag bracket";if("="==ch)return type="equals",null;if("<"==ch){state.tokenize=inText,state.state=baseState,state.tagName=state.tagStart=null;var next=state.tokenize(stream,state);return next?next+" tag error":"tag error"}return /[\'\"]/.test(ch)?(state.tokenize=inAttribute(ch),state.stringStartCol=stream.column(),state.tokenize(stream,state)):(stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function inAttribute(quote){var closure=function(stream,state){for(;!stream.eol();)if(stream.next()==quote){state.tokenize=inTag;break}return"string"};return closure.isInAttribute=!0,closure}function inBlock(style,terminator){return function(stream,state){for(;!stream.eol();){if(stream.match(terminator)){state.tokenize=inText;break}stream.next()}return style}}function doctype(depth){return function(stream,state){for(var ch;null!=(ch=stream.next());){if("<"==ch)return state.tokenize=doctype(depth+1),state.tokenize(stream,state);if(">"==ch)if(1==depth){state.tokenize=inText;break}else return state.tokenize=doctype(depth-1),state.tokenize(stream,state)}return"meta"}}function Context(state,tagName,startOfLine){this.prev=state.context,this.tagName=tagName,this.indent=state.indented,this.startOfLine=startOfLine,(config.doNotIndent.hasOwnProperty(tagName)||state.context&&state.context.noIndent)&&(this.noIndent=!0)}function popContext(state){state.context&&(state.context=state.context.prev)}function maybePopContext(state,nextTagName){for(var parentTagName;;){if(!state.context)return;if(parentTagName=state.context.tagName,!config.contextGrabbers.hasOwnProperty(parentTagName)||!config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName))return;popContext(state)}}function baseState(type,stream,state){return"openTag"==type?(state.tagStart=stream.column(),tagNameState):"closeTag"==type?closeTagNameState:baseState}function tagNameState(type,stream,state){return"word"==type?(state.tagName=stream.current(),setStyle="tag",attrState):config.allowMissingTagName&&"endTag"==type?(setStyle="tag bracket",attrState(type,stream,state)):(setStyle="error",tagNameState)}function closeTagNameState(type,stream,state){if("word"==type){var tagName=stream.current();return state.context&&state.context.tagName!=tagName&&config.implicitlyClosed.hasOwnProperty(state.context.tagName)&&popContext(state),state.context&&state.context.tagName==tagName||!1===config.matchClosing?(setStyle="tag",closeState):(setStyle="tag error",closeStateErr)}return config.allowMissingTagName&&"endTag"==type?(setStyle="tag bracket",closeState(type,stream,state)):(setStyle="error",closeStateErr)}function closeState(type,_stream,state){return"endTag"==type?(popContext(state),baseState):(setStyle="error",closeState)}function closeStateErr(type,stream,state){return setStyle="error",closeState(type,stream,state)}function attrState(type,_stream,state){if("word"==type)return setStyle="attribute",attrEqState;if("endTag"==type||"selfcloseTag"==type){var tagName=state.tagName,tagStart=state.tagStart;return state.tagName=state.tagStart=null,"selfcloseTag"==type||config.autoSelfClosers.hasOwnProperty(tagName)?maybePopContext(state,tagName):(maybePopContext(state,tagName),state.context=new Context(state,tagName,tagStart==state.indented)),baseState}return setStyle="error",attrState}function attrEqState(type,stream,state){return"equals"==type?attrValueState:(config.allowMissing||(setStyle="error"),attrState(type,stream,state))}function attrValueState(type,stream,state){return"string"==type?attrContinuedState:"word"==type&&config.allowUnquoted?(setStyle="string",attrState):(setStyle="error",attrState(type,stream,state))}function attrContinuedState(type,stream,state){return"string"==type?attrContinuedState:attrState(type,stream,state)}var indentUnit=editorConf.indentUnit,config={},defaults=config_.htmlMode?htmlConfig:xmlConfig;for(var prop in defaults)config[prop]=defaults[prop];for(var prop in config_)config[prop]=config_[prop];var type,setStyle;return inText.isInText=!0,{startState:function(baseIndent){var state={tokenize:inText,state:baseState,indented:baseIndent||0,tagName:null,tagStart:null,context:null};return null!=baseIndent&&(state.baseIndent=baseIndent),state},token:function(stream,state){if(!state.tagName&&stream.sol()&&(state.indented=stream.indentation()),stream.eatSpace())return null;type=null;var style=state.tokenize(stream,state);return(style||type)&&"comment"!=style&&(setStyle=null,state.state=state.state(type||style,stream,state),setStyle&&(style="error"==setStyle?style+" error":setStyle)),style},indent:function(state,textAfter,fullLine){var context=state.context;if(state.tokenize.isInAttribute)return state.tagStart==state.indented?state.stringStartCol+1:state.indented+indentUnit;if(context&&context.noIndent)return CodeMirror.Pass;if(state.tokenize!=inTag&&state.tokenize!=inText)return fullLine?fullLine.match(/^(\s*)/)[0].length:0;if(state.tagName)return!1===config.multilineTagIndentPastTag?state.tagStart+indentUnit*(config.multilineTagIndentFactor||1):state.tagStart+state.tagName.length+2;if(config.alignCDATA&&/<!\[CDATA\[/.test(textAfter))return 0;var tagAfter=textAfter&&/^<(\/)?([\w_:\.-]*)/.exec(textAfter);if(tagAfter&&tagAfter[1]){for(;context;)if(context.tagName==tagAfter[2]){context=context.prev;break}else if(config.implicitlyClosed.hasOwnProperty(context.tagName))context=context.prev;else break;}else if(tagAfter)for(;context;){var grabbers=config.contextGrabbers[context.tagName];if(grabbers&&grabbers.hasOwnProperty(tagAfter[2]))context=context.prev;else break}for(;context&&context.prev&&!context.startOfLine;)context=context.prev;return context?context.indent+indentUnit:state.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:config.htmlMode?"html":"xml",helperType:config.htmlMode?"html":"xml",skipAttribute:function(state){state.state==attrValueState&&(state.state=attrState)}}}),CodeMirror.defineMIME("text/xml","xml"),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0})})},HyWd:function(module){"use strict";module.exports=function(bitmap,value){return{enumerable:!(1&bitmap),configurable:!(2&bitmap),writable:!(4&bitmap),value:value}}},IDli:function(module,exports,__webpack_require__){"use strict";module.exports=!__webpack_require__("s0rf")&&!__webpack_require__("6TpT")(function(){return 7!=Object.defineProperty(__webpack_require__("kdYR")("div"),"a",{get:function(){return 7}}).a})},IYZm:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"),__webpack_require__("LiPu"))})(function(CodeMirror){function populate(obj){for(var attr in globalAttrs)globalAttrs.hasOwnProperty(attr)&&(obj.attrs[attr]=globalAttrs[attr])}var langs=["ab","aa","af","ak","sq","am","ar","an","hy","as","av","ae","ay","az","bm","ba","eu","be","bn","bh","bi","bs","br","bg","my","ca","ch","ce","ny","zh","cv","kw","co","cr","hr","cs","da","dv","nl","dz","en","eo","et","ee","fo","fj","fi","fr","ff","gl","ka","de","el","gn","gu","ht","ha","he","hz","hi","ho","hu","ia","id","ie","ga","ig","ik","io","is","it","iu","ja","jv","kl","kn","kr","ks","kk","km","ki","rw","ky","kv","kg","ko","ku","kj","la","lb","lg","li","ln","lo","lt","lu","lv","gv","mk","mg","ms","ml","mt","mi","mr","mh","mn","na","nv","nb","nd","ne","ng","nn","no","ii","nr","oc","oj","cu","om","or","os","pa","pi","fa","pl","ps","pt","qu","rm","rn","ro","ru","sa","sc","sd","se","sm","sg","sr","gd","sn","si","sk","sl","so","st","es","su","sw","ss","sv","ta","te","tg","th","ti","bo","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","cy","wo","fy","xh","yi","yo","za","zu"],targets=["_blank","_self","_top","_parent"],charsets=["ascii","utf-8","utf-16","latin1","latin1"],methods=["get","post","put","delete"],encs=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],media=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],s={attrs:{}},data={a:{attrs:{href:null,ping:null,type:null,media:media,target:targets,hreflang:langs}},abbr:s,acronym:s,address:s,applet:s,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:media,hreflang:langs,type:null,shape:["default","rect","circle","poly"]}},article:s,aside:s,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:s,base:{attrs:{href:null,target:targets}},basefont:s,bdi:s,bdo:s,big:s,blockquote:{attrs:{cite:null}},body:s,br:s,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:encs,formmethod:methods,formnovalidate:["","novalidate"],formtarget:targets,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:s,center:s,cite:s,code:s,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:s,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:s,dir:s,div:s,dl:s,dt:s,em:s,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:s,figure:s,font:s,footer:s,form:{attrs:{action:null,name:null,"accept-charset":charsets,autocomplete:["on","off"],enctype:encs,method:methods,novalidate:["","novalidate"],target:targets}},frame:s,frameset:s,h1:s,h2:s,h3:s,h4:s,h5:s,h6:s,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:s,hgroup:s,hr:s,html:{attrs:{manifest:null},children:["head","body"]},i:s,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:encs,formmethod:methods,formnovalidate:["","novalidate"],formtarget:targets,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:s,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:s,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:langs,media:media,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:s,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:charsets,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:s,noframes:s,noscript:s,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:s,param:{attrs:{name:null,value:null}},pre:s,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:s,rt:s,ruby:s,s:s,samp:s,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:charsets}},section:s,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:s,source:{attrs:{src:null,type:null,media:null}},span:s,strike:s,strong:s,style:{attrs:{type:["text/css"],media:media,scoped:null}},sub:s,summary:s,sup:s,table:s,tbody:s,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:s,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:s,time:{attrs:{datetime:null}},title:s,tr:s,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:langs}},tt:s,u:s,ul:s,var:s,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:s},globalAttrs={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 tag in populate(s),data)data.hasOwnProperty(tag)&&data[tag]!=s&&populate(data[tag]);CodeMirror.htmlSchema=data,CodeMirror.registerHelper("hint","html",function(cm,options){var local={schemaInfo:data};if(options)for(var opt in options)local[opt]=options[opt];return CodeMirror.hint.xml(cm,local)})})},Ib92:function(module,exports,__webpack_require__){"use strict";var ctx=__webpack_require__("iktq"),invoke=__webpack_require__("3Rhr"),html=__webpack_require__("zH6J"),cel=__webpack_require__("kdYR"),global=__webpack_require__("3Vd+"),process=global.process,setTask=global.setImmediate,clearTask=global.clearImmediate,MessageChannel=global.MessageChannel,counter=0,queue={},ONREADYSTATECHANGE="onreadystatechange",run=function(){var id=+this;if(queue.hasOwnProperty(id)){var fn=queue[id];delete queue[id],fn()}},listener=function(event){run.call(event.data)},defer,channel,port;setTask&&clearTask||(setTask=function(fn){for(var args=[],i=1;arguments.length>i;)args.push(arguments[i++]);return queue[++counter]=function(){invoke("function"==typeof fn?fn:Function(fn),args)},defer(counter),counter},clearTask=function(id){delete queue[id]},"process"==__webpack_require__("1ROC")(process)?defer=function(id){process.nextTick(ctx(run,id,1))}:MessageChannel?(channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=listener,defer=ctx(port.postMessage,port,1)):global.addEventListener&&"function"==typeof postMessage&&!global.importScripts?(defer=function(id){global.postMessage(id+"","*")},global.addEventListener("message",listener,!1)):ONREADYSTATECHANGE in cel("script")?defer=function(id){html.appendChild(cel("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run.call(id)}}:defer=function(id){setTimeout(ctx(run,id,1),0)}),module.exports={set:setTask,clear:clearTask}},Ipt8:function(module,exports){"use strict";function replaceInNode(node,variables){for(var attrs=node.attributes,i=0,il=attrs.length,attr;i<il;i++)attr=attrs[i],"string"==typeof attr.value&&node.setAttribute(attr.name,replaceInString(attr.value,variables));return null!=node.value&&(node.value=replaceInString(node.value,variables)),node}function replaceInString(string,variables){for(var model=createModel(string),offset=0,output="",i=0,il=model.variables.length;i<il;i++){var v=model.variables[i],value=v.name in variables?variables[v.name]:v.name;"function"==typeof value&&(value=value(model.string,v,offset+v.location)),output+=model.string.slice(offset,v.location)+value,offset=v.location+v.length}return output+model.string.slice(offset)}function createModel(string){for(var reVariable=/\$\{([a-z][\w\-]*)\}/ig,escapeCharCode=92,variables=[],tokens=new Map,m=void 0;m=reVariable.exec(string);)tokens.set(m.index,m);if(tokens.size){for(var start=0,pos=0,len=string.length,output="";pos<len;){if(string.charCodeAt(pos)===escapeCharCode&&tokens.has(pos+1)){var token=tokens.get(pos+1);output+=string.slice(start,pos)+token[0],start=pos=token.index+token[0].length,tokens.delete(pos+1);continue}pos++}string=output+string.slice(start);for(var validMatches=Array.from(tokens.values()),i=0,il=validMatches.length,_token;i<il;i++)_token=validMatches[i],variables.push({name:_token[1],location:_token.index,length:_token[0].length})}return{string:string,variables:variables}}exports.__esModule=!0,exports.default=function(tree,variables){return variables=variables||{},tree.walk(function(node){return replaceInNode(node,variables)}),tree}},JgNJ:function(module,exports){"use strict";var _Mathpow=Math.pow;exports.read=function(buffer,offset,isLE,mLen,nBytes){var eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i],e,m;for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;0<nBits;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;0<nBits;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:(s?-1:1)*Infinity;m+=_Mathpow(2,mLen),e-=eBias}return(s?-1:1)*m*_Mathpow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=23===mLen?5.960464477539063e-8-6.617444900424222e-24:0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=0>value||0===value&&0>1/value?1:0,e,m,c;for(value=Math.abs(value),isNaN(value)||value===Infinity?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),1>value*(c=_Mathpow(2,-e))&&(e--,c*=2),value+=1<=e+eBias?rt/c:rt*_Mathpow(2,1-eBias),2<=value*c&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):1<=e+eBias?(m=(value*c-1)*_Mathpow(2,mLen),e+=eBias):(m=value*_Mathpow(2,eBias-1)*_Mathpow(2,mLen),e=0));8<=mLen;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<<mLen|m,eLen+=mLen;0<eLen;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},"Jo/m":function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"),__webpack_require__("29F7"),__webpack_require__("4e7A"))})(function(CodeMirror){function searchOverlay(query,caseInsensitive){return"string"==typeof query?query=new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),caseInsensitive?"gi":"g"):!query.global&&(query=new RegExp(query.source,query.ignoreCase?"gi":"g")),{token:function(stream){query.lastIndex=stream.pos;var match=query.exec(stream.string);return match&&match.index==stream.pos?(stream.pos+=match[0].length||1,"searching"):void(match?stream.pos=match.index:stream.skipToEnd())}}}function SearchState(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function getSearchState(cm){return cm.state.search||(cm.state.search=new SearchState)}function queryCaseInsensitive(query){return"string"==typeof query&&query==query.toLowerCase()}function getSearchCursor(cm,query,pos){return cm.getSearchCursor(query,pos,{caseFold:queryCaseInsensitive(query),multiline:!0})}function persistentDialog(cm,text,deflt,onEnter,onKeyDown){cm.openDialog(text,onEnter,{value:deflt,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){clearSearch(cm)},onKeyDown:onKeyDown})}function dialog(cm,text,shortText,deflt,f){cm.openDialog?cm.openDialog(text,f,{value:deflt,selectValueOnOpen:!0}):f(prompt(shortText,deflt))}function confirmDialog(cm,text,shortText,fs){cm.openConfirm?cm.openConfirm(text,fs):confirm(shortText)&&fs[0]()}function parseString(string){return string.replace(/\\(.)/g,function(_,ch){return"n"==ch?"\n":"r"==ch?"\r":ch})}function parseQuery(query){var isRE=query.match(/^\/(.*)\/([a-z]*)$/);if(isRE)try{query=new RegExp(isRE[1],-1==isRE[2].indexOf("i")?"":"i")}catch(e){}else query=parseString(query);return("string"==typeof query?""==query:query.test(""))&&(query=/x^/),query}function startSearch(cm,state,query){state.queryText=query,state.query=parseQuery(query),cm.removeOverlay(state.overlay,queryCaseInsensitive(state.query)),state.overlay=searchOverlay(state.query,queryCaseInsensitive(state.query)),cm.addOverlay(state.overlay),cm.showMatchesOnScrollbar&&(state.annotate&&(state.annotate.clear(),state.annotate=null),state.annotate=cm.showMatchesOnScrollbar(state.query,queryCaseInsensitive(state.query)))}function doSearch(cm,rev,persistent,immediate){var state=getSearchState(cm);if(state.query)return findNext(cm,rev);var q=cm.getSelection()||state.lastQuery;if(q instanceof RegExp&&"x^"==q.source&&(q=null),persistent&&cm.openDialog){var hiding=null,searchNext=function(query,event){CodeMirror.e_stop(event),query&&(query!=state.queryText&&(startSearch(cm,state,query),state.posFrom=state.posTo=cm.getCursor()),hiding&&(hiding.style.opacity=1),findNext(cm,event.shiftKey,function(_,to){var dialog;3>to.line&&document.querySelector&&(dialog=cm.display.wrapper.querySelector(".CodeMirror-dialog"))&&dialog.getBoundingClientRect().bottom-4>cm.cursorCoords(to,"window").top&&((hiding=dialog).style.opacity=.4)}))};persistentDialog(cm,queryDialog,q,searchNext,function(event,query){var keyName=CodeMirror.keyName(event),extra=cm.getOption("extraKeys"),cmd=extra&&extra[keyName]||CodeMirror.keyMap[cm.getOption("keyMap")][keyName];"findNext"==cmd||"findPrev"==cmd||"findPersistentNext"==cmd||"findPersistentPrev"==cmd?(CodeMirror.e_stop(event),startSearch(cm,getSearchState(cm),query),cm.execCommand(cmd)):("find"==cmd||"findPersistent"==cmd)&&(CodeMirror.e_stop(event),searchNext(query,event))}),immediate&&q&&(startSearch(cm,state,q),findNext(cm,rev))}else dialog(cm,queryDialog,"Search for:",q,function(query){query&&!state.query&&cm.operation(function(){startSearch(cm,state,query),state.posFrom=state.posTo=cm.getCursor(),findNext(cm,rev)})})}function findNext(cm,rev,callback){cm.operation(function(){var state=getSearchState(cm),cursor=getSearchCursor(cm,state.query,rev?state.posFrom:state.posTo);!cursor.find(rev)&&(cursor=getSearchCursor(cm,state.query,rev?CodeMirror.Pos(cm.lastLine()):CodeMirror.Pos(cm.firstLine(),0)),!cursor.find(rev))||(cm.setSelection(cursor.from(),cursor.to()),cm.scrollIntoView({from:cursor.from(),to:cursor.to()},20),state.posFrom=cursor.from(),state.posTo=cursor.to(),callback&&callback(cursor.from(),cursor.to()))})}function clearSearch(cm){cm.operation(function(){var state=getSearchState(cm);state.lastQuery=state.query,state.query&&(state.query=state.queryText=null,cm.removeOverlay(state.overlay),state.annotate&&(state.annotate.clear(),state.annotate=null))})}function replaceAll(cm,query,text){cm.operation(function(){for(var cursor=getSearchCursor(cm,query);cursor.findNext();)if("string"!=typeof query){var match=cm.getRange(cursor.from(),cursor.to()).match(query);cursor.replace(text.replace(/\$(\d)/g,function(_,i){return match[i]}))}else cursor.replace(text)})}function replace(cm,all){if(!cm.getOption("readOnly")){var query=cm.getSelection()||getSearchState(cm).lastQuery,dialogText="<span class=\"CodeMirror-search-label\">"+(all?"Replace all:":"Replace:")+"</span>";dialog(cm,dialogText+replaceQueryDialog,dialogText,query,function(query){query&&(query=parseQuery(query),dialog(cm,replacementQueryDialog,"Replace with:","",function(text){if(text=parseString(text),all)replaceAll(cm,query,text);else{clearSearch(cm);var cursor=getSearchCursor(cm,query,cm.getCursor("from")),advance=function advance(){var start=cursor.from(),match;!(match=cursor.findNext())&&(cursor=getSearchCursor(cm,query),!(match=cursor.findNext())||start&&cursor.from().line==start.line&&cursor.from().ch==start.ch)||(cm.setSelection(cursor.from(),cursor.to()),cm.scrollIntoView({from:cursor.from(),to:cursor.to()}),confirmDialog(cm,doReplaceConfirm,"Replace?",[function(){doReplace(match)},advance,function(){replaceAll(cm,query,text)}]))},doReplace=function(match){cursor.replace("string"==typeof query?text:text.replace(/\$(\d)/g,function(_,i){return match[i]})),advance()};advance()}}))})}}var queryDialog="<span class=\"CodeMirror-search-label\">Search:</span> <input type=\"text\" style=\"width: 10em\" class=\"CodeMirror-search-field\"/> <span style=\"color: #888\" class=\"CodeMirror-search-hint\">(Use /re/ syntax for regexp search)</span>",replaceQueryDialog=" <input type=\"text\" style=\"width: 10em\" class=\"CodeMirror-search-field\"/> <span style=\"color: #888\" class=\"CodeMirror-search-hint\">(Use /re/ syntax for regexp search)</span>",replacementQueryDialog="<span class=\"CodeMirror-search-label\">With:</span> <input type=\"text\" style=\"width: 10em\" class=\"CodeMirror-search-field\"/>",doReplaceConfirm="<span class=\"CodeMirror-search-label\">Replace?</span> <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";CodeMirror.commands.find=function(cm){clearSearch(cm),doSearch(cm)},CodeMirror.commands.findPersistent=function(cm){clearSearch(cm),doSearch(cm,!1,!0)},CodeMirror.commands.findPersistentNext=function(cm){doSearch(cm,!1,!0,!0)},CodeMirror.commands.findPersistentPrev=function(cm){doSearch(cm,!0,!0,!0)},CodeMirror.commands.findNext=doSearch,CodeMirror.commands.findPrev=function(cm){doSearch(cm,!0)},CodeMirror.commands.clearSearch=clearSearch,CodeMirror.commands.replace=replace,CodeMirror.commands.replaceAll=function(cm){replace(cm,!0)}})},KM04:function(module){"use strict";!function(){function e(){}function t(t,n){var a=E,o,r,i,l;for(l=arguments.length;2<l--;)W.push(arguments[l]);for(n&&null!=n.children&&(W.length||W.push(n.children),delete n.children);W.length;)if((r=W.pop())&&void 0!==r.pop)for(l=r.length;l--;)W.push(r[l]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof t)&&(null==r?r="":"number"==typeof r?r+="":"string"!=typeof r&&(i=!1)),i&&o?a[a.length-1]+=r:a===E?a=[r]:a.push(r),o=i;var u=new e;return u.nodeName=t,u.children=a,u.attributes=null==n?void 0:n,u.key=null==n?void 0:n.key,void 0!==S.vnode&&S.vnode(u),u}function n(e,t){for(var n in t)e[n]=t[n];return e}function o(e,o){return t(e.nodeName,n(n({},e.attributes),o),2<arguments.length?[].slice.call(arguments,2):e.children)}function r(e){!e.__d&&(e.__d=!0)&&1==A.push(e)&&(S.debounceRendering||P)(i)}function i(){var t=A,e;for(A=[];e=t.pop();)e.__d&&k(e)}function l(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&a(e,t.nodeName):n||e._componentConstructor===t.nodeName}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function u(e){var t=n({},e.attributes);t.children=e.children;var o=e.nodeName.defaultProps;if(void 0!==o)for(var r in o)void 0===t[r]&&(t[r]=o[r]);return t}function _(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function p(e){var t=e.parentNode;t&&t.removeChild(e)}function c(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if(!("class"!==t||r))e.className=o||"";else if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===V.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var l=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,f,l):e.removeEventListener(t,f,l),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)s(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var a=r&&t!==(t=t.replace(/^xlink:?/,""));null==o||!1===o?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}}function s(e,t,n){try{e[t]=n}catch(e){}}function f(e){return this.__l[e.type](S.event&&S.event(e)||e)}function d(){for(var e;e=D.pop();)S.afterMount&&S.afterMount(e),e.componentDidMount&&e.componentDidMount()}function h(e,t,n,o,r,i){H++||(R=null!=r&&void 0!==r.ownerSVGElement,j=null!=e&&!("__preactattr_"in e));var l=m(e,t,n,o,i);return r&&l.parentNode!==r&&r.appendChild(l),--H||(j=!1,i||d()),l}function m(e,t,n,o,r){var i=e,l=R;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),b(e,!0))),i.__preactattr_=!0,i;var u=t.nodeName;if("function"==typeof u)return U(e,t,n,o);if(R="svg"===u||"foreignObject"!==u&&R,u+="",(!e||!a(e,u))&&(i=_(u,R),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),b(e,!0)}var p=i.firstChild,c=i.__preactattr_,s=t.children;if(null==c){c=i.__preactattr_={};for(var f=i.attributes,d=f.length;d--;)c[f[d].name]=f[d].value}return!j&&s&&1===s.length&&"string"==typeof s[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=s[0]&&(p.nodeValue=s[0]):(s&&s.length||null!=p)&&v(i,s,n,o,j||null!=c.dangerouslySetInnerHTML),g(i,t.attributes,c),R=l,i}function v(e,t,n,o,r){var s=e.childNodes,f=[],d={},h=0,v=0,y=s.length,g=0,w=t?t.length:0,i,a,u,_,c;if(0!==y)for(var C=0;C<y;C++){var x=s[C],N=x.__preactattr_,k=w&&N?x._component?x._component.__k:N.key:null;null==k?(N||(void 0===x.splitText?r:!r||x.nodeValue.trim()))&&(f[g++]=x):(h++,d[k]=x)}if(0!==w)for(var C=0;C<w;C++){_=t[C],c=null;var k=_.key;if(null!=k)h&&void 0!==d[k]&&(c=d[k],d[k]=void 0,h--);else if(!c&&v<g)for(i=v;i<g;i++)if(void 0!==f[i]&&l(a=f[i],_,r)){c=a,f[i]=void 0,i===g-1&&g--,i===v&&v++;break}c=m(c,_,n,o),u=s[C],c&&c!==e&&c!==u&&(null==u?e.appendChild(c):c===u.nextSibling?p(u):e.insertBefore(c,u))}if(h)for(var C in d)void 0!==d[C]&&b(d[C],!1);for(;v<=g;)void 0!==(c=f[g--])&&b(c,!1)}function b(e,t){var n=e._component;n?L(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||p(e),y(e))}function y(e){for(e=e.lastChild;e;){var t=e.previousSibling;b(e,!0),e=t}}function g(e,t,n){for(var o in n)t&&null!=t[o]||null==n[o]||c(e,o,n[o],n[o]=void 0,R);for(o in t)"children"===o||"innerHTML"===o||o in n&&t[o]===("value"===o||"checked"===o?e[o]:n[o])||c(e,o,n[o],n[o]=t[o],R)}function w(e){var t=e.constructor.name;(I[t]||(I[t]=[])).push(e)}function C(e,t,n){var r=I[e.name],o;if(e.prototype&&e.prototype.render?(o=new e(t,n),T.call(o,t,n)):(o=new T(t,n),o.constructor=e,o.render=x),r)for(var i=r.length;i--;)if(r[i].constructor===e){o.__b=r[i].__b,r.splice(i,1);break}return o}function x(e,t,n){return this.constructor(e,n)}function N(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===S.syncComponentUpdates&&e.base?r(e):k(e,1,i)),e.__r&&e.__r(e))}function k(e,t,o,r){if(!e.__x){var _=e.props,p=e.state,c=e.context,s=e.__p||_,f=e.__s||p,m=e.__c||c,v=e.base,y=e.__b,g=v||y,w=e._component,x=!1,i,l,a;if(v&&(e.props=s,e.state=f,e.context=m,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(_,p,c)?x=!0:e.componentWillUpdate&&e.componentWillUpdate(_,p,c),e.props=_,e.state=p,e.context=c),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!x){i=e.render(_,p,c),e.getChildContext&&(c=n(n({},c),e.getChildContext()));var M=i&&i.nodeName,U,T;if("function"==typeof M){var W=u(i);l=w,l&&l.constructor===M&&W.key==l.__k?N(l,W,1,c,!1):(U=l,e._component=l=C(M,W,c),l.__b=l.__b||y,l.__u=e,N(l,W,0,c,!1),k(l,1,o,!0)),T=l.base}else a=g,U=w,U&&(a=e._component=null),(g||1===t)&&(a&&(a._component=null),T=h(a,i,c,o||!v,g&&g.parentNode,!0));if(g&&T!==g&&l!==w){var E=g.parentNode;E&&T!==E&&(E.replaceChild(T,g),U||(g._component=null,b(g,!1)))}if(U&&L(U),e.base=T,T&&!r){for(var P=e,V=e;V=V.__u;)(P=V).base=T;T._component=P,T._componentConstructor=P.constructor}}if(!v||o?D.unshift(e):x||(e.componentDidUpdate&&e.componentDidUpdate(s,f,m),S.afterUpdate&&S.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);H||r||d()}}function U(e,t,n,o){for(var r=e&&e._component,i=r,l=e,a=r&&e._componentConstructor===t.nodeName,_=a,p=u(t);r&&!_&&(r=r.__u);)_=r.constructor===t.nodeName;return r&&_&&(!o||r._component)?(N(r,p,3,n,o),e=r.base):(i&&!a&&(L(i),e=l=null),r=C(t.nodeName,p,n),e&&!r.__b&&(r.__b=e,l=null),N(r,p,1,n,o),e=r.base,l&&e!==l&&(l._component=null,b(l,!1))),e}function L(e){S.beforeUnmount&&S.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?L(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,p(t),w(e),y(t)),e.__r&&e.__r(null)}function T(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var S={},W=[],E=[],P="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,V=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,A=[],D=[],H=0,R=!1,j=!1,I={};n(T.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),k(this,2)},render:function(){}});var $={h:t,createElement:t,cloneElement:o,Component:T,render:function(e,t,n){return h(n,e,{},!1,t,!1)},rerender:i,options:S};module.exports=$}()},KxJl:function(module){"use strict";var core=module.exports={version:"2.3.0"};"number"==typeof __e&&(__e=core)},LP5M:function(module){"use strict";var BAD=30;module.exports=function(strm,start){var state,_in,last,_out,beg,end,dmax,wsize,whave,wnext,s_window,hold,bits,lcode,dcode,lmask,dmask,here,op,len,dist,from,from_source,input,output;state=strm.state,_in=strm.next_in,input=strm.input,last=_in+(strm.avail_in-5),_out=strm.next_out,output=strm.output,beg=_out-(start-strm.avail_out),end=_out+(strm.avail_out-257),dmax=state.dmax,wsize=state.wsize,whave=state.whave,wnext=state.wnext,s_window=state.window,hold=state.hold,bits=state.bits,lcode=state.lencode,dcode=state.distcode,lmask=(1<<state.lenbits)-1,dmask=(1<<state.distbits)-1;top:do{15>bits&&(hold+=input[_in++]<<bits,bits+=8,hold+=input[_in++]<<bits,bits+=8),here=lcode[hold&lmask];dolen:for(;;){if(op=here>>>24,hold>>>=op,bits-=op,op=255&here>>>16,0===op)output[_out++]=65535&here;else if(16&op){len=65535&here,op&=15,op&&(bits<op&&(hold+=input[_in++]<<bits,bits+=8),len+=hold&(1<<op)-1,hold>>>=op,bits-=op),15>bits&&(hold+=input[_in++]<<bits,bits+=8,hold+=input[_in++]<<bits,bits+=8),here=dcode[hold&dmask];dodist:for(;;){if(op=here>>>24,hold>>>=op,bits-=op,op=255&here>>>16,16&op){if(dist=65535&here,op&=15,bits<op&&(hold+=input[_in++]<<bits,bits+=8,bits<op&&(hold+=input[_in++]<<bits,bits+=8)),dist+=hold&(1<<op)-1,dist>dmax){strm.msg="invalid distance too far back",state.mode=BAD;break top}if(hold>>>=op,bits-=op,op=_out-beg,dist>op){if(op=dist-op,op>whave&&state.sane){strm.msg="invalid distance too far back",state.mode=BAD;break top}if(from=0,from_source=s_window,0===wnext){if(from+=wsize-op,op<len){len-=op;do output[_out++]=s_window[from++];while(--op);from=_out-dist,from_source=output}}else if(wnext<op){if(from+=wsize+wnext-op,op-=wnext,op<len){len-=op;do output[_out++]=s_window[from++];while(--op);if(from=0,wnext<len){op=wnext,len-=op;do output[_out++]=s_window[from++];while(--op);from=_out-dist,from_source=output}}}else if(from+=wnext-op,op<len){len-=op;do output[_out++]=s_window[from++];while(--op);from=_out-dist,from_source=output}for(;2<len;)output[_out++]=from_source[from++],output[_out++]=from_source[from++],output[_out++]=from_source[from++],len-=3;len&&(output[_out++]=from_source[from++],1<len&&(output[_out++]=from_source[from++]))}else{from=_out-dist;do output[_out++]=output[from++],output[_out++]=output[from++],output[_out++]=output[from++],len-=3;while(2<len);len&&(output[_out++]=output[from++],1<len&&(output[_out++]=output[from++]))}}else if(0==(64&op)){here=dcode[(65535&here)+(hold&(1<<op)-1)];continue dodist}else{strm.msg="invalid distance code",state.mode=BAD;break top}break}}else if(0==(64&op)){here=lcode[(65535&here)+(hold&(1<<op)-1)];continue dolen}else if(32&op){state.mode=12;break top}else{strm.msg="invalid literal/length code",state.mode=BAD;break top}break}}while(_in<last&&_out<end);return len=bits>>3,_in-=len,bits-=len<<3,hold&=(1<<bits)-1,strm.next_in=_in,strm.next_out=_out,strm.avail_in=_in<last?5+(last-_in):5-(_in-last),strm.avail_out=_out<end?257+(end-_out):257-(_out-end),state.hold=hold,void(state.bits=bits)}},LZfN:function(module,exports,__webpack_require__){"use strict";function NodejsStreamOutputAdapter(helper,options,updateCb){Readable.call(this,options),this._helper=helper;var self=this;helper.on("data",function(data,meta){self.push(data)||self._helper.pause(),updateCb&&updateCb(meta)}).on("error",function(e){self.emit("error",e)}).on("end",function(){self.push(null)})}var Readable=__webpack_require__("fOjT").Readable,utils=__webpack_require__("dvMn");utils.inherits(NodejsStreamOutputAdapter,Readable),NodejsStreamOutputAdapter.prototype._read=function(){this._helper.resume()},module.exports=NodejsStreamOutputAdapter},LiPu:function(module,exports,__webpack_require__){"use strict";var _Mathmax2=Math.max;(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){var Pos=CodeMirror.Pos;CodeMirror.registerHelper("hint","xml",function(cm,options){var tags=options&&options.schemaInfo,quote=options&&options.quoteChar||"\"";if(tags){var cur=cm.getCursor(),token=cm.getTokenAt(cur);token.end>cur.ch&&(token.end=cur.ch,token.string=token.string.slice(0,cur.ch-token.start));var inner=CodeMirror.innerMode(cm.getMode(),token.state);if("xml"==inner.mode.name){var result=[],replaceToken=!1,tag=/\btag\b/.test(token.type)&&!/>$/.test(token.string),tagName=tag&&/^\w/.test(token.string),prefix,tagStart;if(tagName){var before=cm.getLine(cur.line).slice(_Mathmax2(0,token.start-2),token.start),tagType=/<\/$/.test(before)?"close":/<$/.test(before)?"open":null;tagType&&(tagStart=token.start-("close"==tagType?2:1))}else tag&&"<"==token.string?tagType="open":tag&&"</"==token.string&&(tagType="close");if(!tag&&!inner.state.tagName||tagType){tagName&&(prefix=token.string),replaceToken=tagType;var cx=inner.state.context,curTag=cx&&tags[cx.tagName],childList=cx?curTag&&curTag.children:tags["!top"];if(childList&&"close"!=tagType)for(var i=0;i<childList.length;++i)prefix&&0!=childList[i].lastIndexOf(prefix,0)||result.push("<"+childList[i]);else if("close"!=tagType)for(var name in tags)tags.hasOwnProperty(name)&&"!top"!=name&&"!attrs"!=name&&(!prefix||0==name.lastIndexOf(prefix,0))&&result.push("<"+name);cx&&(!prefix||"close"==tagType&&0==cx.tagName.lastIndexOf(prefix,0))&&result.push("</"+cx.tagName+">")}else{var curTag=tags[inner.state.tagName],attrs=curTag&&curTag.attrs,globalAttrs=tags["!attrs"];if(!attrs&&!globalAttrs)return;if(!attrs)attrs=globalAttrs;else if(globalAttrs){var set={};for(var nm in globalAttrs)globalAttrs.hasOwnProperty(nm)&&(set[nm]=globalAttrs[nm]);for(var nm in attrs)attrs.hasOwnProperty(nm)&&(set[nm]=attrs[nm]);attrs=set}if("string"==token.type||"="==token.string){var before=cm.getRange(Pos(cur.line,_Mathmax2(0,cur.ch-60)),Pos(cur.line,"string"==token.type?token.start:token.end)),atName=before.match(/([^\s\u00a0=<>\"\']+)=$/),atValues;if(!atName||!attrs.hasOwnProperty(atName[1])||!(atValues=attrs[atName[1]]))return;if("function"==typeof atValues&&(atValues=atValues.call(this,cm)),"string"==token.type){prefix=token.string;var n=0;/['"]/.test(token.string.charAt(0))&&(quote=token.string.charAt(0),prefix=token.string.slice(1),n++);var len=token.string.length;/['"]/.test(token.string.charAt(len-1))&&(quote=token.string.charAt(len-1),prefix=token.string.substr(n,len-2)),replaceToken=!0}for(var i=0;i<atValues.length;++i)prefix&&0!=atValues[i].lastIndexOf(prefix,0)||result.push(quote+atValues[i]+quote)}else for(var attr in"attribute"==token.type&&(prefix=token.string,replaceToken=!0),attrs)attrs.hasOwnProperty(attr)&&(!prefix||0==attr.lastIndexOf(prefix,0))&&result.push(attr)}return{list:result,from:replaceToken?Pos(cur.line,null==tagStart?token.start:tagStart):cur,to:replaceToken?Pos(cur.line,token.end):cur}}}})})},LnjZ:function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__("WSyY")},Lu2N:function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}exports.__esModule=!0;var StreamReader=function(){function StreamReader(string,start,end){_classCallCheck(this,StreamReader),null==end&&"string"==typeof string&&(end=string.length),this.string=string,this.pos=this.start=start||0,this.end=end}return StreamReader.prototype.eof=function(){return this.pos>=this.end},StreamReader.prototype.limit=function(start,end){return new this.constructor(this.string,start,end)},StreamReader.prototype.peek=function(){return this.string.charCodeAt(this.pos)},StreamReader.prototype.next=function(){if(this.pos<this.string.length)return this.string.charCodeAt(this.pos++)},StreamReader.prototype.eat=function(match){var ch=this.peek(),ok="function"==typeof match?match(ch):ch===match;return ok&&this.next(),ok},StreamReader.prototype.eatWhile=function(match){for(var start=this.pos;!this.eof()&&this.eat(match););return this.pos!==start},StreamReader.prototype.backUp=function(n){this.pos-=n||1},StreamReader.prototype.current=function(){return this.substring(this.start,this.pos)},StreamReader.prototype.substring=function(start,end){return this.string.slice(start,end)},StreamReader.prototype.error=function(message){var err=new Error(message+" at char "+(this.pos+1));return err.originalMessage=message,err.pos=this.pos,err.string=this.string,err},StreamReader}();exports.default=StreamReader},MCp7:function(){"use strict";(function(self){function normalizeName(name){if("string"!=typeof name&&(name+=""),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name))throw new TypeError("Invalid character in header field name");return name.toLowerCase()}function normalizeValue(value){return"string"!=typeof value&&(value+=""),value}function iteratorFor(items){var iterator={next:function(){var value=items.shift();return{done:void 0===value,value:value}}};return support.iterable&&(iterator[Symbol.iterator]=function(){return iterator}),iterator}function Headers(headers){this.map={},headers instanceof Headers?headers.forEach(function(value,name){this.append(name,value)},this):Array.isArray(headers)?headers.forEach(function(header){this.append(header[0],header[1])},this):headers&&Object.getOwnPropertyNames(headers).forEach(function(name){this.append(name,headers[name])},this)}function consumed(body){return body.bodyUsed?Promise.reject(new TypeError("Already read")):void(body.bodyUsed=!0)}function fileReaderReady(reader){return new Promise(function(resolve,reject){reader.onload=function(){resolve(reader.result)},reader.onerror=function(){reject(reader.error)}})}function readBlobAsArrayBuffer(blob){var reader=new FileReader,promise=fileReaderReady(reader);return reader.readAsArrayBuffer(blob),promise}function readBlobAsText(blob){var reader=new FileReader,promise=fileReaderReady(reader);return reader.readAsText(blob),promise}function readArrayBufferAsText(buf){for(var view=new Uint8Array(buf),chars=Array(view.length),i=0;i<view.length;i++)chars[i]=String.fromCharCode(view[i]);return chars.join("")}function bufferClone(buf){if(buf.slice)return buf.slice(0);var view=new Uint8Array(buf.byteLength);return view.set(new Uint8Array(buf)),view.buffer}function Body(){return this.bodyUsed=!1,this._initBody=function(body){if(this._bodyInit=body,!body)this._bodyText="";else if("string"==typeof body)this._bodyText=body;else if(support.blob&&Blob.prototype.isPrototypeOf(body))this._bodyBlob=body;else if(support.formData&&FormData.prototype.isPrototypeOf(body))this._bodyFormData=body;else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(body))this._bodyText=body.toString();else if(support.arrayBuffer&&support.blob&&isDataView(body))this._bodyArrayBuffer=bufferClone(body.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else if(support.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(body)||isArrayBufferView(body)))this._bodyArrayBuffer=bufferClone(body);else throw new Error("unsupported BodyInit type");this.headers.get("content-type")||("string"==typeof body?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):support.searchParams&&URLSearchParams.prototype.isPrototypeOf(body)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},support.blob&&(this.blob=function(){var rejected=consumed(this);if(rejected)return rejected;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");else return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?consumed(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(readBlobAsArrayBuffer)}),this.text=function(){var rejected=consumed(this);if(rejected)return rejected;if(this._bodyBlob)return readBlobAsText(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");else return Promise.resolve(this._bodyText)},support.formData&&(this.formData=function(){return this.text().then(decode)}),this.json=function(){return this.text().then(JSON.parse)},this}function normalizeMethod(method){var upcased=method.toUpperCase();return-1<methods.indexOf(upcased)?upcased:method}function Request(input,options){options=options||{};var body=options.body;if(input instanceof Request){if(input.bodyUsed)throw new TypeError("Already read");this.url=input.url,this.credentials=input.credentials,options.headers||(this.headers=new Headers(input.headers)),this.method=input.method,this.mode=input.mode,body||null==input._bodyInit||(body=input._bodyInit,input.bodyUsed=!0)}else this.url=input+"";if(this.credentials=options.credentials||this.credentials||"omit",(options.headers||!this.headers)&&(this.headers=new Headers(options.headers)),this.method=normalizeMethod(options.method||this.method||"GET"),this.mode=options.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&body)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(body)}function decode(body){var form=new FormData;return body.trim().split("&").forEach(function(bytes){if(bytes){var split=bytes.split("="),name=split.shift().replace(/\+/g," "),value=split.join("=").replace(/\+/g," ");form.append(decodeURIComponent(name),decodeURIComponent(value))}}),form}function parseHeaders(rawHeaders){var headers=new Headers,preProcessedHeaders=rawHeaders.replace(/\r?\n[\t ]+/g," ");return preProcessedHeaders.split(/\r?\n/).forEach(function(line){var parts=line.split(":"),key=parts.shift().trim();if(key){var value=parts.join(":").trim();headers.append(key,value)}}),headers}function Response(bodyInit,options){options||(options={}),this.type="default",this.status=void 0===options.status?200:options.status,this.ok=200<=this.status&&300>this.status,this.statusText="statusText"in options?options.statusText:"OK",this.headers=new Headers(options.headers),this.url=options.url||"",this._initBody(bodyInit)}if(!self.fetch){var support={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(support.arrayBuffer)var viewClasses=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],isDataView=function(obj){return obj&&DataView.prototype.isPrototypeOf(obj)},isArrayBufferView=ArrayBuffer.isView||function(obj){return obj&&-1<viewClasses.indexOf(Object.prototype.toString.call(obj))};Headers.prototype.append=function(name,value){name=normalizeName(name),value=normalizeValue(value);var oldValue=this.map[name];this.map[name]=oldValue?oldValue+","+value:value},Headers.prototype["delete"]=function(name){delete this.map[normalizeName(name)]},Headers.prototype.get=function(name){return name=normalizeName(name),this.has(name)?this.map[name]:null},Headers.prototype.has=function(name){return this.map.hasOwnProperty(normalizeName(name))},Headers.prototype.set=function(name,value){this.map[normalizeName(name)]=normalizeValue(value)},Headers.prototype.forEach=function(callback,thisArg){for(var name in this.map)this.map.hasOwnProperty(name)&&callback.call(thisArg,this.map[name],name,this)},Headers.prototype.keys=function(){var items=[];return this.forEach(function(value,name){items.push(name)}),iteratorFor(items)},Headers.prototype.values=function(){var items=[];return this.forEach(function(value){items.push(value)}),iteratorFor(items)},Headers.prototype.entries=function(){var items=[];return this.forEach(function(value,name){items.push([name,value])}),iteratorFor(items)},support.iterable&&(Headers.prototype[Symbol.iterator]=Headers.prototype.entries);var methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];Request.prototype.clone=function(){return new Request(this,{body:this._bodyInit})},Body.call(Request.prototype),Body.call(Response.prototype),Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})},Response.error=function(){var response=new Response(null,{status:0,statusText:""});return response.type="error",response};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(url,status){if(-1===redirectStatuses.indexOf(status))throw new RangeError("Invalid status code");return new Response(null,{status:status,headers:{location:url}})},self.Headers=Headers,self.Request=Request,self.Response=Response,self.fetch=function(input,init){return new Promise(function(resolve,reject){var request=new Request(input,init),xhr=new XMLHttpRequest;xhr.onload=function(){var options={status:xhr.status,statusText:xhr.statusText,headers:parseHeaders(xhr.getAllResponseHeaders()||"")};options.url="responseURL"in xhr?xhr.responseURL:options.headers.get("X-Request-URL");var body="response"in xhr?xhr.response:xhr.responseText;resolve(new Response(body,options))},xhr.onerror=function(){reject(new TypeError("Network request failed"))},xhr.ontimeout=function(){reject(new TypeError("Network request failed"))},xhr.open(request.method,request.url,!0),"include"===request.credentials?xhr.withCredentials=!0:"omit"===request.credentials&&(xhr.withCredentials=!1),"responseType"in xhr&&support.blob&&(xhr.responseType="blob"),request.headers.forEach(function(value,name){xhr.setRequestHeader(name,value)}),xhr.send("undefined"==typeof request._bodyInit?null:request._bodyInit)})},self.fetch.polyfill=!0}})("undefined"==typeof self?void 0:self)},"ML/b":function(module,exports,__webpack_require__){"use strict";function DataReader(data){this.data=data,this.length=data.length,this.index=0,this.zero=0}var utils=__webpack_require__("dvMn");DataReader.prototype={checkOffset:function(offset){this.checkIndex(this.index+offset)},checkIndex:function(newIndex){if(this.length<this.zero+newIndex||0>newIndex)throw new Error("End of data reached (data length = "+this.length+", asked index = "+newIndex+"). Corrupted zip ?")},setIndex:function(newIndex){this.checkIndex(newIndex),this.index=newIndex},skip:function(n){this.setIndex(this.index+n)},byteAt:function(){},readInt:function(size){var result=0,i;for(this.checkOffset(size),i=this.index+size-1;i>=this.index;i--)result=(result<<8)+this.byteAt(i);return this.index+=size,result},readString:function(size){return utils.transformTo("string",this.readData(size))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var dostime=this.readInt(4);return new Date(Date.UTC((127&dostime>>25)+1980,(15&dostime>>21)-1,31&dostime>>16,31&dostime>>11,63&dostime>>5,(31&dostime)<<1))}},module.exports=DataReader},PO9O:function(module,exports,__webpack_require__){"use strict";function CompressedObject(compressedSize,uncompressedSize,crc32,compression,data){this.compressedSize=compressedSize,this.uncompressedSize=uncompressedSize,this.crc32=crc32,this.compression=compression,this.compressedContent=data}var external=__webpack_require__("8JlO"),DataWorker=__webpack_require__("ABU1"),DataLengthProbe=__webpack_require__("S9RN"),Crc32Probe=__webpack_require__("gpbE"),DataLengthProbe=__webpack_require__("S9RN");CompressedObject.prototype={getContentWorker:function(){var worker=new DataWorker(external.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new DataLengthProbe("data_length")),that=this;return worker.on("end",function(){if(this.streamInfo.data_length!==that.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),worker},getCompressedWorker:function(){return new DataWorker(external.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},CompressedObject.createWorkerFrom=function(uncompressedWorker,compression,compressionOptions){return uncompressedWorker.pipe(new Crc32Probe).pipe(new DataLengthProbe("uncompressedSize")).pipe(compression.compressWorker(compressionOptions)).pipe(new DataLengthProbe("compressedSize")).withStreamInfo("compression",compression)},module.exports=CompressedObject},Ps3q:function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__("dvMn"),support=__webpack_require__("untT"),_keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";exports.encode=function(input){for(var output=[],i=0,len=input.length,remainingBytes=len,isArray="string"!==utils.getTypeOf(input),chr1,chr2,chr3,enc1,enc2,enc3,enc4;i<input.length;)remainingBytes=len-i,isArray?(chr1=input[i++],chr2=i<len?input[i++]:0,chr3=i<len?input[i++]:0):(chr1=input.charCodeAt(i++),chr2=i<len?input.charCodeAt(i++):0,chr3=i<len?input.charCodeAt(i++):0),enc1=chr1>>2,enc2=(3&chr1)<<4|chr2>>4,enc3=1<remainingBytes?(15&chr2)<<2|chr3>>6:64,enc4=2<remainingBytes?63&chr3:64,output.push(_keyStr.charAt(enc1)+_keyStr.charAt(enc2)+_keyStr.charAt(enc3)+_keyStr.charAt(enc4));return output.join("")},exports.decode=function(input){var i=0,resultIndex=0,dataUrlPrefix="data:",chr1,chr2,chr3,enc1,enc2,enc3,enc4;if(input.substr(0,dataUrlPrefix.length)===dataUrlPrefix)throw new Error("Invalid base64 input, it looks like a data url.");input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");var totalLength=3*input.length/4;if(input.charAt(input.length-1)===_keyStr.charAt(64)&&totalLength--,input.charAt(input.length-2)===_keyStr.charAt(64)&&totalLength--,0!=totalLength%1)throw new Error("Invalid base64 input, bad content length.");var output;for(output=support.uint8array?new Uint8Array(0|totalLength):Array(0|totalLength);i<input.length;)enc1=_keyStr.indexOf(input.charAt(i++)),enc2=_keyStr.indexOf(input.charAt(i++)),enc3=_keyStr.indexOf(input.charAt(i++)),enc4=_keyStr.indexOf(input.charAt(i++)),chr1=enc1<<2|enc2>>4,chr2=(15&enc2)<<4|enc3>>2,chr3=(3&enc3)<<6|enc4,output[resultIndex++]=chr1,64!==enc3&&(output[resultIndex++]=chr2),64!==enc4&&(output[resultIndex++]=chr3);return output}},Q14w:function(module,exports){"use strict";function objectToString(o){return Object.prototype.toString.call(o)}exports.isArray=function(arg){return Array.isArray?Array.isArray(arg):"[object Array]"===objectToString(arg)},exports.isBoolean=function(arg){return"boolean"==typeof arg},exports.isNull=function(arg){return null===arg},exports.isNullOrUndefined=function(arg){return null==arg},exports.isNumber=function(arg){return"number"==typeof arg},exports.isString=function(arg){return"string"==typeof arg},exports.isSymbol=function(arg){return"symbol"==typeof arg},exports.isUndefined=function(arg){return void 0===arg},exports.isRegExp=function(re){return"[object RegExp]"===objectToString(re)},exports.isObject=function(arg){return"object"==typeof arg&&null!==arg},exports.isDate=function(d){return"[object Date]"===objectToString(d)},exports.isError=function(e){return"[object Error]"===objectToString(e)||e instanceof Error},exports.isFunction=function(arg){return"function"==typeof arg},exports.isPrimitive=function(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||"undefined"==typeof arg},exports.isBuffer=Buffer.isBuffer},QAmr:function(module,exports){"use strict";exports.__esModule=!0;var index="function"==typeof fetch?fetch.bind():function(url,options){return options=options||{},new Promise(function(resolve,reject){function response(){var _keys=[],all=[],headers={},header;return request.getAllResponseHeaders().replace(/^(.*?):\s*([\s\S]*?)$/gm,function(m,key,value){_keys.push(key=key.toLowerCase()),all.push([key,value]),header=headers[key],headers[key]=header?header+","+value:value}),{ok:1==(0|request.status/200),status:request.status,statusText:request.statusText,url:request.responseURL,clone:response,text:function(){return Promise.resolve(request.responseText)},json:function(){return Promise.resolve(request.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([request.response]))},headers:{keys:function(){return _keys},entries:function(){return all},get:function(n){return headers[n.toLowerCase()]},has:function(n){return n.toLowerCase()in headers}}}}var request=new XMLHttpRequest;for(var i in request.open(options.method||"get",url),options.headers)request.setRequestHeader(i,options.headers[i]);request.withCredentials="include"==options.credentials,request.onload=function(){resolve(response())},request.onerror=reject,request.send(options.body)})};exports.default=index},R0uB:function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _mark(string,fields,token){token=token||createToken;var ordered=fields.map(function(field,order){return{order:order,field:field,end:field.location+field.length}}).sort(function(a,b){return a.end-b.end||a.order-b.order}),offset=0,result=ordered.map(function(item){var placeholder=string.substr(item.field.location,item.field.length),prefix=string.slice(offset,item.field.location);return offset=item.end,prefix+token(item.field.index,placeholder)});return result.join("")+string.slice(offset)}function createToken(index,placeholder){return placeholder?"${"+index+":"+placeholder+"}":"${"+index+"}"}function consumeField(stream,location){var start=stream.pos;if(stream.eat(DOLLAR)){var index=consumeIndex(stream),placeholder="";if(null!=index)return new Field(index,placeholder,location);if(stream.eat(OPEN_BRACE)&&(index=consumeIndex(stream),null!=index&&(stream.eat(COLON)&&(placeholder=consumePlaceholder(stream)),stream.eat(CLOSE_BRACE))))return new Field(index,placeholder,location)}stream.pos=start}function consumePlaceholder(stream){var code=void 0,stack=[];for(stream.start=stream.pos;!stream.eof();){if(code=stream.peek(),code===OPEN_BRACE)stack.push(stream.pos);else if(code===CLOSE_BRACE){if(!stack.length)break;stack.pop()}stream.next()}if(stack.length)throw stream.error("Unable to find matching \"}\" for curly brace at "+stack.pop());return stream.current()}function consumeIndex(stream){if(stream.start=stream.pos,stream.eatWhile(_streamReaderUtils.isNumber))return+stream.current()}exports.__esModule=!0,exports.createToken=exports.mark=void 0;var _streamReader=__webpack_require__("Lu2N"),_streamReader2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_streamReader),_streamReaderUtils=__webpack_require__("rc1b"),DOLLAR=36,COLON=58,OPEN_BRACE=123,CLOSE_BRACE=125,Field=function Field(index,placeholder,location){_classCallCheck(this,Field),this.index=index,this.placeholder=placeholder,this.location=location,this.length=this.placeholder.length},FieldString=function(){function FieldString(string,fields){_classCallCheck(this,FieldString),this.string=string,this.fields=fields}return FieldString.prototype.mark=function(token){return _mark(this.string,this.fields,token)},FieldString.prototype.toString=function(){return this.string},FieldString}();exports.default=function(string){for(var stream=new _streamReader2.default(string),fields=[],cleanString="",offset=0,pos=0,code=void 0,field=void 0;!stream.eof();)code=stream.peek(),pos=stream.pos,code===92?(stream.next(),stream.next()):(field=consumeField(stream,cleanString.length+pos-offset))?(fields.push(field),cleanString+=stream.string.slice(offset,pos)+field.placeholder,offset=stream.pos):stream.next();return new FieldString(cleanString+stream.string.slice(offset),fields)},exports.mark=_mark,exports.createToken=createToken},REa7:function(module){"use strict";var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},S9RN:function(module,exports,__webpack_require__){"use strict";function DataLengthProbe(propName){GenericWorker.call(this,"DataLengthProbe for "+propName),this.propName=propName,this.withStreamInfo(propName,0)}var utils=__webpack_require__("dvMn"),GenericWorker=__webpack_require__("ZKdc");utils.inherits(DataLengthProbe,GenericWorker),DataLengthProbe.prototype.processChunk=function(chunk){if(chunk){var length=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=length+chunk.data.length}GenericWorker.prototype.processChunk.call(this,chunk)},module.exports=DataLengthProbe},SUmx:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"),__webpack_require__("ggoL"))})(function(CodeMirror){var pseudoClasses={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};CodeMirror.registerHelper("hint","css",function(cm){function add(keywords){for(var name in keywords)word&&0!=name.lastIndexOf(word,0)||result.push(name)}var cur=cm.getCursor(),token=cm.getTokenAt(cur),inner=CodeMirror.innerMode(cm.getMode(),token.state);if("css"==inner.mode.name){if("keyword"==token.type&&0=="!important".indexOf(token.string))return{list:["!important"],from:CodeMirror.Pos(cur.line,token.start),to:CodeMirror.Pos(cur.line,token.end)};var start=token.start,end=cur.ch,word=token.string.slice(0,end-start);/[^\w$_-]/.test(word)&&(word="",start=end=cur.ch);var spec=CodeMirror.resolveMode("text/css"),result=[],st=inner.state.state;if("pseudo"==st||"variable-3"==token.type?add(pseudoClasses):"block"==st||"maybeprop"==st?add(spec.propertyKeywords):"prop"==st||"parens"==st||"at"==st||"params"==st?(add(spec.valueKeywords),add(spec.colorKeywords)):("media"==st||"media_parens"==st)&&(add(spec.mediaTypes),add(spec.mediaFeatures)),result.length)return{list:result,from:CodeMirror.Pos(cur.line,start),to:CodeMirror.Pos(cur.line,end)}}})})},"Sm7/":function(module,exports,__webpack_require__){"use strict";function Utf8DecodeWorker(){GenericWorker.call(this,"utf-8 decode"),this.leftOver=null}function Utf8EncodeWorker(){GenericWorker.call(this,"utf-8 encode")}for(var utils=__webpack_require__("dvMn"),support=__webpack_require__("untT"),nodejsUtils=__webpack_require__("c5OX"),GenericWorker=__webpack_require__("ZKdc"),_utf8len=Array(256),i=0;256>i;i++)_utf8len[i]=252<=i?6:248<=i?5:240<=i?4:224<=i?3:192<=i?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=function(str){var str_len=str.length,buf_len=0,buf,c,c2,m_pos,i;for(m_pos=0;m_pos<str_len;m_pos++)c=str.charCodeAt(m_pos),55296==(64512&c)&&m_pos+1<str_len&&(c2=str.charCodeAt(m_pos+1),56320==(64512&c2)&&(c=65536+(c-55296<<10)+(c2-56320),m_pos++)),buf_len+=128>c?1:2048>c?2:65536>c?3:4;for(buf=support.uint8array?new Uint8Array(buf_len):Array(buf_len),i=0,m_pos=0;i<buf_len;m_pos++)c=str.charCodeAt(m_pos),55296==(64512&c)&&m_pos+1<str_len&&(c2=str.charCodeAt(m_pos+1),56320==(64512&c2)&&(c=65536+(c-55296<<10)+(c2-56320),m_pos++)),128>c?buf[i++]=c:2048>c?(buf[i++]=192|c>>>6,buf[i++]=128|63&c):65536>c?(buf[i++]=224|c>>>12,buf[i++]=128|63&c>>>6,buf[i++]=128|63&c):(buf[i++]=240|c>>>18,buf[i++]=128|63&c>>>12,buf[i++]=128|63&c>>>6,buf[i++]=128|63&c);return buf},utf8border=function(buf,max){var pos;for(max=max||buf.length,max>buf.length&&(max=buf.length),pos=max-1;0<=pos&&128==(192&buf[pos]);)pos--;return 0>pos?max:0===pos?max:pos+_utf8len[buf[pos]]>max?pos:max},buf2string=function(buf){var len=buf.length,utf16buf=Array(2*len),i,out,c,c_len;for(out=0,i=0;i<len;){if(c=buf[i++],128>c){utf16buf[out++]=c;continue}if(c_len=_utf8len[c],4<c_len){utf16buf[out++]=65533,i+=c_len-1;continue}for(c&=2===c_len?31:3===c_len?15:7;1<c_len&&i<len;)c=c<<6|63&buf[i++],c_len--;if(1<c_len){utf16buf[out++]=65533;continue}65536>c?utf16buf[out++]=c:(c-=65536,utf16buf[out++]=55296|1023&c>>10,utf16buf[out++]=56320|1023&c)}return utf16buf.length!==out&&(utf16buf.subarray?utf16buf=utf16buf.subarray(0,out):utf16buf.length=out),utils.applyFromCharCode(utf16buf)};exports.utf8encode=function(str){return support.nodebuffer?nodejsUtils.newBufferFrom(str,"utf-8"):string2buf(str)},exports.utf8decode=function(buf){return support.nodebuffer?utils.transformTo("nodebuffer",buf).toString("utf-8"):(buf=utils.transformTo(support.uint8array?"uint8array":"array",buf),buf2string(buf))},utils.inherits(Utf8DecodeWorker,GenericWorker),Utf8DecodeWorker.prototype.processChunk=function(chunk){var data=utils.transformTo(support.uint8array?"uint8array":"array",chunk.data);if(this.leftOver&&this.leftOver.length){if(support.uint8array){var previousData=data;data=new Uint8Array(previousData.length+this.leftOver.length),data.set(this.leftOver,0),data.set(previousData,this.leftOver.length)}else data=this.leftOver.concat(data);this.leftOver=null}var nextBoundary=utf8border(data),usableData=data;nextBoundary!==data.length&&(support.uint8array?(usableData=data.subarray(0,nextBoundary),this.leftOver=data.subarray(nextBoundary,data.length)):(usableData=data.slice(0,nextBoundary),this.leftOver=data.slice(nextBoundary,data.length))),this.push({data:exports.utf8decode(usableData),meta:chunk.meta})},Utf8DecodeWorker.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:exports.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},exports.Utf8DecodeWorker=Utf8DecodeWorker,utils.inherits(Utf8EncodeWorker,GenericWorker),Utf8EncodeWorker.prototype.processChunk=function(chunk){this.push({data:exports.utf8encode(chunk.data),meta:chunk.meta})},exports.Utf8EncodeWorker=Utf8EncodeWorker},TCoK:function(module,exports,__webpack_require__){"use strict";function ArrayReader(data){DataReader.call(this,data);for(var i=0;i<this.data.length;i++)data[i]&=255}var DataReader=__webpack_require__("ML/b"),utils=__webpack_require__("dvMn");utils.inherits(ArrayReader,DataReader),ArrayReader.prototype.byteAt=function(i){return this.data[this.zero+i]},ArrayReader.prototype.lastIndexOfSignature=function(sig){for(var sig0=sig.charCodeAt(0),sig1=sig.charCodeAt(1),sig2=sig.charCodeAt(2),sig3=sig.charCodeAt(3),i=this.length-4;0<=i;--i)if(this.data[i]===sig0&&this.data[i+1]===sig1&&this.data[i+2]===sig2&&this.data[i+3]===sig3)return i-this.zero;return-1},ArrayReader.prototype.readAndCheckSignature=function(sig){var sig0=sig.charCodeAt(0),sig1=sig.charCodeAt(1),sig2=sig.charCodeAt(2),sig3=sig.charCodeAt(3),data=this.readData(4);return sig0===data[0]&&sig1===data[1]&&sig2===data[2]&&sig3===data[3]},ArrayReader.prototype.readData=function(size){if(this.checkOffset(size),0===size)return[];var result=this.data.slice(this.zero+this.index,this.zero+this.index+size);return this.index+=size,result},module.exports=ArrayReader},TUpU:function(module,exports){"use strict";exports.__esModule=!0;var instances=[],LogLevel;(function(LogLevel){LogLevel[LogLevel.DEBUG=0]="DEBUG",LogLevel[LogLevel.VERBOSE=1]="VERBOSE",LogLevel[LogLevel.INFO=2]="INFO",LogLevel[LogLevel.WARN=3]="WARN",LogLevel[LogLevel.ERROR=4]="ERROR",LogLevel[LogLevel.SILENT=5]="SILENT"})(LogLevel||(exports.LogLevel=LogLevel={}));var defaultLogLevel=LogLevel.INFO,defaultLogHandler=function(instance,logType){for(var args=[],_i=2;_i<arguments.length;_i++)args[_i-2]=arguments[_i];if(!(logType<instance.logLevel)){var now=new Date().toISOString();switch(logType){case LogLevel.DEBUG:console.log.apply(console,["["+now+"] "+instance.name+":"].concat(args));break;case LogLevel.VERBOSE:console.log.apply(console,["["+now+"] "+instance.name+":"].concat(args));break;case LogLevel.INFO:console.info.apply(console,["["+now+"] "+instance.name+":"].concat(args));break;case LogLevel.WARN:console.warn.apply(console,["["+now+"] "+instance.name+":"].concat(args));break;case LogLevel.ERROR:console.error.apply(console,["["+now+"] "+instance.name+":"].concat(args));break;default:throw new Error("Attempted to log a message with an invalid logType (value: "+logType+")");}}},Logger=function(){function Logger(name){this.name=name,this._logLevel=defaultLogLevel,this._logHandler=defaultLogHandler,instances.push(this)}return Object.defineProperty(Logger.prototype,"logLevel",{get:function(){return this._logLevel},set:function(val){if(!(val in LogLevel))throw new TypeError("Invalid value assigned to `logLevel`");this._logLevel=val},enumerable:!0,configurable:!0}),Object.defineProperty(Logger.prototype,"logHandler",{get:function(){return this._logHandler},set:function(val){if("function"!=typeof val)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=val},enumerable:!0,configurable:!0}),Logger.prototype.debug=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];this._logHandler.apply(this,[this,LogLevel.DEBUG].concat(args))},Logger.prototype.log=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];this._logHandler.apply(this,[this,LogLevel.VERBOSE].concat(args))},Logger.prototype.info=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];this._logHandler.apply(this,[this,LogLevel.INFO].concat(args))},Logger.prototype.warn=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];this._logHandler.apply(this,[this,LogLevel.WARN].concat(args))},Logger.prototype.error=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];this._logHandler.apply(this,[this,LogLevel.ERROR].concat(args))},Logger}();exports.setLogLevel=function(level){instances.forEach(function(inst){inst.logLevel=level})},exports.Logger=Logger,exports.LogLevel=LogLevel},VS7n:function(module,exports,__webpack_require__){"use strict";module.exports=window.fetch||(window.fetch=__webpack_require__("QAmr").default||__webpack_require__("QAmr"))},WSyY:function(module,exports,__webpack_require__){"use strict";(function(global){function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(_this,state)}}function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk)}function _isUint8Array(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array}function nop(){}function WritableState(options,stream){Duplex=Duplex||__webpack_require__("Hba+"),options=options||{};var isDuplex=stream instanceof Duplex;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,writableHwm=options.writableHighWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:isDuplex&&(writableHwm||0===writableHwm)?writableHwm:defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=!1===options.decodeStrings;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){onwrite(stream,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(options){return Duplex=Duplex||__webpack_require__("Hba+"),realHasInstance.call(Writable,this)||this instanceof Duplex?void(this._writableState=new WritableState(options,this),this.writable=!0,options&&("function"==typeof options.write&&(this._write=options.write),"function"==typeof options.writev&&(this._writev=options.writev),"function"==typeof options.destroy&&(this._destroy=options.destroy),"function"==typeof options.final&&(this._final=options.final)),Stream.call(this)):new Writable(options)}function writeAfterEnd(stream,cb){var er=new Error("write after end");stream.emit("error",er),pna.nextTick(cb,er)}function validChunk(stream,state,chunk,cb){var valid=!0,er=!1;return null===chunk?er=new TypeError("May not write null values to stream"):"string"!=typeof chunk&&void 0!==chunk&&!state.objectMode&&(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream.emit("error",er),pna.nextTick(cb,er),valid=!1),valid}function decodeChunk(state,chunk,encoding){return state.objectMode||!1===state.decodeStrings||"string"!=typeof chunk||(chunk=Buffer.from(chunk,encoding)),chunk}function writeOrBuffer(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=decodeChunk(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(ret||(state.needDrain=!0),state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest={chunk:chunk,encoding:encoding,isBuf:isBuf,callback:cb,next:null},last?last.next=state.lastBufferedRequest:state.bufferedRequest=state.lastBufferedRequest,state.bufferedRequestCount+=1}else doWrite(stream,state,!1,len,chunk,encoding,cb);return ret}function doWrite(stream,state,writev,len,chunk,encoding,cb){state.writelen=len,state.writecb=cb,state.writing=!0,state.sync=!0,writev?stream._writev(chunk,state.onwrite):stream._write(chunk,encoding,state.onwrite),state.sync=!1}function onwriteError(stream,state,sync,er,cb){--state.pendingcb,sync?(pna.nextTick(cb,er),pna.nextTick(finishMaybe,stream,state),stream._writableState.errorEmitted=!0,stream.emit("error",er)):(cb(er),stream._writableState.errorEmitted=!0,stream.emit("error",er),finishMaybe(stream,state))}function onwriteStateUpdate(state){state.writing=!1,state.writecb=null,state.length-=state.writelen,state.writelen=0}function onwrite(stream,er){var state=stream._writableState,sync=state.sync,cb=state.writecb;if(onwriteStateUpdate(state),er)onwriteError(stream,state,sync,er,cb);else{var finished=needFinish(state);finished||state.corked||state.bufferProcessing||!state.bufferedRequest||clearBuffer(stream,state),sync?asyncWrite(afterWrite,stream,state,finished,cb):afterWrite(stream,state,finished,cb)}}function afterWrite(stream,state,finished,cb){finished||onwriteDrain(stream,state),state.pendingcb--,cb(),finishMaybe(stream,state)}function onwriteDrain(stream,state){0===state.length&&state.needDrain&&(state.needDrain=!1,stream.emit("drain"))}function clearBuffer(stream,state){state.bufferProcessing=!0;var entry=state.bufferedRequest;if(stream._writev&&entry&&entry.next){var l=state.bufferedRequestCount,buffer=Array(l),holder=state.corkedRequestsFree;holder.entry=entry;for(var count=0,allBuffers=!0;entry;)buffer[count]=entry,entry.isBuf||(allBuffers=!1),entry=entry.next,count+=1;buffer.allBuffers=allBuffers,doWrite(stream,state,!0,state.length,buffer,"",holder.finish),state.pendingcb++,state.lastBufferedRequest=null,holder.next?(state.corkedRequestsFree=holder.next,holder.next=null):state.corkedRequestsFree=new CorkedRequest(state),state.bufferedRequestCount=0}else{for(;entry;){var chunk=entry.chunk,encoding=entry.encoding,cb=entry.callback,len=state.objectMode?1:chunk.length;if(doWrite(stream,state,!1,len,chunk,encoding,cb),entry=entry.next,state.bufferedRequestCount--,state.writing)break}null===entry&&(state.lastBufferedRequest=null)}state.bufferedRequest=entry,state.bufferProcessing=!1}function needFinish(state){return state.ending&&0===state.length&&null===state.bufferedRequest&&!state.finished&&!state.writing}function callFinal(stream,state){stream._final(function(err){state.pendingcb--,err&&stream.emit("error",err),state.prefinished=!0,stream.emit("prefinish"),finishMaybe(stream,state)})}function prefinish(stream,state){state.prefinished||state.finalCalled||("function"==typeof stream._final?(state.pendingcb++,state.finalCalled=!0,pna.nextTick(callFinal,stream,state)):(state.prefinished=!0,stream.emit("prefinish")))}function finishMaybe(stream,state){var need=needFinish(state);return need&&(prefinish(stream,state),0===state.pendingcb&&(state.finished=!0,stream.emit("finish"))),need}function endWritable(stream,state,cb){state.ending=!0,finishMaybe(stream,state),cb&&(state.finished?pna.nextTick(cb):stream.once("finish",cb)),state.ended=!0,stream.writable=!1}function onCorkedFinish(corkReq,state,err){var entry=corkReq.entry;for(corkReq.entry=null;entry;){var cb=entry.callback;state.pendingcb--,cb(err),entry=entry.next}state.corkedRequestsFree?state.corkedRequestsFree.next=corkReq:state.corkedRequestsFree=corkReq}var pna=__webpack_require__("Yj0v");module.exports=Writable;var asyncWrite=!process.browser&&-1<["v0.10","v0.9."].indexOf(process.version.slice(0,5))?setImmediate:pna.nextTick,Duplex;Writable.WritableState=WritableState;var util=__webpack_require__("Q14w");util.inherits=__webpack_require__("4Bm0");var internalUtil={deprecate:__webpack_require__("yM1o")},Stream=__webpack_require__("1ExO"),Buffer=__webpack_require__("38Wu").Buffer,OurUint8Array=global.Uint8Array||function(){},destroyImpl=__webpack_require__("GRUB");util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||this===Writable&&object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=!state.objectMode&&_isUint8Array(chunk);return isBuf&&!Buffer.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":!encoding&&(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){var state=this._writableState;state.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest&&clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}}),Writable.prototype.destroy=destroyImpl.destroy,Writable.prototype._undestroy=destroyImpl.undestroy,Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}).call(exports,__webpack_require__("h6ac"))},X4kj:function(module){"use strict";var crcTable=function(){for(var table=[],n=0,c;256>n;n++){c=n;for(var k=0;8>k;k++)c=1&c?3988292384^c>>>1:c>>>1;table[n]=c}return table}();module.exports=function(crc,buf,len,pos){crc^=-1;for(var i=pos;i<pos+len;i++)crc=crc>>>8^crcTable[255&(crc^buf[i])];return-1^crc}},X7my:function(module,exports,__webpack_require__){"use strict";var _Mathmin=Math.min;(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){function firstNonWS(str){var found=str.search(nonWS);return-1==found?0:found}function probablyInsideString(cm,pos,line){return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line,0)))&&!/^[\'\"\`]/.test(line)}function getMode(cm,pos){var mode=cm.getMode();return!1!==mode.useInnerComments&&mode.innerMode?cm.getModeAt(pos):mode}var noOptions={},nonWS=/[^\s\u00a0]/,Pos=CodeMirror.Pos;CodeMirror.commands.toggleComment=function(cm){cm.toggleComment()},CodeMirror.defineExtension("toggleComment",function(options){options||(options=noOptions);for(var cm=this,minLine=Infinity,ranges=this.listSelections(),mode=null,i=ranges.length-1;0<=i;i--){var from=ranges[i].from(),to=ranges[i].to();from.line>=minLine||(to.line>=minLine&&(to=Pos(minLine,0)),minLine=from.line,null==mode?cm.uncomment(from,to,options)?mode="un":(cm.lineComment(from,to,options),mode="line"):"un"==mode?cm.uncomment(from,to,options):cm.lineComment(from,to,options))}}),CodeMirror.defineExtension("lineComment",function(from,to,options){options||(options=noOptions);var self=this,mode=getMode(self,from),firstLine=self.getLine(from.line);if(!(null==firstLine||probablyInsideString(self,from,firstLine))){var commentString=options.lineComment||mode.lineComment;if(!commentString)return void((options.blockCommentStart||mode.blockCommentStart)&&(options.fullLines=!0,self.blockComment(from,to,options)));var end=_Mathmin(0!=to.ch||to.line==from.line?to.line+1:to.line,self.lastLine()+1),pad=null==options.padding?" ":options.padding,blankLines=options.commentBlankLines||from.line==to.line;self.operation(function(){if(options.indent){for(var baseString=null,i=from.line;i<end;++i){var line=self.getLine(i),whitespace=line.slice(0,firstNonWS(line));(null==baseString||baseString.length>whitespace.length)&&(baseString=whitespace)}for(var i=from.line;i<end;++i){var line=self.getLine(i),cut=baseString.length;!blankLines&&!nonWS.test(line)||(line.slice(0,cut)!=baseString&&(cut=firstNonWS(line)),self.replaceRange(baseString+commentString+pad,Pos(i,0),Pos(i,cut)))}}else for(var i=from.line;i<end;++i)(blankLines||nonWS.test(self.getLine(i)))&&self.replaceRange(commentString+pad,Pos(i,0))})}}),CodeMirror.defineExtension("blockComment",function(from,to,options){options||(options=noOptions);var self=this,mode=getMode(self,from),startString=options.blockCommentStart||mode.blockCommentStart,endString=options.blockCommentEnd||mode.blockCommentEnd;if(!startString||!endString)return void((options.lineComment||mode.lineComment)&&!1!=options.fullLines&&self.lineComment(from,to,options));if(!/\bcomment\b/.test(self.getTokenTypeAt(Pos(from.line,0)))){var end=_Mathmin(to.line,self.lastLine());end!=from.line&&0==to.ch&&nonWS.test(self.getLine(end))&&--end;var pad=null==options.padding?" ":options.padding;from.line>end||self.operation(function(){if(!1!=options.fullLines){var lastLineHasText=nonWS.test(self.getLine(end));self.replaceRange(pad+endString,Pos(end)),self.replaceRange(startString+pad,Pos(from.line,0));var lead=options.blockCommentLead||mode.blockCommentLead;if(null!=lead)for(var i=from.line+1;i<=end;++i)(i!=end||lastLineHasText)&&self.replaceRange(lead+pad,Pos(i,0))}else self.replaceRange(endString,to),self.replaceRange(startString,from)})}}),CodeMirror.defineExtension("uncomment",function(from,to,options){options||(options=noOptions);var self=this,mode=getMode(self,from),end=_Mathmin(0!=to.ch||to.line==from.line?to.line:to.line-1,self.lastLine()),start=_Mathmin(from.line,end),lineString=options.lineComment||mode.lineComment,lines=[],pad=null==options.padding?" ":options.padding,didSomething;lineComment:{if(!lineString)break lineComment;for(var i=start;i<=end;++i){var line=self.getLine(i),found=line.indexOf(lineString);if(-1<found&&!/comment/.test(self.getTokenTypeAt(Pos(i,found+1)))&&(found=-1),-1==found&&nonWS.test(line))break lineComment;if(-1<found&&nonWS.test(line.slice(0,found)))break lineComment;lines.push(line)}if(self.operation(function(){for(var i=start;i<=end;++i){var line=lines[i-start],pos=line.indexOf(lineString),endPos=pos+lineString.length;0>pos||(line.slice(endPos,endPos+pad.length)==pad&&(endPos+=pad.length),didSomething=!0,self.replaceRange("",Pos(i,pos),Pos(i,endPos)))}}),didSomething)return!0}var startString=options.blockCommentStart||mode.blockCommentStart,endString=options.blockCommentEnd||mode.blockCommentEnd;if(!startString||!endString)return!1;var lead=options.blockCommentLead||mode.blockCommentLead,startLine=self.getLine(start),open=startLine.indexOf(startString);if(-1==open)return!1;var endLine=end==start?startLine:self.getLine(end),close=endLine.indexOf(endString,end==start?open+startString.length:0),insideStart=Pos(start,open+1),insideEnd=Pos(end,close+1);if(-1==close||!/comment/.test(self.getTokenTypeAt(insideStart))||!/comment/.test(self.getTokenTypeAt(insideEnd))||-1<self.getRange(insideStart,insideEnd,"\n").indexOf(endString))return!1;var lastStart=startLine.lastIndexOf(startString,from.ch),firstEnd=-1==lastStart?-1:startLine.slice(0,from.ch).indexOf(endString,lastStart+startString.length);if(-1!=lastStart&&-1!=firstEnd&&firstEnd+endString.length!=from.ch)return!1;firstEnd=endLine.indexOf(endString,to.ch);var almostLastStart=endLine.slice(to.ch).lastIndexOf(startString,firstEnd-to.ch);return(lastStart=-1==firstEnd||-1==almostLastStart?-1:to.ch+almostLastStart,-1==firstEnd||-1==lastStart||lastStart==to.ch)&&(self.operation(function(){self.replaceRange("",Pos(end,close-(pad&&endLine.slice(close-pad.length,close)==pad?pad.length:0)),Pos(end,close+endString.length));var openEnd=open+startString.length;if(pad&&startLine.slice(openEnd,openEnd+pad.length)==pad&&(openEnd+=pad.length),self.replaceRange("",Pos(start,open),Pos(start,openEnd)),lead)for(var i=start+1;i<=end;++i){var line=self.getLine(i),found=line.indexOf(lead);if(!(-1==found||nonWS.test(line.slice(0,found)))){var foundEnd=found+lead.length;pad&&line.slice(foundEnd,foundEnd+pad.length)==pad&&(foundEnd+=pad.length),self.replaceRange("",Pos(i,found),Pos(i,foundEnd))}}}),!0)})})},Xc2M:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"),__webpack_require__("29F7"),__webpack_require__("uQIK"))})(function(CodeMirror){function findPosSubword(doc,start,dir){if(0>dir&&0==start.ch)return doc.clipPos(Pos(start.line-1));var line=doc.getLine(start.line);if(0<dir&&start.ch>=line.length)return doc.clipPos(Pos(start.line+1,0));for(var state="start",pos=start.ch,e=0>dir?0:line.length,i=0,type;pos!=e;pos+=dir,i++){var next=line.charAt(0>dir?pos-1:pos),cat="_"!=next&&CodeMirror.isWordChar(next)?"w":"o";if("w"==cat&&next.toUpperCase()==next&&(cat="W"),"start"==state)"o"!=cat&&(state="in",type=cat);else if("in"==state&&type!=cat){if("w"==type&&"W"==cat&&0>dir&&pos--,"W"==type&&"w"==cat&&0<dir){type="w";continue}break}}return Pos(start.line,pos)}function moveSubword(cm,dir){cm.extendSelectionsBy(function(range){return cm.display.shift||cm.doc.extend||range.empty()?findPosSubword(cm.doc,range.head,dir):0>dir?range.from():range.to()})}function insertLine(cm,above){return cm.isReadOnly()?CodeMirror.Pass:void(cm.operation(function(){for(var len=cm.listSelections().length,newSelection=[],last=-1,i=0,head;i<len;i++)if(head=cm.listSelections()[i].head,!(head.line<=last)){var at=Pos(head.line+(above?0:1),0);cm.replaceRange("\n",at,null,"+insertLine"),cm.indentLine(at.line,null,!0),newSelection.push({head:at,anchor:at}),last=head.line+1}cm.setSelections(newSelection)}),cm.execCommand("indentAuto"))}function wordAt(cm,pos){for(var start=pos.ch,end=start,line=cm.getLine(pos.line);start&&CodeMirror.isWordChar(line.charAt(start-1));)--start;for(;end<line.length&&CodeMirror.isWordChar(line.charAt(end));)++end;return{from:Pos(pos.line,start),to:Pos(pos.line,end),word:line.slice(start,end)}}function addCursorToSelection(cm,dir){for(var ranges=cm.listSelections(),newRanges=[],i=0;i<ranges.length;i++){var range=ranges[i],newAnchor=cm.findPosV(range.anchor,dir,"line",range.anchor.goalColumn),newHead=cm.findPosV(range.head,dir,"line",range.head.goalColumn);newAnchor.goalColumn=null==range.anchor.goalColumn?cm.cursorCoords(range.anchor,"div").left:range.anchor.goalColumn,newHead.goalColumn=null==range.head.goalColumn?cm.cursorCoords(range.head,"div").left:range.head.goalColumn;newRanges.push(range),newRanges.push({anchor:newAnchor,head:newHead})}cm.setSelections(newRanges)}function isSelectedRange(ranges,from,to){for(var i=0;i<ranges.length;i++)if(ranges[i].from()==from&&ranges[i].to()==to)return!0;return!1}function selectBetweenBrackets(cm){for(var ranges=cm.listSelections(),newRanges=[],i=0;i<ranges.length;i++){var range=ranges[i],pos=range.head,opening=cm.scanForBracket(pos,-1);if(!opening)return!1;for(;;){var closing=cm.scanForBracket(pos,1);if(!closing)return!1;if(closing.ch==mirror.charAt(mirror.indexOf(opening.ch)+1)){var startPos=Pos(opening.pos.line,opening.pos.ch+1);if(0!=CodeMirror.cmpPos(startPos,range.from())||0!=CodeMirror.cmpPos(closing.pos,range.to())){newRanges.push({anchor:startPos,head:closing.pos});break}else if(opening=cm.scanForBracket(opening.pos,-1),!opening)return!1}pos=Pos(closing.pos.line,closing.pos.ch+1)}}return cm.setSelections(newRanges),!0}function sortLines(cm,caseSensitive){if(cm.isReadOnly())return CodeMirror.Pass;for(var ranges=cm.listSelections(),toSort=[],i=0,selected,range;i<ranges.length;i++)if(range=ranges[i],!range.empty()){for(var from=range.from().line,to=range.to().line;i<ranges.length-1&&ranges[i+1].from().line==to;)to=ranges[++i].to().line;ranges[i].to().ch||to--,toSort.push(from,to)}toSort.length?selected=!0:toSort.push(cm.firstLine(),cm.lastLine()),cm.operation(function(){for(var ranges=[],i=0;i<toSort.length;i+=2){var from=toSort[i],to=toSort[i+1],start=Pos(from,0),end=Pos(to),lines=cm.getRange(start,end,!1);caseSensitive?lines.sort():lines.sort(function(a,b){var au=a.toUpperCase(),bu=b.toUpperCase();return au!=bu&&(a=au,b=bu),a<b?-1:a==b?0:1}),cm.replaceRange(lines,start,end),selected&&ranges.push({anchor:start,head:Pos(to+1,0)})}selected&&cm.setSelections(ranges,0)})}function modifyWordOrSelection(cm,mod){cm.operation(function(){for(var ranges=cm.listSelections(),indices=[],replacements=[],i=0,range;i<ranges.length;i++)range=ranges[i],range.empty()?(indices.push(i),replacements.push("")):replacements.push(mod(cm.getRange(range.from(),range.to())));cm.replaceSelections(replacements,"around","case");for(var i=indices.length-1,at,range;0<=i;i--)if(range=ranges[indices[i]],!(at&&0<CodeMirror.cmpPos(range.head,at))){var word=wordAt(cm,range.head);at=word.from,cm.replaceRange(mod(word.word),word.from,word.to)}})}function getTarget(cm){var from=cm.getCursor("from"),to=cm.getCursor("to");if(0==CodeMirror.cmpPos(from,to)){var word=wordAt(cm,from);if(!word.word)return;from=word.from,to=word.to}return{from:from,to:to,query:cm.getRange(from,to),word:word}}function findAndGoTo(cm,forward){var target=getTarget(cm);if(target){var query=target.query,cur=cm.getSearchCursor(query,forward?target.to:target.from);(forward?cur.findNext():cur.findPrevious())?cm.setSelection(cur.from(),cur.to()):(cur=cm.getSearchCursor(query,forward?Pos(cm.firstLine(),0):cm.clipPos(Pos(cm.lastLine()))),(forward?cur.findNext():cur.findPrevious())?cm.setSelection(cur.from(),cur.to()):target.word&&cm.setSelection(target.from,target.to))}}var cmds=CodeMirror.commands,Pos=CodeMirror.Pos;cmds.goSubwordLeft=function(cm){moveSubword(cm,-1)},cmds.goSubwordRight=function(cm){moveSubword(cm,1)},cmds.scrollLineUp=function(cm){var info=cm.getScrollInfo();if(!cm.somethingSelected()){var visibleBottomLine=cm.lineAtHeight(info.top+info.clientHeight,"local");cm.getCursor().line>=visibleBottomLine&&cm.execCommand("goLineUp")}cm.scrollTo(null,info.top-cm.defaultTextHeight())},cmds.scrollLineDown=function(cm){var info=cm.getScrollInfo();if(!cm.somethingSelected()){var visibleTopLine=cm.lineAtHeight(info.top,"local")+1;cm.getCursor().line<=visibleTopLine&&cm.execCommand("goLineDown")}cm.scrollTo(null,info.top+cm.defaultTextHeight())},cmds.splitSelectionByLine=function(cm){for(var ranges=cm.listSelections(),lineRanges=[],i=0;i<ranges.length;i++)for(var from=ranges[i].from(),to=ranges[i].to(),line=from.line;line<=to.line;++line)to.line>from.line&&line==to.line&&0==to.ch||lineRanges.push({anchor:line==from.line?from:Pos(line,0),head:line==to.line?to:Pos(line)});cm.setSelections(lineRanges,0)},cmds.singleSelectionTop=function(cm){var range=cm.listSelections()[0];cm.setSelection(range.anchor,range.head,{scroll:!1})},cmds.selectLine=function(cm){for(var ranges=cm.listSelections(),extended=[],i=0,range;i<ranges.length;i++)range=ranges[i],extended.push({anchor:Pos(range.from().line,0),head:Pos(range.to().line+1,0)});cm.setSelections(extended)},cmds.insertLineAfter=function(cm){return insertLine(cm,!1)},cmds.insertLineBefore=function(cm){return insertLine(cm,!0)},cmds.selectNextOccurrence=function(cm){var from=cm.getCursor("from"),to=cm.getCursor("to"),fullWord=cm.state.sublimeFindFullWord==cm.doc.sel;if(0==CodeMirror.cmpPos(from,to)){var word=wordAt(cm,from);if(!word.word)return;cm.setSelection(word.from,word.to),fullWord=!0}else{var text=cm.getRange(from,to),query=fullWord?new RegExp("\\b"+text+"\\b"):text,cur=cm.getSearchCursor(query,to),found=cur.findNext();if(found||(cur=cm.getSearchCursor(query,Pos(cm.firstLine(),0)),found=cur.findNext()),!found||isSelectedRange(cm.listSelections(),cur.from(),cur.to()))return CodeMirror.Pass;cm.addSelection(cur.from(),cur.to())}fullWord&&(cm.state.sublimeFindFullWord=cm.doc.sel)},cmds.addCursorToPrevLine=function(cm){addCursorToSelection(cm,-1)},cmds.addCursorToNextLine=function(cm){addCursorToSelection(cm,1)};var mirror="(){}[]";cmds.selectScope=function(cm){selectBetweenBrackets(cm)||cm.execCommand("selectAll")},cmds.selectBetweenBrackets=function(cm){if(!selectBetweenBrackets(cm))return CodeMirror.Pass},cmds.goToBracket=function(cm){cm.extendSelectionsBy(function(range){var next=cm.scanForBracket(range.head,1);if(next&&0!=CodeMirror.cmpPos(next.pos,range.head))return next.pos;var prev=cm.scanForBracket(range.head,-1);return prev&&Pos(prev.pos.line,prev.pos.ch+1)||range.head})},cmds.swapLineUp=function(cm){if(cm.isReadOnly())return CodeMirror.Pass;for(var ranges=cm.listSelections(),linesToMove=[],at=cm.firstLine()-1,newSels=[],i=0;i<ranges.length;i++){var range=ranges[i],from=range.from().line-1,to=range.to().line;newSels.push({anchor:Pos(range.anchor.line-1,range.anchor.ch),head:Pos(range.head.line-1,range.head.ch)}),0!=range.to().ch||range.empty()||--to,from>at?linesToMove.push(from,to):linesToMove.length&&(linesToMove[linesToMove.length-1]=to),at=to}cm.operation(function(){for(var i=0;i<linesToMove.length;i+=2){var from=linesToMove[i],to=linesToMove[i+1],line=cm.getLine(from);cm.replaceRange("",Pos(from,0),Pos(from+1,0),"+swapLine"),to>cm.lastLine()?cm.replaceRange("\n"+line,Pos(cm.lastLine()),null,"+swapLine"):cm.replaceRange(line+"\n",Pos(to,0),null,"+swapLine")}cm.setSelections(newSels),cm.scrollIntoView()})},cmds.swapLineDown=function(cm){if(cm.isReadOnly())return CodeMirror.Pass;for(var ranges=cm.listSelections(),linesToMove=[],at=cm.lastLine()+1,i=ranges.length-1;0<=i;i--){var range=ranges[i],from=range.to().line+1,to=range.from().line;0!=range.to().ch||range.empty()||from--,from<at?linesToMove.push(from,to):linesToMove.length&&(linesToMove[linesToMove.length-1]=to),at=to}cm.operation(function(){for(var i=linesToMove.length-2;0<=i;i-=2){var from=linesToMove[i],to=linesToMove[i+1],line=cm.getLine(from);from==cm.lastLine()?cm.replaceRange("",Pos(from-1),Pos(from),"+swapLine"):cm.replaceRange("",Pos(from,0),Pos(from+1,0),"+swapLine"),cm.replaceRange(line+"\n",Pos(to,0),null,"+swapLine")}cm.scrollIntoView()})},cmds.toggleCommentIndented=function(cm){cm.toggleComment({indent:!0})},cmds.joinLines=function(cm){for(var ranges=cm.listSelections(),joined=[],i=0;i<ranges.length;i++){for(var range=ranges[i],from=range.from(),start=from.line,end=range.to().line;i<ranges.length-1&&ranges[i+1].from().line==end;)end=ranges[++i].to().line;joined.push({start:start,end:end,anchor:!range.empty()&&from})}cm.operation(function(){for(var offset=0,ranges=[],i=0;i<joined.length;i++){for(var obj=joined[i],anchor=obj.anchor&&Pos(obj.anchor.line-offset,obj.anchor.ch),line=obj.start,head,actual;line<=obj.end;line++)actual=line-offset,line==obj.end&&(head=Pos(actual,cm.getLine(actual).length+1)),actual<cm.lastLine()&&(cm.replaceRange(" ",Pos(actual),Pos(actual+1,/^\s*/.exec(cm.getLine(actual+1))[0].length)),++offset);ranges.push({anchor:anchor||head,head:head})}cm.setSelections(ranges,0)})},cmds.duplicateLine=function(cm){cm.operation(function(){for(var rangeCount=cm.listSelections().length,i=0,range;i<rangeCount;i++)range=cm.listSelections()[i],range.empty()?cm.replaceRange(cm.getLine(range.head.line)+"\n",Pos(range.head.line,0)):cm.replaceRange(cm.getRange(range.from(),range.to()),range.from());cm.scrollIntoView()})},cmds.sortLines=function(cm){sortLines(cm,!0)},cmds.sortLinesInsensitive=function(cm){sortLines(cm,!1)},cmds.nextBookmark=function(cm){var marks=cm.state.sublimeBookmarks;if(marks)for(;marks.length;){var current=marks.shift(),found=current.find();if(found)return marks.push(current),cm.setSelection(found.from,found.to)}},cmds.prevBookmark=function(cm){var marks=cm.state.sublimeBookmarks;if(marks)for(;marks.length;){marks.unshift(marks.pop());var found=marks[marks.length-1].find();if(!found)marks.pop();else return cm.setSelection(found.from,found.to)}},cmds.toggleBookmark=function(cm){for(var ranges=cm.listSelections(),marks=cm.state.sublimeBookmarks||(cm.state.sublimeBookmarks=[]),i=0;i<ranges.length;i++){for(var from=ranges[i].from(),to=ranges[i].to(),found=ranges[i].empty()?cm.findMarksAt(from):cm.findMarks(from,to),j=0;j<found.length;j++)if(found[j].sublimeBookmark){found[j].clear();for(var k=0;k<marks.length;k++)marks[k]==found[j]&&marks.splice(k--,1);break}j==found.length&&marks.push(cm.markText(from,to,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},cmds.clearBookmarks=function(cm){var marks=cm.state.sublimeBookmarks;if(marks)for(var i=0;i<marks.length;i++)marks[i].clear();marks.length=0},cmds.selectBookmarks=function(cm){var marks=cm.state.sublimeBookmarks,ranges=[];if(marks)for(var i=0,found;i<marks.length;i++)found=marks[i].find(),found?ranges.push({anchor:found.from,head:found.to}):marks.splice(i--,0);ranges.length&&cm.setSelections(ranges,0)},cmds.smartBackspace=function(cm){return cm.somethingSelected()?CodeMirror.Pass:void cm.operation(function(){for(var cursors=cm.listSelections(),indentUnit=cm.getOption("indentUnit"),i=cursors.length-1;0<=i;i--){var cursor=cursors[i].head,toStartOfLine=cm.getRange({line:cursor.line,ch:0},cursor),column=CodeMirror.countColumn(toStartOfLine,null,cm.getOption("tabSize")),deletePos=cm.findPosH(cursor,-1,"char",!1);if(toStartOfLine&&!/\S/.test(toStartOfLine)&&0==column%indentUnit){var prevIndent=new Pos(cursor.line,CodeMirror.findColumn(toStartOfLine,column-indentUnit,indentUnit));prevIndent.ch!=cursor.ch&&(deletePos=prevIndent)}cm.replaceRange("",deletePos,cursor,"+delete")}})},cmds.delLineRight=function(cm){cm.operation(function(){for(var ranges=cm.listSelections(),i=ranges.length-1;0<=i;i--)cm.replaceRange("",ranges[i].anchor,Pos(ranges[i].to().line),"+delete");cm.scrollIntoView()})},cmds.upcaseAtCursor=function(cm){modifyWordOrSelection(cm,function(str){return str.toUpperCase()})},cmds.downcaseAtCursor=function(cm){modifyWordOrSelection(cm,function(str){return str.toLowerCase()})},cmds.setSublimeMark=function(cm){cm.state.sublimeMark&&cm.state.sublimeMark.clear(),cm.state.sublimeMark=cm.setBookmark(cm.getCursor())},cmds.selectToSublimeMark=function(cm){var found=cm.state.sublimeMark&&cm.state.sublimeMark.find();found&&cm.setSelection(cm.getCursor(),found)},cmds.deleteToSublimeMark=function(cm){var found=cm.state.sublimeMark&&cm.state.sublimeMark.find();if(found){var from=cm.getCursor(),to=found;if(0<CodeMirror.cmpPos(from,to)){var tmp=to;to=from,from=tmp}cm.state.sublimeKilled=cm.getRange(from,to),cm.replaceRange("",from,to)}},cmds.swapWithSublimeMark=function(cm){var found=cm.state.sublimeMark&&cm.state.sublimeMark.find();found&&(cm.state.sublimeMark.clear(),cm.state.sublimeMark=cm.setBookmark(cm.getCursor()),cm.setCursor(found))},cmds.sublimeYank=function(cm){null!=cm.state.sublimeKilled&&cm.replaceSelection(cm.state.sublimeKilled,null,"paste")},cmds.showInCenter=function(cm){var pos=cm.cursorCoords(null,"local");cm.scrollTo(null,(pos.top+pos.bottom)/2-cm.getScrollInfo().clientHeight/2)},cmds.findUnder=function(cm){findAndGoTo(cm,!0)},cmds.findUnderPrevious=function(cm){findAndGoTo(cm,!1)},cmds.findAllUnder=function(cm){var target=getTarget(cm);if(target){for(var cur=cm.getSearchCursor(target.query),matches=[],primaryIndex=-1;cur.findNext();)matches.push({anchor:cur.from(),head:cur.to()}),cur.from().line<=target.from.line&&cur.from().ch<=target.from.ch&&primaryIndex++;cm.setSelections(matches,primaryIndex)}};var keyMap=CodeMirror.keyMap;keyMap.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F9:"sortLines","Cmd-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},CodeMirror.normalizeKeyMap(keyMap.macSublime),keyMap.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Ctrl-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},CodeMirror.normalizeKeyMap(keyMap.pcSublime);var mac=keyMap.default==keyMap.macDefault;keyMap.sublime=mac?keyMap.macSublime:keyMap.pcSublime})},XfO6:function(module,exports,__webpack_require__){"use strict";var GenericWorker=__webpack_require__("ZKdc");exports.STORE={magic:"\0\0",compressWorker:function(){return new GenericWorker("STORE compression")},uncompressWorker:function(){return new GenericWorker("STORE decompression")}},exports.DEFLATE=__webpack_require__("p7rG")},Yj0v:function(module){"use strict";module.exports=process.version&&0!==process.version.indexOf("v0.")&&(0!==process.version.indexOf("v1.")||0===process.version.indexOf("v1.8."))?process:{nextTick:function(fn,arg1,arg2,arg3){if("function"!=typeof fn)throw new TypeError("\"callback\" argument must be a function");var len=arguments.length,args,i;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function(){fn.call(null,arg1)});case 3:return process.nextTick(function(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function(){fn.call(null,arg1,arg2,arg3)});default:for(args=Array(len-1),i=0;i<args.length;)args[i++]=arguments[i];return process.nextTick(function(){fn.apply(null,args)});}}}},ZKdc:function(module){"use strict";function GenericWorker(name){this.name=name||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}GenericWorker.prototype={push:function(chunk){this.emit("data",chunk)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(name,listener){return this._listeners[name].push(listener),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(name,arg){if(this._listeners[name])for(var i=0;i<this._listeners[name].length;i++)this._listeners[name][i].call(this,arg)},pipe:function(next){return next.registerPrevious(this)},registerPrevious:function(previous){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=previous.streamInfo,this.mergeStreamInfo(),this.previous=previous;var self=this;return previous.on("data",function(chunk){self.processChunk(chunk)}),previous.on("end",function(){self.end()}),previous.on("error",function(e){self.error(e)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var withError=!1;return this.generatedError&&(this.error(this.generatedError),withError=!0),this.previous&&this.previous.resume(),!withError},flush:function(){},processChunk:function(chunk){this.push(chunk)},withStreamInfo:function(key,value){return this.extraStreamInfo[key]=value,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var key in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(key)&&(this.streamInfo[key]=this.extraStreamInfo[key])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var me="Worker "+this.name;return this.previous?this.previous+" -> "+me:me}},module.exports=GenericWorker},ZTma:function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isQuote(c){return c===SINGLE_QUOTE||c===DOUBLE_QUOTE}function eatQuoted(stream){var start=stream.pos,quote=stream.prev();if(isQuote(quote))for(;!stream.sol();)if(stream.prev()===quote&&stream.peek()!==ESCAPE)return!0;return stream.pos=start,!1}function eatAttribute(stream){return eatAttributeWithQuotedValue(stream)||eatAttributeWithUnquotedValue(stream)}function eatAttributeWithQuotedValue(stream){var start=stream.pos;return eatQuoted(stream)&&stream.eat(EQUALS)&&eatIdent(stream)||(stream.pos=start,!1)}function eatAttributeWithUnquotedValue(stream){var start=stream.pos;return stream.eatWhile(isUnquotedValue)&&stream.eat(EQUALS)&&eatIdent(stream)||(stream.pos=start,!1)}function eatIdent(stream){return stream.eatWhile(isIdent)}function isIdent(c){return c===COLON||c===DASH||isAlpha(c)||isNumber(c)}function isAlpha(c){return c&=-33,65<=c&&90>=c}function isNumber(c){return 47<c&&58>c}function isWhiteSpace(c){return c===SPACE||c===TAB}function isUnquotedValue(c){return c&&c!==EQUALS&&!isWhiteSpace(c)&&!isQuote(c)}function offsetPastAutoClosed(line,pos,options){for(isQuote(line.charCodeAt(pos))&&pos++;isCloseBrace(line.charCodeAt(pos),options.syntax);)pos++;return pos}function getStartOffset(line,pos,prefix){if(!prefix)return 0;var stream=new StreamReader(line),compiledPrefix=(prefix+"").split("").map(code);stream.pos=pos;for(var result;!stream.sol();)if(!(consumePair(stream,SQUARE_BRACE_R,SQUARE_BRACE_L)||consumePair(stream,CURLY_BRACE_R,CURLY_BRACE_L))){if(result=stream.pos,consumeArray(stream,compiledPrefix))return result;stream.pos--}return-1}function consumePair(stream,close,open){var start=stream.pos;if(stream.eat(close))for(;!stream.sol();){if(stream.eat(open))return!0;stream.pos--}return stream.pos=start,!1}function consumeArray(stream,arr){for(var start=stream.pos,consumed=!1,i=arr.length-1;0<=i&&!stream.sol()&&!!stream.eat(arr[i]);i--)consumed=0===i;return consumed||(stream.pos=start),consumed}function has(arr,value){return-1!==arr.indexOf(value)}function isAbbreviation(c){return 64<c&&91>c||96<c&&123>c||47<c&&58>c||specialChars.has(c)}function isOpenBrace(c,syntax){return c===ROUND_BRACE_L||"markup"===syntax&&(c===SQUARE_BRACE_L||c===CURLY_BRACE_L)}function isCloseBrace(c,syntax){return c===ROUND_BRACE_R||"markup"===syntax&&(c===SQUARE_BRACE_R||c===CURLY_BRACE_R)}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},StreamReader=function(){function StreamReader(string,start){_classCallCheck(this,StreamReader),this.string=string,this.start=start||0,this.pos=this.string.length}return StreamReader.prototype.sol=function(){return this.pos===this.start},StreamReader.prototype.peek=function(offset){return this.string.charCodeAt(this.pos-1+(offset||0))},StreamReader.prototype.prev=function(){if(!this.sol())return this.string.charCodeAt(--this.pos)},StreamReader.prototype.eat=function(match){if(this.sol())return!1;var ok="function"==typeof match?match(this.peek()):match===this.peek();return ok&&this.pos--,ok},StreamReader.prototype.eatWhile=function(match){for(var start=this.pos;this.eat(match););return this.pos<start},StreamReader}(),SINGLE_QUOTE=39,DOUBLE_QUOTE=34,ESCAPE=92,TAB=9,SPACE=32,DASH=45,SLASH=47,COLON=58,EQUALS=61,ANGLE_LEFT=60,isAtHTMLTag=function(stream){var start=stream.pos;if(!stream.eat(62))return!1;var ok=!1;for(stream.eat(SLASH);!stream.sol();){if(stream.eatWhile(isWhiteSpace),eatIdent(stream)){if(stream.eat(SLASH)){ok=stream.eat(ANGLE_LEFT);break}else if(stream.eat(ANGLE_LEFT)){ok=!0;break}else if(stream.eat(isWhiteSpace))continue;else if(stream.eat(EQUALS)){if(eatIdent(stream))continue;break}else if(eatAttributeWithUnquotedValue(stream)){ok=!0;break}break}if(!eatAttribute(stream))break}return stream.pos=start,ok},code=function(ch){return ch.charCodeAt(0)},SQUARE_BRACE_L=code("["),SQUARE_BRACE_R=code("]"),ROUND_BRACE_L=code("("),ROUND_BRACE_R=code(")"),CURLY_BRACE_L=code("{"),CURLY_BRACE_R=code("}"),specialChars=new Set(["#",".","*",":","$","-","_","!","@","%","^","+",">","/"].map(code)),bracePairs=new Map().set(SQUARE_BRACE_L,SQUARE_BRACE_R).set(ROUND_BRACE_L,ROUND_BRACE_R).set(CURLY_BRACE_L,CURLY_BRACE_R),defaultOptions={syntax:"markup",lookAhead:null,prefix:""};exports.default=function(line,pos,options){pos=Math.min(line.length,Math.max(0,null==pos?line.length:pos)),options="boolean"==typeof options?_extends({},defaultOptions,{lookAhead:options}):_extends({},defaultOptions,options),(null==options.lookAhead||!0===options.lookAhead)&&(pos=offsetPastAutoClosed(line,pos,options));var c=void 0,start=getStartOffset(line,pos,options.prefix);if(-1===start)return null;var stream=new StreamReader(line,start);stream.pos=pos;for(var stack=[];!stream.sol();){if(c=stream.peek(),isCloseBrace(c,options.syntax))stack.push(c);else if(isOpenBrace(c,options.syntax)){if(stack.pop()!==bracePairs.get(c))break;}else if(has(stack,SQUARE_BRACE_R)||has(stack,CURLY_BRACE_R)){stream.pos--;continue}else if(isAtHTMLTag(stream)||!isAbbreviation(c))break;stream.pos--}if(!stack.length&&stream.pos!==pos){var abbreviation=line.slice(stream.pos,pos).replace(/^[*+>^]+/,"");return{abbreviation:abbreviation,location:pos-abbreviation.length,start:options.prefix?start-options.prefix.length:pos-abbreviation.length,end:pos}}}},ZUoI:function(module,exports,__webpack_require__){"use strict";__webpack_require__("wGjj");var firebase=function(ex){return ex&&"object"==typeof ex&&"default"in ex?ex["default"]:ex}(__webpack_require__("dP58"));module.exports=firebase},Znrd:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function template(str,data){if(null==str)return str;for(var stack=[],replacer=function(str,left,token,right){return null==data[token]?"":left+data[token]+right},output="",offset=0,i=0,code=void 0,lastPos=void 0;i<str.length;)code=str.charCodeAt(i),code===TOKEN_OPEN?stack.push(i):code===TOKEN_CLOSE&&(lastPos=stack.pop(),!stack.length&&(output+=str.slice(offset,lastPos)+str.slice(lastPos+1,i).replace(TOKEN,replacer),offset=i+1)),i++;return output+str.slice(offset)}function splitByLines(text){return(text||"").split(/\r\n|\r|\n/g)}function isFirstChild(node){return node.parent.firstChild===node}function isRoot(node){return node&&!node.parent}function isPseudoSnippet(node){return node.isTextOnly&&!!node.children.length}function handlePseudoSnippet(outNode){var node=outNode.node;if(isPseudoSnippet(node)){var fieldsModel=(0,_fieldParser2.default)(node.value),field=findLowestIndexField(fieldsModel);if(field){var parts=splitFieldsModel(fieldsModel,field);outNode.open=outNode.renderFields(parts[0]),outNode.close=outNode.renderFields(parts[1])}else outNode.text=outNode.renderFields(fieldsModel);return!0}return!1}function findLowestIndexField(model){return model.fields.reduce(function(result,field){return!result||field.index<result.index?field:result},null)}function splitFieldsModel(model,field){var ix=model.fields.indexOf(field),left=new model.constructor(model.string.slice(0,field.location),model.fields.slice(0,ix)),right=new model.constructor(model.string.slice(field.location+field.length),model.fields.slice(ix+1));return[left,right]}function setFormatting(outNode,profile){var node=outNode.node;if(shouldFormatNode(node,profile)){outNode.indent=profile.indent(getIndentLevel(node,profile)),outNode.newline="\n";var prefix=outNode.newline+outNode.indent;isRoot(node.parent)&&isFirstChild(node)||(outNode.beforeOpen=prefix,node.isTextOnly&&(outNode.beforeText=prefix)),hasInnerFormatting(node,profile)&&(!node.isTextOnly&&(outNode.beforeText=prefix+profile.indent(1)),outNode.beforeClose=prefix)}return outNode}function shouldFormatNode(node,profile){return!!profile.get("format")&&(node.parent.isTextOnly&&1===node.parent.children.length&&(0,_fieldParser2.default)(node.parent.value).fields.length?!1:!isInline(node,profile)||shouldFormatInline(node,profile))}function shouldFormatInline(node,profile){if(!isInline(node,profile))return!1;if(isPseudoSnippet(node))return!0;if(0===node.childIndex){for(var next=node;next=next.nextSibling;)if(!isInline(next,profile))return!0;}else if(!isInline(node.previousSibling,profile))return!0;if(profile.get("inlineBreak")){for(var adjacentInline=1,before=node,after=node;isInlineElement(before=before.previousSibling,profile);)adjacentInline++;for(;isInlineElement(after=after.nextSibling,profile);)adjacentInline++;if(adjacentInline>=profile.get("inlineBreak"))return!0}for(var i=0,il=node.children.length;i<il;i++)if(shouldFormatNode(node.children[i],profile))return!0;return!1}function hasInnerFormatting(node,profile){var nodeName=(node.name||"").toLowerCase();if(-1!==profile.get("formatForce").indexOf(nodeName))return!0;for(var i=0;i<node.children.length;i++)if(shouldFormatNode(node.children[i],profile))return!0;return!1}function formatAttributes(outNode,profile){var node=outNode.node;return node.attributes.map(function(attr){if(attr.options.implied&&null==attr.value)return null;var attrName=profile.attribute(attr.name),attrValue=null;if(attr.options.boolean||-1!==profile.get("booleanAttributes").indexOf(attrName.toLowerCase())){if(profile.get("compactBooleanAttributes")&&null==attr.value)return" "+attrName;null==attr.value&&(attrValue=attrName)}return null==attrValue&&(attrValue=outNode.renderFields(attr.value))," "+attrName+"="+profile.quote(attrValue)}).join("")}function isInline(node,profile){return node&&node.isTextOnly||isInlineElement(node,profile)}function isInlineElement(node,profile){return node&&profile.isInline(node)}function getIndentLevel(node,profile){for(var skip=profile.get("formatSkip")||[],level=node.parent.isTextOnly?-2:-1,ctx=node;ctx=ctx.parent;)-1===skip.indexOf((ctx.name||"").toLowerCase())&&level++;return 0>level?0:level}function commentNode(outNode,options){var node=outNode.node;if(options.enabled&&options.trigger&&node.name)for(var attrs=outNode.node.attributes.reduce(function(out,attr){return attr.name&&null!=attr.value&&(out[attr.name.toUpperCase().replace(/-/g,"_")]=attr.value),out},{}),i=0,il=options.trigger.length;i<il;i++)if(options.trigger[i].toUpperCase()in attrs){outNode.open=template(options.before,attrs)+outNode.open,outNode.close&&(outNode.close+=template(options.after,attrs));break}}function getFormatOptions(options){var format=_extends({},options&&options.format);return format.comment=_extends({},commentOptions,format.comment),format}function indentFormat(outNode,profile,options){options=_extends({},defaultNodeOptions,options);var node=outNode.node;if(outNode.indent=profile.indent(getIndentLevel$1(node,profile)),outNode.newline="\n",isRoot(node.parent)&&isFirstChild(node)||(outNode.beforeOpen=outNode.newline+outNode.indent),node.name){var data=_extends({NAME:profile.name(node.name),SELF_CLOSE:node.selfClosing?options.selfClose:null},getAttributes(outNode,profile,options.attributes));options.omitName&&options.omitName.test(data.NAME)&&data.PRIMARY_ATTRS&&(data.NAME=null),null!=options.open&&(outNode.open=template(options.open,data)),null!=options.close&&(outNode.close=template(options.close,data))}return outNode}function getAttributes(outNode,profile,options){options=_extends({},defaultAttrOptions,options);var primary=[],secondary=[],node=outNode.node;return node.attributes.forEach(function(attr){if(attr.options.implied&&null==attr.value)return null;var name=profile.attribute(attr.name),value=outNode.renderFields(attr.value);if(reId.test(name))value&&primary.push("#"+value);else if(reClass.test(name))value&&primary.push("."+value.replace(/\s+/g,"."));else{var isBoolean=null==attr.value&&(attr.options.boolean||-1!==profile.get("booleanAttributes").indexOf(name.toLowerCase()));secondary.push({name:name,value:value,isBoolean:isBoolean})}}),{PRIMARY_ATTRS:options.primary(primary)||null,SECONDARY_ATTRS:options.secondary(secondary)||null}}function getIndentLevel$1(node){for(var level=node.parent.isTextOnly?-2:-1,ctx=node;ctx=ctx.parent;)level++;return 0>level?0:level}function updateFormatting(outNode,profile){var node=outNode.node;return!node.isTextOnly&&node.value&&(outNode.beforeText=reNl.test(node.value)?outNode.newline+outNode.indent+profile.indent(1):" "),outNode}function formatNodeValue(node,profile){if(null!=node.value&&reNl.test(node.value)){var lines=splitByLines(node.value),indent=profile.indent(1),maxLength=lines.reduce(function(prev,line){return Math.max(prev,line.length)},0);return lines.map(function(line,i){return""+(i?indent:"")+pad(line,maxLength)+" |"}).join("\n")}return node.value}function pad(text,len){for(;text.length<len;)text+=" ";return text}function updateFormatting$1(outNode,profile){var node=outNode.node,parent=node.parent;return 0===profile.get("inlineBreak")&&isInline$1(node,profile)&&!isRoot(parent)&&null==parent.value&&1===parent.children.length&&(outNode.beforeOpen=": "),!node.isTextOnly&&node.value&&(outNode.beforeText=reNl$1.test(node.value)?outNode.newline+outNode.indent+profile.indent(1):" "),outNode}function formatNodeValue$1(node,profile){if(null!=node.value&&reNl$1.test(node.value)){var indent=profile.indent(1);return splitByLines(node.value).map(function(line,i){return""+indent+(i?" ":"|")+" "+line}).join("\n")}return node.value}function isInline$1(node,profile){return node&&(node.isTextOnly||profile.isInline(node))}function updateFormatting$2(outNode,profile){var node=outNode.node;return!node.isTextOnly&&node.value&&(outNode.beforeText=reNl$2.test(node.value)?outNode.newline+outNode.indent+profile.indent(1):" "),outNode}function formatNodeValue$2(node,profile){if(null!=node.value&&reNl$2.test(node.value)){var indent=profile.indent(1);return splitByLines(node.value).map(function(line){return indent+"| "+line}).join("\n")}return node.value}function supports(syntax){return!!syntax&&syntax in supportedSyntaxes}exports.__esModule=!0,exports.template=exports.supports=void 0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_fieldParser=__webpack_require__("R0uB"),_fieldParser2=_interopRequireDefault(_fieldParser),_outputRenderer=__webpack_require__("iOMi"),_outputRenderer2=_interopRequireDefault(_outputRenderer),TOKEN=/^(.*?)([A-Z_]+)(.*?)$/,TOKEN_OPEN=91,TOKEN_CLOSE=93,commentOptions={enabled:!1,trigger:["id","class"],before:"",after:"\n<!-- /[#ID][.CLASS] -->"},reId=/^id$/i,reClass=/^class$/i,defaultAttrOptions={primary:function(attrs){return attrs.join("")},secondary:function(attrs){return attrs.map(function(attr){return attr.isBoolean?attr.name:attr.name+"="+attr.value}).join(", ")}},defaultNodeOptions={open:null,close:null,omitName:/^div$/i,attributes:defaultAttrOptions},reNl=/\n|\r/,reNl$1=/\n|\r/,secondaryAttrs={none:"[ SECONDARY_ATTRS]",round:"[(SECONDARY_ATTRS)]",curly:"[{SECONDARY_ATTRS}]",square:"[[SECONDARY_ATTRS]"},reNl$2=/\n|\r/,supportedSyntaxes={html:function(tree,profile,options){options=_extends({},options);var format=getFormatOptions(options);return(0,_outputRenderer2.default)(tree,options.field,function(outNode){if(outNode=setFormatting(outNode,profile),!handlePseudoSnippet(outNode)){var node=outNode.node;if(node.name){var name=profile.name(node.name),attrs=formatAttributes(outNode,profile);outNode.open="<"+name+attrs+(node.selfClosing?profile.selfClose():"")+">",node.selfClosing||(outNode.close="</"+name+">"),commentNode(outNode,format.comment)}!node.value&&(node.children.length||node.selfClosing)||(outNode.text=outNode.renderFields(node.value))}return outNode})},haml:function(tree,profile,options){options=options||{};var nodeOptions={open:"[%NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)][SELF_CLOSE]",selfClose:"/",attributes:{secondary:function(attrs){return attrs.map(function(attr){return attr.isBoolean?""+attr.name+(profile.get("compactBooleanAttributes")?"":"=true"):attr.name+"="+profile.quote(attr.value)}).join(" ")}}};return(0,_outputRenderer2.default)(tree,options.field,function(outNode){if(outNode=indentFormat(outNode,profile,nodeOptions),outNode=updateFormatting(outNode,profile),!handlePseudoSnippet(outNode)){var node=outNode.node;!node.value&&(node.children.length||node.selfClosing)||(outNode.text=outNode.renderFields(formatNodeValue(node,profile)))}return outNode})},slim:function(tree,profile,options){options=options||{};var SECONDARY_ATTRS=options.attributeWrap&&secondaryAttrs[options.attributeWrap]||secondaryAttrs.none,booleanAttr=SECONDARY_ATTRS===secondaryAttrs.none?function(attr){return attr.name+"=true"}:function(attr){return attr.name},nodeOptions={open:"[NAME][PRIMARY_ATTRS]"+SECONDARY_ATTRS+"[SELF_CLOSE]",selfClose:"/",attributes:{secondary:function(attrs){return attrs.map(function(attr){return attr.isBoolean?booleanAttr(attr):attr.name+"="+profile.quote(attr.value)}).join(" ")}}};return(0,_outputRenderer2.default)(tree,options.field,function(outNode){if(outNode=indentFormat(outNode,profile,nodeOptions),outNode=updateFormatting$1(outNode,profile),!handlePseudoSnippet(outNode)){var node=outNode.node;!node.value&&(node.children.length||node.selfClosing)||(outNode.text=outNode.renderFields(formatNodeValue$1(node,profile)))}return outNode})},pug:function(tree,profile,options){options=options||{};var nodeOptions={open:"[NAME][PRIMARY_ATTRS][(SECONDARY_ATTRS)]",attributes:{secondary:function(attrs){return attrs.map(function(attr){return attr.isBoolean?attr.name:attr.name+"="+profile.quote(attr.value)}).join(", ")}}};return(0,_outputRenderer2.default)(tree,options.field,function(outNode){if(outNode=indentFormat(outNode,profile,nodeOptions),outNode=updateFormatting$2(outNode,profile),!handlePseudoSnippet(outNode)){var node=outNode.node;!node.value&&(node.children.length||node.selfClosing)||(outNode.text=outNode.renderFields(formatNodeValue$2(node,profile)))}return outNode})}};exports.default=function(tree,profile,syntax,options){return"object"==typeof syntax&&(options=syntax,syntax=null),supports(syntax)||(syntax="html"),supportedSyntaxes[syntax](tree,profile,options)},exports.supports=supports,exports.template=template},aBJ1:function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function createAttribute(name,value){return name instanceof Attribute?name:"string"==typeof name?new Attribute(name,value):name&&"object"==typeof name?new Attribute(name.name,name.value,name.options):void 0}function normalize(str){return(str+"").trim()}function uniqueClass(item,i,arr){return item&&arr.indexOf(item)===i}exports.__esModule=!0;var _createClass=function(){function defineProperties(target,props){for(var i=0,descriptor;i<props.length;i++)descriptor=props[i],descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},Attribute=function(){function Attribute(name,value,options){_classCallCheck(this,Attribute),this.name=name,this.value=null==value?null:value,this.options=options||{}}return Attribute.prototype.clone=function(){return new Attribute(this.name,this.value,_extends({},this.options))},Attribute.prototype.valueOf=function(){return this.name+"=\""+this.value+"\""},Attribute}(),Node=function(){function Node(name,attributes){var _this=this;_classCallCheck(this,Node),this.name=name||null,this.value=null,this.repeat=null,this.selfClosing=!1,this.children=[],this.parent=null,this.next=null,this.previous=null,this._attributes=[],Array.isArray(attributes)&&attributes.forEach(function(attr){return _this.setAttribute(attr)})}return Node.prototype.create=function(name,attributes){return new Node(name,attributes)},Node.prototype.setAttribute=function(name,value){var attr=createAttribute(name,value),curAttr=this.getAttribute(name);curAttr?this.replaceAttribute(curAttr,attr):this._attributes.push(attr)},Node.prototype.hasAttribute=function(name){return!!this.getAttribute(name)},Node.prototype.getAttribute=function(name){"object"==typeof name&&(name=name.name);for(var i=0,attr;i<this._attributes.length;i++)if(attr=this._attributes[i],attr.name===name)return attr},Node.prototype.replaceAttribute=function(curAttribute,newName,newValue){"string"==typeof curAttribute&&(curAttribute=this.getAttribute(curAttribute));var ix=this._attributes.indexOf(curAttribute);-1!==ix&&this._attributes.splice(ix,1,createAttribute(newName,newValue))},Node.prototype.removeAttribute=function(attr){"string"==typeof attr&&(attr=this.getAttribute(attr));var ix=this._attributes.indexOf(attr);-1!==ix&&this._attributes.splice(ix,1)},Node.prototype.clearAttributes=function(){this._attributes.length=0},Node.prototype.addClass=function(token){token=normalize(token),this.hasAttribute("class")?token&&!this.hasClass(token)&&this.setAttribute("class",this.classList.concat(token).join(" ")):this.setAttribute("class",token)},Node.prototype.hasClass=function(token){return-1!==this.classList.indexOf(normalize(token))},Node.prototype.removeClass=function(token){token=normalize(token),this.hasClass(token)&&this.setAttribute("class",this.classList.filter(function(name){return name!==token}).join(" "))},Node.prototype.appendChild=function(node){this.insertAt(node,this.children.length)},Node.prototype.insertBefore=function(newNode,refNode){this.insertAt(newNode,this.children.indexOf(refNode))},Node.prototype.insertAt=function(node,pos){if(0>pos||pos>this.children.length)throw new Error("Unable to insert node: position is out of child list range");var prev=this.children[pos-1],next=this.children[pos];node.remove(),node.parent=this,this.children.splice(pos,0,node),prev&&(node.previous=prev,prev.next=node),next&&(node.next=next,next.previous=node)},Node.prototype.removeChild=function(node){var ix=this.children.indexOf(node);-1!==ix&&(this.children.splice(ix,1),node.previous&&(node.previous.next=node.next),node.next&&(node.next.previous=node.previous),node.parent=node.next=node.previous=null)},Node.prototype.remove=function(){this.parent&&this.parent.removeChild(this)},Node.prototype.clone=function(deep){var clone=new Node(this.name);return clone.value=this.value,clone.selfClosing=this.selfClosing,this.repeat&&(clone.repeat=_extends({},this.repeat)),this._attributes.forEach(function(attr){return clone.setAttribute(attr.clone())}),deep&&this.children.forEach(function(child){return clone.appendChild(child.clone(!0))}),clone},Node.prototype.walk=function(fn,_level){_level=_level||0;for(var ctx=this.firstChild,next;ctx;){if(next=ctx.next,!1===fn(ctx,_level)||!1===ctx.walk(fn,_level+1))return!1;ctx=next}},Node.prototype.use=function(fn){for(var args=[this],i=1;i<arguments.length;i++)args.push(arguments[i]);return fn.apply(null,args),this},Node.prototype.toString=function(){var _this2=this,attrs=this.attributes.map(function(attr){attr=_this2.getAttribute(attr.name);var opt=attr.options,out=""+(opt&&opt.implied?"!":"")+(attr.name||"");return opt&&opt.boolean?out+=".":null!=attr.value&&(out+="=\""+attr.value+"\""),out}),out=""+(this.name||"");return attrs.length&&(out+="["+attrs.join(" ")+"]"),null!=this.value&&(out+="{"+this.value+"}"),this.selfClosing&&(out+="/"),this.repeat&&(out+="*"+(this.repeat.count?this.repeat.count:""),null!=this.repeat.value&&(out+="@"+this.repeat.value)),out},_createClass(Node,[{key:"attributes",get:function(){return this._attributes}},{key:"attributesMap",get:function(){return this.attributes.reduce(function(out,attr){return out[attr.name]=attr.options.boolean?attr.name:attr.value,out},{})}},{key:"isGroup",get:function(){return!this.name&&!this.value&&!this._attributes.length}},{key:"isTextOnly",get:function(){return!this.name&&!!this.value&&!this._attributes.length}},{key:"firstChild",get:function(){return this.children[0]}},{key:"lastChild",get:function(){return this.children[this.children.length-1]}},{key:"childIndex",get:function(){return this.parent?this.parent.children.indexOf(this):-1}},{key:"nextSibling",get:function(){return this.next}},{key:"previousSibling",get:function(){return this.previous}},{key:"classList",get:function(){var attr=this.getAttribute("class");return attr&&attr.value?attr.value.split(/\s+/g).filter(uniqueClass):[]}}]),Node}();exports.default=Node},"ad/k":function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function stringScore(abbr,string){if(abbr=abbr.toLowerCase(),string=string.toLowerCase(),abbr===string)return 1;if(!string||abbr.charCodeAt(0)!==string.charCodeAt(0))return 0;for(var abbrLength=abbr.length,stringLength=string.length,i=1,j=1,score=stringLength,ch1=void 0,ch2=void 0,found=void 0,acronym=void 0;i<abbrLength;){for(ch1=abbr.charCodeAt(i),found=!1,acronym=!1;j<stringLength;){if(ch2=string.charCodeAt(j),ch1===ch2){found=!0,score+=(stringLength-j)*(acronym?2:1);break}acronym=ch2===DASH,j++}if(!found)break;i++}return score&&score*(i/abbrLength)/sum(stringLength)}function sum(n){return n*(n+1)/2}function cssSnippets(snippets){return nest(snippets.map(function(snippet){return new CSSSnippet(snippet.key,snippet.value)}))}function nest(snippets){snippets=snippets.sort(snippetsSort);for(var stack=[],i=0,cur,prev;i<snippets.length;i++)if(cur=snippets[i],!!cur.property){for(;stack.length;){if(prev=stack[stack.length-1],0===cur.property.indexOf(prev.property)&&cur.property.charCodeAt(prev.property.length)===DASH$1){prev.addDependency(cur),stack.push(cur);break}stack.pop()}stack.length||stack.push(cur)}return snippets}function snippetsSort(a,b){return a.key===b.key?0:a.key<b.key?-1:1}function isKeyword(str){return /^\s*[\w-]+/.test(str)}function splitValue(value){return(value+"").split("|")}function convertToCSSSnippets(registry){return cssSnippets(registry.all({type:"string"}))}function resolveNode(node,snippets,options){var snippet=findBestMatch(node.name,snippets,"key",options.fuzzySearchMinScore);return snippet?snippet.property?resolveAsProperty(node,snippet,options):resolveAsSnippet(node,snippet):"!"===node.name?setNodeAsText(node,"!important"):node}function resolveAsProperty(node,snippet,formatOptions){var abbr=node.name;if(node.name=snippet.property,node.value&&"object"==typeof node.value){var keywords=snippet.keywords();if(!node.value.size){var kw=findBestMatch(getUnmatchedPart(abbr,snippet.key),keywords);kw||(kw=snippet.defaultValue,kw&&-1===kw.indexOf("${")&&(kw="${1:"+kw+"}")),kw&&node.value.add(kw)}else for(var i=0,token;i<node.value.value.length;i++)token=node.value.value[i],"!"===token?token=(i?"":"${1} ")+"!important":isKeyword$1(token)?token=findBestMatch(token.value,keywords)||findBestMatch(token.value,globalKeywords)||token:isNumericValue(token)&&(token=resolveNumericValue(node.name,token,formatOptions)),node.value.value[i]=token}return node}function resolveAsSnippet(node,snippet){return setNodeAsText(node,snippet.value)}function setNodeAsText(node,text){return node.name=null,node.value=text,node}function findBestMatch(abbr,items,key,fuzzySearchMinScore){if(!abbr)return null;var matchedItem=null,maxScore=0;fuzzySearchMinScore=fuzzySearchMinScore||0;for(var i=0,item;i<items.length;i++){item=items[i];var score=stringScore(abbr,getScoringPart(item,key));if(1===score)return item;score&&score>=maxScore&&(maxScore=score,matchedItem=item)}return maxScore>=fuzzySearchMinScore?matchedItem:null}function getScoringPart(item,key){var value=item&&"object"==typeof item?item[key]:item,m=(value||"").match(/^[\w-@]+/);return m?m[0]:value}function getUnmatchedPart(abbr,string){for(var i=0,lastPos=0;i<abbr.length;i++){if(lastPos=string.indexOf(abbr[i],lastPos),-1===lastPos)return abbr.slice(i);lastPos++}return""}function isKeyword$1(token){return tokenTypeOf(token,"keyword")}function isNumericValue(token){return tokenTypeOf(token,"numeric")}function tokenTypeOf(token,type){return token&&"object"==typeof token&&token.type===type}function resolveNumericValue(property,token,formatOptions){return token.unit?token.unit=formatOptions.unitAliases[token.unit]||token.unit:0!==token.value&&-1===unitlessProperties.indexOf(property)&&(token.unit=token.value===(0|token.value)?formatOptions.intUnit:formatOptions.floatUnit),token}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_createClass=function(){function defineProperties(target,props){for(var i=0,descriptor;i<props.length;i++)descriptor=props[i],descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),DASH=45,reProperty=/^([a-z\-]+)(?:\s*:\s*([^\n\r]+))?$/,DASH$1=45,CSSSnippet=function(){function CSSSnippet(key,value){_classCallCheck(this,CSSSnippet),this.key=key,this.value=value,this.property=null;var m=value&&value.match(reProperty);m&&(this.property=m[1],this.value=m[2]),this.dependencies=[]}return CSSSnippet.prototype.addDependency=function(dep){this.dependencies.push(dep)},CSSSnippet.prototype.keywords=function(){var stack=[],keywords=new Set,i=0,item=void 0,candidates=void 0;for(this.property&&stack.push(this);i<stack.length;)if(item=stack[i++],item.value){candidates=splitValue(item.value).filter(isKeyword);for(var j=0;j<candidates.length;j++)keywords.add(candidates[j].trim());for(var _j=0,deps=item.dependencies;_j<deps.length;_j++)-1===stack.indexOf(deps[_j])&&stack.push(deps[_j])}return Array.from(keywords)},_createClass(CSSSnippet,[{key:"defaultValue",get:function(){return null==this.value?null:splitValue(this.value)[0]}}]),CSSSnippet}(),globalKeywords=["auto","inherit","unset"],unitlessProperties=["z-index","line-height","opacity","font-weight","zoom","flex","flex-grow","flex-shrink"],defaultOptions={intUnit:"px",floatUnit:"em",unitAliases:{e:"em",p:"%",x:"ex",r:"rem"},fuzzySearchMinScore:0};exports.default=function(tree,registry,options){options=_extends({},defaultOptions,options),options.unitAliases=_extends({},defaultOptions.unitAliases,options&&options.unitAliases);var snippets=convertToCSSSnippets(registry);return tree.walk(function(node){return resolveNode(node,snippets,options)}),tree},exports.convertToCSSSnippets=convertToCSSSnippets,exports.stringScore=stringScore,exports.cssSnippets=cssSnippets},bU21:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){CodeMirror.registerGlobalHelper("fold","comment",function(mode){return mode.blockCommentStart&&mode.blockCommentEnd},function(cm,start){var mode=cm.getModeAt(start),startToken=mode.blockCommentStart,endToken=mode.blockCommentEnd;if(startToken&&endToken){for(var line=start.line,lineText=cm.getLine(line),at=start.ch,pass=0,startCh,found;;){if(found=0>=at?-1:lineText.lastIndexOf(startToken,at-1),-1==found){if(1==pass)return;pass=1,at=lineText.length;continue}if(1==pass&&found<start.ch)return;if(/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line,found+1)))&&(0==found||lineText.slice(found-endToken.length,found)==endToken||!/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line,found))))){startCh=found+startToken.length;break}at=found-1}var depth=1,lastLine=cm.lastLine(),end,endCh;outer:for(var i=line;i<=lastLine;++i)for(var text=cm.getLine(i),pos=i==line?startCh:0;;){var nextOpen=text.indexOf(startToken,pos),nextClose=text.indexOf(endToken,pos);if(0>nextOpen&&(nextOpen=text.length),0>nextClose&&(nextClose=text.length),pos=Math.min(nextOpen,nextClose),pos==text.length)break;if(pos==nextOpen)++depth;else if(! --depth){end=i,endCh=pos;break outer}++pos}return null==end||line==end&&endCh==startCh?void 0:{from:CodeMirror.Pos(line,startCh),to:CodeMirror.Pos(end,endCh)}}})})},bdtv:function(module){"use strict";module.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},c5OX:function(module){"use strict";module.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(data,encoding){return new Buffer(data,encoding)},allocBuffer:function(size){return Buffer.alloc?Buffer.alloc(size):new Buffer(size)},isBuffer:function(b){return Buffer.isBuffer(b)},isStream:function(obj){return obj&&"function"==typeof obj.on&&"function"==typeof obj.pause&&"function"==typeof obj.resume}}},cVWy:function(module,exports,__webpack_require__){"use strict";var global=__webpack_require__("3Vd+"),core=__webpack_require__("KxJl"),ctx=__webpack_require__("iktq"),hide=__webpack_require__("3bh8"),PROTOTYPE="prototype",$export=function $export(type,name,source){var IS_FORCED=type&$export.F,IS_GLOBAL=type&$export.G,IS_STATIC=type&$export.S,IS_PROTO=type&$export.P,IS_BIND=type&$export.B,IS_WRAP=type&$export.W,exports=IS_GLOBAL?core:core[name]||(core[name]={}),expProto=exports[PROTOTYPE],target=IS_GLOBAL?global:IS_STATIC?global[name]:(global[name]||{})[PROTOTYPE],key,own,out;for(key in IS_GLOBAL&&(source=name),source)own=!IS_FORCED&&target&&void 0!==target[key],own&&key in exports||(out=own?target[key]:source[key],exports[key]=IS_GLOBAL&&"function"!=typeof target[key]?source[key]:IS_BIND&&own?ctx(out,global):IS_WRAP&&target[key]==out?function(C){var F=function(a,b,c){if(this instanceof C){switch(arguments.length){case 0:return new C;case 1:return new C(a);case 2:return new C(a,b);}return new C(a,b,c)}return C.apply(this,arguments)};return F[PROTOTYPE]=C[PROTOTYPE],F}(out):IS_PROTO&&"function"==typeof out?ctx(Function.call,out):out,IS_PROTO&&((exports.virtual||(exports.virtual={}))[key]=out,type&$export.R&&expProto&&!expProto[key]&&hide(expProto,key,out)))};$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,$export.U=64,$export.R=128,module.exports=$export},cvyR:function(module,exports,__webpack_require__){"use strict";function crc32(crc,buf,len,pos){crc^=-1;for(var i=pos;i<pos+len;i++)crc=crc>>>8^crcTable[255&(crc^buf[i])];return-1^crc}function crc32str(crc,str,len,pos){crc^=-1;for(var i=pos;i<pos+len;i++)crc=crc>>>8^crcTable[255&(crc^str.charCodeAt(i))];return-1^crc}var utils=__webpack_require__("dvMn"),crcTable=function(){for(var table=[],n=0,c;256>n;n++){c=n;for(var k=0;8>k;k++)c=1&c?3988292384^c>>>1:c>>>1;table[n]=c}return table}();module.exports=function(input,crc){if("undefined"==typeof input||!input.length)return 0;var isArray="string"!==utils.getTypeOf(input);return isArray?crc32(0|crc,input,input.length,0):crc32str(0|crc,input,input.length,0)}},dFUs:function(module,exports,__webpack_require__){"use strict";function ZipEntry(options,loadOptions){this.options=options,this.loadOptions=loadOptions}var readerFor=__webpack_require__("9Uuy"),utils=__webpack_require__("dvMn"),CompressedObject=__webpack_require__("PO9O"),crc32fn=__webpack_require__("cvyR"),utf8=__webpack_require__("Sm7/"),compressions=__webpack_require__("XfO6"),support=__webpack_require__("untT"),findCompression=function(compressionMethod){for(var method in compressions)if(compressions.hasOwnProperty(method)&&compressions[method].magic===compressionMethod)return compressions[method];return null};ZipEntry.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(reader){var compression,localExtraFieldsLength;if(reader.skip(22),this.fileNameLength=reader.readInt(2),localExtraFieldsLength=reader.readInt(2),this.fileName=reader.readData(this.fileNameLength),reader.skip(localExtraFieldsLength),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(compression=findCompression(this.compressionMethod),null===compression)throw new Error("Corrupted zip : compression "+utils.pretty(this.compressionMethod)+" unknown (inner file : "+utils.transformTo("string",this.fileName)+")");this.decompressed=new CompressedObject(this.compressedSize,this.uncompressedSize,this.crc32,compression,reader.readData(this.compressedSize))},readCentralPart:function(reader){this.versionMadeBy=reader.readInt(2),reader.skip(2),this.bitFlag=reader.readInt(2),this.compressionMethod=reader.readString(2),this.date=reader.readDate(),this.crc32=reader.readInt(4),this.compressedSize=reader.readInt(4),this.uncompressedSize=reader.readInt(4);var fileNameLength=reader.readInt(2);if(this.extraFieldsLength=reader.readInt(2),this.fileCommentLength=reader.readInt(2),this.diskNumberStart=reader.readInt(2),this.internalFileAttributes=reader.readInt(2),this.externalFileAttributes=reader.readInt(4),this.localHeaderOffset=reader.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");reader.skip(fileNameLength),this.readExtraFields(reader),this.parseZIP64ExtraField(reader),this.fileComment=reader.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var madeBy=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),madeBy==0&&(this.dosPermissions=63&this.externalFileAttributes),madeBy==3&&(this.unixPermissions=65535&this.externalFileAttributes>>16),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var extraReader=readerFor(this.extraFields[1].value);this.uncompressedSize===utils.MAX_VALUE_32BITS&&(this.uncompressedSize=extraReader.readInt(8)),this.compressedSize===utils.MAX_VALUE_32BITS&&(this.compressedSize=extraReader.readInt(8)),this.localHeaderOffset===utils.MAX_VALUE_32BITS&&(this.localHeaderOffset=extraReader.readInt(8)),this.diskNumberStart===utils.MAX_VALUE_32BITS&&(this.diskNumberStart=extraReader.readInt(4))}},readExtraFields:function(reader){var end=reader.index+this.extraFieldsLength,extraFieldId,extraFieldLength,extraFieldValue;for(this.extraFields||(this.extraFields={});reader.index<end;)extraFieldId=reader.readInt(2),extraFieldLength=reader.readInt(2),extraFieldValue=reader.readData(extraFieldLength),this.extraFields[extraFieldId]={id:extraFieldId,length:extraFieldLength,value:extraFieldValue}},handleUTF8:function(){var decodeParamType=support.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=utf8.utf8decode(this.fileName),this.fileCommentStr=utf8.utf8decode(this.fileComment);else{var upath=this.findExtraFieldUnicodePath();if(null!==upath)this.fileNameStr=upath;else{var fileNameByteArray=utils.transformTo(decodeParamType,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(fileNameByteArray)}var ucomment=this.findExtraFieldUnicodeComment();if(null!==ucomment)this.fileCommentStr=ucomment;else{var commentByteArray=utils.transformTo(decodeParamType,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(commentByteArray)}}},findExtraFieldUnicodePath:function(){var upathField=this.extraFields[28789];if(upathField){var extraReader=readerFor(upathField.value);return 1===extraReader.readInt(1)?crc32fn(this.fileName)===extraReader.readInt(4)?utf8.utf8decode(extraReader.readData(upathField.length-5)):null:null}return null},findExtraFieldUnicodeComment:function(){var ucommentField=this.extraFields[25461];if(ucommentField){var extraReader=readerFor(ucommentField.value);return 1===extraReader.readInt(1)?crc32fn(this.fileComment)===extraReader.readInt(4)?utf8.utf8decode(extraReader.readData(ucommentField.length-5)):null:null}return null}},module.exports=ZipEntry},dP58:function(module,exports,__webpack_require__){"use strict";function createFirebaseNamespace(){function app(name){return name=name||DEFAULT_ENTRY_NAME,contains(apps_,name)||error("no-app",{name:name}),apps_[name]}function getApps(){return Object.keys(apps_).map(function(name){return apps_[name]})}function callAppHooks(app,eventName){Object.keys(factories).forEach(function(serviceName){var factoryName=useAsService(app,serviceName);null===factoryName||appHooks[factoryName]&&appHooks[factoryName](eventName,app)})}function useAsService(app,name){if("serverAuth"===name)return null;app.options;return name}var apps_={},factories={},appHooks={},namespace={__esModule:!0,initializeApp:function(options,rawConfig){if(void 0===rawConfig&&(rawConfig={}),"object"!=typeof rawConfig||null===rawConfig){var name_1=rawConfig;rawConfig={name:name_1}}var config=rawConfig;void 0===config.name&&(config.name=DEFAULT_ENTRY_NAME);var name=config.name;"string"==typeof name&&name||error("bad-app-name",{name:name+""}),contains(apps_,name)&&error("duplicate-app",{name:name});var app=new FirebaseAppImpl(options,config,namespace);return apps_[name]=app,callAppHooks(app,"create"),app},app:app,apps:null,Promise:Promise,SDK_VERSION:"5.5.0",INTERNAL:{registerService:function(name,createService,serviceProperties,appHook,allowMultipleInstances){factories[name]&&error("duplicate-service",{name:name}),factories[name]=createService,appHook&&(appHooks[name]=appHook,getApps().forEach(function(app){appHook("create",app)}));var serviceNamespace=function(appArg){return void 0===appArg&&(appArg=app()),"function"!=typeof appArg[name]&&error("invalid-app-argument",{name:name}),appArg[name]()};return void 0!==serviceProperties&&util.deepExtend(serviceNamespace,serviceProperties),namespace[name]=serviceNamespace,FirebaseAppImpl.prototype[name]=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var serviceFxn=this._getService.bind(this,name);return serviceFxn.apply(this,allowMultipleInstances?args:[])},serviceNamespace},createFirebaseNamespace:createFirebaseNamespace,extendNamespace:function(props){util.deepExtend(namespace,props)},createSubscribe:util.createSubscribe,ErrorFactory:util.ErrorFactory,removeApp:function(name){var app=apps_[name];callAppHooks(app,"delete"),delete apps_[name]},factories:factories,useAsService:useAsService,Promise:Promise,deepExtend:util.deepExtend}};return util.patchProperty(namespace,"default",namespace),Object.defineProperty(namespace,"apps",{get:getApps}),util.patchProperty(app,"App",FirebaseAppImpl),namespace}function error(code,args){throw appErrors.create(code,args)}Object.defineProperty(exports,"__esModule",{value:!0});var util=__webpack_require__("58xA"),contains=function(obj,key){return Object.prototype.hasOwnProperty.call(obj,key)},DEFAULT_ENTRY_NAME="[DEFAULT]",tokenListeners=[],FirebaseAppImpl=function(){function FirebaseAppImpl(options,config,firebase_){this.firebase_=firebase_,this.isDeleted_=!1,this.services_={},this.name_=config.name,this._automaticDataCollectionEnabled=config.automaticDataCollectionEnabled||!1,this.options_=util.deepCopy(options),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(callback){tokenListeners.push(callback),setTimeout(function(){return callback(null)},0)},removeAuthTokenListener:function(callback){tokenListeners=tokenListeners.filter(function(listener){return listener!==callback})}}}return Object.defineProperty(FirebaseAppImpl.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this._automaticDataCollectionEnabled},set:function(val){this.checkDestroyed_(),this._automaticDataCollectionEnabled=val},enumerable:!0,configurable:!0}),Object.defineProperty(FirebaseAppImpl.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(FirebaseAppImpl.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,configurable:!0}),FirebaseAppImpl.prototype.delete=function(){var _this=this;return new Promise(function(resolve){_this.checkDestroyed_(),resolve()}).then(function(){_this.firebase_.INTERNAL.removeApp(_this.name_);var services=[];return Object.keys(_this.services_).forEach(function(serviceKey){Object.keys(_this.services_[serviceKey]).forEach(function(instanceKey){services.push(_this.services_[serviceKey][instanceKey])})}),Promise.all(services.map(function(service){return service.INTERNAL.delete()}))}).then(function(){_this.isDeleted_=!0,_this.services_={}})},FirebaseAppImpl.prototype._getService=function(name,instanceIdentifier){if(void 0===instanceIdentifier&&(instanceIdentifier=DEFAULT_ENTRY_NAME),this.checkDestroyed_(),this.services_[name]||(this.services_[name]={}),!this.services_[name][instanceIdentifier]){var instanceSpecifier=instanceIdentifier===DEFAULT_ENTRY_NAME?void 0:instanceIdentifier,service=this.firebase_.INTERNAL.factories[name](this,this.extendApp.bind(this),instanceSpecifier);this.services_[name][instanceIdentifier]=service}return this.services_[name][instanceIdentifier]},FirebaseAppImpl.prototype.extendApp=function(props){var _this=this;util.deepExtend(this,props),props.INTERNAL&&props.INTERNAL.addAuthTokenListener&&(tokenListeners.forEach(function(listener){_this.INTERNAL.addAuthTokenListener(listener)}),tokenListeners=[])},FirebaseAppImpl.prototype.checkDestroyed_=function(){this.isDeleted_&&error("app-deleted",{name:this.name_})},FirebaseAppImpl}();FirebaseAppImpl.prototype.name&&FirebaseAppImpl.prototype.options||FirebaseAppImpl.prototype.delete||console.log("dc");var appErrors=new util.ErrorFactory("app","Firebase",{"no-app":"No Firebase App '{$name}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$name}","duplicate-app":"Firebase App named '{$name}' already exists","app-deleted":"Firebase App named '{$name}' already deleted","duplicate-service":"Firebase service named '{$name}' already registered","sa-not-supported":"Initializing the Firebase SDK with a service account is only allowed in a Node.js environment. On client devices, you should instead initialize the SDK with an api key and auth domain","invalid-app-argument":"firebase.{$name}() takes either no argument or a Firebase App instance."}),firebase=createFirebaseNamespace();exports.firebase=firebase,exports.default=firebase},daDe:function(module,exports,__webpack_require__){"use strict";function NodeBufferReader(data){Uint8ArrayReader.call(this,data)}var Uint8ArrayReader=__webpack_require__("nR4t"),utils=__webpack_require__("dvMn");utils.inherits(NodeBufferReader,Uint8ArrayReader),NodeBufferReader.prototype.readData=function(size){this.checkOffset(size);var result=this.data.slice(this.zero+this.index,this.zero+this.index+size);return this.index+=size,result},module.exports=NodeBufferReader},dskh:function(module,exports,__webpack_require__){"use strict";var _Mathpow2=Math.pow,_Mathfloor2=Math.floor,_StringfromCharCode5=String.fromCharCode,_Mathmin2=Math.min;(function(global){function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()<length)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(that=new Uint8Array(length),that.__proto__=Buffer.prototype):(null===that&&(that=new Buffer(length)),that.length=length),that}function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer))return new Buffer(arg,encodingOrOffset,length);if("number"==typeof arg){if("string"==typeof encodingOrOffset)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,arg)}return from(this,arg,encodingOrOffset,length)}function from(that,value,encodingOrOffset,length){if("number"==typeof value)throw new TypeError("\"value\" argument must not be a number");return"undefined"!=typeof ArrayBuffer&&value instanceof ArrayBuffer?fromArrayBuffer(that,value,encodingOrOffset,length):"string"==typeof value?fromString(that,value,encodingOrOffset):fromObject(that,value)}function assertSize(size){if("number"!=typeof size)throw new TypeError("\"size\" argument must be a number");else if(0>size)throw new RangeError("\"size\" argument must not be negative")}function alloc(that,size,fill,encoding){return assertSize(size),0>=size?createBuffer(that,size):void 0===fill?createBuffer(that,size):"string"==typeof encoding?createBuffer(that,size).fill(fill,encoding):createBuffer(that,size).fill(fill)}function allocUnsafe(that,size){if(assertSize(size),that=createBuffer(that,0>size?0:0|checked(size)),!Buffer.TYPED_ARRAY_SUPPORT)for(var i=0;i<size;++i)that[i]=0;return that}function fromString(that,string,encoding){if(("string"!=typeof encoding||""===encoding)&&(encoding="utf8"),!Buffer.isEncoding(encoding))throw new TypeError("\"encoding\" must be a valid string encoding");var length=0|byteLength(string,encoding);that=createBuffer(that,length);var actual=that.write(string,encoding);return actual!==length&&(that=that.slice(0,actual)),that}function fromArrayLike(that,array){var length=0>array.length?0:0|checked(array.length);that=createBuffer(that,length);for(var i=0;i<length;i+=1)that[i]=255&array[i];return that}function fromArrayBuffer(that,array,byteOffset,length){if(array.byteLength,0>byteOffset||array.byteLength<byteOffset)throw new RangeError("'offset' is out of bounds");if(array.byteLength<byteOffset+(length||0))throw new RangeError("'length' is out of bounds");return array=void 0===byteOffset&&void 0===length?new Uint8Array(array):void 0===length?new Uint8Array(array,byteOffset):new Uint8Array(array,byteOffset,length),Buffer.TYPED_ARRAY_SUPPORT?(that=array,that.__proto__=Buffer.prototype):that=fromArrayLike(that,array),that}function fromObject(that,obj){if(Buffer.isBuffer(obj)){var len=0|checked(obj.length);return(that=createBuffer(that,len),0===that.length)?that:(obj.copy(that,0,0,len),that)}if(obj){if("undefined"!=typeof ArrayBuffer&&obj.buffer instanceof ArrayBuffer||"length"in obj)return"number"!=typeof obj.length||isnan(obj.length)?createBuffer(that,0):fromArrayLike(that,obj);if("Buffer"===obj.type&&isArray(obj.data))return fromArrayLike(that,obj.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(length){if(length>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0;}}function slowToString(encoding,start,end){var loweredCase=!1;if((void 0===start||0>start)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),0>=end)return"";if(end>>>=0,start>>>=0,end<=start)return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0;}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):2147483647<byteOffset?byteOffset=2147483647:-2147483648>byteOffset&&(byteOffset=-2147483648),byteOffset=+byteOffset,isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),0>byteOffset&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(0>byteOffset)if(dir)byteOffset=0;else return-1;if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){function read(buf,i){return 1==indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}var indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&(encoding=(encoding+"").toLowerCase(),"ucs2"===encoding||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(2>arr.length||2>val.length)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}var i;if(dir){var foundIndex=-1;for(i=byteOffset;i<arrLength;i++)if(read(arr,i)!==read(val,-1==foundIndex?0:i-foundIndex))-1!=foundIndex&&(i-=i-foundIndex),foundIndex=-1;else if(-1==foundIndex&&(foundIndex=i),i-foundIndex+1===valLength)return foundIndex*indexSize}else for(byteOffset+valLength>arrLength&&(byteOffset=arrLength-valLength),i=byteOffset;0<=i;i--){for(var found=!0,j=0;j<valLength;j++)if(read(arr,i+j)!==read(val,j)){found=!1;break}if(found)return i}return-1}function hexWrite(buf,string,offset,length){offset=+offset||0;var remaining=buf.length-offset;length?(length=+length,length>remaining&&(length=remaining)):length=remaining;var strLen=string.length;if(0!=strLen%2)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0,parsed;i<length;++i){if(parsed=parseInt(string.substr(2*i,2),16),isNaN(parsed))return i;buf[offset+i]=parsed}return i}function utf8Write(buf,string,offset,length){return blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length)}function asciiWrite(buf,string,offset,length){return blitBuffer(asciiToBytes(string),buf,offset,length)}function latin1Write(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){return blitBuffer(base64ToBytes(string),buf,offset,length)}function ucs2Write(buf,string,offset,length){return blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length)}function base64Slice(buf,start,end){return 0===start&&end===buf.length?base64.fromByteArray(buf):base64.fromByteArray(buf.slice(start,end))}function utf8Slice(buf,start,end){end=_Mathmin2(buf.length,end);for(var res=[],i=start;i<end;){var firstByte=buf[i],codePoint=null,bytesPerSequence=239<firstByte?4:223<firstByte?3:191<firstByte?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;1==bytesPerSequence?128>firstByte&&(codePoint=firstByte):2==bytesPerSequence?(secondByte=buf[i+1],128==(192&secondByte)&&(tempCodePoint=(31&firstByte)<<6|63&secondByte,127<tempCodePoint&&(codePoint=tempCodePoint))):3==bytesPerSequence?(secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte,2047<tempCodePoint&&(55296>tempCodePoint||57343<tempCodePoint)&&(codePoint=tempCodePoint))):4==bytesPerSequence?(secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte,65535<tempCodePoint&&1114112>tempCodePoint&&(codePoint=tempCodePoint))):void 0}null===codePoint?(codePoint=65533,bytesPerSequence=1):65535<codePoint&&(codePoint-=65536,res.push(55296|1023&codePoint>>>10),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return decodeCodePointsArray(res)}function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return _StringfromCharCode5.apply(String,codePoints);for(var res="",i=0;i<len;)res+=_StringfromCharCode5.apply(String,codePoints.slice(i,i+=MAX_ARGUMENTS_LENGTH));return res}function asciiSlice(buf,start,end){var ret="";end=_Mathmin2(buf.length,end);for(var i=start;i<end;++i)ret+=_StringfromCharCode5(127&buf[i]);return ret}function latin1Slice(buf,start,end){var ret="";end=_Mathmin2(buf.length,end);for(var i=start;i<end;++i)ret+=_StringfromCharCode5(buf[i]);return ret}function hexSlice(buf,start,end){var len=buf.length;(!start||0>start)&&(start=0),(!end||0>end||end>len)&&(end=len);for(var out="",i=start;i<end;++i)out+=toHex(buf[i]);return out}function utf16leSlice(buf,start,end){for(var bytes=buf.slice(start,end),res="",i=0;i<bytes.length;i+=2)res+=_StringfromCharCode5(bytes[i]+256*bytes[i+1]);return res}function checkOffset(offset,ext,length){if(0!=offset%1||0>offset)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError("\"buffer\" argument must be a Buffer instance");if(value>max||value<min)throw new RangeError("\"value\" argument is out of bounds");if(offset+ext>buf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){0>value&&(value=65535+value+1);for(var i=0,j=_Mathmin2(buf.length-offset,2);i<j;++i)buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){0>value&&(value=4294967295+value+1);for(var i=0,j=_Mathmin2(buf.length-offset,4);i<j;++i)buf[offset+i]=255&value>>>8*(littleEndian?i:3-i)}function checkIEEE754(buf,value,offset,ext){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(0>offset)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}function base64clean(str){if(str=stringtrim(str).replace(INVALID_BASE64_RE,""),2>str.length)return"";for(;0!=str.length%4;)str+="=";return str}function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}function toHex(n){return 16>n?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(string,units){units=units||Infinity;for(var length=string.length,leadSurrogate=null,bytes=[],i=0,codePoint;i<length;++i){if(codePoint=string.charCodeAt(i),55295<codePoint&&57344>codePoint){if(!leadSurrogate){if(56319<codePoint){-1<(units-=3)&&bytes.push(239,191,189);continue}else if(i+1===length){-1<(units-=3)&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(56320>codePoint){-1<(units-=3)&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else leadSurrogate&&-1<(units-=3)&&bytes.push(239,191,189);if(leadSurrogate=null,128>codePoint){if(0>(units-=1))break;bytes.push(codePoint)}else if(2048>codePoint){if(0>(units-=2))break;bytes.push(192|codePoint>>6,128|63&codePoint)}else if(65536>codePoint){if(0>(units-=3))break;bytes.push(224|codePoint>>12,128|63&codePoint>>6,128|63&codePoint)}else if(1114112>codePoint){if(0>(units-=4))break;bytes.push(240|codePoint>>18,128|63&codePoint>>12,128|63&codePoint>>6,128|63&codePoint)}else throw new Error("Invalid code point")}return bytes}function asciiToBytes(str){for(var byteArray=[],i=0;i<str.length;++i)byteArray.push(255&str.charCodeAt(i));return byteArray}function utf16leToBytes(str,units){for(var byteArray=[],i=0,c,hi,lo;i<str.length&&!(0>(units-=2));++i)c=str.charCodeAt(i),hi=c>>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i<length&&!(i+offset>=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}function isnan(val){return val!==val}var base64=__webpack_require__("yh9p"),ieee754=__webpack_require__("JgNJ"),isArray=__webpack_require__("REa7");exports.Buffer=Buffer,exports.SlowBuffer=function(length){return+length!=length&&(length=0),Buffer.alloc(+length)},exports.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0===global.TYPED_ARRAY_SUPPORT?function(){try{var arr=new Uint8Array(1);return arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===arr.foo()&&"function"==typeof arr.subarray&&0===arr.subarray(1,1).byteLength}catch(e){return!1}}():global.TYPED_ARRAY_SUPPORT,exports.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(arr){return arr.__proto__=Buffer.prototype,arr},Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(size,fill,encoding){return alloc(null,size,fill,encoding)},Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)},Buffer.isBuffer=function(b){return!!(null!=b&&b._isBuffer)},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=_Mathmin2(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i],y=b[i];break}return x<y?-1:y<x?1:0},Buffer.isEncoding=function(encoding){switch((encoding+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1;}},Buffer.concat=function(list,length){if(!isArray(list))throw new TypeError("\"list\" argument must be an Array of Buffers");if(0===list.length)return Buffer.alloc(0);var i;if(void 0===length)for(length=0,i=0;i<list.length;++i)length+=list[i].length;var buffer=Buffer.allocUnsafe(length),pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(!Buffer.isBuffer(buf))throw new TypeError("\"list\" argument must be an Array of Buffers");buf.copy(buffer,pos),pos+=buf.length}return buffer},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var len=this.length;if(0!=len%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<len;i+=2)swap(this,i,i+1);return this},Buffer.prototype.swap32=function(){var len=this.length;if(0!=len%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<len;i+=4)swap(this,i,i+3),swap(this,i+1,i+2);return this},Buffer.prototype.swap64=function(){var len=this.length;if(0!=len%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<len;i+=8)swap(this,i,i+7),swap(this,i+1,i+6),swap(this,i+2,i+5),swap(this,i+3,i+4);return this},Buffer.prototype.toString=function(){var length=0|this.length;return 0==length?"":0===arguments.length?utf8Slice(this,0,length):slowToString.apply(this,arguments)},Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===Buffer.compare(this,b)},Buffer.prototype.inspect=function(){var str="",max=exports.INSPECT_MAX_BYTES;return 0<this.length&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),"<Buffer "+str+">"},Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),0>start||end>target.length||0>thisStart||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=_Mathmin2(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;i<len;++i)if(thisCopy[i]!==targetCopy[i]){x=thisCopy[i],y=targetCopy[i];break}return x<y?-1:y<x?1:0},Buffer.prototype.includes=function(val,byteOffset,encoding){return-1!==this.indexOf(val,byteOffset,encoding)},Buffer.prototype.indexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!0)},Buffer.prototype.lastIndexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!1)},Buffer.prototype.write=function(string,offset,length,encoding){if(void 0===offset)encoding="utf8",length=this.length,offset=0;else if(void 0===length&&"string"==typeof offset)encoding=offset,length=this.length,offset=0;else if(isFinite(offset))offset|=0,isFinite(length)?(length|=0,void 0===encoding&&(encoding="utf8")):(encoding=length,length=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var remaining=this.length-offset;if((void 0===length||length>remaining)&&(length=remaining),0<string.length&&(0>length||0>offset)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0;}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start,end=void 0===end?len:~~end,0>start?(start+=len,0>start&&(start=0)):start>len&&(start=len),0>end?(end+=len,0>end&&(end=0)):end>len&&(end=len),end<start&&(end=start);var newBuf;if(Buffer.TYPED_ARRAY_SUPPORT)newBuf=this.subarray(start,end),newBuf.__proto__=Buffer.prototype;else{var sliceLen=end-start;newBuf=new Buffer(sliceLen,void 0);for(var i=0;i<sliceLen;++i)newBuf[i]=this[i+start]}return newBuf},Buffer.prototype.readUIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i<byteLength&&(mul*=256);)val+=this[offset+i]*mul;return val},Buffer.prototype.readUIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset+--byteLength],mul=1;0<byteLength&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i<byteLength&&(mul*=256);)val+=this[offset+i]*mul;return mul*=128,val>=mul&&(val-=_Mathpow2(2,8*byteLength)),val},Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];0<i&&(mul*=256);)val+=this[offset+--i]*mul;return mul*=128,val>=mul&&(val-=_Mathpow2(2,8*byteLength)),val},Buffer.prototype.readInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?-1*(255-this[offset]+1):this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,byteLength|=0,!noAssert){var maxBytes=_Mathpow2(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var mul=1,i=0;for(this[offset]=255&value;++i<byteLength&&(mul*=256);)this[offset+i]=255&value/mul;return offset+byteLength},Buffer.prototype.writeUIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,byteLength|=0,!noAssert){var maxBytes=_Mathpow2(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var i=byteLength-1,mul=1;for(this[offset+i]=255&value;0<=--i&&(mul*=256);)this[offset+i]=255&value/mul;return offset+byteLength},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=_Mathfloor2(value)),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=_Mathpow2(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i<byteLength&&(mul*=256);)0>value&&0==sub&&0!==this[offset+i-1]&&(sub=1),this[offset+i]=255&(value/mul>>0)-sub;return offset+byteLength},Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=_Mathpow2(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;0<=--i&&(mul*=256);)0>value&&0==sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=255&(value/mul>>0)-sub;return offset+byteLength},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=_Mathfloor2(value)),0>value&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),0>value&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),0<end&&end<start&&(end=start),end===start)return 0;if(0===target.length||0===this.length)return 0;if(0>targetStart)throw new RangeError("targetStart out of bounds");if(0>start||start>=this.length)throw new RangeError("sourceStart out of bounds");if(0>end)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart<end-start&&(end=target.length-targetStart+start);var len=end-start,i;if(this===target&&start<targetStart&&targetStart<end)for(i=len-1;0<=i;--i)target[i+targetStart]=this[i+start];else if(1e3>len||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i<len;++i)target[i+targetStart]=this[i+start];else Uint8Array.prototype.set.call(target,this.subarray(start,start+len),targetStart);return len},Buffer.prototype.fill=function(val,start,end,encoding){if("string"==typeof val){if("string"==typeof start?(encoding=start,start=0,end=this.length):"string"==typeof end&&(encoding=end,end=this.length),1===val.length){var code=val.charCodeAt(0);256>code&&(val=code)}if(void 0!==encoding&&"string"!=typeof encoding)throw new TypeError("encoding must be a string");if("string"==typeof encoding&&!Buffer.isEncoding(encoding))throw new TypeError("Unknown encoding: "+encoding)}else"number"==typeof val&&(val&=255);if(0>start||this.length<start||this.length<end)throw new RangeError("Out of range index");if(end<=start)return this;start>>>=0,end=void 0===end?this.length:end>>>0,val||(val=0);var i;if("number"==typeof val)for(i=start;i<end;++i)this[i]=val;else{var bytes=Buffer.isBuffer(val)?val:utf8ToBytes(new Buffer(val,encoding).toString()),len=bytes.length;for(i=0;i<end-start;++i)this[i+start]=bytes[i%len]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g}).call(exports,__webpack_require__("h6ac"))},dvMn:function(module,exports,__webpack_require__){"use strict";function string2binary(str){var result=null;return result=support.uint8array?new Uint8Array(str.length):Array(str.length),stringToArrayLike(str,result)}function identity(input){return input}function stringToArrayLike(str,array){for(var i=0;i<str.length;++i)array[i]=255&str.charCodeAt(i);return array}function arrayLikeToString(array){var chunk=65536,type=exports.getTypeOf(array),canUseApply=!0;if("uint8array"===type?canUseApply=arrayToStringHelper.applyCanBeUsed.uint8array:"nodebuffer"===type&&(canUseApply=arrayToStringHelper.applyCanBeUsed.nodebuffer),canUseApply)for(;1<chunk;)try{return arrayToStringHelper.stringifyByChunk(array,type,chunk)}catch(e){chunk=Math.floor(chunk/2)}return arrayToStringHelper.stringifyByChar(array)}function arrayLikeToArrayLike(arrayFrom,arrayTo){for(var i=0;i<arrayFrom.length;i++)arrayTo[i]=arrayFrom[i];return arrayTo}var _StringfromCharCode6=String.fromCharCode,_Mathmin3=Math.min,support=__webpack_require__("untT"),base64=__webpack_require__("Ps3q"),nodejsUtils=__webpack_require__("c5OX"),setImmediate=__webpack_require__("sN8g"),external=__webpack_require__("8JlO");exports.newBlob=function(part,type){exports.checkSupport("blob");try{return new Blob([part],{type:type})}catch(e){try{var Builder=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,builder=new Builder;return builder.append(part),builder.getBlob(type)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var arrayToStringHelper={stringifyByChunk:function(array,type,chunk){var result=[],k=0,len=array.length;if(len<=chunk)return _StringfromCharCode6.apply(null,array);for(;k<len;)"array"===type||"nodebuffer"===type?result.push(_StringfromCharCode6.apply(null,array.slice(k,_Mathmin3(k+chunk,len)))):result.push(_StringfromCharCode6.apply(null,array.subarray(k,_Mathmin3(k+chunk,len)))),k+=chunk;return result.join("")},stringifyByChar:function(array){for(var resultStr="",i=0;i<array.length;i++)resultStr+=_StringfromCharCode6(array[i]);return resultStr},applyCanBeUsed:{uint8array:function(){try{return support.uint8array&&1===_StringfromCharCode6.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return support.nodebuffer&&1===_StringfromCharCode6.apply(null,nodejsUtils.allocBuffer(1)).length}catch(e){return!1}}()}};exports.applyFromCharCode=arrayLikeToString;var transform={};transform.string={string:identity,array:function(input){return stringToArrayLike(input,Array(input.length))},arraybuffer:function(input){return transform.string.uint8array(input).buffer},uint8array:function(input){return stringToArrayLike(input,new Uint8Array(input.length))},nodebuffer:function(input){return stringToArrayLike(input,nodejsUtils.allocBuffer(input.length))}},transform.array={string:arrayLikeToString,array:identity,arraybuffer:function(input){return new Uint8Array(input).buffer},uint8array:function(input){return new Uint8Array(input)},nodebuffer:function(input){return nodejsUtils.newBufferFrom(input)}},transform.arraybuffer={string:function(input){return arrayLikeToString(new Uint8Array(input))},array:function(input){return arrayLikeToArrayLike(new Uint8Array(input),Array(input.byteLength))},arraybuffer:identity,uint8array:function(input){return new Uint8Array(input)},nodebuffer:function(input){return nodejsUtils.newBufferFrom(new Uint8Array(input))}},transform.uint8array={string:arrayLikeToString,array:function(input){return arrayLikeToArrayLike(input,Array(input.length))},arraybuffer:function(input){return input.buffer},uint8array:identity,nodebuffer:function(input){return nodejsUtils.newBufferFrom(input)}},transform.nodebuffer={string:arrayLikeToString,array:function(input){return arrayLikeToArrayLike(input,Array(input.length))},arraybuffer:function(input){return transform.nodebuffer.uint8array(input).buffer},uint8array:function(input){return arrayLikeToArrayLike(input,new Uint8Array(input.length))},nodebuffer:identity},exports.transformTo=function(outputType,input){if(input||(input=""),!outputType)return input;exports.checkSupport(outputType);var inputType=exports.getTypeOf(input),result=transform[inputType][outputType](input);return result},exports.getTypeOf=function(input){return"string"==typeof input?"string":"[object Array]"===Object.prototype.toString.call(input)?"array":support.nodebuffer&&nodejsUtils.isBuffer(input)?"nodebuffer":support.uint8array&&input instanceof Uint8Array?"uint8array":support.arraybuffer&&input instanceof ArrayBuffer?"arraybuffer":void 0},exports.checkSupport=function(type){var supported=support[type.toLowerCase()];if(!supported)throw new Error(type+" is not supported by this platform")},exports.MAX_VALUE_16BITS=65535,exports.MAX_VALUE_32BITS=-1,exports.pretty=function(str){var res="",code,i;for(i=0;i<(str||"").length;i++)code=str.charCodeAt(i),res+="\\x"+(16>code?"0":"")+code.toString(16).toUpperCase();return res},exports.delay=function(callback,args,self){setImmediate(function(){callback.apply(self||null,args||[])})},exports.inherits=function(ctor,superCtor){var Obj=function(){};Obj.prototype=superCtor.prototype,ctor.prototype=new Obj},exports.extend=function(){var result={},i,attr;for(i=0;i<arguments.length;i++)for(attr in arguments[i])arguments[i].hasOwnProperty(attr)&&"undefined"==typeof result[attr]&&(result[attr]=arguments[i][attr]);return result},exports.prepareContent=function(name,inputData,isBinary,isOptimizedBinaryString,isBase64){var promise=external.Promise.resolve(inputData).then(function(data){var isBlob=support.blob&&(data instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(data)));return isBlob&&"undefined"!=typeof FileReader?new external.Promise(function(resolve,reject){var reader=new FileReader;reader.onload=function(e){resolve(e.target.result)},reader.onerror=function(e){reject(e.target.error)},reader.readAsArrayBuffer(data)}):data});return promise.then(function(data){var dataType=exports.getTypeOf(data);return dataType?("arraybuffer"===dataType?data=exports.transformTo("uint8array",data):"string"===dataType&&(isBase64?data=base64.decode(data):isBinary&&!0!==isOptimizedBinaryString&&(data=string2binary(data))),data):external.Promise.reject(new Error("Can't read the data of '"+name+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},e4aZ:function(module,exports,__webpack_require__){"use strict";function isRegExp(object){return"[object RegExp]"===Object.prototype.toString.call(object)}var utf8=__webpack_require__("Sm7/"),utils=__webpack_require__("dvMn"),GenericWorker=__webpack_require__("ZKdc"),StreamHelper=__webpack_require__("2P9T"),defaults=__webpack_require__("lUr3"),CompressedObject=__webpack_require__("PO9O"),ZipObject=__webpack_require__("geN+"),generate=__webpack_require__("GTg1"),nodejsUtils=__webpack_require__("c5OX"),NodejsStreamInputAdapter=__webpack_require__("AsaI"),fileAdd=function(name,data,originalOptions){var dataType=utils.getTypeOf(data),o=utils.extend(originalOptions||{},defaults),parent;o.date=o.date||new Date,null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(name=forceTrailingSlash(name)),o.createFolders&&(parent=parentFolder(name))&&folderAdd.call(this,parent,!0);var isUnicodeString="string"===dataType&&!1===o.binary&&!1===o.base64;originalOptions&&"undefined"!=typeof originalOptions.binary||(o.binary=!isUnicodeString);var isCompressedEmpty=data instanceof CompressedObject&&0===data.uncompressedSize;(isCompressedEmpty||o.dir||!data||0===data.length)&&(o.base64=!1,o.binary=!0,data="",o.compression="STORE",dataType="string");var zipObjectContent=null;zipObjectContent=data instanceof CompressedObject||data instanceof GenericWorker?data:nodejsUtils.isNode&&nodejsUtils.isStream(data)?new NodejsStreamInputAdapter(name,data):utils.prepareContent(name,data,o.binary,o.optimizedBinaryString,o.base64);var object=new ZipObject(name,zipObjectContent,o);this.files[name]=object},parentFolder=function(path){"/"===path.slice(-1)&&(path=path.substring(0,path.length-1));var lastSlash=path.lastIndexOf("/");return 0<lastSlash?path.substring(0,lastSlash):""},forceTrailingSlash=function(path){return"/"!==path.slice(-1)&&(path+="/"),path},folderAdd=function(name,createFolders){return createFolders="undefined"==typeof createFolders?defaults.createFolders:createFolders,name=forceTrailingSlash(name),this.files[name]||fileAdd.call(this,name,null,{dir:!0,createFolders:createFolders}),this.files[name]};module.exports={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(cb){var filename,relativePath,file;for(filename in this.files)this.files.hasOwnProperty(filename)&&(file=this.files[filename],relativePath=filename.slice(this.root.length,filename.length),relativePath&&filename.slice(0,this.root.length)===this.root&&cb(relativePath,file))},filter:function(search){var result=[];return this.forEach(function(relativePath,entry){search(relativePath,entry)&&result.push(entry)}),result},file:function(name,data,o){if(1===arguments.length){if(isRegExp(name)){var regexp=name;return this.filter(function(relativePath,file){return!file.dir&®exp.test(relativePath)})}var obj=this.files[this.root+name];return obj&&!obj.dir?obj:null}return name=this.root+name,fileAdd.call(this,name,data,o),this},folder:function(arg){if(!arg)return this;if(isRegExp(arg))return this.filter(function(relativePath,file){return file.dir&&arg.test(relativePath)});var name=this.root+arg,newFolder=folderAdd.call(this,name),ret=this.clone();return ret.root=newFolder.name,ret},remove:function(name){name=this.root+name;var file=this.files[name];if(file||("/"!==name.slice(-1)&&(name+="/"),file=this.files[name]),file&&!file.dir)delete this.files[name];else for(var kids=this.filter(function(relativePath,file){return file.name.slice(0,name.length)===name}),i=0;i<kids.length;i++)delete this.files[kids[i].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(options){var opts={},worker;try{if(opts=utils.extend(options||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:utf8.utf8encode}),opts.type=opts.type.toLowerCase(),opts.compression=opts.compression.toUpperCase(),"binarystring"===opts.type&&(opts.type="string"),!opts.type)throw new Error("No output type specified.");utils.checkSupport(opts.type),("darwin"===opts.platform||"freebsd"===opts.platform||"linux"===opts.platform||"sunos"===opts.platform)&&(opts.platform="UNIX"),"win32"===opts.platform&&(opts.platform="DOS");var comment=opts.comment||this.comment||"";worker=generate.generateWorker(this,opts,comment)}catch(e){worker=new GenericWorker("error"),worker.error(e)}return new StreamHelper(worker,opts.type||"string",opts.mimeType)},generateAsync:function(options,onUpdate){return this.generateInternalStream(options).accumulate(onUpdate)},generateNodeStream:function(options,onUpdate){return options=options||{},options.type||(options.type="nodebuffer"),this.generateInternalStream(options).toNodejsStream(onUpdate)}}},e5FP:function(module,exports,__webpack_require__){"use strict";function isRoot(node){return!node.parent}function rand(from,to){return Math.floor(Math.random()*(to-from)+from)}function sample(arr,count){for(var len=arr.length,iterations=_Mathmin4(len,count),result=new Set;result.size<iterations;)result.add(arr[rand(0,len)]);return Array.from(result)}function choice(val){return val[rand(0,val.length-1)]}function sentence(words,end){return words.length&&(words=[capitalize(words[0])].concat(words.slice(1))),words.join(" ")+(end||choice("?!..."))}function capitalize(word){return word[0].toUpperCase()+word.slice(1)}function insertCommas(words){if(2>words.length)return words;words=words.slice();var len=words.length,hasComma=/,$/,totalCommas=0;totalCommas=3<len&&6>=len?rand(0,1):6<len&&12>=len?rand(0,2):rand(1,4);for(var i=0,pos;i<totalCommas;i++)pos=rand(0,len-2),hasComma.test(words[pos])||(words[pos]+=",");return words}function paragraph(dict,wordCount,startWithCommon){var result=[],totalWords=0,words=void 0;for(startWithCommon&&dict.common&&(words=dict.common.slice(0,wordCount),totalWords+=words.length,result.push(sentence(insertCommas(words),".")));totalWords<wordCount;)words=sample(dict.words,_Mathmin4(rand(2,30),wordCount-totalWords)),totalWords+=words.length,result.push(sentence(insertCommas(words)));return result.join(" ")}function isRepeating(node){for(;node.parent;){if(node.repeat&&node.repeat.value&&1<node.repeat.value)return!0;node=node.parent}return!1}var _Mathmin4=Math.min;exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_implicitTag=__webpack_require__("7EAy"),_implicitTag2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_implicitTag),langs={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"]}},defaultOptions={wordCount:30,skipCommon:!1,lang:"latin"};exports.default=function(node,options){options=_extends({},defaultOptions,options);var dict=langs[options.lang]||langs.latin,startWithCommon=!options.skipCommon&&!isRepeating(node);return node.repeat||isRoot(node.parent)?(node.value=paragraph(dict,options.wordCount,startWithCommon),node.name=node.parent.name?(0,_implicitTag2.default)(node.parent.name):null):(node.parent.value=paragraph(dict,options.wordCount,startWithCommon),node.remove()),node}},eA7g:function(module,exports,__webpack_require__){"use strict";function getLogLevel(){return logClient.logLevel===logger.LogLevel.DEBUG?LogLevel.DEBUG:logClient.logLevel===logger.LogLevel.SILENT?LogLevel.SILENT:LogLevel.ERROR}function setLogLevel(newLevel){newLevel===LogLevel.DEBUG?logClient.logLevel=logger.LogLevel.DEBUG:newLevel===LogLevel.ERROR?logClient.logLevel=logger.LogLevel.ERROR:newLevel===LogLevel.SILENT?logClient.logLevel=logger.LogLevel.SILENT:logClient.error("Firestore ("+SDK_VERSION+"): Invalid value passed to `setLogLevel`")}function debug(tag,msg){for(var obj=[],_i=2;_i<arguments.length;_i++)obj[_i-2]=arguments[_i];if(logClient.logLevel<=logger.LogLevel.DEBUG){var args=obj.map(argToString);logClient.debug.apply(logClient,["Firestore ("+SDK_VERSION+") ["+tag+"]: "+msg].concat(args))}}function error(msg){for(var obj=[],_i=1;_i<arguments.length;_i++)obj[_i-1]=arguments[_i];if(logClient.logLevel<=logger.LogLevel.ERROR){var args=obj.map(argToString);logClient.error.apply(logClient,["Firestore ("+SDK_VERSION+"): "+msg].concat(args))}}function argToString(obj){if("string"==typeof obj)return obj;var platform=PlatformSupport.getPlatform();try{return platform.formatJSON(obj)}catch(e){return obj}}function fail(failure){var message="FIRESTORE ("+SDK_VERSION+") INTERNAL ASSERTION FAILED: "+failure;throw error(message),new Error(message)}function assert(assertion,message){assertion||fail(message)}function emptyByteString(){return PlatformSupport.getPlatform().emptyByteString}function makeConstructorPrivate(cls,optionalMessage){function PublicConstructor(){var error="This constructor is private.";throw optionalMessage&&(error+=" ",error+=optionalMessage),new FirestoreError(Code.INVALID_ARGUMENT,error)}for(var staticProperty in PublicConstructor.prototype=cls.prototype,cls)cls.hasOwnProperty(staticProperty)&&(PublicConstructor[staticProperty]=cls[staticProperty]);return PublicConstructor}function contains(obj,key){return Object.prototype.hasOwnProperty.call(obj,key)}function defaulted(value,defaultValue){return void 0===value?defaultValue:value}function forEachNumber(obj,fn){for(var key in obj)if(Object.prototype.hasOwnProperty.call(obj,key)){var num=+key;isNaN(num)||fn(num,obj[key])}}function values(obj){var vs=[];return forEach(obj,function(_,v){return vs.push(v)}),vs}function forEach(obj,fn){for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&fn(key,obj[key])}function isEmpty(obj){for(var key in assert(null!=obj&&"object"==typeof obj,"isEmpty() expects object parameter."),obj)if(Object.prototype.hasOwnProperty.call(obj,key))return!1;return!0}function shallowCopy(obj){assert(obj&&"object"==typeof obj,"shallowCopy() expects object parameter.");var result={};for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(result[key]=obj[key]);return result}function validateExactNumberOfArgs(functionName,args,numberOfArgs){if(args.length!==numberOfArgs)throw new FirestoreError(Code.INVALID_ARGUMENT,"Function "+functionName+"() requires "+formatPlural(numberOfArgs,"argument")+", but was called with "+formatPlural(args.length,"argument")+".")}function validateAtLeastNumberOfArgs(functionName,args,minNumberOfArgs){if(args.length<minNumberOfArgs)throw new FirestoreError(Code.INVALID_ARGUMENT,"Function "+functionName+"() requires at least "+formatPlural(minNumberOfArgs,"argument")+", but was called with "+formatPlural(args.length,"argument")+".")}function validateBetweenNumberOfArgs(functionName,args,minNumberOfArgs,maxNumberOfArgs){if(args.length<minNumberOfArgs||args.length>maxNumberOfArgs)throw new FirestoreError(Code.INVALID_ARGUMENT,"Function "+functionName+"() requires between "+minNumberOfArgs+" and "+(maxNumberOfArgs+" arguments, but was called with ")+formatPlural(args.length,"argument")+".")}function validateNamedArrayAtLeastNumberOfElements(functionName,value,name,minNumberOfElements){if(!(value instanceof Array)||value.length<minNumberOfElements)throw new FirestoreError(Code.INVALID_ARGUMENT,"Function "+functionName+"() requires its "+name+" argument to be an array with at least "+(formatPlural(minNumberOfElements,"element")+"."))}function validateArgType(functionName,type,position,argument){validateType(functionName,type,ordinal(position)+" argument",argument)}function validateOptionalArgType(functionName,type,position,argument){void 0!==argument&&validateArgType(functionName,type,position,argument)}function validateNamedType(functionName,type,optionName,argument){validateType(functionName,type,optionName+" option",argument)}function validateNamedOptionalType(functionName,type,optionName,argument){void 0!==argument&&validateNamedType(functionName,type,optionName,argument)}function validateArrayElements(functionName,optionName,typeDescription,argument,validator){if(!(argument instanceof Array))throw new FirestoreError(Code.INVALID_ARGUMENT,"Function "+functionName+"() requires its "+optionName+" "+("option to be an array, but it was: "+valueDescription(argument)));for(var i=0;i<argument.length;++i)if(!validator(argument[i]))throw new FirestoreError(Code.INVALID_ARGUMENT,"Function "+functionName+"() requires all "+optionName+" "+("elements to be "+typeDescription+", but the value at index "+i+" ")+("was: "+valueDescription(argument[i])))}function validateOptionalArrayElements(functionName,optionName,typeDescription,argument,validator){void 0!==argument&&validateArrayElements(functionName,optionName,typeDescription,argument,validator)}function validateNamedPropertyEquals(functionName,inputName,optionName,input,expected){for(var expectedDescription=[],_i=0,expected_1=expected,val;_i<expected_1.length;_i++){if(val=expected_1[_i],val===input)return;expectedDescription.push(valueDescription(val))}var actualDescription=valueDescription(input);throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid value "+actualDescription+" provided to function "+functionName+"() for option "+("\""+optionName+"\". Acceptable values: "+expectedDescription.join(", ")))}function validateNamedOptionalPropertyEquals(functionName,inputName,optionName,input,expected){void 0!==input&&validateNamedPropertyEquals(functionName,inputName,optionName,input,expected)}function validateType(functionName,type,inputName,input){var valid=!1;if(valid="object"===type?isPlainObject(input):"non-empty string"===type?"string"==typeof input&&""!==input:typeof input==type,!valid){var description=valueDescription(input);throw new FirestoreError(Code.INVALID_ARGUMENT,"Function "+functionName+"() requires its "+inputName+" "+("to be of type "+type+", but it was: "+description))}}function isPlainObject(input){return"object"==typeof input&&null!==input&&(Object.getPrototypeOf(input)===Object.prototype||null===Object.getPrototypeOf(input))}function valueDescription(input){if(void 0===input)return"undefined";if(null===input)return"null";if("string"==typeof input)return 20<input.length&&(input=input.substring(0,20)+"..."),JSON.stringify(input);if("number"==typeof input||"boolean"==typeof input)return""+input;if("object"==typeof input){if(input instanceof Array)return"an array";var customObjectName=tryGetCustomObjectType(input);return customObjectName?"a custom "+customObjectName+" object":"an object"}return"function"==typeof input?"a function":fail("Unknown wrong type: "+typeof input)}function tryGetCustomObjectType(input){if(input.constructor){var funcNameRegex=/function\s+([^\s(]+)\s*\(/,results=funcNameRegex.exec(input.constructor.toString());if(results&&1<results.length)return results[1]}return null}function validateDefined(functionName,position,argument){if(void 0===argument)throw new FirestoreError(Code.INVALID_ARGUMENT,"Function "+functionName+"() requires a valid "+ordinal(position)+" argument, but it was undefined.")}function validateOptionNames(functionName,options,optionNames){forEach(options,function(key){if(0>optionNames.indexOf(key))throw new FirestoreError(Code.INVALID_ARGUMENT,"Unknown option '"+key+"' passed to function "+functionName+"(). Available options: "+optionNames.join(", "))})}function invalidClassError(functionName,type,position,argument){var description=valueDescription(argument);return new FirestoreError(Code.INVALID_ARGUMENT,"Function "+functionName+"() requires its "+ordinal(position)+" "+("argument to be a "+type+", but it was: "+description))}function ordinal(num){return 1===num?"first":2===num?"second":3===num?"third":num+"th"}function formatPlural(num,str){return num+" "+str+(1===num?"":"s")}function primitiveComparator(left,right){return left<right?-1:left>right?1:0}function equals(left,right){return null!==left&&void 0!==left?!!(right&&left.isEqual(right)):left===right}function arrayEquals(left,right){if(left.length!==right.length)return!1;for(var i=0;i<left.length;i++)if(!left[i].isEqual(right[i]))return!1;return!0}function immediateSuccessor(s){return s+"\0"}function assertUint8ArrayAvailable(){if("undefined"==typeof Uint8Array)throw new FirestoreError(Code.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function assertBase64Available(){if(!PlatformSupport.getPlatform().base64Available)throw new FirestoreError(Code.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}function numericComparator(left,right){return left<right?-1:left>right?1:left===right?0:isNaN(left)?isNaN(right)?0:-1:1}function numericEquals(left,right){return left===right?0!==left||1/left==1/right:left!==left&&right!==right}function isNullOrUndefined(value){return null===value||void 0===value}function isSafeInteger(value){return isInteger(value)&&value<=MAX_SAFE_INTEGER&&value>=MIN_SAFE_INTEGER}function coercedFieldValuesArray(value){return value instanceof ArrayValue?value.internalValue.slice():[]}function isPermanentError(code){return code===Code.OK?fail("Treated status OK as error"):code===Code.CANCELLED||code===Code.UNKNOWN||code===Code.DEADLINE_EXCEEDED||code===Code.RESOURCE_EXHAUSTED||code===Code.INTERNAL||code===Code.UNAVAILABLE||code===Code.UNAUTHENTICATED?!1:code===Code.INVALID_ARGUMENT||code===Code.NOT_FOUND||code===Code.ALREADY_EXISTS||code===Code.PERMISSION_DENIED||code===Code.FAILED_PRECONDITION||code===Code.ABORTED||code===Code.OUT_OF_RANGE||code===Code.UNIMPLEMENTED||code===Code.DATA_LOSS||fail("Unknown status code: "+code)}function mapCodeFromRpcStatus(status){var code=RpcCode[status];return void 0===code?void 0:mapCodeFromRpcCode(code)}function mapCodeFromRpcCode(code){return void 0===code?(error("GRPC error has no .code"),Code.UNKNOWN):code===RpcCode.OK?Code.OK:code===RpcCode.CANCELLED?Code.CANCELLED:code===RpcCode.UNKNOWN?Code.UNKNOWN:code===RpcCode.DEADLINE_EXCEEDED?Code.DEADLINE_EXCEEDED:code===RpcCode.RESOURCE_EXHAUSTED?Code.RESOURCE_EXHAUSTED:code===RpcCode.INTERNAL?Code.INTERNAL:code===RpcCode.UNAVAILABLE?Code.UNAVAILABLE:code===RpcCode.UNAUTHENTICATED?Code.UNAUTHENTICATED:code===RpcCode.INVALID_ARGUMENT?Code.INVALID_ARGUMENT:code===RpcCode.NOT_FOUND?Code.NOT_FOUND:code===RpcCode.ALREADY_EXISTS?Code.ALREADY_EXISTS:code===RpcCode.PERMISSION_DENIED?Code.PERMISSION_DENIED:code===RpcCode.FAILED_PRECONDITION?Code.FAILED_PRECONDITION:code===RpcCode.ABORTED?Code.ABORTED:code===RpcCode.OUT_OF_RANGE?Code.OUT_OF_RANGE:code===RpcCode.UNIMPLEMENTED?Code.UNIMPLEMENTED:code===RpcCode.DATA_LOSS?Code.DATA_LOSS:fail("Unknown status code: "+code)}function mapRpcCodeFromCode(code){return void 0===code?RpcCode.OK:code===Code.OK?RpcCode.OK:code===Code.CANCELLED?RpcCode.CANCELLED:code===Code.UNKNOWN?RpcCode.UNKNOWN:code===Code.DEADLINE_EXCEEDED?RpcCode.DEADLINE_EXCEEDED:code===Code.RESOURCE_EXHAUSTED?RpcCode.RESOURCE_EXHAUSTED:code===Code.INTERNAL?RpcCode.INTERNAL:code===Code.UNAVAILABLE?RpcCode.UNAVAILABLE:code===Code.UNAUTHENTICATED?RpcCode.UNAUTHENTICATED:code===Code.INVALID_ARGUMENT?RpcCode.INVALID_ARGUMENT:code===Code.NOT_FOUND?RpcCode.NOT_FOUND:code===Code.ALREADY_EXISTS?RpcCode.ALREADY_EXISTS:code===Code.PERMISSION_DENIED?RpcCode.PERMISSION_DENIED:code===Code.FAILED_PRECONDITION?RpcCode.FAILED_PRECONDITION:code===Code.ABORTED?RpcCode.ABORTED:code===Code.OUT_OF_RANGE?RpcCode.OUT_OF_RANGE:code===Code.UNIMPLEMENTED?RpcCode.UNIMPLEMENTED:code===Code.DATA_LOSS?RpcCode.DATA_LOSS:fail("Unknown status code: "+code)}function mapCodeFromHttpStatus(status){return 200===status?Code.OK:400===status?Code.INVALID_ARGUMENT:401===status?Code.UNAUTHENTICATED:403===status?Code.PERMISSION_DENIED:404===status?Code.NOT_FOUND:409===status?Code.ABORTED:416===status?Code.OUT_OF_RANGE:429===status?Code.RESOURCE_EXHAUSTED:499===status?Code.CANCELLED:500===status?Code.UNKNOWN:501===status?Code.UNIMPLEMENTED:503===status?Code.UNAVAILABLE:504===status?Code.DEADLINE_EXCEEDED:200<=status&&300>status?Code.OK:400<=status&&500>status?Code.FAILED_PRECONDITION:500<=status&&600>status?Code.INTERNAL:Code.UNKNOWN}function maybeDocumentMap(){return EMPTY_MAYBE_DOCUMENT_MAP}function documentMap(){return EMPTY_DOCUMENT_MAP}function documentVersionMap(){return EMPTY_DOCUMENT_VERSION_MAP}function documentKeySet(){return EMPTY_DOCUMENT_KEY_SET}function targetIdSet(){return EMPTY_TARGET_ID_SET}function documentTargetMap(){return new SortedMap(DocumentKey.comparator)}function snapshotChangesMap(){return new SortedMap(DocumentKey.comparator)}function assertPresent(value,description){assert(!isNullOrUndefined(value),description+" is missing")}function parseInt64(value){return"number"==typeof value?value:"string"==typeof value?+value:fail("can't parse "+value)}function hasTag(obj,type,tag){return type===tag||!type&&tag in obj}function encode(path){for(var result="",i=0;i<path.length;i++)0<result.length&&(result=encodeSeparator(result)),result=encodeSegment(path.get(i),result);return encodeSeparator(result)}function encodeSegment(segment,resultBuf){for(var result=resultBuf,length=segment.length,i=0,c;i<length;i++)c=segment.charAt(i),result+="\0"===c?escapeChar+encodedNul:c===escapeChar?escapeChar+encodedEscape:c;return result}function encodeSeparator(result){return result+escapeChar+encodedSeparatorChar}function decode$1(path){var length=path.length;if(assert(2<=length,"Invalid path "+path),2===length)return assert(path.charAt(0)===escapeChar&&path.charAt(1)===encodedSeparatorChar,"Non-empty path "+path+" had length 2"),ResourcePath.EMPTY_PATH;for(var segments=[],segmentBuilder="",start=0,end;start<length;){end=path.indexOf(escapeChar,start),(0>end||end>length-2)&&fail("Invalid encoded resource path: \""+path+"\"");var next=path.charAt(end+1);switch(next){case encodedSeparatorChar:var currentPiece=path.substring(start,end),segment=void 0;0===segmentBuilder.length?segment=currentPiece:(segmentBuilder+=currentPiece,segment=segmentBuilder,segmentBuilder=""),segments.push(segment);break;case encodedNul:segmentBuilder+=path.substring(start,end),segmentBuilder+="\0";break;case encodedEscape:segmentBuilder+=path.substring(start,end+1);break;default:fail("Invalid encoded resource path: \""+path+"\"");}start=end+2}return new ResourcePath(segments)}function wrapRequest(request){return new PersistencePromise(function(resolve,reject){request.onsuccess=function(event){var result=event.target.result;resolve(result)},request.onerror=function(event){reject(event.target.error)}})}function documentGlobalStore(txn){return IndexedDbPersistence.getStore(txn,DbRemoteDocumentGlobal.store)}function isDocumentChangeMissingError(err){return err.code===Code.DATA_LOSS&&err.message===REMOTE_DOCUMENT_CHANGE_MISSING_ERR_MSG}function remoteDocumentsStore(txn){return IndexedDbPersistence.getStore(txn,DbRemoteDocument.store)}function documentChangesStore(txn){return IndexedDbPersistence.getStore(txn,DbRemoteDocumentChanges.store)}function dbKey(docKey){return docKey.path.toArray()}function dbDocumentSize(doc){var value;if(doc.document)value=doc.document;else if(doc.unknownDocument)value=doc.unknownDocument;else if(doc.noDocument)value=doc.noDocument;else throw fail("Unknown remote document type");return JSON.stringify(value).length}function createPrimaryClientStore(db){db.createObjectStore(DbPrimaryClient.store)}function createMutationQueue(db){db.createObjectStore(DbMutationQueue.store,{keyPath:DbMutationQueue.keyPath});var mutationBatchesStore=db.createObjectStore(DbMutationBatch.store,{keyPath:DbMutationBatch.keyPath,autoIncrement:!0});mutationBatchesStore.createIndex(DbMutationBatch.userMutationsIndex,DbMutationBatch.userMutationsKeyPath,{unique:!0}),db.createObjectStore(DbDocumentMutation.store)}function upgradeMutationBatchSchemaAndMigrateData(db,txn){var v1MutationsStore=txn.store(DbMutationBatch.store);return v1MutationsStore.loadAll().next(function(existingMutations){db.deleteObjectStore(DbMutationBatch.store);var mutationsStore=db.createObjectStore(DbMutationBatch.store,{keyPath:DbMutationBatch.keyPath,autoIncrement:!0});mutationsStore.createIndex(DbMutationBatch.userMutationsIndex,DbMutationBatch.userMutationsKeyPath,{unique:!0});var v3MutationsStore=txn.store(DbMutationBatch.store),writeAll=existingMutations.map(function(mutation){return v3MutationsStore.put(mutation)});return PersistencePromise.waitFor(writeAll)})}function createRemoteDocumentCache(db){db.createObjectStore(DbRemoteDocument.store)}function createDocumentGlobalStore(db){db.createObjectStore(DbRemoteDocumentGlobal.store)}function createQueryCache(db){var targetDocumentsStore=db.createObjectStore(DbTargetDocument.store,{keyPath:DbTargetDocument.keyPath});targetDocumentsStore.createIndex(DbTargetDocument.documentTargetsIndex,DbTargetDocument.documentTargetsKeyPath,{unique:!0});var targetStore=db.createObjectStore(DbTarget.store,{keyPath:DbTarget.keyPath});targetStore.createIndex(DbTarget.queryTargetsIndexName,DbTarget.queryTargetsKeyPath,{unique:!0}),db.createObjectStore(DbTargetGlobal.store)}function dropQueryCache(db){db.deleteObjectStore(DbTargetDocument.store),db.deleteObjectStore(DbTarget.store),db.deleteObjectStore(DbTargetGlobal.store)}function writeEmptyTargetGlobalEntry(txn){var globalStore=txn.store(DbTargetGlobal.store),metadata=new DbTargetGlobal(0,0,SnapshotVersion.MIN.toTimestamp(),0);return globalStore.put(DbTargetGlobal.key,metadata)}function createRemoteDocumentChangesStore(db){db.createObjectStore(DbRemoteDocumentChanges.store,{keyPath:"id",autoIncrement:!0})}function createClientMetadataStore(db){db.createObjectStore(DbClientMetadata.store,{keyPath:DbClientMetadata.keyPath})}function mutationQueueContainsKey(txn,userId,key){var indexKey=DbDocumentMutation.prefixForPath(userId,key.path),encodedPath=indexKey[1],startRange=IDBKeyRange.lowerBound(indexKey),containsKey=!1;return documentMutationsStore(txn).iterate({range:startRange,keysOnly:!0},function(key,value,control){var userID=key[0],keyPath=key[1],_=key[2];userID===userId&&keyPath===encodedPath&&(containsKey=!0),control.done()}).next(function(){return containsKey})}function mutationQueuesContainKey(txn,docKey){var found=!1;return mutationQueuesStore(txn).iterateSerial(function(userId){return mutationQueueContainsKey(txn,userId,docKey).next(function(containsKey){return containsKey&&(found=!0),PersistencePromise.resolve(!containsKey)})}).next(function(){return found})}function removeMutationBatch(txn,userId,batch){var mutationStore=txn.store(DbMutationBatch.store),indexTxn=txn.store(DbDocumentMutation.store),promises=[],range=IDBKeyRange.only(batch.batchId),numDeleted=0,removePromise=mutationStore.iterate({range:range},function(key,value,control){return numDeleted++,control.delete()});promises.push(removePromise.next(function(){assert(1==numDeleted,"Dangling document-mutation reference found: Missing batch "+batch.batchId)}));for(var removedDocuments=[],_i=0,_a=batch.mutations;_i<_a.length;_i++){var mutation=_a[_i],indexKey=DbDocumentMutation.key(userId,mutation.key.path,batch.batchId);promises.push(indexTxn.delete(indexKey)),removedDocuments.push(mutation.key)}return PersistencePromise.waitFor(promises).next(function(){return removedDocuments})}function convertStreamToken(token){return token instanceof Uint8Array?(assert("YES"===process.env.USE_MOCK_PERSISTENCE,"Persisting non-string stream tokens is only supported with mock persistence."),token.toString()):token}function mutationsStore(txn){return IndexedDbPersistence.getStore(txn,DbMutationBatch.store)}function documentMutationsStore(txn){return IndexedDbPersistence.getStore(txn,DbDocumentMutation.store)}function mutationQueuesStore(txn){return IndexedDbPersistence.getStore(txn,DbMutationQueue.store)}function targetsStore(txn){return IndexedDbPersistence.getStore(txn,DbTarget.store)}function globalTargetStore(txn){return IndexedDbPersistence.getStore(txn,DbTargetGlobal.store)}function retrieveMetadata(txn){var globalStore=SimpleDb.getStore(txn,DbTargetGlobal.store);return globalStore.get(DbTargetGlobal.key).next(function(metadata){return assert(null!==metadata,"Missing metadata row."),metadata})}function getHighestListenSequenceNumber(txn){return retrieveMetadata(txn).next(function(targetGlobal){return targetGlobal.highestListenSequenceNumber})}function documentTargetStore(txn){return IndexedDbPersistence.getStore(txn,DbTargetDocument.store)}function isDocumentQuery(dbQuery){return void 0!==dbQuery.documents}function bufferEntryComparator(_a,_b){var aSequence=_a[0],aIndex=_a[1],bSequence=_b[0],bIndex=_b[1],seqCmp=primitiveComparator(aSequence,bSequence);return 0===seqCmp?primitiveComparator(aIndex,bIndex):seqCmp}function isPrimaryLeaseLostError(err){return err.code===Code.FAILED_PRECONDITION&&err.message===PRIMARY_LEASE_LOST_ERROR_MSG}function primaryClientStore(txn){return txn.store(DbPrimaryClient.store)}function clientMetadataStore(txn){return txn.store(DbClientMetadata.store)}function sentinelKey(key){return[0,encode(key.path)]}function sentinelRow(key,sequenceNumber){return new DbTargetDocument(0,encode(key.path),sequenceNumber)}function writeSentinelKey(txn,key){return documentTargetStore(txn).put(sentinelRow(key,txn.currentSequenceNumber))}function documentSizeMap(){return new SortedMap(DocumentKey.comparator)}function compareChangeType(c1,c2){var order=function(change){return change===ChangeType.Added?1:change===ChangeType.Modified?2:change===ChangeType.Metadata?2:change===ChangeType.Removed?0:fail("Unknown ChangeType: "+change)};return order(c1)-order(c2)}function fromWebStorageSequenceNumber(seqString){var sequenceNumber=ListenSequence.INVALID;if(null!=seqString)try{var parsed=JSON.parse(seqString);assert("number"==typeof parsed,"Found non-numeric sequence number"),sequenceNumber=parsed}catch(e){error(LOG_TAG$10,"Failed to read sequence number from WebStorage",e)}return sequenceNumber}function fromDotSeparatedString(path){var found=path.search(RESERVED);if(0<=found)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid field path ("+path+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new(FieldPath$1.bind.apply(FieldPath$1,[void 0].concat(path.split("."))))}catch(e){throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid field path ("+path+"). Paths must not be empty, begin with '.', end with '.', or contain '..'")}}function makeCredentialsProvider(credentials){if(!credentials)return new EmptyCredentialsProvider;switch(credentials.type){case"gapi":return new FirstPartyCredentialsProvider(credentials.client,credentials.sessionIndex||"0");case"provider":return credentials.client;default:throw new FirestoreError(Code.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type");}}function isPartialObserver(obj){return implementsAnyMethods$1(obj,["next","error","complete"])}function implementsAnyMethods$1(obj,methods){if("object"!=typeof obj||null===obj)return!1;for(var object=obj,_i=0,methods_1=methods,method;_i<methods_1.length;_i++)if(method=methods_1[_i],method in object&&"function"==typeof object[method])return!0;return!1}function isWrite(dataSource){switch(dataSource){case UserDataSource.Set:case UserDataSource.MergeSet:case UserDataSource.Update:return!0;case UserDataSource.Argument:return!1;default:throw fail("Unexpected case for UserDataSource: "+dataSource);}}function looksLikeJsonObject(input){return"object"==typeof input&&null!==input&&!(input instanceof Array)&&!(input instanceof Date)&&!(input instanceof Timestamp)&&!(input instanceof GeoPoint)&&!(input instanceof Blob)&&!(input instanceof DocumentKeyReference)&&!(input instanceof FieldValueImpl)}function validatePlainObject(message,context,input){if(!looksLikeJsonObject(input)||!isPlainObject(input)){var description=valueDescription(input);if("an object"===description)throw context.createError(message+" a custom object");else throw context.createError(message+" "+description)}}function fieldPathFromArgument(methodName,path){if(path instanceof FieldPath$1)return path._internalPath;if("string"==typeof path)return fieldPathFromDotSeparatedString(methodName,path);throw new FirestoreError(Code.INVALID_ARGUMENT,"Function "+methodName+"() called with invalid data. "+"Field path arguments must be of type string or FieldPath.")}function fieldPathFromDotSeparatedString(methodName,path){try{return fromDotSeparatedString(path)._internalPath}catch(e){var message=errorMessage(e);throw new FirestoreError(Code.INVALID_ARGUMENT,"Function "+methodName+"() called with invalid data. "+message)}}function errorMessage(error){return error instanceof Error?error.message:error.toString()}function throwDocChangesMethodError(){throw new FirestoreError(Code.INVALID_ARGUMENT,"QuerySnapshot.docChanges has been changed from a property into a method, so usages like \"querySnapshot.docChanges\" should become \"querySnapshot.docChanges()\"")}function validateSetOptions(methodName,options){if(void 0===options)return{merge:!1};if(validateOptionNames(methodName,options,["merge","mergeFields"]),validateNamedOptionalType(methodName,"boolean","merge",options.merge),validateOptionalArrayElements(methodName,"mergeFields","a string or a FieldPath",options.mergeFields,function(element){return"string"==typeof element||element instanceof FieldPath$1}),void 0!==options.mergeFields&&void 0!==options.merge)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid options passed to function "+methodName+"(): You cannot specify both \"merge\" and \"mergeFields\".");return options}function validateSnapshotOptions(methodName,options){return void 0===options?{}:(validateOptionNames(methodName,options,["serverTimestamps"]),validateNamedOptionalPropertyEquals(methodName,"options","serverTimestamps",options.serverTimestamps,["estimate","previous","none"]),options)}function validateGetOptions(methodName,options){validateOptionalArgType(methodName,"object",1,options),options&&(validateOptionNames(methodName,options,["source"]),validateNamedOptionalPropertyEquals(methodName,"options","source",options.source,["default","server","cache"]))}function validateReference(methodName,documentRef,firestore){if(!(documentRef instanceof DocumentReference))throw invalidClassError(methodName,"DocumentReference",1,documentRef);else if(documentRef.firestore!==firestore)throw new FirestoreError(Code.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");else return documentRef}function changesFromSnapshot(firestore,includeMetadataChanges,snapshot){if(snapshot.oldDocs.isEmpty()){var index_1=0,lastDoc_1;return snapshot.docChanges.map(function(change){var doc=new QueryDocumentSnapshot(firestore,change.doc.key,change.doc,snapshot.fromCache,snapshot.mutatedKeys.has(change.doc.key));return assert(change.type===ChangeType.Added,"Invalid event type for first snapshot"),assert(!lastDoc_1||0>snapshot.query.docComparator(lastDoc_1,change.doc),"Got added events in wrong order"),lastDoc_1=change.doc,{type:"added",doc:doc,oldIndex:-1,newIndex:index_1++}})}var indexTracker_1=snapshot.oldDocs;return snapshot.docChanges.filter(function(change){return includeMetadataChanges||change.type!==ChangeType.Metadata}).map(function(change){var doc=new QueryDocumentSnapshot(firestore,change.doc.key,change.doc,snapshot.fromCache,snapshot.mutatedKeys.has(change.doc.key)),oldIndex=-1,newIndex=-1;return change.type!==ChangeType.Added&&(oldIndex=indexTracker_1.indexOf(change.doc.key),assert(0<=oldIndex,"Index for document not found"),indexTracker_1=indexTracker_1.delete(change.doc.key)),change.type!==ChangeType.Removed&&(indexTracker_1=indexTracker_1.add(change.doc),newIndex=indexTracker_1.indexOf(change.doc.key)),{type:resultChangeType(change.type),doc:doc,oldIndex:oldIndex,newIndex:newIndex}})}function resultChangeType(type){return type===ChangeType.Added?"added":type===ChangeType.Modified||type===ChangeType.Metadata?"modified":type===ChangeType.Removed?"removed":fail("Unknown change type: "+type)}function configureForFirebase(firebase$$1){firebase$$1.INTERNAL.registerService("firestore",function(app){return new Firestore(app)},shallowCopy(firestoreNamespace))}function registerFirestore(instance){configureForFirebase(instance)}var _NumberPOSITIVE_INFINITY=Number.POSITIVE_INFINITY,_NumberNEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,_Mathfloor3=Math.floor,_Mathmin5=Math.min,_Mathmax3=Math.max;Object.defineProperty(exports,"__esModule",{value:!0});var firebase=function(ex){return ex&&"object"==typeof ex&&"default"in ex?ex["default"]:ex}(__webpack_require__("dP58")),logger=__webpack_require__("TUpU"),tslib_1=__webpack_require__("vCxL"),webchannelWrapper=__webpack_require__("ueHA"),SDK_VERSION=firebase.SDK_VERSION,logClient=new logger.Logger("@firebase/firestore"),LogLevel;(function(LogLevel){LogLevel[LogLevel.DEBUG=0]="DEBUG",LogLevel[LogLevel.ERROR=1]="ERROR",LogLevel[LogLevel.SILENT=2]="SILENT"})(LogLevel||(LogLevel={}));var PlatformSupport=function(){function PlatformSupport(){}return PlatformSupport.setPlatform=function(platform){PlatformSupport.platform&&fail("Platform already defined"),PlatformSupport.platform=platform},PlatformSupport.getPlatform=function(){return PlatformSupport.platform||fail("Platform not set"),PlatformSupport.platform},PlatformSupport}(),Code={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"},FirestoreError=function(_super){function FirestoreError(code,message){var _this=_super.call(this,message)||this;return _this.code=code,_this.message=message,_this.name="FirebaseError",_this.toString=function(){return _this.name+": [code="+_this.code+"]: "+_this.message},_this}return tslib_1.__extends(FirestoreError,_super),FirestoreError}(Error),AutoId=function(){function AutoId(){}return AutoId.newId=function(){for(var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",autoId="",i=0;20>i;i++)autoId+=chars.charAt(_Mathfloor3(Math.random()*chars.length));return assert(20===autoId.length,"Invalid auto ID: "+autoId),autoId},AutoId}(),Blob=function(){function Blob(binaryString){assertBase64Available(),this._binaryString=binaryString}return Blob.fromBase64String=function(base64){validateExactNumberOfArgs("Blob.fromBase64String",arguments,1),validateArgType("Blob.fromBase64String","string",1,base64),assertBase64Available();try{var binaryString=PlatformSupport.getPlatform().atob(base64);return new Blob(binaryString)}catch(e){throw new FirestoreError(Code.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+e)}},Blob.fromUint8Array=function(array){if(validateExactNumberOfArgs("Blob.fromUint8Array",arguments,1),assertUint8ArrayAvailable(),!(array instanceof Uint8Array))throw invalidClassError("Blob.fromUint8Array","Uint8Array",1,array);var binaryString=Array.prototype.map.call(array,function(char){return String.fromCharCode(char)}).join("");return new Blob(binaryString)},Blob.prototype.toBase64=function(){return validateExactNumberOfArgs("Blob.toBase64",arguments,0),assertBase64Available(),PlatformSupport.getPlatform().btoa(this._binaryString)},Blob.prototype.toUint8Array=function(){validateExactNumberOfArgs("Blob.toUint8Array",arguments,0),assertUint8ArrayAvailable();for(var buffer=new Uint8Array(this._binaryString.length),i=0;i<this._binaryString.length;i++)buffer[i]=this._binaryString.charCodeAt(i);return buffer},Blob.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},Blob.prototype.isEqual=function(other){return this._binaryString===other._binaryString},Blob.prototype._compareTo=function(other){return primitiveComparator(this._binaryString,other._binaryString)},Blob}(),PublicBlob=makeConstructorPrivate(Blob,"Use Blob.fromUint8Array() or Blob.fromBase64String() instead."),GeoPoint=function(){function GeoPoint(latitude,longitude){if(validateExactNumberOfArgs("GeoPoint",arguments,2),validateArgType("GeoPoint","number",1,latitude),validateArgType("GeoPoint","number",2,longitude),!isFinite(latitude)||-90>latitude||90<latitude)throw new FirestoreError(Code.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+latitude);if(!isFinite(longitude)||-180>longitude||180<longitude)throw new FirestoreError(Code.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+longitude);this._lat=latitude,this._long=longitude}return Object.defineProperty(GeoPoint.prototype,"latitude",{get:function(){return this._lat},enumerable:!0,configurable:!0}),Object.defineProperty(GeoPoint.prototype,"longitude",{get:function(){return this._long},enumerable:!0,configurable:!0}),GeoPoint.prototype.isEqual=function(other){return this._lat===other._lat&&this._long===other._long},GeoPoint.prototype._compareTo=function(other){return primitiveComparator(this._lat,other._lat)||primitiveComparator(this._long,other._long)},GeoPoint}(),Timestamp=function(){function Timestamp(seconds,nanoseconds){if(this.seconds=seconds,this.nanoseconds=nanoseconds,0>nanoseconds)throw new FirestoreError(Code.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+nanoseconds);if(1e9<=nanoseconds)throw new FirestoreError(Code.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+nanoseconds);if(-62135596800>seconds)throw new FirestoreError(Code.INVALID_ARGUMENT,"Timestamp seconds out of range: "+seconds);if(253402300800<=seconds)throw new FirestoreError(Code.INVALID_ARGUMENT,"Timestamp seconds out of range: "+seconds)}return Timestamp.now=function(){return Timestamp.fromMillis(Date.now())},Timestamp.fromDate=function(date){return Timestamp.fromMillis(date.getTime())},Timestamp.fromMillis=function(milliseconds){var seconds=_Mathfloor3(milliseconds/1e3);return new Timestamp(seconds,1e6*(milliseconds-1e3*seconds))},Timestamp.prototype.toDate=function(){return new Date(this.toMillis())},Timestamp.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},Timestamp.prototype._compareTo=function(other){return this.seconds===other.seconds?primitiveComparator(this.nanoseconds,other.nanoseconds):primitiveComparator(this.seconds,other.seconds)},Timestamp.prototype.isEqual=function(other){return other.seconds===this.seconds&&other.nanoseconds===this.nanoseconds},Timestamp.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},Timestamp}(),DatabaseInfo=function(){return function(databaseId,persistenceKey,host,ssl){this.databaseId=databaseId,this.persistenceKey=persistenceKey,this.host=host,this.ssl=ssl}}(),DEFAULT_DATABASE_NAME="(default)",DatabaseId=function(){function DatabaseId(projectId,database){this.projectId=projectId,this.database=database?database:DEFAULT_DATABASE_NAME}return Object.defineProperty(DatabaseId.prototype,"isDefaultDatabase",{get:function(){return this.database===DEFAULT_DATABASE_NAME},enumerable:!0,configurable:!0}),DatabaseId.prototype.isEqual=function(other){return other instanceof DatabaseId&&other.projectId===this.projectId&&other.database===this.database},DatabaseId.prototype.compareTo=function(other){return primitiveComparator(this.projectId,other.projectId)||primitiveComparator(this.database,other.database)},DatabaseId}(),DOCUMENT_KEY_NAME="__name__",Path=function(){function Path(segments,offset,length){this.init(segments,offset,length)}return Path.prototype.init=function(segments,offset,length){void 0===offset?offset=0:offset>segments.length&&fail("offset "+offset+" out of range "+segments.length),void 0===length?length=segments.length-offset:length>segments.length-offset&&fail("length "+length+" out of range "+(segments.length-offset)),this.segments=segments,this.offset=offset,this.len=length},Path.prototype.construct=function(segments,offset,length){var path=Object.create(Object.getPrototypeOf(this));return path.init(segments,offset,length),path},Object.defineProperty(Path.prototype,"length",{get:function(){return this.len},enumerable:!0,configurable:!0}),Path.prototype.isEqual=function(other){return 0===Path.comparator(this,other)},Path.prototype.child=function(nameOrPath){var segments=this.segments.slice(this.offset,this.limit());return nameOrPath instanceof Path?nameOrPath.forEach(function(segment){segments.push(segment)}):"string"==typeof nameOrPath?segments.push(nameOrPath):fail("Unknown parameter type for Path.child(): "+nameOrPath),this.construct(segments)},Path.prototype.limit=function(){return this.offset+this.length},Path.prototype.popFirst=function(size){return size=void 0===size?1:size,assert(this.length>=size,"Can't call popFirst() with less segments"),this.construct(this.segments,this.offset+size,this.length-size)},Path.prototype.popLast=function(){return assert(!this.isEmpty(),"Can't call popLast() on empty path"),this.construct(this.segments,this.offset,this.length-1)},Path.prototype.firstSegment=function(){return assert(!this.isEmpty(),"Can't call firstSegment() on empty path"),this.segments[this.offset]},Path.prototype.lastSegment=function(){return assert(!this.isEmpty(),"Can't call lastSegment() on empty path"),this.segments[this.limit()-1]},Path.prototype.get=function(index){return assert(index<this.length,"Index out of range"),this.segments[this.offset+index]},Path.prototype.isEmpty=function(){return 0===this.length},Path.prototype.isPrefixOf=function(other){if(other.length<this.length)return!1;for(var i=0;i<this.length;i++)if(this.get(i)!==other.get(i))return!1;return!0},Path.prototype.isImmediateParentOf=function(potentialChild){if(this.length+1!==potentialChild.length)return!1;for(var i=0;i<this.length;i++)if(this.get(i)!==potentialChild.get(i))return!1;return!0},Path.prototype.forEach=function(fn){for(var i=this.offset,end=this.limit();i<end;i++)fn(this.segments[i])},Path.prototype.toArray=function(){return this.segments.slice(this.offset,this.limit())},Path.comparator=function(p1,p2){for(var len=_Mathmin5(p1.length,p2.length),i=0;i<len;i++){var left=p1.get(i),right=p2.get(i);if(left<right)return-1;if(left>right)return 1}return p1.length<p2.length?-1:p1.length>p2.length?1:0},Path}(),ResourcePath=function(_super){function ResourcePath(){return null!==_super&&_super.apply(this,arguments)||this}return tslib_1.__extends(ResourcePath,_super),ResourcePath.prototype.canonicalString=function(){return this.toArray().join("/")},ResourcePath.prototype.toString=function(){return this.canonicalString()},ResourcePath.fromString=function(path){if(0<=path.indexOf("//"))throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid path ("+path+"). Paths must not contain // in them.");var segments=path.split("/").filter(function(segment){return 0<segment.length});return new ResourcePath(segments)},ResourcePath.EMPTY_PATH=new ResourcePath([]),ResourcePath}(Path),identifierRegExp=/^[_a-zA-Z][_a-zA-Z0-9]*$/,FieldPath=function(_super){function FieldPath(){return null!==_super&&_super.apply(this,arguments)||this}return tslib_1.__extends(FieldPath,_super),FieldPath.isValidIdentifier=function(segment){return identifierRegExp.test(segment)},FieldPath.prototype.canonicalString=function(){return this.toArray().map(function(str){return str=str.replace("\\","\\\\").replace("`","\\`"),FieldPath.isValidIdentifier(str)||(str="`"+str+"`"),str}).join(".")},FieldPath.prototype.toString=function(){return this.canonicalString()},FieldPath.prototype.isKeyField=function(){return 1===this.length&&this.get(0)===DOCUMENT_KEY_NAME},FieldPath.keyField=function(){return new FieldPath([DOCUMENT_KEY_NAME])},FieldPath.fromServerFormat=function(path){for(var segments=[],current="",i=0,addCurrentSegment=function(){if(0===current.length)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid field path ("+path+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");segments.push(current),current=""},inBackticks=!1,c;i<path.length;)if(c=path[i],"\\"===c){if(i+1===path.length)throw new FirestoreError(Code.INVALID_ARGUMENT,"Path has trailing escape character: "+path);var next=path[i+1];if("\\"!==next&&"."!==next&&"`"!==next)throw new FirestoreError(Code.INVALID_ARGUMENT,"Path has invalid escape sequence: "+path);current+=next,i+=2}else"`"===c?(inBackticks=!inBackticks,i++):"."!==c||inBackticks?(current+=c,i++):(addCurrentSegment(),i++);if(addCurrentSegment(),inBackticks)throw new FirestoreError(Code.INVALID_ARGUMENT,"Unterminated ` in path: "+path);return new FieldPath(segments)},FieldPath.EMPTY_PATH=new FieldPath([]),FieldPath}(Path),DocumentKey=function(){function DocumentKey(path){this.path=path,assert(DocumentKey.isDocumentKey(path),"Invalid DocumentKey with an odd number of segments: "+path.toArray().join("/"))}return DocumentKey.prototype.isEqual=function(other){return null!==other&&0===ResourcePath.comparator(this.path,other.path)},DocumentKey.prototype.toString=function(){return this.path.toString()},DocumentKey.comparator=function(k1,k2){return ResourcePath.comparator(k1.path,k2.path)},DocumentKey.isDocumentKey=function(path){return 0==path.length%2},DocumentKey.fromSegments=function(segments){return new DocumentKey(new ResourcePath(segments.slice()))},DocumentKey.fromPathString=function(path){return new DocumentKey(ResourcePath.fromString(path))},DocumentKey.EMPTY=new DocumentKey(new ResourcePath([])),DocumentKey}(),MaybeDocument=function(){function MaybeDocument(key,version){this.key=key,this.version=version}return MaybeDocument.compareByKey=function(d1,d2){return DocumentKey.comparator(d1.key,d2.key)},MaybeDocument}(),Document=function(_super){function Document(key,version,data,options){var _this=_super.call(this,key,version)||this;return _this.data=data,_this.hasLocalMutations=!!options.hasLocalMutations,_this.hasCommittedMutations=!!options.hasCommittedMutations,_this}return tslib_1.__extends(Document,_super),Document.prototype.field=function(path){return this.data.field(path)},Document.prototype.fieldValue=function(path){var field=this.field(path);return field?field.value():void 0},Document.prototype.value=function(){return this.data.value()},Document.prototype.isEqual=function(other){return other instanceof Document&&this.key.isEqual(other.key)&&this.version.isEqual(other.version)&&this.data.isEqual(other.data)&&this.hasLocalMutations===other.hasLocalMutations&&this.hasCommittedMutations===other.hasCommittedMutations},Document.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.data.toString()+", "+("{hasLocalMutations: "+this.hasLocalMutations+"}), ")+("{hasCommittedMutations: "+this.hasCommittedMutations+"})")},Object.defineProperty(Document.prototype,"hasPendingWrites",{get:function(){return this.hasLocalMutations||this.hasCommittedMutations},enumerable:!0,configurable:!0}),Document.compareByField=function(field,d1,d2){var v1=d1.field(field),v2=d2.field(field);return void 0!==v1&&void 0!==v2?v1.compareTo(v2):fail("Trying to compare documents on fields that don't exist")},Document}(MaybeDocument),NoDocument=function(_super){function NoDocument(key,version,options){var _this=_super.call(this,key,version)||this;return _this.hasCommittedMutations=!!(options&&options.hasCommittedMutations),_this}return tslib_1.__extends(NoDocument,_super),NoDocument.prototype.toString=function(){return"NoDocument("+this.key+", "+this.version+")"},Object.defineProperty(NoDocument.prototype,"hasPendingWrites",{get:function(){return this.hasCommittedMutations},enumerable:!0,configurable:!0}),NoDocument.prototype.isEqual=function(other){return other instanceof NoDocument&&other.hasCommittedMutations===this.hasCommittedMutations&&other.version.isEqual(this.version)&&other.key.isEqual(this.key)},NoDocument}(MaybeDocument),UnknownDocument=function(_super){function UnknownDocument(key,version){return _super.call(this,key,version)||this}return tslib_1.__extends(UnknownDocument,_super),UnknownDocument.prototype.toString=function(){return"UnknownDocument("+this.key+", "+this.version+")"},Object.defineProperty(UnknownDocument.prototype,"hasPendingWrites",{get:function(){return!0},enumerable:!0,configurable:!0}),UnknownDocument.prototype.isEqual=function(other){return other instanceof UnknownDocument&&other.version.isEqual(this.version)&&other.key.isEqual(this.key)},UnknownDocument}(MaybeDocument),SortedMap=function(){function SortedMap(comparator,root){this.comparator=comparator,this.root=root?root:LLRBNode.EMPTY}return SortedMap.prototype.insert=function(key,value){return new SortedMap(this.comparator,this.root.insert(key,value,this.comparator).copy(null,null,LLRBNode.BLACK,null,null))},SortedMap.prototype.remove=function(key){return new SortedMap(this.comparator,this.root.remove(key,this.comparator).copy(null,null,LLRBNode.BLACK,null,null))},SortedMap.prototype.get=function(key){for(var node=this.root,cmp;!node.isEmpty();){if(cmp=this.comparator(key,node.key),0===cmp)return node.value;0>cmp?node=node.left:0<cmp&&(node=node.right)}return null},SortedMap.prototype.indexOf=function(key){for(var prunedNodes=0,node=this.root,cmp;!node.isEmpty();){if(cmp=this.comparator(key,node.key),0===cmp)return prunedNodes+node.left.size;0>cmp?node=node.left:(prunedNodes+=node.left.size+1,node=node.right)}return-1},SortedMap.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(SortedMap.prototype,"size",{get:function(){return this.root.size},enumerable:!0,configurable:!0}),SortedMap.prototype.minKey=function(){return this.root.minKey()},SortedMap.prototype.maxKey=function(){return this.root.maxKey()},SortedMap.prototype.inorderTraversal=function(action){return this.root.inorderTraversal(action)},SortedMap.prototype.forEach=function(fn){this.inorderTraversal(function(k,v){return fn(k,v),!1})},SortedMap.prototype.reverseTraversal=function(action){return this.root.reverseTraversal(action)},SortedMap.prototype.getIterator=function(){return new SortedMapIterator(this.root,null,this.comparator,!1)},SortedMap.prototype.getIteratorFrom=function(key){return new SortedMapIterator(this.root,key,this.comparator,!1)},SortedMap.prototype.getReverseIterator=function(){return new SortedMapIterator(this.root,null,this.comparator,!0)},SortedMap.prototype.getReverseIteratorFrom=function(key){return new SortedMapIterator(this.root,key,this.comparator,!0)},SortedMap}(),SortedMapIterator=function(){function SortedMapIterator(node,startKey,comparator,isReverse){this.isReverse=isReverse,this.nodeStack=[];for(var cmp=1;!node.isEmpty();)if(cmp=startKey?comparator(node.key,startKey):1,isReverse&&(cmp*=-1),0>cmp)node=this.isReverse?node.left:node.right;else if(0===cmp){this.nodeStack.push(node);break}else this.nodeStack.push(node),node=this.isReverse?node.right:node.left}return SortedMapIterator.prototype.getNext=function(){assert(0<this.nodeStack.length,"getNext() called on iterator when hasNext() is false.");var node=this.nodeStack.pop(),result={key:node.key,value:node.value};if(this.isReverse)for(node=node.left;!node.isEmpty();)this.nodeStack.push(node),node=node.right;else for(node=node.right;!node.isEmpty();)this.nodeStack.push(node),node=node.left;return result},SortedMapIterator.prototype.hasNext=function(){return 0<this.nodeStack.length},SortedMapIterator.prototype.peek=function(){if(0===this.nodeStack.length)return null;var node=this.nodeStack[this.nodeStack.length-1];return{key:node.key,value:node.value}},SortedMapIterator}(),LLRBNode=function(){function LLRBNode(key,value,color,left,right){this.key=key,this.value=value,this.color=null==color?LLRBNode.RED:color,this.left=null==left?LLRBNode.EMPTY:left,this.right=null==right?LLRBNode.EMPTY:right,this.size=this.left.size+1+this.right.size}return LLRBNode.prototype.copy=function(key,value,color,left,right){return new LLRBNode(null==key?this.key:key,null==value?this.value:value,null==color?this.color:color,null==left?this.left:left,null==right?this.right:right)},LLRBNode.prototype.isEmpty=function(){return!1},LLRBNode.prototype.inorderTraversal=function(action){return this.left.inorderTraversal(action)||action(this.key,this.value)||this.right.inorderTraversal(action)},LLRBNode.prototype.reverseTraversal=function(action){return this.right.reverseTraversal(action)||action(this.key,this.value)||this.left.reverseTraversal(action)},LLRBNode.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},LLRBNode.prototype.minKey=function(){return this.min().key},LLRBNode.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},LLRBNode.prototype.insert=function(key,value,comparator){var n=this,cmp=comparator(key,n.key);return n=0>cmp?n.copy(null,null,null,n.left.insert(key,value,comparator),null):0===cmp?n.copy(null,value,null,null,null):n.copy(null,null,null,null,n.right.insert(key,value,comparator)),n.fixUp()},LLRBNode.prototype.removeMin=function(){if(this.left.isEmpty())return LLRBNode.EMPTY;var n=this;return n.left.isRed()||n.left.left.isRed()||(n=n.moveRedLeft()),n=n.copy(null,null,null,n.left.removeMin(),null),n.fixUp()},LLRBNode.prototype.remove=function(key,comparator){var n=this,smallest;if(0>comparator(key,n.key))n.left.isEmpty()||n.left.isRed()||n.left.left.isRed()||(n=n.moveRedLeft()),n=n.copy(null,null,null,n.left.remove(key,comparator),null);else{if(n.left.isRed()&&(n=n.rotateRight()),n.right.isEmpty()||n.right.isRed()||n.right.left.isRed()||(n=n.moveRedRight()),0===comparator(key,n.key)){if(n.right.isEmpty())return LLRBNode.EMPTY;smallest=n.right.min(),n=n.copy(smallest.key,smallest.value,null,null,n.right.removeMin())}n=n.copy(null,null,null,null,n.right.remove(key,comparator))}return n.fixUp()},LLRBNode.prototype.isRed=function(){return this.color},LLRBNode.prototype.fixUp=function(){var n=this;return n.right.isRed()&&!n.left.isRed()&&(n=n.rotateLeft()),n.left.isRed()&&n.left.left.isRed()&&(n=n.rotateRight()),n.left.isRed()&&n.right.isRed()&&(n=n.colorFlip()),n},LLRBNode.prototype.moveRedLeft=function(){var n=this.colorFlip();return n.right.left.isRed()&&(n=n.copy(null,null,null,null,n.right.rotateRight()),n=n.rotateLeft(),n=n.colorFlip()),n},LLRBNode.prototype.moveRedRight=function(){var n=this.colorFlip();return n.left.left.isRed()&&(n=n.rotateRight(),n=n.colorFlip()),n},LLRBNode.prototype.rotateLeft=function(){var nl=this.copy(null,null,LLRBNode.RED,null,this.right.left);return this.right.copy(null,null,this.color,nl,null)},LLRBNode.prototype.rotateRight=function(){var nr=this.copy(null,null,LLRBNode.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,nr)},LLRBNode.prototype.colorFlip=function(){var left=this.left.copy(null,null,!this.left.color,null,null),right=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,left,right)},LLRBNode.prototype.checkMaxDepth=function(){var blackDepth=this.check();return!!(Math.pow(2,blackDepth)<=this.size+1)},LLRBNode.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw fail("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed())throw fail("Right child of ("+this.key+","+this.value+") is red");var blackDepth=this.left.check();if(blackDepth!==this.right.check())throw fail("Black depths differ");else return blackDepth+(this.isRed()?0:1)},LLRBNode.EMPTY=null,LLRBNode.RED=!0,LLRBNode.BLACK=!1,LLRBNode}(),LLRBEmptyNode=function(){function LLRBEmptyNode(){this.size=0}return LLRBEmptyNode.prototype.copy=function(){return this},LLRBEmptyNode.prototype.insert=function(key,value){return new LLRBNode(key,value)},LLRBEmptyNode.prototype.remove=function(){return this},LLRBEmptyNode.prototype.isEmpty=function(){return!0},LLRBEmptyNode.prototype.inorderTraversal=function(){return!1},LLRBEmptyNode.prototype.reverseTraversal=function(){return!1},LLRBEmptyNode.prototype.minKey=function(){return null},LLRBEmptyNode.prototype.maxKey=function(){return null},LLRBEmptyNode.prototype.isRed=function(){return!1},LLRBEmptyNode.prototype.checkMaxDepth=function(){return!0},LLRBEmptyNode.prototype.check=function(){return 0},LLRBEmptyNode}();LLRBNode.EMPTY=new LLRBEmptyNode;var TypeOrder;(function(TypeOrder){TypeOrder[TypeOrder.NullValue=0]="NullValue",TypeOrder[TypeOrder.BooleanValue=1]="BooleanValue",TypeOrder[TypeOrder.NumberValue=2]="NumberValue",TypeOrder[TypeOrder.TimestampValue=3]="TimestampValue",TypeOrder[TypeOrder.StringValue=4]="StringValue",TypeOrder[TypeOrder.BlobValue=5]="BlobValue",TypeOrder[TypeOrder.RefValue=6]="RefValue",TypeOrder[TypeOrder.GeoPointValue=7]="GeoPointValue",TypeOrder[TypeOrder.ArrayValue=8]="ArrayValue",TypeOrder[TypeOrder.ObjectValue=9]="ObjectValue"})(TypeOrder||(TypeOrder={}));var ServerTimestampBehavior;(function(ServerTimestampBehavior){ServerTimestampBehavior[ServerTimestampBehavior.Default=0]="Default",ServerTimestampBehavior[ServerTimestampBehavior.Estimate=1]="Estimate",ServerTimestampBehavior[ServerTimestampBehavior.Previous=2]="Previous"})(ServerTimestampBehavior||(ServerTimestampBehavior={}));var FieldValueOptions=function(){function FieldValueOptions(serverTimestampBehavior,timestampsInSnapshots){this.serverTimestampBehavior=serverTimestampBehavior,this.timestampsInSnapshots=timestampsInSnapshots}return FieldValueOptions.fromSnapshotOptions=function(options,timestampsInSnapshots){switch(options.serverTimestamps){case"estimate":return new FieldValueOptions(ServerTimestampBehavior.Estimate,timestampsInSnapshots);case"previous":return new FieldValueOptions(ServerTimestampBehavior.Previous,timestampsInSnapshots);case"none":case void 0:return new FieldValueOptions(ServerTimestampBehavior.Default,timestampsInSnapshots);default:return fail("fromSnapshotOptions() called with invalid options.");}},FieldValueOptions}(),FieldValue=function(){function FieldValue(){}return FieldValue.prototype.toString=function(){var val=this.value();return null===val?"null":val.toString()},FieldValue.prototype.defaultCompareTo=function(other){assert(this.typeOrder!==other.typeOrder,"Default compareTo should not be used for values of same type.");var cmp=primitiveComparator(this.typeOrder,other.typeOrder);return cmp},FieldValue}(),NullValue=function(_super){function NullValue(){var _this=_super.call(this)||this;return _this.typeOrder=TypeOrder.NullValue,_this.internalValue=null,_this}return tslib_1.__extends(NullValue,_super),NullValue.prototype.value=function(){return null},NullValue.prototype.isEqual=function(other){return other instanceof NullValue},NullValue.prototype.compareTo=function(other){return other instanceof NullValue?0:this.defaultCompareTo(other)},NullValue.INSTANCE=new NullValue,NullValue}(FieldValue),BooleanValue=function(_super){function BooleanValue(internalValue){var _this=_super.call(this)||this;return _this.internalValue=internalValue,_this.typeOrder=TypeOrder.BooleanValue,_this}return tslib_1.__extends(BooleanValue,_super),BooleanValue.prototype.value=function(){return this.internalValue},BooleanValue.prototype.isEqual=function(other){return other instanceof BooleanValue&&this.internalValue===other.internalValue},BooleanValue.prototype.compareTo=function(other){return other instanceof BooleanValue?primitiveComparator(this,other):this.defaultCompareTo(other)},BooleanValue.of=function(value){return value?BooleanValue.TRUE:BooleanValue.FALSE},BooleanValue.TRUE=new BooleanValue(!0),BooleanValue.FALSE=new BooleanValue(!1),BooleanValue}(FieldValue),NumberValue=function(_super){function NumberValue(internalValue){var _this=_super.call(this)||this;return _this.internalValue=internalValue,_this.typeOrder=TypeOrder.NumberValue,_this}return tslib_1.__extends(NumberValue,_super),NumberValue.prototype.value=function(){return this.internalValue},NumberValue.prototype.compareTo=function(other){return other instanceof NumberValue?numericComparator(this.internalValue,other.internalValue):this.defaultCompareTo(other)},NumberValue}(FieldValue),IntegerValue=function(_super){function IntegerValue(internalValue){return _super.call(this,internalValue)||this}return tslib_1.__extends(IntegerValue,_super),IntegerValue.prototype.isEqual=function(other){return!!(other instanceof IntegerValue)&&numericEquals(this.internalValue,other.internalValue)},IntegerValue}(NumberValue),DoubleValue=function(_super){function DoubleValue(internalValue){var _this=_super.call(this,internalValue)||this;return _this.internalValue=internalValue,_this}return tslib_1.__extends(DoubleValue,_super),DoubleValue.prototype.isEqual=function(other){return!!(other instanceof DoubleValue)&&numericEquals(this.internalValue,other.internalValue)},DoubleValue.NAN=new DoubleValue(NaN),DoubleValue.POSITIVE_INFINITY=new DoubleValue(Infinity),DoubleValue.NEGATIVE_INFINITY=new DoubleValue(-Infinity),DoubleValue}(NumberValue),StringValue=function(_super){function StringValue(internalValue){var _this=_super.call(this)||this;return _this.internalValue=internalValue,_this.typeOrder=TypeOrder.StringValue,_this}return tslib_1.__extends(StringValue,_super),StringValue.prototype.value=function(){return this.internalValue},StringValue.prototype.isEqual=function(other){return other instanceof StringValue&&this.internalValue===other.internalValue},StringValue.prototype.compareTo=function(other){return other instanceof StringValue?primitiveComparator(this.internalValue,other.internalValue):this.defaultCompareTo(other)},StringValue}(FieldValue),TimestampValue=function(_super){function TimestampValue(internalValue){var _this=_super.call(this)||this;return _this.internalValue=internalValue,_this.typeOrder=TypeOrder.TimestampValue,_this}return tslib_1.__extends(TimestampValue,_super),TimestampValue.prototype.value=function(options){return options&&options.timestampsInSnapshots?this.internalValue:this.internalValue.toDate()},TimestampValue.prototype.isEqual=function(other){return other instanceof TimestampValue&&this.internalValue.isEqual(other.internalValue)},TimestampValue.prototype.compareTo=function(other){return other instanceof TimestampValue?this.internalValue._compareTo(other.internalValue):other instanceof ServerTimestampValue?-1:this.defaultCompareTo(other)},TimestampValue}(FieldValue),ServerTimestampValue=function(_super){function ServerTimestampValue(localWriteTime,previousValue){var _this=_super.call(this)||this;return _this.localWriteTime=localWriteTime,_this.previousValue=previousValue,_this.typeOrder=TypeOrder.TimestampValue,_this}return tslib_1.__extends(ServerTimestampValue,_super),ServerTimestampValue.prototype.value=function(options){return options&&options.serverTimestampBehavior===ServerTimestampBehavior.Estimate?new TimestampValue(this.localWriteTime).value(options):options&&options.serverTimestampBehavior===ServerTimestampBehavior.Previous?this.previousValue?this.previousValue.value(options):null:null},ServerTimestampValue.prototype.isEqual=function(other){return other instanceof ServerTimestampValue&&this.localWriteTime.isEqual(other.localWriteTime)},ServerTimestampValue.prototype.compareTo=function(other){return other instanceof ServerTimestampValue?this.localWriteTime._compareTo(other.localWriteTime):other instanceof TimestampValue?1:this.defaultCompareTo(other)},ServerTimestampValue.prototype.toString=function(){return"<ServerTimestamp localTime="+this.localWriteTime.toString()+">"},ServerTimestampValue}(FieldValue),BlobValue=function(_super){function BlobValue(internalValue){var _this=_super.call(this)||this;return _this.internalValue=internalValue,_this.typeOrder=TypeOrder.BlobValue,_this}return tslib_1.__extends(BlobValue,_super),BlobValue.prototype.value=function(){return this.internalValue},BlobValue.prototype.isEqual=function(other){return other instanceof BlobValue&&this.internalValue.isEqual(other.internalValue)},BlobValue.prototype.compareTo=function(other){return other instanceof BlobValue?this.internalValue._compareTo(other.internalValue):this.defaultCompareTo(other)},BlobValue}(FieldValue),RefValue=function(_super){function RefValue(databaseId,key){var _this=_super.call(this)||this;return _this.databaseId=databaseId,_this.key=key,_this.typeOrder=TypeOrder.RefValue,_this}return tslib_1.__extends(RefValue,_super),RefValue.prototype.value=function(){return this.key},RefValue.prototype.isEqual=function(other){return!!(other instanceof RefValue)&&this.key.isEqual(other.key)&&this.databaseId.isEqual(other.databaseId)},RefValue.prototype.compareTo=function(other){if(other instanceof RefValue){var cmp=this.databaseId.compareTo(other.databaseId);return 0===cmp?DocumentKey.comparator(this.key,other.key):cmp}return this.defaultCompareTo(other)},RefValue}(FieldValue),GeoPointValue=function(_super){function GeoPointValue(internalValue){var _this=_super.call(this)||this;return _this.internalValue=internalValue,_this.typeOrder=TypeOrder.GeoPointValue,_this}return tslib_1.__extends(GeoPointValue,_super),GeoPointValue.prototype.value=function(){return this.internalValue},GeoPointValue.prototype.isEqual=function(other){return other instanceof GeoPointValue&&this.internalValue.isEqual(other.internalValue)},GeoPointValue.prototype.compareTo=function(other){return other instanceof GeoPointValue?this.internalValue._compareTo(other.internalValue):this.defaultCompareTo(other)},GeoPointValue}(FieldValue),ObjectValue=function(_super){function ObjectValue(internalValue){var _this=_super.call(this)||this;return _this.internalValue=internalValue,_this.typeOrder=TypeOrder.ObjectValue,_this}return tslib_1.__extends(ObjectValue,_super),ObjectValue.prototype.value=function(options){var result={};return this.internalValue.inorderTraversal(function(key,val){result[key]=val.value(options)}),result},ObjectValue.prototype.forEach=function(action){this.internalValue.inorderTraversal(action)},ObjectValue.prototype.isEqual=function(other){if(other instanceof ObjectValue){for(var it1=this.internalValue.getIterator(),it2=other.internalValue.getIterator();it1.hasNext()&&it2.hasNext();){var next1=it1.getNext(),next2=it2.getNext();if(next1.key!==next2.key||!next1.value.isEqual(next2.value))return!1}return!it1.hasNext()&&!it2.hasNext()}return!1},ObjectValue.prototype.compareTo=function(other){if(other instanceof ObjectValue){for(var it1=this.internalValue.getIterator(),it2=other.internalValue.getIterator();it1.hasNext()&&it2.hasNext();){var next1=it1.getNext(),next2=it2.getNext(),cmp=primitiveComparator(next1.key,next2.key)||next1.value.compareTo(next2.value);if(cmp)return cmp}return primitiveComparator(it1.hasNext(),it2.hasNext())}return this.defaultCompareTo(other)},ObjectValue.prototype.set=function(path,to){if(assert(!path.isEmpty(),"Cannot set field for empty path on ObjectValue"),1===path.length)return this.setChild(path.firstSegment(),to);var child=this.child(path.firstSegment());child instanceof ObjectValue||(child=ObjectValue.EMPTY);var newChild=child.set(path.popFirst(),to);return this.setChild(path.firstSegment(),newChild)},ObjectValue.prototype.delete=function(path){if(assert(!path.isEmpty(),"Cannot delete field for empty path on ObjectValue"),1===path.length)return new ObjectValue(this.internalValue.remove(path.firstSegment()));var child=this.child(path.firstSegment());if(child instanceof ObjectValue){var newChild=child.delete(path.popFirst());return new ObjectValue(this.internalValue.insert(path.firstSegment(),newChild))}return this},ObjectValue.prototype.contains=function(path){return void 0!==this.field(path)},ObjectValue.prototype.field=function(path){assert(!path.isEmpty(),"Can't get field of empty path");var field=this;return path.forEach(function(pathSegment){field=field instanceof ObjectValue?field.internalValue.get(pathSegment)||void 0:void 0}),field},ObjectValue.prototype.toString=function(){return JSON.stringify(this.value())},ObjectValue.prototype.child=function(childName){return this.internalValue.get(childName)||void 0},ObjectValue.prototype.setChild=function(childName,value){return new ObjectValue(this.internalValue.insert(childName,value))},ObjectValue.EMPTY=new ObjectValue(new SortedMap(primitiveComparator)),ObjectValue}(FieldValue),ArrayValue=function(_super){function ArrayValue(internalValue){var _this=_super.call(this)||this;return _this.internalValue=internalValue,_this.typeOrder=TypeOrder.ArrayValue,_this}return tslib_1.__extends(ArrayValue,_super),ArrayValue.prototype.value=function(options){return this.internalValue.map(function(v){return v.value(options)})},ArrayValue.prototype.forEach=function(action){this.internalValue.forEach(action)},ArrayValue.prototype.isEqual=function(other){if(other instanceof ArrayValue){if(this.internalValue.length!==other.internalValue.length)return!1;for(var i=0;i<this.internalValue.length;i++)if(!this.internalValue[i].isEqual(other.internalValue[i]))return!1;return!0}return!1},ArrayValue.prototype.compareTo=function(other){if(other instanceof ArrayValue){for(var minLength=_Mathmin5(this.internalValue.length,other.internalValue.length),i=0,cmp;i<minLength;i++)if(cmp=this.internalValue[i].compareTo(other.internalValue[i]),cmp)return cmp;return primitiveComparator(this.internalValue.length,other.internalValue.length)}return this.defaultCompareTo(other)},ArrayValue.prototype.toString=function(){return JSON.stringify(this.value())},ArrayValue}(FieldValue),NumberAsAny=Number,MIN_SAFE_INTEGER=NumberAsAny.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER=NumberAsAny.MAX_SAFE_INTEGER||9007199254740991,isInteger=NumberAsAny.isInteger||function(value){return"number"==typeof value&&isFinite(value)&&_Mathfloor3(value)===value},Query=function(){function Query(path,explicitOrderBy,filters,limit,startAt,endAt){void 0===explicitOrderBy&&(explicitOrderBy=[]),void 0===filters&&(filters=[]),void 0===limit&&(limit=null),void 0===startAt&&(startAt=null),void 0===endAt&&(endAt=null),this.path=path,this.explicitOrderBy=explicitOrderBy,this.filters=filters,this.limit=limit,this.startAt=startAt,this.endAt=endAt,this.memoizedCanonicalId=null,this.memoizedOrderBy=null,this.startAt&&this.assertValidBound(this.startAt),this.endAt&&this.assertValidBound(this.endAt)}return Query.atPath=function(path){return new Query(path)},Object.defineProperty(Query.prototype,"orderBy",{get:function(){if(null===this.memoizedOrderBy){var inequalityField=this.getInequalityFilterField(),firstOrderByField=this.getFirstOrderByField();if(null!==inequalityField&&null===firstOrderByField)this.memoizedOrderBy=inequalityField.isKeyField()?[KEY_ORDERING_ASC]:[new OrderBy(inequalityField),KEY_ORDERING_ASC];else{assert(null===inequalityField||null!==firstOrderByField&&inequalityField.isEqual(firstOrderByField),"First orderBy should match inequality field."),this.memoizedOrderBy=[];for(var foundKeyOrdering=!1,_i=0,_a=this.explicitOrderBy,orderBy;_i<_a.length;_i++)orderBy=_a[_i],this.memoizedOrderBy.push(orderBy),orderBy.field.isKeyField()&&(foundKeyOrdering=!0);if(!foundKeyOrdering){var lastDirection=0<this.explicitOrderBy.length?this.explicitOrderBy[this.explicitOrderBy.length-1].dir:Direction.ASCENDING;this.memoizedOrderBy.push(lastDirection===Direction.ASCENDING?KEY_ORDERING_ASC:KEY_ORDERING_DESC)}}}return this.memoizedOrderBy},enumerable:!0,configurable:!0}),Query.prototype.addFilter=function(filter){assert(null==this.getInequalityFilterField()||!(filter instanceof RelationFilter)||!filter.isInequality()||filter.field.isEqual(this.getInequalityFilterField()),"Query must only have one inequality field."),assert(!DocumentKey.isDocumentKey(this.path),"No filtering allowed for document query");var newFilters=this.filters.concat([filter]);return new Query(this.path,this.explicitOrderBy.slice(),newFilters,this.limit,this.startAt,this.endAt)},Query.prototype.addOrderBy=function(orderBy){assert(!DocumentKey.isDocumentKey(this.path),"No ordering allowed for document query"),assert(!this.startAt&&!this.endAt,"Bounds must be set after orderBy");var newOrderBy=this.explicitOrderBy.concat([orderBy]);return new Query(this.path,newOrderBy,this.filters.slice(),this.limit,this.startAt,this.endAt)},Query.prototype.withLimit=function(limit){return new Query(this.path,this.explicitOrderBy.slice(),this.filters.slice(),limit,this.startAt,this.endAt)},Query.prototype.withStartAt=function(bound){return new Query(this.path,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,bound,this.endAt)},Query.prototype.withEndAt=function(bound){return new Query(this.path,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,this.startAt,bound)},Query.prototype.canonicalId=function(){if(null===this.memoizedCanonicalId){var canonicalId=this.path.canonicalString();canonicalId+="|f:";for(var _i=0,_a=this.filters,filter;_i<_a.length;_i++)filter=_a[_i],canonicalId+=filter.canonicalId(),canonicalId+=",";canonicalId+="|ob:";for(var _b=0,_c=this.orderBy,orderBy;_b<_c.length;_b++)orderBy=_c[_b],canonicalId+=orderBy.canonicalId(),canonicalId+=",";isNullOrUndefined(this.limit)||(canonicalId+="|l:",canonicalId+=this.limit),this.startAt&&(canonicalId+="|lb:",canonicalId+=this.startAt.canonicalId()),this.endAt&&(canonicalId+="|ub:",canonicalId+=this.endAt.canonicalId()),this.memoizedCanonicalId=canonicalId}return this.memoizedCanonicalId},Query.prototype.toString=function(){var str="Query("+this.path.canonicalString();return 0<this.filters.length&&(str+=", filters: ["+this.filters.join(", ")+"]"),isNullOrUndefined(this.limit)||(str+=", limit: "+this.limit),0<this.explicitOrderBy.length&&(str+=", orderBy: ["+this.explicitOrderBy.join(", ")+"]"),this.startAt&&(str+=", startAt: "+this.startAt.canonicalId()),this.endAt&&(str+=", endAt: "+this.endAt.canonicalId()),str+")"},Query.prototype.isEqual=function(other){if(this.limit!==other.limit)return!1;if(this.orderBy.length!==other.orderBy.length)return!1;for(var i=0;i<this.orderBy.length;i++)if(!this.orderBy[i].isEqual(other.orderBy[i]))return!1;if(this.filters.length!==other.filters.length)return!1;for(var i=0;i<this.filters.length;i++)if(!this.filters[i].isEqual(other.filters[i]))return!1;return!!this.path.isEqual(other.path)&&(null===this.startAt?null===other.startAt:!!this.startAt.isEqual(other.startAt))&&(null===this.endAt?null===other.endAt:this.endAt.isEqual(other.endAt))},Query.prototype.docComparator=function(d1,d2){for(var comparedOnKeyField=!1,_i=0,_a=this.orderBy;_i<_a.length;_i++){var orderBy=_a[_i],comp=orderBy.compare(d1,d2);if(0!==comp)return comp;comparedOnKeyField=comparedOnKeyField||orderBy.field.isKeyField()}return assert(comparedOnKeyField,"orderBy used that doesn't compare on key field"),0},Query.prototype.matches=function(doc){return this.matchesAncestor(doc)&&this.matchesOrderBy(doc)&&this.matchesFilters(doc)&&this.matchesBounds(doc)},Query.prototype.hasLimit=function(){return!isNullOrUndefined(this.limit)},Query.prototype.getFirstOrderByField=function(){return 0<this.explicitOrderBy.length?this.explicitOrderBy[0].field:null},Query.prototype.getInequalityFilterField=function(){for(var _i=0,_a=this.filters,filter;_i<_a.length;_i++)if(filter=_a[_i],filter instanceof RelationFilter&&filter.isInequality())return filter.field;return null},Query.prototype.hasArrayContainsFilter=function(){return void 0!==this.filters.find(function(filter){return filter instanceof RelationFilter&&filter.op===RelationOp.ARRAY_CONTAINS})},Query.prototype.isDocumentQuery=function(){return DocumentKey.isDocumentKey(this.path)&&0===this.filters.length},Query.prototype.matchesAncestor=function(doc){var docPath=doc.key.path;return DocumentKey.isDocumentKey(this.path)?this.path.isEqual(docPath):this.path.isPrefixOf(docPath)&&this.path.length===docPath.length-1},Query.prototype.matchesOrderBy=function(doc){for(var _i=0,_a=this.explicitOrderBy,orderBy;_i<_a.length;_i++)if(orderBy=_a[_i],!orderBy.field.isKeyField()&&void 0===doc.field(orderBy.field))return!1;return!0},Query.prototype.matchesFilters=function(doc){for(var _i=0,_a=this.filters,filter;_i<_a.length;_i++)if(filter=_a[_i],!filter.matches(doc))return!1;return!0},Query.prototype.matchesBounds=function(doc){return this.startAt&&!this.startAt.sortsBeforeDocument(this.orderBy,doc)?!1:this.endAt&&this.endAt.sortsBeforeDocument(this.orderBy,doc)?!1:!0},Query.prototype.assertValidBound=function(bound){assert(bound.position.length<=this.orderBy.length,"Bound is longer than orderBy")},Query}(),Filter=function(){function Filter(){}return Filter.create=function(field,op,value){if(value.isEqual(NullValue.INSTANCE)){if(op!==RelationOp.EQUAL)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on null.");return new NullFilter(field)}if(value.isEqual(DoubleValue.NAN)){if(op!==RelationOp.EQUAL)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on NaN.");return new NanFilter(field)}return new RelationFilter(field,op,value)},Filter}(),RelationOp=function(){function RelationOp(name){this.name=name}return RelationOp.fromString=function(op){return"<"===op?RelationOp.LESS_THAN:"<="===op?RelationOp.LESS_THAN_OR_EQUAL:"=="===op?RelationOp.EQUAL:">="===op?RelationOp.GREATER_THAN_OR_EQUAL:">"===op?RelationOp.GREATER_THAN:"array-contains"===op?RelationOp.ARRAY_CONTAINS:fail("Unknown relation: "+op)},RelationOp.prototype.toString=function(){return this.name},RelationOp.prototype.isEqual=function(other){return this.name===other.name},RelationOp.LESS_THAN=new RelationOp("<"),RelationOp.LESS_THAN_OR_EQUAL=new RelationOp("<="),RelationOp.EQUAL=new RelationOp("=="),RelationOp.GREATER_THAN=new RelationOp(">"),RelationOp.GREATER_THAN_OR_EQUAL=new RelationOp(">="),RelationOp.ARRAY_CONTAINS=new RelationOp("array-contains"),RelationOp}(),RelationFilter=function(_super){function RelationFilter(field,op,value){var _this=_super.call(this)||this;return _this.field=field,_this.op=op,_this.value=value,_this}return tslib_1.__extends(RelationFilter,_super),RelationFilter.prototype.matches=function(doc){if(this.field.isKeyField()){assert(this.value instanceof RefValue,"Comparing on key, but filter value not a RefValue"),assert(this.op!==RelationOp.ARRAY_CONTAINS,"array-contains queries don't make sense on document keys.");var refValue=this.value,comparison=DocumentKey.comparator(doc.key,refValue.key);return this.matchesComparison(comparison)}var val=doc.field(this.field);return void 0!==val&&this.matchesValue(val)},RelationFilter.prototype.matchesValue=function(value){var _this=this;return this.op===RelationOp.ARRAY_CONTAINS?value instanceof ArrayValue&&void 0!==value.internalValue.find(function(element){return element.isEqual(_this.value)}):this.value.typeOrder===value.typeOrder&&this.matchesComparison(value.compareTo(this.value))},RelationFilter.prototype.matchesComparison=function(comparison){switch(this.op){case RelationOp.LESS_THAN:return 0>comparison;case RelationOp.LESS_THAN_OR_EQUAL:return 0>=comparison;case RelationOp.EQUAL:return 0===comparison;case RelationOp.GREATER_THAN:return 0<comparison;case RelationOp.GREATER_THAN_OR_EQUAL:return 0<=comparison;default:return fail("Unknown relation op"+this.op);}},RelationFilter.prototype.isInequality=function(){return this.op!==RelationOp.EQUAL&&this.op!==RelationOp.ARRAY_CONTAINS},RelationFilter.prototype.canonicalId=function(){return this.field.canonicalString()+this.op.toString()+this.value.toString()},RelationFilter.prototype.isEqual=function(other){return!!(other instanceof RelationFilter)&&this.op.isEqual(other.op)&&this.field.isEqual(other.field)&&this.value.isEqual(other.value)},RelationFilter.prototype.toString=function(){return this.field.canonicalString()+" "+this.op+" "+this.value.value()},RelationFilter}(Filter),NullFilter=function(_super){function NullFilter(field){var _this=_super.call(this)||this;return _this.field=field,_this}return tslib_1.__extends(NullFilter,_super),NullFilter.prototype.matches=function(doc){var val=doc.field(this.field);return void 0!==val&&null===val.value()},NullFilter.prototype.canonicalId=function(){return this.field.canonicalString()+" IS null"},NullFilter.prototype.toString=function(){return this.field.canonicalString()+" IS null"},NullFilter.prototype.isEqual=function(other){return!!(other instanceof NullFilter)&&this.field.isEqual(other.field)},NullFilter}(Filter),NanFilter=function(_super){function NanFilter(field){var _this=_super.call(this)||this;return _this.field=field,_this}return tslib_1.__extends(NanFilter,_super),NanFilter.prototype.matches=function(doc){var field=doc.field(this.field),val=field&&field.value();return"number"==typeof val&&isNaN(val)},NanFilter.prototype.canonicalId=function(){return this.field.canonicalString()+" IS NaN"},NanFilter.prototype.toString=function(){return this.field.canonicalString()+" IS NaN"},NanFilter.prototype.isEqual=function(other){return!!(other instanceof NanFilter)&&this.field.isEqual(other.field)},NanFilter}(Filter),Direction=function(){function Direction(name){this.name=name}return Direction.prototype.toString=function(){return this.name},Direction.ASCENDING=new Direction("asc"),Direction.DESCENDING=new Direction("desc"),Direction}(),Bound=function(){function Bound(position,before){this.position=position,this.before=before}return Bound.prototype.canonicalId=function(){for(var canonicalId=this.before?"b:":"a:",_i=0,_a=this.position,component;_i<_a.length;_i++)component=_a[_i],canonicalId+=component.toString();return canonicalId},Bound.prototype.sortsBeforeDocument=function(orderBy,doc){assert(this.position.length<=orderBy.length,"Bound has more components than query's orderBy");for(var comparison=0,i=0;i<this.position.length;i++){var orderByComponent=orderBy[i],component=this.position[i];if(orderByComponent.field.isKeyField())assert(component instanceof RefValue,"Bound has a non-key value where the key path is being used."),comparison=DocumentKey.comparator(component.key,doc.key);else{var docValue=doc.field(orderByComponent.field);assert(void 0!==docValue,"Field should exist since document matched the orderBy already."),comparison=component.compareTo(docValue)}if(orderByComponent.dir===Direction.DESCENDING&&(comparison*=-1),0!==comparison)break}return this.before?0>=comparison:0>comparison},Bound.prototype.isEqual=function(other){if(null===other)return!1;if(this.before!==other.before||this.position.length!==other.position.length)return!1;for(var i=0;i<this.position.length;i++){var thisPosition=this.position[i],otherPosition=other.position[i];return thisPosition.isEqual(otherPosition)}return!0},Bound}(),OrderBy=function(){function OrderBy(field,dir){this.field=field,void 0===dir&&(dir=Direction.ASCENDING),this.dir=dir,this.isKeyOrderBy=field.isKeyField()}return OrderBy.prototype.compare=function(d1,d2){var comparison=this.isKeyOrderBy?Document.compareByKey(d1,d2):Document.compareByField(this.field,d1,d2);switch(this.dir){case Direction.ASCENDING:return comparison;case Direction.DESCENDING:return-1*comparison;default:return fail("Unknown direction: "+this.dir);}},OrderBy.prototype.canonicalId=function(){return this.field.canonicalString()+this.dir.toString()},OrderBy.prototype.toString=function(){return this.field.canonicalString()+" ("+this.dir+")"},OrderBy.prototype.isEqual=function(other){return this.dir===other.dir&&this.field.isEqual(other.field)},OrderBy}(),KEY_ORDERING_ASC=new OrderBy(FieldPath.keyField(),Direction.ASCENDING),KEY_ORDERING_DESC=new OrderBy(FieldPath.keyField(),Direction.DESCENDING),SnapshotVersion=function(){function SnapshotVersion(timestamp){this.timestamp=timestamp}return SnapshotVersion.fromMicroseconds=function(value){var seconds=_Mathfloor3(value/1e6);return new SnapshotVersion(new Timestamp(seconds,1e3*(value%1e6)))},SnapshotVersion.fromTimestamp=function(value){return new SnapshotVersion(value)},SnapshotVersion.forDeletedDoc=function(){return SnapshotVersion.MIN},SnapshotVersion.prototype.compareTo=function(other){return this.timestamp._compareTo(other.timestamp)},SnapshotVersion.prototype.isEqual=function(other){return this.timestamp.isEqual(other.timestamp)},SnapshotVersion.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},SnapshotVersion.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},SnapshotVersion.prototype.toTimestamp=function(){return this.timestamp},SnapshotVersion.MIN=new SnapshotVersion(new Timestamp(0,0)),SnapshotVersion}(),QueryPurpose;(function(QueryPurpose){QueryPurpose[QueryPurpose.Listen=0]="Listen",QueryPurpose[QueryPurpose.ExistenceFilterMismatch=1]="ExistenceFilterMismatch",QueryPurpose[QueryPurpose.LimboResolution=2]="LimboResolution"})(QueryPurpose||(QueryPurpose={}));var QueryData=function(){function QueryData(query,targetId,purpose,sequenceNumber,snapshotVersion,resumeToken){void 0===snapshotVersion&&(snapshotVersion=SnapshotVersion.MIN),void 0===resumeToken&&(resumeToken=emptyByteString()),this.query=query,this.targetId=targetId,this.purpose=purpose,this.sequenceNumber=sequenceNumber,this.snapshotVersion=snapshotVersion,this.resumeToken=resumeToken}return QueryData.prototype.copy=function(overwrite){return new QueryData(this.query,this.targetId,this.purpose,void 0===overwrite.sequenceNumber?this.sequenceNumber:overwrite.sequenceNumber,void 0===overwrite.snapshotVersion?this.snapshotVersion:overwrite.snapshotVersion,void 0===overwrite.resumeToken?this.resumeToken:overwrite.resumeToken)},QueryData.prototype.isEqual=function(other){return this.targetId===other.targetId&&this.purpose===other.purpose&&this.sequenceNumber===other.sequenceNumber&&this.snapshotVersion.isEqual(other.snapshotVersion)&&this.resumeToken===other.resumeToken&&this.query.isEqual(other.query)},QueryData}(),FieldMask=function(){function FieldMask(fields){this.fields=fields}return FieldMask.prototype.covers=function(fieldPath){for(var _i=0,_a=this.fields,fieldMaskPath;_i<_a.length;_i++)if(fieldMaskPath=_a[_i],fieldMaskPath.isPrefixOf(fieldPath))return!0;return!1},FieldMask.prototype.isEqual=function(other){return arrayEquals(this.fields,other.fields)},FieldMask}(),FieldTransform=function(){function FieldTransform(field,transform){this.field=field,this.transform=transform}return FieldTransform.prototype.isEqual=function(other){return this.field.isEqual(other.field)&&this.transform.isEqual(other.transform)},FieldTransform}(),MutationResult=function(){return function(version,transformResults){this.version=version,this.transformResults=transformResults}}(),MutationType;(function(MutationType){MutationType[MutationType.Set=0]="Set",MutationType[MutationType.Patch=1]="Patch",MutationType[MutationType.Transform=2]="Transform",MutationType[MutationType.Delete=3]="Delete"})(MutationType||(MutationType={}));var Precondition=function(){function Precondition(updateTime,exists){this.updateTime=updateTime,this.exists=exists,assert(void 0===updateTime||void 0===exists,"Precondition can specify \"exists\" or \"updateTime\" but not both")}return Precondition.exists=function(exists){return new Precondition(void 0,exists)},Precondition.updateTime=function(version){return new Precondition(version)},Object.defineProperty(Precondition.prototype,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!0,configurable:!0}),Precondition.prototype.isValidFor=function(maybeDoc){return void 0===this.updateTime?void 0===this.exists?(assert(this.isNone,"Precondition should be empty"),!0):this.exists===maybeDoc instanceof Document:maybeDoc instanceof Document&&maybeDoc.version.isEqual(this.updateTime)},Precondition.prototype.isEqual=function(other){return equals(this.updateTime,other.updateTime)&&this.exists===other.exists},Precondition.NONE=new Precondition,Precondition}(),Mutation=function(){function Mutation(){}return Mutation.prototype.verifyKeyMatches=function(maybeDoc){null!=maybeDoc&&assert(maybeDoc.key.isEqual(this.key),"Can only apply a mutation to a document with the same key")},Mutation.getPostMutationVersion=function(maybeDoc){return maybeDoc instanceof Document?maybeDoc.version:SnapshotVersion.MIN},Mutation}(),SetMutation=function(_super){function SetMutation(key,value,precondition){var _this=_super.call(this)||this;return _this.key=key,_this.value=value,_this.precondition=precondition,_this.type=MutationType.Set,_this}return tslib_1.__extends(SetMutation,_super),SetMutation.prototype.applyToRemoteDocument=function(maybeDoc,mutationResult){this.verifyKeyMatches(maybeDoc),assert(null==mutationResult.transformResults,"Transform results received by SetMutation.");var version=mutationResult.version;return new Document(this.key,version,this.value,{hasCommittedMutations:!0})},SetMutation.prototype.applyToLocalView=function(maybeDoc){if(this.verifyKeyMatches(maybeDoc),!this.precondition.isValidFor(maybeDoc))return maybeDoc;var version=Mutation.getPostMutationVersion(maybeDoc);return new Document(this.key,version,this.value,{hasLocalMutations:!0})},SetMutation.prototype.isEqual=function(other){return other instanceof SetMutation&&this.key.isEqual(other.key)&&this.value.isEqual(other.value)&&this.precondition.isEqual(other.precondition)},SetMutation}(Mutation),PatchMutation=function(_super){function PatchMutation(key,data,fieldMask,precondition){var _this=_super.call(this)||this;return _this.key=key,_this.data=data,_this.fieldMask=fieldMask,_this.precondition=precondition,_this.type=MutationType.Patch,_this}return tslib_1.__extends(PatchMutation,_super),PatchMutation.prototype.applyToRemoteDocument=function(maybeDoc,mutationResult){if(this.verifyKeyMatches(maybeDoc),assert(null==mutationResult.transformResults,"Transform results received by PatchMutation."),!this.precondition.isValidFor(maybeDoc))return new UnknownDocument(this.key,mutationResult.version);var newData=this.patchDocument(maybeDoc);return new Document(this.key,mutationResult.version,newData,{hasCommittedMutations:!0})},PatchMutation.prototype.applyToLocalView=function(maybeDoc){if(this.verifyKeyMatches(maybeDoc),!this.precondition.isValidFor(maybeDoc))return maybeDoc;var version=Mutation.getPostMutationVersion(maybeDoc),newData=this.patchDocument(maybeDoc);return new Document(this.key,version,newData,{hasLocalMutations:!0})},PatchMutation.prototype.isEqual=function(other){return other instanceof PatchMutation&&this.key.isEqual(other.key)&&this.fieldMask.isEqual(other.fieldMask)&&this.precondition.isEqual(other.precondition)},PatchMutation.prototype.patchDocument=function(maybeDoc){var data;return data=maybeDoc instanceof Document?maybeDoc.data:ObjectValue.EMPTY,this.patchObject(data)},PatchMutation.prototype.patchObject=function(data){for(var _i=0,_a=this.fieldMask.fields,fieldPath;_i<_a.length;_i++)if(fieldPath=_a[_i],!fieldPath.isEmpty()){var newValue=this.data.field(fieldPath);data=void 0===newValue?data.delete(fieldPath):data.set(fieldPath,newValue)}return data},PatchMutation}(Mutation),TransformMutation=function(_super){function TransformMutation(key,fieldTransforms){var _this=_super.call(this)||this;return _this.key=key,_this.fieldTransforms=fieldTransforms,_this.type=MutationType.Transform,_this.precondition=Precondition.exists(!0),_this}return tslib_1.__extends(TransformMutation,_super),TransformMutation.prototype.applyToRemoteDocument=function(maybeDoc,mutationResult){if(this.verifyKeyMatches(maybeDoc),assert(null!=mutationResult.transformResults,"Transform results missing for TransformMutation."),!this.precondition.isValidFor(maybeDoc))return new UnknownDocument(this.key,mutationResult.version);var doc=this.requireDocument(maybeDoc),transformResults=this.serverTransformResults(maybeDoc,mutationResult.transformResults),version=mutationResult.version,newData=this.transformObject(doc.data,transformResults);return new Document(this.key,version,newData,{hasCommittedMutations:!0})},TransformMutation.prototype.applyToLocalView=function(maybeDoc,baseDoc,localWriteTime){if(this.verifyKeyMatches(maybeDoc),!this.precondition.isValidFor(maybeDoc))return maybeDoc;var doc=this.requireDocument(maybeDoc),transformResults=this.localTransformResults(localWriteTime,baseDoc),newData=this.transformObject(doc.data,transformResults);return new Document(this.key,doc.version,newData,{hasLocalMutations:!0})},TransformMutation.prototype.isEqual=function(other){return other instanceof TransformMutation&&this.key.isEqual(other.key)&&arrayEquals(this.fieldTransforms,other.fieldTransforms)&&this.precondition.isEqual(other.precondition)},TransformMutation.prototype.requireDocument=function(maybeDoc){assert(maybeDoc instanceof Document,"Unknown MaybeDocument type "+maybeDoc);var doc=maybeDoc;return assert(doc.key.isEqual(this.key),"Can only transform a document with the same key"),doc},TransformMutation.prototype.serverTransformResults=function(baseDoc,serverTransformResults){var transformResults=[];assert(this.fieldTransforms.length===serverTransformResults.length,"server transform result count ("+serverTransformResults.length+") "+("should match field transform count ("+this.fieldTransforms.length+")"));for(var i=0;i<serverTransformResults.length;i++){var fieldTransform=this.fieldTransforms[i],transform=fieldTransform.transform,previousValue=null;baseDoc instanceof Document&&(previousValue=baseDoc.field(fieldTransform.field)||null),transformResults.push(transform.applyToRemoteDocument(previousValue,serverTransformResults[i]))}return transformResults},TransformMutation.prototype.localTransformResults=function(localWriteTime,baseDoc){for(var transformResults=[],_i=0,_a=this.fieldTransforms;_i<_a.length;_i++){var fieldTransform=_a[_i],transform=fieldTransform.transform,previousValue=null;baseDoc instanceof Document&&(previousValue=baseDoc.field(fieldTransform.field)||null),transformResults.push(transform.applyToLocalView(previousValue,localWriteTime))}return transformResults},TransformMutation.prototype.transformObject=function(data,transformResults){assert(transformResults.length===this.fieldTransforms.length,"TransformResults length mismatch.");for(var i=0;i<this.fieldTransforms.length;i++){var fieldTransform=this.fieldTransforms[i],fieldPath=fieldTransform.field;data=data.set(fieldPath,transformResults[i])}return data},TransformMutation}(Mutation),DeleteMutation=function(_super){function DeleteMutation(key,precondition){var _this=_super.call(this)||this;return _this.key=key,_this.precondition=precondition,_this.type=MutationType.Delete,_this}return tslib_1.__extends(DeleteMutation,_super),DeleteMutation.prototype.applyToRemoteDocument=function(maybeDoc,mutationResult){return this.verifyKeyMatches(maybeDoc),assert(null==mutationResult.transformResults,"Transform results received by DeleteMutation."),new NoDocument(this.key,mutationResult.version,{hasCommittedMutations:!0})},DeleteMutation.prototype.applyToLocalView=function(maybeDoc){return(this.verifyKeyMatches(maybeDoc),!this.precondition.isValidFor(maybeDoc))?maybeDoc:(maybeDoc&&assert(maybeDoc.key.isEqual(this.key),"Can only apply mutation to document with same key"),new NoDocument(this.key,SnapshotVersion.forDeletedDoc()))},DeleteMutation.prototype.isEqual=function(other){return other instanceof DeleteMutation&&this.key.isEqual(other.key)&&this.precondition.isEqual(other.precondition)},DeleteMutation}(Mutation),ServerTimestampTransform=function(){function ServerTimestampTransform(){}return ServerTimestampTransform.prototype.applyToLocalView=function(previousValue,localWriteTime){return new ServerTimestampValue(localWriteTime,previousValue)},ServerTimestampTransform.prototype.applyToRemoteDocument=function(previousValue,transformResult){return transformResult},ServerTimestampTransform.prototype.isEqual=function(other){return other instanceof ServerTimestampTransform},ServerTimestampTransform.instance=new ServerTimestampTransform,ServerTimestampTransform}(),ArrayUnionTransformOperation=function(){function ArrayUnionTransformOperation(elements){this.elements=elements}return ArrayUnionTransformOperation.prototype.applyToLocalView=function(previousValue){return this.apply(previousValue)},ArrayUnionTransformOperation.prototype.applyToRemoteDocument=function(previousValue){return this.apply(previousValue)},ArrayUnionTransformOperation.prototype.apply=function(previousValue){for(var result=coercedFieldValuesArray(previousValue),_loop_1=function(toUnion){result.find(function(element){return element.isEqual(toUnion)})||result.push(toUnion)},_i=0,_a=this.elements,toUnion;_i<_a.length;_i++)toUnion=_a[_i],_loop_1(toUnion);return new ArrayValue(result)},ArrayUnionTransformOperation.prototype.isEqual=function(other){return other instanceof ArrayUnionTransformOperation&&arrayEquals(other.elements,this.elements)},ArrayUnionTransformOperation}(),ArrayRemoveTransformOperation=function(){function ArrayRemoveTransformOperation(elements){this.elements=elements}return ArrayRemoveTransformOperation.prototype.applyToLocalView=function(previousValue){return this.apply(previousValue)},ArrayRemoveTransformOperation.prototype.applyToRemoteDocument=function(previousValue){return this.apply(previousValue)},ArrayRemoveTransformOperation.prototype.apply=function(previousValue){for(var result=coercedFieldValuesArray(previousValue),_loop_2=function(toRemove){result=result.filter(function(element){return!element.isEqual(toRemove)})},_i=0,_a=this.elements,toRemove;_i<_a.length;_i++)toRemove=_a[_i],_loop_2(toRemove);return new ArrayValue(result)},ArrayRemoveTransformOperation.prototype.isEqual=function(other){return other instanceof ArrayRemoveTransformOperation&&arrayEquals(other.elements,this.elements)},ArrayRemoveTransformOperation}(),ExistenceFilter=function(){function ExistenceFilter(count){this.count=count}return ExistenceFilter.prototype.isEqual=function(other){return other&&other.count===this.count},ExistenceFilter}(),RpcCode;(function(RpcCode){RpcCode[RpcCode.OK=0]="OK",RpcCode[RpcCode.CANCELLED=1]="CANCELLED",RpcCode[RpcCode.UNKNOWN=2]="UNKNOWN",RpcCode[RpcCode.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",RpcCode[RpcCode.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",RpcCode[RpcCode.NOT_FOUND=5]="NOT_FOUND",RpcCode[RpcCode.ALREADY_EXISTS=6]="ALREADY_EXISTS",RpcCode[RpcCode.PERMISSION_DENIED=7]="PERMISSION_DENIED",RpcCode[RpcCode.UNAUTHENTICATED=16]="UNAUTHENTICATED",RpcCode[RpcCode.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",RpcCode[RpcCode.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",RpcCode[RpcCode.ABORTED=10]="ABORTED",RpcCode[RpcCode.OUT_OF_RANGE=11]="OUT_OF_RANGE",RpcCode[RpcCode.UNIMPLEMENTED=12]="UNIMPLEMENTED",RpcCode[RpcCode.INTERNAL=13]="INTERNAL",RpcCode[RpcCode.UNAVAILABLE=14]="UNAVAILABLE",RpcCode[RpcCode.DATA_LOSS=15]="DATA_LOSS"})(RpcCode||(RpcCode={}));var SortedSet=function(){function SortedSet(comparator){this.comparator=comparator,this.data=new SortedMap(this.comparator)}return SortedSet.fromMapKeys=function(map){var keys=new SortedSet(map.comparator);return map.forEach(function(key){keys=keys.add(key)}),keys},SortedSet.prototype.has=function(elem){return null!==this.data.get(elem)},SortedSet.prototype.first=function(){return this.data.minKey()},SortedSet.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(SortedSet.prototype,"size",{get:function(){return this.data.size},enumerable:!0,configurable:!0}),SortedSet.prototype.indexOf=function(elem){return this.data.indexOf(elem)},SortedSet.prototype.forEach=function(cb){this.data.inorderTraversal(function(k){return cb(k),!1})},SortedSet.prototype.forEachInRange=function(range,cb){for(var iter=this.data.getIteratorFrom(range[0]),elem;iter.hasNext();){if(elem=iter.getNext(),0<=this.comparator(elem.key,range[1]))return;cb(elem.key)}},SortedSet.prototype.forEachWhile=function(cb,start){var iter;for(iter=void 0===start?this.data.getIterator():this.data.getIteratorFrom(start);iter.hasNext();){var elem=iter.getNext(),result=cb(elem.key);if(!result)return}},SortedSet.prototype.firstAfterOrEqual=function(elem){var iter=this.data.getIteratorFrom(elem);return iter.hasNext()?iter.getNext().key:null},SortedSet.prototype.add=function(elem){return this.copy(this.data.remove(elem).insert(elem,!0))},SortedSet.prototype.delete=function(elem){return this.has(elem)?this.copy(this.data.remove(elem)):this},SortedSet.prototype.isEmpty=function(){return this.data.isEmpty()},SortedSet.prototype.unionWith=function(other){var result=this;return other.forEach(function(elem){result=result.add(elem)}),result},SortedSet.prototype.isEqual=function(other){if(!(other instanceof SortedSet))return!1;if(this.size!==other.size)return!1;for(var thisIt=this.data.getIterator(),otherIt=other.data.getIterator();thisIt.hasNext();){var thisElem=thisIt.getNext().key,otherElem=otherIt.getNext().key;if(0!==this.comparator(thisElem,otherElem))return!1}return!0},SortedSet.prototype.toArray=function(){var res=[];return this.forEach(function(targetId){res.push(targetId)}),res},SortedSet.prototype.toString=function(){var result=[];return this.forEach(function(elem){return result.push(elem)}),"SortedSet("+result.toString()+")"},SortedSet.prototype.copy=function(data){var result=new SortedSet(this.comparator);return result.data=data,result},SortedSet}(),EMPTY_MAYBE_DOCUMENT_MAP=new SortedMap(DocumentKey.comparator),EMPTY_DOCUMENT_MAP=new SortedMap(DocumentKey.comparator),EMPTY_DOCUMENT_VERSION_MAP=new SortedMap(DocumentKey.comparator),EMPTY_DOCUMENT_KEY_SET=new SortedSet(DocumentKey.comparator),EMPTY_TARGET_ID_SET=new SortedSet(primitiveComparator),DocumentSet=function(){function DocumentSet(comp){this.comparator=comp?function(d1,d2){return comp(d1,d2)||DocumentKey.comparator(d1.key,d2.key)}:function(d1,d2){return DocumentKey.comparator(d1.key,d2.key)},this.keyedMap=documentMap(),this.sortedSet=new SortedMap(this.comparator)}return DocumentSet.emptySet=function(oldSet){return new DocumentSet(oldSet.comparator)},DocumentSet.prototype.has=function(key){return null!=this.keyedMap.get(key)},DocumentSet.prototype.get=function(key){return this.keyedMap.get(key)},DocumentSet.prototype.first=function(){return this.sortedSet.minKey()},DocumentSet.prototype.last=function(){return this.sortedSet.maxKey()},DocumentSet.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},DocumentSet.prototype.indexOf=function(key){var doc=this.keyedMap.get(key);return doc?this.sortedSet.indexOf(doc):-1},Object.defineProperty(DocumentSet.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!0,configurable:!0}),DocumentSet.prototype.forEach=function(cb){this.sortedSet.inorderTraversal(function(k){return cb(k),!1})},DocumentSet.prototype.add=function(doc){var set=this.delete(doc.key);return set.copy(set.keyedMap.insert(doc.key,doc),set.sortedSet.insert(doc,null))},DocumentSet.prototype.delete=function(key){var doc=this.get(key);return doc?this.copy(this.keyedMap.remove(key),this.sortedSet.remove(doc)):this},DocumentSet.prototype.isEqual=function(other){if(!(other instanceof DocumentSet))return!1;if(this.size!==other.size)return!1;for(var thisIt=this.sortedSet.getIterator(),otherIt=other.sortedSet.getIterator();thisIt.hasNext();){var thisDoc=thisIt.getNext().key,otherDoc=otherIt.getNext().key;if(!thisDoc.isEqual(otherDoc))return!1}return!0},DocumentSet.prototype.toString=function(){var docStrings=[];return this.forEach(function(doc){docStrings.push(doc.toString())}),0===docStrings.length?"DocumentSet ()":"DocumentSet (\n "+docStrings.join(" \n")+"\n)"},DocumentSet.prototype.copy=function(keyedMap,sortedSet){var newSet=new DocumentSet;return newSet.comparator=this.comparator,newSet.keyedMap=keyedMap,newSet.sortedSet=sortedSet,newSet},DocumentSet}(),ChangeType;(function(ChangeType){ChangeType[ChangeType.Added=0]="Added",ChangeType[ChangeType.Removed=1]="Removed",ChangeType[ChangeType.Modified=2]="Modified",ChangeType[ChangeType.Metadata=3]="Metadata"})(ChangeType||(ChangeType={}));var SyncState;(function(SyncState){SyncState[SyncState.Local=0]="Local",SyncState[SyncState.Synced=1]="Synced"})(SyncState||(SyncState={}));var DocumentChangeSet=function(){function DocumentChangeSet(){this.changeMap=new SortedMap(DocumentKey.comparator)}return DocumentChangeSet.prototype.track=function(change){var key=change.doc.key,oldChange=this.changeMap.get(key);return oldChange?void(change.type!==ChangeType.Added&&oldChange.type===ChangeType.Metadata?this.changeMap=this.changeMap.insert(key,change):change.type===ChangeType.Metadata&&oldChange.type!==ChangeType.Removed?this.changeMap=this.changeMap.insert(key,{type:oldChange.type,doc:change.doc}):change.type===ChangeType.Modified&&oldChange.type===ChangeType.Modified?this.changeMap=this.changeMap.insert(key,{type:ChangeType.Modified,doc:change.doc}):change.type===ChangeType.Modified&&oldChange.type===ChangeType.Added?this.changeMap=this.changeMap.insert(key,{type:ChangeType.Added,doc:change.doc}):change.type===ChangeType.Removed&&oldChange.type===ChangeType.Added?this.changeMap=this.changeMap.remove(key):change.type===ChangeType.Removed&&oldChange.type===ChangeType.Modified?this.changeMap=this.changeMap.insert(key,{type:ChangeType.Removed,doc:oldChange.doc}):change.type===ChangeType.Added&&oldChange.type===ChangeType.Removed?this.changeMap=this.changeMap.insert(key,{type:ChangeType.Modified,doc:change.doc}):fail("unsupported combination of changes: "+JSON.stringify(change)+" after "+JSON.stringify(oldChange))):void(this.changeMap=this.changeMap.insert(key,change))},DocumentChangeSet.prototype.getChanges=function(){var changes=[];return this.changeMap.inorderTraversal(function(key,change){changes.push(change)}),changes},DocumentChangeSet}(),ViewSnapshot=function(){function ViewSnapshot(query,docs,oldDocs,docChanges,mutatedKeys,fromCache,syncStateChanged,excludesMetadataChanges){this.query=query,this.docs=docs,this.oldDocs=oldDocs,this.docChanges=docChanges,this.mutatedKeys=mutatedKeys,this.fromCache=fromCache,this.syncStateChanged=syncStateChanged,this.excludesMetadataChanges=excludesMetadataChanges}return ViewSnapshot.fromInitialDocuments=function(query,documents,mutatedKeys,fromCache){var changes=[];return documents.forEach(function(doc){changes.push({type:ChangeType.Added,doc:doc})}),new ViewSnapshot(query,documents,DocumentSet.emptySet(documents),changes,mutatedKeys,fromCache,!0,!1)},Object.defineProperty(ViewSnapshot.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!0,configurable:!0}),ViewSnapshot.prototype.isEqual=function(other){if(this.fromCache!==other.fromCache||this.syncStateChanged!==other.syncStateChanged||!this.mutatedKeys.isEqual(other.mutatedKeys)||!this.query.isEqual(other.query)||!this.docs.isEqual(other.docs)||!this.oldDocs.isEqual(other.oldDocs))return!1;var changes=this.docChanges,otherChanges=other.docChanges;if(changes.length!==otherChanges.length)return!1;for(var i=0;i<changes.length;i++)if(changes[i].type!==otherChanges[i].type||!changes[i].doc.isEqual(otherChanges[i].doc))return!1;return!0},ViewSnapshot}(),RemoteEvent=function(){function RemoteEvent(snapshotVersion,targetChanges,targetMismatches,documentUpdates,resolvedLimboDocuments){this.snapshotVersion=snapshotVersion,this.targetChanges=targetChanges,this.targetMismatches=targetMismatches,this.documentUpdates=documentUpdates,this.resolvedLimboDocuments=resolvedLimboDocuments}return RemoteEvent.createSynthesizedRemoteEventForCurrentChange=function(targetId,current){var targetChanges=(_a={},_a[targetId]=TargetChange.createSynthesizedTargetChangeForCurrentChange(targetId,current),_a);return new RemoteEvent(SnapshotVersion.MIN,targetChanges,targetIdSet(),maybeDocumentMap(),documentKeySet());var _a},RemoteEvent}(),TargetChange=function(){function TargetChange(resumeToken,current,addedDocuments,modifiedDocuments,removedDocuments){this.resumeToken=resumeToken,this.current=current,this.addedDocuments=addedDocuments,this.modifiedDocuments=modifiedDocuments,this.removedDocuments=removedDocuments}return TargetChange.createSynthesizedTargetChangeForCurrentChange=function(targetId,current){return new TargetChange(emptyByteString(),current,documentKeySet(),documentKeySet(),documentKeySet())},TargetChange}(),DocumentWatchChange=function(){return function(updatedTargetIds,removedTargetIds,key,newDoc){this.updatedTargetIds=updatedTargetIds,this.removedTargetIds=removedTargetIds,this.key=key,this.newDoc=newDoc}}(),ExistenceFilterChange=function(){return function(targetId,existenceFilter){this.targetId=targetId,this.existenceFilter=existenceFilter}}(),WatchTargetChangeState;(function(WatchTargetChangeState){WatchTargetChangeState[WatchTargetChangeState.NoChange=0]="NoChange",WatchTargetChangeState[WatchTargetChangeState.Added=1]="Added",WatchTargetChangeState[WatchTargetChangeState.Removed=2]="Removed",WatchTargetChangeState[WatchTargetChangeState.Current=3]="Current",WatchTargetChangeState[WatchTargetChangeState.Reset=4]="Reset"})(WatchTargetChangeState||(WatchTargetChangeState={}));var WatchTargetChange=function(){return function(state,targetIds,resumeToken,cause){void 0===resumeToken&&(resumeToken=emptyByteString()),void 0===cause&&(cause=null),this.state=state,this.targetIds=targetIds,this.resumeToken=resumeToken,this.cause=cause}}(),TargetState=function(){function TargetState(){this.pendingResponses=0,this.documentChanges=snapshotChangesMap(),this._resumeToken=emptyByteString(),this._current=!1,this._hasPendingChanges=!0}return Object.defineProperty(TargetState.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),Object.defineProperty(TargetState.prototype,"resumeToken",{get:function(){return this._resumeToken},enumerable:!0,configurable:!0}),Object.defineProperty(TargetState.prototype,"isPending",{get:function(){return 0!==this.pendingResponses},enumerable:!0,configurable:!0}),Object.defineProperty(TargetState.prototype,"hasPendingChanges",{get:function(){return this._hasPendingChanges},enumerable:!0,configurable:!0}),TargetState.prototype.updateResumeToken=function(resumeToken){0<resumeToken.length&&(this._hasPendingChanges=!0,this._resumeToken=resumeToken)},TargetState.prototype.toTargetChange=function(){var addedDocuments=documentKeySet(),modifiedDocuments=documentKeySet(),removedDocuments=documentKeySet();return this.documentChanges.forEach(function(key,changeType){changeType===ChangeType.Added?addedDocuments=addedDocuments.add(key):changeType===ChangeType.Modified?modifiedDocuments=modifiedDocuments.add(key):changeType===ChangeType.Removed?removedDocuments=removedDocuments.add(key):fail("Encountered invalid change type: "+changeType)}),new TargetChange(this._resumeToken,this._current,addedDocuments,modifiedDocuments,removedDocuments)},TargetState.prototype.clearPendingChanges=function(){this._hasPendingChanges=!1,this.documentChanges=snapshotChangesMap()},TargetState.prototype.addDocumentChange=function(key,changeType){this._hasPendingChanges=!0,this.documentChanges=this.documentChanges.insert(key,changeType)},TargetState.prototype.removeDocumentChange=function(key){this._hasPendingChanges=!0,this.documentChanges=this.documentChanges.remove(key)},TargetState.prototype.recordPendingTargetRequest=function(){this.pendingResponses+=1},TargetState.prototype.recordTargetResponse=function(){this.pendingResponses-=1},TargetState.prototype.markCurrent=function(){this._hasPendingChanges=!0,this._current=!0},TargetState}(),WatchChangeAggregator=function(){function WatchChangeAggregator(metadataProvider){this.metadataProvider=metadataProvider,this.targetStates={},this.pendingDocumentUpdates=maybeDocumentMap(),this.pendingDocumentTargetMapping=documentTargetMap(),this.pendingTargetResets=new SortedSet(primitiveComparator)}return WatchChangeAggregator.prototype.handleDocumentChange=function(docChange){for(var _i=0,_a=docChange.updatedTargetIds,targetId;_i<_a.length;_i++)targetId=_a[_i],docChange.newDoc instanceof Document?this.addDocumentToTarget(targetId,docChange.newDoc):docChange.newDoc instanceof NoDocument&&this.removeDocumentFromTarget(targetId,docChange.key,docChange.newDoc);for(var _b=0,_c=docChange.removedTargetIds,targetId;_b<_c.length;_b++)targetId=_c[_b],this.removeDocumentFromTarget(targetId,docChange.key,docChange.newDoc)},WatchChangeAggregator.prototype.handleTargetChange=function(targetChange){var _this=this;this.forEachTarget(targetChange,function(targetId){var targetState=_this.ensureTargetState(targetId);switch(targetChange.state){case WatchTargetChangeState.NoChange:_this.isActiveTarget(targetId)&&targetState.updateResumeToken(targetChange.resumeToken);break;case WatchTargetChangeState.Added:targetState.recordTargetResponse(),targetState.isPending||targetState.clearPendingChanges(),targetState.updateResumeToken(targetChange.resumeToken);break;case WatchTargetChangeState.Removed:targetState.recordTargetResponse(),targetState.isPending||_this.removeTarget(targetId),assert(!targetChange.cause,"WatchChangeAggregator does not handle errored targets");break;case WatchTargetChangeState.Current:_this.isActiveTarget(targetId)&&(targetState.markCurrent(),targetState.updateResumeToken(targetChange.resumeToken));break;case WatchTargetChangeState.Reset:_this.isActiveTarget(targetId)&&(_this.resetTarget(targetId),targetState.updateResumeToken(targetChange.resumeToken));break;default:fail("Unknown target watch change state: "+targetChange.state);}})},WatchChangeAggregator.prototype.forEachTarget=function(targetChange,fn){0<targetChange.targetIds.length?targetChange.targetIds.forEach(fn):forEachNumber(this.targetStates,fn)},WatchChangeAggregator.prototype.handleExistenceFilter=function(watchChange){var targetId=watchChange.targetId,expectedCount=watchChange.existenceFilter.count,queryData=this.queryDataForActiveTarget(targetId);if(queryData){var query=queryData.query;if(!query.isDocumentQuery()){var currentSize=this.getCurrentDocumentCountForTarget(targetId);currentSize!==expectedCount&&(this.resetTarget(targetId),this.pendingTargetResets=this.pendingTargetResets.add(targetId))}else if(0===expectedCount){var key=new DocumentKey(query.path);this.removeDocumentFromTarget(targetId,key,new NoDocument(key,SnapshotVersion.forDeletedDoc()))}else assert(1===expectedCount,"Single document existence filter with count: "+expectedCount)}},WatchChangeAggregator.prototype.createRemoteEvent=function(snapshotVersion){var _this=this,targetChanges={};forEachNumber(this.targetStates,function(targetId,targetState){var queryData=_this.queryDataForActiveTarget(targetId);if(queryData){if(targetState.current&&queryData.query.isDocumentQuery()){var key=new DocumentKey(queryData.query.path);null!==_this.pendingDocumentUpdates.get(key)||_this.targetContainsDocument(targetId,key)||_this.removeDocumentFromTarget(targetId,key,new NoDocument(key,snapshotVersion))}targetState.hasPendingChanges&&(targetChanges[targetId]=targetState.toTargetChange(),targetState.clearPendingChanges())}});var resolvedLimboDocuments=documentKeySet();this.pendingDocumentTargetMapping.forEach(function(key,targets){var isOnlyLimboTarget=!0;targets.forEachWhile(function(targetId){var queryData=_this.queryDataForActiveTarget(targetId);return queryData&&queryData.purpose!==QueryPurpose.LimboResolution?(isOnlyLimboTarget=!1,!1):!0}),isOnlyLimboTarget&&(resolvedLimboDocuments=resolvedLimboDocuments.add(key))});var remoteEvent=new RemoteEvent(snapshotVersion,targetChanges,this.pendingTargetResets,this.pendingDocumentUpdates,resolvedLimboDocuments);return this.pendingDocumentUpdates=maybeDocumentMap(),this.pendingDocumentTargetMapping=documentTargetMap(),this.pendingTargetResets=new SortedSet(primitiveComparator),remoteEvent},WatchChangeAggregator.prototype.addDocumentToTarget=function(targetId,document){if(this.isActiveTarget(targetId)){var changeType=this.targetContainsDocument(targetId,document.key)?ChangeType.Modified:ChangeType.Added,targetState=this.ensureTargetState(targetId);targetState.addDocumentChange(document.key,changeType),this.pendingDocumentUpdates=this.pendingDocumentUpdates.insert(document.key,document),this.pendingDocumentTargetMapping=this.pendingDocumentTargetMapping.insert(document.key,this.ensureDocumentTargetMapping(document.key).add(targetId))}},WatchChangeAggregator.prototype.removeDocumentFromTarget=function(targetId,key,updatedDocument){if(this.isActiveTarget(targetId)){var targetState=this.ensureTargetState(targetId);this.targetContainsDocument(targetId,key)?targetState.addDocumentChange(key,ChangeType.Removed):targetState.removeDocumentChange(key),this.pendingDocumentTargetMapping=this.pendingDocumentTargetMapping.insert(key,this.ensureDocumentTargetMapping(key).delete(targetId)),updatedDocument&&(this.pendingDocumentUpdates=this.pendingDocumentUpdates.insert(key,updatedDocument))}},WatchChangeAggregator.prototype.removeTarget=function(targetId){delete this.targetStates[targetId]},WatchChangeAggregator.prototype.getCurrentDocumentCountForTarget=function(targetId){var targetState=this.ensureTargetState(targetId),targetChange=targetState.toTargetChange();return this.metadataProvider.getRemoteKeysForTarget(targetId).size+targetChange.addedDocuments.size-targetChange.removedDocuments.size},WatchChangeAggregator.prototype.recordPendingTargetRequest=function(targetId){var targetState=this.ensureTargetState(targetId);targetState.recordPendingTargetRequest()},WatchChangeAggregator.prototype.ensureTargetState=function(targetId){return this.targetStates[targetId]||(this.targetStates[targetId]=new TargetState),this.targetStates[targetId]},WatchChangeAggregator.prototype.ensureDocumentTargetMapping=function(key){var targetMapping=this.pendingDocumentTargetMapping.get(key);return targetMapping||(targetMapping=new SortedSet(primitiveComparator),this.pendingDocumentTargetMapping=this.pendingDocumentTargetMapping.insert(key,targetMapping)),targetMapping},WatchChangeAggregator.prototype.isActiveTarget=function(targetId){return null!==this.queryDataForActiveTarget(targetId)},WatchChangeAggregator.prototype.queryDataForActiveTarget=function(targetId){var targetState=this.targetStates[targetId];return targetState&&targetState.isPending?null:this.metadataProvider.getQueryDataForTarget(targetId)},WatchChangeAggregator.prototype.resetTarget=function(targetId){var _this=this;assert(!this.targetStates[targetId].isPending,"Should only reset active targets"),this.targetStates[targetId]=new TargetState;var existingKeys=this.metadataProvider.getRemoteKeysForTarget(targetId);existingKeys.forEach(function(key){_this.removeDocumentFromTarget(targetId,key,null)})},WatchChangeAggregator.prototype.targetContainsDocument=function(targetId,key){var existingKeys=this.metadataProvider.getRemoteKeysForTarget(targetId);return existingKeys.has(key)},WatchChangeAggregator}(),DIRECTIONS=function(){var dirs={};return dirs[Direction.ASCENDING.name]="ASCENDING",dirs[Direction.DESCENDING.name]="DESCENDING",dirs}(),OPERATORS=function(){var ops={};return ops[RelationOp.LESS_THAN.name]="LESS_THAN",ops[RelationOp.LESS_THAN_OR_EQUAL.name]="LESS_THAN_OR_EQUAL",ops[RelationOp.GREATER_THAN.name]="GREATER_THAN",ops[RelationOp.GREATER_THAN_OR_EQUAL.name]="GREATER_THAN_OR_EQUAL",ops[RelationOp.EQUAL.name]="EQUAL",ops[RelationOp.ARRAY_CONTAINS.name]="ARRAY_CONTAINS",ops}(),ISO_REG_EXP=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/),JsonProtoSerializer=function(){function JsonProtoSerializer(databaseId,options){this.databaseId=databaseId,this.options=options}return JsonProtoSerializer.prototype.emptyByteString=function(){return this.options.useProto3Json?"":new Uint8Array(0)},JsonProtoSerializer.prototype.unsafeCastProtoByteString=function(byteString){return byteString},JsonProtoSerializer.prototype.fromRpcStatus=function(status){var code=void 0===status.code?Code.UNKNOWN:mapCodeFromRpcCode(status.code);return new FirestoreError(code,status.message||"")},JsonProtoSerializer.prototype.toInt32Value=function(val){return isNullOrUndefined(val)?void 0:{value:val}},JsonProtoSerializer.prototype.fromInt32Value=function(val){var result;return result="object"==typeof val?val.value:val,isNullOrUndefined(result)?null:result},JsonProtoSerializer.prototype.toTimestamp=function(timestamp){return{seconds:timestamp.seconds,nanos:timestamp.nanoseconds}},JsonProtoSerializer.prototype.fromTimestamp=function(date){if("string"==typeof date)return this.fromIso8601String(date);assert(!!date,"Cannot deserialize null or undefined timestamp.");var seconds=parseInt64(date.seconds||"0"),nanos=date.nanos||0;return new Timestamp(seconds,nanos)},JsonProtoSerializer.prototype.fromIso8601String=function(utc){var nanos=0,fraction=ISO_REG_EXP.exec(utc);if(assert(!!fraction,"invalid timestamp: "+utc),fraction[1]){var nanoStr=fraction[1];nanoStr=(nanoStr+"000000000").substr(0,9),nanos=+nanoStr}var date=new Date(utc),seconds=_Mathfloor3(date.getTime()/1e3);return new Timestamp(seconds,nanos)},JsonProtoSerializer.prototype.toBytes=function(bytes){return this.options.useProto3Json?bytes.toBase64():this.unsafeCastProtoByteString(bytes.toUint8Array())},JsonProtoSerializer.prototype.fromBlob=function(blob){return"string"==typeof blob?(assert(this.options.useProto3Json,"Expected bytes to be passed in as Uint8Array, but got a string instead."),Blob.fromBase64String(blob)):(assert(!this.options.useProto3Json,"Expected bytes to be passed in as string, but got something else instead."),Blob.fromUint8Array(blob))},JsonProtoSerializer.prototype.toVersion=function(version){return this.toTimestamp(version.toTimestamp())},JsonProtoSerializer.prototype.fromVersion=function(version){return assert(!!version,"Trying to deserialize version that isn't set"),SnapshotVersion.fromTimestamp(this.fromTimestamp(version))},JsonProtoSerializer.prototype.toResourceName=function(databaseId,path){return this.fullyQualifiedPrefixPath(databaseId).child("documents").child(path).canonicalString()},JsonProtoSerializer.prototype.fromResourceName=function(name){var resource=ResourcePath.fromString(name);return assert(this.isValidResourceName(resource),"Tried to deserialize invalid key "+resource.toString()),resource},JsonProtoSerializer.prototype.toName=function(key){return this.toResourceName(this.databaseId,key.path)},JsonProtoSerializer.prototype.fromName=function(name){var resource=this.fromResourceName(name);return assert(resource.get(1)===this.databaseId.projectId,"Tried to deserialize key from different project: "+resource.get(1)+" vs "+this.databaseId.projectId),assert(!resource.get(3)&&!this.databaseId.database||resource.get(3)===this.databaseId.database,"Tried to deserialize key from different database: "+resource.get(3)+" vs "+this.databaseId.database),new DocumentKey(this.extractLocalPathFromResourceName(resource))},JsonProtoSerializer.prototype.toQueryPath=function(path){return 0===path.length?this.encodedDatabaseId:this.toResourceName(this.databaseId,path)},JsonProtoSerializer.prototype.fromQueryPath=function(name){var resourceName=this.fromResourceName(name);return 4===resourceName.length?ResourcePath.EMPTY_PATH:this.extractLocalPathFromResourceName(resourceName)},Object.defineProperty(JsonProtoSerializer.prototype,"encodedDatabaseId",{get:function(){var path=new ResourcePath(["projects",this.databaseId.projectId,"databases",this.databaseId.database]);return path.canonicalString()},enumerable:!0,configurable:!0}),JsonProtoSerializer.prototype.fullyQualifiedPrefixPath=function(databaseId){return new ResourcePath(["projects",databaseId.projectId,"databases",databaseId.database])},JsonProtoSerializer.prototype.extractLocalPathFromResourceName=function(resourceName){return assert(4<resourceName.length&&"documents"===resourceName.get(4),"tried to deserialize invalid key "+resourceName.toString()),resourceName.popFirst(5)},JsonProtoSerializer.prototype.isValidResourceName=function(path){return 4<=path.length&&"projects"===path.get(0)&&"databases"===path.get(2)},JsonProtoSerializer.prototype.toValue=function(val){if(val instanceof NullValue)return{nullValue:"NULL_VALUE"};if(val instanceof BooleanValue)return{booleanValue:val.value()};if(val instanceof IntegerValue)return{integerValue:""+val.value()};if(val instanceof DoubleValue){var doubleValue=val.value();if(this.options.useProto3Json){if(isNaN(doubleValue))return{doubleValue:"NaN"};if(doubleValue===Infinity)return{doubleValue:"Infinity"};if(doubleValue===-Infinity)return{doubleValue:"-Infinity"}}return{doubleValue:val.value()}}return val instanceof StringValue?{stringValue:val.value()}:val instanceof ObjectValue?{mapValue:this.toMapValue(val)}:val instanceof ArrayValue?{arrayValue:this.toArrayValue(val)}:val instanceof TimestampValue?{timestampValue:this.toTimestamp(val.internalValue)}:val instanceof GeoPointValue?{geoPointValue:{latitude:val.value().latitude,longitude:val.value().longitude}}:val instanceof BlobValue?{bytesValue:this.toBytes(val.value())}:val instanceof RefValue?{referenceValue:this.toResourceName(val.databaseId,val.key.path)}:fail("Unknown FieldValue "+JSON.stringify(val))},JsonProtoSerializer.prototype.fromValue=function(obj){var _this=this,type=obj.value_type;if(hasTag(obj,type,"nullValue"))return NullValue.INSTANCE;if(hasTag(obj,type,"booleanValue"))return BooleanValue.of(obj.booleanValue);if(hasTag(obj,type,"integerValue"))return new IntegerValue(parseInt64(obj.integerValue));if(hasTag(obj,type,"doubleValue")){if(this.options.useProto3Json){if("NaN"===obj.doubleValue)return DoubleValue.NAN;if("Infinity"===obj.doubleValue)return DoubleValue.POSITIVE_INFINITY;if("-Infinity"===obj.doubleValue)return DoubleValue.NEGATIVE_INFINITY}return new DoubleValue(obj.doubleValue)}if(hasTag(obj,type,"stringValue"))return new StringValue(obj.stringValue);if(hasTag(obj,type,"mapValue"))return this.fromFields(obj.mapValue.fields||{});if(hasTag(obj,type,"arrayValue")){assertPresent(obj.arrayValue,"arrayValue");var values$$1=obj.arrayValue.values||[];return new ArrayValue(values$$1.map(function(v){return _this.fromValue(v)}))}if(hasTag(obj,type,"timestampValue"))return assertPresent(obj.timestampValue,"timestampValue"),new TimestampValue(this.fromTimestamp(obj.timestampValue));if(hasTag(obj,type,"geoPointValue")){assertPresent(obj.geoPointValue,"geoPointValue");var latitude=obj.geoPointValue.latitude||0,longitude=obj.geoPointValue.longitude||0;return new GeoPointValue(new GeoPoint(latitude,longitude))}if(hasTag(obj,type,"bytesValue")){assertPresent(obj.bytesValue,"bytesValue");var blob=this.fromBlob(obj.bytesValue);return new BlobValue(blob)}if(hasTag(obj,type,"referenceValue")){assertPresent(obj.referenceValue,"referenceValue");var resourceName=this.fromResourceName(obj.referenceValue),dbId=new DatabaseId(resourceName.get(1),resourceName.get(3)),key=new DocumentKey(this.extractLocalPathFromResourceName(resourceName));return new RefValue(dbId,key)}return fail("Unknown Value proto "+JSON.stringify(obj))},JsonProtoSerializer.prototype.toMutationDocument=function(key,fields){return{name:this.toName(key),fields:this.toFields(fields)}},JsonProtoSerializer.prototype.toDocument=function(document){return assert(!document.hasLocalMutations,"Can't serialize documents with mutations."),{name:this.toName(document.key),fields:this.toFields(document.data),updateTime:this.toTimestamp(document.version.toTimestamp())}},JsonProtoSerializer.prototype.fromDocument=function(document,hasCommittedMutations){return new Document(this.fromName(document.name),this.fromVersion(document.updateTime),this.fromFields(document.fields||{}),{hasCommittedMutations:!!hasCommittedMutations})},JsonProtoSerializer.prototype.toFields=function(fields){var _this=this,result={};return fields.forEach(function(key,value){result[key]=_this.toValue(value)}),result},JsonProtoSerializer.prototype.fromFields=function(object){var _this=this,result=ObjectValue.EMPTY;return forEach(object,function(key,value){result=result.set(new FieldPath([key]),_this.fromValue(value))}),result},JsonProtoSerializer.prototype.toMapValue=function(map){return{fields:this.toFields(map)}},JsonProtoSerializer.prototype.toArrayValue=function(array){var _this=this,result=[];return array.forEach(function(value){result.push(_this.toValue(value))}),{values:result}},JsonProtoSerializer.prototype.fromFound=function(doc){assert(!!doc.found,"Tried to deserialize a found document from a missing document."),assertPresent(doc.found.name,"doc.found.name"),assertPresent(doc.found.updateTime,"doc.found.updateTime");var key=this.fromName(doc.found.name),version=this.fromVersion(doc.found.updateTime),fields=this.fromFields(doc.found.fields||{});return new Document(key,version,fields,{})},JsonProtoSerializer.prototype.fromMissing=function(result){assert(!!result.missing,"Tried to deserialize a missing document from a found document."),assert(!!result.readTime,"Tried to deserialize a missing document without a read time.");var key=this.fromName(result.missing),version=this.fromVersion(result.readTime);return new NoDocument(key,version)},JsonProtoSerializer.prototype.fromMaybeDocument=function(result){var type=result.result;return hasTag(result,type,"found")?this.fromFound(result):hasTag(result,type,"missing")?this.fromMissing(result):fail("invalid batch get response: "+JSON.stringify(result))},JsonProtoSerializer.prototype.toWatchTargetChangeState=function(state){return state===WatchTargetChangeState.Added?"ADD":state===WatchTargetChangeState.Current?"CURRENT":state===WatchTargetChangeState.NoChange?"NO_CHANGE":state===WatchTargetChangeState.Removed?"REMOVE":state===WatchTargetChangeState.Reset?"RESET":fail("Unknown WatchTargetChangeState: "+state)},JsonProtoSerializer.prototype.toTestWatchChange=function(watchChange){if(watchChange instanceof ExistenceFilterChange)return{filter:{count:watchChange.existenceFilter.count,targetId:watchChange.targetId}};if(watchChange instanceof DocumentWatchChange){if(watchChange.newDoc instanceof Document){var doc=watchChange.newDoc;return{documentChange:{document:{name:this.toName(doc.key),fields:this.toFields(doc.data),updateTime:this.toVersion(doc.version)},targetIds:watchChange.updatedTargetIds,removedTargetIds:watchChange.removedTargetIds}}}if(watchChange.newDoc instanceof NoDocument){var doc=watchChange.newDoc;return{documentDelete:{document:this.toName(doc.key),readTime:this.toVersion(doc.version),removedTargetIds:watchChange.removedTargetIds}}}if(null===watchChange.newDoc)return{documentRemove:{document:this.toName(watchChange.key),removedTargetIds:watchChange.removedTargetIds}}}if(watchChange instanceof WatchTargetChange){var cause;return watchChange.cause&&(cause={code:mapRpcCodeFromCode(watchChange.cause.code),message:watchChange.cause.message}),{targetChange:{targetChangeType:this.toWatchTargetChangeState(watchChange.state),targetIds:watchChange.targetIds,resumeToken:this.unsafeCastProtoByteString(watchChange.resumeToken),cause:cause}}}return fail("Unrecognized watch change: "+JSON.stringify(watchChange))},JsonProtoSerializer.prototype.fromWatchChange=function(change){var type=change.response_type,watchChange;if(hasTag(change,type,"targetChange")){assertPresent(change.targetChange,"targetChange");var state=this.fromWatchTargetChangeState(change.targetChange.targetChangeType||"NO_CHANGE"),targetIds=change.targetChange.targetIds||[],resumeToken=change.targetChange.resumeToken||this.emptyByteString(),causeProto=change.targetChange.cause,cause=causeProto&&this.fromRpcStatus(causeProto);watchChange=new WatchTargetChange(state,targetIds,resumeToken,cause||null)}else if(hasTag(change,type,"documentChange")){assertPresent(change.documentChange,"documentChange"),assertPresent(change.documentChange.document,"documentChange.name"),assertPresent(change.documentChange.document.name,"documentChange.document.name"),assertPresent(change.documentChange.document.updateTime,"documentChange.document.updateTime");var entityChange=change.documentChange,key=this.fromName(entityChange.document.name),version=this.fromVersion(entityChange.document.updateTime),fields=this.fromFields(entityChange.document.fields||{}),doc=new Document(key,version,fields,{}),updatedTargetIds=entityChange.targetIds||[],removedTargetIds=entityChange.removedTargetIds||[];watchChange=new DocumentWatchChange(updatedTargetIds,removedTargetIds,doc.key,doc)}else if(hasTag(change,type,"documentDelete")){assertPresent(change.documentDelete,"documentDelete"),assertPresent(change.documentDelete.document,"documentDelete.document");var docDelete=change.documentDelete,key=this.fromName(docDelete.document),version=docDelete.readTime?this.fromVersion(docDelete.readTime):SnapshotVersion.forDeletedDoc(),doc=new NoDocument(key,version),removedTargetIds=docDelete.removedTargetIds||[];watchChange=new DocumentWatchChange([],removedTargetIds,doc.key,doc)}else if(hasTag(change,type,"documentRemove")){assertPresent(change.documentRemove,"documentRemove"),assertPresent(change.documentRemove.document,"documentRemove");var docRemove=change.documentRemove,key=this.fromName(docRemove.document),removedTargetIds=docRemove.removedTargetIds||[];watchChange=new DocumentWatchChange([],removedTargetIds,key,null)}else if(hasTag(change,type,"filter")){assertPresent(change.filter,"filter"),assertPresent(change.filter.targetId,"filter.targetId");var filter=change.filter,count=filter.count||0,existenceFilter=new ExistenceFilter(count),targetId=filter.targetId;watchChange=new ExistenceFilterChange(targetId,existenceFilter)}else return fail("Unknown change type "+JSON.stringify(change));return watchChange},JsonProtoSerializer.prototype.fromWatchTargetChangeState=function(state){return"NO_CHANGE"===state?WatchTargetChangeState.NoChange:"ADD"===state?WatchTargetChangeState.Added:"REMOVE"===state?WatchTargetChangeState.Removed:"CURRENT"===state?WatchTargetChangeState.Current:"RESET"===state?WatchTargetChangeState.Reset:fail("Got unexpected TargetChange.state: "+state)},JsonProtoSerializer.prototype.versionFromListenResponse=function(change){var type=change.response_type;if(!hasTag(change,type,"targetChange"))return SnapshotVersion.MIN;var targetChange=change.targetChange;return targetChange.targetIds&&targetChange.targetIds.length?SnapshotVersion.MIN:targetChange.readTime?this.fromVersion(targetChange.readTime):SnapshotVersion.MIN},JsonProtoSerializer.prototype.toMutation=function(mutation){var _this=this,result;if(mutation instanceof SetMutation)result={update:this.toMutationDocument(mutation.key,mutation.value)};else if(mutation instanceof DeleteMutation)result={delete:this.toName(mutation.key)};else if(mutation instanceof PatchMutation)result={update:this.toMutationDocument(mutation.key,mutation.data),updateMask:this.toDocumentMask(mutation.fieldMask)};else if(mutation instanceof TransformMutation)result={transform:{document:this.toName(mutation.key),fieldTransforms:mutation.fieldTransforms.map(function(transform){return _this.toFieldTransform(transform)})}};else return fail("Unknown mutation type "+mutation.type);return mutation.precondition.isNone||(result.currentDocument=this.toPrecondition(mutation.precondition)),result},JsonProtoSerializer.prototype.fromMutation=function(proto){var _this=this,precondition=proto.currentDocument?this.fromPrecondition(proto.currentDocument):Precondition.NONE;if(proto.update){assertPresent(proto.update.name,"name");var key=this.fromName(proto.update.name),value=this.fromFields(proto.update.fields||{});if(proto.updateMask){var fieldMask=this.fromDocumentMask(proto.updateMask);return new PatchMutation(key,value,fieldMask,precondition)}return new SetMutation(key,value,precondition)}if(proto.delete){var key=this.fromName(proto.delete);return new DeleteMutation(key,precondition)}if(proto.transform){var key=this.fromName(proto.transform.document),fieldTransforms=proto.transform.fieldTransforms.map(function(transform){return _this.fromFieldTransform(transform)});return assert(!0===precondition.exists,"Transforms only support precondition \"exists == true\""),new TransformMutation(key,fieldTransforms)}return fail("unknown mutation proto: "+JSON.stringify(proto))},JsonProtoSerializer.prototype.toPrecondition=function(precondition){return assert(!precondition.isNone,"Can't serialize an empty precondition"),void 0===precondition.updateTime?void 0===precondition.exists?fail("Unknown precondition"):{exists:precondition.exists}:{updateTime:this.toVersion(precondition.updateTime)}},JsonProtoSerializer.prototype.fromPrecondition=function(precondition){return void 0===precondition.updateTime?void 0===precondition.exists?Precondition.NONE:Precondition.exists(precondition.exists):Precondition.updateTime(this.fromVersion(precondition.updateTime))},JsonProtoSerializer.prototype.fromWriteResult=function(proto,commitTime){var _this=this,version=proto.updateTime?this.fromVersion(proto.updateTime):this.fromVersion(commitTime),transformResults=null;return proto.transformResults&&0<proto.transformResults.length&&(transformResults=proto.transformResults.map(function(result){return _this.fromValue(result)})),new MutationResult(version,transformResults)},JsonProtoSerializer.prototype.fromWriteResults=function(protos,commitTime){var _this=this;return protos&&0<protos.length?(assert(void 0!==commitTime,"Received a write result without a commit time"),protos.map(function(proto){return _this.fromWriteResult(proto,commitTime)})):[]},JsonProtoSerializer.prototype.toFieldTransform=function(fieldTransform){var _this=this,transform=fieldTransform.transform;if(transform instanceof ServerTimestampTransform)return{fieldPath:fieldTransform.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(transform instanceof ArrayUnionTransformOperation)return{fieldPath:fieldTransform.field.canonicalString(),appendMissingElements:{values:transform.elements.map(function(v){return _this.toValue(v)})}};if(transform instanceof ArrayRemoveTransformOperation)return{fieldPath:fieldTransform.field.canonicalString(),removeAllFromArray:{values:transform.elements.map(function(v){return _this.toValue(v)})}};throw fail("Unknown transform: "+fieldTransform.transform)},JsonProtoSerializer.prototype.fromFieldTransform=function(proto){var _this=this,type=proto.transform_type,transform=null;if(hasTag(proto,type,"setToServerValue"))assert("REQUEST_TIME"===proto.setToServerValue,"Unknown server value transform proto: "+JSON.stringify(proto)),transform=ServerTimestampTransform.instance;else if(hasTag(proto,type,"appendMissingElements")){var values$$1=proto.appendMissingElements.values||[];transform=new ArrayUnionTransformOperation(values$$1.map(function(v){return _this.fromValue(v)}))}else if(hasTag(proto,type,"removeAllFromArray")){var values$$1=proto.removeAllFromArray.values||[];transform=new ArrayRemoveTransformOperation(values$$1.map(function(v){return _this.fromValue(v)}))}else fail("Unknown transform proto: "+JSON.stringify(proto));var fieldPath=FieldPath.fromServerFormat(proto.fieldPath);return new FieldTransform(fieldPath,transform)},JsonProtoSerializer.prototype.toDocumentsTarget=function(query){return{documents:[this.toQueryPath(query.path)]}},JsonProtoSerializer.prototype.fromDocumentsTarget=function(documentsTarget){var count=documentsTarget.documents.length;assert(1===count,"DocumentsTarget contained other than 1 document: "+count);var name=documentsTarget.documents[0];return Query.atPath(this.fromQueryPath(name))},JsonProtoSerializer.prototype.toQueryTarget=function(query){var result={structuredQuery:{}};if(query.path.isEmpty())result.parent=this.toQueryPath(ResourcePath.EMPTY_PATH);else{var path=query.path;assert(0!=path.length%2,"Document queries with filters are not supported."),result.parent=this.toQueryPath(path.popLast()),result.structuredQuery.from=[{collectionId:path.lastSegment()}]}var where=this.toFilter(query.filters);where&&(result.structuredQuery.where=where);var orderBy=this.toOrder(query.orderBy);orderBy&&(result.structuredQuery.orderBy=orderBy);var limit=this.toInt32Value(query.limit);return void 0!==limit&&(result.structuredQuery.limit=limit),query.startAt&&(result.structuredQuery.startAt=this.toCursor(query.startAt)),query.endAt&&(result.structuredQuery.endAt=this.toCursor(query.endAt)),result},JsonProtoSerializer.prototype.fromQueryTarget=function(target){var path=this.fromQueryPath(target.parent),query=target.structuredQuery,fromCount=query.from?query.from.length:0;if(0<fromCount){assert(1===fromCount,"StructuredQuery.from with more than one collection is not supported.");var from=query.from[0];path=path.child(from.collectionId)}var filterBy=[];query.where&&(filterBy=this.fromFilter(query.where));var orderBy=[];query.orderBy&&(orderBy=this.fromOrder(query.orderBy));var limit=null;query.limit&&(limit=this.fromInt32Value(query.limit));var startAt=null;query.startAt&&(startAt=this.fromCursor(query.startAt));var endAt=null;return query.endAt&&(endAt=this.fromCursor(query.endAt)),new Query(path,orderBy,filterBy,limit,startAt,endAt)},JsonProtoSerializer.prototype.toListenRequestLabels=function(queryData){var value=this.toLabel(queryData.purpose);return null==value?null:{"goog-listen-tags":value}},JsonProtoSerializer.prototype.toLabel=function(purpose){return purpose===QueryPurpose.Listen?null:purpose===QueryPurpose.ExistenceFilterMismatch?"existence-filter-mismatch":purpose===QueryPurpose.LimboResolution?"limbo-document":fail("Unrecognized query purpose: "+purpose)},JsonProtoSerializer.prototype.toTarget=function(queryData){var query=queryData.query,result;return result=query.isDocumentQuery()?{documents:this.toDocumentsTarget(query)}:{query:this.toQueryTarget(query)},result.targetId=queryData.targetId,0<queryData.resumeToken.length&&(result.resumeToken=this.unsafeCastProtoByteString(queryData.resumeToken)),result},JsonProtoSerializer.prototype.toFilter=function(filters){var _this=this;if(0!==filters.length){var protos=filters.map(function(filter){return filter instanceof RelationFilter?_this.toRelationFilter(filter):_this.toUnaryFilter(filter)});return 1===protos.length?protos[0]:{compositeFilter:{op:"AND",filters:protos}}}},JsonProtoSerializer.prototype.fromFilter=function(filter){var _this=this;return filter?void 0===filter.unaryFilter?void 0===filter.fieldFilter?void 0===filter.compositeFilter?fail("Unknown filter: "+JSON.stringify(filter)):filter.compositeFilter.filters.map(function(f){return _this.fromFilter(f)}).reduce(function(accum,current){return accum.concat(current)}):[this.fromRelationFilter(filter)]:[this.fromUnaryFilter(filter)]:[]},JsonProtoSerializer.prototype.toOrder=function(orderBys){var _this=this;return 0===orderBys.length?void 0:orderBys.map(function(order){return _this.toPropertyOrder(order)})},JsonProtoSerializer.prototype.fromOrder=function(orderBys){var _this=this;return orderBys.map(function(order){return _this.fromPropertyOrder(order)})},JsonProtoSerializer.prototype.toCursor=function(cursor){var _this=this;return{before:cursor.before,values:cursor.position.map(function(component){return _this.toValue(component)})}},JsonProtoSerializer.prototype.fromCursor=function(cursor){var _this=this,before=!!cursor.before,position=cursor.values.map(function(component){return _this.fromValue(component)});return new Bound(position,before)},JsonProtoSerializer.prototype.toDirection=function(dir){return DIRECTIONS[dir.name]},JsonProtoSerializer.prototype.fromDirection=function(dir){return"ASCENDING"===dir?Direction.ASCENDING:"DESCENDING"===dir?Direction.DESCENDING:void 0},JsonProtoSerializer.prototype.toOperatorName=function(op){return OPERATORS[op.name]},JsonProtoSerializer.prototype.fromOperatorName=function(op){return"EQUAL"===op?RelationOp.EQUAL:"GREATER_THAN"===op?RelationOp.GREATER_THAN:"GREATER_THAN_OR_EQUAL"===op?RelationOp.GREATER_THAN_OR_EQUAL:"LESS_THAN"===op?RelationOp.LESS_THAN:"LESS_THAN_OR_EQUAL"===op?RelationOp.LESS_THAN_OR_EQUAL:"ARRAY_CONTAINS"===op?RelationOp.ARRAY_CONTAINS:"OPERATOR_UNSPECIFIED"===op?fail("Unspecified relation"):fail("Unknown relation")},JsonProtoSerializer.prototype.toFieldPathReference=function(path){return{fieldPath:path.canonicalString()}},JsonProtoSerializer.prototype.fromFieldPathReference=function(fieldReference){return FieldPath.fromServerFormat(fieldReference.fieldPath)},JsonProtoSerializer.prototype.toPropertyOrder=function(orderBy){return{field:this.toFieldPathReference(orderBy.field),direction:this.toDirection(orderBy.dir)}},JsonProtoSerializer.prototype.fromPropertyOrder=function(orderBy){return new OrderBy(this.fromFieldPathReference(orderBy.field),this.fromDirection(orderBy.direction))},JsonProtoSerializer.prototype.toRelationFilter=function(filter){return filter instanceof RelationFilter?{fieldFilter:{field:this.toFieldPathReference(filter.field),op:this.toOperatorName(filter.op),value:this.toValue(filter.value)}}:fail("Unrecognized filter: "+JSON.stringify(filter))},JsonProtoSerializer.prototype.fromRelationFilter=function(filter){return new RelationFilter(this.fromFieldPathReference(filter.fieldFilter.field),this.fromOperatorName(filter.fieldFilter.op),this.fromValue(filter.fieldFilter.value))},JsonProtoSerializer.prototype.toUnaryFilter=function(filter){return filter instanceof NanFilter?{unaryFilter:{field:this.toFieldPathReference(filter.field),op:"IS_NAN"}}:filter instanceof NullFilter?{unaryFilter:{field:this.toFieldPathReference(filter.field),op:"IS_NULL"}}:fail("Unrecognized filter: "+JSON.stringify(filter))},JsonProtoSerializer.prototype.fromUnaryFilter=function(filter){switch(filter.unaryFilter.op){case"IS_NAN":var nanField=this.fromFieldPathReference(filter.unaryFilter.field);return new NanFilter(nanField);case"IS_NULL":var nullField=this.fromFieldPathReference(filter.unaryFilter.field);return new NullFilter(nullField);case"OPERATOR_UNSPECIFIED":return fail("Unspecified filter");default:return fail("Unknown filter");}},JsonProtoSerializer.prototype.toDocumentMask=function(fieldMask){return{fieldPaths:fieldMask.fields.map(function(field){return field.canonicalString()})}},JsonProtoSerializer.prototype.fromDocumentMask=function(proto){var paths=proto.fieldPaths||[],fields=paths.map(function(path){return FieldPath.fromServerFormat(path)});return new FieldMask(fields)},JsonProtoSerializer}(),isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},ERROR_NAME="FirebaseError",captureStackTrace=Error.captureStackTrace,FirebaseError=function(){return function(code,message){if(this.code=code,this.message=message,captureStackTrace)captureStackTrace(this,ErrorFactory.prototype.create);else try{throw Error.apply(this,arguments)}catch(err){this.name=ERROR_NAME,Object.defineProperty(this,"stack",{get:function(){return err.stack}})}}}();FirebaseError.prototype=Object.create(Error.prototype),FirebaseError.prototype.constructor=FirebaseError,FirebaseError.prototype.name=ERROR_NAME;var ErrorFactory=function(){function ErrorFactory(service,serviceName,errors){this.service=service,this.serviceName=serviceName,this.errors=errors,this.pattern=/\{\$([^}]+)}/g}return ErrorFactory.prototype.create=function(code,data){void 0===data&&(data={});var template=this.errors[code],fullCode=this.service+"/"+code,message;message=void 0===template?"Error":template.replace(this.pattern,function(match,key){var value=data[key];return void 0===value?"<"+key+"?>":value.toString()}),message=this.serviceName+": "+message+" ("+fullCode+").";var err=new FirebaseError(fullCode,message);for(var prop in data)data.hasOwnProperty(prop)&&"_"!==prop.slice(-1)&&(err[prop]=data[prop]);return err},ErrorFactory}(),Hash=function(){return function(){this.blockSize=-1}}(),Sha1=function(_super){function Sha1(){var _this=_super.call(this)||this;_this.chain_=[],_this.buf_=[],_this.W_=[],_this.pad_=[],_this.inbuf_=0,_this.total_=0,_this.blockSize=64,_this.pad_[0]=128;for(var i=1;i<_this.blockSize;++i)_this.pad_[i]=0;return _this.reset(),_this}return tslib_1.__extends(Sha1,_super),Sha1.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},Sha1.prototype.compress_=function(buf,opt_offset){opt_offset||(opt_offset=0);var W=this.W_;if("string"==typeof buf)for(var i=0;16>i;i++)W[i]=buf.charCodeAt(opt_offset)<<24|buf.charCodeAt(opt_offset+1)<<16|buf.charCodeAt(opt_offset+2)<<8|buf.charCodeAt(opt_offset+3),opt_offset+=4;else for(var i=0;16>i;i++)W[i]=buf[opt_offset]<<24|buf[opt_offset+1]<<16|buf[opt_offset+2]<<8|buf[opt_offset+3],opt_offset+=4;for(var i=16,t;80>i;i++)t=W[i-3]^W[i-8]^W[i-14]^W[i-16],W[i]=4294967295&(t<<1|t>>>31);for(var a=this.chain_[0],b=this.chain_[1],c=this.chain_[2],d=this.chain_[3],e=this.chain_[4],i=0,f,k;80>i;i++){40>i?20>i?(f=d^b&(c^d),k=1518500249):(f=b^c^d,k=1859775393):60>i?(f=b&c|d&(b|c),k=2400959708):(f=b^c^d,k=3395469782);var t=4294967295&(a<<5|a>>>27)+f+e+k+W[i];e=d,d=c,c=4294967295&(b<<30|b>>>2),b=a,a=t}this.chain_[0]=4294967295&this.chain_[0]+a,this.chain_[1]=4294967295&this.chain_[1]+b,this.chain_[2]=4294967295&this.chain_[2]+c,this.chain_[3]=4294967295&this.chain_[3]+d,this.chain_[4]=4294967295&this.chain_[4]+e},Sha1.prototype.update=function(bytes,opt_length){if(null!=bytes){void 0===opt_length&&(opt_length=bytes.length);for(var lengthMinusBlock=opt_length-this.blockSize,n=0,buf=this.buf_,inbuf=this.inbuf_;n<opt_length;){if(0==inbuf)for(;n<=lengthMinusBlock;)this.compress_(bytes,n),n+=this.blockSize;if("string"==typeof bytes){for(;n<opt_length;)if(buf[inbuf]=bytes.charCodeAt(n),++inbuf,++n,inbuf==this.blockSize){this.compress_(buf),inbuf=0;break}}else for(;n<opt_length;)if(buf[inbuf]=bytes[n],++inbuf,++n,inbuf==this.blockSize){this.compress_(buf),inbuf=0;break}}this.inbuf_=inbuf,this.total_+=opt_length}},Sha1.prototype.digest=function(){var digest=[],totalBits=8*this.total_;56>this.inbuf_?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var i=this.blockSize-1;56<=i;i--)this.buf_[i]=255&totalBits,totalBits/=256;this.compress_(this.buf_);for(var n=0,i=0;5>i;i++)for(var j=24;0<=j;j-=8)digest[n]=255&this.chain_[i]>>j,++n;return digest},Sha1}(Hash),StreamBridge=function(){function StreamBridge(args){this.sendFn=args.sendFn,this.closeFn=args.closeFn}return StreamBridge.prototype.onOpen=function(callback){assert(!this.wrappedOnOpen,"Called onOpen on stream twice!"),this.wrappedOnOpen=callback},StreamBridge.prototype.onClose=function(callback){assert(!this.wrappedOnClose,"Called onClose on stream twice!"),this.wrappedOnClose=callback},StreamBridge.prototype.onMessage=function(callback){assert(!this.wrappedOnMessage,"Called onMessage on stream twice!"),this.wrappedOnMessage=callback},StreamBridge.prototype.close=function(){this.closeFn()},StreamBridge.prototype.send=function(msg){this.sendFn(msg)},StreamBridge.prototype.callOnOpen=function(){assert(void 0!==this.wrappedOnOpen,"Cannot call onOpen because no callback was set"),this.wrappedOnOpen()},StreamBridge.prototype.callOnClose=function(err){assert(void 0!==this.wrappedOnClose,"Cannot call onClose because no callback was set"),this.wrappedOnClose(err)},StreamBridge.prototype.callOnMessage=function(msg){assert(void 0!==this.wrappedOnMessage,"Cannot call onMessage because no callback was set"),this.wrappedOnMessage(msg)},StreamBridge}(),LOG_TAG="Connection",RPC_NAME_REST_MAPPING={BatchGetDocuments:"batchGet",Commit:"commit"},WebChannelConnection=function(){function WebChannelConnection(info){this.databaseId=info.databaseId,this.pool=new webchannelWrapper.XhrIoPool;var proto=info.ssl?"https":"http";this.baseUrl=proto+"://"+info.host}return WebChannelConnection.prototype.modifyHeadersForRequest=function(headers,token){if(token)for(var header in token.authHeaders)token.authHeaders.hasOwnProperty(header)&&(headers[header]=token.authHeaders[header]);headers["X-Goog-Api-Client"]="gl-js/ fire/"+SDK_VERSION},WebChannelConnection.prototype.invokeRPC=function(rpcName,request,token){var _this=this,url=this.makeUrl(rpcName);return new Promise(function(resolve,reject){_this.pool.getObject(function(xhr){xhr.listenOnce(webchannelWrapper.EventType.COMPLETE,function(){try{switch(xhr.getLastErrorCode()){case webchannelWrapper.ErrorCode.NO_ERROR:var json=xhr.getResponseJson();debug(LOG_TAG,"XHR received:",JSON.stringify(json)),resolve(json);break;case webchannelWrapper.ErrorCode.TIMEOUT:debug(LOG_TAG,"RPC \""+rpcName+"\" timed out"),reject(new FirestoreError(Code.DEADLINE_EXCEEDED,"Request time out"));break;case webchannelWrapper.ErrorCode.HTTP_ERROR:var status_1=xhr.getStatus();debug(LOG_TAG,"RPC \""+rpcName+"\" failed with status:",status_1,"response text:",xhr.getResponseText()),0<status_1?reject(new FirestoreError(mapCodeFromHttpStatus(status_1),"Server responded with status "+xhr.getStatusText())):(debug(LOG_TAG,"RPC \""+rpcName+"\" failed"),reject(new FirestoreError(Code.UNAVAILABLE,"Connection failed.")));break;default:fail("RPC \""+rpcName+"\" failed with unanticipated webchannel error "+xhr.getLastErrorCode()+": "+xhr.getLastError()+", giving up.");}}finally{debug(LOG_TAG,"RPC \""+rpcName+"\" completed."),_this.pool.releaseObject(xhr)}});var requestString=JSON.stringify(request);debug(LOG_TAG,"XHR sending: ",url+" "+requestString);var headers={"Content-Type":"text/plain"};_this.modifyHeadersForRequest(headers,token),xhr.send(url,"POST",requestString,headers,15)})})},WebChannelConnection.prototype.invokeStreamingRPC=function(rpcName,request,token){return this.invokeRPC(rpcName,request,token)},WebChannelConnection.prototype.openStream=function(rpcName,token){var urlParts=[this.baseUrl,"/","google.firestore.v1beta1.Firestore","/",rpcName,"/channel"],webchannelTransport=webchannelWrapper.createWebChannelTransport(),request={backgroundChannelTest:!0,httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0};this.modifyHeadersForRequest(request.initMessageHeaders,token),isReactNative()||(request.httpHeadersOverwriteParam="$httpHeaders");var url=urlParts.join("");debug(LOG_TAG,"Creating WebChannel: "+url+" "+request);var channel=webchannelTransport.createWebChannel(url,request),opened=!1,closed=!1,streamBridge=new StreamBridge({sendFn:function(msg){closed?debug(LOG_TAG,"Not sending because WebChannel is closed:",msg):(!opened&&(debug(LOG_TAG,"Opening WebChannel transport."),channel.open(),opened=!0),debug(LOG_TAG,"WebChannel sending:",msg),channel.send(msg))},closeFn:function(){return channel.close()}}),unguardedEventListen=function(type,fn){channel.listen(type,function(param){try{fn(param)}catch(e){setTimeout(function(){throw e},0)}})};return unguardedEventListen(webchannelWrapper.WebChannel.EventType.OPEN,function(){closed||debug(LOG_TAG,"WebChannel transport opened.")}),unguardedEventListen(webchannelWrapper.WebChannel.EventType.CLOSE,function(){closed||(closed=!0,debug(LOG_TAG,"WebChannel transport closed"),streamBridge.callOnClose())}),unguardedEventListen(webchannelWrapper.WebChannel.EventType.ERROR,function(err){closed||(closed=!0,debug(LOG_TAG,"WebChannel transport errored:",err),streamBridge.callOnClose(new FirestoreError(Code.UNAVAILABLE,"The operation could not be completed")))}),unguardedEventListen(webchannelWrapper.WebChannel.EventType.MESSAGE,function(msg){if(!closed){var msgData=msg.data[0];assert(!!msgData,"Got a webchannel message without data.");var error$$1=msgData.error||msgData[0]&&msgData[0].error;if(error$$1){debug(LOG_TAG,"WebChannel received error:",error$$1);var status_2=error$$1.status,code=mapCodeFromRpcStatus(status_2),message=error$$1.message;void 0===code&&(code=Code.INTERNAL,message="Unknown error status: "+status_2+" with message "+error$$1.message),closed=!0,streamBridge.callOnClose(new FirestoreError(code,message)),channel.close()}else debug(LOG_TAG,"WebChannel received:",msgData),streamBridge.callOnMessage(msgData)}}),setTimeout(function(){streamBridge.callOnOpen()},0),streamBridge},WebChannelConnection.prototype.makeUrl=function(rpcName){var urlRpcName=RPC_NAME_REST_MAPPING[rpcName];assert(void 0!==urlRpcName,"Unknown REST mapping for: "+rpcName);var url=[this.baseUrl,"/","v1beta1","/projects/",this.databaseId.projectId,"/databases/",this.databaseId.database,"/documents",":",urlRpcName];return url.join("")},WebChannelConnection}(),BrowserPlatform=function(){function BrowserPlatform(){this.emptyByteString="",this.base64Available="undefined"!=typeof atob}return Object.defineProperty(BrowserPlatform.prototype,"document",{get:function(){return"undefined"==typeof document?null:document},enumerable:!0,configurable:!0}),Object.defineProperty(BrowserPlatform.prototype,"window",{get:function(){return"undefined"==typeof window?null:window},enumerable:!0,configurable:!0}),BrowserPlatform.prototype.loadConnection=function(databaseInfo){return Promise.resolve(new WebChannelConnection(databaseInfo))},BrowserPlatform.prototype.newSerializer=function(databaseId){return new JsonProtoSerializer(databaseId,{useProto3Json:!0})},BrowserPlatform.prototype.formatJSON=function(value){return JSON.stringify(value)},BrowserPlatform.prototype.atob=function(encoded){return atob(encoded)},BrowserPlatform.prototype.btoa=function(raw){return btoa(raw)},BrowserPlatform}();PlatformSupport.setPlatform(new BrowserPlatform);var ListenSequence=function(){function ListenSequence(previousValue,sequenceNumberSyncer){var _this=this;this.previousValue=previousValue,sequenceNumberSyncer&&(sequenceNumberSyncer.sequenceNumberHandler=function(sequenceNumber){return _this.setPreviousValue(sequenceNumber)},this.writeNewSequenceNumber=function(sequenceNumber){return sequenceNumberSyncer.writeSequenceNumber(sequenceNumber)})}return ListenSequence.prototype.setPreviousValue=function(externalPreviousValue){return this.previousValue=_Mathmax3(externalPreviousValue,this.previousValue),this.previousValue},ListenSequence.prototype.next=function(){var nextValue=++this.previousValue;return this.writeNewSequenceNumber&&this.writeNewSequenceNumber(nextValue),nextValue},ListenSequence.INVALID=-1,ListenSequence}(),Deferred$1=function(){return function(){var _this=this;this.promise=new Promise(function(resolve,reject){_this.resolve=resolve,_this.reject=reject})}}(),TimerId;(function(TimerId){TimerId.All="all",TimerId.ListenStreamIdle="listen_stream_idle",TimerId.ListenStreamConnectionBackoff="listen_stream_connection_backoff",TimerId.WriteStreamIdle="write_stream_idle",TimerId.WriteStreamConnectionBackoff="write_stream_connection_backoff",TimerId.OnlineStateTimeout="online_state_timeout",TimerId.ClientMetadataRefresh="client_metadata_refresh"})(TimerId||(TimerId={}));var DelayedOperation=function(){function DelayedOperation(asyncQueue,timerId,targetTimeMs,op,removalCallback){this.asyncQueue=asyncQueue,this.timerId=timerId,this.targetTimeMs=targetTimeMs,this.op=op,this.removalCallback=removalCallback,this.deferred=new Deferred$1,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.catch=this.deferred.promise.catch.bind(this.deferred.promise),this.deferred.promise.catch(function(){})}return DelayedOperation.createAndSchedule=function(asyncQueue,timerId,delayMs,op,removalCallback){var targetTime=Date.now()+delayMs,delayedOp=new DelayedOperation(asyncQueue,timerId,targetTime,op,removalCallback);return delayedOp.start(delayMs),delayedOp},DelayedOperation.prototype.start=function(delayMs){var _this=this;this.timerHandle=setTimeout(function(){return _this.handleDelayElapsed()},delayMs)},DelayedOperation.prototype.skipDelay=function(){return this.handleDelayElapsed()},DelayedOperation.prototype.cancel=function(reason){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new FirestoreError(Code.CANCELLED,"Operation cancelled"+(reason?": "+reason:""))))},DelayedOperation.prototype.handleDelayElapsed=function(){var _this=this;this.asyncQueue.enqueueAndForget(function(){return null===_this.timerHandle?Promise.resolve():(_this.clearTimeout(),_this.op().then(function(result){return _this.deferred.resolve(result)}))})},DelayedOperation.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},DelayedOperation}(),AsyncQueue=function(){function AsyncQueue(){this.tail=Promise.resolve(),this.delayedOperations=[],this.operationInProgress=!1}return AsyncQueue.prototype.enqueueAndForget=function(op){this.enqueue(op)},AsyncQueue.prototype.enqueue=function(op){var _this=this;this.verifyNotFailed();var newTail=this.tail.then(function(){return _this.operationInProgress=!0,op().catch(function(error$$1){_this.failure=error$$1,_this.operationInProgress=!1;var message=error$$1.stack||error$$1.message||"";throw error("INTERNAL UNHANDLED ERROR: ",message),0>message.indexOf("Firestore Test Simulated Error")&&setTimeout(function(){throw error$$1},0),error$$1}).then(function(result){return _this.operationInProgress=!1,result})});return this.tail=newTail,newTail},AsyncQueue.prototype.enqueueAfterDelay=function(timerId,delayMs,op){var _this=this;this.verifyNotFailed(),assert(0<=delayMs,"Attempted to schedule an operation with a negative delay of "+delayMs),assert(!this.containsDelayedOperation(timerId),"Attempted to schedule multiple operations with timer id "+timerId+".");var delayedOp=DelayedOperation.createAndSchedule(this,timerId,delayMs,op,function(op){return _this.removeDelayedOperation(op)});return this.delayedOperations.push(delayedOp),delayedOp},AsyncQueue.prototype.verifyNotFailed=function(){this.failure&&fail("AsyncQueue is already failed: "+(this.failure.stack||this.failure.message))},AsyncQueue.prototype.verifyOperationInProgress=function(){assert(this.operationInProgress,"verifyOpInProgress() called when no op in progress on this queue.")},AsyncQueue.prototype.drain=function(){return this.enqueue(function(){return Promise.resolve()})},AsyncQueue.prototype.containsDelayedOperation=function(timerId){for(var _i=0,_a=this.delayedOperations,op;_i<_a.length;_i++)if(op=_a[_i],op.timerId===timerId)return!0;return!1},AsyncQueue.prototype.runDelayedOperationsEarly=function(lastTimerId){var _this=this;return this.drain().then(function(){assert(lastTimerId===TimerId.All||_this.containsDelayedOperation(lastTimerId),"Attempted to drain to missing operation "+lastTimerId),_this.delayedOperations.sort(function(a,b){return a.targetTimeMs-b.targetTimeMs});for(var _i=0,_a=_this.delayedOperations,op;_i<_a.length&&(op=_a[_i],op.skipDelay(),lastTimerId===TimerId.All||op.timerId!==lastTimerId);_i++);return _this.drain()})},AsyncQueue.prototype.removeDelayedOperation=function(op){var index=this.delayedOperations.indexOf(op);assert(0<=index,"Delayed operation not found."),this.delayedOperations.splice(index,1)},AsyncQueue}(),escapeChar="\x01",encodedSeparatorChar="\x01",encodedNul="\x10",encodedEscape="\x11",BATCHID_UNKNOWN=-1,MutationBatch=function(){function MutationBatch(batchId,localWriteTime,mutations){this.batchId=batchId,this.localWriteTime=localWriteTime,this.mutations=mutations,assert(0<mutations.length,"Cannot create an empty mutation batch")}return MutationBatch.prototype.applyToRemoteDocument=function(docKey,maybeDoc,batchResult){maybeDoc&&assert(maybeDoc.key.isEqual(docKey),"applyToRemoteDocument: key "+docKey+" should match maybeDoc key\n "+maybeDoc.key);var mutationResults=batchResult.mutationResults;assert(mutationResults.length===this.mutations.length,"Mismatch between mutations length\n ("+this.mutations.length+") and mutation results length\n ("+mutationResults.length+").");for(var i=0,mutation;i<this.mutations.length;i++)if(mutation=this.mutations[i],mutation.key.isEqual(docKey)){var mutationResult=mutationResults[i];maybeDoc=mutation.applyToRemoteDocument(maybeDoc,mutationResult)}return maybeDoc},MutationBatch.prototype.applyToLocalView=function(docKey,maybeDoc){maybeDoc&&assert(maybeDoc.key.isEqual(docKey),"applyToLocalDocument: key "+docKey+" should match maybeDoc key\n "+maybeDoc.key);for(var baseDoc=maybeDoc,i=0,mutation;i<this.mutations.length;i++)mutation=this.mutations[i],mutation.key.isEqual(docKey)&&(maybeDoc=mutation.applyToLocalView(maybeDoc,baseDoc,this.localWriteTime));return maybeDoc},MutationBatch.prototype.keys=function(){for(var keySet=documentKeySet(),_i=0,_a=this.mutations,mutation;_i<_a.length;_i++)mutation=_a[_i],keySet=keySet.add(mutation.key);return keySet},MutationBatch.prototype.isEqual=function(other){return this.batchId===other.batchId&&arrayEquals(this.mutations,other.mutations)},MutationBatch}(),MutationBatchResult=function(){function MutationBatchResult(batch,commitVersion,mutationResults,streamToken,docVersions){this.batch=batch,this.commitVersion=commitVersion,this.mutationResults=mutationResults,this.streamToken=streamToken,this.docVersions=docVersions}return MutationBatchResult.from=function(batch,commitVersion,results,streamToken){assert(batch.mutations.length===results.length,"Mutations sent "+batch.mutations.length+" must equal results received "+results.length);for(var versionMap=documentVersionMap(),mutations=batch.mutations,i=0;i<mutations.length;i++)versionMap=versionMap.insert(mutations[i].key,results[i].version);return new MutationBatchResult(batch,commitVersion,results,streamToken,versionMap)},MutationBatchResult}(),PersistencePromise=function(){function PersistencePromise(callback){var _this=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,callback(function(value){_this.isDone=!0,_this.result=value,_this.nextCallback&&_this.nextCallback(value)},function(error){_this.isDone=!0,_this.error=error,_this.catchCallback&&_this.catchCallback(error)})}return PersistencePromise.prototype.catch=function(fn){return this.next(void 0,fn)},PersistencePromise.prototype.next=function(nextFn,catchFn){var _this=this;return this.callbackAttached&&fail("Called next() or catch() twice for PersistencePromise"),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(catchFn,this.error):this.wrapSuccess(nextFn,this.result):new PersistencePromise(function(resolve,reject){_this.nextCallback=function(value){_this.wrapSuccess(nextFn,value).next(resolve,reject)},_this.catchCallback=function(error){_this.wrapFailure(catchFn,error).next(resolve,reject)}})},PersistencePromise.prototype.toPromise=function(){var _this=this;return new Promise(function(resolve,reject){_this.next(resolve,reject)})},PersistencePromise.prototype.wrapUserFunction=function(fn){try{var result=fn();return result instanceof PersistencePromise?result:PersistencePromise.resolve(result)}catch(e){return PersistencePromise.reject(e)}},PersistencePromise.prototype.wrapSuccess=function(nextFn,value){return nextFn?this.wrapUserFunction(function(){return nextFn(value)}):PersistencePromise.resolve(value)},PersistencePromise.prototype.wrapFailure=function(catchFn,error){return catchFn?this.wrapUserFunction(function(){return catchFn(error)}):PersistencePromise.reject(error)},PersistencePromise.resolve=function(result){return new PersistencePromise(function(resolve){resolve(result)})},PersistencePromise.reject=function(error){return new PersistencePromise(function(resolve,reject){reject(error)})},PersistencePromise.waitFor=function(all){return new PersistencePromise(function(resolve,reject){var expectedCount=0,resolvedCount=0,done=!1;all.forEach(function(element){++expectedCount,element.next(function(){++resolvedCount,done&&resolvedCount==expectedCount&&resolve()},function(err){return reject(err)})}),done=!0,resolvedCount==expectedCount&&resolve()})},PersistencePromise.or=function(predicates){for(var p=PersistencePromise.resolve(!1),_loop_1=function(predicate){p=p.next(function(isTrue){return isTrue?PersistencePromise.resolve(isTrue):predicate()})},_i=0,predicates_1=predicates,predicate;_i<predicates_1.length;_i++)predicate=predicates_1[_i],_loop_1(predicate);return p},PersistencePromise.forEach=function(collection,f){var _this=this,promises=[];return collection.forEach(function(r,s){promises.push(f.call(_this,r,s))}),this.waitFor(promises)},PersistencePromise}(),ObjectMap=function(){function ObjectMap(mapKeyFn){this.mapKeyFn=mapKeyFn,this.inner={}}return ObjectMap.prototype.get=function(key){var id=this.mapKeyFn(key),matches=this.inner[id];if(void 0!==matches)for(var _i=0,matches_1=matches;_i<matches_1.length;_i++){var _a=matches_1[_i],otherKey=_a[0],value=_a[1];if(otherKey.isEqual(key))return value}},ObjectMap.prototype.has=function(key){return void 0!==this.get(key)},ObjectMap.prototype.set=function(key,value){var id=this.mapKeyFn(key),matches=this.inner[id];if(void 0===matches)return void(this.inner[id]=[[key,value]]);for(var i=0;i<matches.length;i++)if(matches[i][0].isEqual(key))return void(matches[i]=[key,value]);matches.push([key,value])},ObjectMap.prototype.delete=function(key){var id=this.mapKeyFn(key),matches=this.inner[id];if(void 0===matches)return!1;for(var i=0;i<matches.length;i++)if(matches[i][0].isEqual(key))return 1===matches.length?delete this.inner[id]:matches.splice(i,1),!0;return!1},ObjectMap.prototype.forEach=function(fn){forEach(this.inner,function(_,entries){for(var _i=0,entries_1=entries;_i<entries_1.length;_i++){var _a=entries_1[_i],k=_a[0],v=_a[1];fn(k,v)}})},ObjectMap.prototype.isEmpty=function(){return isEmpty(this.inner)},ObjectMap}(),RemoteDocumentChangeBuffer=function(){function RemoteDocumentChangeBuffer(){this.changes=maybeDocumentMap(),this.documentSizes=new ObjectMap(function(key){return key.toString()})}return RemoteDocumentChangeBuffer.prototype.addEntry=function(maybeDocument){var changes=this.assertChanges();this.changes=changes.insert(maybeDocument.key,maybeDocument)},RemoteDocumentChangeBuffer.prototype.getEntry=function(transaction,documentKey){var _this=this,changes=this.assertChanges(),bufferedEntry=changes.get(documentKey);return bufferedEntry?PersistencePromise.resolve(bufferedEntry):this.getFromCache(transaction,documentKey).next(function(getResult){return null===getResult?(_this.documentSizes.set(documentKey,0),null):(_this.documentSizes.set(documentKey,getResult.size),getResult.maybeDocument)})},RemoteDocumentChangeBuffer.prototype.apply=function(transaction){var result=this.applyChanges(transaction);return this.changes=null,result},RemoteDocumentChangeBuffer.prototype.assertChanges=function(){return assert(null!==this.changes,"Changes have already been applied."),this.changes},RemoteDocumentChangeBuffer}(),LOG_TAG$1="SimpleDb",SimpleDb=function(){function SimpleDb(db){this.db=db}return SimpleDb.openOrCreate=function(name,version,schemaConverter){return assert(SimpleDb.isAvailable(),"IndexedDB not supported in current environment."),debug(LOG_TAG$1,"Opening database:",name),new PersistencePromise(function(resolve,reject){var request=window.indexedDB.open(name,version);request.onsuccess=function(event){var db=event.target.result;resolve(new SimpleDb(db))},request.onblocked=function(){reject(new FirestoreError(Code.FAILED_PRECONDITION,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},request.onerror=function(event){reject(event.target.error)},request.onupgradeneeded=function(event){debug(LOG_TAG$1,"Database \""+name+"\" requires upgrade from version:",event.oldVersion);var db=event.target.result,txn=new SimpleDbTransaction(request.transaction);schemaConverter.createOrUpgrade(db,txn,event.oldVersion,SCHEMA_VERSION).next(function(){debug(LOG_TAG$1,"Database upgrade to version "+SCHEMA_VERSION+" complete")})}}).toPromise()},SimpleDb.delete=function(name){return debug(LOG_TAG$1,"Removing database:",name),wrapRequest(window.indexedDB.deleteDatabase(name)).toPromise()},SimpleDb.isAvailable=function(){if("undefined"==typeof window||null==window.indexedDB)return!1;if(void 0===window.navigator)return"YES"===process.env.USE_MOCK_PERSISTENCE;var ua=window.navigator.userAgent;return 0<ua.indexOf("MSIE ")||0<ua.indexOf("Trident/")||0<ua.indexOf("Edge/")?!1:!0},SimpleDb.getStore=function(txn,store){return txn.store(store)},SimpleDb.prototype.runTransaction=function(mode,objectStores,transactionFn){var transaction=SimpleDbTransaction.open(this.db,mode,objectStores),transactionFnResult=transactionFn(transaction).catch(function(error$$1){transaction.abort(error$$1)}).toPromise();return transaction.completionPromise.then(function(){return transactionFnResult})},SimpleDb.prototype.close=function(){this.db.close()},SimpleDb}(),IterationController=function(){function IterationController(dbCursor){this.dbCursor=dbCursor,this.shouldStop=!1,this.nextKey=null}return Object.defineProperty(IterationController.prototype,"isDone",{get:function(){return this.shouldStop},enumerable:!0,configurable:!0}),Object.defineProperty(IterationController.prototype,"skipToKey",{get:function(){return this.nextKey},enumerable:!0,configurable:!0}),Object.defineProperty(IterationController.prototype,"cursor",{set:function(value){this.dbCursor=value},enumerable:!0,configurable:!0}),IterationController.prototype.done=function(){this.shouldStop=!0},IterationController.prototype.skip=function(key){this.nextKey=key},IterationController.prototype.delete=function(){return wrapRequest(this.dbCursor.delete())},IterationController}(),SimpleDbTransaction=function(){function SimpleDbTransaction(transaction){var _this=this;this.transaction=transaction,this.aborted=!1,this.completionDeferred=new Deferred$1,this.transaction.oncomplete=function(){_this.completionDeferred.resolve()},this.transaction.onabort=function(){transaction.error?_this.completionDeferred.reject(transaction.error):_this.completionDeferred.resolve()},this.transaction.onerror=function(event){_this.completionDeferred.reject(event.target.error)}}return SimpleDbTransaction.open=function(db,mode,objectStoreNames){return new SimpleDbTransaction(db.transaction(objectStoreNames,mode))},Object.defineProperty(SimpleDbTransaction.prototype,"completionPromise",{get:function(){return this.completionDeferred.promise},enumerable:!0,configurable:!0}),SimpleDbTransaction.prototype.abort=function(error$$1){error$$1&&this.completionDeferred.reject(error$$1),this.aborted||(debug(LOG_TAG$1,"Aborting transaction:",error$$1?error$$1.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},SimpleDbTransaction.prototype.store=function(storeName){var store=this.transaction.objectStore(storeName);return assert(!!store,"Object store not part of transaction: "+storeName),new SimpleDbStore(store)},SimpleDbTransaction}(),SimpleDbStore=function(){function SimpleDbStore(store){this.store=store}return SimpleDbStore.prototype.put=function(keyOrValue,value){var request;return void 0===value?(debug(LOG_TAG$1,"PUT",this.store.name,"<auto-key>",keyOrValue),request=this.store.put(keyOrValue)):(debug(LOG_TAG$1,"PUT",this.store.name,keyOrValue,value),request=this.store.put(value,keyOrValue)),wrapRequest(request)},SimpleDbStore.prototype.add=function(value){debug(LOG_TAG$1,"ADD",this.store.name,value,value);var request=this.store.add(value);return wrapRequest(request)},SimpleDbStore.prototype.get=function(key){var _this=this,request=this.store.get(key);return wrapRequest(request).next(function(result){return void 0===result&&(result=null),debug(LOG_TAG$1,"GET",_this.store.name,key,result),result})},SimpleDbStore.prototype.delete=function(key){debug(LOG_TAG$1,"DELETE",this.store.name,key);var request=this.store.delete(key);return wrapRequest(request)},SimpleDbStore.prototype.count=function(){debug(LOG_TAG$1,"COUNT",this.store.name);var request=this.store.count();return wrapRequest(request)},SimpleDbStore.prototype.loadAll=function(indexOrRange,range){var cursor=this.cursor(this.options(indexOrRange,range)),results=[];return this.iterateCursor(cursor,function(key,value){results.push(value)}).next(function(){return results})},SimpleDbStore.prototype.deleteAll=function(indexOrRange,range){debug(LOG_TAG$1,"DELETE ALL",this.store.name);var options=this.options(indexOrRange,range);options.keysOnly=!1;var cursor=this.cursor(options);return this.iterateCursor(cursor,function(key,value,control){return control.delete()})},SimpleDbStore.prototype.iterate=function(optionsOrCallback,callback){var options;callback?options=optionsOrCallback:(options={},callback=optionsOrCallback);var cursor=this.cursor(options);return this.iterateCursor(cursor,callback)},SimpleDbStore.prototype.iterateSerial=function(callback){var cursorRequest=this.cursor({});return new PersistencePromise(function(resolve,reject){cursorRequest.onerror=function(event){reject(event.target.error)},cursorRequest.onsuccess=function(event){var cursor=event.target.result;return cursor?void callback(cursor.primaryKey,cursor.value).next(function(shouldContinue){shouldContinue?cursor.continue():resolve()}):void resolve()}})},SimpleDbStore.prototype.iterateCursor=function(cursorRequest,fn){var results=[];return new PersistencePromise(function(resolve,reject){cursorRequest.onerror=function(event){reject(event.target.error)},cursorRequest.onsuccess=function(event){var cursor=event.target.result;if(!cursor)return void resolve();var controller=new IterationController(cursor),userResult=fn(cursor.primaryKey,cursor.value,controller);if(userResult instanceof PersistencePromise){var userPromise=userResult.catch(function(err){return controller.done(),PersistencePromise.reject(err)});results.push(userPromise)}controller.isDone?resolve():null===controller.skipToKey?cursor.continue():cursor.continue(controller.skipToKey)}}).next(function(){return PersistencePromise.waitFor(results)})},SimpleDbStore.prototype.options=function(indexOrRange,range){var indexName;return void 0!==indexOrRange&&("string"==typeof indexOrRange?indexName=indexOrRange:(assert(void 0===range,"3rd argument must not be defined if 2nd is a range."),range=indexOrRange)),{index:indexName,range:range}},SimpleDbStore.prototype.cursor=function(options){var direction="next";if(options.reverse&&(direction="prev"),options.index){var index=this.store.index(options.index);return options.keysOnly?index.openKeyCursor(options.range,direction):index.openCursor(options.range,direction)}return this.store.openCursor(options.range,direction)},SimpleDbStore}(),REMOTE_DOCUMENT_CHANGE_MISSING_ERR_MSG="The remote document changelog no longer contains all changes for all local query views. It may be necessary to rebuild these views.",IndexedDbRemoteDocumentCache=function(){function IndexedDbRemoteDocumentCache(serializer,keepDocumentChangeLog){this.serializer=serializer,this.keepDocumentChangeLog=keepDocumentChangeLog,this._lastProcessedDocumentChangeId=0}return Object.defineProperty(IndexedDbRemoteDocumentCache.prototype,"lastProcessedDocumentChangeId",{get:function(){return this._lastProcessedDocumentChangeId},enumerable:!0,configurable:!0}),IndexedDbRemoteDocumentCache.prototype.start=function(transaction){var store=SimpleDb.getStore(transaction,DbRemoteDocumentChanges.store);return this.synchronizeLastDocumentChangeId(store)},IndexedDbRemoteDocumentCache.prototype.addEntries=function(transaction,entries,sizeDelta){var promises=[];if(0<entries.length){for(var documentStore=remoteDocumentsStore(transaction),changedKeys=documentKeySet(),_i=0,entries_1=entries;_i<entries_1.length;_i++){var _a=entries_1[_i],key=_a.key,doc=_a.doc;promises.push(documentStore.put(dbKey(key),doc)),changedKeys=changedKeys.add(key)}this.keepDocumentChangeLog&&promises.push(documentChangesStore(transaction).put({changes:this.serializer.toDbResourcePaths(changedKeys)})),promises.push(this.updateSize(transaction,sizeDelta))}return PersistencePromise.waitFor(promises)},IndexedDbRemoteDocumentCache.prototype.removeEntry=function(transaction,documentKey){var store=remoteDocumentsStore(transaction),key=dbKey(documentKey);return store.get(key).next(function(document){return document?store.delete(key).next(function(){return dbDocumentSize(document)}):PersistencePromise.resolve(0)})},IndexedDbRemoteDocumentCache.prototype.getEntry=function(transaction,documentKey){var _this=this;return remoteDocumentsStore(transaction).get(dbKey(documentKey)).next(function(dbRemoteDoc){return dbRemoteDoc?_this.serializer.fromDbRemoteDocument(dbRemoteDoc):null})},IndexedDbRemoteDocumentCache.prototype.getSizedEntry=function(transaction,documentKey){var _this=this;return remoteDocumentsStore(transaction).get(dbKey(documentKey)).next(function(dbRemoteDoc){return dbRemoteDoc?{maybeDocument:_this.serializer.fromDbRemoteDocument(dbRemoteDoc),size:dbDocumentSize(dbRemoteDoc)}:null})},IndexedDbRemoteDocumentCache.prototype.getDocumentsMatchingQuery=function(transaction,query){var _this=this,results=documentMap(),startKey=query.path.toArray(),range=IDBKeyRange.lowerBound(startKey);return remoteDocumentsStore(transaction).iterate({range:range},function(key,dbRemoteDoc,control){var maybeDoc=_this.serializer.fromDbRemoteDocument(dbRemoteDoc);query.path.isPrefixOf(maybeDoc.key.path)?maybeDoc instanceof Document&&query.matches(maybeDoc)&&(results=results.insert(maybeDoc.key,maybeDoc)):control.done()}).next(function(){return results})},IndexedDbRemoteDocumentCache.prototype.getNewDocumentChanges=function(transaction){var _this=this;assert(this.keepDocumentChangeLog,"Can only call getNewDocumentChanges() when document change log is enabled");var changedKeys=documentKeySet(),changedDocs=maybeDocumentMap(),range=IDBKeyRange.lowerBound(this._lastProcessedDocumentChangeId+1),firstIteration=!0,changesStore=documentChangesStore(transaction);return changesStore.iterate({range:range},function(_,documentChange){return firstIteration&&(firstIteration=!1,_this._lastProcessedDocumentChangeId+1!==documentChange.id)?_this.synchronizeLastDocumentChangeId(changesStore).next(function(){return PersistencePromise.reject(new FirestoreError(Code.DATA_LOSS,REMOTE_DOCUMENT_CHANGE_MISSING_ERR_MSG))}):void(changedKeys=changedKeys.unionWith(_this.serializer.fromDbResourcePaths(documentChange.changes)),_this._lastProcessedDocumentChangeId=documentChange.id)}).next(function(){var documentPromises=[];return changedKeys.forEach(function(key){documentPromises.push(_this.getEntry(transaction,key).next(function(maybeDocument){var doc=maybeDocument||new NoDocument(key,SnapshotVersion.forDeletedDoc());changedDocs=changedDocs.insert(key,doc)}))}),PersistencePromise.waitFor(documentPromises)}).next(function(){return changedDocs})},IndexedDbRemoteDocumentCache.prototype.removeDocumentChangesThroughChangeId=function(transaction,changeId){var range=IDBKeyRange.upperBound(changeId);return documentChangesStore(transaction).delete(range)},IndexedDbRemoteDocumentCache.prototype.synchronizeLastDocumentChangeId=function(documentChangesStore){var _this=this;return this._lastProcessedDocumentChangeId=0,documentChangesStore.iterate({keysOnly:!0,reverse:!0},function(key,value,control){_this._lastProcessedDocumentChangeId=key,control.done()})},IndexedDbRemoteDocumentCache.prototype.newChangeBuffer=function(){return new IndexedDbRemoteDocumentChangeBuffer(this)},IndexedDbRemoteDocumentCache.prototype.getSize=function(txn){return this.getMetadata(txn).next(function(metadata){return metadata.byteSize})},IndexedDbRemoteDocumentCache.prototype.getMetadata=function(txn){return documentGlobalStore(txn).get(DbRemoteDocumentGlobal.key).next(function(metadata){return assert(!!metadata,"Missing document cache metadata"),metadata})},IndexedDbRemoteDocumentCache.prototype.setMetadata=function(txn,metadata){return documentGlobalStore(txn).put(DbRemoteDocumentGlobal.key,metadata)},IndexedDbRemoteDocumentCache.prototype.updateSize=function(txn,sizeDelta){var _this=this;return this.getMetadata(txn).next(function(metadata){return metadata.byteSize+=sizeDelta,_this.setMetadata(txn,metadata)})},IndexedDbRemoteDocumentCache}(),IndexedDbRemoteDocumentChangeBuffer=function(_super){function IndexedDbRemoteDocumentChangeBuffer(documentCache){var _this=_super.call(this)||this;return _this.documentCache=documentCache,_this}return tslib_1.__extends(IndexedDbRemoteDocumentChangeBuffer,_super),IndexedDbRemoteDocumentChangeBuffer.prototype.applyChanges=function(transaction){var _this=this,changes=this.assertChanges(),delta=0,toApply=[];return changes.forEach(function(key,maybeDocument){var doc=_this.documentCache.serializer.toDbRemoteDocument(maybeDocument),previousSize=_this.documentSizes.get(key);assert(void 0!==previousSize,"Attempting to change document "+key.toString()+" without having read it first");var size=dbDocumentSize(doc);delta+=size-previousSize,toApply.push({key:key,doc:doc})}),this.documentCache.addEntries(transaction,toApply,delta)},IndexedDbRemoteDocumentChangeBuffer.prototype.getFromCache=function(transaction,documentKey){return this.documentCache.getSizedEntry(transaction,documentKey)},IndexedDbRemoteDocumentChangeBuffer}(RemoteDocumentChangeBuffer),SCHEMA_VERSION=6,SchemaConverter=function(){function SchemaConverter(serializer){this.serializer=serializer}return SchemaConverter.prototype.createOrUpgrade=function(db,txn,fromVersion,toVersion){var _this=this;assert(fromVersion<toVersion&&0<=fromVersion&&toVersion<=SCHEMA_VERSION,"Unexpected schema upgrade from v"+fromVersion+" to v{toVersion}."),1>fromVersion&&1<=toVersion&&(createPrimaryClientStore(db),createMutationQueue(db),createQueryCache(db),createRemoteDocumentCache(db));var p=PersistencePromise.resolve();return 3>fromVersion&&3<=toVersion&&(0!==fromVersion&&(dropQueryCache(db),createQueryCache(db)),p=p.next(function(){return writeEmptyTargetGlobalEntry(txn)})),4>fromVersion&&4<=toVersion&&(0!==fromVersion&&(p=p.next(function(){return upgradeMutationBatchSchemaAndMigrateData(db,txn)})),p=p.next(function(){createClientMetadataStore(db),createRemoteDocumentChangesStore(db)})),5>fromVersion&&5<=toVersion&&(p=p.next(function(){return _this.removeAcknowledgedMutations(txn)})),6>fromVersion&&6<=toVersion&&(p=p.next(function(){return createDocumentGlobalStore(db),_this.addDocumentGlobal(txn)})),p},SchemaConverter.prototype.addDocumentGlobal=function(txn){var byteCount=0;return txn.store(DbRemoteDocument.store).iterate(function(_,doc){byteCount+=dbDocumentSize(doc)}).next(function(){var metadata=new DbRemoteDocumentGlobal(byteCount);return txn.store(DbRemoteDocumentGlobal.store).put(DbRemoteDocumentGlobal.key,metadata)})},SchemaConverter.prototype.removeAcknowledgedMutations=function(txn){var _this=this,queuesStore=txn.store(DbMutationQueue.store),mutationsStore=txn.store(DbMutationBatch.store);return queuesStore.loadAll().next(function(queues){return PersistencePromise.forEach(queues,function(queue){var range=IDBKeyRange.bound([queue.userId,BATCHID_UNKNOWN],[queue.userId,queue.lastAcknowledgedBatchId]);return mutationsStore.loadAll(DbMutationBatch.userMutationsIndex,range).next(function(dbBatches){return PersistencePromise.forEach(dbBatches,function(dbBatch){assert(dbBatch.userId===queue.userId,"Cannot process batch "+dbBatch.batchId+" from unexpected user");var batch=_this.serializer.fromDbMutationBatch(dbBatch);return removeMutationBatch(txn,queue.userId,batch).next(function(){})})})})})},SchemaConverter}(),DbTimestamp=function(){return function(seconds,nanoseconds){this.seconds=seconds,this.nanoseconds=nanoseconds}}(),DbPrimaryClient=function(){function DbPrimaryClient(ownerId,allowTabSynchronization,leaseTimestampMs){this.ownerId=ownerId,this.allowTabSynchronization=allowTabSynchronization,this.leaseTimestampMs=leaseTimestampMs}return DbPrimaryClient.store="owner",DbPrimaryClient.key="owner",DbPrimaryClient}(),DbMutationQueue=function(){function DbMutationQueue(userId,lastAcknowledgedBatchId,lastStreamToken){this.userId=userId,this.lastAcknowledgedBatchId=lastAcknowledgedBatchId,this.lastStreamToken=lastStreamToken}return DbMutationQueue.store="mutationQueues",DbMutationQueue.keyPath="userId",DbMutationQueue}(),DbMutationBatch=function(){function DbMutationBatch(userId,batchId,localWriteTimeMs,mutations){this.userId=userId,this.batchId=batchId,this.localWriteTimeMs=localWriteTimeMs,this.mutations=mutations}return DbMutationBatch.store="mutations",DbMutationBatch.keyPath="batchId",DbMutationBatch.userMutationsIndex="userMutationsIndex",DbMutationBatch.userMutationsKeyPath=["userId","batchId"],DbMutationBatch}(),DbDocumentMutation=function(){function DbDocumentMutation(){}return DbDocumentMutation.prefixForUser=function(userId){return[userId]},DbDocumentMutation.prefixForPath=function(userId,path){return[userId,encode(path)]},DbDocumentMutation.key=function(userId,path,batchId){return[userId,encode(path),batchId]},DbDocumentMutation.store="documentMutations",DbDocumentMutation.PLACEHOLDER=new DbDocumentMutation,DbDocumentMutation}(),DbNoDocument=function(){return function(path,readTime){this.path=path,this.readTime=readTime}}(),DbUnknownDocument=function(){return function(path,version){this.path=path,this.version=version}}(),DbRemoteDocument=function(){function DbRemoteDocument(unknownDocument,noDocument,document,hasCommittedMutations){this.unknownDocument=unknownDocument,this.noDocument=noDocument,this.document=document,this.hasCommittedMutations=hasCommittedMutations}return DbRemoteDocument.store="remoteDocuments",DbRemoteDocument}(),DbRemoteDocumentGlobal=function(){function DbRemoteDocumentGlobal(byteSize){this.byteSize=byteSize}return DbRemoteDocumentGlobal.store="remoteDocumentGlobal",DbRemoteDocumentGlobal.key="remoteDocumentGlobalKey",DbRemoteDocumentGlobal}(),DbTarget=function(){function DbTarget(targetId,canonicalId,readTime,resumeToken,lastListenSequenceNumber,query){this.targetId=targetId,this.canonicalId=canonicalId,this.readTime=readTime,this.resumeToken=resumeToken,this.lastListenSequenceNumber=lastListenSequenceNumber,this.query=query}return DbTarget.store="targets",DbTarget.keyPath="targetId",DbTarget.queryTargetsIndexName="queryTargetsIndex",DbTarget.queryTargetsKeyPath=["canonicalId","targetId"],DbTarget}(),DbTargetDocument=function(){function DbTargetDocument(targetId,path,sequenceNumber){this.targetId=targetId,this.path=path,this.sequenceNumber=sequenceNumber,assert(0===targetId==(void 0!==sequenceNumber),"A target-document row must either have targetId == 0 and a defined sequence number, or a non-zero targetId and no sequence number")}return DbTargetDocument.store="targetDocuments",DbTargetDocument.keyPath=["targetId","path"],DbTargetDocument.documentTargetsIndex="documentTargetsIndex",DbTargetDocument.documentTargetsKeyPath=["path","targetId"],DbTargetDocument}(),DbTargetGlobal=function(){function DbTargetGlobal(highestTargetId,highestListenSequenceNumber,lastRemoteSnapshotVersion,targetCount){this.highestTargetId=highestTargetId,this.highestListenSequenceNumber=highestListenSequenceNumber,this.lastRemoteSnapshotVersion=lastRemoteSnapshotVersion,this.targetCount=targetCount}return DbTargetGlobal.key="targetGlobalKey",DbTargetGlobal.store="targetGlobal",DbTargetGlobal}(),DbRemoteDocumentChanges=function(){function DbRemoteDocumentChanges(changes){this.changes=changes}return DbRemoteDocumentChanges.store="remoteDocumentChanges",DbRemoteDocumentChanges.keyPath="id",DbRemoteDocumentChanges}(),DbClientMetadata=function(){function DbClientMetadata(clientId,updateTimeMs,networkEnabled,inForeground,lastProcessedDocumentChangeId){this.clientId=clientId,this.updateTimeMs=updateTimeMs,this.networkEnabled=networkEnabled,this.inForeground=inForeground,this.lastProcessedDocumentChangeId=lastProcessedDocumentChangeId}return DbClientMetadata.store="clientMetadata",DbClientMetadata.keyPath="clientId",DbClientMetadata}(),V1_STORES=[DbMutationQueue.store,DbMutationBatch.store,DbDocumentMutation.store,DbRemoteDocument.store,DbTarget.store,DbPrimaryClient.store,DbTargetGlobal.store,DbTargetDocument.store],V4_STORES=V1_STORES.concat([DbClientMetadata.store,DbRemoteDocumentChanges.store]),V6_STORES=V4_STORES.concat([DbRemoteDocumentGlobal.store]),ALL_STORES=V6_STORES,IndexedDbMutationQueue=function(){function IndexedDbMutationQueue(userId,serializer,referenceDelegate){this.userId=userId,this.serializer=serializer,this.referenceDelegate=referenceDelegate,this.documentKeysByBatchId={}}return IndexedDbMutationQueue.forUser=function(user,serializer,referenceDelegate){assert(""!==user.uid,"UserID must not be an empty string.");var userId=user.isAuthenticated()?user.uid:"";return new IndexedDbMutationQueue(userId,serializer,referenceDelegate)},IndexedDbMutationQueue.prototype.checkEmpty=function(transaction){var empty=!0,range=IDBKeyRange.bound([this.userId,_NumberNEGATIVE_INFINITY],[this.userId,_NumberPOSITIVE_INFINITY]);return mutationsStore(transaction).iterate({index:DbMutationBatch.userMutationsIndex,range:range},function(key,value,control){empty=!1,control.done()}).next(function(){return empty})},IndexedDbMutationQueue.prototype.acknowledgeBatch=function(transaction,batch,streamToken){return this.getMutationQueueMetadata(transaction).next(function(metadata){var batchId=batch.batchId;return assert(batchId>metadata.lastAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order"),metadata.lastAcknowledgedBatchId=batchId,metadata.lastStreamToken=convertStreamToken(streamToken),mutationQueuesStore(transaction).put(metadata)})},IndexedDbMutationQueue.prototype.getLastStreamToken=function(transaction){return this.getMutationQueueMetadata(transaction).next(function(metadata){return metadata.lastStreamToken})},IndexedDbMutationQueue.prototype.setLastStreamToken=function(transaction,streamToken){return this.getMutationQueueMetadata(transaction).next(function(metadata){return metadata.lastStreamToken=convertStreamToken(streamToken),mutationQueuesStore(transaction).put(metadata)})},IndexedDbMutationQueue.prototype.addMutationBatch=function(transaction,localWriteTime,mutations){var _this=this,documentStore=documentMutationsStore(transaction),mutationStore=mutationsStore(transaction);return mutationStore.add({}).next(function(batchId){assert("number"==typeof batchId,"Auto-generated key is not a number");var batch=new MutationBatch(batchId,localWriteTime,mutations),dbBatch=_this.serializer.toDbMutationBatch(_this.userId,batch);_this.documentKeysByBatchId[batchId]=batch.keys();for(var promises=[],_i=0,mutations_1=mutations;_i<mutations_1.length;_i++){var mutation=mutations_1[_i],indexKey=DbDocumentMutation.key(_this.userId,mutation.key.path,batchId);promises.push(mutationStore.put(dbBatch)),promises.push(documentStore.put(indexKey,DbDocumentMutation.PLACEHOLDER))}return PersistencePromise.waitFor(promises).next(function(){return batch})})},IndexedDbMutationQueue.prototype.lookupMutationBatch=function(transaction,batchId){var _this=this;return mutationsStore(transaction).get(batchId).next(function(dbBatch){return dbBatch?(assert(dbBatch.userId===_this.userId,"Unexpected user '"+dbBatch.userId+"' for mutation batch "+batchId),_this.serializer.fromDbMutationBatch(dbBatch)):null})},IndexedDbMutationQueue.prototype.lookupMutationKeys=function(transaction,batchId){var _this=this;return this.documentKeysByBatchId[batchId]?PersistencePromise.resolve(this.documentKeysByBatchId[batchId]):this.lookupMutationBatch(transaction,batchId).next(function(batch){if(batch){var keys=batch.keys();return _this.documentKeysByBatchId[batchId]=keys,keys}return null})},IndexedDbMutationQueue.prototype.getNextMutationBatchAfterBatchId=function(transaction,batchId){var _this=this;return this.getMutationQueueMetadata(transaction).next(function(metadata){var nextBatchId=_Mathmax3(batchId,metadata.lastAcknowledgedBatchId)+1,range=IDBKeyRange.lowerBound([_this.userId,nextBatchId]),foundBatch=null;return mutationsStore(transaction).iterate({index:DbMutationBatch.userMutationsIndex,range:range},function(key,dbBatch,control){dbBatch.userId===_this.userId&&(assert(dbBatch.batchId>=nextBatchId,"Should have found mutation after "+nextBatchId),foundBatch=_this.serializer.fromDbMutationBatch(dbBatch)),control.done()}).next(function(){return foundBatch})})},IndexedDbMutationQueue.prototype.getAllMutationBatches=function(transaction){var _this=this,range=IDBKeyRange.bound([this.userId,BATCHID_UNKNOWN],[this.userId,_NumberPOSITIVE_INFINITY]);return mutationsStore(transaction).loadAll(DbMutationBatch.userMutationsIndex,range).next(function(dbBatches){return dbBatches.map(function(dbBatch){return _this.serializer.fromDbMutationBatch(dbBatch)})})},IndexedDbMutationQueue.prototype.getAllMutationBatchesAffectingDocumentKey=function(transaction,documentKey){var _this=this,indexPrefix=DbDocumentMutation.prefixForPath(this.userId,documentKey.path),indexStart=IDBKeyRange.lowerBound(indexPrefix),results=[];return documentMutationsStore(transaction).iterate({range:indexStart},function(indexKey,_,control){var userID=indexKey[0],encodedPath=indexKey[1],batchId=indexKey[2],path=decode$1(encodedPath);return userID===_this.userId&&documentKey.path.isEqual(path)?mutationsStore(transaction).get(batchId).next(function(mutation){if(!mutation)throw fail("Dangling document-mutation reference found: "+indexKey+" which points to "+batchId);assert(mutation.userId===_this.userId,"Unexpected user '"+mutation.userId+"' for mutation batch "+batchId),results.push(_this.serializer.fromDbMutationBatch(mutation))}):void control.done()}).next(function(){return results})},IndexedDbMutationQueue.prototype.getAllMutationBatchesAffectingDocumentKeys=function(transaction,documentKeys){var _this=this,uniqueBatchIDs=new SortedSet(primitiveComparator),promises=[];return documentKeys.forEach(function(documentKey){var indexStart=DbDocumentMutation.prefixForPath(_this.userId,documentKey.path),range=IDBKeyRange.lowerBound(indexStart),promise=documentMutationsStore(transaction).iterate({range:range},function(indexKey,_,control){var userID=indexKey[0],encodedPath=indexKey[1],batchID=indexKey[2],path=decode$1(encodedPath);return userID===_this.userId&&documentKey.path.isEqual(path)?void(uniqueBatchIDs=uniqueBatchIDs.add(batchID)):void control.done()});promises.push(promise)}),PersistencePromise.waitFor(promises).next(function(){return _this.lookupMutationBatches(transaction,uniqueBatchIDs)})},IndexedDbMutationQueue.prototype.getAllMutationBatchesAffectingQuery=function(transaction,query){var _this=this;assert(!query.isDocumentQuery(),"Document queries shouldn't go down this path");var queryPath=query.path,immediateChildrenLength=queryPath.length+1,indexPrefix=DbDocumentMutation.prefixForPath(this.userId,queryPath),indexStart=IDBKeyRange.lowerBound(indexPrefix),uniqueBatchIDs=new SortedSet(primitiveComparator);return documentMutationsStore(transaction).iterate({range:indexStart},function(indexKey,_,control){var userID=indexKey[0],encodedPath=indexKey[1],batchID=indexKey[2],path=decode$1(encodedPath);return userID===_this.userId&&queryPath.isPrefixOf(path)?void(path.length!==immediateChildrenLength||(uniqueBatchIDs=uniqueBatchIDs.add(batchID))):void control.done()}).next(function(){return _this.lookupMutationBatches(transaction,uniqueBatchIDs)})},IndexedDbMutationQueue.prototype.lookupMutationBatches=function(transaction,batchIDs){var _this=this,results=[],promises=[];return batchIDs.forEach(function(batchId){promises.push(mutationsStore(transaction).get(batchId).next(function(mutation){if(null===mutation)throw fail("Dangling document-mutation reference found, which points to "+batchId);assert(mutation.userId===_this.userId,"Unexpected user '"+mutation.userId+"' for mutation batch "+batchId),results.push(_this.serializer.fromDbMutationBatch(mutation))}))}),PersistencePromise.waitFor(promises).next(function(){return results})},IndexedDbMutationQueue.prototype.removeMutationBatch=function(transaction,batch){var _this=this;return removeMutationBatch(transaction.simpleDbTransaction,this.userId,batch).next(function(removedDocuments){return _this.removeCachedMutationKeys(batch.batchId),PersistencePromise.forEach(removedDocuments,function(key){return _this.referenceDelegate.removeMutationReference(transaction,key)})})},IndexedDbMutationQueue.prototype.removeCachedMutationKeys=function(batchId){delete this.documentKeysByBatchId[batchId]},IndexedDbMutationQueue.prototype.performConsistencyCheck=function(txn){var _this=this;return this.checkEmpty(txn).next(function(empty){if(!empty)return PersistencePromise.resolve();var startRange=IDBKeyRange.lowerBound(DbDocumentMutation.prefixForUser(_this.userId)),danglingMutationReferences=[];return documentMutationsStore(txn).iterate({range:startRange},function(key,_,control){var userID=key[0];if(userID!==_this.userId)return void control.done();var path=decode$1(key[1]);danglingMutationReferences.push(path)}).next(function(){assert(0===danglingMutationReferences.length,"Document leak -- detected dangling mutation references when queue is empty. Dangling keys: "+danglingMutationReferences.map(function(p){return p.canonicalString()}))})})},IndexedDbMutationQueue.prototype.containsKey=function(txn,key){return mutationQueueContainsKey(txn,this.userId,key)},IndexedDbMutationQueue.prototype.getMutationQueueMetadata=function(transaction){var _this=this;return mutationQueuesStore(transaction).get(this.userId).next(function(metadata){return metadata||new DbMutationQueue(_this.userId,BATCHID_UNKNOWN,"")})},IndexedDbMutationQueue}(),RESERVED_BITS=1,GeneratorIds;(function(GeneratorIds){GeneratorIds[GeneratorIds.QueryCache=0]="QueryCache",GeneratorIds[GeneratorIds.SyncEngine=1]="SyncEngine"})(GeneratorIds||(GeneratorIds={}));var TargetIdGenerator=function(){function TargetIdGenerator(generatorId,seed){this.generatorId=generatorId,assert((generatorId&RESERVED_BITS)===generatorId,"Generator ID "+generatorId+" contains more than "+RESERVED_BITS+" reserved bits"),this.seek(void 0===seed?this.generatorId:seed)}return TargetIdGenerator.prototype.next=function(){var nextId=this.nextId;return this.nextId+=1<<RESERVED_BITS,nextId},TargetIdGenerator.prototype.after=function(targetId){return this.seek(targetId+(1<<RESERVED_BITS)),this.next()},TargetIdGenerator.prototype.seek=function(targetId){assert((targetId&RESERVED_BITS)===this.generatorId,"Cannot supply target ID from different generator ID"),this.nextId=targetId},TargetIdGenerator.forQueryCache=function(){var targetIdGenerator=new TargetIdGenerator(GeneratorIds.QueryCache,2);return targetIdGenerator},TargetIdGenerator.forSyncEngine=function(){return new TargetIdGenerator(GeneratorIds.SyncEngine)},TargetIdGenerator}(),IndexedDbQueryCache=function(){function IndexedDbQueryCache(referenceDelegate,serializer){this.referenceDelegate=referenceDelegate,this.serializer=serializer,this.targetIdGenerator=TargetIdGenerator.forQueryCache()}return IndexedDbQueryCache.prototype.allocateTargetId=function(transaction){var _this=this;return this.retrieveMetadata(transaction).next(function(metadata){return metadata.highestTargetId=_this.targetIdGenerator.after(metadata.highestTargetId),_this.saveMetadata(transaction,metadata).next(function(){return metadata.highestTargetId})})},IndexedDbQueryCache.prototype.getLastRemoteSnapshotVersion=function(transaction){return this.retrieveMetadata(transaction).next(function(metadata){return SnapshotVersion.fromTimestamp(new Timestamp(metadata.lastRemoteSnapshotVersion.seconds,metadata.lastRemoteSnapshotVersion.nanoseconds))})},IndexedDbQueryCache.prototype.getHighestSequenceNumber=function(transaction){return getHighestListenSequenceNumber(transaction.simpleDbTransaction)},IndexedDbQueryCache.prototype.setTargetsMetadata=function(transaction,highestListenSequenceNumber,lastRemoteSnapshotVersion){var _this=this;return this.retrieveMetadata(transaction).next(function(metadata){return metadata.highestListenSequenceNumber=highestListenSequenceNumber,lastRemoteSnapshotVersion&&(metadata.lastRemoteSnapshotVersion=lastRemoteSnapshotVersion.toTimestamp()),highestListenSequenceNumber>metadata.highestListenSequenceNumber&&(metadata.highestListenSequenceNumber=highestListenSequenceNumber),_this.saveMetadata(transaction,metadata)})},IndexedDbQueryCache.prototype.addQueryData=function(transaction,queryData){var _this=this;return this.saveQueryData(transaction,queryData).next(function(){return _this.retrieveMetadata(transaction).next(function(metadata){return metadata.targetCount+=1,_this.updateMetadataFromQueryData(queryData,metadata),_this.saveMetadata(transaction,metadata)})})},IndexedDbQueryCache.prototype.updateQueryData=function(transaction,queryData){return this.saveQueryData(transaction,queryData)},IndexedDbQueryCache.prototype.removeQueryData=function(transaction,queryData){var _this=this;return this.removeMatchingKeysForTargetId(transaction,queryData.targetId).next(function(){return targetsStore(transaction).delete(queryData.targetId)}).next(function(){return _this.retrieveMetadata(transaction)}).next(function(metadata){return assert(0<metadata.targetCount,"Removing from an empty query cache"),metadata.targetCount-=1,_this.saveMetadata(transaction,metadata)})},IndexedDbQueryCache.prototype.removeTargets=function(txn,upperBound,activeTargetIds){var _this=this,count=0,promises=[];return targetsStore(txn).iterate(function(key,value){var queryData=_this.serializer.fromDbTarget(value);queryData.sequenceNumber<=upperBound&&void 0===activeTargetIds[queryData.targetId]&&(count++,promises.push(_this.removeQueryData(txn,queryData)))}).next(function(){return PersistencePromise.waitFor(promises)}).next(function(){return count})},IndexedDbQueryCache.prototype.forEachTarget=function(txn,f){var _this=this;return targetsStore(txn).iterate(function(key,value){var queryData=_this.serializer.fromDbTarget(value);f(queryData)})},IndexedDbQueryCache.prototype.retrieveMetadata=function(transaction){return retrieveMetadata(transaction.simpleDbTransaction)},IndexedDbQueryCache.prototype.saveMetadata=function(transaction,metadata){return globalTargetStore(transaction).put(DbTargetGlobal.key,metadata)},IndexedDbQueryCache.prototype.saveQueryData=function(transaction,queryData){return targetsStore(transaction).put(this.serializer.toDbTarget(queryData))},IndexedDbQueryCache.prototype.updateMetadataFromQueryData=function(queryData,metadata){var updated=!1;return queryData.targetId>metadata.highestTargetId&&(metadata.highestTargetId=queryData.targetId,updated=!0),queryData.sequenceNumber>metadata.highestListenSequenceNumber&&(metadata.highestListenSequenceNumber=queryData.sequenceNumber,updated=!0),updated},IndexedDbQueryCache.prototype.getQueryCount=function(transaction){return this.retrieveMetadata(transaction).next(function(metadata){return metadata.targetCount})},IndexedDbQueryCache.prototype.getQueryData=function(transaction,query){var _this=this,canonicalId=query.canonicalId(),range=IDBKeyRange.bound([canonicalId,_NumberNEGATIVE_INFINITY],[canonicalId,_NumberPOSITIVE_INFINITY]),result=null;return targetsStore(transaction).iterate({range:range,index:DbTarget.queryTargetsIndexName},function(key,value,control){var found=_this.serializer.fromDbTarget(value);query.isEqual(found.query)&&(result=found,control.done())}).next(function(){return result})},IndexedDbQueryCache.prototype.addMatchingKeys=function(txn,keys,targetId){var _this=this,promises=[],store=documentTargetStore(txn);return keys.forEach(function(key){var path=encode(key.path);promises.push(store.put(new DbTargetDocument(targetId,path))),promises.push(_this.referenceDelegate.addReference(txn,key))}),PersistencePromise.waitFor(promises)},IndexedDbQueryCache.prototype.removeMatchingKeys=function(txn,keys,targetId){var _this=this,store=documentTargetStore(txn);return PersistencePromise.forEach(keys,function(key){var path=encode(key.path);return PersistencePromise.waitFor([store.delete([targetId,path]),_this.referenceDelegate.removeReference(txn,key)])})},IndexedDbQueryCache.prototype.removeMatchingKeysForTargetId=function(txn,targetId){var store=documentTargetStore(txn),range=IDBKeyRange.bound([targetId],[targetId+1],!1,!0);return store.delete(range)},IndexedDbQueryCache.prototype.getMatchingKeysForTargetId=function(txn,targetId){var range=IDBKeyRange.bound([targetId],[targetId+1],!1,!0),store=documentTargetStore(txn),result=documentKeySet();return store.iterate({range:range,keysOnly:!0},function(key){var path=decode$1(key[1]),docKey=new DocumentKey(path);result=result.add(docKey)}).next(function(){return result})},IndexedDbQueryCache.prototype.containsKey=function(txn,key){var path=encode(key.path),range=IDBKeyRange.bound([path],[immediateSuccessor(path)],!1,!0),count=0;return documentTargetStore(txn).iterate({index:DbTargetDocument.documentTargetsIndex,keysOnly:!0,range:range},function(_a,_,control){var targetId=_a[0],path=_a[1];0!==targetId&&(count++,control.done())}).next(function(){return 0<count})},IndexedDbQueryCache.prototype.getQueryDataForTarget=function(transaction,targetId){var _this=this;return targetsStore(transaction).get(targetId).next(function(found){return found?_this.serializer.fromDbTarget(found):null})},IndexedDbQueryCache}(),LocalSerializer=function(){function LocalSerializer(remoteSerializer){this.remoteSerializer=remoteSerializer}return LocalSerializer.prototype.fromDbRemoteDocument=function(remoteDoc){if(remoteDoc.document)return this.remoteSerializer.fromDocument(remoteDoc.document,!!remoteDoc.hasCommittedMutations);if(remoteDoc.noDocument){var key=DocumentKey.fromSegments(remoteDoc.noDocument.path),version=this.fromDbTimestamp(remoteDoc.noDocument.readTime);return new NoDocument(key,version,{hasCommittedMutations:!!remoteDoc.hasCommittedMutations})}if(remoteDoc.unknownDocument){var key=DocumentKey.fromSegments(remoteDoc.unknownDocument.path),version=this.fromDbTimestamp(remoteDoc.unknownDocument.version);return new UnknownDocument(key,version)}return fail("Unexpected DbRemoteDocument")},LocalSerializer.prototype.toDbRemoteDocument=function(maybeDoc){if(maybeDoc instanceof Document){var doc=this.remoteSerializer.toDocument(maybeDoc),hasCommittedMutations=maybeDoc.hasCommittedMutations;return new DbRemoteDocument(null,null,doc,hasCommittedMutations)}if(maybeDoc instanceof NoDocument){var path=maybeDoc.key.path.toArray(),readTime=this.toDbTimestamp(maybeDoc.version),hasCommittedMutations=maybeDoc.hasCommittedMutations;return new DbRemoteDocument(null,new DbNoDocument(path,readTime),null,hasCommittedMutations)}if(maybeDoc instanceof UnknownDocument){var path=maybeDoc.key.path.toArray(),readTime=this.toDbTimestamp(maybeDoc.version);return new DbRemoteDocument(new DbUnknownDocument(path,readTime),null,null,!0)}return fail("Unexpected MaybeDocumment")},LocalSerializer.prototype.toDbTimestamp=function(snapshotVersion){var timestamp=snapshotVersion.toTimestamp();return new DbTimestamp(timestamp.seconds,timestamp.nanoseconds)},LocalSerializer.prototype.fromDbTimestamp=function(dbTimestamp){var timestamp=new Timestamp(dbTimestamp.seconds,dbTimestamp.nanoseconds);return SnapshotVersion.fromTimestamp(timestamp)},LocalSerializer.prototype.toDbMutationBatch=function(userId,batch){var _this=this,serializedMutations=batch.mutations.map(function(m){return _this.remoteSerializer.toMutation(m)});return new DbMutationBatch(userId,batch.batchId,batch.localWriteTime.toMillis(),serializedMutations)},LocalSerializer.prototype.fromDbMutationBatch=function(dbBatch){var _this=this,mutations=dbBatch.mutations.map(function(m){return _this.remoteSerializer.fromMutation(m)}),timestamp=Timestamp.fromMillis(dbBatch.localWriteTimeMs);return new MutationBatch(dbBatch.batchId,timestamp,mutations)},LocalSerializer.prototype.toDbResourcePaths=function(keys){var encodedKeys=[];return keys.forEach(function(key){encodedKeys.push(encode(key.path))}),encodedKeys},LocalSerializer.prototype.fromDbResourcePaths=function(encodedPaths){for(var keys=documentKeySet(),_i=0,encodedPaths_1=encodedPaths,documentKey;_i<encodedPaths_1.length;_i++)documentKey=encodedPaths_1[_i],keys=keys.add(new DocumentKey(decode$1(documentKey)));return keys},LocalSerializer.prototype.fromDbTarget=function(dbTarget){var version=this.fromDbTimestamp(dbTarget.readTime),query;return query=isDocumentQuery(dbTarget.query)?this.remoteSerializer.fromDocumentsTarget(dbTarget.query):this.remoteSerializer.fromQueryTarget(dbTarget.query),new QueryData(query,dbTarget.targetId,QueryPurpose.Listen,dbTarget.lastListenSequenceNumber,version,dbTarget.resumeToken)},LocalSerializer.prototype.toDbTarget=function(queryData){assert(QueryPurpose.Listen===queryData.purpose,"Only queries with purpose "+QueryPurpose.Listen+" may be stored, got "+queryData.purpose);var dbTimestamp=this.toDbTimestamp(queryData.snapshotVersion),queryProto;queryProto=queryData.query.isDocumentQuery()?this.remoteSerializer.toDocumentsTarget(queryData.query):this.remoteSerializer.toQueryTarget(queryData.query);var resumeToken;return queryData.resumeToken instanceof Uint8Array?(assert("YES"===process.env.USE_MOCK_PERSISTENCE,"Persisting non-string stream tokens is only supported with mock persistence ."),resumeToken=queryData.resumeToken.toString()):resumeToken=queryData.resumeToken,new DbTarget(queryData.targetId,queryData.query.canonicalId(),dbTimestamp,resumeToken,queryData.sequenceNumber,queryProto)},LocalSerializer}(),RollingSequenceNumberBuffer=function(){function RollingSequenceNumberBuffer(maxElements){this.maxElements=maxElements,this.buffer=new SortedSet(bufferEntryComparator),this.previousIndex=0}return RollingSequenceNumberBuffer.prototype.nextIndex=function(){return++this.previousIndex},RollingSequenceNumberBuffer.prototype.addElement=function(sequenceNumber){var entry=[sequenceNumber,this.nextIndex()];if(this.buffer.size<this.maxElements)this.buffer=this.buffer.add(entry);else{var highestValue=this.buffer.last();0>bufferEntryComparator(entry,highestValue)&&(this.buffer=this.buffer.delete(highestValue).add(entry))}},Object.defineProperty(RollingSequenceNumberBuffer.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!0,configurable:!0}),RollingSequenceNumberBuffer}(),LruGarbageCollector=function(){function LruGarbageCollector(delegate){this.delegate=delegate}return LruGarbageCollector.prototype.calculateTargetCount=function(txn,percentile){return this.delegate.getTargetCount(txn).next(function(targetCount){return _Mathfloor3(percentile/100*targetCount)})},LruGarbageCollector.prototype.nthSequenceNumber=function(txn,n){var _this=this;if(0===n)return PersistencePromise.resolve(ListenSequence.INVALID);var buffer=new RollingSequenceNumberBuffer(n);return this.delegate.forEachTarget(txn,function(target){return buffer.addElement(target.sequenceNumber)}).next(function(){return _this.delegate.forEachOrphanedDocumentSequenceNumber(txn,function(sequenceNumber){return buffer.addElement(sequenceNumber)})}).next(function(){return buffer.maxValue})},LruGarbageCollector.prototype.removeTargets=function(txn,upperBound,activeTargetIds){return this.delegate.removeTargets(txn,upperBound,activeTargetIds)},LruGarbageCollector.prototype.removeOrphanedDocuments=function(txn,upperBound){return this.delegate.removeOrphanedDocuments(txn,upperBound)},LruGarbageCollector}(),PersistenceTransaction=function(){return function(){}}(),LOG_TAG$2="IndexedDbPersistence",MAX_CLIENT_AGE_MS=1800000,MAX_PRIMARY_ELIGIBLE_AGE_MS=5e3,PRIMARY_LEASE_LOST_ERROR_MSG="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG="Another tab has exclusive access to the persistence layer. To allow shared access, make sure to invoke `enablePersistence()` with `experimentalTabSynchronization:true` in all tabs.",IndexedDbTransaction=function(_super){function IndexedDbTransaction(simpleDbTransaction,currentSequenceNumber){var _this=_super.call(this)||this;return _this.simpleDbTransaction=simpleDbTransaction,_this.currentSequenceNumber=currentSequenceNumber,_this}return tslib_1.__extends(IndexedDbTransaction,_super),IndexedDbTransaction}(PersistenceTransaction),IndexedDbPersistence=function(){function IndexedDbPersistence(persistenceKey,clientId,platform,queue,serializer,multiClientParams){if(this.persistenceKey=persistenceKey,this.clientId=clientId,this.queue=queue,this.multiClientParams=multiClientParams,this._started=!1,this.isPrimary=!1,this.networkEnabled=!0,this.inForeground=!1,this.lastGarbageCollectionTime=_NumberNEGATIVE_INFINITY,this.primaryStateListener=function(){return Promise.resolve()},!IndexedDbPersistence.isAvailable())throw new FirestoreError(Code.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");if(this.referenceDelegate=new IndexedDbLruDelegate(this),this.dbName=persistenceKey+IndexedDbPersistence.MAIN_DATABASE,this.serializer=new LocalSerializer(serializer),this.document=platform.document,this.allowTabSynchronization=void 0!==multiClientParams,this.queryCache=new IndexedDbQueryCache(this.referenceDelegate,this.serializer),this.remoteDocumentCache=new IndexedDbRemoteDocumentCache(this.serializer,this.allowTabSynchronization),platform.window&&platform.window.localStorage)this.window=platform.window,this.webStorage=this.window.localStorage;else throw new FirestoreError(Code.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.")}return IndexedDbPersistence.getStore=function(txn,store){if(txn instanceof IndexedDbTransaction)return SimpleDb.getStore(txn.simpleDbTransaction,store);throw fail("IndexedDbPersistence must use instances of IndexedDbTransaction")},IndexedDbPersistence.createIndexedDbPersistence=function(persistenceKey,clientId,platform,queue,serializer){return tslib_1.__awaiter(this,void 0,void 0,function(){var persistence;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return persistence=new IndexedDbPersistence(persistenceKey,clientId,platform,queue,serializer),[4,persistence.start()];case 1:return _a.sent(),[2,persistence];}})})},IndexedDbPersistence.createMultiClientIndexedDbPersistence=function(persistenceKey,clientId,platform,queue,serializer,multiClientParams){return tslib_1.__awaiter(this,void 0,void 0,function(){var persistence;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return persistence=new IndexedDbPersistence(persistenceKey,clientId,platform,queue,serializer,multiClientParams),[4,persistence.start()];case 1:return _a.sent(),[2,persistence];}})})},IndexedDbPersistence.prototype.start=function(){var _this=this;return assert(!this.started,"IndexedDbPersistence double-started!"),assert(null!==this.window,"Expected 'window' to be defined"),SimpleDb.openOrCreate(this.dbName,SCHEMA_VERSION,new SchemaConverter(this.serializer)).then(function(db){_this.simpleDb=db}).then(function(){return _this.startRemoteDocumentCache()}).then(function(){return _this.attachVisibilityHandler(),_this.attachWindowUnloadHook(),_this.updateClientMetadataAndTryBecomePrimary().then(function(){return _this.scheduleClientMetadataAndPrimaryLeaseRefreshes()})}).then(function(){return _this.simpleDb.runTransaction("readonly",[DbTargetGlobal.store],function(txn){return getHighestListenSequenceNumber(txn).next(function(highestListenSequenceNumber){var sequenceNumberSyncer=_this.multiClientParams?_this.multiClientParams.sequenceNumberSyncer:void 0;_this.listenSequence=new ListenSequence(highestListenSequenceNumber,sequenceNumberSyncer)})})}).then(function(){_this._started=!0}).catch(function(reason){return _this.simpleDb&&_this.simpleDb.close(),Promise.reject(reason)})},IndexedDbPersistence.prototype.startRemoteDocumentCache=function(){var _this=this;return this.simpleDb.runTransaction("readonly",ALL_STORES,function(txn){return _this.remoteDocumentCache.start(txn)})},IndexedDbPersistence.prototype.setPrimaryStateListener=function(primaryStateListener){var _this=this;return this.primaryStateListener=function(primaryState){return tslib_1.__awaiter(_this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return this.started?[2,primaryStateListener(primaryState)]:[2]})})},primaryStateListener(this.isPrimary)},IndexedDbPersistence.prototype.setNetworkEnabled=function(networkEnabled){var _this=this;this.networkEnabled!==networkEnabled&&(this.networkEnabled=networkEnabled,this.queue.enqueueAndForget(function(){return tslib_1.__awaiter(_this,void 0,void 0,function(){return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return this.started?[4,this.updateClientMetadataAndTryBecomePrimary()]:[3,2];case 1:_a.sent(),_a.label=2;case 2:return[2];}})})}))},IndexedDbPersistence.prototype.updateClientMetadataAndTryBecomePrimary=function(){var _this=this;return this.simpleDb.runTransaction("readwrite",ALL_STORES,function(txn){var metadataStore=clientMetadataStore(txn);return metadataStore.put(new DbClientMetadata(_this.clientId,Date.now(),_this.networkEnabled,_this.inForeground,_this.remoteDocumentCache.lastProcessedDocumentChangeId)).next(function(){if(_this.isPrimary)return _this.verifyPrimaryLease(txn).next(function(success){success||(_this.isPrimary=!1,_this.queue.enqueueAndForget(function(){return _this.primaryStateListener(!1)}))})}).next(function(){return _this.canActAsPrimary(txn)}).next(function(canActAsPrimary){var wasPrimary=_this.isPrimary;return(_this.isPrimary=canActAsPrimary,wasPrimary!==_this.isPrimary&&_this.queue.enqueueAndForget(function(){return _this.primaryStateListener(_this.isPrimary)}),wasPrimary&&!_this.isPrimary)?_this.releasePrimaryLeaseIfHeld(txn):_this.isPrimary?_this.acquireOrExtendPrimaryLease(txn):void 0})})},IndexedDbPersistence.prototype.verifyPrimaryLease=function(txn){var _this=this,store=primaryClientStore(txn);return store.get(DbPrimaryClient.key).next(function(primaryClient){return PersistencePromise.resolve(_this.isLocalClient(primaryClient))})},IndexedDbPersistence.prototype.removeClientMetadata=function(txn){var metadataStore=clientMetadataStore(txn);return metadataStore.delete(this.clientId)},IndexedDbPersistence.prototype.maybeGarbageCollectMultiClientState=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this,activeClients_1,inactiveClients_1;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return!this.isPrimary||this.isWithinAge(this.lastGarbageCollectionTime,MAX_CLIENT_AGE_MS)?[3,2]:(this.lastGarbageCollectionTime=Date.now(),inactiveClients_1=[],[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",function(txn){var metadataStore=IndexedDbPersistence.getStore(txn,DbClientMetadata.store);return metadataStore.loadAll().next(function(existingClients){activeClients_1=_this.filterActiveClients(existingClients,MAX_CLIENT_AGE_MS),inactiveClients_1=existingClients.filter(function(client){return-1===activeClients_1.indexOf(client)})}).next(function(){return PersistencePromise.forEach(inactiveClients_1,function(inactiveClient){return metadataStore.delete(inactiveClient.clientId)})}).next(function(){if(activeClients_1=activeClients_1.filter(function(client){return client.clientId!==_this.clientId}),0<activeClients_1.length){var processedChangeIds=activeClients_1.map(function(client){return client.lastProcessedDocumentChangeId||0}),oldestChangeId=_Mathmin5.apply(Math,processedChangeIds);return _this.remoteDocumentCache.removeDocumentChangesThroughChangeId(txn,oldestChangeId)}})})]);case 1:_a.sent(),inactiveClients_1.forEach(function(inactiveClient){_this.window.localStorage.removeItem(_this.zombiedClientLocalStorageKey(inactiveClient.clientId))}),_a.label=2;case 2:return[2];}})})},IndexedDbPersistence.prototype.scheduleClientMetadataAndPrimaryLeaseRefreshes=function(){var _this=this;this.clientMetadataRefresher=this.queue.enqueueAfterDelay(TimerId.ClientMetadataRefresh,4e3,function(){return _this.updateClientMetadataAndTryBecomePrimary().then(function(){return _this.maybeGarbageCollectMultiClientState()}).then(function(){return _this.scheduleClientMetadataAndPrimaryLeaseRefreshes()})})},IndexedDbPersistence.prototype.isLocalClient=function(client){return!!client&&client.ownerId===this.clientId},IndexedDbPersistence.prototype.canActAsPrimary=function(txn){var _this=this,store=primaryClientStore(txn);return store.get(DbPrimaryClient.key).next(function(currentPrimary){var currentLeaseIsValid=null!==currentPrimary&&_this.isWithinAge(currentPrimary.leaseTimestampMs,MAX_PRIMARY_ELIGIBLE_AGE_MS)&&!_this.isClientZombied(currentPrimary.ownerId);if(currentLeaseIsValid){if(_this.isLocalClient(currentPrimary)&&_this.networkEnabled)return!0;if(!_this.isLocalClient(currentPrimary)){if(!currentPrimary.allowTabSynchronization)throw new FirestoreError(Code.FAILED_PRECONDITION,PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG);return!1}}return _this.networkEnabled&&_this.inForeground||clientMetadataStore(txn).loadAll().next(function(existingClients){var preferredCandidate=_this.filterActiveClients(existingClients,MAX_PRIMARY_ELIGIBLE_AGE_MS).find(function(otherClient){if(_this.clientId!==otherClient.clientId){var otherClientHasBetterNetworkState=!_this.networkEnabled&&otherClient.networkEnabled,otherClientHasBetterVisibility=!_this.inForeground&&otherClient.inForeground,otherClientHasSameNetworkState=_this.networkEnabled===otherClient.networkEnabled;if(otherClientHasBetterNetworkState||otherClientHasBetterVisibility&&otherClientHasSameNetworkState)return!0}return!1});return void 0===preferredCandidate})}).next(function(canActAsPrimary){return _this.isPrimary!==canActAsPrimary&&debug(LOG_TAG$2,"Client "+(canActAsPrimary?"is":"is not")+" eligible for a primary lease."),canActAsPrimary})},IndexedDbPersistence.prototype.shutdown=function(deleteData){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return this._started=!1,this.markClientZombied(),this.clientMetadataRefresher&&this.clientMetadataRefresher.cancel(),this.detachVisibilityHandler(),this.detachWindowUnloadHook(),[4,this.simpleDb.runTransaction("readwrite",[DbPrimaryClient.store,DbClientMetadata.store],function(txn){return _this.releasePrimaryLeaseIfHeld(txn).next(function(){return _this.removeClientMetadata(txn)})})];case 1:return _a.sent(),this.simpleDb.close(),this.removeClientZombiedEntry(),deleteData?[4,SimpleDb.delete(this.dbName)]:[3,3];case 2:_a.sent(),_a.label=3;case 3:return[2];}})})},IndexedDbPersistence.prototype.filterActiveClients=function(clients,activityThresholdMs){var _this=this;return clients.filter(function(client){return _this.isWithinAge(client.updateTimeMs,activityThresholdMs)&&!_this.isClientZombied(client.clientId)})},IndexedDbPersistence.prototype.getActiveClients=function(){var _this=this;return this.simpleDb.runTransaction("readonly",[DbClientMetadata.store],function(txn){return clientMetadataStore(txn).loadAll().next(function(clients){return _this.filterActiveClients(clients,MAX_CLIENT_AGE_MS).map(function(clientMetadata){return clientMetadata.clientId})})})},Object.defineProperty(IndexedDbPersistence.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0}),IndexedDbPersistence.prototype.getMutationQueue=function(user){return assert(this.started,"Cannot initialize MutationQueue before persistence is started."),IndexedDbMutationQueue.forUser(user,this.serializer,this.referenceDelegate)},IndexedDbPersistence.prototype.getQueryCache=function(){return assert(this.started,"Cannot initialize QueryCache before persistence is started."),this.queryCache},IndexedDbPersistence.prototype.getRemoteDocumentCache=function(){return assert(this.started,"Cannot initialize RemoteDocumentCache before persistence is started."),this.remoteDocumentCache},IndexedDbPersistence.prototype.runTransaction=function(action,mode,transactionOperation){var _this=this;return debug(LOG_TAG$2,"Starting transaction:",action),this.simpleDb.runTransaction("readonly"===mode?"readonly":"readwrite",ALL_STORES,function(simpleDbTxn){return"readwrite-primary"===mode?_this.verifyPrimaryLease(simpleDbTxn).next(function(success){if(!success)throw error("Failed to obtain primary lease for action '"+action+"'."),_this.isPrimary=!1,_this.queue.enqueueAndForget(function(){return _this.primaryStateListener(!1)}),new FirestoreError(Code.FAILED_PRECONDITION,PRIMARY_LEASE_LOST_ERROR_MSG);return transactionOperation(new IndexedDbTransaction(simpleDbTxn,_this.listenSequence.next()))}).next(function(result){return _this.acquireOrExtendPrimaryLease(simpleDbTxn).next(function(){return result})}):_this.verifyAllowTabSynchronization(simpleDbTxn).next(function(){return transactionOperation(new IndexedDbTransaction(simpleDbTxn,_this.listenSequence.next()))})})},IndexedDbPersistence.prototype.verifyAllowTabSynchronization=function(txn){var _this=this,store=primaryClientStore(txn);return store.get(DbPrimaryClient.key).next(function(currentPrimary){var currentLeaseIsValid=null!==currentPrimary&&_this.isWithinAge(currentPrimary.leaseTimestampMs,MAX_PRIMARY_ELIGIBLE_AGE_MS)&&!_this.isClientZombied(currentPrimary.ownerId);if(currentLeaseIsValid&&!_this.isLocalClient(currentPrimary)&&!currentPrimary.allowTabSynchronization)throw new FirestoreError(Code.FAILED_PRECONDITION,PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG)})},IndexedDbPersistence.prototype.acquireOrExtendPrimaryLease=function(txn){var newPrimary=new DbPrimaryClient(this.clientId,this.allowTabSynchronization,Date.now());return primaryClientStore(txn).put(DbPrimaryClient.key,newPrimary)},IndexedDbPersistence.isAvailable=function(){return SimpleDb.isAvailable()},IndexedDbPersistence.buildStoragePrefix=function(databaseInfo){var database=databaseInfo.databaseId.projectId;return databaseInfo.databaseId.isDefaultDatabase||(database+="."+databaseInfo.databaseId.database),"firestore/"+databaseInfo.persistenceKey+"/"+database+"/"},IndexedDbPersistence.prototype.releasePrimaryLeaseIfHeld=function(txn){var _this=this,store=primaryClientStore(txn);return store.get(DbPrimaryClient.key).next(function(primaryClient){return _this.isLocalClient(primaryClient)?(debug(LOG_TAG$2,"Releasing primary lease."),store.delete(DbPrimaryClient.key)):PersistencePromise.resolve()})},IndexedDbPersistence.prototype.isWithinAge=function(updateTimeMs,maxAgeMs){var now=Date.now(),maxAcceptable=now;return!(updateTimeMs<now-maxAgeMs)&&(!(updateTimeMs>maxAcceptable)||(error("Detected an update time that is in the future: "+updateTimeMs+" > "+maxAcceptable),!1))},IndexedDbPersistence.prototype.attachVisibilityHandler=function(){var _this=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.documentVisibilityHandler=function(){_this.queue.enqueueAndForget(function(){return _this.inForeground="visible"===_this.document.visibilityState,_this.updateClientMetadataAndTryBecomePrimary()})},this.document.addEventListener("visibilitychange",this.documentVisibilityHandler),this.inForeground="visible"===this.document.visibilityState)},IndexedDbPersistence.prototype.detachVisibilityHandler=function(){this.documentVisibilityHandler&&(assert(null!==this.document&&"function"==typeof this.document.addEventListener,"Expected 'document.addEventListener' to be a function"),this.document.removeEventListener("visibilitychange",this.documentVisibilityHandler),this.documentVisibilityHandler=null)},IndexedDbPersistence.prototype.attachWindowUnloadHook=function(){var _this=this;"function"==typeof this.window.addEventListener&&(this.windowUnloadHandler=function(){_this.markClientZombied(),_this.queue.enqueueAndForget(function(){return _this.shutdown()})},this.window.addEventListener("unload",this.windowUnloadHandler))},IndexedDbPersistence.prototype.detachWindowUnloadHook=function(){this.windowUnloadHandler&&(assert("function"==typeof this.window.removeEventListener,"Expected 'window.removeEventListener' to be a function"),this.window.removeEventListener("unload",this.windowUnloadHandler),this.windowUnloadHandler=null)},IndexedDbPersistence.prototype.isClientZombied=function(clientId){try{var isZombied=null!==this.webStorage.getItem(this.zombiedClientLocalStorageKey(clientId));return debug(LOG_TAG$2,"Client '"+clientId+"' "+(isZombied?"is":"is not")+" zombied in LocalStorage"),isZombied}catch(e){return error(LOG_TAG$2,"Failed to get zombied client id.",e),!1}},IndexedDbPersistence.prototype.markClientZombied=function(){try{this.webStorage.setItem(this.zombiedClientLocalStorageKey(this.clientId),Date.now()+"")}catch(e){error("Failed to set zombie client id.",e)}},IndexedDbPersistence.prototype.removeClientZombiedEntry=function(){try{this.webStorage.removeItem(this.zombiedClientLocalStorageKey(this.clientId))}catch(e){}},IndexedDbPersistence.prototype.zombiedClientLocalStorageKey=function(clientId){return"firestore_zombie"+"_"+this.persistenceKey+"_"+clientId},IndexedDbPersistence.MAIN_DATABASE="main",IndexedDbPersistence}(),IndexedDbLruDelegate=function(){function IndexedDbLruDelegate(db){this.db=db,this.garbageCollector=new LruGarbageCollector(this)}return IndexedDbLruDelegate.prototype.getTargetCount=function(txn){return this.db.getQueryCache().getQueryCount(txn)},IndexedDbLruDelegate.prototype.forEachTarget=function(txn,f){return this.db.getQueryCache().forEachTarget(txn,f)},IndexedDbLruDelegate.prototype.forEachOrphanedDocumentSequenceNumber=function(txn,f){return this.forEachOrphanedDocument(txn,function(docKey,sequenceNumber){return f(sequenceNumber)})},IndexedDbLruDelegate.prototype.setInMemoryPins=function(inMemoryPins){this.inMemoryPins=inMemoryPins},IndexedDbLruDelegate.prototype.addReference=function(txn,key){return writeSentinelKey(txn,key)},IndexedDbLruDelegate.prototype.removeReference=function(txn,key){return writeSentinelKey(txn,key)},IndexedDbLruDelegate.prototype.removeTargets=function(txn,upperBound,activeTargetIds){return this.db.getQueryCache().removeTargets(txn,upperBound,activeTargetIds)},IndexedDbLruDelegate.prototype.removeMutationReference=function(txn,key){return writeSentinelKey(txn,key)},IndexedDbLruDelegate.prototype.isPinned=function(txn,docKey){return this.inMemoryPins.containsKey(docKey)?PersistencePromise.resolve(!0):mutationQueuesContainKey(txn,docKey)},IndexedDbLruDelegate.prototype.removeOrphanedDocuments=function(txn,upperBound){var _this=this,count=0,bytesRemoved=0,promises=[],iteration=this.forEachOrphanedDocument(txn,function(docKey,sequenceNumber){if(sequenceNumber<=upperBound){var p=_this.isPinned(txn,docKey).next(function(isPinned){if(!isPinned)return count++,_this.removeOrphanedDocument(txn,docKey).next(function(documentBytes){bytesRemoved+=documentBytes})});promises.push(p)}});return iteration.next(function(){return PersistencePromise.waitFor(promises)}).next(function(){return _this.db.getRemoteDocumentCache().updateSize(txn,-bytesRemoved)}).next(function(){return count})},IndexedDbLruDelegate.prototype.removeOrphanedDocument=function(txn,docKey){var totalBytesRemoved=0,documentCache=this.db.getRemoteDocumentCache();return PersistencePromise.waitFor([documentTargetStore(txn).delete(sentinelKey(docKey)),documentCache.removeEntry(txn,docKey).next(function(bytesRemoved){totalBytesRemoved+=bytesRemoved})]).next(function(){return totalBytesRemoved})},IndexedDbLruDelegate.prototype.removeTarget=function(txn,queryData){var updated=queryData.copy({sequenceNumber:txn.currentSequenceNumber});return this.db.getQueryCache().updateQueryData(txn,updated)},IndexedDbLruDelegate.prototype.updateLimboDocument=function(txn,key){return writeSentinelKey(txn,key)},IndexedDbLruDelegate.prototype.forEachOrphanedDocument=function(txn,f){var store=documentTargetStore(txn),nextToReport=ListenSequence.INVALID,nextPath;return store.iterate({index:DbTargetDocument.documentTargetsIndex},function(_a,_b){var targetId=_a[0],docKey=_a[1],path=_b.path,sequenceNumber=_b.sequenceNumber;0===targetId?(nextToReport!==ListenSequence.INVALID&&f(new DocumentKey(decode$1(nextPath)),nextToReport),nextToReport=sequenceNumber,nextPath=path):nextToReport=ListenSequence.INVALID}).next(function(){nextToReport!==ListenSequence.INVALID&&f(new DocumentKey(decode$1(nextPath)),nextToReport)})},IndexedDbLruDelegate}(),LocalDocumentsView=function(){function LocalDocumentsView(remoteDocumentCache,mutationQueue){this.remoteDocumentCache=remoteDocumentCache,this.mutationQueue=mutationQueue}return LocalDocumentsView.prototype.getDocument=function(transaction,key){var _this=this;return this.mutationQueue.getAllMutationBatchesAffectingDocumentKey(transaction,key).next(function(batches){return _this.getDocumentInternal(transaction,key,batches)})},LocalDocumentsView.prototype.getDocumentInternal=function(transaction,key,inBatches){return this.remoteDocumentCache.getEntry(transaction,key).next(function(doc){for(var _i=0,inBatches_1=inBatches,batch;_i<inBatches_1.length;_i++)batch=inBatches_1[_i],doc=batch.applyToLocalView(key,doc);return doc})},LocalDocumentsView.prototype.getDocuments=function(transaction,keys){var _this=this;return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(transaction,keys).next(function(batches){var promises=[],results=maybeDocumentMap();return keys.forEach(function(key){promises.push(_this.getDocumentInternal(transaction,key,batches).next(function(maybeDoc){maybeDoc||(maybeDoc=new NoDocument(key,SnapshotVersion.forDeletedDoc())),results=results.insert(key,maybeDoc)}))}),PersistencePromise.waitFor(promises).next(function(){return results})})},LocalDocumentsView.prototype.getDocumentsMatchingQuery=function(transaction,query){return DocumentKey.isDocumentKey(query.path)?this.getDocumentsMatchingDocumentQuery(transaction,query.path):this.getDocumentsMatchingCollectionQuery(transaction,query)},LocalDocumentsView.prototype.getDocumentsMatchingDocumentQuery=function(transaction,docPath){return this.getDocument(transaction,new DocumentKey(docPath)).next(function(maybeDoc){var result=documentMap();return maybeDoc instanceof Document&&(result=result.insert(maybeDoc.key,maybeDoc)),result})},LocalDocumentsView.prototype.getDocumentsMatchingCollectionQuery=function(transaction,query){var _this=this,results;return this.remoteDocumentCache.getDocumentsMatchingQuery(transaction,query).next(function(queryResults){return results=queryResults,_this.mutationQueue.getAllMutationBatchesAffectingQuery(transaction,query)}).next(function(matchingMutationBatches){for(var _i=0,matchingMutationBatches_1=matchingMutationBatches,batch;_i<matchingMutationBatches_1.length;_i++){batch=matchingMutationBatches_1[_i];for(var _a=0,_b=batch.mutations;_a<_b.length;_a++){var mutation=_b[_a],key=mutation.key;if(query.path.isImmediateParentOf(key.path)){var baseDoc=results.get(key),mutatedDoc=mutation.applyToLocalView(baseDoc,baseDoc,batch.localWriteTime);results=mutatedDoc instanceof Document?results.insert(key,mutatedDoc):results.remove(key)}}}}).next(function(){return results.forEach(function(key,doc){query.matches(doc)||(results=results.remove(key))}),results})},LocalDocumentsView}(),ReferenceSet=function(){function ReferenceSet(){this.refsByKey=new SortedSet(DocReference.compareByKey),this.refsByTarget=new SortedSet(DocReference.compareByTargetId)}return ReferenceSet.prototype.isEmpty=function(){return this.refsByKey.isEmpty()},ReferenceSet.prototype.addReference=function(key,id){var ref=new DocReference(key,id);this.refsByKey=this.refsByKey.add(ref),this.refsByTarget=this.refsByTarget.add(ref)},ReferenceSet.prototype.addReferences=function(keys,id){var _this=this;keys.forEach(function(key){return _this.addReference(key,id)})},ReferenceSet.prototype.removeReference=function(key,id){this.removeRef(new DocReference(key,id))},ReferenceSet.prototype.removeReferences=function(keys,id){var _this=this;keys.forEach(function(key){return _this.removeReference(key,id)})},ReferenceSet.prototype.removeReferencesForId=function(id){var _this=this,emptyKey=DocumentKey.EMPTY,startRef=new DocReference(emptyKey,id),endRef=new DocReference(emptyKey,id+1),keys=[];return this.refsByTarget.forEachInRange([startRef,endRef],function(ref){_this.removeRef(ref),keys.push(ref.key)}),keys},ReferenceSet.prototype.removeAllReferences=function(){var _this=this;this.refsByKey.forEach(function(ref){return _this.removeRef(ref)})},ReferenceSet.prototype.removeRef=function(ref){this.refsByKey=this.refsByKey.delete(ref),this.refsByTarget=this.refsByTarget.delete(ref)},ReferenceSet.prototype.referencesForId=function(id){var emptyKey=DocumentKey.EMPTY,startRef=new DocReference(emptyKey,id),endRef=new DocReference(emptyKey,id+1),keys=documentKeySet();return this.refsByTarget.forEachInRange([startRef,endRef],function(ref){keys=keys.add(ref.key)}),keys},ReferenceSet.prototype.containsKey=function(key){var ref=new DocReference(key,0),firstRef=this.refsByKey.firstAfterOrEqual(ref);return null!==firstRef&&key.isEqual(firstRef.key)},ReferenceSet}(),DocReference=function(){function DocReference(key,targetOrBatchId){this.key=key,this.targetOrBatchId=targetOrBatchId}return DocReference.compareByKey=function(left,right){return DocumentKey.comparator(left.key,right.key)||primitiveComparator(left.targetOrBatchId,right.targetOrBatchId)},DocReference.compareByTargetId=function(left,right){return primitiveComparator(left.targetOrBatchId,right.targetOrBatchId)||DocumentKey.comparator(left.key,right.key)},DocReference}(),LocalStore=function(){function LocalStore(persistence,initialUser){this.persistence=persistence,this.localViewReferences=new ReferenceSet,this.queryDataByTarget={},assert(persistence.started,"LocalStore was passed an unstarted persistence implementation"),this.persistence.referenceDelegate.setInMemoryPins(this.localViewReferences),this.mutationQueue=persistence.getMutationQueue(initialUser),this.remoteDocuments=persistence.getRemoteDocumentCache(),this.queryCache=persistence.getQueryCache(),this.localDocuments=new LocalDocumentsView(this.remoteDocuments,this.mutationQueue)}return LocalStore.prototype.handleUserChange=function(user){var _this=this;return this.persistence.runTransaction("Handle user change","readonly",function(txn){var oldBatches;return _this.mutationQueue.getAllMutationBatches(txn).next(function(promisedOldBatches){return oldBatches=promisedOldBatches,_this.mutationQueue=_this.persistence.getMutationQueue(user),_this.localDocuments=new LocalDocumentsView(_this.remoteDocuments,_this.mutationQueue),_this.mutationQueue.getAllMutationBatches(txn)}).next(function(newBatches){for(var removedBatchIds=[],addedBatchIds=[],changedKeys=documentKeySet(),_i=0,oldBatches_1=oldBatches,batch;_i<oldBatches_1.length;_i++){batch=oldBatches_1[_i],removedBatchIds.push(batch.batchId);for(var _a=0,_b=batch.mutations,mutation;_a<_b.length;_a++)mutation=_b[_a],changedKeys=changedKeys.add(mutation.key)}for(var _c=0,newBatches_1=newBatches,batch;_c<newBatches_1.length;_c++){batch=newBatches_1[_c],addedBatchIds.push(batch.batchId);for(var _d=0,_e=batch.mutations,mutation;_d<_e.length;_d++)mutation=_e[_d],changedKeys=changedKeys.add(mutation.key)}return _this.localDocuments.getDocuments(txn,changedKeys).next(function(affectedDocuments){return{affectedDocuments:affectedDocuments,removedBatchIds:removedBatchIds,addedBatchIds:addedBatchIds}})})})},LocalStore.prototype.localWrite=function(mutations){var _this=this;return this.persistence.runTransaction("Locally write mutations","readwrite",function(txn){var localWriteTime=Timestamp.now(),batch;return _this.mutationQueue.addMutationBatch(txn,localWriteTime,mutations).next(function(promisedBatch){batch=promisedBatch;var keys=batch.keys();return _this.localDocuments.getDocuments(txn,keys)}).next(function(changedDocuments){return{batchId:batch.batchId,changes:changedDocuments}})})},LocalStore.prototype.lookupMutationDocuments=function(batchId){var _this=this;return this.persistence.runTransaction("Lookup mutation documents","readonly",function(txn){return _this.mutationQueue.lookupMutationKeys(txn,batchId).next(function(keys){return keys?_this.localDocuments.getDocuments(txn,keys):PersistencePromise.resolve(null)})})},LocalStore.prototype.acknowledgeBatch=function(batchResult){var _this=this;return this.persistence.runTransaction("Acknowledge batch","readwrite-primary",function(txn){var affected=batchResult.batch.keys(),documentBuffer=_this.remoteDocuments.newChangeBuffer();return _this.mutationQueue.acknowledgeBatch(txn,batchResult.batch,batchResult.streamToken).next(function(){return _this.applyWriteToRemoteDocuments(txn,batchResult,documentBuffer)}).next(function(){return documentBuffer.apply(txn)}).next(function(){return _this.mutationQueue.performConsistencyCheck(txn)}).next(function(){return _this.localDocuments.getDocuments(txn,affected)})})},LocalStore.prototype.rejectBatch=function(batchId){var _this=this;return this.persistence.runTransaction("Reject batch","readwrite-primary",function(txn){var affectedKeys;return _this.mutationQueue.lookupMutationBatch(txn,batchId).next(function(batch){return assert(null!==batch,"Attempt to reject nonexistent batch!"),affectedKeys=batch.keys(),_this.mutationQueue.removeMutationBatch(txn,batch)}).next(function(){return _this.mutationQueue.performConsistencyCheck(txn)}).next(function(){return _this.localDocuments.getDocuments(txn,affectedKeys)})})},LocalStore.prototype.getLastStreamToken=function(){var _this=this;return this.persistence.runTransaction("Get last stream token","readonly",function(txn){return _this.mutationQueue.getLastStreamToken(txn)})},LocalStore.prototype.setLastStreamToken=function(streamToken){var _this=this;return this.persistence.runTransaction("Set last stream token","readwrite-primary",function(txn){return _this.mutationQueue.setLastStreamToken(txn,streamToken)})},LocalStore.prototype.getLastRemoteSnapshotVersion=function(){var _this=this;return this.persistence.runTransaction("Get last remote snapshot version","readonly",function(txn){return _this.queryCache.getLastRemoteSnapshotVersion(txn)})},LocalStore.prototype.applyRemoteEvent=function(remoteEvent){var _this=this,documentBuffer=this.remoteDocuments.newChangeBuffer();return this.persistence.runTransaction("Apply remote event","readwrite-primary",function(txn){var promises=[],authoritativeUpdates=documentKeySet();forEachNumber(remoteEvent.targetChanges,function(targetId,change){var queryData=_this.queryDataByTarget[targetId];if(queryData){change.addedDocuments.forEach(function(key){authoritativeUpdates=authoritativeUpdates.add(key)}),change.modifiedDocuments.forEach(function(key){authoritativeUpdates=authoritativeUpdates.add(key)}),promises.push(_this.queryCache.removeMatchingKeys(txn,change.removedDocuments,targetId).next(function(){return _this.queryCache.addMatchingKeys(txn,change.addedDocuments,targetId)}));var resumeToken=change.resumeToken;if(0<resumeToken.length){var oldQueryData=queryData;queryData=queryData.copy({resumeToken:resumeToken,snapshotVersion:remoteEvent.snapshotVersion}),_this.queryDataByTarget[targetId]=queryData,LocalStore.shouldPersistQueryData(oldQueryData,queryData,change)&&promises.push(_this.queryCache.updateQueryData(txn,queryData))}}});var changedDocKeys=documentKeySet();remoteEvent.documentUpdates.forEach(function(key,doc){changedDocKeys=changedDocKeys.add(key),promises.push(documentBuffer.getEntry(txn,key).next(function(existingDoc){null==existingDoc||doc.version.isEqual(SnapshotVersion.MIN)||authoritativeUpdates.has(doc.key)&&!existingDoc.hasPendingWrites||0<=doc.version.compareTo(existingDoc.version)?documentBuffer.addEntry(doc):debug("LocalStore","Ignoring outdated watch update for ",key,". Current version:",existingDoc.version," Watch version:",doc.version)})),remoteEvent.resolvedLimboDocuments.has(key)&&promises.push(_this.persistence.referenceDelegate.updateLimboDocument(txn,key))});var remoteVersion=remoteEvent.snapshotVersion;if(!remoteVersion.isEqual(SnapshotVersion.MIN)){var updateRemoteVersion=_this.queryCache.getLastRemoteSnapshotVersion(txn).next(function(lastRemoteVersion){return assert(0<=remoteVersion.compareTo(lastRemoteVersion),"Watch stream reverted to previous snapshot?? "+remoteVersion+" < "+lastRemoteVersion),_this.queryCache.setTargetsMetadata(txn,txn.currentSequenceNumber,remoteVersion)});promises.push(updateRemoteVersion)}return PersistencePromise.waitFor(promises).next(function(){return documentBuffer.apply(txn)}).next(function(){return _this.localDocuments.getDocuments(txn,changedDocKeys)})})},LocalStore.shouldPersistQueryData=function(oldQueryData,newQueryData,change){if(0===newQueryData.resumeToken.length)return!1;if(0===oldQueryData.resumeToken.length)return!0;var timeDelta=newQueryData.snapshotVersion.toMicroseconds()-oldQueryData.snapshotVersion.toMicroseconds();if(timeDelta>=this.RESUME_TOKEN_MAX_AGE_MICROS)return!0;var changes=change.addedDocuments.size+change.modifiedDocuments.size+change.removedDocuments.size;return 0<changes},LocalStore.prototype.notifyLocalViewChanges=function(viewChanges){var _this=this;return this.persistence.runTransaction("notifyLocalViewChanges","readwrite",function(txn){return PersistencePromise.forEach(viewChanges,function(viewChange){return _this.localViewReferences.addReferences(viewChange.addedKeys,viewChange.targetId),_this.localViewReferences.removeReferences(viewChange.removedKeys,viewChange.targetId),PersistencePromise.forEach(viewChange.removedKeys,function(key){return _this.persistence.referenceDelegate.removeReference(txn,key)})})})},LocalStore.prototype.nextMutationBatch=function(afterBatchId){var _this=this;return this.persistence.runTransaction("Get next mutation batch","readonly",function(txn){return void 0===afterBatchId&&(afterBatchId=BATCHID_UNKNOWN),_this.mutationQueue.getNextMutationBatchAfterBatchId(txn,afterBatchId)})},LocalStore.prototype.readDocument=function(key){var _this=this;return this.persistence.runTransaction("read document","readonly",function(txn){return _this.localDocuments.getDocument(txn,key)})},LocalStore.prototype.allocateQuery=function(query){var _this=this;return this.persistence.runTransaction("Allocate query","readwrite",function(txn){var queryData;return _this.queryCache.getQueryData(txn,query).next(function(cached){return cached?(queryData=cached,PersistencePromise.resolve()):_this.queryCache.allocateTargetId(txn).next(function(targetId){return queryData=new QueryData(query,targetId,QueryPurpose.Listen,txn.currentSequenceNumber),_this.queryCache.addQueryData(txn,queryData)})}).next(function(){return assert(!_this.queryDataByTarget[queryData.targetId],"Tried to allocate an already allocated query: "+query),_this.queryDataByTarget[queryData.targetId]=queryData,queryData})})},LocalStore.prototype.releaseQuery=function(query,keepPersistedQueryData){var _this=this,mode=keepPersistedQueryData?"readwrite":"readwrite-primary";return this.persistence.runTransaction("Release query",mode,function(txn){return _this.queryCache.getQueryData(txn,query).next(function(queryData){assert(null!=queryData,"Tried to release nonexistent query: "+query);var targetId=queryData.targetId,cachedQueryData=_this.queryDataByTarget[targetId],removed=_this.localViewReferences.removeReferencesForId(targetId);return delete _this.queryDataByTarget[targetId],keepPersistedQueryData?PersistencePromise.resolve():PersistencePromise.forEach(removed,function(key){return _this.persistence.referenceDelegate.removeReference(txn,key)}).next(function(){return _this.persistence.referenceDelegate.removeTarget(txn,cachedQueryData)})})})},LocalStore.prototype.executeQuery=function(query){var _this=this;return this.persistence.runTransaction("Execute query","readonly",function(txn){return _this.localDocuments.getDocumentsMatchingQuery(txn,query)})},LocalStore.prototype.remoteDocumentKeys=function(targetId){var _this=this;return this.persistence.runTransaction("Remote document keys","readonly",function(txn){return _this.queryCache.getMatchingKeysForTargetId(txn,targetId)})},LocalStore.prototype.getActiveClients=function(){return this.persistence.getActiveClients()},LocalStore.prototype.removeCachedMutationBatchMetadata=function(batchId){this.mutationQueue.removeCachedMutationKeys(batchId)},LocalStore.prototype.setNetworkEnabled=function(networkEnabled){this.persistence.setNetworkEnabled(networkEnabled)},LocalStore.prototype.applyWriteToRemoteDocuments=function(txn,batchResult,documentBuffer){var _this=this,batch=batchResult.batch,docKeys=batch.keys(),promiseChain=PersistencePromise.resolve();return docKeys.forEach(function(docKey){promiseChain=promiseChain.next(function(){return documentBuffer.getEntry(txn,docKey)}).next(function(remoteDoc){var doc=remoteDoc,ackVersion=batchResult.docVersions.get(docKey);assert(null!==ackVersion,"ackVersions should contain every doc in the write."),(!doc||0>doc.version.compareTo(ackVersion))&&(doc=batch.applyToRemoteDocument(docKey,doc,batchResult),doc?documentBuffer.addEntry(doc):assert(!remoteDoc,"Mutation batch "+batch+" applied to document "+remoteDoc+" resulted in null"))})}),promiseChain.next(function(){return _this.mutationQueue.removeMutationBatch(txn,batch)})},LocalStore.prototype.getQueryForTarget=function(targetId){var _this=this;return this.queryDataByTarget[targetId]?Promise.resolve(this.queryDataByTarget[targetId].query):this.persistence.runTransaction("Get query data","readonly",function(txn){return _this.queryCache.getQueryDataForTarget(txn,targetId).next(function(queryData){return queryData?queryData.query:null})})},LocalStore.prototype.getNewDocumentChanges=function(){var _this=this;return this.persistence.runTransaction("Get new document changes","readonly",function(txn){return _this.remoteDocuments.getNewDocumentChanges(txn)})},LocalStore.RESUME_TOKEN_MAX_AGE_MICROS=300000000,LocalStore}(),MemoryMutationQueue=function(){function MemoryMutationQueue(referenceDelegate){this.referenceDelegate=referenceDelegate,this.mutationQueue=[],this.nextBatchId=1,this.highestAcknowledgedBatchId=BATCHID_UNKNOWN,this.lastStreamToken=emptyByteString(),this.batchesByDocumentKey=new SortedSet(DocReference.compareByKey)}return MemoryMutationQueue.prototype.checkEmpty=function(){return PersistencePromise.resolve(0===this.mutationQueue.length)},MemoryMutationQueue.prototype.acknowledgeBatch=function(transaction,batch,streamToken){var batchId=batch.batchId;assert(batchId>this.highestAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order");var batchIndex=this.indexOfExistingBatchId(batchId,"acknowledged");assert(0===batchIndex,"Can only acknowledge the first batch in the mutation queue");var check=this.mutationQueue[batchIndex];return assert(batchId===check.batchId,"Queue ordering failure: expected batch "+batchId+", got batch "+check.batchId),this.highestAcknowledgedBatchId=batchId,this.lastStreamToken=streamToken,PersistencePromise.resolve()},MemoryMutationQueue.prototype.getLastStreamToken=function(){return PersistencePromise.resolve(this.lastStreamToken)},MemoryMutationQueue.prototype.setLastStreamToken=function(transaction,streamToken){return this.lastStreamToken=streamToken,PersistencePromise.resolve()},MemoryMutationQueue.prototype.addMutationBatch=function(transaction,localWriteTime,mutations){assert(0!==mutations.length,"Mutation batches should not be empty");var batchId=this.nextBatchId;if(this.nextBatchId++,0<this.mutationQueue.length){var prior=this.mutationQueue[this.mutationQueue.length-1];assert(prior.batchId<batchId,"Mutation batchIDs must be monotonically increasing order")}var batch=new MutationBatch(batchId,localWriteTime,mutations);this.mutationQueue.push(batch);for(var _i=0,mutations_1=mutations,mutation;_i<mutations_1.length;_i++)mutation=mutations_1[_i],this.batchesByDocumentKey=this.batchesByDocumentKey.add(new DocReference(mutation.key,batchId));return PersistencePromise.resolve(batch)},MemoryMutationQueue.prototype.lookupMutationBatch=function(transaction,batchId){return PersistencePromise.resolve(this.findMutationBatch(batchId))},MemoryMutationQueue.prototype.lookupMutationKeys=function(transaction,batchId){var mutationBatch=this.findMutationBatch(batchId);return assert(null!=mutationBatch,"Failed to find local mutation batch."),PersistencePromise.resolve(mutationBatch.keys())},MemoryMutationQueue.prototype.getNextMutationBatchAfterBatchId=function(transaction,batchId){var nextBatchId=_Mathmax3(batchId,this.highestAcknowledgedBatchId)+1,rawIndex=this.indexOfBatchId(nextBatchId),index=0>rawIndex?0:rawIndex;return PersistencePromise.resolve(this.mutationQueue.length>index?this.mutationQueue[index]:null)},MemoryMutationQueue.prototype.getAllMutationBatches=function(){return PersistencePromise.resolve(this.mutationQueue.slice())},MemoryMutationQueue.prototype.getAllMutationBatchesAffectingDocumentKey=function(transaction,documentKey){var _this=this,start=new DocReference(documentKey,0),end=new DocReference(documentKey,_NumberPOSITIVE_INFINITY),result=[];return this.batchesByDocumentKey.forEachInRange([start,end],function(ref){assert(documentKey.isEqual(ref.key),"Should only iterate over a single key's batches");var batch=_this.findMutationBatch(ref.targetOrBatchId);assert(null!==batch,"Batches in the index must exist in the main table"),result.push(batch)}),PersistencePromise.resolve(result)},MemoryMutationQueue.prototype.getAllMutationBatchesAffectingDocumentKeys=function(transaction,documentKeys){var _this=this,uniqueBatchIDs=new SortedSet(primitiveComparator);return documentKeys.forEach(function(documentKey){var start=new DocReference(documentKey,0),end=new DocReference(documentKey,_NumberPOSITIVE_INFINITY);_this.batchesByDocumentKey.forEachInRange([start,end],function(ref){assert(documentKey.isEqual(ref.key),"For each key, should only iterate over a single key's batches"),uniqueBatchIDs=uniqueBatchIDs.add(ref.targetOrBatchId)})}),PersistencePromise.resolve(this.findMutationBatches(uniqueBatchIDs))},MemoryMutationQueue.prototype.getAllMutationBatchesAffectingQuery=function(transaction,query){var prefix=query.path,immediateChildrenPathLength=prefix.length+1,startPath=prefix;DocumentKey.isDocumentKey(startPath)||(startPath=startPath.child(""));var start=new DocReference(new DocumentKey(startPath),0),uniqueBatchIDs=new SortedSet(primitiveComparator);return this.batchesByDocumentKey.forEachWhile(function(ref){var rowKeyPath=ref.key.path;return!!prefix.isPrefixOf(rowKeyPath)&&(rowKeyPath.length===immediateChildrenPathLength&&(uniqueBatchIDs=uniqueBatchIDs.add(ref.targetOrBatchId)),!0)},start),PersistencePromise.resolve(this.findMutationBatches(uniqueBatchIDs))},MemoryMutationQueue.prototype.findMutationBatches=function(batchIDs){var _this=this,result=[];return batchIDs.forEach(function(batchId){var batch=_this.findMutationBatch(batchId);null!==batch&&result.push(batch)}),result},MemoryMutationQueue.prototype.removeMutationBatch=function(transaction,batch){var _this=this,batchIndex=this.indexOfExistingBatchId(batch.batchId,"removed");assert(0===batchIndex,"Can only remove the first entry of the mutation queue"),this.mutationQueue.shift();var references=this.batchesByDocumentKey;return PersistencePromise.forEach(batch.mutations,function(mutation){var ref=new DocReference(mutation.key,batch.batchId);return references=references.delete(ref),_this.referenceDelegate.removeMutationReference(transaction,mutation.key)}).next(function(){_this.batchesByDocumentKey=references})},MemoryMutationQueue.prototype.removeCachedMutationKeys=function(){},MemoryMutationQueue.prototype.containsKey=function(txn,key){var ref=new DocReference(key,0),firstRef=this.batchesByDocumentKey.firstAfterOrEqual(ref);return PersistencePromise.resolve(key.isEqual(firstRef&&firstRef.key))},MemoryMutationQueue.prototype.performConsistencyCheck=function(){return 0===this.mutationQueue.length&&assert(this.batchesByDocumentKey.isEmpty(),"Document leak -- detected dangling mutation references when queue is empty."),PersistencePromise.resolve()},MemoryMutationQueue.prototype.indexOfExistingBatchId=function(batchId,action){var index=this.indexOfBatchId(batchId);return assert(0<=index&&index<this.mutationQueue.length,"Batches must exist to be "+action),index},MemoryMutationQueue.prototype.indexOfBatchId=function(batchId){if(0===this.mutationQueue.length)return 0;var firstBatchId=this.mutationQueue[0].batchId;return batchId-firstBatchId},MemoryMutationQueue.prototype.findMutationBatch=function(batchId){var index=this.indexOfBatchId(batchId);if(0>index||index>=this.mutationQueue.length)return null;var batch=this.mutationQueue[index];return assert(batch.batchId===batchId,"If found batch must match"),batch},MemoryMutationQueue}(),MemoryQueryCache=function(){function MemoryQueryCache(persistence){this.persistence=persistence,this.queries=new ObjectMap(function(q){return q.canonicalId()}),this.lastRemoteSnapshotVersion=SnapshotVersion.MIN,this.highestTargetId=0,this.highestSequenceNumber=0,this.references=new ReferenceSet,this.targetCount=0,this.targetIdGenerator=TargetIdGenerator.forQueryCache()}return MemoryQueryCache.prototype.getTargetCount=function(){return PersistencePromise.resolve(this.targetCount)},MemoryQueryCache.prototype.forEachTarget=function(txn,f){return this.queries.forEach(function(_,queryData){return f(queryData)}),PersistencePromise.resolve()},MemoryQueryCache.prototype.getLastRemoteSnapshotVersion=function(){return PersistencePromise.resolve(this.lastRemoteSnapshotVersion)},MemoryQueryCache.prototype.getHighestSequenceNumber=function(){return PersistencePromise.resolve(this.highestSequenceNumber)},MemoryQueryCache.prototype.allocateTargetId=function(){var nextTargetId=this.targetIdGenerator.after(this.highestTargetId);return this.highestTargetId=nextTargetId,PersistencePromise.resolve(nextTargetId)},MemoryQueryCache.prototype.setTargetsMetadata=function(transaction,highestListenSequenceNumber,lastRemoteSnapshotVersion){return lastRemoteSnapshotVersion&&(this.lastRemoteSnapshotVersion=lastRemoteSnapshotVersion),highestListenSequenceNumber>this.highestSequenceNumber&&(this.highestSequenceNumber=highestListenSequenceNumber),PersistencePromise.resolve()},MemoryQueryCache.prototype.saveQueryData=function(queryData){this.queries.set(queryData.query,queryData);var targetId=queryData.targetId;targetId>this.highestTargetId&&(this.highestTargetId=targetId),queryData.sequenceNumber>this.highestSequenceNumber&&(this.highestSequenceNumber=queryData.sequenceNumber)},MemoryQueryCache.prototype.addQueryData=function(transaction,queryData){return assert(!this.queries.has(queryData.query),"Adding a query that already exists"),this.saveQueryData(queryData),this.targetCount+=1,PersistencePromise.resolve()},MemoryQueryCache.prototype.updateQueryData=function(transaction,queryData){return assert(this.queries.has(queryData.query),"Updating a non-existent query"),this.saveQueryData(queryData),PersistencePromise.resolve()},MemoryQueryCache.prototype.removeQueryData=function(transaction,queryData){return assert(0<this.targetCount,"Removing a target from an empty cache"),assert(this.queries.has(queryData.query),"Removing a non-existent target from the cache"),this.queries.delete(queryData.query),this.references.removeReferencesForId(queryData.targetId),this.targetCount-=1,PersistencePromise.resolve()},MemoryQueryCache.prototype.removeTargets=function(transaction,upperBound,activeTargetIds){var _this=this,count=0,removals=[];return this.queries.forEach(function(key,queryData){queryData.sequenceNumber<=upperBound&&!activeTargetIds[queryData.targetId]&&(_this.queries.delete(key),removals.push(_this.removeMatchingKeysForTargetId(transaction,queryData.targetId)),count++)}),PersistencePromise.waitFor(removals).next(function(){return count})},MemoryQueryCache.prototype.getQueryCount=function(){return PersistencePromise.resolve(this.targetCount)},MemoryQueryCache.prototype.getQueryData=function(transaction,query){var queryData=this.queries.get(query)||null;return PersistencePromise.resolve(queryData)},MemoryQueryCache.prototype.getQueryDataForTarget=function(){return fail("Not yet implemented.")},MemoryQueryCache.prototype.addMatchingKeys=function(txn,keys,targetId){this.references.addReferences(keys,targetId);var referenceDelegate=this.persistence.referenceDelegate,promises=[];return referenceDelegate&&keys.forEach(function(key){promises.push(referenceDelegate.addReference(txn,key))}),PersistencePromise.waitFor(promises)},MemoryQueryCache.prototype.removeMatchingKeys=function(txn,keys,targetId){this.references.removeReferences(keys,targetId);var referenceDelegate=this.persistence.referenceDelegate,promises=[];return referenceDelegate&&keys.forEach(function(key){promises.push(referenceDelegate.removeReference(txn,key))}),PersistencePromise.waitFor(promises)},MemoryQueryCache.prototype.removeMatchingKeysForTargetId=function(txn,targetId){return this.references.removeReferencesForId(targetId),PersistencePromise.resolve()},MemoryQueryCache.prototype.getMatchingKeysForTargetId=function(txn,targetId){var matchingKeys=this.references.referencesForId(targetId);return PersistencePromise.resolve(matchingKeys)},MemoryQueryCache.prototype.containsKey=function(txn,key){return PersistencePromise.resolve(this.references.containsKey(key))},MemoryQueryCache}(),MemoryRemoteDocumentCache=function(){function MemoryRemoteDocumentCache(sizer){this.sizer=sizer,this.docs=documentSizeMap(),this.newDocumentChanges=documentKeySet(),this.size=0}return MemoryRemoteDocumentCache.prototype.addEntries=function(transaction,entries,sizeDelta){for(var _i=0,entries_1=entries;_i<entries_1.length;_i++){var entry=entries_1[_i],key=entry.maybeDocument.key;this.docs=this.docs.insert(key,entry),this.newDocumentChanges=this.newDocumentChanges.add(key)}return this.size+=sizeDelta,PersistencePromise.resolve()},MemoryRemoteDocumentCache.prototype.removeEntry=function(transaction,documentKey){var entry=this.docs.get(documentKey);return entry?(this.docs=this.docs.remove(documentKey),this.size-=entry.size,PersistencePromise.resolve(entry.size)):PersistencePromise.resolve(0)},MemoryRemoteDocumentCache.prototype.getEntry=function(transaction,documentKey){var entry=this.docs.get(documentKey);return PersistencePromise.resolve(entry?entry.maybeDocument:null)},MemoryRemoteDocumentCache.prototype.getSizedEntry=function(transaction,documentKey){return PersistencePromise.resolve(this.docs.get(documentKey))},MemoryRemoteDocumentCache.prototype.getDocumentsMatchingQuery=function(transaction,query){for(var results=documentMap(),prefix=new DocumentKey(query.path.child("")),iterator=this.docs.getIteratorFrom(prefix);iterator.hasNext();){var _a=iterator.getNext(),key=_a.key,maybeDocument=_a.value.maybeDocument;if(!query.path.isPrefixOf(key.path))break;maybeDocument instanceof Document&&query.matches(maybeDocument)&&(results=results.insert(maybeDocument.key,maybeDocument))}return PersistencePromise.resolve(results)},MemoryRemoteDocumentCache.prototype.forEachDocumentKey=function(transaction,f){return PersistencePromise.forEach(this.docs,function(key){return f(key)})},MemoryRemoteDocumentCache.prototype.getNewDocumentChanges=function(){var _this=this,changedDocs=maybeDocumentMap();return this.newDocumentChanges.forEach(function(key){var entry=_this.docs.get(key),changedDoc=entry?entry.maybeDocument:new NoDocument(key,SnapshotVersion.forDeletedDoc());changedDocs=changedDocs.insert(key,changedDoc)}),this.newDocumentChanges=documentKeySet(),PersistencePromise.resolve(changedDocs)},MemoryRemoteDocumentCache.prototype.newChangeBuffer=function(){return new MemoryRemoteDocumentChangeBuffer(this.sizer,this)},MemoryRemoteDocumentCache.prototype.getSize=function(){return PersistencePromise.resolve(this.size)},MemoryRemoteDocumentCache}(),MemoryRemoteDocumentChangeBuffer=function(_super){function MemoryRemoteDocumentChangeBuffer(sizer,documentCache){var _this=_super.call(this)||this;return _this.sizer=sizer,_this.documentCache=documentCache,_this}return tslib_1.__extends(MemoryRemoteDocumentChangeBuffer,_super),MemoryRemoteDocumentChangeBuffer.prototype.applyChanges=function(transaction){var _this=this,changes=this.assertChanges(),delta=0,docs=[];return changes.forEach(function(key,maybeDocument){var previousSize=_this.documentSizes.get(key);assert(void 0!==previousSize,"Attempting to change document "+key.toString()+" without having read it first");var size=_this.sizer(maybeDocument);delta+=size-previousSize,docs.push({maybeDocument:maybeDocument,size:size})}),this.documentCache.addEntries(transaction,docs,delta)},MemoryRemoteDocumentChangeBuffer.prototype.getFromCache=function(transaction,documentKey){return this.documentCache.getSizedEntry(transaction,documentKey)},MemoryRemoteDocumentChangeBuffer}(RemoteDocumentChangeBuffer),MemoryPersistence=function(){function MemoryPersistence(clientId,isEager,serializer){var _this=this;this.clientId=clientId,this.mutationQueues={},this.listenSequence=new ListenSequence(0),this._started=!1,this._started=!0,this.referenceDelegate=isEager?new MemoryEagerDelegate(this):new MemoryLruDelegate(this,new LocalSerializer(serializer)),this.queryCache=new MemoryQueryCache(this);this.remoteDocumentCache=new MemoryRemoteDocumentCache(function(doc){return _this.referenceDelegate.documentSize(doc)})}return MemoryPersistence.createLruPersistence=function(clientId,serializer){return new MemoryPersistence(clientId,!1,serializer)},MemoryPersistence.createEagerPersistence=function(clientId,serializer){return new MemoryPersistence(clientId,!0,serializer)},MemoryPersistence.prototype.shutdown=function(){return this._started=!1,Promise.resolve()},Object.defineProperty(MemoryPersistence.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0}),MemoryPersistence.prototype.getActiveClients=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return[2,[this.clientId]]})})},MemoryPersistence.prototype.setPrimaryStateListener=function(primaryStateListener){return primaryStateListener(!0)},MemoryPersistence.prototype.setNetworkEnabled=function(){},MemoryPersistence.prototype.getMutationQueue=function(user){var queue=this.mutationQueues[user.toKey()];return queue||(queue=new MemoryMutationQueue(this.referenceDelegate),this.mutationQueues[user.toKey()]=queue),queue},MemoryPersistence.prototype.getQueryCache=function(){return this.queryCache},MemoryPersistence.prototype.getRemoteDocumentCache=function(){return this.remoteDocumentCache},MemoryPersistence.prototype.runTransaction=function(action,mode,transactionOperation){var _this=this;debug("MemoryPersistence","Starting transaction:",action);var txn=new MemoryTransaction(this.listenSequence.next());return this.referenceDelegate.onTransactionStarted(),transactionOperation(txn).next(function(result){return _this.referenceDelegate.onTransactionCommitted(txn).next(function(){return result})}).toPromise()},MemoryPersistence.prototype.mutationQueuesContainKey=function(transaction,key){return PersistencePromise.or(values(this.mutationQueues).map(function(queue){return function(){return queue.containsKey(transaction,key)}}))},MemoryPersistence}(),MemoryTransaction=function(){return function(currentSequenceNumber){this.currentSequenceNumber=currentSequenceNumber}}(),MemoryEagerDelegate=function(){function MemoryEagerDelegate(persistence){this.persistence=persistence}return MemoryEagerDelegate.prototype.setInMemoryPins=function(inMemoryPins){this.inMemoryPins=inMemoryPins},MemoryEagerDelegate.prototype.addReference=function(txn,key){return this.orphanedDocuments.delete(key),PersistencePromise.resolve()},MemoryEagerDelegate.prototype.removeReference=function(txn,key){return this.orphanedDocuments.add(key),PersistencePromise.resolve()},MemoryEagerDelegate.prototype.removeMutationReference=function(txn,key){return this.orphanedDocuments.add(key),PersistencePromise.resolve()},MemoryEagerDelegate.prototype.removeTarget=function(txn,queryData){var _this=this,cache=this.persistence.getQueryCache();return cache.getMatchingKeysForTargetId(txn,queryData.targetId).next(function(keys){keys.forEach(function(key){return _this.orphanedDocuments.add(key)})}).next(function(){return cache.removeQueryData(txn,queryData)})},MemoryEagerDelegate.prototype.onTransactionStarted=function(){this.orphanedDocuments=new Set},MemoryEagerDelegate.prototype.onTransactionCommitted=function(txn){var _this=this,cache=this.persistence.getRemoteDocumentCache();return PersistencePromise.forEach(this.orphanedDocuments,function(key){return _this.isReferenced(txn,key).next(function(isReferenced){return isReferenced?PersistencePromise.resolve():cache.removeEntry(txn,key).next(function(){})})})},MemoryEagerDelegate.prototype.updateLimboDocument=function(txn,key){var _this=this;return this.isReferenced(txn,key).next(function(isReferenced){isReferenced?_this.orphanedDocuments.delete(key):_this.orphanedDocuments.add(key)})},MemoryEagerDelegate.prototype.documentSize=function(){return 0},MemoryEagerDelegate.prototype.isReferenced=function(txn,key){var _this=this;return PersistencePromise.or([function(){return _this.persistence.getQueryCache().containsKey(txn,key)},function(){return _this.persistence.mutationQueuesContainKey(txn,key)},function(){return PersistencePromise.resolve(_this.inMemoryPins.containsKey(key))}])},MemoryEagerDelegate}(),MemoryLruDelegate=function(){function MemoryLruDelegate(persistence,serializer){this.persistence=persistence,this.serializer=serializer,this.orphanedSequenceNumbers=new ObjectMap(function(k){return encode(k.path)}),this.garbageCollector=new LruGarbageCollector(this)}return MemoryLruDelegate.prototype.onTransactionStarted=function(){},MemoryLruDelegate.prototype.onTransactionCommitted=function(){return PersistencePromise.resolve()},MemoryLruDelegate.prototype.forEachTarget=function(txn,f){return this.persistence.getQueryCache().forEachTarget(txn,f)},MemoryLruDelegate.prototype.getTargetCount=function(txn){return this.persistence.getQueryCache().getTargetCount(txn)},MemoryLruDelegate.prototype.forEachOrphanedDocumentSequenceNumber=function(txn,f){var _this=this;return PersistencePromise.forEach(this.orphanedSequenceNumbers,function(key,sequenceNumber){return _this.isPinned(txn,key,sequenceNumber).next(function(isPinned){return isPinned?PersistencePromise.resolve():f(sequenceNumber)})})},MemoryLruDelegate.prototype.setInMemoryPins=function(inMemoryPins){this.inMemoryPins=inMemoryPins},MemoryLruDelegate.prototype.removeTargets=function(txn,upperBound,activeTargetIds){return this.persistence.getQueryCache().removeTargets(txn,upperBound,activeTargetIds)},MemoryLruDelegate.prototype.removeOrphanedDocuments=function(txn,upperBound){var _this=this,count=0,cache=this.persistence.getRemoteDocumentCache(),p=cache.forEachDocumentKey(txn,function(key){return _this.isPinned(txn,key,upperBound).next(function(isPinned){return isPinned?PersistencePromise.resolve():(count++,cache.removeEntry(txn,key).next())})});return p.next(function(){return count})},MemoryLruDelegate.prototype.removeMutationReference=function(txn,key){return this.orphanedSequenceNumbers.set(key,txn.currentSequenceNumber),PersistencePromise.resolve()},MemoryLruDelegate.prototype.removeTarget=function(txn,queryData){var updated=queryData.copy({sequenceNumber:txn.currentSequenceNumber});return this.persistence.getQueryCache().updateQueryData(txn,updated)},MemoryLruDelegate.prototype.addReference=function(txn,key){return this.orphanedSequenceNumbers.set(key,txn.currentSequenceNumber),PersistencePromise.resolve()},MemoryLruDelegate.prototype.removeReference=function(txn,key){return this.orphanedSequenceNumbers.set(key,txn.currentSequenceNumber),PersistencePromise.resolve()},MemoryLruDelegate.prototype.updateLimboDocument=function(txn,key){return this.orphanedSequenceNumbers.set(key,txn.currentSequenceNumber),PersistencePromise.resolve()},MemoryLruDelegate.prototype.documentSize=function(maybeDoc){var remoteDocument=this.serializer.toDbRemoteDocument(maybeDoc),value;if(remoteDocument.document)value=remoteDocument.document;else if(remoteDocument.unknownDocument)value=remoteDocument.unknownDocument;else if(remoteDocument.noDocument)value=remoteDocument.noDocument;else throw fail("Unknown remote document type");return JSON.stringify(value).length},MemoryLruDelegate.prototype.isPinned=function(txn,key,upperBound){var _this=this;return PersistencePromise.or([function(){return _this.persistence.mutationQueuesContainKey(txn,key)},function(){return PersistencePromise.resolve(_this.inMemoryPins.containsKey(key))},function(){return _this.persistence.getQueryCache().containsKey(txn,key)},function(){var orphanedAt=_this.orphanedSequenceNumbers.get(key);return PersistencePromise.resolve(void 0!==orphanedAt&&orphanedAt>upperBound)}])},MemoryLruDelegate}(),ExponentialBackoff=function(){function ExponentialBackoff(queue,timerId,initialDelayMs,backoffFactor,maxDelayMs){this.queue=queue,this.timerId=timerId,this.initialDelayMs=initialDelayMs,this.backoffFactor=backoffFactor,this.maxDelayMs=maxDelayMs,this.timerPromise=null,this.lastAttemptTime=Date.now(),this.reset()}return ExponentialBackoff.prototype.reset=function(){this.currentBaseMs=0},ExponentialBackoff.prototype.resetToMax=function(){this.currentBaseMs=this.maxDelayMs},ExponentialBackoff.prototype.backoffAndRun=function(op){var _this=this;this.cancel();var desiredDelayWithJitterMs=_Mathfloor3(this.currentBaseMs+this.jitterDelayMs()),delaySoFarMs=_Mathmax3(0,Date.now()-this.lastAttemptTime),remainingDelayMs=_Mathmax3(0,desiredDelayWithJitterMs-delaySoFarMs);0<this.currentBaseMs&&debug("ExponentialBackoff","Backing off for "+remainingDelayMs+" ms "+("(base delay: "+this.currentBaseMs+" ms, ")+("delay with jitter: "+desiredDelayWithJitterMs+" ms, ")+("last attempt: "+delaySoFarMs+" ms ago)")),this.timerPromise=this.queue.enqueueAfterDelay(this.timerId,remainingDelayMs,function(){return _this.lastAttemptTime=Date.now(),op()}),this.currentBaseMs*=this.backoffFactor,this.currentBaseMs<this.initialDelayMs&&(this.currentBaseMs=this.initialDelayMs),this.currentBaseMs>this.maxDelayMs&&(this.currentBaseMs=this.maxDelayMs)},ExponentialBackoff.prototype.cancel=function(){null!==this.timerPromise&&(this.timerPromise.cancel(),this.timerPromise=null)},ExponentialBackoff.prototype.jitterDelayMs=function(){return(Math.random()-0.5)*this.currentBaseMs},ExponentialBackoff}(),LOG_TAG$6="PersistentStream",PersistentStreamState;(function(PersistentStreamState){PersistentStreamState[PersistentStreamState.Initial=0]="Initial",PersistentStreamState[PersistentStreamState.Starting=1]="Starting",PersistentStreamState[PersistentStreamState.Open=2]="Open",PersistentStreamState[PersistentStreamState.Error=3]="Error",PersistentStreamState[PersistentStreamState.Backoff=4]="Backoff"})(PersistentStreamState||(PersistentStreamState={}));var PersistentStream=function(){function PersistentStream(queue,connectionTimerId,idleTimerId,connection,credentialsProvider,listener){this.queue=queue,this.idleTimerId=idleTimerId,this.connection=connection,this.credentialsProvider=credentialsProvider,this.listener=listener,this.state=PersistentStreamState.Initial,this.closeCount=0,this.idleTimer=null,this.stream=null,this.backoff=new ExponentialBackoff(queue,connectionTimerId,1e3,1.5,60000)}return PersistentStream.prototype.isStarted=function(){return this.state===PersistentStreamState.Starting||this.state===PersistentStreamState.Open||this.state===PersistentStreamState.Backoff},PersistentStream.prototype.isOpen=function(){return this.state===PersistentStreamState.Open},PersistentStream.prototype.start=function(){return this.state===PersistentStreamState.Error?void this.performBackoff():void(assert(this.state===PersistentStreamState.Initial,"Already started"),this.auth())},PersistentStream.prototype.stop=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return this.isStarted()?[4,this.close(PersistentStreamState.Initial)]:[3,2];case 1:_a.sent(),_a.label=2;case 2:return[2];}})})},PersistentStream.prototype.inhibitBackoff=function(){assert(!this.isStarted(),"Can only inhibit backoff in a stopped state"),this.state=PersistentStreamState.Initial,this.backoff.reset()},PersistentStream.prototype.markIdle=function(){var _this=this;this.isOpen()&&null===this.idleTimer&&(this.idleTimer=this.queue.enqueueAfterDelay(this.idleTimerId,60000,function(){return _this.handleIdleCloseTimer()}))},PersistentStream.prototype.sendRequest=function(msg){this.cancelIdleCheck(),this.stream.send(msg)},PersistentStream.prototype.handleIdleCloseTimer=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return this.isOpen()?[2,this.close(PersistentStreamState.Initial)]:[2]})})},PersistentStream.prototype.cancelIdleCheck=function(){this.idleTimer&&(this.idleTimer.cancel(),this.idleTimer=null)},PersistentStream.prototype.close=function(finalState,error$$1){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return assert(this.isStarted(),"Only started streams should be closed."),assert(finalState===PersistentStreamState.Error||isNullOrUndefined(error$$1),"Can't provide an error when not in an error state."),this.cancelIdleCheck(),this.backoff.cancel(),this.closeCount++,finalState===PersistentStreamState.Error?error$$1&&error$$1.code===Code.RESOURCE_EXHAUSTED?(error(error$$1.toString()),error("Using maximum backoff delay to prevent overloading the backend."),this.backoff.resetToMax()):error$$1&&error$$1.code===Code.UNAUTHENTICATED&&this.credentialsProvider.invalidateToken():this.backoff.reset(),null!==this.stream&&(this.tearDown(),this.stream.close(),this.stream=null),this.state=finalState,[4,this.listener.onClose(error$$1)];case 1:return _a.sent(),[2];}})})},PersistentStream.prototype.tearDown=function(){},PersistentStream.prototype.auth=function(){var _this=this;assert(this.state===PersistentStreamState.Initial,"Must be in initial state to auth"),this.state=PersistentStreamState.Starting;var dispatchIfNotClosed=this.getCloseGuardedDispatcher(this.closeCount),closeCount=this.closeCount;this.credentialsProvider.getToken().then(function(token){_this.closeCount===closeCount&&_this.startStream(token)},function(error$$1){dispatchIfNotClosed(function(){var rpcError=new FirestoreError(Code.UNKNOWN,"Fetching auth token failed: "+error$$1.message);return _this.handleStreamClose(rpcError)})})},PersistentStream.prototype.startStream=function(token){var _this=this;assert(this.state===PersistentStreamState.Starting,"Trying to start stream in a non-starting state");var dispatchIfNotClosed=this.getCloseGuardedDispatcher(this.closeCount);this.stream=this.startRpc(token),this.stream.onOpen(function(){dispatchIfNotClosed(function(){return assert(_this.state===PersistentStreamState.Starting,"Expected stream to be in state Starting, but was "+_this.state),_this.state=PersistentStreamState.Open,_this.listener.onOpen()})}),this.stream.onClose(function(error$$1){dispatchIfNotClosed(function(){return _this.handleStreamClose(error$$1)})}),this.stream.onMessage(function(msg){dispatchIfNotClosed(function(){return _this.onMessage(msg)})})},PersistentStream.prototype.performBackoff=function(){var _this=this;assert(this.state===PersistentStreamState.Error,"Should only perform backoff when in Error state"),this.state=PersistentStreamState.Backoff,this.backoff.backoffAndRun(function(){return tslib_1.__awaiter(_this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return assert(this.state===PersistentStreamState.Backoff,"Backoff elapsed but state is now: "+this.state),this.state=PersistentStreamState.Initial,this.start(),assert(this.isStarted(),"PersistentStream should have started"),[2]})})})},PersistentStream.prototype.handleStreamClose=function(error$$1){return assert(this.isStarted(),"Can't handle server close on non-started stream"),debug(LOG_TAG$6,"close with error: "+error$$1),this.stream=null,this.close(PersistentStreamState.Error,error$$1)},PersistentStream.prototype.getCloseGuardedDispatcher=function(startCloseCount){var _this=this;return function(fn){_this.queue.enqueueAndForget(function(){return _this.closeCount===startCloseCount?fn():(debug(LOG_TAG$6,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())})}},PersistentStream}(),PersistentListenStream=function(_super){function PersistentListenStream(queue,connection,credentials,serializer,listener){var _this=_super.call(this,queue,TimerId.ListenStreamConnectionBackoff,TimerId.ListenStreamIdle,connection,credentials,listener)||this;return _this.serializer=serializer,_this}return tslib_1.__extends(PersistentListenStream,_super),PersistentListenStream.prototype.startRpc=function(token){return this.connection.openStream("Listen",token)},PersistentListenStream.prototype.onMessage=function(watchChangeProto){this.backoff.reset();var watchChange=this.serializer.fromWatchChange(watchChangeProto),snapshot=this.serializer.versionFromListenResponse(watchChangeProto);return this.listener.onWatchChange(watchChange,snapshot)},PersistentListenStream.prototype.watch=function(queryData){var request={database:this.serializer.encodedDatabaseId,addTarget:this.serializer.toTarget(queryData)},labels=this.serializer.toListenRequestLabels(queryData);labels&&(request.labels=labels),this.sendRequest(request)},PersistentListenStream.prototype.unwatch=function(targetId){var request={};request.database=this.serializer.encodedDatabaseId,request.removeTarget=targetId,this.sendRequest(request)},PersistentListenStream}(PersistentStream),PersistentWriteStream=function(_super){function PersistentWriteStream(queue,connection,credentials,serializer,listener){var _this=_super.call(this,queue,TimerId.WriteStreamConnectionBackoff,TimerId.WriteStreamIdle,connection,credentials,listener)||this;return _this.serializer=serializer,_this.handshakeComplete_=!1,_this}return tslib_1.__extends(PersistentWriteStream,_super),Object.defineProperty(PersistentWriteStream.prototype,"handshakeComplete",{get:function(){return this.handshakeComplete_},enumerable:!0,configurable:!0}),PersistentWriteStream.prototype.start=function(){this.handshakeComplete_=!1,_super.prototype.start.call(this)},PersistentWriteStream.prototype.tearDown=function(){this.handshakeComplete_&&this.writeMutations([])},PersistentWriteStream.prototype.startRpc=function(token){return this.connection.openStream("Write",token)},PersistentWriteStream.prototype.onMessage=function(responseProto){if(assert(!!responseProto.streamToken,"Got a write response without a stream token"),this.lastStreamToken=responseProto.streamToken,!this.handshakeComplete_)return assert(!responseProto.writeResults||0===responseProto.writeResults.length,"Got mutation results for handshake"),this.handshakeComplete_=!0,this.listener.onHandshakeComplete();this.backoff.reset();var results=this.serializer.fromWriteResults(responseProto.writeResults,responseProto.commitTime),commitVersion=this.serializer.fromVersion(responseProto.commitTime);return this.listener.onMutationResult(commitVersion,results)},PersistentWriteStream.prototype.writeHandshake=function(){assert(this.isOpen(),"Writing handshake requires an opened stream"),assert(!this.handshakeComplete_,"Handshake already completed");var request={};request.database=this.serializer.encodedDatabaseId,this.sendRequest(request)},PersistentWriteStream.prototype.writeMutations=function(mutations){var _this=this;assert(this.isOpen(),"Writing mutations requires an opened stream"),assert(this.handshakeComplete_,"Handshake must be complete before writing mutations"),assert(0<this.lastStreamToken.length,"Trying to write mutation without a token");var request={streamToken:this.lastStreamToken,writes:mutations.map(function(mutation){return _this.serializer.toMutation(mutation)})};this.sendRequest(request)},PersistentWriteStream}(PersistentStream),Datastore=function(){function Datastore(queue,connection,credentials,serializer){this.queue=queue,this.connection=connection,this.credentials=credentials,this.serializer=serializer}return Datastore.prototype.newPersistentWriteStream=function(listener){return new PersistentWriteStream(this.queue,this.connection,this.credentials,this.serializer,listener)},Datastore.prototype.newPersistentWatchStream=function(listener){return new PersistentListenStream(this.queue,this.connection,this.credentials,this.serializer,listener)},Datastore.prototype.commit=function(mutations){var _this=this,params={database:this.serializer.encodedDatabaseId,writes:mutations.map(function(m){return _this.serializer.toMutation(m)})};return this.invokeRPC("Commit",params).then(function(response){return _this.serializer.fromWriteResults(response.writeResults,response.commitTime)})},Datastore.prototype.lookup=function(keys){var _this=this,params={database:this.serializer.encodedDatabaseId,documents:keys.map(function(k){return _this.serializer.toName(k)})};return this.invokeStreamingRPC("BatchGetDocuments",params).then(function(response){var docs=maybeDocumentMap();response.forEach(function(proto){var doc=_this.serializer.fromMaybeDocument(proto);docs=docs.insert(doc.key,doc)});var result=[];return keys.forEach(function(key){var doc=docs.get(key);assert(!!doc,"Missing entity in write response for "+key),result.push(doc)}),result})},Datastore.prototype.invokeRPC=function(rpcName,request){var _this=this;return this.credentials.getToken().then(function(token){return _this.connection.invokeRPC(rpcName,request,token)}).catch(function(error){throw error.code===Code.UNAUTHENTICATED&&_this.credentials.invalidateToken(),error})},Datastore.prototype.invokeStreamingRPC=function(rpcName,request){var _this=this;return this.credentials.getToken().then(function(token){return _this.connection.invokeStreamingRPC(rpcName,request,token)}).catch(function(error){throw error.code===Code.UNAUTHENTICATED&&_this.credentials.invalidateToken(),error})},Datastore}(),Transaction=function(){function Transaction(datastore){this.datastore=datastore,this.readVersions=documentVersionMap(),this.mutations=[],this.committed=!1}return Transaction.prototype.recordVersion=function(doc){var docVersion;if(doc instanceof Document)docVersion=doc.version;else if(doc instanceof NoDocument)docVersion=SnapshotVersion.forDeletedDoc();else throw fail("Document in a transaction was a "+doc.constructor.name);var existingVersion=this.readVersions.get(doc.key);if(null===existingVersion)this.readVersions=this.readVersions.insert(doc.key,docVersion);else if(!docVersion.isEqual(existingVersion))throw new FirestoreError(Code.ABORTED,"Document version changed between two reads.")},Transaction.prototype.lookup=function(keys){var _this=this;return this.committed?Promise.reject("Transaction has already completed."):0<this.mutations.length?Promise.reject("Transactions lookups are invalid after writes."):this.datastore.lookup(keys).then(function(docs){return docs.forEach(function(doc){doc instanceof NoDocument||doc instanceof Document?_this.recordVersion(doc):fail("Document in a transaction was a "+doc.constructor.name)}),docs})},Transaction.prototype.write=function(mutations){if(this.committed)throw new FirestoreError(Code.FAILED_PRECONDITION,"Transaction has already completed.");this.mutations=this.mutations.concat(mutations)},Transaction.prototype.precondition=function(key){var version=this.readVersions.get(key);return version?Precondition.updateTime(version):Precondition.NONE},Transaction.prototype.preconditionForUpdate=function(key){var version=this.readVersions.get(key);if(version&&version.isEqual(SnapshotVersion.forDeletedDoc()))throw new FirestoreError(Code.FAILED_PRECONDITION,"Can't update a document that doesn't exist.");else return version?Precondition.updateTime(version):Precondition.exists(!0)},Transaction.prototype.set=function(key,data){this.write(data.toMutations(key,this.precondition(key)))},Transaction.prototype.update=function(key,data){this.write(data.toMutations(key,this.preconditionForUpdate(key)))},Transaction.prototype.delete=function(key){this.write([new DeleteMutation(key,this.precondition(key))]),this.readVersions=this.readVersions.insert(key,SnapshotVersion.forDeletedDoc())},Transaction.prototype.commit=function(){var _this=this,unwritten=this.readVersions;return this.mutations.forEach(function(mutation){unwritten=unwritten.remove(mutation.key)}),unwritten.isEmpty()?this.datastore.commit(this.mutations).then(function(){_this.committed=!0}):Promise.reject(Error("Every document read in a transaction must also be written."))},Transaction}(),OnlineState;(function(OnlineState){OnlineState[OnlineState.Unknown=0]="Unknown",OnlineState[OnlineState.Online=1]="Online",OnlineState[OnlineState.Offline=2]="Offline"})(OnlineState||(OnlineState={}));var OnlineStateSource;(function(OnlineStateSource){OnlineStateSource[OnlineStateSource.RemoteStore=0]="RemoteStore",OnlineStateSource[OnlineStateSource.SharedClientState=1]="SharedClientState"})(OnlineStateSource||(OnlineStateSource={}));var MAX_WATCH_STREAM_FAILURES=1,ONLINE_STATE_TIMEOUT_MS=10000,OnlineStateTracker=function(){function OnlineStateTracker(asyncQueue,onlineStateHandler){this.asyncQueue=asyncQueue,this.onlineStateHandler=onlineStateHandler,this.state=OnlineState.Unknown,this.watchStreamFailures=0,this.onlineStateTimer=null,this.shouldWarnClientIsOffline=!0}return OnlineStateTracker.prototype.handleWatchStreamStart=function(){var _this=this;0===this.watchStreamFailures&&(this.setAndBroadcast(OnlineState.Unknown),assert(null===this.onlineStateTimer,"onlineStateTimer shouldn't be started yet"),this.onlineStateTimer=this.asyncQueue.enqueueAfterDelay(TimerId.OnlineStateTimeout,ONLINE_STATE_TIMEOUT_MS,function(){return _this.onlineStateTimer=null,assert(_this.state===OnlineState.Unknown,"Timer should be canceled if we transitioned to a different state."),_this.logClientOfflineWarningIfNecessary("Backend didn't respond within "+ONLINE_STATE_TIMEOUT_MS/1e3+" seconds."),_this.setAndBroadcast(OnlineState.Offline),Promise.resolve()}))},OnlineStateTracker.prototype.handleWatchStreamFailure=function(error$$1){this.state===OnlineState.Online?(this.setAndBroadcast(OnlineState.Unknown),assert(0===this.watchStreamFailures,"watchStreamFailures must be 0"),assert(null===this.onlineStateTimer,"onlineStateTimer must be null")):(this.watchStreamFailures++,this.watchStreamFailures>=MAX_WATCH_STREAM_FAILURES&&(this.clearOnlineStateTimer(),this.logClientOfflineWarningIfNecessary("Connection failed "+MAX_WATCH_STREAM_FAILURES+" "+("times. Most recent error: "+error$$1.toString())),this.setAndBroadcast(OnlineState.Offline)))},OnlineStateTracker.prototype.set=function(newState){this.clearOnlineStateTimer(),this.watchStreamFailures=0,newState===OnlineState.Online&&(this.shouldWarnClientIsOffline=!1),this.setAndBroadcast(newState)},OnlineStateTracker.prototype.setAndBroadcast=function(newState){newState!==this.state&&(this.state=newState,this.onlineStateHandler(newState))},OnlineStateTracker.prototype.logClientOfflineWarningIfNecessary=function(details){var message="Could not reach Cloud Firestore backend. "+details+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.shouldWarnClientIsOffline?(error(message),this.shouldWarnClientIsOffline=!1):debug("OnlineStateTracker",message)},OnlineStateTracker.prototype.clearOnlineStateTimer=function(){null!==this.onlineStateTimer&&(this.onlineStateTimer.cancel(),this.onlineStateTimer=null)},OnlineStateTracker}(),LOG_TAG$8="RemoteStore",RemoteStore=function(){function RemoteStore(localStore,datastore,asyncQueue,onlineStateHandler){this.localStore=localStore,this.datastore=datastore,this.writePipeline=[],this.listenTargets={},this.watchChangeAggregator=null,this.networkEnabled=!1,this.isPrimary=!1,this.onlineStateTracker=new OnlineStateTracker(asyncQueue,onlineStateHandler),this.watchStream=this.datastore.newPersistentWatchStream({onOpen:this.onWatchStreamOpen.bind(this),onClose:this.onWatchStreamClose.bind(this),onWatchChange:this.onWatchStreamChange.bind(this)}),this.writeStream=this.datastore.newPersistentWriteStream({onOpen:this.onWriteStreamOpen.bind(this),onClose:this.onWriteStreamClose.bind(this),onHandshakeComplete:this.onWriteHandshakeComplete.bind(this),onMutationResult:this.onMutationResult.bind(this)})}return RemoteStore.prototype.start=function(){return this.enableNetwork()},RemoteStore.prototype.enableNetwork=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){var _a;return tslib_1.__generator(this,function(_b){switch(_b.label){case 0:return(this.networkEnabled=!0,!this.canUseNetwork())?[3,3]:(_a=this.writeStream,[4,this.localStore.getLastStreamToken()]);case 1:return _a.lastStreamToken=_b.sent(),this.shouldStartWatchStream()?this.startWatchStream():this.onlineStateTracker.set(OnlineState.Unknown),[4,this.fillWritePipeline()];case 2:_b.sent(),_b.label=3;case 3:return[2];}})})},RemoteStore.prototype.disableNetwork=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return this.networkEnabled=!1,[4,this.disableNetworkInternal()];case 1:return _a.sent(),this.onlineStateTracker.set(OnlineState.Offline),[2];}})})},RemoteStore.prototype.disableNetworkInternal=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return[4,this.writeStream.stop()];case 1:return _a.sent(),[4,this.watchStream.stop()];case 2:return _a.sent(),0<this.writePipeline.length&&(debug(LOG_TAG$8,"Stopping write stream with "+this.writePipeline.length+" pending writes"),this.writePipeline=[]),this.cleanUpWatchStreamState(),[2];}})})},RemoteStore.prototype.shutdown=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return debug(LOG_TAG$8,"RemoteStore shutting down."),this.networkEnabled=!1,[4,this.disableNetworkInternal()];case 1:return _a.sent(),this.onlineStateTracker.set(OnlineState.Unknown),[2];}})})},RemoteStore.prototype.listen=function(queryData){assert(!contains(this.listenTargets,queryData.targetId),"listen called with duplicate targetId!"),this.listenTargets[queryData.targetId]=queryData,this.shouldStartWatchStream()?this.startWatchStream():this.watchStream.isOpen()&&this.sendWatchRequest(queryData)},RemoteStore.prototype.unlisten=function(targetId){assert(contains(this.listenTargets,targetId),"unlisten called without assigned target ID!"),delete this.listenTargets[targetId],this.watchStream.isOpen()&&this.sendUnwatchRequest(targetId),isEmpty(this.listenTargets)&&(this.watchStream.isOpen()?this.watchStream.markIdle():this.canUseNetwork()&&this.onlineStateTracker.set(OnlineState.Unknown))},RemoteStore.prototype.getQueryDataForTarget=function(targetId){return this.listenTargets[targetId]||null},RemoteStore.prototype.getRemoteKeysForTarget=function(targetId){return this.syncEngine.getRemoteKeysForTarget(targetId)},RemoteStore.prototype.sendWatchRequest=function(queryData){this.watchChangeAggregator.recordPendingTargetRequest(queryData.targetId),this.watchStream.watch(queryData)},RemoteStore.prototype.sendUnwatchRequest=function(targetId){this.watchChangeAggregator.recordPendingTargetRequest(targetId),this.watchStream.unwatch(targetId)},RemoteStore.prototype.startWatchStream=function(){assert(this.shouldStartWatchStream(),"startWatchStream() called when shouldStartWatchStream() is false."),this.watchChangeAggregator=new WatchChangeAggregator(this),this.watchStream.start(),this.onlineStateTracker.handleWatchStreamStart()},RemoteStore.prototype.shouldStartWatchStream=function(){return this.canUseNetwork()&&!this.watchStream.isStarted()&&!isEmpty(this.listenTargets)},RemoteStore.prototype.canUseNetwork=function(){return this.isPrimary&&this.networkEnabled},RemoteStore.prototype.cleanUpWatchStreamState=function(){this.watchChangeAggregator=null},RemoteStore.prototype.onWatchStreamOpen=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this;return tslib_1.__generator(this,function(){return forEachNumber(this.listenTargets,function(targetId,queryData){_this.sendWatchRequest(queryData)}),[2]})})},RemoteStore.prototype.onWatchStreamClose=function(error$$1){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return void 0===error$$1&&assert(!this.shouldStartWatchStream(),"Watch stream was stopped gracefully while still needed."),this.cleanUpWatchStreamState(),this.shouldStartWatchStream()?(this.onlineStateTracker.handleWatchStreamFailure(error$$1),this.startWatchStream()):this.onlineStateTracker.set(OnlineState.Unknown),[2]})})},RemoteStore.prototype.onWatchStreamChange=function(watchChange,snapshotVersion){return tslib_1.__awaiter(this,void 0,void 0,function(){var lastRemoteSnapshotVersion;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return(this.onlineStateTracker.set(OnlineState.Online),watchChange instanceof WatchTargetChange&&watchChange.state===WatchTargetChangeState.Removed&&watchChange.cause)?[2,this.handleTargetError(watchChange)]:(watchChange instanceof DocumentWatchChange?this.watchChangeAggregator.handleDocumentChange(watchChange):watchChange instanceof ExistenceFilterChange?this.watchChangeAggregator.handleExistenceFilter(watchChange):(assert(watchChange instanceof WatchTargetChange,"Expected watchChange to be an instance of WatchTargetChange"),this.watchChangeAggregator.handleTargetChange(watchChange)),snapshotVersion.isEqual(SnapshotVersion.MIN)?[3,3]:[4,this.localStore.getLastRemoteSnapshotVersion()]);case 1:return lastRemoteSnapshotVersion=_a.sent(),0<=snapshotVersion.compareTo(lastRemoteSnapshotVersion)?[4,this.raiseWatchSnapshot(snapshotVersion)]:[3,3];case 2:_a.sent(),_a.label=3;case 3:return[2];}})})},RemoteStore.prototype.raiseWatchSnapshot=function(snapshotVersion){var _this=this;assert(!snapshotVersion.isEqual(SnapshotVersion.MIN),"Can't raise event for unknown SnapshotVersion");var remoteEvent=this.watchChangeAggregator.createRemoteEvent(snapshotVersion);return forEachNumber(remoteEvent.targetChanges,function(targetId,change){if(0<change.resumeToken.length){var queryData=_this.listenTargets[targetId];queryData&&(_this.listenTargets[targetId]=queryData.copy({resumeToken:change.resumeToken,snapshotVersion:snapshotVersion}))}}),remoteEvent.targetMismatches.forEach(function(targetId){var queryData=_this.listenTargets[targetId];if(queryData){_this.listenTargets[targetId]=queryData.copy({resumeToken:emptyByteString()}),_this.sendUnwatchRequest(targetId);var requestQueryData=new QueryData(queryData.query,targetId,QueryPurpose.ExistenceFilterMismatch,queryData.sequenceNumber);_this.sendWatchRequest(requestQueryData)}}),this.syncEngine.applyRemoteEvent(remoteEvent)},RemoteStore.prototype.handleTargetError=function(watchChange){var _this=this;assert(!!watchChange.cause,"Handling target error without a cause");var error$$1=watchChange.cause,promiseChain=Promise.resolve();return watchChange.targetIds.forEach(function(targetId){promiseChain=promiseChain.then(function(){return tslib_1.__awaiter(_this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return contains(this.listenTargets,targetId)?(delete this.listenTargets[targetId],this.watchChangeAggregator.removeTarget(targetId),[2,this.syncEngine.rejectListen(targetId,error$$1)]):[2]})})})}),promiseChain},RemoteStore.prototype.fillWritePipeline=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){var lastBatchIdRetrieved,batch;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return this.canAddToWritePipeline()?(lastBatchIdRetrieved=0<this.writePipeline.length?this.writePipeline[this.writePipeline.length-1].batchId:BATCHID_UNKNOWN,[4,this.localStore.nextMutationBatch(lastBatchIdRetrieved)]):[3,4];case 1:return(batch=_a.sent(),null!==batch)?[3,2]:(0===this.writePipeline.length&&this.writeStream.markIdle(),[3,4]);case 2:return this.addToWritePipeline(batch),[4,this.fillWritePipeline()];case 3:_a.sent(),_a.label=4;case 4:return this.shouldStartWriteStream()&&this.startWriteStream(),[2];}})})},RemoteStore.prototype.canAddToWritePipeline=function(){return this.canUseNetwork()&&this.writePipeline.length<10},RemoteStore.prototype.outstandingWrites=function(){return this.writePipeline.length},RemoteStore.prototype.addToWritePipeline=function(batch){assert(this.canAddToWritePipeline(),"addToWritePipeline called when pipeline is full"),this.writePipeline.push(batch),this.writeStream.isOpen()&&this.writeStream.handshakeComplete&&this.writeStream.writeMutations(batch.mutations)},RemoteStore.prototype.shouldStartWriteStream=function(){return this.canUseNetwork()&&!this.writeStream.isStarted()&&0<this.writePipeline.length},RemoteStore.prototype.startWriteStream=function(){assert(this.shouldStartWriteStream(),"startWriteStream() called when shouldStartWriteStream() is false."),this.writeStream.start()},RemoteStore.prototype.onWriteStreamOpen=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return this.writeStream.writeHandshake(),[2]})})},RemoteStore.prototype.onWriteHandshakeComplete=function(){var _this=this;return this.localStore.setLastStreamToken(this.writeStream.lastStreamToken).then(function(){for(var _i=0,_a=_this.writePipeline,batch;_i<_a.length;_i++)batch=_a[_i],_this.writeStream.writeMutations(batch.mutations)}).catch(function(err){return _this.ignoreIfPrimaryLeaseLoss(err)})},RemoteStore.prototype.ignoreIfPrimaryLeaseLoss=function(err){if(isPrimaryLeaseLostError(err))debug(LOG_TAG$8,"Unexpectedly lost primary lease");else throw err},RemoteStore.prototype.onMutationResult=function(commitVersion,results){var _this=this;assert(0<this.writePipeline.length,"Got result for empty write pipeline");var batch=this.writePipeline.shift(),success=MutationBatchResult.from(batch,commitVersion,results,this.writeStream.lastStreamToken);return this.syncEngine.applySuccessfulWrite(success).then(function(){return _this.fillWritePipeline()})},RemoteStore.prototype.onWriteStreamClose=function(error$$1){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this,errorHandling;return tslib_1.__generator(this,function(){return void 0===error$$1&&assert(!this.shouldStartWriteStream(),"Write stream was stopped gracefully while still needed."),error$$1&&0<this.writePipeline.length?(errorHandling=void 0,errorHandling=this.writeStream.handshakeComplete?this.handleWriteError(error$$1):this.handleHandshakeError(error$$1),[2,errorHandling.then(function(){_this.shouldStartWriteStream()&&_this.startWriteStream()})]):[2]})})},RemoteStore.prototype.handleHandshakeError=function(error$$1){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this;return tslib_1.__generator(this,function(){return isPermanentError(error$$1.code)||error$$1.code===Code.ABORTED?(debug(LOG_TAG$8,"RemoteStore error before completed handshake; resetting stream token: ",this.writeStream.lastStreamToken),this.writeStream.lastStreamToken=emptyByteString(),[2,this.localStore.setLastStreamToken(emptyByteString()).catch(function(err){return _this.ignoreIfPrimaryLeaseLoss(err)})]):[2]})})},RemoteStore.prototype.handleWriteError=function(error$$1){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this,batch;return tslib_1.__generator(this,function(){return isPermanentError(error$$1.code)?(batch=this.writePipeline.shift(),this.writeStream.inhibitBackoff(),[2,this.syncEngine.rejectFailedWrite(batch.batchId,error$$1).then(function(){return _this.fillWritePipeline()})]):[2]})})},RemoteStore.prototype.createTransaction=function(){return new Transaction(this.datastore)},RemoteStore.prototype.handleCredentialChange=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return this.canUseNetwork()?(debug(LOG_TAG$8,"RemoteStore restarting streams for new credential"),this.networkEnabled=!1,[4,this.disableNetworkInternal()]):[3,3];case 1:return _a.sent(),this.onlineStateTracker.set(OnlineState.Unknown),[4,this.enableNetwork()];case 2:_a.sent(),_a.label=3;case 3:return[2];}})})},RemoteStore.prototype.applyPrimaryState=function(isPrimary){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return this.isPrimary=isPrimary,isPrimary&&this.networkEnabled?[4,this.enableNetwork()]:[3,2];case 1:return _a.sent(),[3,4];case 2:return isPrimary?[3,4]:[4,this.disableNetworkInternal()];case 3:_a.sent(),this.onlineStateTracker.set(OnlineState.Unknown),_a.label=4;case 4:return[2];}})})},RemoteStore}(),QueryListenersInfo=function(){return function(){this.listeners=[]}}(),EventManager=function(){function EventManager(syncEngine){this.syncEngine=syncEngine,this.queries=new ObjectMap(function(q){return q.canonicalId()}),this.onlineState=OnlineState.Unknown,this.syncEngine.subscribe(this)}return EventManager.prototype.listen=function(listener){var query=listener.query,firstListen=!1,queryInfo=this.queries.get(query);return queryInfo||(firstListen=!0,queryInfo=new QueryListenersInfo,this.queries.set(query,queryInfo)),queryInfo.listeners.push(listener),listener.applyOnlineStateChange(this.onlineState),queryInfo.viewSnap&&listener.onViewSnapshot(queryInfo.viewSnap),firstListen?this.syncEngine.listen(query).then(function(targetId){return queryInfo.targetId=targetId,targetId}):Promise.resolve(queryInfo.targetId)},EventManager.prototype.unlisten=function(listener){return tslib_1.__awaiter(this,void 0,void 0,function(){var query,lastListen,queryInfo,i;return tslib_1.__generator(this,function(){return query=listener.query,lastListen=!1,queryInfo=this.queries.get(query),queryInfo&&(i=queryInfo.listeners.indexOf(listener),0<=i&&(queryInfo.listeners.splice(i,1),lastListen=0===queryInfo.listeners.length)),lastListen?(this.queries.delete(query),[2,this.syncEngine.unlisten(query)]):[2]})})},EventManager.prototype.onWatchChange=function(viewSnaps){for(var _i=0,viewSnaps_1=viewSnaps;_i<viewSnaps_1.length;_i++){var viewSnap=viewSnaps_1[_i],query=viewSnap.query,queryInfo=this.queries.get(query);if(queryInfo){for(var _a=0,_b=queryInfo.listeners,listener;_a<_b.length;_a++)listener=_b[_a],listener.onViewSnapshot(viewSnap);queryInfo.viewSnap=viewSnap}}},EventManager.prototype.onWatchError=function(query,error){var queryInfo=this.queries.get(query);if(queryInfo)for(var _i=0,_a=queryInfo.listeners,listener;_i<_a.length;_i++)listener=_a[_i],listener.onError(error);this.queries.delete(query)},EventManager.prototype.onOnlineStateChange=function(onlineState){this.onlineState=onlineState,this.queries.forEach(function(_,queryInfo){for(var _i=0,_a=queryInfo.listeners,listener;_i<_a.length;_i++)listener=_a[_i],listener.applyOnlineStateChange(onlineState)})},EventManager}(),QueryListener=function(){function QueryListener(query,queryObserver,options){this.query=query,this.queryObserver=queryObserver,this.raisedInitialEvent=!1,this.onlineState=OnlineState.Unknown,this.options=options||{}}return QueryListener.prototype.onViewSnapshot=function(snap){if(assert(0<snap.docChanges.length||snap.syncStateChanged,"We got a new snapshot with no changes?"),!this.options.includeMetadataChanges){for(var docChanges=[],_i=0,_a=snap.docChanges,docChange;_i<_a.length;_i++)docChange=_a[_i],docChange.type!==ChangeType.Metadata&&docChanges.push(docChange);snap=new ViewSnapshot(snap.query,snap.docs,snap.oldDocs,docChanges,snap.mutatedKeys,snap.fromCache,snap.syncStateChanged,!0)}this.raisedInitialEvent?this.shouldRaiseEvent(snap)&&this.queryObserver.next(snap):this.shouldRaiseInitialEvent(snap,this.onlineState)&&this.raiseInitialEvent(snap),this.snap=snap},QueryListener.prototype.onError=function(error){this.queryObserver.error(error)},QueryListener.prototype.applyOnlineStateChange=function(onlineState){this.onlineState=onlineState,this.snap&&!this.raisedInitialEvent&&this.shouldRaiseInitialEvent(this.snap,onlineState)&&this.raiseInitialEvent(this.snap)},QueryListener.prototype.shouldRaiseInitialEvent=function(snap,onlineState){if(assert(!this.raisedInitialEvent,"Determining whether to raise first event but already had first event"),!snap.fromCache)return!0;var maybeOnline=onlineState!==OnlineState.Offline;return this.options.waitForSyncWhenOnline&&maybeOnline?(assert(snap.fromCache,"Waiting for sync, but snapshot is not from cache"),!1):!snap.docs.isEmpty()||onlineState===OnlineState.Offline},QueryListener.prototype.shouldRaiseEvent=function(snap){if(0<snap.docChanges.length)return!0;var hasPendingWritesChanged=this.snap&&this.snap.hasPendingWrites!==snap.hasPendingWrites;return(snap.syncStateChanged||hasPendingWritesChanged)&&!0===this.options.includeMetadataChanges},QueryListener.prototype.raiseInitialEvent=function(snap){assert(!this.raisedInitialEvent,"Trying to raise initial events for second time"),snap=ViewSnapshot.fromInitialDocuments(snap.query,snap.docs,snap.mutatedKeys,snap.fromCache),this.raisedInitialEvent=!0,this.queryObserver.next(snap)},QueryListener}(),LocalViewChanges=function(){function LocalViewChanges(targetId,addedKeys,removedKeys){this.targetId=targetId,this.addedKeys=addedKeys,this.removedKeys=removedKeys}return LocalViewChanges.fromSnapshot=function(targetId,viewSnapshot){for(var addedKeys=documentKeySet(),removedKeys=documentKeySet(),_i=0,_a=viewSnapshot.docChanges,docChange;_i<_a.length;_i++)switch(docChange=_a[_i],docChange.type){case ChangeType.Added:addedKeys=addedKeys.add(docChange.doc.key);break;case ChangeType.Removed:removedKeys=removedKeys.add(docChange.doc.key);break;default:}return new LocalViewChanges(targetId,addedKeys,removedKeys)},LocalViewChanges}(),AddedLimboDocument=function(){return function(key){this.key=key}}(),RemovedLimboDocument=function(){return function(key){this.key=key}}(),View=function(){function View(query,_syncedDocuments){this.query=query,this._syncedDocuments=_syncedDocuments,this.syncState=null,this.current=!1,this.limboDocuments=documentKeySet(),this.mutatedKeys=documentKeySet(),this.documentSet=new DocumentSet(query.docComparator.bind(query))}return Object.defineProperty(View.prototype,"syncedDocuments",{get:function(){return this._syncedDocuments},enumerable:!0,configurable:!0}),View.prototype.computeDocChanges=function(docChanges,previousChanges){var _this=this,changeSet=previousChanges?previousChanges.changeSet:new DocumentChangeSet,oldDocumentSet=previousChanges?previousChanges.documentSet:this.documentSet,newMutatedKeys=previousChanges?previousChanges.mutatedKeys:this.mutatedKeys,newDocumentSet=oldDocumentSet,needsRefill=!1,lastDocInLimit=this.query.hasLimit()&&oldDocumentSet.size===this.query.limit?oldDocumentSet.last():null;if(docChanges.inorderTraversal(function(key,newMaybeDoc){var oldDoc=oldDocumentSet.get(key),newDoc=newMaybeDoc instanceof Document?newMaybeDoc:null;newDoc&&(assert(key.isEqual(newDoc.key),"Mismatching keys found in document changes: "+key+" != "+newDoc.key),newDoc=_this.query.matches(newDoc)?newDoc:null);var oldDocHadPendingMutations=!!oldDoc&&_this.mutatedKeys.has(oldDoc.key),newDocHasPendingMutations=!!newDoc&&(newDoc.hasLocalMutations||_this.mutatedKeys.has(newDoc.key)&&newDoc.hasCommittedMutations),changeApplied=!1;if(oldDoc&&newDoc){var docsEqual=oldDoc.data.isEqual(newDoc.data);docsEqual?oldDocHadPendingMutations!==newDocHasPendingMutations&&(changeSet.track({type:ChangeType.Metadata,doc:newDoc}),changeApplied=!0):!_this.shouldWaitForSyncedDocument(oldDoc,newDoc)&&(changeSet.track({type:ChangeType.Modified,doc:newDoc}),changeApplied=!0,lastDocInLimit&&0<_this.query.docComparator(newDoc,lastDocInLimit)&&(needsRefill=!0))}else!oldDoc&&newDoc?(changeSet.track({type:ChangeType.Added,doc:newDoc}),changeApplied=!0):oldDoc&&!newDoc&&(changeSet.track({type:ChangeType.Removed,doc:oldDoc}),changeApplied=!0,lastDocInLimit&&(needsRefill=!0));changeApplied&&(newDoc?(newDocumentSet=newDocumentSet.add(newDoc),newMutatedKeys=newDocHasPendingMutations?newMutatedKeys.add(key):newMutatedKeys.delete(key)):(newDocumentSet=newDocumentSet.delete(key),newMutatedKeys=newMutatedKeys.delete(key)))}),this.query.hasLimit())for(;newDocumentSet.size>this.query.limit;){var oldDoc=newDocumentSet.last();newDocumentSet=newDocumentSet.delete(oldDoc.key),newMutatedKeys=newMutatedKeys.delete(oldDoc.key),changeSet.track({type:ChangeType.Removed,doc:oldDoc})}return assert(!needsRefill||!previousChanges,"View was refilled using docs that themselves needed refilling."),{documentSet:newDocumentSet,changeSet:changeSet,needsRefill:needsRefill,mutatedKeys:newMutatedKeys}},View.prototype.shouldWaitForSyncedDocument=function(oldDoc,newDoc){return oldDoc.hasLocalMutations&&newDoc.hasCommittedMutations&&!newDoc.hasLocalMutations},View.prototype.applyChanges=function(docChanges,updateLimboDocuments,targetChange){var _this=this;assert(!docChanges.needsRefill,"Cannot apply changes that need a refill");var oldDocs=this.documentSet;this.documentSet=docChanges.documentSet,this.mutatedKeys=docChanges.mutatedKeys;var changes=docChanges.changeSet.getChanges();changes.sort(function(c1,c2){return compareChangeType(c1.type,c2.type)||_this.query.docComparator(c1.doc,c2.doc)}),this.applyTargetChange(targetChange);var limboChanges=updateLimboDocuments?this.updateLimboDocuments():[],synced=0===this.limboDocuments.size&&this.current,newSyncState=synced?SyncState.Synced:SyncState.Local,syncStateChanged=newSyncState!==this.syncState;if(this.syncState=newSyncState,0===changes.length&&!syncStateChanged)return{limboChanges:limboChanges};var snap=new ViewSnapshot(this.query,docChanges.documentSet,oldDocs,changes,docChanges.mutatedKeys,newSyncState===SyncState.Local,syncStateChanged,!1);return{snapshot:snap,limboChanges:limboChanges}},View.prototype.applyOnlineStateChange=function(onlineState){return this.current&&onlineState===OnlineState.Offline?(this.current=!1,this.applyChanges({documentSet:this.documentSet,changeSet:new DocumentChangeSet,mutatedKeys:this.mutatedKeys,needsRefill:!1},!1)):{limboChanges:[]}},View.prototype.shouldBeInLimbo=function(key){return!this._syncedDocuments.has(key)&&!!this.documentSet.has(key)&&!this.documentSet.get(key).hasLocalMutations},View.prototype.applyTargetChange=function(targetChange){var _this=this;targetChange&&(targetChange.addedDocuments.forEach(function(key){return _this._syncedDocuments=_this._syncedDocuments.add(key)}),targetChange.modifiedDocuments.forEach(function(key){return assert(_this._syncedDocuments.has(key),"Modified document "+key+" not found in view.")}),targetChange.removedDocuments.forEach(function(key){return _this._syncedDocuments=_this._syncedDocuments.delete(key)}),this.current=targetChange.current)},View.prototype.updateLimboDocuments=function(){var _this=this;if(!this.current)return[];var oldLimboDocuments=this.limboDocuments;this.limboDocuments=documentKeySet(),this.documentSet.forEach(function(doc){_this.shouldBeInLimbo(doc.key)&&(_this.limboDocuments=_this.limboDocuments.add(doc.key))});var changes=[];return oldLimboDocuments.forEach(function(key){_this.limboDocuments.has(key)||changes.push(new RemovedLimboDocument(key))}),this.limboDocuments.forEach(function(key){oldLimboDocuments.has(key)||changes.push(new AddedLimboDocument(key))}),changes},View.prototype.synchronizeWithPersistedState=function(localDocs,remoteKeys){this._syncedDocuments=remoteKeys,this.limboDocuments=documentKeySet();var docChanges=this.computeDocChanges(localDocs);return this.applyChanges(docChanges,!0)},View.prototype.computeInitialSnapshot=function(){return ViewSnapshot.fromInitialDocuments(this.query,this.documentSet,this.mutatedKeys,this.syncState===SyncState.Local)},View}(),LOG_TAG$9="SyncEngine",QueryView=function(){return function(query,targetId,view){this.query=query,this.targetId=targetId,this.view=view}}(),LimboResolution=function(){return function(key){this.key=key}}(),SyncEngine=function(){function SyncEngine(localStore,remoteStore,sharedClientState,currentUser){this.localStore=localStore,this.remoteStore=remoteStore,this.sharedClientState=sharedClientState,this.currentUser=currentUser,this.syncEngineListener=null,this.queryViewsByQuery=new ObjectMap(function(q){return q.canonicalId()}),this.queryViewsByTarget={},this.limboTargetsByKey=new SortedMap(DocumentKey.comparator),this.limboResolutionsByTarget={},this.limboDocumentRefs=new ReferenceSet,this.mutationUserCallbacks={},this.limboTargetIdGenerator=TargetIdGenerator.forSyncEngine(),this.isPrimary=void 0,this.onlineState=OnlineState.Unknown}return Object.defineProperty(SyncEngine.prototype,"isPrimaryClient",{get:function(){return!0===this.isPrimary},enumerable:!0,configurable:!0}),SyncEngine.prototype.subscribe=function(syncEngineListener){assert(null!==syncEngineListener,"SyncEngine listener cannot be null"),assert(null===this.syncEngineListener,"SyncEngine already has a subscriber."),this.syncEngineListener=syncEngineListener},SyncEngine.prototype.listen=function(query){return tslib_1.__awaiter(this,void 0,void 0,function(){var targetId,viewSnapshot,queryView,queryData,status_1;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return(this.assertSubscribed("listen()"),queryView=this.queryViewsByQuery.get(query),!queryView)?[3,1]:(targetId=queryView.targetId,this.sharedClientState.addLocalQueryTarget(targetId),viewSnapshot=queryView.view.computeInitialSnapshot(),[3,4]);case 1:return[4,this.localStore.allocateQuery(query)];case 2:return queryData=_a.sent(),status_1=this.sharedClientState.addLocalQueryTarget(queryData.targetId),targetId=queryData.targetId,[4,this.initializeViewAndComputeSnapshot(queryData,"current"===status_1)];case 3:viewSnapshot=_a.sent(),this.isPrimary&&this.remoteStore.listen(queryData),_a.label=4;case 4:return this.syncEngineListener.onWatchChange([viewSnapshot]),[2,targetId];}})})},SyncEngine.prototype.initializeViewAndComputeSnapshot=function(queryData,current){var _this=this,query=queryData.query;return this.localStore.executeQuery(query).then(function(docs){return _this.localStore.remoteDocumentKeys(queryData.targetId).then(function(remoteKeys){var view=new View(query,remoteKeys),viewDocChanges=view.computeDocChanges(docs),synthesizedTargetChange=TargetChange.createSynthesizedTargetChangeForCurrentChange(queryData.targetId,current&&_this.onlineState!==OnlineState.Offline),viewChange=view.applyChanges(viewDocChanges,!0===_this.isPrimary,synthesizedTargetChange);assert(0===viewChange.limboChanges.length,"View returned limbo docs before target ack from the server."),assert(!!viewChange.snapshot,"applyChanges for new view should always return a snapshot");var data=new QueryView(query,queryData.targetId,view);return _this.queryViewsByQuery.set(query,data),_this.queryViewsByTarget[queryData.targetId]=data,viewChange.snapshot})})},SyncEngine.prototype.synchronizeViewAndComputeSnapshot=function(queryView){var _this=this;return this.localStore.executeQuery(queryView.query).then(function(docs){return _this.localStore.remoteDocumentKeys(queryView.targetId).then(function(remoteKeys){return tslib_1.__awaiter(_this,void 0,void 0,function(){var viewSnapshot;return tslib_1.__generator(this,function(){return viewSnapshot=queryView.view.synchronizeWithPersistedState(docs,remoteKeys),this.isPrimary&&this.updateTrackedLimbos(queryView.targetId,viewSnapshot.limboChanges),[2,viewSnapshot]})})})})},SyncEngine.prototype.unlisten=function(query){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this,queryView,targetRemainsActive;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return(this.assertSubscribed("unlisten()"),queryView=this.queryViewsByQuery.get(query),assert(!!queryView,"Trying to unlisten on query not found:"+query),!this.isPrimary)?[3,3]:(this.sharedClientState.removeLocalQueryTarget(queryView.targetId),targetRemainsActive=this.sharedClientState.isActiveQueryTarget(queryView.targetId),targetRemainsActive?[3,2]:[4,this.localStore.releaseQuery(query,!1).then(function(){_this.sharedClientState.clearQueryState(queryView.targetId),_this.remoteStore.unlisten(queryView.targetId),_this.removeAndCleanupQuery(queryView)}).catch(function(err){return _this.ignoreIfPrimaryLeaseLoss(err)})]);case 1:_a.sent(),_a.label=2;case 2:return[3,5];case 3:return this.removeAndCleanupQuery(queryView),[4,this.localStore.releaseQuery(query,!0)];case 4:_a.sent(),_a.label=5;case 5:return[2];}})})},SyncEngine.prototype.write=function(batch,userCallback){var _this=this;return this.assertSubscribed("write()"),this.localStore.localWrite(batch).then(function(result){return _this.sharedClientState.addPendingMutation(result.batchId),_this.addMutationCallback(result.batchId,userCallback),_this.emitNewSnapsAndNotifyLocalStore(result.changes)}).then(function(){return _this.remoteStore.fillWritePipeline()})},SyncEngine.prototype.wrapUpdateFunctionError=function(error$$1){return error$$1},SyncEngine.prototype.runTransaction=function(updateFunction,retries){var _this=this;void 0===retries&&(retries=5),assert(0<=retries,"Got negative number of retries for transaction.");var transaction=this.remoteStore.createTransaction();return function(){try{var userPromise=updateFunction(transaction);return!isNullOrUndefined(userPromise)&&userPromise.catch&&userPromise.then?userPromise.catch(function(e){return Promise.reject(_this.wrapUpdateFunctionError(e))}):Promise.reject(Error("Transaction callback must return a Promise"))}catch(e){return Promise.reject(_this.wrapUpdateFunctionError(e))}}().then(function(result){return transaction.commit().then(function(){return result}).catch(function(error$$1){return 0===retries?Promise.reject(error$$1):_this.runTransaction(updateFunction,retries-1)})})},SyncEngine.prototype.applyRemoteEvent=function(remoteEvent){var _this=this;return this.assertSubscribed("applyRemoteEvent()"),this.localStore.applyRemoteEvent(remoteEvent).then(function(changes){return forEach(remoteEvent.targetChanges,function(targetId,targetChange){var limboResolution=_this.limboResolutionsByTarget[targetId];limboResolution&&(assert(1>=targetChange.addedDocuments.size+targetChange.modifiedDocuments.size+targetChange.removedDocuments.size,"Limbo resolution for single document contains multiple changes."),0<targetChange.addedDocuments.size?limboResolution.receivedDocument=!0:0<targetChange.modifiedDocuments.size?assert(limboResolution.receivedDocument,"Received change for limbo target document without add."):0<targetChange.removedDocuments.size&&(assert(limboResolution.receivedDocument,"Received remove for limbo target document without add."),limboResolution.receivedDocument=!1))}),_this.emitNewSnapsAndNotifyLocalStore(changes,remoteEvent)}).catch(function(err){return _this.ignoreIfPrimaryLeaseLoss(err)})},SyncEngine.prototype.applyOnlineStateChange=function(onlineState,source){if(this.isPrimary&&source===OnlineStateSource.RemoteStore||!this.isPrimary&&source===OnlineStateSource.SharedClientState){var newViewSnapshots_1=[];this.queryViewsByQuery.forEach(function(query,queryView){var viewChange=queryView.view.applyOnlineStateChange(onlineState);assert(0===viewChange.limboChanges.length,"OnlineState should not affect limbo documents."),viewChange.snapshot&&newViewSnapshots_1.push(viewChange.snapshot)}),this.syncEngineListener.onOnlineStateChange(onlineState),this.syncEngineListener.onWatchChange(newViewSnapshots_1),this.onlineState=onlineState,this.isPrimary&&this.sharedClientState.setOnlineState(onlineState)}},SyncEngine.prototype.rejectListen=function(targetId,err){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this,limboResolution,limboKey,documentUpdates,resolvedLimboDocuments,event_1,queryView_1;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return(this.assertSubscribed("rejectListens()"),this.sharedClientState.updateQueryState(targetId,"rejected",err),limboResolution=this.limboResolutionsByTarget[targetId],limboKey=limboResolution&&limboResolution.key,!limboKey)?[3,1]:(this.limboTargetsByKey=this.limboTargetsByKey.remove(limboKey),delete this.limboResolutionsByTarget[targetId],documentUpdates=new SortedMap(DocumentKey.comparator),documentUpdates=documentUpdates.insert(limboKey,new NoDocument(limboKey,SnapshotVersion.forDeletedDoc())),resolvedLimboDocuments=documentKeySet().add(limboKey),event_1=new RemoteEvent(SnapshotVersion.MIN,{},new SortedSet(primitiveComparator),documentUpdates,resolvedLimboDocuments),[2,this.applyRemoteEvent(event_1)]);case 1:return queryView_1=this.queryViewsByTarget[targetId],assert(!!queryView_1,"Unknown targetId: "+targetId),[4,this.localStore.releaseQuery(queryView_1.query,!1).then(function(){return _this.removeAndCleanupQuery(queryView_1)}).catch(function(err){return _this.ignoreIfPrimaryLeaseLoss(err)})];case 2:_a.sent(),this.syncEngineListener.onWatchError(queryView_1.query,err),_a.label=3;case 3:return[2];}})})},SyncEngine.prototype.applyBatchState=function(batchId,batchState,error$$1){return tslib_1.__awaiter(this,void 0,void 0,function(){var documents;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return this.assertSubscribed("applyBatchState()"),[4,this.localStore.lookupMutationDocuments(batchId)];case 1:return documents=_a.sent(),null===documents?(debug(LOG_TAG$9,"Cannot apply mutation batch with id: "+batchId),[2]):"pending"===batchState?[4,this.remoteStore.fillWritePipeline()]:[3,3];case 2:return _a.sent(),[3,4];case 3:"acknowledged"===batchState||"rejected"===batchState?(this.processUserCallback(batchId,error$$1?error$$1:null),this.localStore.removeCachedMutationBatchMetadata(batchId)):fail("Unknown batchState: "+batchState),_a.label=4;case 4:return[4,this.emitNewSnapsAndNotifyLocalStore(documents)];case 5:return _a.sent(),[2];}})})},SyncEngine.prototype.applySuccessfulWrite=function(mutationBatchResult){var _this=this;this.assertSubscribed("applySuccessfulWrite()");var batchId=mutationBatchResult.batch.batchId;return this.processUserCallback(batchId,null),this.localStore.acknowledgeBatch(mutationBatchResult).then(function(changes){return _this.sharedClientState.updateMutationState(batchId,"acknowledged"),_this.emitNewSnapsAndNotifyLocalStore(changes)}).catch(function(err){return _this.ignoreIfPrimaryLeaseLoss(err)})},SyncEngine.prototype.rejectFailedWrite=function(batchId,error$$1){var _this=this;return this.assertSubscribed("rejectFailedWrite()"),this.processUserCallback(batchId,error$$1),this.localStore.rejectBatch(batchId).then(function(changes){return _this.sharedClientState.updateMutationState(batchId,"rejected",error$$1),_this.emitNewSnapsAndNotifyLocalStore(changes)}).catch(function(err){return _this.ignoreIfPrimaryLeaseLoss(err)})},SyncEngine.prototype.addMutationCallback=function(batchId,callback){var newCallbacks=this.mutationUserCallbacks[this.currentUser.toKey()];newCallbacks||(newCallbacks=new SortedMap(primitiveComparator)),newCallbacks=newCallbacks.insert(batchId,callback),this.mutationUserCallbacks[this.currentUser.toKey()]=newCallbacks},SyncEngine.prototype.processUserCallback=function(batchId,error$$1){var newCallbacks=this.mutationUserCallbacks[this.currentUser.toKey()];if(newCallbacks){var callback=newCallbacks.get(batchId);callback&&(assert(batchId===newCallbacks.minKey(),"Mutation callbacks processed out-of-order?"),error$$1?callback.reject(error$$1):callback.resolve(),newCallbacks=newCallbacks.remove(batchId)),this.mutationUserCallbacks[this.currentUser.toKey()]=newCallbacks}},SyncEngine.prototype.removeAndCleanupQuery=function(queryView){var _this=this;if(this.sharedClientState.removeLocalQueryTarget(queryView.targetId),this.queryViewsByQuery.delete(queryView.query),delete this.queryViewsByTarget[queryView.targetId],this.isPrimary){var limboKeys=this.limboDocumentRefs.referencesForId(queryView.targetId);this.limboDocumentRefs.removeReferencesForId(queryView.targetId),limboKeys.forEach(function(limboKey){var isReferenced=_this.limboDocumentRefs.containsKey(limboKey);isReferenced||_this.removeLimboTarget(limboKey)})}},SyncEngine.prototype.removeLimboTarget=function(key){var limboTargetId=this.limboTargetsByKey.get(key);null===limboTargetId||(this.remoteStore.unlisten(limboTargetId),this.limboTargetsByKey=this.limboTargetsByKey.remove(key),delete this.limboResolutionsByTarget[limboTargetId])},SyncEngine.prototype.updateTrackedLimbos=function(targetId,limboChanges){for(var _i=0,limboChanges_1=limboChanges,limboChange;_i<limboChanges_1.length;_i++)if(limboChange=limboChanges_1[_i],limboChange instanceof AddedLimboDocument)this.limboDocumentRefs.addReference(limboChange.key,targetId),this.trackLimboChange(limboChange);else if(limboChange instanceof RemovedLimboDocument){debug(LOG_TAG$9,"Document no longer in limbo: "+limboChange.key),this.limboDocumentRefs.removeReference(limboChange.key,targetId);var isReferenced=this.limboDocumentRefs.containsKey(limboChange.key);isReferenced||this.removeLimboTarget(limboChange.key)}else fail("Unknown limbo change: "+JSON.stringify(limboChange))},SyncEngine.prototype.trackLimboChange=function(limboChange){var key=limboChange.key;if(!this.limboTargetsByKey.get(key)){debug(LOG_TAG$9,"New document in limbo: "+key);var limboTargetId=this.limboTargetIdGenerator.next(),query=Query.atPath(key.path);this.limboResolutionsByTarget[limboTargetId]=new LimboResolution(key),this.remoteStore.listen(new QueryData(query,limboTargetId,QueryPurpose.LimboResolution,ListenSequence.INVALID)),this.limboTargetsByKey=this.limboTargetsByKey.insert(key,limboTargetId)}},SyncEngine.prototype.currentLimboDocs=function(){return this.limboTargetsByKey},SyncEngine.prototype.emitNewSnapsAndNotifyLocalStore=function(changes,remoteEvent){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this,newSnaps,docChangesInAllViews,queriesProcessed;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return newSnaps=[],docChangesInAllViews=[],queriesProcessed=[],this.queryViewsByQuery.forEach(function(_,queryView){queriesProcessed.push(Promise.resolve().then(function(){var viewDocChanges=queryView.view.computeDocChanges(changes);return viewDocChanges.needsRefill?_this.localStore.executeQuery(queryView.query).then(function(docs){return queryView.view.computeDocChanges(docs,viewDocChanges)}):viewDocChanges}).then(function(viewDocChanges){var targetChange=remoteEvent&&remoteEvent.targetChanges[queryView.targetId],viewChange=queryView.view.applyChanges(viewDocChanges,!0===_this.isPrimary,targetChange);if(_this.updateTrackedLimbos(queryView.targetId,viewChange.limboChanges),viewChange.snapshot){_this.isPrimary&&_this.sharedClientState.updateQueryState(queryView.targetId,viewChange.snapshot.fromCache?"not-current":"current"),newSnaps.push(viewChange.snapshot);var docChanges=LocalViewChanges.fromSnapshot(queryView.targetId,viewChange.snapshot);docChangesInAllViews.push(docChanges)}}))}),[4,Promise.all(queriesProcessed)];case 1:return _a.sent(),this.syncEngineListener.onWatchChange(newSnaps),[4,this.localStore.notifyLocalViewChanges(docChangesInAllViews)];case 2:return _a.sent(),[2];}})})},SyncEngine.prototype.ignoreIfPrimaryLeaseLoss=function(err){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(){if(isPrimaryLeaseLostError(err))debug(LOG_TAG$9,"Unexpectedly lost primary lease");else throw err;return[2]})})},SyncEngine.prototype.assertSubscribed=function(fnName){assert(null!==this.syncEngineListener,"Trying to call "+fnName+" before calling subscribe().")},SyncEngine.prototype.handleCredentialChange=function(user){return tslib_1.__awaiter(this,void 0,void 0,function(){var userChanged,result;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return userChanged=!this.currentUser.isEqual(user),this.currentUser=user,userChanged?[4,this.localStore.handleUserChange(user)]:[3,3];case 1:return result=_a.sent(),this.sharedClientState.handleUserChange(user,result.removedBatchIds,result.addedBatchIds),[4,this.emitNewSnapsAndNotifyLocalStore(result.affectedDocuments)];case 2:_a.sent(),_a.label=3;case 3:return[4,this.remoteStore.handleCredentialChange()];case 4:return _a.sent(),[2];}})})},SyncEngine.prototype.applyPrimaryState=function(isPrimary){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this,activeTargets,activeQueries,_i,activeQueries_1,queryData,activeTargets_1,p_1;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return!0!==isPrimary||!0===this.isPrimary?[3,3]:(this.isPrimary=!0,[4,this.remoteStore.applyPrimaryState(!0)]);case 1:return _a.sent(),activeTargets=this.sharedClientState.getAllActiveQueryTargets(),[4,this.synchronizeQueryViewsAndRaiseSnapshots(activeTargets.toArray())];case 2:for(activeQueries=_a.sent(),_i=0,activeQueries_1=activeQueries;_i<activeQueries_1.length;_i++)queryData=activeQueries_1[_i],this.remoteStore.listen(queryData);return[3,7];case 3:return!1!==isPrimary||!1===this.isPrimary?[3,7]:(this.isPrimary=!1,activeTargets_1=[],p_1=Promise.resolve(),forEachNumber(this.queryViewsByTarget,function(targetId,queryView){_this.sharedClientState.isLocalQueryTarget(targetId)?activeTargets_1.push(targetId):p_1=p_1.then(function(){return _this.unlisten(queryView.query)}),_this.remoteStore.unlisten(queryView.targetId)}),[4,p_1]);case 4:return _a.sent(),[4,this.synchronizeQueryViewsAndRaiseSnapshots(activeTargets_1)];case 5:return _a.sent(),this.resetLimboDocuments(),[4,this.remoteStore.applyPrimaryState(!1)];case 6:_a.sent(),_a.label=7;case 7:return[2];}})})},SyncEngine.prototype.resetLimboDocuments=function(){var _this=this;forEachNumber(this.limboResolutionsByTarget,function(targetId){_this.remoteStore.unlisten(targetId)}),this.limboDocumentRefs.removeAllReferences(),this.limboResolutionsByTarget=[],this.limboTargetsByKey=new SortedMap(DocumentKey.comparator)},SyncEngine.prototype.synchronizeQueryViewsAndRaiseSnapshots=function(targets){for(var _this=this,p=Promise.resolve(),activeQueries=[],newViewSnapshots=[],_loop_1=function(targetId){p=p.then(function(){return tslib_1.__awaiter(_this,void 0,void 0,function(){var queryData,queryView,viewChange,query;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return queryView=this.queryViewsByTarget[targetId],queryView?[4,this.localStore.releaseQuery(queryView.query,!0)]:[3,4];case 1:return _a.sent(),[4,this.localStore.allocateQuery(queryView.query)];case 2:return queryData=_a.sent(),[4,this.synchronizeViewAndComputeSnapshot(queryView)];case 3:return viewChange=_a.sent(),viewChange.snapshot&&newViewSnapshots.push(viewChange.snapshot),[3,8];case 4:return assert(!0===this.isPrimary,"A secondary tab should never have an active query without an active view."),[4,this.localStore.getQueryForTarget(targetId)];case 5:return query=_a.sent(),assert(!!query,"Query data for target "+targetId+" not found"),[4,this.localStore.allocateQuery(query)];case 6:return queryData=_a.sent(),[4,this.initializeViewAndComputeSnapshot(queryData,!1)];case 7:_a.sent(),_a.label=8;case 8:return activeQueries.push(queryData),[2];}})})})},_i=0,targets_1=targets,targetId;_i<targets_1.length;_i++)targetId=targets_1[_i],_loop_1(targetId);return p.then(function(){return _this.syncEngineListener.onWatchChange(newViewSnapshots),activeQueries})},SyncEngine.prototype.getActiveClients=function(){return this.localStore.getActiveClients()},SyncEngine.prototype.applyTargetState=function(targetId,state,error$$1){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this,_a,queryView;return tslib_1.__generator(this,function(_b){switch(_b.label){case 0:return this.isPrimary?(debug(LOG_TAG$9,"Ignoring unexpected query state notification."),[2]):this.queryViewsByTarget[targetId]?(_a=state,"current"===_a?[3,1]:"not-current"===_a?[3,1]:"rejected"===_a?[3,2]:[3,4]):[3,5];case 1:return[2,this.localStore.getNewDocumentChanges().then(function(changes){return tslib_1.__awaiter(_this,void 0,void 0,function(){var synthesizedRemoteEvent;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return synthesizedRemoteEvent=RemoteEvent.createSynthesizedRemoteEventForCurrentChange(targetId,"current"===state),[4,this.emitNewSnapsAndNotifyLocalStore(changes,synthesizedRemoteEvent)];case 1:return _a.sent(),[2];}})})},function(err){return tslib_1.__awaiter(_this,void 0,void 0,function(){var activeTargets_2;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return isDocumentChangeMissingError(err)?(activeTargets_2=[],forEachNumber(this.queryViewsByTarget,function(target){return activeTargets_2.push(target)}),[4,this.synchronizeQueryViewsAndRaiseSnapshots(activeTargets_2)]):[3,2];case 1:return _a.sent(),[3,3];case 2:throw err;case 3:return[2];}})})})];_b.label=2;case 2:return queryView=this.queryViewsByTarget[targetId],this.removeAndCleanupQuery(queryView),[4,this.localStore.releaseQuery(queryView.query,!0)];case 3:return _b.sent(),this.syncEngineListener.onWatchError(queryView.query,error$$1),[3,5];case 4:fail("Unexpected target state: "+state),_b.label=5;case 5:return[2];}})})},SyncEngine.prototype.applyActiveTargetsChange=function(added,removed){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this,_i,added_1,targetId,query,queryData,_loop_2,this_1,_a,removed_1,targetId;return tslib_1.__generator(this,function(_b){switch(_b.label){case 0:if(!this.isPrimary)return[2];_i=0,added_1=added,_b.label=1;case 1:return _i<added_1.length?(targetId=added_1[_i],assert(!this.queryViewsByTarget[targetId],"Trying to add an already active target"),[4,this.localStore.getQueryForTarget(targetId)]):[3,6];case 2:return query=_b.sent(),assert(!!query,"Query data for active target "+targetId+" not found"),[4,this.localStore.allocateQuery(query)];case 3:return queryData=_b.sent(),[4,this.initializeViewAndComputeSnapshot(queryData,!1)];case 4:_b.sent(),this.remoteStore.listen(queryData),_b.label=5;case 5:return _i++,[3,1];case 6:_loop_2=function(targetId){var queryView;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return queryView=this_1.queryViewsByTarget[targetId],queryView?[4,this_1.localStore.releaseQuery(queryView.query,!1).then(function(){_this.remoteStore.unlisten(targetId),_this.removeAndCleanupQuery(queryView)}).catch(function(err){return _this.ignoreIfPrimaryLeaseLoss(err)})]:[3,2];case 1:_a.sent(),_a.label=2;case 2:return[2];}})},this_1=this,_a=0,removed_1=removed,_b.label=7;case 7:return _a<removed_1.length?(targetId=removed_1[_a],[5,_loop_2(targetId)]):[3,10];case 8:_b.sent(),_b.label=9;case 9:return _a++,[3,7];case 10:return[2];}})})},SyncEngine.prototype.enableNetwork=function(){return this.localStore.setNetworkEnabled(!0),this.remoteStore.enableNetwork()},SyncEngine.prototype.disableNetwork=function(){return this.localStore.setNetworkEnabled(!1),this.remoteStore.disableNetwork()},SyncEngine.prototype.getRemoteKeysForTarget=function(targetId){var limboResolution=this.limboResolutionsByTarget[targetId];return limboResolution&&limboResolution.receivedDocument?documentKeySet().add(limboResolution.key):this.queryViewsByTarget[targetId]?this.queryViewsByTarget[targetId].view.syncedDocuments:documentKeySet()},SyncEngine}(),User=function(){function User(uid){this.uid=uid}return User.prototype.isAuthenticated=function(){return null!=this.uid},User.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},User.prototype.isEqual=function(otherUser){return otherUser.uid===this.uid},User.UNAUTHENTICATED=new User(null),User.GOOGLE_CREDENTIALS=new User("google-credentials-uid"),User.FIRST_PARTY=new User("first-party-uid"),User}(),LOG_TAG$10="SharedClientState",CLIENT_STATE_KEY_PREFIX="firestore_clients",MUTATION_BATCH_KEY_PREFIX="firestore_mutations",QUERY_TARGET_KEY_PREFIX="firestore_targets",MutationMetadata=function(){function MutationMetadata(user,batchId,state,error$$1){this.user=user,this.batchId=batchId,this.state=state,this.error=error$$1,assert(void 0!==error$$1==("rejected"===state),"MutationMetadata must contain an error iff state is 'rejected'")}return MutationMetadata.fromWebStorageEntry=function(user,batchId,value){var mutationBatch=JSON.parse(value),validData="object"==typeof mutationBatch&&-1!==["pending","acknowledged","rejected"].indexOf(mutationBatch.state)&&(void 0===mutationBatch.error||"object"==typeof mutationBatch.error),firestoreError=void 0;return validData&&mutationBatch.error&&(validData="string"==typeof mutationBatch.error.message&&"string"==typeof mutationBatch.error.code,validData&&(firestoreError=new FirestoreError(mutationBatch.error.code,mutationBatch.error.message))),validData?new MutationMetadata(user,batchId,mutationBatch.state,firestoreError):(error(LOG_TAG$10,"Failed to parse mutation state for ID '"+batchId+"': "+value),null)},MutationMetadata.prototype.toWebStorageJSON=function(){var batchMetadata={state:this.state,updateTimeMs:Date.now()};return this.error&&(batchMetadata.error={code:this.error.code,message:this.error.message}),JSON.stringify(batchMetadata)},MutationMetadata}(),QueryTargetMetadata=function(){function QueryTargetMetadata(targetId,state,error$$1){this.targetId=targetId,this.state=state,this.error=error$$1,assert(void 0!==error$$1==("rejected"===state),"QueryTargetMetadata must contain an error iff state is 'rejected'")}return QueryTargetMetadata.fromWebStorageEntry=function(targetId,value){var targetState=JSON.parse(value),validData="object"==typeof targetState&&-1!==["not-current","current","rejected"].indexOf(targetState.state)&&(void 0===targetState.error||"object"==typeof targetState.error),firestoreError=void 0;return validData&&targetState.error&&(validData="string"==typeof targetState.error.message&&"string"==typeof targetState.error.code,validData&&(firestoreError=new FirestoreError(targetState.error.code,targetState.error.message))),validData?new QueryTargetMetadata(targetId,targetState.state,firestoreError):(error(LOG_TAG$10,"Failed to parse target state for ID '"+targetId+"': "+value),null)},QueryTargetMetadata.prototype.toWebStorageJSON=function(){var targetState={state:this.state,updateTimeMs:Date.now()};return this.error&&(targetState.error={code:this.error.code,message:this.error.message}),JSON.stringify(targetState)},QueryTargetMetadata}(),RemoteClientState=function(){function RemoteClientState(clientId,activeTargetIds){this.clientId=clientId,this.activeTargetIds=activeTargetIds}return RemoteClientState.fromWebStorageEntry=function(clientId,value){for(var clientState=JSON.parse(value),validData="object"==typeof clientState&&clientState.activeTargetIds instanceof Array,activeTargetIdsSet=targetIdSet(),i=0;validData&&i<clientState.activeTargetIds.length;++i)validData=isSafeInteger(clientState.activeTargetIds[i]),activeTargetIdsSet=activeTargetIdsSet.add(clientState.activeTargetIds[i]);return validData?new RemoteClientState(clientId,activeTargetIdsSet):(error(LOG_TAG$10,"Failed to parse client data for instance '"+clientId+"': "+value),null)},RemoteClientState}(),SharedOnlineState=function(){function SharedOnlineState(clientId,onlineState){this.clientId=clientId,this.onlineState=onlineState}return SharedOnlineState.fromWebStorageEntry=function(value){var onlineState=JSON.parse(value),validData="object"==typeof onlineState&&void 0!==OnlineState[onlineState.onlineState]&&"string"==typeof onlineState.clientId;return validData?new SharedOnlineState(onlineState.clientId,OnlineState[onlineState.onlineState]):(error(LOG_TAG$10,"Failed to parse online state: "+value),null)},SharedOnlineState}(),LocalClientState=function(){function LocalClientState(){this.activeTargetIds=targetIdSet()}return LocalClientState.prototype.addQueryTarget=function(targetId){assert(!this.activeTargetIds.has(targetId),"Target with ID '"+targetId+"' already active."),this.activeTargetIds=this.activeTargetIds.add(targetId)},LocalClientState.prototype.removeQueryTarget=function(targetId){this.activeTargetIds=this.activeTargetIds.delete(targetId)},LocalClientState.prototype.toWebStorageJSON=function(){var data={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(data)},LocalClientState}(),WebStorageSharedClientState=function(){function WebStorageSharedClientState(queue,platform,persistenceKey,localClientId,initialUser){if(this.queue=queue,this.platform=platform,this.persistenceKey=persistenceKey,this.localClientId=localClientId,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.activeClients={},this.storageListener=this.handleWebStorageEvent.bind(this),this.started=!1,this.earlyEvents=[],!WebStorageSharedClientState.isAvailable(this.platform))throw new FirestoreError(Code.UNIMPLEMENTED,"LocalStorage is not available on this platform.");var escapedPersistenceKey=persistenceKey.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.platform.window.localStorage,this.currentUser=initialUser,this.localClientStorageKey=this.toWebStorageClientStateKey(this.localClientId),this.sequenceNumberKey="firestore_sequence_number"+"_"+persistenceKey,this.activeClients[this.localClientId]=new LocalClientState,this.clientStateKeyRe=new RegExp("^"+CLIENT_STATE_KEY_PREFIX+"_"+escapedPersistenceKey+"_([^_]*)$"),this.mutationBatchKeyRe=new RegExp("^"+MUTATION_BATCH_KEY_PREFIX+"_"+escapedPersistenceKey+"_(\\d+)(?:_(.*))?$"),this.queryTargetKeyRe=new RegExp("^"+QUERY_TARGET_KEY_PREFIX+"_"+escapedPersistenceKey+"_(\\d+)$"),this.onlineStateKey="firestore_online_state"+"_"+persistenceKey,this.platform.window.addEventListener("storage",this.storageListener)}return WebStorageSharedClientState.isAvailable=function(platform){return!!(platform.window&&null!=platform.window.localStorage)},WebStorageSharedClientState.prototype.start=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){var _this=this,existingClients,_i,existingClients_1,clientId,storageItem,clientState,onlineStateJSON,onlineState,_a,_b,event_1;return tslib_1.__generator(this,function(_c){switch(_c.label){case 0:return assert(!this.started,"WebStorageSharedClientState already started"),assert(null!==this.syncEngine,"syncEngine property must be set before calling start()"),assert(null!==this.onlineStateHandler,"onlineStateHandler property must be set before calling start()"),[4,this.syncEngine.getActiveClients()];case 1:for(existingClients=_c.sent(),_i=0,existingClients_1=existingClients;_i<existingClients_1.length;_i++)(clientId=existingClients_1[_i],clientId!==this.localClientId)&&(storageItem=this.getItem(this.toWebStorageClientStateKey(clientId)),storageItem&&(clientState=RemoteClientState.fromWebStorageEntry(clientId,storageItem),clientState&&(this.activeClients[clientState.clientId]=clientState)));for(this.persistClientState(),onlineStateJSON=this.storage.getItem(this.onlineStateKey),onlineStateJSON&&(onlineState=this.fromWebStorageOnlineState(onlineStateJSON),onlineState&&this.handleOnlineStateEvent(onlineState)),(_a=0,_b=this.earlyEvents);_a<_b.length;_a++)event_1=_b[_a],this.handleWebStorageEvent(event_1);return this.earlyEvents=[],this.platform.window.addEventListener("unload",function(){return _this.shutdown()}),this.started=!0,[2];}})})},WebStorageSharedClientState.prototype.writeSequenceNumber=function(sequenceNumber){this.setItem(this.sequenceNumberKey,JSON.stringify(sequenceNumber))},WebStorageSharedClientState.prototype.getAllActiveQueryTargets=function(){var activeTargets=targetIdSet();return forEach(this.activeClients,function(key,value){activeTargets=activeTargets.unionWith(value.activeTargetIds)}),activeTargets},WebStorageSharedClientState.prototype.isActiveQueryTarget=function(targetId){for(var clientId in this.activeClients)if(this.activeClients.hasOwnProperty(clientId)&&this.activeClients[clientId].activeTargetIds.has(targetId))return!0;return!1},WebStorageSharedClientState.prototype.addPendingMutation=function(batchId){this.persistMutationState(batchId,"pending")},WebStorageSharedClientState.prototype.updateMutationState=function(batchId,state,error$$1){this.persistMutationState(batchId,state,error$$1),this.removeMutationState(batchId)},WebStorageSharedClientState.prototype.addLocalQueryTarget=function(targetId){var queryState="not-current";if(this.isActiveQueryTarget(targetId)){var storageItem=this.storage.getItem(this.toWebStorageQueryTargetMetadataKey(targetId));if(storageItem){var metadata=QueryTargetMetadata.fromWebStorageEntry(targetId,storageItem);metadata&&(queryState=metadata.state)}}return this.localClientState.addQueryTarget(targetId),this.persistClientState(),queryState},WebStorageSharedClientState.prototype.removeLocalQueryTarget=function(targetId){this.localClientState.removeQueryTarget(targetId),this.persistClientState()},WebStorageSharedClientState.prototype.isLocalQueryTarget=function(targetId){return this.localClientState.activeTargetIds.has(targetId)},WebStorageSharedClientState.prototype.clearQueryState=function(targetId){this.removeItem(this.toWebStorageQueryTargetMetadataKey(targetId))},WebStorageSharedClientState.prototype.updateQueryState=function(targetId,state,error$$1){this.persistQueryTargetState(targetId,state,error$$1)},WebStorageSharedClientState.prototype.handleUserChange=function(user,removedBatchIds,addedBatchIds){var _this=this;removedBatchIds.forEach(function(batchId){_this.removeMutationState(batchId)}),this.currentUser=user,addedBatchIds.forEach(function(batchId){_this.addPendingMutation(batchId)})},WebStorageSharedClientState.prototype.setOnlineState=function(onlineState){this.persistOnlineState(onlineState)},WebStorageSharedClientState.prototype.shutdown=function(){this.started&&(this.platform.window.removeEventListener("storage",this.storageListener),this.removeItem(this.localClientStorageKey),this.started=!1)},WebStorageSharedClientState.prototype.getItem=function(key){var value=this.storage.getItem(key);return debug(LOG_TAG$10,"READ",key,value),value},WebStorageSharedClientState.prototype.setItem=function(key,value){debug(LOG_TAG$10,"SET",key,value),this.storage.setItem(key,value)},WebStorageSharedClientState.prototype.removeItem=function(key){debug(LOG_TAG$10,"REMOVE",key),this.storage.removeItem(key)},WebStorageSharedClientState.prototype.handleWebStorageEvent=function(event){var _this=this;if(event.storageArea===this.storage){if(debug(LOG_TAG$10,"EVENT",event.key,event.newValue),event.key===this.localClientStorageKey)return void error("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.queue.enqueueAndForget(function(){return tslib_1.__awaiter(_this,void 0,void 0,function(){var clientState,clientId,mutationMetadata,queryTargetMetadata,onlineState,sequenceNumber;return tslib_1.__generator(this,function(){if(!this.started)return this.earlyEvents.push(event),[2];if(null===event.key)return[2];if(this.clientStateKeyRe.test(event.key)){if(null==event.newValue)return clientId=this.fromWebStorageClientStateKey(event.key),[2,this.handleClientStateEvent(clientId,null)];if(clientState=this.fromWebStorageClientState(event.key,event.newValue),clientState)return[2,this.handleClientStateEvent(clientState.clientId,clientState)]}else if(this.mutationBatchKeyRe.test(event.key)){if(null!==event.newValue&&(mutationMetadata=this.fromWebStorageMutationMetadata(event.key,event.newValue),mutationMetadata))return[2,this.handleMutationBatchEvent(mutationMetadata)];}else if(this.queryTargetKeyRe.test(event.key)){if(null!==event.newValue&&(queryTargetMetadata=this.fromWebStorageQueryTargetMetadata(event.key,event.newValue),queryTargetMetadata))return[2,this.handleQueryTargetEvent(queryTargetMetadata)];}else if(event.key!==this.onlineStateKey)event.key===this.sequenceNumberKey&&(assert(!!this.sequenceNumberHandler,"Missing sequenceNumberHandler"),sequenceNumber=fromWebStorageSequenceNumber(event.newValue),sequenceNumber!==ListenSequence.INVALID&&this.sequenceNumberHandler(sequenceNumber));else if(null!==event.newValue&&(onlineState=this.fromWebStorageOnlineState(event.newValue),onlineState))return[2,this.handleOnlineStateEvent(onlineState)];return[2]})})})}},Object.defineProperty(WebStorageSharedClientState.prototype,"localClientState",{get:function(){return this.activeClients[this.localClientId]},enumerable:!0,configurable:!0}),WebStorageSharedClientState.prototype.persistClientState=function(){this.setItem(this.localClientStorageKey,this.localClientState.toWebStorageJSON())},WebStorageSharedClientState.prototype.persistMutationState=function(batchId,state,error$$1){var mutationState=new MutationMetadata(this.currentUser,batchId,state,error$$1),mutationKey=this.toWebStorageMutationBatchKey(batchId);this.setItem(mutationKey,mutationState.toWebStorageJSON())},WebStorageSharedClientState.prototype.removeMutationState=function(batchId){var mutationKey=this.toWebStorageMutationBatchKey(batchId);this.removeItem(mutationKey)},WebStorageSharedClientState.prototype.persistOnlineState=function(onlineState){var entry={clientId:this.localClientId,onlineState:OnlineState[onlineState]};this.storage.setItem(this.onlineStateKey,JSON.stringify(entry))},WebStorageSharedClientState.prototype.persistQueryTargetState=function(targetId,state,error$$1){var targetKey=this.toWebStorageQueryTargetMetadataKey(targetId),targetMetadata=new QueryTargetMetadata(targetId,state,error$$1);this.setItem(targetKey,targetMetadata.toWebStorageJSON())},WebStorageSharedClientState.prototype.toWebStorageClientStateKey=function(clientId){return assert(-1===clientId.indexOf("_"),"Client key cannot contain '_', but was '"+clientId+"'"),CLIENT_STATE_KEY_PREFIX+"_"+this.persistenceKey+"_"+clientId},WebStorageSharedClientState.prototype.toWebStorageQueryTargetMetadataKey=function(targetId){return QUERY_TARGET_KEY_PREFIX+"_"+this.persistenceKey+"_"+targetId},WebStorageSharedClientState.prototype.toWebStorageMutationBatchKey=function(batchId){var mutationKey=MUTATION_BATCH_KEY_PREFIX+"_"+this.persistenceKey+"_"+batchId;return this.currentUser.isAuthenticated()&&(mutationKey+="_"+this.currentUser.uid),mutationKey},WebStorageSharedClientState.prototype.fromWebStorageClientStateKey=function(key){var match=this.clientStateKeyRe.exec(key);return match?match[1]:null},WebStorageSharedClientState.prototype.fromWebStorageClientState=function(key,value){var clientId=this.fromWebStorageClientStateKey(key);return assert(null!==clientId,"Cannot parse client state key '"+key+"'"),RemoteClientState.fromWebStorageEntry(clientId,value)},WebStorageSharedClientState.prototype.fromWebStorageMutationMetadata=function(key,value){var match=this.mutationBatchKeyRe.exec(key);assert(null!==match,"Cannot parse mutation batch key '"+key+"'");var batchId=+match[1],userId=void 0===match[2]?null:match[2];return MutationMetadata.fromWebStorageEntry(new User(userId),batchId,value)},WebStorageSharedClientState.prototype.fromWebStorageQueryTargetMetadata=function(key,value){var match=this.queryTargetKeyRe.exec(key);assert(null!==match,"Cannot parse query target key '"+key+"'");var targetId=+match[1];return QueryTargetMetadata.fromWebStorageEntry(targetId,value)},WebStorageSharedClientState.prototype.fromWebStorageOnlineState=function(value){return SharedOnlineState.fromWebStorageEntry(value)},WebStorageSharedClientState.prototype.handleMutationBatchEvent=function(mutationBatch){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return mutationBatch.user.uid===this.currentUser.uid?[2,this.syncEngine.applyBatchState(mutationBatch.batchId,mutationBatch.state,mutationBatch.error)]:(debug(LOG_TAG$10,"Ignoring mutation for non-active user "+mutationBatch.user.uid),[2])})})},WebStorageSharedClientState.prototype.handleQueryTargetEvent=function(targetMetadata){return this.syncEngine.applyTargetState(targetMetadata.targetId,targetMetadata.state,targetMetadata.error)},WebStorageSharedClientState.prototype.handleClientStateEvent=function(clientId,clientState){var _this=this,existingTargets=this.getAllActiveQueryTargets();clientState?this.activeClients[clientId]=clientState:delete this.activeClients[clientId];var newTargets=this.getAllActiveQueryTargets(),addedTargets=[],removedTargets=[];return newTargets.forEach(function(targetId){return tslib_1.__awaiter(_this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return existingTargets.has(targetId)||addedTargets.push(targetId),[2]})})}),existingTargets.forEach(function(targetId){return tslib_1.__awaiter(_this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return newTargets.has(targetId)||removedTargets.push(targetId),[2]})})}),this.syncEngine.applyActiveTargetsChange(addedTargets,removedTargets)},WebStorageSharedClientState.prototype.handleOnlineStateEvent=function(onlineState){this.activeClients[onlineState.clientId]&&this.onlineStateHandler(onlineState.onlineState)},WebStorageSharedClientState}(),MemorySharedClientState=function(){function MemorySharedClientState(){this.localState=new LocalClientState,this.queryState={},this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null}return MemorySharedClientState.prototype.addPendingMutation=function(){},MemorySharedClientState.prototype.updateMutationState=function(){},MemorySharedClientState.prototype.addLocalQueryTarget=function(targetId){return this.localState.addQueryTarget(targetId),this.queryState[targetId]||"not-current"},MemorySharedClientState.prototype.updateQueryState=function(targetId,state){this.queryState[targetId]=state},MemorySharedClientState.prototype.removeLocalQueryTarget=function(targetId){this.localState.removeQueryTarget(targetId)},MemorySharedClientState.prototype.isLocalQueryTarget=function(targetId){return this.localState.activeTargetIds.has(targetId)},MemorySharedClientState.prototype.clearQueryState=function(targetId){delete this.queryState[targetId]},MemorySharedClientState.prototype.getAllActiveQueryTargets=function(){return this.localState.activeTargetIds},MemorySharedClientState.prototype.isActiveQueryTarget=function(targetId){return this.localState.activeTargetIds.has(targetId)},MemorySharedClientState.prototype.start=function(){return this.localState=new LocalClientState,Promise.resolve()},MemorySharedClientState.prototype.handleUserChange=function(){},MemorySharedClientState.prototype.setOnlineState=function(){},MemorySharedClientState.prototype.shutdown=function(){},MemorySharedClientState.prototype.writeSequenceNumber=function(){},MemorySharedClientState}(),LOG_TAG$11="FirestoreClient",FirestoreClient=function(){function FirestoreClient(platform,databaseInfo,credentials,asyncQueue){this.platform=platform,this.databaseInfo=databaseInfo,this.credentials=credentials,this.asyncQueue=asyncQueue,this.clientId=AutoId.newId()}return FirestoreClient.prototype.start=function(persistenceSettings){var _this=this,initializationDone=new Deferred$1,persistenceResult=new Deferred$1,initialized=!1;return this.credentials.setChangeListener(function(user){initialized?_this.asyncQueue.enqueueAndForget(function(){return _this.handleCredentialChange(user)}):(initialized=!0,_this.initializePersistence(persistenceSettings,persistenceResult,user).then(function(){return _this.initializeRest(user)}).then(initializationDone.resolve,initializationDone.reject))}),this.asyncQueue.enqueueAndForget(function(){return initializationDone.promise}),persistenceResult.promise},FirestoreClient.prototype.enableNetwork=function(){var _this=this;return this.asyncQueue.enqueue(function(){return _this.syncEngine.enableNetwork()})},FirestoreClient.prototype.initializePersistence=function(persistenceSettings,persistenceResult,user){var _this=this;return persistenceSettings.enabled?this.startIndexedDbPersistence(user,persistenceSettings).then(persistenceResult.resolve).catch(function(error$$1){return(persistenceResult.reject(error$$1),!_this.canFallback(error$$1))?Promise.reject(error$$1):(console.warn("Error enabling offline storage. Falling back to storage disabled: "+error$$1),_this.startMemoryPersistence())}):(persistenceResult.resolve(),this.startMemoryPersistence())},FirestoreClient.prototype.canFallback=function(error$$1){return error$$1 instanceof FirestoreError?error$$1.code===Code.FAILED_PRECONDITION||error$$1.code===Code.UNIMPLEMENTED:"undefined"!=typeof DOMException&&error$$1 instanceof DOMException?error$$1.code===22||error$$1.code===20:!0},FirestoreClient.prototype.startIndexedDbPersistence=function(user,settings){var _this=this;assert(settings.enabled,"Should only start IndexedDb persitence with offline persistence enabled.");var storagePrefix=IndexedDbPersistence.buildStoragePrefix(this.databaseInfo),serializer=new JsonProtoSerializer(this.databaseInfo.databaseId,{useProto3Json:!0});return Promise.resolve().then(function(){return tslib_1.__awaiter(_this,void 0,void 0,function(){var _a,_b;return tslib_1.__generator(this,function(_c){switch(_c.label){case 0:if(settings.experimentalTabSynchronization&&!WebStorageSharedClientState.isAvailable(this.platform))throw new FirestoreError(Code.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");return settings.experimentalTabSynchronization?(this.sharedClientState=new WebStorageSharedClientState(this.asyncQueue,this.platform,storagePrefix,this.clientId,user),_a=this,[4,IndexedDbPersistence.createMultiClientIndexedDbPersistence(storagePrefix,this.clientId,this.platform,this.asyncQueue,serializer,{sequenceNumberSyncer:this.sharedClientState})]):[3,2];case 1:return _a.persistence=_c.sent(),[3,4];case 2:return this.sharedClientState=new MemorySharedClientState,_b=this,[4,IndexedDbPersistence.createIndexedDbPersistence(storagePrefix,this.clientId,this.platform,this.asyncQueue,serializer)];case 3:_b.persistence=_c.sent(),_c.label=4;case 4:return[2];}})})})},FirestoreClient.prototype.startMemoryPersistence=function(){var serializer=new JsonProtoSerializer(this.databaseInfo.databaseId,{useProto3Json:!0});return this.persistence=MemoryPersistence.createEagerPersistence(this.clientId,serializer),this.sharedClientState=new MemorySharedClientState,Promise.resolve()},FirestoreClient.prototype.initializeRest=function(user){var _this=this;return debug(LOG_TAG$11,"Initializing. user=",user.uid),this.platform.loadConnection(this.databaseInfo).then(function(connection){return tslib_1.__awaiter(_this,void 0,void 0,function(){var _this=this,serializer,datastore,remoteStoreOnlineStateChangedHandler,sharedClientStateOnlineStateChangedHandler;return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return this.localStore=new LocalStore(this.persistence,user),serializer=this.platform.newSerializer(this.databaseInfo.databaseId),datastore=new Datastore(this.asyncQueue,connection,this.credentials,serializer),remoteStoreOnlineStateChangedHandler=function(onlineState){return _this.syncEngine.applyOnlineStateChange(onlineState,OnlineStateSource.RemoteStore)},sharedClientStateOnlineStateChangedHandler=function(onlineState){return _this.syncEngine.applyOnlineStateChange(onlineState,OnlineStateSource.SharedClientState)},this.remoteStore=new RemoteStore(this.localStore,datastore,this.asyncQueue,remoteStoreOnlineStateChangedHandler),this.syncEngine=new SyncEngine(this.localStore,this.remoteStore,this.sharedClientState,user),this.sharedClientState.onlineStateHandler=sharedClientStateOnlineStateChangedHandler,this.remoteStore.syncEngine=this.syncEngine,this.sharedClientState.syncEngine=this.syncEngine,this.eventMgr=new EventManager(this.syncEngine),[4,this.sharedClientState.start()];case 1:return _a.sent(),[4,this.remoteStore.start()];case 2:return _a.sent(),[4,this.persistence.setPrimaryStateListener(function(isPrimary){return _this.syncEngine.applyPrimaryState(isPrimary)})];case 3:return _a.sent(),[2];}})})})},FirestoreClient.prototype.handleCredentialChange=function(user){return this.asyncQueue.verifyOperationInProgress(),debug(LOG_TAG$11,"Credential Changed. Current user: "+user.uid),this.syncEngine.handleCredentialChange(user)},FirestoreClient.prototype.disableNetwork=function(){var _this=this;return this.asyncQueue.enqueue(function(){return _this.syncEngine.disableNetwork()})},FirestoreClient.prototype.shutdown=function(options){var _this=this;return this.asyncQueue.enqueue(function(){return tslib_1.__awaiter(_this,void 0,void 0,function(){return tslib_1.__generator(this,function(_a){switch(_a.label){case 0:return[4,this.remoteStore.shutdown()];case 1:return _a.sent(),[4,this.sharedClientState.shutdown()];case 2:return _a.sent(),[4,this.persistence.shutdown(options&&options.purgePersistenceWithDataLoss)];case 3:return _a.sent(),this.credentials.removeChangeListener(),[2];}})})})},FirestoreClient.prototype.listen=function(query,observer,options){var _this=this,listener=new QueryListener(query,observer,options);return this.asyncQueue.enqueueAndForget(function(){return _this.eventMgr.listen(listener)}),listener},FirestoreClient.prototype.unlisten=function(listener){var _this=this;this.asyncQueue.enqueueAndForget(function(){return _this.eventMgr.unlisten(listener)})},FirestoreClient.prototype.getDocumentFromLocalCache=function(docKey){var _this=this;return this.asyncQueue.enqueue(function(){return _this.localStore.readDocument(docKey)}).then(function(maybeDoc){if(maybeDoc instanceof Document)return maybeDoc;if(maybeDoc instanceof NoDocument)return null;throw new FirestoreError(Code.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)")})},FirestoreClient.prototype.getDocumentsFromLocalCache=function(query){var _this=this;return this.asyncQueue.enqueue(function(){return _this.localStore.executeQuery(query)}).then(function(docs){var remoteKeys=documentKeySet(),view=new View(query,remoteKeys),viewDocChanges=view.computeDocChanges(docs);return view.applyChanges(viewDocChanges,!1).snapshot})},FirestoreClient.prototype.write=function(mutations){var _this=this,deferred=new Deferred$1;return this.asyncQueue.enqueueAndForget(function(){return _this.syncEngine.write(mutations,deferred)}),deferred.promise},FirestoreClient.prototype.databaseId=function(){return this.databaseInfo.databaseId},FirestoreClient.prototype.transaction=function(updateFunction){var _this=this;return this.asyncQueue.enqueue(function(){return tslib_1.__awaiter(_this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return[2]})})}).then(function(){return _this.syncEngine.runTransaction(updateFunction)})},FirestoreClient}(),AsyncObserver=function(){function AsyncObserver(observer){this.observer=observer,this.muted=!1}return AsyncObserver.prototype.next=function(value){this.scheduleEvent(this.observer.next,value)},AsyncObserver.prototype.error=function(error){this.scheduleEvent(this.observer.error,error)},AsyncObserver.prototype.mute=function(){this.muted=!0},AsyncObserver.prototype.scheduleEvent=function(eventHandler,event){var _this=this;this.muted||setTimeout(function(){_this.muted||eventHandler(event)},0)},AsyncObserver}(),FieldPath$1=function(){function FieldPath$$1(){for(var fieldNames=[],_i=0;_i<arguments.length;_i++)fieldNames[_i]=arguments[_i];validateNamedArrayAtLeastNumberOfElements("FieldPath",fieldNames,"fieldNames",1);for(var i=0;i<fieldNames.length;++i)if(validateArgType("FieldPath","string",i,fieldNames[i]),0===fieldNames[i].length)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new FieldPath(fieldNames)}return FieldPath$$1.documentId=function(){return FieldPath$$1._DOCUMENT_ID},FieldPath$$1.prototype.isEqual=function(other){if(!(other instanceof FieldPath$$1))throw invalidClassError("isEqual","FieldPath",1,other);return this._internalPath.isEqual(other._internalPath)},FieldPath$$1._DOCUMENT_ID=new FieldPath$$1(FieldPath.keyField().canonicalString()),FieldPath$$1}(),RESERVED=/[~\*\/\[\]]/,OAuthToken=function(){return function(value,user){this.user=user,this.type="OAuth",this.authHeaders={Authorization:"Bearer "+value}}}(),EmptyCredentialsProvider=function(){function EmptyCredentialsProvider(){this.changeListener=null}return EmptyCredentialsProvider.prototype.getToken=function(){return Promise.resolve(null)},EmptyCredentialsProvider.prototype.invalidateToken=function(){},EmptyCredentialsProvider.prototype.setChangeListener=function(changeListener){assert(!this.changeListener,"Can only call setChangeListener() once."),this.changeListener=changeListener,changeListener(User.UNAUTHENTICATED)},EmptyCredentialsProvider.prototype.removeChangeListener=function(){assert(null!==this.changeListener,"removeChangeListener() when no listener registered"),this.changeListener=null},EmptyCredentialsProvider}(),FirebaseCredentialsProvider=function(){function FirebaseCredentialsProvider(app){var _this=this;this.app=app,this.tokenListener=null,this.tokenCounter=0,this.changeListener=null,this.forceRefresh=!1,this.tokenListener=function(){_this.tokenCounter++,_this.currentUser=_this.getUser(),_this.changeListener&&_this.changeListener(_this.currentUser)},this.tokenCounter=0,this.app.INTERNAL.addAuthTokenListener(this.tokenListener)}return FirebaseCredentialsProvider.prototype.getToken=function(){var _this=this;assert(null!=this.tokenListener,"getToken cannot be called after listener removed.");var initialTokenCounter=this.tokenCounter,forceRefresh=this.forceRefresh;return this.forceRefresh=!1,this.app.INTERNAL.getToken(forceRefresh).then(function(tokenData){if(_this.tokenCounter!==initialTokenCounter)throw new FirestoreError(Code.ABORTED,"getToken aborted due to token change.");else return tokenData?(assert("string"==typeof tokenData.accessToken,"Invalid tokenData returned from getToken():"+tokenData),new OAuthToken(tokenData.accessToken,_this.currentUser)):null})},FirebaseCredentialsProvider.prototype.invalidateToken=function(){this.forceRefresh=!0},FirebaseCredentialsProvider.prototype.setChangeListener=function(changeListener){assert(!this.changeListener,"Can only call setChangeListener() once."),this.changeListener=changeListener,this.currentUser&&changeListener(this.currentUser)},FirebaseCredentialsProvider.prototype.removeChangeListener=function(){assert(null!=this.tokenListener,"removeChangeListener() called twice"),assert(null!==this.changeListener,"removeChangeListener() called when no listener registered"),this.app.INTERNAL.removeAuthTokenListener(this.tokenListener),this.tokenListener=null,this.changeListener=null},FirebaseCredentialsProvider.prototype.getUser=function(){var currentUid=this.app.INTERNAL.getUid();return assert(null===currentUid||"string"==typeof currentUid,"Received invalid UID: "+currentUid),new User(currentUid)},FirebaseCredentialsProvider}(),FirstPartyToken=function(){function FirstPartyToken(gapi,sessionIndex){this.gapi=gapi,this.sessionIndex=sessionIndex,this.type="FirstParty",this.user=User.FIRST_PARTY,assert(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return Object.defineProperty(FirstPartyToken.prototype,"authHeaders",{get:function(){return{Authorization:this.gapi.auth.getAuthHeaderValueForFirstParty([]),"X-Goog-AuthUser":this.sessionIndex}},enumerable:!0,configurable:!0}),FirstPartyToken}(),FirstPartyCredentialsProvider=function(){function FirstPartyCredentialsProvider(gapi,sessionIndex){this.gapi=gapi,this.sessionIndex=sessionIndex,assert(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return FirstPartyCredentialsProvider.prototype.getToken=function(){return Promise.resolve(new FirstPartyToken(this.gapi,this.sessionIndex))},FirstPartyCredentialsProvider.prototype.setChangeListener=function(changeListener){changeListener(User.FIRST_PARTY)},FirstPartyCredentialsProvider.prototype.removeChangeListener=function(){},FirstPartyCredentialsProvider.prototype.invalidateToken=function(){},FirstPartyCredentialsProvider}(),FieldValueImpl=function(){function FieldValueImpl(_methodName){this._methodName=_methodName}return FieldValueImpl.delete=function(){return DeleteFieldValueImpl.instance},FieldValueImpl.serverTimestamp=function(){return ServerTimestampFieldValueImpl.instance},FieldValueImpl.arrayUnion=function(){for(var elements=[],_i=0;_i<arguments.length;_i++)elements[_i]=arguments[_i];return validateAtLeastNumberOfArgs("FieldValue.arrayUnion",arguments,1),new ArrayUnionFieldValueImpl(elements)},FieldValueImpl.arrayRemove=function(){for(var elements=[],_i=0;_i<arguments.length;_i++)elements[_i]=arguments[_i];return validateAtLeastNumberOfArgs("FieldValue.arrayRemove",arguments,1),new ArrayRemoveFieldValueImpl(elements)},FieldValueImpl.prototype.isEqual=function(other){return this===other},FieldValueImpl}(),DeleteFieldValueImpl=function(_super){function DeleteFieldValueImpl(){return _super.call(this,"FieldValue.delete")||this}return tslib_1.__extends(DeleteFieldValueImpl,_super),DeleteFieldValueImpl.instance=new DeleteFieldValueImpl,DeleteFieldValueImpl}(FieldValueImpl),ServerTimestampFieldValueImpl=function(_super){function ServerTimestampFieldValueImpl(){return _super.call(this,"FieldValue.serverTimestamp")||this}return tslib_1.__extends(ServerTimestampFieldValueImpl,_super),ServerTimestampFieldValueImpl.instance=new ServerTimestampFieldValueImpl,ServerTimestampFieldValueImpl}(FieldValueImpl),ArrayUnionFieldValueImpl=function(_super){function ArrayUnionFieldValueImpl(_elements){var _this=_super.call(this,"FieldValue.arrayUnion")||this;return _this._elements=_elements,_this}return tslib_1.__extends(ArrayUnionFieldValueImpl,_super),ArrayUnionFieldValueImpl}(FieldValueImpl),ArrayRemoveFieldValueImpl=function(_super){function ArrayRemoveFieldValueImpl(_elements){var _this=_super.call(this,"FieldValue.arrayRemove")||this;return _this._elements=_elements,_this}return tslib_1.__extends(ArrayRemoveFieldValueImpl,_super),ArrayRemoveFieldValueImpl}(FieldValueImpl),PublicFieldValue=makeConstructorPrivate(FieldValueImpl,"Use FieldValue.<field>() instead."),RESERVED_FIELD_REGEX=/^__.*__$/,ParsedSetData=function(){function ParsedSetData(data,fieldMask,fieldTransforms){this.data=data,this.fieldMask=fieldMask,this.fieldTransforms=fieldTransforms}return ParsedSetData.prototype.toMutations=function(key,precondition){var mutations=[];return null===this.fieldMask?mutations.push(new SetMutation(key,this.data,precondition)):mutations.push(new PatchMutation(key,this.data,this.fieldMask,precondition)),0<this.fieldTransforms.length&&mutations.push(new TransformMutation(key,this.fieldTransforms)),mutations},ParsedSetData}(),ParsedUpdateData=function(){function ParsedUpdateData(data,fieldMask,fieldTransforms){this.data=data,this.fieldMask=fieldMask,this.fieldTransforms=fieldTransforms}return ParsedUpdateData.prototype.toMutations=function(key,precondition){var mutations=[new PatchMutation(key,this.data,this.fieldMask,precondition)];return 0<this.fieldTransforms.length&&mutations.push(new TransformMutation(key,this.fieldTransforms)),mutations},ParsedUpdateData}(),UserDataSource;(function(UserDataSource){UserDataSource[UserDataSource.Set=0]="Set",UserDataSource[UserDataSource.Update=1]="Update",UserDataSource[UserDataSource.MergeSet=2]="MergeSet",UserDataSource[UserDataSource.Argument=3]="Argument"})(UserDataSource||(UserDataSource={}));var ParseContext=function(){function ParseContext(dataSource,methodName,path,arrayElement,fieldTransforms,fieldMask){this.dataSource=dataSource,this.methodName=methodName,this.path=path,this.arrayElement=arrayElement,void 0===fieldTransforms&&this.validatePath(),this.arrayElement=void 0!==arrayElement&&arrayElement,this.fieldTransforms=fieldTransforms||[],this.fieldMask=fieldMask||[]}return ParseContext.prototype.childContextForField=function(field){var childPath=null==this.path?null:this.path.child(field),context=new ParseContext(this.dataSource,this.methodName,childPath,!1,this.fieldTransforms,this.fieldMask);return context.validatePathSegment(field),context},ParseContext.prototype.childContextForFieldPath=function(field){var childPath=null==this.path?null:this.path.child(field),context=new ParseContext(this.dataSource,this.methodName,childPath,!1,this.fieldTransforms,this.fieldMask);return context.validatePath(),context},ParseContext.prototype.childContextForArray=function(){return new ParseContext(this.dataSource,this.methodName,null,!0,this.fieldTransforms,this.fieldMask)},ParseContext.prototype.createError=function(reason){var fieldDescription=null===this.path||this.path.isEmpty()?"":" (found in field "+this.path.toString()+")";return new FirestoreError(Code.INVALID_ARGUMENT,"Function "+this.methodName+"() called with invalid data. "+reason+fieldDescription)},ParseContext.prototype.contains=function(fieldPath){return void 0!==this.fieldMask.find(function(field){return fieldPath.isPrefixOf(field)})||void 0!==this.fieldTransforms.find(function(transform){return fieldPath.isPrefixOf(transform.field)})},ParseContext.prototype.validatePath=function(){if(null!==this.path)for(var i=0;i<this.path.length;i++)this.validatePathSegment(this.path.get(i))},ParseContext.prototype.validatePathSegment=function(segment){if(isWrite(this.dataSource)&&RESERVED_FIELD_REGEX.test(segment))throw this.createError("Document fields cannot begin and end with __")},ParseContext}(),DocumentKeyReference=function(){return function(databaseId,key){this.databaseId=databaseId,this.key=key}}(),UserDataConverter=function(){function UserDataConverter(preConverter){this.preConverter=preConverter}return UserDataConverter.prototype.parseSetData=function(methodName,input){var context=new ParseContext(UserDataSource.Set,methodName,FieldPath.EMPTY_PATH);validatePlainObject("Data must be an object, but it was:",context,input);var updateData=this.parseData(input,context);return new ParsedSetData(updateData,null,context.fieldTransforms)},UserDataConverter.prototype.parseMergeData=function(methodName,input,fieldPaths){var context=new ParseContext(UserDataSource.MergeSet,methodName,FieldPath.EMPTY_PATH);validatePlainObject("Data must be an object, but it was:",context,input);var updateData=this.parseData(input,context),fieldMask,fieldTransforms;if(!fieldPaths)fieldMask=new FieldMask(context.fieldMask),fieldTransforms=context.fieldTransforms;else{for(var validatedFieldPaths=[],_i=0,fieldPaths_1=fieldPaths;_i<fieldPaths_1.length;_i++){var stringOrFieldPath=fieldPaths_1[_i],fieldPath=void 0;if(stringOrFieldPath instanceof FieldPath$1)fieldPath=stringOrFieldPath._internalPath;else if("string"==typeof stringOrFieldPath)fieldPath=fieldPathFromDotSeparatedString(methodName,stringOrFieldPath);else throw fail("Expected stringOrFieldPath to be a string or a FieldPath");if(!context.contains(fieldPath))throw new FirestoreError(Code.INVALID_ARGUMENT,"Field '"+fieldPath+"' is specified in your field mask but missing from your input data.");validatedFieldPaths.push(fieldPath)}fieldMask=new FieldMask(validatedFieldPaths),fieldTransforms=context.fieldTransforms.filter(function(transform){return fieldMask.covers(transform.field)})}return new ParsedSetData(updateData,fieldMask,fieldTransforms)},UserDataConverter.prototype.parseUpdateData=function(methodName,input){var _this=this,context=new ParseContext(UserDataSource.Update,methodName,FieldPath.EMPTY_PATH);validatePlainObject("Data must be an object, but it was:",context,input);var fieldMaskPaths=[],updateData=ObjectValue.EMPTY;forEach(input,function(key,value){var path=fieldPathFromDotSeparatedString(methodName,key),childContext=context.childContextForFieldPath(path);if(value=_this.runPreConverter(value,childContext),value instanceof DeleteFieldValueImpl)fieldMaskPaths.push(path);else{var parsedValue=_this.parseData(value,childContext);null!=parsedValue&&(fieldMaskPaths.push(path),updateData=updateData.set(path,parsedValue))}});var mask=new FieldMask(fieldMaskPaths);return new ParsedUpdateData(updateData,mask,context.fieldTransforms)},UserDataConverter.prototype.parseUpdateVarargs=function(methodName,field,value,moreFieldsAndValues){var context=new ParseContext(UserDataSource.Update,methodName,FieldPath.EMPTY_PATH),keys=[fieldPathFromArgument(methodName,field)],values$$1=[value];if(0!=moreFieldsAndValues.length%2)throw new FirestoreError(Code.INVALID_ARGUMENT,"Function "+methodName+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var i=0;i<moreFieldsAndValues.length;i+=2)keys.push(fieldPathFromArgument(methodName,moreFieldsAndValues[i])),values$$1.push(moreFieldsAndValues[i+1]);for(var fieldMaskPaths=[],updateData=ObjectValue.EMPTY,i=0;i<keys.length;++i){var path=keys[i],childContext=context.childContextForFieldPath(path),value_1=this.runPreConverter(values$$1[i],childContext);if(value_1 instanceof DeleteFieldValueImpl)fieldMaskPaths.push(path);else{var parsedValue=this.parseData(value_1,childContext);null!=parsedValue&&(fieldMaskPaths.push(path),updateData=updateData.set(path,parsedValue))}}var mask=new FieldMask(fieldMaskPaths);return new ParsedUpdateData(updateData,mask,context.fieldTransforms)},UserDataConverter.prototype.parseQueryValue=function(methodName,input){var context=new ParseContext(UserDataSource.Argument,methodName,FieldPath.EMPTY_PATH),parsed=this.parseData(input,context);return assert(null!=parsed,"Parsed data should not be null."),assert(0===context.fieldTransforms.length,"Field transforms should have been disallowed."),parsed},UserDataConverter.prototype.runPreConverter=function(input,context){try{return this.preConverter(input)}catch(e){var message=errorMessage(e);throw context.createError(message)}},UserDataConverter.prototype.parseData=function(input,context){if(input=this.runPreConverter(input,context),looksLikeJsonObject(input))return validatePlainObject("Unsupported field value:",context,input),this.parseObject(input,context);if(input instanceof FieldValueImpl)return this.parseSentinelFieldValue(input,context),null;if(context.path&&context.fieldMask.push(context.path),input instanceof Array){if(context.arrayElement)throw context.createError("Nested arrays are not supported");return this.parseArray(input,context)}return this.parseScalarValue(input,context)},UserDataConverter.prototype.parseObject=function(obj,context){var _this=this,result=new SortedMap(primitiveComparator);return isEmpty(obj)?context.path&&0<context.path.length&&context.fieldMask.push(context.path):forEach(obj,function(key,val){var parsedValue=_this.parseData(val,context.childContextForField(key));null!=parsedValue&&(result=result.insert(key,parsedValue))}),new ObjectValue(result)},UserDataConverter.prototype.parseArray=function(array,context){for(var result=[],entryIndex=0,_i=0,array_1=array;_i<array_1.length;_i++){var entry=array_1[_i],parsedEntry=this.parseData(entry,context.childContextForArray(entryIndex));null==parsedEntry&&(parsedEntry=NullValue.INSTANCE),result.push(parsedEntry),entryIndex++}return new ArrayValue(result)},UserDataConverter.prototype.parseSentinelFieldValue=function(value,context){if(!isWrite(context.dataSource))throw context.createError(value._methodName+"() can only be used with update() and set()");if(null===context.path)throw context.createError(value._methodName+"() is not currently supported inside arrays");if(value instanceof DeleteFieldValueImpl){if(context.dataSource===UserDataSource.MergeSet)context.fieldMask.push(context.path);else if(context.dataSource===UserDataSource.Update)throw assert(0<context.path.length,"FieldValue.delete() at the top level should have already been handled."),context.createError("FieldValue.delete() can only appear at the top level of your update data");else throw context.createError("FieldValue.delete() cannot be used with set() unless you pass {merge:true}");}else if(value instanceof ServerTimestampFieldValueImpl)context.fieldTransforms.push(new FieldTransform(context.path,ServerTimestampTransform.instance));else if(value instanceof ArrayUnionFieldValueImpl){var parsedElements=this.parseArrayTransformElements(value._methodName,value._elements),arrayUnion=new ArrayUnionTransformOperation(parsedElements);context.fieldTransforms.push(new FieldTransform(context.path,arrayUnion))}else if(value instanceof ArrayRemoveFieldValueImpl){var parsedElements=this.parseArrayTransformElements(value._methodName,value._elements),arrayRemove=new ArrayRemoveTransformOperation(parsedElements);context.fieldTransforms.push(new FieldTransform(context.path,arrayRemove))}else fail("Unknown FieldValue type: "+value)},UserDataConverter.prototype.parseScalarValue=function(value,context){if(null===value)return NullValue.INSTANCE;if("number"==typeof value)return isSafeInteger(value)?new IntegerValue(value):new DoubleValue(value);if("boolean"==typeof value)return BooleanValue.of(value);if("string"==typeof value)return new StringValue(value);if(value instanceof Date)return new TimestampValue(Timestamp.fromDate(value));if(value instanceof Timestamp)return new TimestampValue(new Timestamp(value.seconds,1e3*_Mathfloor3(value.nanoseconds/1e3)));if(value instanceof GeoPoint)return new GeoPointValue(value);if(value instanceof Blob)return new BlobValue(value);if(value instanceof DocumentKeyReference)return new RefValue(value.databaseId,value.key);throw context.createError("Unsupported field value: "+valueDescription(value))},UserDataConverter.prototype.parseArrayTransformElements=function(methodName,elements){var _this=this;return elements.map(function(element,i){var context=new ParseContext(UserDataSource.Argument,methodName,FieldPath.EMPTY_PATH);return _this.parseData(element,context.childContextForArray(i))})},UserDataConverter}(),DEFAULT_SSL=!0,FirestoreSettings=function(){function FirestoreSettings(settings){if(void 0===settings.host){if(void 0!==settings.ssl)throw new FirestoreError(Code.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=DEFAULT_SSL}else validateNamedType("settings","non-empty string","host",settings.host),this.host=settings.host,validateNamedOptionalType("settings","boolean","ssl",settings.ssl),this.ssl=defaulted(settings.ssl,DEFAULT_SSL);validateOptionNames("settings",settings,["host","ssl","credentials","timestampsInSnapshots"]),validateNamedOptionalType("settings","object","credentials",settings.credentials),this.credentials=settings.credentials,validateNamedOptionalType("settings","boolean","timestampsInSnapshots",settings.timestampsInSnapshots),this.timestampsInSnapshots=defaulted(settings.timestampsInSnapshots,!1)}return FirestoreSettings.prototype.isEqual=function(other){return this.host===other.host&&this.ssl===other.ssl&&this.timestampsInSnapshots===other.timestampsInSnapshots&&this.credentials===other.credentials},FirestoreSettings}(),FirestoreConfig=function(){return function(){}}(),PersistenceSettings=function(){function PersistenceSettings(enabled,settings){this.enabled=enabled,assert(enabled||!settings,"Can only provide PersistenceSettings with persistence enabled"),settings=settings||{},this.experimentalTabSynchronization=defaulted(settings.experimentalTabSynchronization,!1)}return PersistenceSettings.prototype.isEqual=function(other){return this.enabled===other.enabled&&this.experimentalTabSynchronization===other.experimentalTabSynchronization},PersistenceSettings}(),Firestore=function(){function Firestore(databaseIdOrApp){var _this=this;this._queue=new AsyncQueue,this.INTERNAL={delete:function(options){return tslib_1.__awaiter(_this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return this._firestoreClient?[2,this._firestoreClient.shutdown(options)]:[2]})})}};var config=new FirestoreConfig;if("object"==typeof databaseIdOrApp.options){var app=databaseIdOrApp;config.firebaseApp=app,config.databaseId=Firestore.databaseIdFromApp(app),config.persistenceKey=config.firebaseApp.name,config.credentials=new FirebaseCredentialsProvider(app)}else{var external_1=databaseIdOrApp;if(!external_1.projectId)throw new FirestoreError(Code.INVALID_ARGUMENT,"Must provide projectId");config.databaseId=new DatabaseId(external_1.projectId,external_1.database),config.persistenceKey="[DEFAULT]",config.credentials=new EmptyCredentialsProvider}config.settings=new FirestoreSettings({}),this._config=config,this._databaseId=config.databaseId}return Firestore.prototype.settings=function(settingsLiteral){if(validateExactNumberOfArgs("Firestore.settings",arguments,1),validateArgType("Firestore.settings","object",1,settingsLiteral),contains(settingsLiteral,"persistence"))throw new FirestoreError(Code.INVALID_ARGUMENT,"\"persistence\" is now specified with a separate call to firestore.enablePersistence().");var newSettings=new FirestoreSettings(settingsLiteral);if(this._firestoreClient&&!this._config.settings.isEqual(newSettings))throw new FirestoreError(Code.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");this._config.settings=newSettings,void 0!==newSettings.credentials&&(this._config.credentials=makeCredentialsProvider(newSettings.credentials))},Firestore.prototype.enableNetwork=function(){return this.ensureClientConfigured(),this._firestoreClient.enableNetwork()},Firestore.prototype.disableNetwork=function(){return this.ensureClientConfigured(),this._firestoreClient.disableNetwork()},Firestore.prototype.enablePersistence=function(settings){if(this._firestoreClient)throw new FirestoreError(Code.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");return this.configureClient(new PersistenceSettings(!0,settings))},Firestore.prototype.ensureClientConfigured=function(){return this._firestoreClient||this.configureClient(new PersistenceSettings(!1)),this._firestoreClient},Firestore.prototype.configureClient=function(persistenceSettings){var _this=this;assert(!!this._config.settings.host,"FirestoreSettings.host cannot be falsey"),this._config.settings.timestampsInSnapshots||error("\nThe behavior for Date objects stored in Firestore is going to change\nAND YOUR APP MAY BREAK.\nTo hide this warning and ensure your app does not break, you need to add the\nfollowing code to your app before calling any other Cloud Firestore methods:\n\n const firestore = firebase.firestore();\n const settings = {/* your settings... */ timestampsInSnapshots: true};\n firestore.settings(settings);\n\nWith this change, timestamps stored in Cloud Firestore will be read back as\nFirebase Timestamp objects instead of as system Date objects. So you will also\nneed to update code expecting a Date to instead expect a Timestamp. For example:\n\n // Old:\n const date = snapshot.get('created_at');\n // New:\n const timestamp = snapshot.get('created_at');\n const date = timestamp.toDate();\n\nPlease audit all existing usages of Date when you enable the new behavior. In a\nfuture release, the behavior will change to the new behavior, so if you do not\nfollow these steps, YOUR APP MAY BREAK."),assert(!this._firestoreClient,"configureClient() called multiple times");var databaseInfo=new DatabaseInfo(this._config.databaseId,this._config.persistenceKey,this._config.settings.host,this._config.settings.ssl);return this._dataConverter=new UserDataConverter(function(value){if(value instanceof DocumentReference){var thisDb=_this._config.databaseId,otherDb=value.firestore._config.databaseId;if(!otherDb.isEqual(thisDb))throw new FirestoreError(Code.INVALID_ARGUMENT,"Document reference is for database "+(otherDb.projectId+"/"+otherDb.database+" but should be ")+("for database "+thisDb.projectId+"/"+thisDb.database));return new DocumentKeyReference(_this._config.databaseId,value._key)}return value}),this._firestoreClient=new FirestoreClient(PlatformSupport.getPlatform(),databaseInfo,this._config.credentials,this._queue),this._firestoreClient.start(persistenceSettings)},Firestore.databaseIdFromApp=function(app){var options=app.options;if(!contains(options,"projectId"))throw new FirestoreError(Code.INVALID_ARGUMENT,"\"projectId\" not provided in firebase.initializeApp.");var projectId=options.projectId;if(!projectId||"string"!=typeof projectId)throw new FirestoreError(Code.INVALID_ARGUMENT,"projectId must be a string in FirebaseApp.options");return new DatabaseId(projectId)},Object.defineProperty(Firestore.prototype,"app",{get:function(){if(!this._config.firebaseApp)throw new FirestoreError(Code.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._config.firebaseApp},enumerable:!0,configurable:!0}),Firestore.prototype.collection=function(pathString){if(validateExactNumberOfArgs("Firestore.collection",arguments,1),validateArgType("Firestore.collection","non-empty string",1,pathString),!pathString)throw new FirestoreError(Code.INVALID_ARGUMENT,"Must provide a non-empty collection path to collection()");return this.ensureClientConfigured(),new CollectionReference(ResourcePath.fromString(pathString),this)},Firestore.prototype.doc=function(pathString){if(validateExactNumberOfArgs("Firestore.doc",arguments,1),validateArgType("Firestore.doc","non-empty string",1,pathString),!pathString)throw new FirestoreError(Code.INVALID_ARGUMENT,"Must provide a non-empty document path to doc()");return this.ensureClientConfigured(),DocumentReference.forPath(ResourcePath.fromString(pathString),this)},Firestore.prototype.runTransaction=function(updateFunction){var _this=this;return validateExactNumberOfArgs("Firestore.runTransaction",arguments,1),validateArgType("Firestore.runTransaction","function",1,updateFunction),this.ensureClientConfigured().transaction(function(transaction){return updateFunction(new Transaction$1(_this,transaction))})},Firestore.prototype.batch=function(){return this.ensureClientConfigured(),new WriteBatch(this)},Object.defineProperty(Firestore,"logLevel",{get:function(){switch(getLogLevel()){case LogLevel.DEBUG:return"debug";case LogLevel.ERROR:return"error";case LogLevel.SILENT:return"silent";default:return fail("Unknown log level: "+getLogLevel());}},enumerable:!0,configurable:!0}),Firestore.setLogLevel=function(level){switch(validateExactNumberOfArgs("Firestore.setLogLevel",arguments,1),validateArgType("Firestore.setLogLevel","non-empty string",1,level),level){case"debug":setLogLevel(LogLevel.DEBUG);break;case"error":setLogLevel(LogLevel.ERROR);break;case"silent":setLogLevel(LogLevel.SILENT);break;default:throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid log level: "+level);}},Firestore.prototype._areTimestampsInSnapshotsEnabled=function(){return this._config.settings.timestampsInSnapshots},Firestore}(),Transaction$1=function(){function Transaction(_firestore,_transaction){this._firestore=_firestore,this._transaction=_transaction}return Transaction.prototype.get=function(documentRef){var _this=this;validateExactNumberOfArgs("Transaction.get",arguments,1);var ref=validateReference("Transaction.get",documentRef,this._firestore);return this._transaction.lookup([ref._key]).then(function(docs){if(!docs||1!==docs.length)return fail("Mismatch in docs returned from document lookup.");var doc=docs[0];if(doc instanceof NoDocument)return new DocumentSnapshot(_this._firestore,ref._key,null,!1,!1);if(doc instanceof Document)return new DocumentSnapshot(_this._firestore,ref._key,doc,!1,!1);throw fail("BatchGetDocumentsRequest returned unexpected document type: "+doc.constructor.name)})},Transaction.prototype.set=function(documentRef,value,options){validateBetweenNumberOfArgs("Transaction.set",arguments,2,3);var ref=validateReference("Transaction.set",documentRef,this._firestore);options=validateSetOptions("Transaction.set",options);var parsed=options.merge||options.mergeFields?this._firestore._dataConverter.parseMergeData("Transaction.set",value,options.mergeFields):this._firestore._dataConverter.parseSetData("Transaction.set",value);return this._transaction.set(ref._key,parsed),this},Transaction.prototype.update=function(documentRef,fieldOrUpdateData,value){for(var moreFieldsAndValues=[],_i=3;_i<arguments.length;_i++)moreFieldsAndValues[_i-3]=arguments[_i];var ref,parsed;return"string"==typeof fieldOrUpdateData||fieldOrUpdateData instanceof FieldPath$1?(validateAtLeastNumberOfArgs("Transaction.update",arguments,3),ref=validateReference("Transaction.update",documentRef,this._firestore),parsed=this._firestore._dataConverter.parseUpdateVarargs("Transaction.update",fieldOrUpdateData,value,moreFieldsAndValues)):(validateExactNumberOfArgs("Transaction.update",arguments,2),ref=validateReference("Transaction.update",documentRef,this._firestore),parsed=this._firestore._dataConverter.parseUpdateData("Transaction.update",fieldOrUpdateData)),this._transaction.update(ref._key,parsed),this},Transaction.prototype.delete=function(documentRef){validateExactNumberOfArgs("Transaction.delete",arguments,1);var ref=validateReference("Transaction.delete",documentRef,this._firestore);return this._transaction.delete(ref._key),this},Transaction}(),WriteBatch=function(){function WriteBatch(_firestore){this._firestore=_firestore,this._mutations=[],this._committed=!1}return WriteBatch.prototype.set=function(documentRef,value,options){validateBetweenNumberOfArgs("WriteBatch.set",arguments,2,3),this.verifyNotCommitted();var ref=validateReference("WriteBatch.set",documentRef,this._firestore);options=validateSetOptions("WriteBatch.set",options);var parsed=options.merge||options.mergeFields?this._firestore._dataConverter.parseMergeData("WriteBatch.set",value,options.mergeFields):this._firestore._dataConverter.parseSetData("WriteBatch.set",value);return this._mutations=this._mutations.concat(parsed.toMutations(ref._key,Precondition.NONE)),this},WriteBatch.prototype.update=function(documentRef,fieldOrUpdateData,value){for(var moreFieldsAndValues=[],_i=3;_i<arguments.length;_i++)moreFieldsAndValues[_i-3]=arguments[_i];this.verifyNotCommitted();var ref,parsed;return"string"==typeof fieldOrUpdateData||fieldOrUpdateData instanceof FieldPath$1?(validateAtLeastNumberOfArgs("WriteBatch.update",arguments,3),ref=validateReference("WriteBatch.update",documentRef,this._firestore),parsed=this._firestore._dataConverter.parseUpdateVarargs("WriteBatch.update",fieldOrUpdateData,value,moreFieldsAndValues)):(validateExactNumberOfArgs("WriteBatch.update",arguments,2),ref=validateReference("WriteBatch.update",documentRef,this._firestore),parsed=this._firestore._dataConverter.parseUpdateData("WriteBatch.update",fieldOrUpdateData)),this._mutations=this._mutations.concat(parsed.toMutations(ref._key,Precondition.exists(!0))),this},WriteBatch.prototype.delete=function(documentRef){validateExactNumberOfArgs("WriteBatch.delete",arguments,1),this.verifyNotCommitted();var ref=validateReference("WriteBatch.delete",documentRef,this._firestore);return this._mutations=this._mutations.concat(new DeleteMutation(ref._key,Precondition.NONE)),this},WriteBatch.prototype.commit=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(){return this.verifyNotCommitted(),this._committed=!0,0<this._mutations.length?[2,this._firestore.ensureClientConfigured().write(this._mutations)]:[2]})})},WriteBatch.prototype.verifyNotCommitted=function(){if(this._committed)throw new FirestoreError(Code.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},WriteBatch}(),DocumentReference=function(){function DocumentReference(_key,firestore){this._key=_key,this.firestore=firestore,this._firestoreClient=this.firestore.ensureClientConfigured()}return DocumentReference.forPath=function(path,firestore){if(0!=path.length%2)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+(path.canonicalString()+" has "+path.length));return new DocumentReference(new DocumentKey(path),firestore)},Object.defineProperty(DocumentReference.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(DocumentReference.prototype,"parent",{get:function(){return new CollectionReference(this._key.path.popLast(),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(DocumentReference.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!0,configurable:!0}),DocumentReference.prototype.collection=function(pathString){if(validateExactNumberOfArgs("DocumentReference.collection",arguments,1),validateArgType("DocumentReference.collection","non-empty string",1,pathString),!pathString)throw new FirestoreError(Code.INVALID_ARGUMENT,"Must provide a non-empty collection name to collection()");var path=ResourcePath.fromString(pathString);return new CollectionReference(this._key.path.child(path),this.firestore)},DocumentReference.prototype.isEqual=function(other){if(!(other instanceof DocumentReference))throw invalidClassError("isEqual","DocumentReference",1,other);return this.firestore===other.firestore&&this._key.isEqual(other._key)},DocumentReference.prototype.set=function(value,options){validateBetweenNumberOfArgs("DocumentReference.set",arguments,1,2),options=validateSetOptions("DocumentReference.set",options);var parsed=options.merge||options.mergeFields?this.firestore._dataConverter.parseMergeData("DocumentReference.set",value,options.mergeFields):this.firestore._dataConverter.parseSetData("DocumentReference.set",value);return this._firestoreClient.write(parsed.toMutations(this._key,Precondition.NONE))},DocumentReference.prototype.update=function(fieldOrUpdateData,value){for(var moreFieldsAndValues=[],_i=2;_i<arguments.length;_i++)moreFieldsAndValues[_i-2]=arguments[_i];var parsed;return"string"==typeof fieldOrUpdateData||fieldOrUpdateData instanceof FieldPath$1?(validateAtLeastNumberOfArgs("DocumentReference.update",arguments,2),parsed=this.firestore._dataConverter.parseUpdateVarargs("DocumentReference.update",fieldOrUpdateData,value,moreFieldsAndValues)):(validateExactNumberOfArgs("DocumentReference.update",arguments,1),parsed=this.firestore._dataConverter.parseUpdateData("DocumentReference.update",fieldOrUpdateData)),this._firestoreClient.write(parsed.toMutations(this._key,Precondition.exists(!0)))},DocumentReference.prototype.delete=function(){return validateExactNumberOfArgs("DocumentReference.delete",arguments,0),this._firestoreClient.write([new DeleteMutation(this._key,Precondition.NONE)])},DocumentReference.prototype.onSnapshot=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];validateBetweenNumberOfArgs("DocumentReference.onSnapshot",arguments,1,4);var options={includeMetadataChanges:!1},currArg=0,observer;"object"!=typeof args[currArg]||isPartialObserver(args[currArg])||(options=args[currArg],validateOptionNames("DocumentReference.onSnapshot",options,["includeMetadataChanges"]),validateNamedOptionalType("DocumentReference.onSnapshot","boolean","includeMetadataChanges",options.includeMetadataChanges),currArg++);var internalOptions={includeMetadataChanges:options.includeMetadataChanges};return isPartialObserver(args[currArg])?observer=args[currArg]:(validateArgType("DocumentReference.onSnapshot","function",currArg,args[currArg]),validateOptionalArgType("DocumentReference.onSnapshot","function",currArg+1,args[currArg+1]),validateOptionalArgType("DocumentReference.onSnapshot","function",currArg+2,args[currArg+2]),observer={next:args[currArg],error:args[currArg+1],complete:args[currArg+2]}),this.onSnapshotInternal(internalOptions,observer)},DocumentReference.prototype.onSnapshotInternal=function(options,observer){var _this=this,errHandler=function(err){console.error("Uncaught Error in onSnapshot:",err)};observer.error&&(errHandler=observer.error.bind(observer));var asyncObserver=new AsyncObserver({next:function(snapshot){if(observer.next){assert(1>=snapshot.docs.size,"Too many documents returned on a document query");var doc=snapshot.docs.get(_this._key);observer.next(new DocumentSnapshot(_this.firestore,_this._key,doc,snapshot.fromCache,snapshot.hasPendingWrites))}},error:errHandler}),internalListener=this._firestoreClient.listen(Query.atPath(this._key.path),asyncObserver,options);return function(){asyncObserver.mute(),_this._firestoreClient.unlisten(internalListener)}},DocumentReference.prototype.get=function(options){var _this=this;return validateBetweenNumberOfArgs("DocumentReference.get",arguments,0,1),validateGetOptions("DocumentReference.get",options),new Promise(function(resolve,reject){options&&"cache"===options.source?_this.firestore.ensureClientConfigured().getDocumentFromLocalCache(_this._key).then(function(doc){resolve(new DocumentSnapshot(_this.firestore,_this._key,doc,!0,!!(doc instanceof Document)&&doc.hasLocalMutations))},reject):_this.getViaSnapshotListener(resolve,reject,options)})},DocumentReference.prototype.getViaSnapshotListener=function(resolve,reject,options){var unlisten=this.onSnapshotInternal({includeMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(snap){unlisten(),!snap.exists&&snap.metadata.fromCache?reject(new FirestoreError(Code.UNAVAILABLE,"Failed to get document because the client is offline.")):snap.exists&&snap.metadata.fromCache&&options&&"server"===options.source?reject(new FirestoreError(Code.UNAVAILABLE,"Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to \"server\" to retrieve the cached document.)")):resolve(snap)},error:reject})},DocumentReference}(),SnapshotMetadata=function(){function SnapshotMetadata(hasPendingWrites,fromCache){this.hasPendingWrites=hasPendingWrites,this.fromCache=fromCache}return SnapshotMetadata.prototype.isEqual=function(other){return this.hasPendingWrites===other.hasPendingWrites&&this.fromCache===other.fromCache},SnapshotMetadata}(),DocumentSnapshot=function(){function DocumentSnapshot(_firestore,_key,_document,_fromCache,_hasPendingWrites){this._firestore=_firestore,this._key=_key,this._document=_document,this._fromCache=_fromCache,this._hasPendingWrites=_hasPendingWrites}return DocumentSnapshot.prototype.data=function(options){return validateBetweenNumberOfArgs("DocumentSnapshot.data",arguments,0,1),options=validateSnapshotOptions("DocumentSnapshot.data",options),this._document?this.convertObject(this._document.data,FieldValueOptions.fromSnapshotOptions(options,this._firestore._areTimestampsInSnapshotsEnabled())):void 0},DocumentSnapshot.prototype.get=function(fieldPath,options){if(validateBetweenNumberOfArgs("DocumentSnapshot.get",arguments,1,2),options=validateSnapshotOptions("DocumentSnapshot.get",options),this._document){var value=this._document.data.field(fieldPathFromArgument("DocumentSnapshot.get",fieldPath));if(void 0!==value)return this.convertValue(value,FieldValueOptions.fromSnapshotOptions(options,this._firestore._areTimestampsInSnapshotsEnabled()))}},Object.defineProperty(DocumentSnapshot.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(DocumentSnapshot.prototype,"ref",{get:function(){return new DocumentReference(this._key,this._firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(DocumentSnapshot.prototype,"exists",{get:function(){return null!==this._document},enumerable:!0,configurable:!0}),Object.defineProperty(DocumentSnapshot.prototype,"metadata",{get:function(){return new SnapshotMetadata(this._hasPendingWrites,this._fromCache)},enumerable:!0,configurable:!0}),DocumentSnapshot.prototype.isEqual=function(other){if(!(other instanceof DocumentSnapshot))throw invalidClassError("isEqual","DocumentSnapshot",1,other);return this._firestore===other._firestore&&this._fromCache===other._fromCache&&this._key.isEqual(other._key)&&(null===this._document?null===other._document:this._document.isEqual(other._document))},DocumentSnapshot.prototype.convertObject=function(data,options){var _this=this,result={};return data.forEach(function(key,value){result[key]=_this.convertValue(value,options)}),result},DocumentSnapshot.prototype.convertValue=function(value,options){if(value instanceof ObjectValue)return this.convertObject(value,options);if(value instanceof ArrayValue)return this.convertArray(value,options);if(value instanceof RefValue){var key=value.value(options),database=this._firestore.ensureClientConfigured().databaseId();return value.databaseId.isEqual(database)||error("Document "+this._key.path+" contains a document reference within a different database ("+(value.databaseId.projectId+"/"+value.databaseId.database+") which is not supported. It will be treated as a reference in the current ")+("database ("+database.projectId+"/"+database.database+") instead.")),new DocumentReference(key,this._firestore)}return value.value(options)},DocumentSnapshot.prototype.convertArray=function(data,options){var _this=this;return data.internalValue.map(function(value){return _this.convertValue(value,options)})},DocumentSnapshot}(),QueryDocumentSnapshot=function(_super){function QueryDocumentSnapshot(firestore,key,document,fromCache,hasPendingWrites){return _super.call(this,firestore,key,document,fromCache,hasPendingWrites)||this}return tslib_1.__extends(QueryDocumentSnapshot,_super),QueryDocumentSnapshot.prototype.data=function(options){var data=_super.prototype.data.call(this,options);return assert("object"==typeof data,"Document in a QueryDocumentSnapshot should exist"),data},QueryDocumentSnapshot}(DocumentSnapshot),Query$1=function(){function Query$$1(_query,firestore){this._query=_query,this.firestore=firestore}return Query$$1.prototype.where=function(field,opStr,value){validateExactNumberOfArgs("Query.where",arguments,3),validateArgType("Query.where","non-empty string",2,opStr),validateDefined("Query.where",3,value);var fieldPath=fieldPathFromArgument("Query.where",field),relationOp=RelationOp.fromString(opStr),fieldValue;if(fieldPath.isKeyField()){if(relationOp===RelationOp.ARRAY_CONTAINS)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid Query. You can't perform array-contains queries on FieldPath.documentId() since document IDs are not arrays.");if("string"==typeof value){if(-1!==value.indexOf("/"))throw new FirestoreError(Code.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(""===value)throw new FirestoreError(Code.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 path=this._query.path.child(new ResourcePath([value]));assert(0==path.length%2,"Path should be a document key"),fieldValue=new RefValue(this.firestore._databaseId,new DocumentKey(path))}else if(value instanceof DocumentReference){fieldValue=new RefValue(this.firestore._databaseId,value._key)}else throw new FirestoreError(Code.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: "+(valueDescription(value)+"."))}else fieldValue=this.firestore._dataConverter.parseQueryValue("Query.where",value);var filter=Filter.create(fieldPath,relationOp,fieldValue);return this.validateNewFilter(filter),new Query$$1(this._query.addFilter(filter),this.firestore)},Query$$1.prototype.orderBy=function(field,directionStr){validateBetweenNumberOfArgs("Query.orderBy",arguments,1,2),validateOptionalArgType("Query.orderBy","non-empty string",2,directionStr);var direction;if(void 0===directionStr||"asc"===directionStr)direction=Direction.ASCENDING;else if("desc"===directionStr)direction=Direction.DESCENDING;else throw new FirestoreError(Code.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+directionStr+"', expected 'asc' or 'desc'.");if(null!==this._query.startAt)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");if(null!==this._query.endAt)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");var fieldPath=fieldPathFromArgument("Query.orderBy",field),orderBy=new OrderBy(fieldPath,direction);return this.validateNewOrderBy(orderBy),new Query$$1(this._query.addOrderBy(orderBy),this.firestore)},Query$$1.prototype.limit=function(n){if(validateExactNumberOfArgs("Query.limit",arguments,1),validateArgType("Query.limit","number",1,n),0>=n)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid Query. Query limit ("+n+") is invalid. Limit must be positive.");return new Query$$1(this._query.withLimit(n),this.firestore)},Query$$1.prototype.startAt=function(docOrField){for(var fields=[],_i=1;_i<arguments.length;_i++)fields[_i-1]=arguments[_i];validateAtLeastNumberOfArgs("Query.startAt",arguments,1);var bound=this.boundFromDocOrFields("Query.startAt",docOrField,fields,!0);return new Query$$1(this._query.withStartAt(bound),this.firestore)},Query$$1.prototype.startAfter=function(docOrField){for(var fields=[],_i=1;_i<arguments.length;_i++)fields[_i-1]=arguments[_i];validateAtLeastNumberOfArgs("Query.startAfter",arguments,1);var bound=this.boundFromDocOrFields("Query.startAfter",docOrField,fields,!1);return new Query$$1(this._query.withStartAt(bound),this.firestore)},Query$$1.prototype.endBefore=function(docOrField){for(var fields=[],_i=1;_i<arguments.length;_i++)fields[_i-1]=arguments[_i];validateAtLeastNumberOfArgs("Query.endBefore",arguments,1);var bound=this.boundFromDocOrFields("Query.endBefore",docOrField,fields,!0);return new Query$$1(this._query.withEndAt(bound),this.firestore)},Query$$1.prototype.endAt=function(docOrField){for(var fields=[],_i=1;_i<arguments.length;_i++)fields[_i-1]=arguments[_i];validateAtLeastNumberOfArgs("Query.endAt",arguments,1);var bound=this.boundFromDocOrFields("Query.endAt",docOrField,fields,!1);return new Query$$1(this._query.withEndAt(bound),this.firestore)},Query$$1.prototype.isEqual=function(other){if(!(other instanceof Query$$1))throw invalidClassError("isEqual","Query",1,other);return this.firestore===other.firestore&&this._query.isEqual(other._query)},Query$$1.prototype.boundFromDocOrFields=function(methodName,docOrField,fields,before){if(validateDefined(methodName,1,docOrField),docOrField instanceof DocumentSnapshot){if(0<fields.length)throw new FirestoreError(Code.INVALID_ARGUMENT,"Too many arguments provided to "+methodName+"().");var snap=docOrField;if(!snap.exists)throw new FirestoreError(Code.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+(methodName+"()."));return this.boundFromDocument(methodName,snap._document,before)}var allFields=[docOrField].concat(fields);return this.boundFromFields(methodName,allFields,before)},Query$$1.prototype.boundFromDocument=function(methodName,doc,before){for(var components=[],_i=0,_a=this._query.orderBy,orderBy;_i<_a.length;_i++)if(orderBy=_a[_i],orderBy.field.isKeyField())components.push(new RefValue(this.firestore._databaseId,doc.key));else{var value=doc.field(orderBy.field);if(void 0!==value)components.push(value);else{var field=orderBy.field.canonicalString();throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+field+"' (used as the orderBy) does not exist.")}}return new Bound(components,before)},Query$$1.prototype.boundFromFields=function(methodName,values$$1,before){var orderBy=this._query.explicitOrderBy;if(values$$1.length>orderBy.length)throw new FirestoreError(Code.INVALID_ARGUMENT,"Too many arguments provided to "+methodName+"(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");for(var components=[],i=0;i<values$$1.length;i++){var rawValue=values$$1[i],orderByComponent=orderBy[i];if(orderByComponent.field.isKeyField()){if("string"!=typeof rawValue)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+(methodName+"(), but got a "+typeof rawValue));if(-1!==rawValue.indexOf("/"))throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid query. Document ID '"+rawValue+"' contains a slash in "+(methodName+"()"));var key=new DocumentKey(this._query.path.child(rawValue));components.push(new RefValue(this.firestore._databaseId,key))}else{var wrapped=this.firestore._dataConverter.parseQueryValue(methodName,rawValue);components.push(wrapped)}}return new Bound(components,before)},Query$$1.prototype.onSnapshot=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];validateBetweenNumberOfArgs("Query.onSnapshot",arguments,1,4);var options={},currArg=0,observer;return"object"!=typeof args[currArg]||isPartialObserver(args[currArg])||(options=args[currArg],validateOptionNames("Query.onSnapshot",options,["includeMetadataChanges"]),validateNamedOptionalType("Query.onSnapshot","boolean","includeMetadataChanges",options.includeMetadataChanges),currArg++),isPartialObserver(args[currArg])?observer=args[currArg]:(validateArgType("Query.onSnapshot","function",currArg,args[currArg]),validateOptionalArgType("Query.onSnapshot","function",currArg+1,args[currArg+1]),validateOptionalArgType("Query.onSnapshot","function",currArg+2,args[currArg+2]),observer={next:args[currArg],error:args[currArg+1],complete:args[currArg+2]}),this.onSnapshotInternal(options,observer)},Query$$1.prototype.onSnapshotInternal=function(options,observer){var _this=this,errHandler=function(err){console.error("Uncaught Error in onSnapshot:",err)};observer.error&&(errHandler=observer.error.bind(observer));var asyncObserver=new AsyncObserver({next:function(result){observer.next&&observer.next(new QuerySnapshot(_this.firestore,_this._query,result))},error:errHandler}),firestoreClient=this.firestore.ensureClientConfigured(),internalListener=firestoreClient.listen(this._query,asyncObserver,options);return function(){asyncObserver.mute(),firestoreClient.unlisten(internalListener)}},Query$$1.prototype.get=function(options){var _this=this;return validateBetweenNumberOfArgs("Query.get",arguments,0,1),validateGetOptions("Query.get",options),new Promise(function(resolve,reject){options&&"cache"===options.source?_this.firestore.ensureClientConfigured().getDocumentsFromLocalCache(_this._query).then(function(viewSnap){resolve(new QuerySnapshot(_this.firestore,_this._query,viewSnap))},reject):_this.getViaSnapshotListener(resolve,reject,options)})},Query$$1.prototype.getViaSnapshotListener=function(resolve,reject,options){var unlisten=this.onSnapshotInternal({includeMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(result){unlisten(),result.metadata.fromCache&&options&&"server"===options.source?reject(new FirestoreError(Code.UNAVAILABLE,"Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to \"server\" to retrieve the cached documents.)")):resolve(result)},error:reject})},Query$$1.prototype.validateNewFilter=function(filter){if(filter instanceof RelationFilter)if(filter.isInequality()){var existingField=this._query.getInequalityFilterField();if(null!==existingField&&!existingField.isEqual(filter.field))throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+existingField.toString()+"'"+(" and '"+filter.field.toString()+"'"));var firstOrderByField=this._query.getFirstOrderByField();null!==firstOrderByField&&this.validateOrderByAndInequalityMatch(filter.field,firstOrderByField)}else if(filter.op===RelationOp.ARRAY_CONTAINS&&this._query.hasArrayContainsFilter())throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid query. Queries only support a single array-contains filter.")},Query$$1.prototype.validateNewOrderBy=function(orderBy){if(null===this._query.getFirstOrderByField()){var inequalityField=this._query.getInequalityFilterField();null!==inequalityField&&this.validateOrderByAndInequalityMatch(inequalityField,orderBy.field)}},Query$$1.prototype.validateOrderByAndInequalityMatch=function(inequality,orderBy){if(!orderBy.isEqual(inequality))throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+inequality.toString()+"' "+("and so you must also use '"+inequality.toString()+"' as your first Query.orderBy(), but your first Query.orderBy() ")+("is on field '"+orderBy.toString()+"' instead."))},Query$$1}(),QuerySnapshot=function(){function QuerySnapshot(_firestore,_originalQuery,_snapshot){this._firestore=_firestore,this._originalQuery=_originalQuery,this._snapshot=_snapshot,this._cachedChanges=null,this._cachedChangesIncludeMetadataChanges=null,this.metadata=new SnapshotMetadata(_snapshot.hasPendingWrites,_snapshot.fromCache)}return Object.defineProperty(QuerySnapshot.prototype,"docs",{get:function(){var result=[];return this.forEach(function(doc){return result.push(doc)}),result},enumerable:!0,configurable:!0}),Object.defineProperty(QuerySnapshot.prototype,"empty",{get:function(){return this._snapshot.docs.isEmpty()},enumerable:!0,configurable:!0}),Object.defineProperty(QuerySnapshot.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!0,configurable:!0}),QuerySnapshot.prototype.forEach=function(callback,thisArg){var _this=this;validateBetweenNumberOfArgs("QuerySnapshot.forEach",arguments,1,2),validateArgType("QuerySnapshot.forEach","function",1,callback),this._snapshot.docs.forEach(function(doc){callback.call(thisArg,_this.convertToDocumentImpl(doc))})},Object.defineProperty(QuerySnapshot.prototype,"query",{get:function(){return new Query$1(this._originalQuery,this._firestore)},enumerable:!0,configurable:!0}),QuerySnapshot.prototype.docChanges=function(options){options&&(validateOptionNames("QuerySnapshot.docChanges",options,["includeMetadataChanges"]),validateNamedOptionalType("QuerySnapshot.docChanges","boolean","includeMetadataChanges",options.includeMetadataChanges));var includeMetadataChanges=!!(options&&options.includeMetadataChanges);if(includeMetadataChanges&&this._snapshot.excludesMetadataChanges)throw new FirestoreError(Code.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===includeMetadataChanges||(this._cachedChanges=changesFromSnapshot(this._firestore,includeMetadataChanges,this._snapshot),this._cachedChangesIncludeMetadataChanges=includeMetadataChanges),this._cachedChanges},QuerySnapshot.prototype.isEqual=function(other){if(!(other instanceof QuerySnapshot))throw invalidClassError("isEqual","QuerySnapshot",1,other);return this._firestore===other._firestore&&this._originalQuery.isEqual(other._originalQuery)&&this._snapshot.isEqual(other._snapshot)},QuerySnapshot.prototype.convertToDocumentImpl=function(doc){return new QueryDocumentSnapshot(this._firestore,doc.key,doc,this.metadata.fromCache,this._snapshot.mutatedKeys.has(doc.key))},QuerySnapshot}(),docChangesPropertiesToOverride=["length","forEach","map"].concat("undefined"==typeof Symbol?[]:[Symbol.iterator]);docChangesPropertiesToOverride.forEach(function(property){try{Object.defineProperty(QuerySnapshot.prototype.docChanges,property,{get:function(){return throwDocChangesMethodError()}})}catch(err){}});var CollectionReference=function(_super){function CollectionReference(path,firestore){var _this=_super.call(this,Query.atPath(path),firestore)||this;if(1!=path.length%2)throw new FirestoreError(Code.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+(path.canonicalString()+" has "+path.length));return _this}return tslib_1.__extends(CollectionReference,_super),Object.defineProperty(CollectionReference.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(CollectionReference.prototype,"parent",{get:function(){var parentPath=this._query.path.popLast();return parentPath.isEmpty()?null:new DocumentReference(new DocumentKey(parentPath),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(CollectionReference.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!0,configurable:!0}),CollectionReference.prototype.doc=function(pathString){if(validateBetweenNumberOfArgs("CollectionReference.doc",arguments,0,1),0===arguments.length&&(pathString=AutoId.newId()),validateArgType("CollectionReference.doc","non-empty string",1,pathString),""===pathString)throw new FirestoreError(Code.INVALID_ARGUMENT,"Document path must be a non-empty string");var path=ResourcePath.fromString(pathString);return DocumentReference.forPath(this._query.path.child(path),this.firestore)},CollectionReference.prototype.add=function(value){validateExactNumberOfArgs("CollectionReference.add",arguments,1),validateArgType("CollectionReference.add","object",1,value);var docRef=this.doc();return docRef.set(value).then(function(){return docRef})},CollectionReference}(Query$1),PublicFirestore=makeConstructorPrivate(Firestore,"Use firebase.firestore() instead."),PublicTransaction=makeConstructorPrivate(Transaction$1,"Use firebase.firestore().runTransaction() instead."),PublicWriteBatch=makeConstructorPrivate(WriteBatch,"Use firebase.firestore().batch() instead."),PublicDocumentReference=makeConstructorPrivate(DocumentReference,"Use firebase.firestore().doc() instead."),PublicDocumentSnapshot=makeConstructorPrivate(DocumentSnapshot),PublicQueryDocumentSnapshot=makeConstructorPrivate(QueryDocumentSnapshot),PublicQuery=makeConstructorPrivate(Query$1),PublicQuerySnapshot=makeConstructorPrivate(QuerySnapshot),PublicCollectionReference=makeConstructorPrivate(CollectionReference,"Use firebase.firestore().collection() instead."),firestoreNamespace={Firestore:PublicFirestore,GeoPoint:GeoPoint,Timestamp:Timestamp,Blob:PublicBlob,Transaction:PublicTransaction,WriteBatch:PublicWriteBatch,DocumentReference:PublicDocumentReference,DocumentSnapshot:PublicDocumentSnapshot,Query:PublicQuery,QueryDocumentSnapshot:PublicQueryDocumentSnapshot,QuerySnapshot:PublicQuerySnapshot,CollectionReference:PublicCollectionReference,FieldPath:FieldPath$1,FieldValue:PublicFieldValue,setLogLevel:Firestore.setLogLevel};registerFirestore(firebase),exports.registerFirestore=registerFirestore},"ew/s":function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"),__webpack_require__("4e7A"))})(function(CodeMirror){function dialog(cm,text,shortText,deflt,f){cm.openDialog?cm.openDialog(text,f,{value:deflt,selectValueOnOpen:!0}):f(prompt(shortText,deflt))}function interpretLine(cm,string){var num=+string;return /^[-+]/.test(string)?cm.getCursor().line+num:num-1}CodeMirror.commands.jumpToLine=function(cm){var cur=cm.getCursor();dialog(cm,"Jump to line: <input type=\"text\" style=\"width: 10em\" class=\"CodeMirror-search-field\"/> <span style=\"color: #888\" class=\"CodeMirror-search-hint\">(Use line:column or scroll% syntax)</span>","Jump to line:",cur.line+1+":"+cur.ch,function(posStr){if(posStr){var match;if(match=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr))cm.setCursor(interpretLine(cm,match[1]),+match[2]);else if(match=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr)){var line=Math.round(cm.lineCount()*+match[1]/100);/^[-+]/.test(match[1])&&(line=cur.line+line+1),cm.setCursor(line-1,cur.ch)}else(match=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr))&&cm.setCursor(interpretLine(cm,match[1]),cur.ch)}})},CodeMirror.keyMap["default"]["Alt-G"]="jumpToLine"})},f4vO:function(module,exports,__webpack_require__){"use strict";var assign=__webpack_require__("tbG5").assign,deflate=__webpack_require__("nFS2"),inflate=__webpack_require__("faQk"),constants=__webpack_require__("xUUw"),pako={};assign(pako,deflate,inflate,constants),module.exports=pako},fOjT:function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__("fnRj")},faQk:function(module,exports,__webpack_require__){"use strict";function Inflate(options){if(!(this instanceof Inflate))return new Inflate(options);this.options=utils.assign({chunkSize:16384,windowBits:0,to:""},options||{});var opt=this.options;opt.raw&&0<=opt.windowBits&&16>opt.windowBits&&(opt.windowBits=-opt.windowBits,0===opt.windowBits&&(opt.windowBits=-15)),0<=opt.windowBits&&16>opt.windowBits&&!(options&&options.windowBits)&&(opt.windowBits+=32),15<opt.windowBits&&48>opt.windowBits&&0==(15&opt.windowBits)&&(opt.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ZStream,this.strm.avail_out=0;var status=zlib_inflate.inflateInit2(this.strm,opt.windowBits);if(status!==c.Z_OK)throw new Error(msg[status]);this.header=new GZheader,zlib_inflate.inflateGetHeader(this.strm,this.header)}function inflate(input,options){var inflator=new Inflate(options);if(inflator.push(input,!0),inflator.err)throw inflator.msg||msg[inflator.err];return inflator.result}var zlib_inflate=__webpack_require__("GIDK"),utils=__webpack_require__("tbG5"),strings=__webpack_require__("34Q3"),c=__webpack_require__("xUUw"),msg=__webpack_require__("gMAY"),ZStream=__webpack_require__("bdtv"),GZheader=__webpack_require__("/+WI"),toString=Object.prototype.toString;Inflate.prototype.push=function(data,mode){var strm=this.strm,chunkSize=this.options.chunkSize,dictionary=this.options.dictionary,allowBufError=!1,status,_mode,next_out_utf8,tail,utf8str,dict;if(this.ended)return!1;_mode=mode===~~mode?mode:!0===mode?c.Z_FINISH:c.Z_NO_FLUSH,strm.input="string"==typeof data?strings.binstring2buf(data):"[object ArrayBuffer]"===toString.call(data)?new Uint8Array(data):data,strm.next_in=0,strm.avail_in=strm.input.length;do{if(0===strm.avail_out&&(strm.output=new utils.Buf8(chunkSize),strm.next_out=0,strm.avail_out=chunkSize),status=zlib_inflate.inflate(strm,c.Z_NO_FLUSH),status===c.Z_NEED_DICT&&dictionary&&(dict="string"==typeof dictionary?strings.string2buf(dictionary):"[object ArrayBuffer]"===toString.call(dictionary)?new Uint8Array(dictionary):dictionary,status=zlib_inflate.inflateSetDictionary(this.strm,dict)),status===c.Z_BUF_ERROR&&!0==allowBufError&&(status=c.Z_OK,allowBufError=!1),status!==c.Z_STREAM_END&&status!==c.Z_OK)return this.onEnd(status),this.ended=!0,!1;strm.next_out&&(0===strm.avail_out||status===c.Z_STREAM_END||0===strm.avail_in&&(_mode===c.Z_FINISH||_mode===c.Z_SYNC_FLUSH))&&("string"===this.options.to?(next_out_utf8=strings.utf8border(strm.output,strm.next_out),tail=strm.next_out-next_out_utf8,utf8str=strings.buf2string(strm.output,next_out_utf8),strm.next_out=tail,strm.avail_out=chunkSize-tail,tail&&utils.arraySet(strm.output,strm.output,next_out_utf8,tail,0),this.onData(utf8str)):this.onData(utils.shrinkBuf(strm.output,strm.next_out))),0===strm.avail_in&&0===strm.avail_out&&(allowBufError=!0)}while((0<strm.avail_in||0===strm.avail_out)&&status!==c.Z_STREAM_END);return status===c.Z_STREAM_END&&(_mode=c.Z_FINISH),_mode===c.Z_FINISH?(status=zlib_inflate.inflateEnd(this.strm),this.onEnd(status),this.ended=!0,status===c.Z_OK):_mode!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),strm.avail_out=0,!0)},Inflate.prototype.onData=function(chunk){this.chunks.push(chunk)},Inflate.prototype.onEnd=function(status){status===c.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=utils.flattenChunks(this.chunks)),this.chunks=[],this.err=status,this.msg=this.strm.msg},exports.Inflate=Inflate,exports.inflate=inflate,exports.inflateRaw=function(input,options){return options=options||{},options.raw=!0,inflate(input,options)},exports.ungzip=inflate},fnRj:function(module,exports,__webpack_require__){"use strict";function Stream(){EE.call(this)}module.exports=Stream;var EE=__webpack_require__("FRpO").EventEmitter,inherits=__webpack_require__("4Bm0");inherits(Stream,EE),Stream.Readable=__webpack_require__("tzeh"),Stream.Writable=__webpack_require__("LnjZ"),Stream.Duplex=__webpack_require__("kT1X"),Stream.Transform=__webpack_require__("A9/K"),Stream.PassThrough=__webpack_require__("C6nS"),Stream.Stream=Stream,Stream.prototype.pipe=function(dest,options){function ondata(chunk){dest.writable&&!1===dest.write(chunk)&&source.pause&&source.pause()}function ondrain(){source.readable&&source.resume&&source.resume()}function onend(){didOnEnd||(didOnEnd=!0,dest.end())}function onclose(){didOnEnd||(didOnEnd=!0,"function"==typeof dest.destroy&&dest.destroy())}function onerror(er){if(cleanup(),0===EE.listenerCount(this,"error"))throw er}function cleanup(){source.removeListener("data",ondata),dest.removeListener("drain",ondrain),source.removeListener("end",onend),source.removeListener("close",onclose),source.removeListener("error",onerror),dest.removeListener("error",onerror),source.removeListener("end",cleanup),source.removeListener("close",cleanup),dest.removeListener("close",cleanup)}var source=this;source.on("data",ondata),dest.on("drain",ondrain),dest._isStdio||options&&!1===options.end||(source.on("end",onend),source.on("close",onclose));var didOnEnd=!1;return source.on("error",onerror),dest.on("error",onerror),source.on("end",cleanup),source.on("close",cleanup),dest.on("close",cleanup),dest.emit("pipe",source),dest}},gMAY:function(module){"use strict";module.exports={0:"",1:"stream end",2:"need dictionary","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},gPKv:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){function clearActiveLines(cm){for(var i=0;i<cm.state.activeLines.length;i++)cm.removeLineClass(cm.state.activeLines[i],"wrap",WRAP_CLASS),cm.removeLineClass(cm.state.activeLines[i],"background",BACK_CLASS),cm.removeLineClass(cm.state.activeLines[i],"gutter",GUTT_CLASS)}function sameArray(a,b){if(a.length!=b.length)return!1;for(var i=0;i<a.length;i++)if(a[i]!=b[i])return!1;return!0}function updateActiveLines(cm,ranges){for(var active=[],i=0;i<ranges.length;i++){var range=ranges[i],option=cm.getOption("styleActiveLine");if("object"==typeof option&&option.nonEmpty?range.anchor.line==range.head.line:!!range.empty()){var line=cm.getLineHandleVisualStart(range.head.line);active[active.length-1]!=line&&active.push(line)}}sameArray(cm.state.activeLines,active)||cm.operation(function(){clearActiveLines(cm);for(var i=0;i<active.length;i++)cm.addLineClass(active[i],"wrap",WRAP_CLASS),cm.addLineClass(active[i],"background",BACK_CLASS),cm.addLineClass(active[i],"gutter",GUTT_CLASS);cm.state.activeLines=active})}function selectionChange(cm,sel){updateActiveLines(cm,sel.ranges)}var WRAP_CLASS="CodeMirror-activeline",BACK_CLASS="CodeMirror-activeline-background",GUTT_CLASS="CodeMirror-activeline-gutter";CodeMirror.defineOption("styleActiveLine",!1,function(cm,val,old){var prev=old!=CodeMirror.Init&&old;val==prev||(prev&&(cm.off("beforeSelectionChange",selectionChange),clearActiveLines(cm),delete cm.state.activeLines),val&&(cm.state.activeLines=[],updateActiveLines(cm,cm.listSelections()),cm.on("beforeSelectionChange",selectionChange)))})})},"geN+":function(module,exports,__webpack_require__){"use strict";var StreamHelper=__webpack_require__("2P9T"),DataWorker=__webpack_require__("ABU1"),utf8=__webpack_require__("Sm7/"),CompressedObject=__webpack_require__("PO9O"),GenericWorker=__webpack_require__("ZKdc"),ZipObject=function(name,data,options){this.name=name,this.dir=options.dir,this.date=options.date,this.comment=options.comment,this.unixPermissions=options.unixPermissions,this.dosPermissions=options.dosPermissions,this._data=data,this._dataBinary=options.binary,this.options={compression:options.compression,compressionOptions:options.compressionOptions}};ZipObject.prototype={internalStream:function(type){var result=null,outputType="string";try{if(!type)throw new Error("No output type specified.");outputType=type.toLowerCase();var askUnicodeString="string"===outputType||"text"===outputType;("binarystring"===outputType||"text"===outputType)&&(outputType="string"),result=this._decompressWorker();var isUnicodeString=!this._dataBinary;isUnicodeString&&!askUnicodeString&&(result=result.pipe(new utf8.Utf8EncodeWorker)),!isUnicodeString&&askUnicodeString&&(result=result.pipe(new utf8.Utf8DecodeWorker))}catch(e){result=new GenericWorker("error"),result.error(e)}return new StreamHelper(result,outputType,"")},async:function(type,onUpdate){return this.internalStream(type).accumulate(onUpdate)},nodeStream:function(type,onUpdate){return this.internalStream(type||"nodebuffer").toNodejsStream(onUpdate)},_compressWorker:function(compression,compressionOptions){if(this._data instanceof CompressedObject&&this._data.compression.magic===compression.magic)return this._data.getCompressedWorker();var result=this._decompressWorker();return this._dataBinary||(result=result.pipe(new utf8.Utf8EncodeWorker)),CompressedObject.createWorkerFrom(result,compression,compressionOptions)},_decompressWorker:function(){return this._data instanceof CompressedObject?this._data.getContentWorker():this._data instanceof GenericWorker?this._data:new DataWorker(this._data)}};for(var removedMethods=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],removedFn=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},i=0;i<removedMethods.length;i++)ZipObject.prototype[removedMethods[i]]=removedFn;module.exports=ZipObject},gfUn:function(module,exports,__webpack_require__){"use strict";(function(global){function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};return 3<=arguments.length&&(ctx.depth=arguments[2]),4<=arguments.length&&(ctx.colors=arguments[3]),isBoolean(opts)?ctx.showHidden=opts:opts&&exports._extend(ctx,opts),isUndefined(ctx.showHidden)&&(ctx.showHidden=!1),isUndefined(ctx.depth)&&(ctx.depth=2),isUndefined(ctx.colors)&&(ctx.colors=!1),isUndefined(ctx.customInspect)&&(ctx.customInspect=!0),ctx.colors&&(ctx.stylize=stylizeWithColor),formatValue(ctx,obj,ctx.depth)}function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];return style?"\x1B["+inspect.colors[style][0]+"m"+str+"\x1B["+inspect.colors[style][1]+"m":str}function stylizeNoColor(str){return str}function arrayToHash(array){var hash={};return array.forEach(function(val){hash[val]=!0}),hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);return isString(ret)||(ret=formatValue(ctx,ret,recurseTimes)),ret}var primitive=formatPrimitive(ctx,value);if(primitive)return primitive;var keys=Object.keys(value),visibleKeys=arrayToHash(keys);if(ctx.showHidden&&(keys=Object.getOwnPropertyNames(value)),isError(value)&&(0<=keys.indexOf("message")||0<=keys.indexOf("description")))return formatError(value);if(0===keys.length){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value))return ctx.stylize(RegExp.prototype.toString.call(value),"regexp");if(isDate(value))return ctx.stylize(Date.prototype.toString.call(value),"date");if(isError(value))return formatError(value)}var base="",array=!1,braces=["{","}"];if(isArray(value)&&(array=!0,braces=["[","]"]),isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)&&(base=" "+RegExp.prototype.toString.call(value)),isDate(value)&&(base=" "+Date.prototype.toUTCString.call(value)),isError(value)&&(base=" "+formatError(value)),0===keys.length&&(!array||0==value.length))return braces[0]+base+braces[1];if(0>recurseTimes)return isRegExp(value)?ctx.stylize(RegExp.prototype.toString.call(value),"regexp"):ctx.stylize("[Object]","special");ctx.seen.push(value);var output;return output=array?formatArray(ctx,value,recurseTimes,visibleKeys,keys):keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}),ctx.seen.pop(),reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,"\"")+"'";return ctx.stylize(simple,"string")}return isNumber(value)?ctx.stylize(""+value,"number"):isBoolean(value)?ctx.stylize(""+value,"boolean"):isNull(value)?ctx.stylize("null","null"):void 0}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){for(var output=[],i=0,l=value.length;i<l;++i)hasOwnProperty(value,i+"")?output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,i+"",!0)):output.push("");return keys.forEach(function(key){key.match(/^\d+$/)||output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,!0))}),output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;if(desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]},desc.get?desc.set?str=ctx.stylize("[Getter/Setter]","special"):str=ctx.stylize("[Getter]","special"):desc.set&&(str=ctx.stylize("[Setter]","special")),hasOwnProperty(visibleKeys,key)||(name="["+key+"]"),str||(0>ctx.seen.indexOf(desc.value)?(str=isNull(recurseTimes)?formatValue(ctx,desc.value,null):formatValue(ctx,desc.value,recurseTimes-1),-1<str.indexOf("\n")&&(array?str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2):str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n"))):str=ctx.stylize("[Circular]","special")),isUndefined(name)){if(array&&key.match(/^\d+$/))return str;name=JSON.stringify(""+key),name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(name=name.substr(1,name.length-2),name=ctx.stylize(name,"name")):(name=name.replace(/'/g,"\\'").replace(/\\"/g,"\"").replace(/(^"|"$)/g,"'"),name=ctx.stylize(name,"string"))}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0,length=output.reduce(function(prev,cur){return numLinesEst++,0<=cur.indexOf("\n")&&numLinesEst++,prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);return 60<length?braces[0]+(""===base?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]:braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return isObject(re)&&"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return isObject(d)&&"[object Date]"===objectToString(d)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(arg){return"function"==typeof arg}function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return 10>n?"0"+n.toString(10):n.toString(10)}function timestamp(){var d=new Date,time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){for(var objects=[],i=0;i<arguments.length;i++)objects.push(inspect(arguments[i]));return objects.join(" ")}for(var i=1,args=arguments,len=args.length,str=(f+"").replace(formatRegExp,function(x){if("%%"===x)return"%";if(i>=len)return x;switch(x){case"%s":return args[i++]+"";case"%d":return+args[i++];case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x;}}),x=args[i];i<len;x=args[++i])str+=isNull(x)||!isObject(x)?" "+x:" "+inspect(x);return str},exports.deprecate=function(fn,msg){if(isUndefined(global.process))return function(){return exports.deprecate(fn,msg).apply(this,arguments)};if(!0===process.noDeprecation)return fn;var warned=!1;return function(){if(!warned){if(process.throwDeprecation)throw new Error(msg);else process.traceDeprecation?console.trace(msg):console.error(msg);warned=!0}return fn.apply(this,arguments)}};var debugs={},debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron)&&(debugEnviron=process.env.NODE_DEBUG||""),set=set.toUpperCase(),!debugs[set])if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else debugs[set]=function(){};return debugs[set]},exports.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=function(arg){return null==arg},exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=function(arg){return"symbol"==typeof arg},exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=function(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||"undefined"==typeof arg},exports.isBuffer=__webpack_require__("vexR");var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))},exports.inherits=__webpack_require__("4Bm0"),exports._extend=function(origin,add){if(!add||!isObject(add))return origin;for(var keys=Object.keys(add),i=keys.length;i--;)origin[keys[i]]=add[keys[i]];return origin}}).call(exports,__webpack_require__("h6ac"))},ggoL:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){function keySet(array){for(var keys={},i=0;i<array.length;++i)keys[array[i].toLowerCase()]=!0;return keys}function tokenCComment(stream,state){for(var maybeEnd=!1,ch;null!=(ch=stream.next());){if(maybeEnd&&"/"==ch){state.tokenize=null;break}maybeEnd="*"==ch}return["comment","comment"]}CodeMirror.defineMode("css",function(config,parserConfig){function ret(style,tp){return type=tp,style}function tokenBase(stream,state){var ch=stream.next();if(tokenHooks[ch]){var result=tokenHooks[ch](stream,state);if(!1!==result)return result}if("@"==ch)return stream.eatWhile(/[\w\\\-]/),ret("def",stream.current());if("="==ch||("~"==ch||"|"==ch)&&stream.eat("="))return ret(null,"compare");if("\""==ch||"'"==ch)return state.tokenize=tokenString(ch),state.tokenize(stream,state);if("#"==ch)return stream.eatWhile(/[\w\\\-]/),ret("atom","hash");if("!"==ch)return stream.match(/^\s*\w*/),ret("keyword","important");if(/\d/.test(ch)||"."==ch&&stream.eat(/\d/))return stream.eatWhile(/[\w.%]/),ret("number","unit");if("-"===ch){if(/[\d.]/.test(stream.peek()))return stream.eatWhile(/[\w.%]/),ret("number","unit");if(stream.match(/^-[\w\\\-]+/))return stream.eatWhile(/[\w\\\-]/),stream.match(/^\s*:/,!1)?ret("variable-2","variable-definition"):ret("variable-2","variable");if(stream.match(/^\w+-/))return ret("meta","meta")}else return /[,+>*\/]/.test(ch)?ret(null,"select-op"):"."==ch&&stream.match(/^-?[_a-z][_a-z0-9-]*/i)?ret("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(ch)?ret(null,ch):("u"==ch||"U"==ch)&&stream.match(/rl(-prefix)?\(/i)||("d"==ch||"D"==ch)&&stream.match("omain(",!0,!0)||("r"==ch||"R"==ch)&&stream.match("egexp(",!0,!0)?(stream.backUp(1),state.tokenize=tokenParenthesized,ret("property","word")):/[\w\\\-]/.test(ch)?(stream.eatWhile(/[\w\\\-]/),ret("property","word")):ret(null,null)}function tokenString(quote){return function(stream,state){for(var escaped=!1,ch;null!=(ch=stream.next());){if(ch==quote&&!escaped){")"==quote&&stream.backUp(1);break}escaped=!escaped&&"\\"==ch}return ch!=quote&&(escaped||")"==quote)||(state.tokenize=null),ret("string","string")}}function tokenParenthesized(stream,state){return stream.next(),state.tokenize=stream.match(/\s*[\"\')]/,!1)?null:tokenString(")"),ret(null,"(")}function Context(type,indent,prev){this.type=type,this.indent=indent,this.prev=prev}function pushContext(state,stream,type,indent){return state.context=new Context(type,stream.indentation()+(!1===indent?0:indentUnit),state.context),type}function popContext(state){return state.context.prev&&(state.context=state.context.prev),state.context.type}function pass(type,stream,state){return states[state.context.type](type,stream,state)}function popAndPass(type,stream,state,n){for(var i=n||1;0<i;i--)state.context=state.context.prev;return pass(type,stream,state)}function wordAsValue(stream){var word=stream.current().toLowerCase();override=valueKeywords.hasOwnProperty(word)?"atom":colorKeywords.hasOwnProperty(word)?"keyword":"variable"}var inline=parserConfig.inline;parserConfig.propertyKeywords||(parserConfig=CodeMirror.resolveMode("text/css"));var indentUnit=config.indentUnit,tokenHooks=parserConfig.tokenHooks,documentTypes=parserConfig.documentTypes||{},mediaTypes=parserConfig.mediaTypes||{},mediaFeatures=parserConfig.mediaFeatures||{},mediaValueKeywords=parserConfig.mediaValueKeywords||{},propertyKeywords=parserConfig.propertyKeywords||{},nonStandardPropertyKeywords=parserConfig.nonStandardPropertyKeywords||{},fontProperties=parserConfig.fontProperties||{},counterDescriptors=parserConfig.counterDescriptors||{},colorKeywords=parserConfig.colorKeywords||{},valueKeywords=parserConfig.valueKeywords||{},allowNested=parserConfig.allowNested,lineComment=parserConfig.lineComment,supportsAtComponent=!0===parserConfig.supportsAtComponent,states={},type,override;return states.top=function(type,stream,state){if("{"==type)return pushContext(state,stream,"block");if("}"==type&&state.context.prev)return popContext(state);if(supportsAtComponent&&/@component/i.test(type))return pushContext(state,stream,"atComponentBlock");if(/^@(-moz-)?document$/i.test(type))return pushContext(state,stream,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(type))return pushContext(state,stream,"atBlock");if(/^@(font-face|counter-style)/i.test(type))return state.stateArg=type,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(type))return"keyframes";if(type&&"@"==type.charAt(0))return pushContext(state,stream,"at");if("hash"==type)override="builtin";else if("word"==type)override="tag";else{if("variable-definition"==type)return"maybeprop";if("interpolation"==type)return pushContext(state,stream,"interpolation");if(":"==type)return"pseudo";if(allowNested&&"("==type)return pushContext(state,stream,"parens")}return state.context.type},states.block=function(type,stream,state){if("word"==type){var word=stream.current().toLowerCase();return propertyKeywords.hasOwnProperty(word)?(override="property","maybeprop"):nonStandardPropertyKeywords.hasOwnProperty(word)?(override="string-2","maybeprop"):allowNested?(override=stream.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(override+=" error","maybeprop")}return"meta"==type?"block":allowNested||"hash"!=type&&"qualifier"!=type?states.top(type,stream,state):(override="error","block")},states.maybeprop=function(type,stream,state){return":"==type?pushContext(state,stream,"prop"):pass(type,stream,state)},states.prop=function(type,stream,state){if(";"==type)return popContext(state);if("{"==type&&allowNested)return pushContext(state,stream,"propBlock");if("}"==type||"{"==type)return popAndPass(type,stream,state);if("("==type)return pushContext(state,stream,"parens");if("hash"==type&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current()))override+=" error";else if("word"==type)wordAsValue(stream);else if("interpolation"==type)return pushContext(state,stream,"interpolation");return"prop"},states.propBlock=function(type,_stream,state){return"}"==type?popContext(state):"word"==type?(override="property","maybeprop"):state.context.type},states.parens=function(type,stream,state){return"{"==type||"}"==type?popAndPass(type,stream,state):")"==type?popContext(state):"("==type?pushContext(state,stream,"parens"):"interpolation"==type?pushContext(state,stream,"interpolation"):("word"==type&&wordAsValue(stream),"parens")},states.pseudo=function(type,stream,state){return"meta"==type?"pseudo":"word"==type?(override="variable-3",state.context.type):pass(type,stream,state)},states.documentTypes=function(type,stream,state){return"word"==type&&documentTypes.hasOwnProperty(stream.current())?(override="tag",state.context.type):states.atBlock(type,stream,state)},states.atBlock=function(type,stream,state){if("("==type)return pushContext(state,stream,"atBlock_parens");if("}"==type||";"==type)return popAndPass(type,stream,state);if("{"==type)return popContext(state)&&pushContext(state,stream,allowNested?"block":"top");if("interpolation"==type)return pushContext(state,stream,"interpolation");if("word"==type){var word=stream.current().toLowerCase();override="only"==word||"not"==word||"and"==word||"or"==word?"keyword":mediaTypes.hasOwnProperty(word)?"attribute":mediaFeatures.hasOwnProperty(word)?"property":mediaValueKeywords.hasOwnProperty(word)?"keyword":propertyKeywords.hasOwnProperty(word)?"property":nonStandardPropertyKeywords.hasOwnProperty(word)?"string-2":valueKeywords.hasOwnProperty(word)?"atom":colorKeywords.hasOwnProperty(word)?"keyword":"error"}return state.context.type},states.atComponentBlock=function(type,stream,state){return"}"==type?popAndPass(type,stream,state):"{"==type?popContext(state)&&pushContext(state,stream,allowNested?"block":"top",!1):("word"==type&&(override="error"),state.context.type)},states.atBlock_parens=function(type,stream,state){return")"==type?popContext(state):"{"==type||"}"==type?popAndPass(type,stream,state,2):states.atBlock(type,stream,state)},states.restricted_atBlock_before=function(type,stream,state){return"{"==type?pushContext(state,stream,"restricted_atBlock"):"word"==type&&"@counter-style"==state.stateArg?(override="variable","restricted_atBlock_before"):pass(type,stream,state)},states.restricted_atBlock=function(type,stream,state){return"}"==type?(state.stateArg=null,popContext(state)):"word"==type?(override=("@font-face"!=state.stateArg||fontProperties.hasOwnProperty(stream.current().toLowerCase()))&&("@counter-style"!=state.stateArg||counterDescriptors.hasOwnProperty(stream.current().toLowerCase()))?"property":"error","maybeprop"):"restricted_atBlock"},states.keyframes=function(type,stream,state){return"word"==type?(override="variable","keyframes"):"{"==type?pushContext(state,stream,"top"):pass(type,stream,state)},states.at=function(type,stream,state){return";"==type?popContext(state):"{"==type||"}"==type?popAndPass(type,stream,state):("word"==type?override="tag":"hash"==type&&(override="builtin"),"at")},states.interpolation=function(type,stream,state){return"}"==type?popContext(state):"{"==type||";"==type?popAndPass(type,stream,state):("word"==type?override="variable":"variable"!=type&&"("!=type&&")"!=type&&(override="error"),"interpolation")},{startState:function(base){return{tokenize:null,state:inline?"block":"top",stateArg:null,context:new Context(inline?"block":"top",base||0,null)}},token:function(stream,state){if(!state.tokenize&&stream.eatSpace())return null;var style=(state.tokenize||tokenBase)(stream,state);return style&&"object"==typeof style&&(type=style[1],style=style[0]),override=style,"comment"!=type&&(state.state=states[state.state](type,stream,state)),override},indent:function(state,textAfter){var cx=state.context,ch=textAfter&&textAfter.charAt(0),indent=cx.indent;return"prop"==cx.type&&("}"==ch||")"==ch)&&(cx=cx.prev),cx.prev&&("}"==ch&&("block"==cx.type||"top"==cx.type||"interpolation"==cx.type||"restricted_atBlock"==cx.type)?(cx=cx.prev,indent=cx.indent):(")"==ch&&("parens"==cx.type||"atBlock_parens"==cx.type)||"{"==ch&&("at"==cx.type||"atBlock"==cx.type))&&(indent=Math.max(0,cx.indent-indentUnit))),indent},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:lineComment,fold:"brace"}});var documentTypes_=["domain","regexp","url","url-prefix"],documentTypes=keySet(documentTypes_),mediaTypes_=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],mediaTypes=keySet(mediaTypes_),mediaFeatures_=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],mediaFeatures=keySet(mediaFeatures_),mediaValueKeywords_=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],mediaValueKeywords=keySet(mediaValueKeywords_),propertyKeywords_=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],propertyKeywords=keySet(propertyKeywords_),nonStandardPropertyKeywords_=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],nonStandardPropertyKeywords=keySet(nonStandardPropertyKeywords_),fontProperties=keySet(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),counterDescriptors=keySet(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),colorKeywords_=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],colorKeywords=keySet(colorKeywords_),valueKeywords_=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],valueKeywords=keySet(valueKeywords_),allWords=documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_).concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_).concat(valueKeywords_);CodeMirror.registerHelper("hintWords","css",allWords),CodeMirror.defineMIME("text/css",{documentTypes:documentTypes,mediaTypes:mediaTypes,mediaFeatures:mediaFeatures,mediaValueKeywords:mediaValueKeywords,propertyKeywords:propertyKeywords,nonStandardPropertyKeywords:nonStandardPropertyKeywords,fontProperties:fontProperties,counterDescriptors:counterDescriptors,colorKeywords:colorKeywords,valueKeywords:valueKeywords,tokenHooks:{"/":function(stream,state){return!!stream.eat("*")&&(state.tokenize=tokenCComment,tokenCComment(stream,state))}},name:"css"}),CodeMirror.defineMIME("text/x-scss",{mediaTypes:mediaTypes,mediaFeatures:mediaFeatures,mediaValueKeywords:mediaValueKeywords,propertyKeywords:propertyKeywords,nonStandardPropertyKeywords:nonStandardPropertyKeywords,colorKeywords:colorKeywords,valueKeywords:valueKeywords,fontProperties:fontProperties,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(stream,state){return stream.eat("/")?(stream.skipToEnd(),["comment","comment"]):stream.eat("*")?(state.tokenize=tokenCComment,tokenCComment(stream,state)):["operator","operator"]},":":function(stream){return!!stream.match(/\s*\{/,!1)&&[null,null]},$:function(stream){return stream.match(/^[\w-]+/),stream.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(stream){return!!stream.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),CodeMirror.defineMIME("text/x-less",{mediaTypes:mediaTypes,mediaFeatures:mediaFeatures,mediaValueKeywords:mediaValueKeywords,propertyKeywords:propertyKeywords,nonStandardPropertyKeywords:nonStandardPropertyKeywords,colorKeywords:colorKeywords,valueKeywords:valueKeywords,fontProperties:fontProperties,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(stream,state){return stream.eat("/")?(stream.skipToEnd(),["comment","comment"]):stream.eat("*")?(state.tokenize=tokenCComment,tokenCComment(stream,state)):["operator","operator"]},"@":function(stream){return stream.eat("{")?[null,"interpolation"]:!stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(stream.eatWhile(/[\w\\\-]/),stream.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),CodeMirror.defineMIME("text/x-gss",{documentTypes:documentTypes,mediaTypes:mediaTypes,mediaFeatures:mediaFeatures,propertyKeywords:propertyKeywords,nonStandardPropertyKeywords:nonStandardPropertyKeywords,fontProperties:fontProperties,counterDescriptors:counterDescriptors,colorKeywords:colorKeywords,valueKeywords:valueKeywords,supportsAtComponent:!0,tokenHooks:{"/":function(stream,state){return!!stream.eat("*")&&(state.tokenize=tokenCComment,tokenCComment(stream,state))}},name:"css",helperType:"gss"})})},gpbE:function(module,exports,__webpack_require__){"use strict";function Crc32Probe(){GenericWorker.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}var GenericWorker=__webpack_require__("ZKdc"),crc32=__webpack_require__("cvyR"),utils=__webpack_require__("dvMn");utils.inherits(Crc32Probe,GenericWorker),Crc32Probe.prototype.processChunk=function(chunk){this.streamInfo.crc32=crc32(chunk.data,this.streamInfo.crc32||0),this.push(chunk)},module.exports=Crc32Probe},h6ac:function(module){"use strict";var g=function(){return this}();try{g=g||Function("return this")()||(1,eval)("this")}catch(e){"object"==typeof window&&(g=window)}module.exports=g},hIGV:function(module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function stringScore(abbr,string){if(abbr=abbr.toLowerCase(),string=string.toLowerCase(),abbr===string)return 1;if(!string||abbr.charCodeAt(0)!==string.charCodeAt(0))return 0;for(var abbrLength=abbr.length,stringLength=string.length,i=1,j=1,score=stringLength,ch1=void 0,ch2=void 0,found=void 0,acronym=void 0;i<abbrLength;){for(ch1=abbr.charCodeAt(i),found=!1,acronym=!1;j<stringLength;){if(ch2=string.charCodeAt(j),ch1===ch2){found=!0,score+=(stringLength-j)*(acronym?2:1);break}acronym=ch2===DASH,j++}if(!found)break;i++}return score&&score*(i/abbrLength)/sum(stringLength)}function sum(n){return n*(n+1)/2}function cssSnippets(snippets){return nest(snippets.map(function(snippet){return new CSSSnippet(snippet.key,snippet.value)}))}function nest(snippets){snippets=snippets.sort(snippetsSort);for(var stack=[],i=0,cur,prev;i<snippets.length;i++)if(cur=snippets[i],!!cur.property){for(;stack.length;){if(prev=stack[stack.length-1],0===cur.property.indexOf(prev.property)&&cur.property.charCodeAt(prev.property.length)===DASH$1){prev.addDependency(cur),stack.push(cur);break}stack.pop()}stack.length||stack.push(cur)}return snippets}function snippetsSort(a,b){return a.key===b.key?0:a.key<b.key?-1:1}function isKeyword(str){return /^\s*[\w-]+/.test(str)}function splitValue(value){return(value+"").split("|")}function convertToCSSSnippets(registry){return cssSnippets(registry.all({type:"string"}))}function resolveNode(node,snippets,options){if(options.property)return resolveAsPropertyValue(node,snippets.find(function(snippet){return snippet.property===options.property}),options);var snippet=findBestMatch(node.name,snippets,"key",options.fuzzySearchMinScore);return snippet?snippet.property?resolveAsProperty(node,snippet,options):resolveAsSnippet(node,snippet):"!"===node.name?setNodeAsText(node,"!important"):node}function resolveAsProperty(node,snippet,formatOptions){var abbr=node.name;if(node.name=snippet.property,node.value&&"object"==typeof node.value){var keywords=snippet.keywords();if(!node.value.size){var kw=findBestMatch(getUnmatchedPart(abbr,snippet.key),keywords);kw||(kw=snippet.defaultValue,kw&&-1===kw.indexOf("${")&&(kw="${1:"+kw+"}")),kw&&node.value.add(kw)}else for(var i=0,token;i<node.value.value.length;i++)token=node.value.value[i],"!"===token?token=(i?"":"${1} ")+"!important":isKeyword$1(token)?token=findBestMatch(token.value,keywords)||findBestMatch(token.value,globalKeywords)||token:isNumericValue(token)&&(token=resolveNumericValue(node.name,token,formatOptions)),node.value.value[i]=token}return node}function resolveAsSnippet(node,snippet){return setNodeAsText(node,snippet.value)}function resolveAsPropertyValue(node,snippet,options){var keywords=globalKeywords.slice();snippet&&(keywords=keywords.concat(snippet.keywords()));var values=[node.name].concat(node.value.value).filter(Boolean).map(function(value){return"string"==typeof value||"keyword"===value.type?(value+="",findBestMatch(value,keywords,null,options.fuzzySearchMinScore)||value):value});return node.name=null,node.value.value=values,node}function setNodeAsText(node,text){return node.name=null,node.value=text,node}function findBestMatch(abbr,items,key,fuzzySearchMinScore){if(!abbr)return null;var matchedItem=null,maxScore=0;fuzzySearchMinScore=fuzzySearchMinScore||0;for(var i=0,item;i<items.length;i++){item=items[i];var score=stringScore(abbr,getScoringPart(item,key));if(1===score)return item;score&&score>=maxScore&&(maxScore=score,matchedItem=item)}return maxScore>=fuzzySearchMinScore?matchedItem:null}function getScoringPart(item,key){var value=item&&"object"==typeof item?item[key]:item,m=(value||"").match(/^[\w-@]+/);return m?m[0]:value}function getUnmatchedPart(abbr,string){for(var i=0,lastPos=0;i<abbr.length;i++){if(lastPos=string.indexOf(abbr[i],lastPos),-1===lastPos)return abbr.slice(i);lastPos++}return""}function isKeyword$1(token){return tokenTypeOf(token,"keyword")}function isNumericValue(token){return tokenTypeOf(token,"numeric")}function tokenTypeOf(token,type){return token&&"object"==typeof token&&token.type===type}function resolveNumericValue(property,token,formatOptions){return token.unit?token.unit=formatOptions.unitAliases[token.unit]||token.unit:0!==token.value&&-1===unitlessProperties.indexOf(property)&&(token.unit=token.value===(0|token.value)?formatOptions.intUnit:formatOptions.floatUnit),token}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_createClass=function(){function defineProperties(target,props){for(var i=0,descriptor;i<props.length;i++)descriptor=props[i],descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),DASH=45,reProperty=/^([a-z-]+)(?:\s*:\s*([^\n\r]+))?$/,DASH$1=45,CSSSnippet=function(){function CSSSnippet(key,value){_classCallCheck(this,CSSSnippet),this.key=key,this.value=value,this.property=null;var m=value&&value.match(reProperty);m&&(this.property=m[1],this.value=m[2]),this.dependencies=[]}return CSSSnippet.prototype.addDependency=function(dep){this.dependencies.push(dep)},CSSSnippet.prototype.keywords=function(){var stack=[],keywords=new Set,i=0,item=void 0,candidates=void 0;for(this.property&&stack.push(this);i<stack.length;)if(item=stack[i++],item.value){candidates=splitValue(item.value).filter(isKeyword);for(var j=0;j<candidates.length;j++)keywords.add(candidates[j].trim());for(var _j=0,deps=item.dependencies;_j<deps.length;_j++)-1===stack.indexOf(deps[_j])&&stack.push(deps[_j])}return Array.from(keywords)},_createClass(CSSSnippet,[{key:"defaultValue",get:function(){return null==this.value?null:splitValue(this.value)[0]}}]),CSSSnippet}(),globalKeywords=["auto","inherit","unset"],unitlessProperties=["z-index","line-height","opacity","font-weight","zoom","flex","flex-grow","flex-shrink"],defaultOptions={intUnit:"px",floatUnit:"em",unitAliases:{e:"em",p:"%",x:"ex",r:"rem"},fuzzySearchMinScore:0};exports.default=function(tree,registry,options){options=_extends({},defaultOptions,options),options.unitAliases=_extends({},defaultOptions.unitAliases,options&&options.unitAliases);var snippets=convertToCSSSnippets(registry);return tree.walk(function(node){return resolveNode(node,snippets,options)}),tree},exports.convertToCSSSnippets=convertToCSSSnippets,exports.stringScore=stringScore,exports.cssSnippets=cssSnippets},iOMi:function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function splitByLines(text){return(text||"").split(/\r\n|\r|\n/g)}function run(nodes,formatter,fieldsRenderer){return nodes.map(function(node){var outNode=formatter(new OutputNode(node,fieldsRenderer));return outNode?outNode.toString(run(node.children,formatter,fieldsRenderer)):""}).join("")}function getFieldsModel(text,fieldState){var model="object"==typeof text?text:(0,_fieldParser2.default)(text),largestIndex=-1;return model.fields.forEach(function(field){field.index+=fieldState.index,field.index>largestIndex&&(largestIndex=field.index)}),-1!==largestIndex&&(fieldState.index=largestIndex+1),model}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_fieldParser=__webpack_require__("R0uB"),_fieldParser2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_fieldParser),defaultFieldsRenderer=function(text){return text},OutputNode=function(){function OutputNode(node,fieldsRenderer,options){_classCallCheck(this,OutputNode),"object"==typeof fieldsRenderer&&(options=fieldsRenderer,fieldsRenderer=null),this.node=node,this._fieldsRenderer=fieldsRenderer||defaultFieldsRenderer,this.open=null,this.beforeOpen="",this.afterOpen="",this.close=null,this.beforeClose="",this.afterClose="",this.text=null,this.beforeText="",this.afterText="",this.indent="",this.newline="",options&&_extends(this,options)}return OutputNode.prototype.clone=function(){return new this.constructor(this.node,this)},OutputNode.prototype.indentText=function(text){var _this=this,lines=splitByLines(text);if(1===lines.length)return text;var nl=this.newline||this.indent?this.newline:" ";return lines.map(function(line,i){return i?_this.indent+line:line}).join(nl)},OutputNode.prototype.renderFields=function(text){return this._fieldsRenderer(text)},OutputNode.prototype.toString=function(children){var open=this._wrap(this.open,this.beforeOpen,this.afterOpen),close=this._wrap(this.close,this.beforeClose,this.afterClose),text=this._wrap(this.text,this.beforeText,this.afterText);return open+text+(null==children?"":children)+close},OutputNode.prototype._wrap=function(str,before,after){return before=null==before?"":before,after=null==after?"":after,null==str?"":(str=before?str.replace(/^\s+/,""):str,str=after?str.replace(/\s+$/,""):str,before+this.indentText(str)+after)},OutputNode}(),defaultField=function(index,placeholder){return placeholder||""};exports.default=function(tree,field,formatter){"undefined"==typeof formatter&&(formatter=field,field=null),field=field||defaultField;var fieldState={index:1};return run(tree.children,formatter,function(text){return null==text?field(fieldState.index++):getFieldsModel(text,fieldState).mark(field)})}},iktq:function(module,exports,__webpack_require__){"use strict";var aFunction=__webpack_require__("qdP6");module.exports=function(fn,that,length){return(aFunction(fn),void 0===that)?fn:1===length?function(a){return fn.call(that,a)}:2===length?function(a,b){return fn.call(that,a,b)}:3===length?function(a,b,c){return fn.call(that,a,b,c)}:function(){return fn.apply(that,arguments)}}},"k/hd":function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function expand(abbr,config){return config=_extends({},config),"string"==typeof abbr&&(abbr=parse(abbr,config)),(0,_markupFormatters2.default)(abbr,config.profile,config.syntax,config)}function parse(abbr,config){return(0,_abbreviation2.default)(abbr).use(_htmlSnippetsResolver2.default,config.snippets).use(_variableResolver2.default,config.variables).use(_htmlTransform2.default,config.text,config.options)}function expand$1(abbr,config){return config=config||{},"string"==typeof abbr&&(abbr=parse$1(abbr,config)),(0,_stylesheetFormatters2.default)(abbr,config.profile,config.syntax,config)}function parse$1(abbr,config){return"string"==typeof abbr&&(abbr=(0,_cssAbbreviation2.default)(abbr)),abbr.use(_cssSnippetsResolver2.default,config.snippets,config.options)}function snippetsRegistryFactory(type,syntax,snippets){var registrySnippets=[];"markup"===type?registrySnippets.push(_snippets2.default.html):"stylesheet"===type&®istrySnippets.push(_snippets2.default.css),syntax in _snippets2.default&&-1===registrySnippets.indexOf(_snippets2.default[syntax])&®istrySnippets.push(_snippets2.default[syntax]),Array.isArray(snippets)?snippets.forEach(function(item){registrySnippets.push("string"==typeof item?_snippets2.default[item]:item)}):"object"==typeof snippets&®istrySnippets.push(snippets);var registry=new _snippetsRegistry2.default(registrySnippets.filter(Boolean));return"stylesheet"!==type&®istry.get(0).set(reLorem,loremGenerator),registry}function loremGenerator(node){var options={},m=node.name.match(reLorem);return m[1]&&(options.lang=m[1]),m[2]&&(options.wordCount=+m[2]),(0,_lorem2.default)(node,options)}function createSnippetsRegistry(type,syntax,snippets){return type&&"markup"!==type&&"stylesheet"!==type&&(snippets=syntax,syntax=type,type="markup"),snippets instanceof _snippetsRegistry2.default?snippets:snippetsRegistryFactory(type,syntax,snippets)}function createOptions(options){return"string"==typeof options&&(options={syntax:options}),options=_extends({},defaultOptions,options),null==options.type&&options.syntax&&(options.type=isStylesheet(options.syntax)?"stylesheet":"markup"),options.format=_extends({field:options.field},options.format),options.profile=createProfile(options),options.variables=_extends({},defaultVariables,options.variables),options.snippets=createSnippetsRegistry(options.type,options.syntax,options.snippets),options}function isStylesheet(syntax){return-1!==stylesheetSyntaxes.indexOf(syntax)}function createProfile(options){return options.profile instanceof _outputProfile2.default?options.profile:new _outputProfile2.default(options.profile)}function getType(type,syntax){return type?"stylesheet"===type?"stylesheet":"markup":isStylesheet(syntax)?"stylesheet":"markup"}exports.__esModule=!0,exports.createProfile=exports.isStylesheet=exports.createOptions=exports.createSnippetsRegistry=exports.parse=exports.expand=void 0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_abbreviation=__webpack_require__("A9O4"),_abbreviation2=_interopRequireDefault(_abbreviation),_htmlSnippetsResolver=__webpack_require__("/rE2"),_htmlSnippetsResolver2=_interopRequireDefault(_htmlSnippetsResolver),_htmlTransform=__webpack_require__("lXap"),_htmlTransform2=_interopRequireDefault(_htmlTransform),_variableResolver=__webpack_require__("Ipt8"),_variableResolver2=_interopRequireDefault(_variableResolver),_markupFormatters=__webpack_require__("Znrd"),_markupFormatters2=_interopRequireDefault(_markupFormatters),_cssAbbreviation=__webpack_require__("FFEI"),_cssAbbreviation2=_interopRequireDefault(_cssAbbreviation),_cssSnippetsResolver=__webpack_require__("hIGV"),_cssSnippetsResolver2=_interopRequireDefault(_cssSnippetsResolver),_stylesheetFormatters=__webpack_require__("Dxv2"),_stylesheetFormatters2=_interopRequireDefault(_stylesheetFormatters),_snippets=__webpack_require__("B9y7"),_snippets2=_interopRequireDefault(_snippets),_lorem=__webpack_require__("e5FP"),_lorem2=_interopRequireDefault(_lorem),_snippetsRegistry=__webpack_require__("5E0L"),_snippetsRegistry2=_interopRequireDefault(_snippetsRegistry),_outputProfile=__webpack_require__("EJg2"),_outputProfile2=_interopRequireDefault(_outputProfile),reLorem=/^lorem([a-z]*)(\d*)$/i,defaultVariables={lang:"en",locale:"en-US",charset:"UTF-8"},stylesheetSyntaxes=["css","sass","scss","less","stylus","sss"],defaultOptions={type:null,syntax:"html",field:function(index,placeholder){return placeholder||""},text:null,profile:null,variables:{},snippets:{},options:null,format:null};exports.expand=function(abbr,config){return config=createOptions(config),"stylesheet"===getType(config.type,config.syntax)?expand$1(abbr,config):expand(abbr,config)},exports.parse=function(abbr,options){return options=createOptions(options),"stylesheet"===getType(options.type,options.syntax)?parse$1(abbr,options):parse(abbr,options)},exports.createSnippetsRegistry=createSnippetsRegistry,exports.createOptions=createOptions,exports.isStylesheet=isStylesheet,exports.createProfile=createProfile},k0dc:function(module,exports){"use strict";function resolveConfig(config,ref){var type=ref.type,syntax=ref.syntax,project=ref.project;return{syntax:syntax,type:type,project:project,format:mergeConfig(config,"format",type,syntax,project),profile:mergeConfig(config,"profile",type,syntax,project),options:mergeConfig(config,"options",type,syntax,project),variables:mergeConfig(config,"variables",type,syntax,project),snippets:getConfig(config,"snippets",type,syntax,project).filter(Boolean)}}function createParams(config,params){var type=params.type,syntax=params.syntax;return type||syntax?!type&&syntax?-1===knownSyntaxes.markup.indexOf(syntax)?-1===knownSyntaxes.stylesheet.indexOf(syntax)?type=get(config,["syntax",syntax,"type"])||get(config,["project",params.project,"syntax",syntax,"type"]):type="stylesheet":type="markup":!syntax&&(syntax=defaultSyntaxes[type]):(type="markup",syntax=defaultSyntaxes[type]),_extends({},params,{type:type,syntax:syntax})}function mergeConfig(config,key,type,syntax,project){return getConfig(config,key,type,syntax,project).reduce(function(out,obj){return _extends({},out,obj)},{})}function getConfig(config,key,type,syntax,project){return[get(config,["globals",type,key]),get(config,["project",project,"globals",type,key]),get(config,["syntax",syntax,key]),get(config,["project",project,"syntax",syntax,key])].filter(Boolean)}function get(obj,key,defaultValue){for(var result=obj,i=0;i<key.length&&null!=result;i++)result=result[key[i]];return null==result?defaultValue:result}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},defaultSyntaxes={markup:"html",stylesheet:"css"},knownSyntaxes={markup:["html","xml","xsl","jsx","js","pug","slim","haml"],stylesheet:["css","sass","scss","less","sss","stylus"]};exports.default=function(config,params){params=createParams(config,params||{});var resolved=resolveConfig(config,params),knownFields=["globals","syntax","project"];for(var p in config)-1===knownFields.indexOf(p)&&(resolved[p]=config[p]);return resolved}},k0gZ:function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function eatToken(stream,test){var start=stream.pos;return stream.eatWhile(test)?new Token(stream,start,stream.pos):void(stream.pos=start)}function eatAttributeName(stream){return eatPaired(stream)||token(stream,isAttributeName)}function eatAttributeValue(stream){var start=stream.pos;if((0,_streamReaderUtils.eatQuoted)(stream)){var current=stream.pos,valueStart=void 0,valueEnd=void 0;stream.pos=start,stream.next(),valueStart=stream.start=stream.pos,stream.pos=current,stream.backUp(1),valueEnd=stream.pos;var result=token(stream,valueStart,valueEnd);return stream.pos=current,result}return eatPaired(stream)||eatUnquoted(stream)}function isAttributeName(code){return code!==EQUALS&&!isTerminator(code)&&!(0,_streamReaderUtils.isSpace)(code)}function isTerminator(code){return code===RIGHT_ANGLE$1||code===SLASH$1}function eatUnquoted(stream){return token(stream,isUnquoted)}function isUnquoted(code){return!isNaN(code)&&!(0,_streamReaderUtils.isQuote)(code)&&!(0,_streamReaderUtils.isSpace)(code)&&!isTerminator(code)}function eatTagName(stream){return token(stream,isTagName)}function isTagName(code){return(0,_streamReaderUtils.isAlphaNumeric)(code)||code===COLON||code===DOT||code===DASH||code===UNDERSCORE}function eatArray(stream,codes){for(var start=stream.pos,i=0;i<codes.length;i++)if(!stream.eat(codes[i]))return stream.pos=start,!1;return stream.start=start,!0}function eatSection(stream,open,close,allowUnclosed){var start=stream.pos;if(eatArray(stream,open)){for(;!stream.eof();){if(eatArray(stream,close))return!0;stream.next()}return!!allowUnclosed||(stream.pos=start,!1)}return stream.pos=start,null}function toCharCodes(str){return str.split("").map(function(ch){return ch.charCodeAt(0)})}function match(stream){if(60===stream.peek())return comment(stream)||cdata(stream)||tag(stream)}function consumeSpecial(stream,codes){for(var start=stream.pos;!stream.eof();){if(eatArray(stream,codes))return stream.pos=stream.start,tag(stream);stream.next()}return stream.pos=start,null}function getName(tag$$1){return tag$$1.name?tag$$1.name.value.toLowerCase():"#"+tag$$1.type}function last(arr){return arr[arr.length-1]}exports.__esModule=!0,exports.match=exports.defaultOptions=void 0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_createClass=function(){function defineProperties(target,props){for(var i=0,descriptor;i<props.length;i++)descriptor=props[i],descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_streamReader=__webpack_require__("Lu2N"),_streamReader2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_streamReader),_streamReaderUtils=__webpack_require__("rc1b"),Node=function(){function Node(stream,type,open,close){_classCallCheck(this,Node),this.stream=stream,this.type=type,this.open=open,this.close=close,this.children=[],this.parent=null}return Node.prototype.getIndex=function(){return this.parent?this.parent.children.indexOf(this):-1},Node.prototype.addChild=function(node){return this.removeChild(node),this.children.push(node),node.parent=this,this},Node.prototype.removeChild=function(node){var ix=this.children.indexOf(node);return-1!==ix&&(this.children.splice(ix,1),node.parent=null),this},_createClass(Node,[{key:"name",get:function(){return"tag"===this.type&&this.open?this.open&&this.open.name&&this.open.name.value:"#"+this.type}},{key:"attributes",get:function(){return this.open&&this.open.attributes}},{key:"start",get:function(){return this.open&&this.open.start}},{key:"end",get:function(){return this.close?this.close.end:this.open&&this.open.end}},{key:"firstChild",get:function(){return this.children[0]}},{key:"nextSibling",get:function(){var ix=this.getIndex();return-1===ix?null:this.parent.children[ix+1]}},{key:"previousSibling",get:function(){var ix=this.getIndex();return-1===ix?null:this.parent.children[ix-1]}}]),Node}(),token=function(stream,start,end){return"function"==typeof start?eatToken(stream,start):new Token(stream,start,end)},Token=function(){function Token(stream,start,end){_classCallCheck(this,Token),this.stream=stream,this.start=null==start?stream.start:start,this.end=null==end?stream.pos:end,this._value=null}return Token.prototype.toString=function(){return this.value},Token.prototype.valueOf=function(){return this.value+" ["+this.start+"; "+this.end+"]"},_createClass(Token,[{key:"value",get:function(){if(null===this._value){var start=this.stream.start,end=this.stream.pos;this.stream.start=this.start,this.stream.pos=this.end,this._value=this.stream.current(),this.stream.start=start,this.stream.pos=end}return this._value}}]),Token}(),opt={throws:!0},eatPaired=function(stream){var start=stream.pos,consumed=(0,_streamReaderUtils.eatPair)(stream,60,62,opt)||(0,_streamReaderUtils.eatPair)(stream,91,93,opt)||(0,_streamReaderUtils.eatPair)(stream,40,41,opt)||(0,_streamReaderUtils.eatPair)(stream,123,125,opt);if(consumed)return token(stream,start)},SLASH$1=47,EQUALS=61,RIGHT_ANGLE$1=62,eatAttributes=function(stream){for(var result=[],attr=void 0;!stream.eof();)if(stream.eatWhile(_streamReaderUtils.isSpace),attr={start:stream.pos},attr.name=eatAttributeName(stream))stream.eat(EQUALS)?attr.value=eatAttributeValue(stream):attr.boolean=!0,attr.end=stream.pos,result.push(attr);else if(isTerminator(stream.peek()))break;else stream.next();return result},DASH=45,DOT=46,SLASH=47,COLON=58,UNDERSCORE=95,tag=function(stream){var start=stream.pos;if(stream.eat(60)){var model={type:stream.eat(SLASH)?"close":"open"};if((model.name=eatTagName(stream))&&("close"!==model.type&&(model.attributes=eatAttributes(stream),stream.eatWhile(_streamReaderUtils.isSpace),model.selfClosing=stream.eat(SLASH)),stream.eat(62)))return _extends(token(stream,start),model)}return stream.pos=start,null},open=toCharCodes("<!--"),close=toCharCodes("-->"),comment=function(stream){var start=stream.pos;if(eatSection(stream,open,close,!0)){var result=token(stream,start);return result.type="comment",result}return null},open$1=toCharCodes("<![CDATA["),close$1=toCharCodes("]]>"),cdata=function(stream){var start=stream.pos;if(eatSection(stream,open$1,close$1,!0)){var result=token(stream,start);return result.type="cdata",result}return null},defaultOptions={xml:!1,special:["script","style"],empty:["img","meta","link","br","base","hr","area","wbr","col","embed","input","param","source","track"]};exports.defaultOptions=defaultOptions,exports.match=match,exports.default=function(content,options){options=_extends({},defaultOptions,options);for(var stream="string"==typeof content?new _streamReader2.default(content):content,root=new Node(stream,"root"),empty=new Set(options.empty),special=options.special.reduce(function(map,name){return map.set(name,toCharCodes("</"+name+">"))},new Map),isEmpty=function(token,name){return token.selfClosing||!options.xml&&empty.has(name)},m=void 0,node=void 0,name=void 0,stack=[root];!stream.eof();)if(!(m=match(stream)))stream.next();else if(name=getName(m),"open"===m.type)node=new Node(stream,"tag",m),last(stack).addChild(node),special.has(name)?node.close=consumeSpecial(stream,special.get(name)):!isEmpty(m,name)&&stack.push(node);else if("close"===m.type){for(var i=stack.length-1;0<i;i--)if(stack[i].name.toLowerCase()===name){stack[i].close=m,stack=stack.slice(0,i);break}}else last(stack).addChild(new Node(stream,m.type,m));return root}},kT1X:function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__("Hba+")},kdYR:function(module,exports,__webpack_require__){"use strict";var isObject=__webpack_require__("0gyT"),document=__webpack_require__("3Vd+").document,is=isObject(document)&&isObject(document.createElement);module.exports=function(it){return is?document.createElement(it):{}}},lUr3:function(module,exports){"use strict";exports.base64=!1,exports.binary=!1,exports.dir=!1,exports.createFolders=!0,exports.date=null,exports.compression=null,exports.compressionOptions=null,exports.comment=null,exports.unixPermissions=null,exports.dosPermissions=null},lXap:function(module,exports,__webpack_require__){"use strict";function findUnescapedTokens(str,token){for(var result=new Set,tlen=token.length,pos=0;-1!==(pos=str.indexOf(token,pos));)result.add(pos),pos+=tlen;if(result.size)for(var _pos=0,len=str.length;_pos<len;)"\\"===str[_pos++]&&result.delete(_pos++);return Array.from(result).map(function(ix){return range(ix,tlen)})}function replaceRanges(str,ranges,value){for(var i=ranges.length-1;0<=i;i--){var r=ranges[i],offset=0,offsetLength=0,descendingOrder=!1;if("@"===str.substr(r[0]+r[1],1)){"-"===str.substr(r[0]+r[1]+1,1)&&(descendingOrder=!0);var matches=str.substr(r[0]+r[1]+1+ +descendingOrder).match(/^(\d+)/);matches?(offsetLength=matches[1].length+1+ +descendingOrder,offset=parseInt(matches[1])-1):offsetLength=2}str=str.substring(0,r[0])+("function"==typeof value?value(str.substr(r[0],r[1]),offset,descendingOrder):value)+str.substring(r[0]+r[1]+offsetLength)}return str}function range(start,length){return[start,length]}function applyNumbering$1(node){var repeater=findRepeater(node);if(repeater&&null!=repeater.value){var value=repeater.value,count=repeater.count;node.name=replaceNumbering(node.name,value,count),node.value=replaceNumbering(node.value,value,count),node.attributes.forEach(function(attr){var copy=node.getAttribute(attr.name).clone();copy.name=replaceNumbering(attr.name,value,count),copy.value=replaceNumbering(attr.value,value,count),node.replaceAttribute(attr.name,copy)})}return node}function findRepeater(node){for(;node;){if(node.repeat)return node.repeat;node=node.parent}}function replaceNumbering(str,value,count){if("string"==typeof str){var ranges=getNumberingRanges(str);return replaceNumberingRanges(str,ranges,value,count)}return str}function getNumberingRanges(str){return findUnescapedTokens(str||"",numberingToken).reduce(function(out,range$$1){if(!/[#{]/.test(str[range$$1[0]+1]||"")){var lastRange=out[out.length-1];lastRange&&lastRange[0]+lastRange[1]===range$$1[0]?lastRange[1]+=range$$1[1]:out.push(range$$1)}return out},[])}function replaceNumberingRanges(str,ranges,value,count){var replaced=replaceRanges(str,ranges,function(token,offset,descendingOrder){for(var _value=descendingOrder?offset+count-value+1+"":value+offset+"";_value.length<token.length;)_value="0"+_value;return _value});return unescapeString(replaced)}function unescapeString(str){for(var i=0,result="",len=str.length,ch;i<len;)ch=str[i++],result+="\\"===ch?str[i++]||"":ch;return result}function prepare(tree,amount){return amount=amount||1,tree.walk(function(node){if(node.repeat&&null===node.repeat.count){for(var i=0,clone;i<amount;i++)clone=node.clone(!0),clone.repeat.implicit=!0,clone.repeat.count=amount,clone.repeat.value=i+1,clone.repeat.index=i,node.parent.insertBefore(clone,node);node.remove()}}),tree}function insert(tree,content){if(Array.isArray(content)&&content.length){var updated=!1;tree.walk(function(node){node.repeat&&node.repeat.implicit&&(updated=!0,insertContent(node,content[node.repeat.index]))}),updated||setNodeContent(findDeepestNode(tree),content.join("\n"))}return tree}function insertContent(node,content){var inserted=insertContentIntoPlaceholder(node,content);return node.walk(function(child){return inserted|=insertContentIntoPlaceholder(child,content)}),inserted||setNodeContent(findDeepestNode(node),content),node}function insertContentIntoPlaceholder(node,content){var state={replaced:!1};return node.value=replacePlaceholder(node.value,content,state),node.attributes.forEach(function(attr){attr.value&&node.setAttribute(attr.name,replacePlaceholder(attr.value,content,state))}),state.replaced}function replacePlaceholder(str,value,_state){if("string"==typeof str){var ranges=findUnescapedTokens(str,placeholder);ranges.length&&(_state&&(_state.replaced=!0),str=replaceRanges(str,ranges,value))}return str}function findDeepestNode(node){for(;node.children.length;)node=node.children[node.children.length-1];return node}function setNodeContent(node,content){if(node.value){var ranges=findUnescapedTokens(node.value,caret);if(ranges.length)return void(node.value=replaceRanges(node.value,ranges,content))}("a"===node.name.toLowerCase()||node.hasAttribute("href"))&&(reUrl.test(content)?node.setAttribute("href",(reProto.test(content)?"":"http://")+content):reEmail.test(content)&&node.setAttribute("href","mailto:"+content)),node.value=content}function expandClassNames(node){var classNames=node.classList.reduce(function(out,cl){var ix=cl.indexOf("_");return 0<ix&&!cl.startsWith("-")?(out.add(cl.slice(0,ix)),out.add(cl.slice(ix)),out):out.add(cl)},new Set);classNames.size&&node.setAttribute("class",Array.from(classNames).join(" "))}function expandShortNotation(node,lookup,options){var classNames=node.classList.reduce(function(out,cl){var prefix=void 0,m=void 0,originalClass=cl;return(m=cl.match(reElement))&&(prefix=getBlockName(node,lookup,m[1])+options.element+m[2],out.add(prefix),cl=cl.slice(m[0].length)),(m=cl.match(reModifier))&&(!prefix&&(prefix=getBlockName(node,lookup,m[1]),out.add(prefix)),out.add(""+prefix+options.modifier+m[2]),cl=cl.slice(m[0].length)),cl===originalClass&&out.add(originalClass),out},new Set),arrClassNames=Array.from(classNames).filter(Boolean);arrClassNames.length&&node.setAttribute("class",arrClassNames.join(" "))}function createBlockLookup(tree){var lookup=new Map;return tree.walk(function(node){var classNames=node.classList;classNames.length&&lookup.set(node,find(classNames,blockCandidates1)||find(classNames,blockCandidates2)||lookup.get(node.parent))}),lookup}function getBlockName(node,lookup,prefix){for(var depth=1<prefix.length?prefix.length:0;node.parent&&node.parent.parent&&depth--;)node=node.parent;return lookup.get(node)||""}function find(arr,filter){for(var i=0;i<arr.length&&!(reElement.test(arr[i])||reModifier.test(arr[i]));i++)if(filter(arr[i]))return arr[i]}function replace(node,oldName,newName){var attr=node.getAttribute(oldName);attr&&(attr.name=newName)}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},_implicitTag=__webpack_require__("7EAy"),_implicitTag2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_implicitTag),implicitTags=function(tree){return tree.walk(function(node){null==node.name&&node.attributes.length&&(node.name=(0,_implicitTag2.default)(node.parent.name))}),tree},numberingToken="$",applyNumbering=function(tree){return tree.walk(applyNumbering$1),tree},placeholder="$#",caret="|",reUrl=/^((?:https?|ftp|file):\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/,reEmail=/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/,reProto=/^([a-z]+:)?\/\//i,defaultOptions={element:"__",modifier:"_"},reElement=/^(-+)([a-z0-9]+[a-z0-9-]*)/i,reModifier=/^(_+)([a-z0-9]+[a-z0-9-_]*)/i,blockCandidates1=function(className){return /^[a-z]\-/i.test(className)},blockCandidates2=function(className){return /^[a-z]/i.test(className)},reSupporterNames=/^xsl:(variable|with\-param)$/i,supportedAddons={bem:function(tree,options){options=_extends({},defaultOptions,options),tree.walk(function(node){return expandClassNames(node,options)});var lookup=createBlockLookup(tree);return tree.walk(function(node){return expandShortNotation(node,lookup,options)}),tree},jsx:function(tree){return tree.walk(function(node){replace(node,"class","className"),replace(node,"for","htmlFor")}),tree},xsl:function(tree){return tree.walk(function(node){reSupporterNames.test(node.name||"")&&(node.children.length||node.value)&&node.removeAttribute("select")}),tree}},addons=function(tree,_addons){return Object.keys(_addons||{}).forEach(function(key){if(key in supportedAddons){var addonOpt="object"==typeof _addons[key]?_addons[key]:null;tree=tree.use(supportedAddons[key],addonOpt)}}),tree};exports.default=function(tree,content,appliedAddons){return"string"==typeof content?content=[content]:content&&"object"==typeof content&&!Array.isArray(content)&&(appliedAddons=content,content=null),tree.use(implicitTags).use(prepare,Array.isArray(content)?content.length:null).use(applyNumbering).use(insert,content).use(addons,appliedAddons)}},"m+Gh":function(module,exports,__webpack_require__){"use strict";(function(global){global.Promise||(global.Promise=__webpack_require__("BtxX")),global.fetch||(global.fetch=__webpack_require__("VS7n"))}).call(exports,__webpack_require__("h6ac"))},mSND:function(module){"use strict";(function(global,factory){module.exports=factory()})(void 0,function(){var global=window,document=global.document,addEventListener="addEventListener",removeEventListener="removeEventListener",getBoundingClientRect="getBoundingClientRect",NOOP=function(){return!1},FLOAT_FUDGING=0.1,isIE8=global.attachEvent&&!global[addEventListener],calc=["","-webkit-","-moz-","-o-"].filter(function(prefix){var el=document.createElement("div");return el.style.cssText="width:"+prefix+"calc(9px)",!!el.style.length}).shift()+"calc",elementOrSelector=function(el){return"string"==typeof el||el instanceof String?document.querySelector(el):el};return function(ids,options){function setElementSize(el,size,gutSize){var style=elementStyle(dimension,size,gutSize);Object.keys(style).forEach(function(prop){return el.style[prop]=style[prop]})}function setGutterSize(gutterElement,gutSize){var style=gutterStyle(dimension,gutSize);Object.keys(style).forEach(function(prop){return gutterElement.style[prop]=style[prop]})}function adjust(offset){setElementSize(this.a,offset/this.size*this.percentage-FLOAT_FUDGING,this.aGutterSize),setElementSize(this.b,this.percentage-offset/this.size*this.percentage-FLOAT_FUDGING,this.bGutterSize)}function drag(e){var offset;this.dragging&&(offset="touches"in e?e.touches[0][clientAxis]-this.start:e[clientAxis]-this.start,offset<=this.aMin+snapOffset+this.aGutterSize?offset=this.aMin+this.aGutterSize:offset>=this.size-(this.bMin+snapOffset+this.bGutterSize)&&(offset=this.size-(this.bMin+this.bGutterSize)),adjust.call(this,offset),options.onDrag&&options.onDrag())}function calculateSizes(){var computedStyle=global.getComputedStyle(this.parent),parentSize=this.parent[clientDimension]-parseFloat(computedStyle[paddingA]||0)-parseFloat(computedStyle[paddingB]||0);this.size=this.a[getBoundingClientRect]()[dimension]+this.b[getBoundingClientRect]()[dimension]+this.aGutterSize+this.bGutterSize,this.percentage=Math.min(100*(this.size/parentSize),100),this.start=this.a[getBoundingClientRect]()[position]}function stopDragging(){var self=this,a=self.a,b=self.b;self.dragging&&options.onDragEnd&&options.onDragEnd(),self.dragging=!1,global[removeEventListener]("mouseup",self.stop),global[removeEventListener]("touchend",self.stop),global[removeEventListener]("touchcancel",self.stop),self.parent[removeEventListener]("mousemove",self.move),self.parent[removeEventListener]("touchmove",self.move),delete self.stop,delete self.move,a[removeEventListener]("selectstart",NOOP),a[removeEventListener]("dragstart",NOOP),b[removeEventListener]("selectstart",NOOP),b[removeEventListener]("dragstart",NOOP),a.style.userSelect="",a.style.webkitUserSelect="",a.style.MozUserSelect="",a.style.pointerEvents="",b.style.userSelect="",b.style.webkitUserSelect="",b.style.MozUserSelect="",b.style.pointerEvents="",self.gutter.style.cursor="",self.parent.style.cursor=""}function startDragging(e){var self=this,a=self.a,b=self.b;!self.dragging&&options.onDragStart&&options.onDragStart(),e.preventDefault(),self.dragging=!0,self.move=drag.bind(self),self.stop=stopDragging.bind(self),global[addEventListener]("mouseup",self.stop),global[addEventListener]("touchend",self.stop),global[addEventListener]("touchcancel",self.stop),self.parent[addEventListener]("mousemove",self.move),self.parent[addEventListener]("touchmove",self.move),a[addEventListener]("selectstart",NOOP),a[addEventListener]("dragstart",NOOP),b[addEventListener]("selectstart",NOOP),b[addEventListener]("dragstart",NOOP),a.style.userSelect="none",a.style.webkitUserSelect="none",a.style.MozUserSelect="none",a.style.pointerEvents="none",b.style.userSelect="none",b.style.webkitUserSelect="none",b.style.MozUserSelect="none",b.style.pointerEvents="none",self.gutter.style.cursor=cursor,self.parent.style.cursor=cursor,calculateSizes.call(self)}function setSizes(newSizes){newSizes.forEach(function(newSize,i){if(0<i){var pair=pairs[i-1];setElementSize(pair.a,newSizes[i-1],pair.aGutterSize),setElementSize(pair.b,newSize,pair.bGutterSize)}})}function destroy(){pairs.forEach(function(pair){pair.parent.removeChild(pair.gutter),pair.a.style[dimension]="",pair.b.style[dimension]=""})}void 0===options&&(options={});var parent=elementOrSelector(ids[0]).parentNode,parentFlexDirection=global.getComputedStyle(parent).flexDirection,sizes=options.sizes||ids.map(function(){return 100/ids.length}),minSize=void 0===options.minSize?100:options.minSize,minSizes=Array.isArray(minSize)?minSize:ids.map(function(){return minSize}),gutterSize=void 0===options.gutterSize?10:options.gutterSize,snapOffset=void 0===options.snapOffset?30:options.snapOffset,direction=options.direction||"horizontal",cursor=options.cursor||("horizontal"===direction?"ew-resize":"ns-resize"),gutter=options.gutter||function(i,gutterDirection){var gut=document.createElement("div");return gut.className="gutter gutter-"+gutterDirection,gut},elementStyle=options.elementStyle||function(dim,size,gutSize){var style={};return style[dim]="string"==typeof size||size instanceof String?size:isIE8?size+"%":calc+"("+size+"% - "+gutSize+"px)",style},gutterStyle=options.gutterStyle||function(dim,gutSize){return obj={},obj[dim]=gutSize+"px",obj;var obj},dimension,clientDimension,clientAxis,position,paddingA,paddingB;"horizontal"===direction?(dimension="width",clientDimension="clientWidth",clientAxis="clientX",position="left",paddingA="paddingLeft",paddingB="paddingRight"):"vertical"===direction&&(dimension="height",clientDimension="clientHeight",clientAxis="clientY",position="top",paddingA="paddingTop",paddingB="paddingBottom");var pairs=ids.map(function(id,i){var el=elementOrSelector(id),isFirstPair=1===i,isLastPair=i===ids.length-1,size=sizes[i],pair;if(0<i&&(pair={a:elementOrSelector(ids[i-1]),b:el,aMin:minSizes[i-1],bMin:minSizes[i],dragging:!1,isFirst:isFirstPair,isLast:isLastPair,direction:direction,parent:parent},pair.aGutterSize=gutterSize,pair.bGutterSize=gutterSize,isFirstPair&&(pair.aGutterSize=gutterSize/2),isLastPair&&(pair.bGutterSize=gutterSize/2),"row-reverse"===parentFlexDirection||"column-reverse"===parentFlexDirection)){var temp=pair.a;pair.a=pair.b,pair.b=temp}if(!isIE8&&0<i){var gutterElement=gutter(i,direction);setGutterSize(gutterElement,gutterSize),gutterElement[addEventListener]("mousedown",startDragging.bind(pair)),gutterElement[addEventListener]("touchstart",startDragging.bind(pair)),parent.insertBefore(gutterElement,el),pair.gutter=gutterElement}if(0===i||i===ids.length-1?setElementSize(el,size,gutterSize/2):setElementSize(el,size,gutterSize),0<i){var aSize=pair.a[getBoundingClientRect]()[dimension],bSize=pair.b[getBoundingClientRect]()[dimension];aSize<pair.aMin&&(pair.aMin=aSize),bSize<pair.bMin&&(pair.bMin=bSize)}return 0<i?pair:null});return pairs.shift(),isIE8?{setSizes:setSizes,destroy:destroy}:{setSizes:setSizes,getSizes:function(){var newSizes=[];return pairs.forEach(function(pair,i){var computedStyle=global.getComputedStyle(pair.parent),parentSize=pair.parent[clientDimension]-parseFloat(computedStyle[paddingA]||0)-parseFloat(computedStyle[paddingB]||0);newSizes.push(100*((pair.a[getBoundingClientRect]()[dimension]+pair.aGutterSize)/parentSize)),i===pairs.length-1&&newSizes.push(100*((pair.b[getBoundingClientRect]()[dimension]+pair.bGutterSize)/parentSize))}),newSizes},collapse:function(i){if(i===pairs.length){var pair=pairs[i-1];calculateSizes.call(pair),isIE8||adjust.call(pair,pair.size-pair.bGutterSize)}else{var pair$1=pairs[i];calculateSizes.call(pair$1),isIE8||adjust.call(pair$1,pair$1.aGutterSize)}},destroy:destroy}}})},nFS2:function(module,exports,__webpack_require__){"use strict";function Deflate(options){if(!(this instanceof Deflate))return new Deflate(options);this.options=utils.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY,to:""},options||{});var opt=this.options;opt.raw&&0<opt.windowBits?opt.windowBits=-opt.windowBits:opt.gzip&&0<opt.windowBits&&16>opt.windowBits&&(opt.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ZStream,this.strm.avail_out=0;var status=zlib_deflate.deflateInit2(this.strm,opt.level,opt.method,opt.windowBits,opt.memLevel,opt.strategy);if(status!==Z_OK)throw new Error(msg[status]);if(opt.header&&zlib_deflate.deflateSetHeader(this.strm,opt.header),opt.dictionary){var dict;if(dict="string"==typeof opt.dictionary?strings.string2buf(opt.dictionary):"[object ArrayBuffer]"===toString.call(opt.dictionary)?new Uint8Array(opt.dictionary):opt.dictionary,status=zlib_deflate.deflateSetDictionary(this.strm,dict),status!==Z_OK)throw new Error(msg[status]);this._dict_set=!0}}function deflate(input,options){var deflator=new Deflate(options);if(deflator.push(input,!0),deflator.err)throw deflator.msg||msg[deflator.err];return deflator.result}var zlib_deflate=__webpack_require__("+BLB"),utils=__webpack_require__("tbG5"),strings=__webpack_require__("34Q3"),msg=__webpack_require__("gMAY"),ZStream=__webpack_require__("bdtv"),toString=Object.prototype.toString,Z_FINISH=4,Z_OK=0,Z_STREAM_END=1,Z_SYNC_FLUSH=2,Z_DEFAULT_COMPRESSION=-1,Z_DEFAULT_STRATEGY=0,Z_DEFLATED=8;Deflate.prototype.push=function(data,mode){var strm=this.strm,chunkSize=this.options.chunkSize,status,_mode;if(this.ended)return!1;_mode=mode===~~mode?mode:!0===mode?Z_FINISH:0,strm.input="string"==typeof data?strings.string2buf(data):"[object ArrayBuffer]"===toString.call(data)?new Uint8Array(data):data,strm.next_in=0,strm.avail_in=strm.input.length;do{if(0===strm.avail_out&&(strm.output=new utils.Buf8(chunkSize),strm.next_out=0,strm.avail_out=chunkSize),status=zlib_deflate.deflate(strm,_mode),status!==Z_STREAM_END&&status!==Z_OK)return this.onEnd(status),this.ended=!0,!1;(0===strm.avail_out||0===strm.avail_in&&(_mode===Z_FINISH||_mode===Z_SYNC_FLUSH))&&("string"===this.options.to?this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output,strm.next_out))):this.onData(utils.shrinkBuf(strm.output,strm.next_out)))}while((0<strm.avail_in||0===strm.avail_out)&&status!==Z_STREAM_END);return _mode===Z_FINISH?(status=zlib_deflate.deflateEnd(this.strm),this.onEnd(status),this.ended=!0,status===Z_OK):_mode!==Z_SYNC_FLUSH||(this.onEnd(Z_OK),strm.avail_out=0,!0)},Deflate.prototype.onData=function(chunk){this.chunks.push(chunk)},Deflate.prototype.onEnd=function(status){status===Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=utils.flattenChunks(this.chunks)),this.chunks=[],this.err=status,this.msg=this.strm.msg},exports.Deflate=Deflate,exports.deflate=deflate,exports.deflateRaw=function(input,options){return options=options||{},options.raw=!0,deflate(input,options)},exports.gzip=function(input,options){return options=options||{},options.gzip=!0,deflate(input,options)}},nR4t:function(module,exports,__webpack_require__){"use strict";function Uint8ArrayReader(data){ArrayReader.call(this,data)}var ArrayReader=__webpack_require__("TCoK"),utils=__webpack_require__("dvMn");utils.inherits(Uint8ArrayReader,ArrayReader),Uint8ArrayReader.prototype.readData=function(size){if(this.checkOffset(size),0===size)return new Uint8Array(0);var result=this.data.subarray(this.zero+this.index,this.zero+this.index+size);return this.index+=size,result},module.exports=Uint8ArrayReader},nwyA:function(module,exports,__webpack_require__){"use strict";function PassThrough(options){return this instanceof PassThrough?void Transform.call(this,options):new PassThrough(options)}module.exports=PassThrough;var Transform=__webpack_require__("7tlB"),util=__webpack_require__("Q14w");util.inherits=__webpack_require__("4Bm0"),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},p7rG:function(module,exports,__webpack_require__){"use strict";function FlateWorker(action,options){GenericWorker.call(this,"FlateWorker/"+action),this._pako=null,this._pakoAction=action,this._pakoOptions=options,this.meta={}}var USE_TYPEDARRAY="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,pako=__webpack_require__("f4vO"),utils=__webpack_require__("dvMn"),GenericWorker=__webpack_require__("ZKdc"),ARRAY_TYPE=USE_TYPEDARRAY?"uint8array":"array";exports.magic="\b\0",utils.inherits(FlateWorker,GenericWorker),FlateWorker.prototype.processChunk=function(chunk){this.meta=chunk.meta,null===this._pako&&this._createPako(),this._pako.push(utils.transformTo(ARRAY_TYPE,chunk.data),!1)},FlateWorker.prototype.flush=function(){GenericWorker.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},FlateWorker.prototype.cleanUp=function(){GenericWorker.prototype.cleanUp.call(this),this._pako=null},FlateWorker.prototype._createPako=function(){this._pako=new pako[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var self=this;this._pako.onData=function(data){self.push({data:data,meta:self.meta})}},exports.compressWorker=function(compressionOptions){return new FlateWorker("Deflate",compressionOptions)},exports.uncompressWorker=function(){return new FlateWorker("Inflate",{})}},pTe4:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){function getOption(conf,name){return"pairs"==name&&"string"==typeof conf?conf:"object"==typeof conf&&null!=conf[name]?conf[name]:defaults[name]}function ensureBound(chars){for(var i=0;i<chars.length;i++){var ch=chars.charAt(i),key="'"+ch+"'";keyMap[key]||(keyMap[key]=handler(ch))}}function handler(ch){return function(cm){return handleChar(cm,ch)}}function getConfig(cm){var deflt=cm.state.closeBrackets;if(!deflt||deflt.override)return deflt;var mode=cm.getModeAt(cm.getCursor());return mode.closeBrackets||deflt}function contractSelection(sel){var inverted=0<CodeMirror.cmpPos(sel.anchor,sel.head);return{anchor:new Pos(sel.anchor.line,sel.anchor.ch+(inverted?-1:1)),head:new Pos(sel.head.line,sel.head.ch+(inverted?1:-1))}}function handleChar(cm,ch){var conf=getConfig(cm);if(!conf||cm.getOption("disableInput"))return CodeMirror.Pass;var pairs=getOption(conf,"pairs"),pos=pairs.indexOf(ch);if(-1==pos)return CodeMirror.Pass;for(var triples=getOption(conf,"triples"),identical=pairs.charAt(pos+1)==ch,ranges=cm.listSelections(),opening=0==pos%2,i=0,type;i<ranges.length;i++){var range=ranges[i],cur=range.head,next=cm.getRange(cur,Pos(cur.line,cur.ch+1)),curType;if(opening&&!range.empty())curType="surround";else if((identical||!opening)&&next==ch)curType=identical&&stringStartsAfter(cm,cur)?"both":0<=triples.indexOf(ch)&&cm.getRange(cur,Pos(cur.line,cur.ch+3))==ch+ch+ch?"skipThree":"skip";else if(identical&&1<cur.ch&&0<=triples.indexOf(ch)&&cm.getRange(Pos(cur.line,cur.ch-2),cur)==ch+ch){if(2<cur.ch&&/\bstring/.test(cm.getTokenTypeAt(Pos(cur.line,cur.ch-2))))return CodeMirror.Pass;curType="addFour"}else if(identical){var prev=0==cur.ch?" ":cm.getRange(Pos(cur.line,cur.ch-1),cur);if(!CodeMirror.isWordChar(next)&&prev!=ch&&!CodeMirror.isWordChar(prev))curType="both";else return CodeMirror.Pass}else if(opening&&(cm.getLine(cur.line).length==cur.ch||isClosingBracket(next,pairs)||/\s/.test(next)))curType="both";else return CodeMirror.Pass;if(!type)type=curType;else if(type!=curType)return CodeMirror.Pass}var left=pos%2?pairs.charAt(pos-1):ch,right=pos%2?ch:pairs.charAt(pos+1);cm.operation(function(){if("skip"==type)cm.execCommand("goCharRight");else if("skipThree"==type)for(var i=0;3>i;i++)cm.execCommand("goCharRight");else if("surround"==type){for(var sels=cm.getSelections(),i=0;i<sels.length;i++)sels[i]=left+sels[i]+right;cm.replaceSelections(sels,"around"),sels=cm.listSelections().slice();for(var i=0;i<sels.length;i++)sels[i]=contractSelection(sels[i]);cm.setSelections(sels)}else"both"==type?(cm.replaceSelection(left+right,null),cm.triggerElectric(left+right),cm.execCommand("goCharLeft")):"addFour"==type&&(cm.replaceSelection(left+left+left+left,"before"),cm.execCommand("goCharRight"))})}function isClosingBracket(ch,pairs){var pos=pairs.lastIndexOf(ch);return-1<pos&&1==pos%2}function charsAround(cm,pos){var str=cm.getRange(Pos(pos.line,pos.ch-1),Pos(pos.line,pos.ch+1));return 2==str.length?str:null}function stringStartsAfter(cm,pos){var token=cm.getTokenAt(Pos(pos.line,pos.ch+1));return /\bstring/.test(token.type)&&token.start==pos.ch&&(0==pos.ch||!/\bstring/.test(cm.getTokenTypeAt(pos)))}var defaults={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},Pos=CodeMirror.Pos;CodeMirror.defineOption("autoCloseBrackets",!1,function(cm,val,old){old&&old!=CodeMirror.Init&&(cm.removeKeyMap(keyMap),cm.state.closeBrackets=null),val&&(ensureBound(getOption(val,"pairs")),cm.state.closeBrackets=val,cm.addKeyMap(keyMap))});var keyMap={Backspace:function(cm){var conf=getConfig(cm);if(!conf||cm.getOption("disableInput"))return CodeMirror.Pass;for(var pairs=getOption(conf,"pairs"),ranges=cm.listSelections(),i=0;i<ranges.length;i++){if(!ranges[i].empty())return CodeMirror.Pass;var around=charsAround(cm,ranges[i].head);if(!around||0!=pairs.indexOf(around)%2)return CodeMirror.Pass}for(var i=ranges.length-1,cur;0<=i;i--)cur=ranges[i].head,cm.replaceRange("",Pos(cur.line,cur.ch-1),Pos(cur.line,cur.ch+1),"+delete")},Enter:function(cm){var conf=getConfig(cm),explode=conf&&getOption(conf,"explode");if(!explode||cm.getOption("disableInput"))return CodeMirror.Pass;for(var ranges=cm.listSelections(),i=0;i<ranges.length;i++){if(!ranges[i].empty())return CodeMirror.Pass;var around=charsAround(cm,ranges[i].head);if(!around||0!=explode.indexOf(around)%2)return CodeMirror.Pass}cm.operation(function(){var linesep=cm.lineSeparator()||"\n";cm.replaceSelection(linesep+linesep,null),cm.execCommand("goCharLeft"),ranges=cm.listSelections();for(var i=0,line;i<ranges.length;i++)line=ranges[i].head.line,cm.indentLine(line,null,!0),cm.indentLine(line+1,null,!0)})}};ensureBound(defaults.pairs+"`")})},pwNi:function(module,exports,__webpack_require__){"use strict";var _preact=__webpack_require__("KM04");var interopDefault=function(m){return m&&m.default?m.default:m},app=interopDefault(__webpack_require__("JkW7"));if("function"==typeof app){var root=document.body.firstElementChild,init=function(){var app=interopDefault(__webpack_require__("JkW7"));root=(0,_preact.render)((0,_preact.h)(app),document.body,root)};!1,init()}},q6qL:function(module,exports,__webpack_require__){"use strict";(function(global,factory){module.exports=factory(__webpack_require__("KM04"))})(void 0,function(preact){var asyncGenerator=function(){function AwaitValue(value){this.value=value}function AsyncGenerator(gen){function resume(key,arg){try{var result=gen[key](arg),value=result.value;value instanceof AwaitValue?Promise.resolve(value.value).then(function(arg){resume("next",arg)},function(arg){resume("throw",arg)}):settle(result.done?"return":"normal",result.value)}catch(err){settle("throw",err)}}function settle(type,value){"return"===type?front.resolve({value:value,done:!0}):"throw"===type?front.reject(value):front.resolve({value:value,done:!1}),front=front.next,front?resume(front.key,front.arg):back=null}var front,back;this._invoke=function(key,arg){return new Promise(function(resolve,reject){var request={key:key,arg:arg,resolve:resolve,reject:reject,next:null};back?back=back.next=request:(front=back=request,resume(key,arg))})},"function"!=typeof gen.return&&(this.return=void 0)}return"function"==typeof Symbol&&Symbol.asyncIterator&&(AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),AsyncGenerator.prototype.next=function(arg){return this._invoke("next",arg)},AsyncGenerator.prototype.throw=function(arg){return this._invoke("throw",arg)},AsyncGenerator.prototype.return=function(arg){return this._invoke("return",arg)},{wrap:function(fn){return function(){return new AsyncGenerator(fn.apply(this,arguments))}},await:function(value){return new AwaitValue(value)}}}(),classCallCheck=function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")},inherits=function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)},possibleConstructorReturn=function(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return call&&("object"==typeof call||"function"==typeof call)?call:self},Portal=function(_Component){function Portal(){return classCallCheck(this,Portal),possibleConstructorReturn(this,_Component.apply(this,arguments))}return inherits(Portal,_Component),Portal.prototype.componentDidUpdate=function(props){for(var i in props)if(props[i]!==this.props[i])return setTimeout(this.renderLayer)},Portal.prototype.componentDidMount=function(){this.isMounted=!0,this.renderLayer=this.renderLayer.bind(this),this.renderLayer()},Portal.prototype.componentWillUnmount=function(){this.renderLayer(!1),this.isMounted=!1,this.remote&&this.remote.parentNode.removeChild(this.remote)},Portal.prototype.findNode=function(node){return"string"==typeof node?document.querySelector(node):node},Portal.prototype.renderLayer=function(){var show=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!0;this.isMounted&&(this.props.into!==this.intoPointer&&(this.intoPointer=this.props.into,this.into&&this.remote&&(this.remote=preact.render(preact.h(PortalProxy,null),this.into,this.remote)),this.into=this.findNode(this.props.into)),this.remote=preact.render(preact.h(PortalProxy,{context:this.context},show&&this.props.children||null),this.into,this.remote))},Portal.prototype.render=function(){return null},Portal}(preact.Component),PortalProxy=function(_Component2){function PortalProxy(){return classCallCheck(this,PortalProxy),possibleConstructorReturn(this,_Component2.apply(this,arguments))}return inherits(PortalProxy,_Component2),PortalProxy.prototype.getChildContext=function(){return this.props.context},PortalProxy.prototype.render=function(_ref){var children=_ref.children;return children&&children[0]||null},PortalProxy}(preact.Component);return Portal})},qdP6:function(module){"use strict";module.exports=function(it){if("function"!=typeof it)throw TypeError(it+" is not a function!");return it}},qqFR:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){CodeMirror.defineMode("javascript",function(config,parserConfig){function readRegexp(stream){for(var escaped=!1,inSet=!1,next;null!=(next=stream.next());){if(!escaped){if("/"==next&&!inSet)return;"["==next?inSet=!0:inSet&&"]"==next&&(inSet=!1)}escaped=!escaped&&"\\"==next}}function ret(tp,style,cont){return type=tp,content=cont,style}function tokenBase(stream,state){var ch=stream.next();if("\""==ch||"'"==ch)return state.tokenize=tokenString(ch),state.tokenize(stream,state);if("."==ch&&stream.match(/^\d+(?:[eE][+\-]?\d+)?/))return ret("number","number");if("."==ch&&stream.match(".."))return ret("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(ch))return ret(ch);if("="==ch&&stream.eat(">"))return ret("=>","operator");if("0"==ch&&stream.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return ret("number","number");if(/\d/.test(ch))return stream.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),ret("number","number");if("/"==ch)return stream.eat("*")?(state.tokenize=tokenComment,tokenComment(stream,state)):stream.eat("/")?(stream.skipToEnd(),ret("comment","comment")):expressionAllowed(stream,state,1)?(readRegexp(stream),stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),ret("regexp","string-2")):(stream.eat("="),ret("operator","operator",stream.current()));if("`"==ch)return state.tokenize=tokenQuasi,tokenQuasi(stream,state);if("#"==ch)return stream.skipToEnd(),ret("error","error");if(isOperatorChar.test(ch))return">"==ch&&state.lexical&&">"==state.lexical.type||(stream.eat("=")?("!"==ch||"="==ch)&&stream.eat("="):/[<>*+\-]/.test(ch)&&(stream.eat(ch),">"==ch&&stream.eat(ch))),ret("operator","operator",stream.current());if(wordRE.test(ch)){stream.eatWhile(wordRE);var word=stream.current();if("."!=state.lastType){if(keywords.propertyIsEnumerable(word)){var kw=keywords[word];return ret(kw.type,kw.style,word)}if("async"==word&&stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return ret("async","keyword",word)}return ret("variable","variable",word)}}function tokenString(quote){return function(stream,state){var escaped=!1,next;if(jsonldMode&&"@"==stream.peek()&&stream.match(isJsonldKeyword))return state.tokenize=tokenBase,ret("jsonld-keyword","meta");for(;null!=(next=stream.next())&&(next!=quote||escaped);)escaped=!escaped&&"\\"==next;return escaped||(state.tokenize=tokenBase),ret("string","string")}}function tokenComment(stream,state){for(var maybeEnd=!1,ch;ch=stream.next();){if("/"==ch&&maybeEnd){state.tokenize=tokenBase;break}maybeEnd="*"==ch}return ret("comment","comment")}function tokenQuasi(stream,state){for(var escaped=!1,next;null!=(next=stream.next());){if(!escaped&&("`"==next||"$"==next&&stream.eat("{"))){state.tokenize=tokenBase;break}escaped=!escaped&&"\\"==next}return ret("quasi","string-2",stream.current())}function findFatArrow(stream,state){state.fatArrowAt&&(state.fatArrowAt=null);var arrow=stream.string.indexOf("=>",stream.start);if(!(0>arrow)){if(isTS){var m=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start,arrow));m&&(arrow=m.index)}for(var depth=0,sawSomething=!1,pos=arrow-1;0<=pos;--pos){var ch=stream.string.charAt(pos),bracket=brackets.indexOf(ch);if(0<=bracket&&3>bracket){if(!depth){++pos;break}if(0==--depth){"("==ch&&(sawSomething=!0);break}}else if(3<=bracket&&6>bracket)++depth;else if(wordRE.test(ch))sawSomething=!0;else{if(/["'\/]/.test(ch))return;if(sawSomething&&!depth){++pos;break}}}sawSomething&&!depth&&(state.fatArrowAt=pos)}}function JSLexical(indented,column,type,align,prev,info){this.indented=indented,this.column=column,this.type=type,this.prev=prev,this.info=info,null!=align&&(this.align=align)}function inScope(state,varname){for(var v=state.localVars;v;v=v.next)if(v.name==varname)return!0;for(var cx=state.context;cx;cx=cx.prev)for(var v=cx.vars;v;v=v.next)if(v.name==varname)return!0}function parseJS(state,style,type,content,stream){var cc=state.cc;for(cx.state=state,cx.stream=stream,cx.marked=null,cx.cc=cc,cx.style=style,state.lexical.hasOwnProperty("align")||(state.lexical.align=!0);;){var combinator=cc.length?cc.pop():jsonMode?expression:statement;if(combinator(type,content)){for(;cc.length&&cc[cc.length-1].lex;)cc.pop()();return cx.marked?cx.marked:"variable"==type&&inScope(state,content)?"variable-2":style}}}function pass(){for(var i=arguments.length-1;0<=i;i--)cx.cc.push(arguments[i])}function cont(){return pass.apply(null,arguments),!0}function inList(name,list){for(var v=list;v;v=v.next)if(v.name==name)return!0;return!1}function register(varname){var state=cx.state;if(cx.marked="def",state.context)if("var"==state.lexical.info&&state.context&&state.context.block){var newContext=registerVarScoped(varname,state.context);if(null!=newContext)return void(state.context=newContext)}else if(!inList(varname,state.localVars))return void(state.localVars=new Var(varname,state.localVars));parserConfig.globalVars&&!inList(varname,state.globalVars)&&(state.globalVars=new Var(varname,state.globalVars))}function registerVarScoped(varname,context){if(!context)return null;if(context.block){var inner=registerVarScoped(varname,context.prev);return inner?inner==context.prev?context:new Context(inner,context.vars,!0):null}return inList(varname,context.vars)?context:new Context(context.prev,new Var(varname,context.vars),!1)}function isModifier(name){return"public"==name||"private"==name||"protected"==name||"abstract"==name||"readonly"==name}function Context(prev,vars,block){this.prev=prev,this.vars=vars,this.block=block}function Var(name,next){this.name=name,this.next=next}function pushcontext(){cx.state.context=new Context(cx.state.context,cx.state.localVars,!1),cx.state.localVars=defaultVars}function pushblockcontext(){cx.state.context=new Context(cx.state.context,cx.state.localVars,!0),cx.state.localVars=null}function popcontext(){cx.state.localVars=cx.state.context.vars,cx.state.context=cx.state.context.prev}function pushlex(type,info){var result=function(){var state=cx.state,indent=state.indented;if("stat"==state.lexical.type)indent=state.lexical.indented;else for(var outer=state.lexical;outer&&")"==outer.type&&outer.align;outer=outer.prev)indent=outer.indented;state.lexical=new JSLexical(indent,cx.stream.column(),type,null,state.lexical,info)};return result.lex=!0,result}function poplex(){var state=cx.state;state.lexical.prev&&(")"==state.lexical.type&&(state.indented=state.lexical.indented),state.lexical=state.lexical.prev)}function expect(wanted){function exp(type){return type==wanted?cont():";"==wanted?pass():cont(exp)}return exp}function statement(type,value){return"var"==type?cont(pushlex("vardef",value),vardef,expect(";"),poplex):"keyword a"==type?cont(pushlex("form"),parenExpr,statement,poplex):"keyword b"==type?cont(pushlex("form"),statement,poplex):"keyword d"==type?cx.stream.match(/^\s*$/,!1)?cont():cont(pushlex("stat"),maybeexpression,expect(";"),poplex):"debugger"==type?cont(expect(";")):"{"==type?cont(pushlex("}"),pushblockcontext,block,poplex,popcontext):";"==type?cont():"if"==type?("else"==cx.state.lexical.info&&cx.state.cc[cx.state.cc.length-1]==poplex&&cx.state.cc.pop()(),cont(pushlex("form"),parenExpr,statement,poplex,maybeelse)):"function"==type?cont(functiondef):"for"==type?cont(pushlex("form"),forspec,statement,poplex):"class"==type||isTS&&"interface"==value?(cx.marked="keyword",cont(pushlex("form"),className,poplex)):"variable"==type?isTS&&"declare"==value?(cx.marked="keyword",cont(statement)):isTS&&("module"==value||"enum"==value||"type"==value)&&cx.stream.match(/^\s*\w/,!1)?(cx.marked="keyword","enum"==value?cont(enumdef):"type"==value?cont(typeexpr,expect("operator"),typeexpr,expect(";")):cont(pushlex("form"),pattern,expect("{"),pushlex("}"),block,poplex,poplex)):isTS&&"namespace"==value?(cx.marked="keyword",cont(pushlex("form"),expression,block,poplex)):isTS&&"abstract"==value?(cx.marked="keyword",cont(statement)):cont(pushlex("stat"),maybelabel):"switch"==type?cont(pushlex("form"),parenExpr,expect("{"),pushlex("}","switch"),pushblockcontext,block,poplex,poplex,popcontext):"case"==type?cont(expression,expect(":")):"default"==type?cont(expect(":")):"catch"==type?cont(pushlex("form"),pushcontext,maybeCatchBinding,statement,poplex,popcontext):"export"==type?cont(pushlex("stat"),afterExport,poplex):"import"==type?cont(pushlex("stat"),afterImport,poplex):"async"==type?cont(statement):"@"==value?cont(expression,statement):pass(pushlex("stat"),expression,expect(";"),poplex)}function maybeCatchBinding(type){if("("==type)return cont(funarg,expect(")"))}function expression(type,value){return expressionInner(type,value,!1)}function expressionNoComma(type,value){return expressionInner(type,value,!0)}function parenExpr(type){return"("==type?cont(pushlex(")"),expression,expect(")"),poplex):pass()}function expressionInner(type,value,noComma){if(cx.state.fatArrowAt==cx.stream.start){var body=noComma?arrowBodyNoComma:arrowBody;if("("==type)return cont(pushcontext,pushlex(")"),commasep(funarg,")"),poplex,expect("=>"),body,popcontext);if("variable"==type)return pass(pushcontext,pattern,expect("=>"),body,popcontext)}var maybeop=noComma?maybeoperatorNoComma:maybeoperatorComma;return atomicTypes.hasOwnProperty(type)?cont(maybeop):"function"==type?cont(functiondef,maybeop):"class"==type||isTS&&"interface"==value?(cx.marked="keyword",cont(pushlex("form"),classExpression,poplex)):"keyword c"==type||"async"==type?cont(noComma?expressionNoComma:expression):"("==type?cont(pushlex(")"),maybeexpression,expect(")"),poplex,maybeop):"operator"==type||"spread"==type?cont(noComma?expressionNoComma:expression):"["==type?cont(pushlex("]"),arrayLiteral,poplex,maybeop):"{"==type?contCommasep(objprop,"}",null,maybeop):"quasi"==type?pass(quasi,maybeop):"new"==type?cont(maybeTarget(noComma)):"import"==type?cont(expression):cont()}function maybeexpression(type){return type.match(/[;\}\)\],]/)?pass():pass(expression)}function maybeoperatorComma(type,value){return","==type?cont(expression):maybeoperatorNoComma(type,value,!1)}function maybeoperatorNoComma(type,value,noComma){var me=!1==noComma?maybeoperatorComma:maybeoperatorNoComma,expr=!1==noComma?expression:expressionNoComma;return"=>"==type?cont(pushcontext,noComma?arrowBodyNoComma:arrowBody,popcontext):"operator"==type?/\+\+|--/.test(value)||isTS&&"!"==value?cont(me):isTS&&"<"==value&&cx.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?cont(pushlex(">"),commasep(typeexpr,">"),poplex,me):"?"==value?cont(expression,expect(":"),expr):cont(expr):"quasi"==type?pass(quasi,me):";"==type?void 0:"("==type?contCommasep(expressionNoComma,")","call",me):"."==type?cont(property,me):"["==type?cont(pushlex("]"),maybeexpression,expect("]"),poplex,me):isTS&&"as"==value?(cx.marked="keyword",cont(typeexpr,me)):"regexp"==type?(cx.state.lastType=cx.marked="operator",cx.stream.backUp(cx.stream.pos-cx.stream.start-1),cont(expr)):void 0}function quasi(type,value){return"quasi"==type?"${"==value.slice(value.length-2)?cont(expression,continueQuasi):cont(quasi):pass()}function continueQuasi(type){if("}"==type)return cx.marked="string-2",cx.state.tokenize=tokenQuasi,cont(quasi)}function arrowBody(type){return findFatArrow(cx.stream,cx.state),pass("{"==type?statement:expression)}function arrowBodyNoComma(type){return findFatArrow(cx.stream,cx.state),pass("{"==type?statement:expressionNoComma)}function maybeTarget(noComma){return function(type){return"."==type?cont(noComma?targetNoComma:target):"variable"==type&&isTS?cont(maybeTypeArgs,noComma?maybeoperatorNoComma:maybeoperatorComma):pass(noComma?expressionNoComma:expression)}}function target(_,value){if("target"==value)return cx.marked="keyword",cont(maybeoperatorComma)}function targetNoComma(_,value){if("target"==value)return cx.marked="keyword",cont(maybeoperatorNoComma)}function maybelabel(type){return":"==type?cont(poplex,statement):pass(maybeoperatorComma,expect(";"),poplex)}function property(type){if("variable"==type)return cx.marked="property",cont()}function objprop(type,value){if("async"==type)return cx.marked="property",cont(objprop);if("variable"==type||"keyword"==cx.style){if(cx.marked="property","get"==value||"set"==value)return cont(getterSetter);var m;return isTS&&cx.state.fatArrowAt==cx.stream.start&&(m=cx.stream.match(/^\s*:\s*/,!1))&&(cx.state.fatArrowAt=cx.stream.pos+m[0].length),cont(afterprop)}return"number"==type||"string"==type?(cx.marked=jsonldMode?"property":cx.style+" property",cont(afterprop)):"jsonld-keyword"==type?cont(afterprop):isTS&&isModifier(value)?(cx.marked="keyword",cont(objprop)):"["==type?cont(expression,maybetype,expect("]"),afterprop):"spread"==type?cont(expressionNoComma,afterprop):"*"==value?(cx.marked="keyword",cont(objprop)):":"==type?pass(afterprop):void 0}function getterSetter(type){return"variable"==type?(cx.marked="property",cont(functiondef)):pass(afterprop)}function afterprop(type){return":"==type?cont(expressionNoComma):"("==type?pass(functiondef):void 0}function commasep(what,end,sep){function proceed(type,value){if(sep?-1<sep.indexOf(type):","==type){var lex=cx.state.lexical;return"call"==lex.info&&(lex.pos=(lex.pos||0)+1),cont(function(type,value){return type==end||value==end?pass():pass(what)},proceed)}return type==end||value==end?cont():cont(expect(end))}return function(type,value){return type==end||value==end?cont():pass(what,proceed)}}function contCommasep(what,end,info){for(var i=3;i<arguments.length;i++)cx.cc.push(arguments[i]);return cont(pushlex(end,info),commasep(what,end),poplex)}function block(type){return"}"==type?cont():pass(statement,block)}function maybetype(type,value){if(isTS){if(":"==type)return cont(typeexpr);if("?"==value)return cont(maybetype)}}function mayberettype(type){if(isTS&&":"==type)return cx.stream.match(/^\s*\w+\s+is\b/,!1)?cont(expression,isKW,typeexpr):cont(typeexpr)}function isKW(_,value){if("is"==value)return cx.marked="keyword",cont()}function typeexpr(type,value){return"keyof"==value||"typeof"==value?(cx.marked="keyword",cont("keyof"==value?typeexpr:expressionNoComma)):"variable"==type||"void"==value?(cx.marked="type",cont(afterType)):"string"==type||"number"==type||"atom"==type?cont(afterType):"["==type?cont(pushlex("]"),commasep(typeexpr,"]",","),poplex,afterType):"{"==type?cont(pushlex("}"),commasep(typeprop,"}",",;"),poplex,afterType):"("==type?cont(commasep(typearg,")"),maybeReturnType):"<"==type?cont(commasep(typeexpr,">"),typeexpr):void 0}function maybeReturnType(type){if("=>"==type)return cont(typeexpr)}function typeprop(type,value){return"variable"==type||"keyword"==cx.style?(cx.marked="property",cont(typeprop)):"?"==value?cont(typeprop):":"==type?cont(typeexpr):"["==type?cont(expression,maybetype,expect("]"),typeprop):void 0}function typearg(type,value){return"variable"==type&&cx.stream.match(/^\s*[?:]/,!1)||"?"==value?cont(typearg):":"==type?cont(typeexpr):pass(typeexpr)}function afterType(type,value){return"<"==value?cont(pushlex(">"),commasep(typeexpr,">"),poplex,afterType):"|"==value||"."==type||"&"==value?cont(typeexpr):"["==type?cont(expect("]"),afterType):"extends"==value||"implements"==value?(cx.marked="keyword",cont(typeexpr)):void 0}function maybeTypeArgs(_,value){if("<"==value)return cont(pushlex(">"),commasep(typeexpr,">"),poplex,afterType)}function typeparam(){return pass(typeexpr,maybeTypeDefault)}function maybeTypeDefault(_,value){if("="==value)return cont(typeexpr)}function vardef(_,value){return"enum"==value?(cx.marked="keyword",cont(enumdef)):pass(pattern,maybetype,maybeAssign,vardefCont)}function pattern(type,value){return isTS&&isModifier(value)?(cx.marked="keyword",cont(pattern)):"variable"==type?(register(value),cont()):"spread"==type?cont(pattern):"["==type?contCommasep(pattern,"]"):"{"==type?contCommasep(proppattern,"}"):void 0}function proppattern(type,value){return"variable"!=type||cx.stream.match(/^\s*:/,!1)?("variable"==type&&(cx.marked="property"),"spread"==type?cont(pattern):"}"==type?pass():cont(expect(":"),pattern,maybeAssign)):(register(value),cont(maybeAssign))}function maybeAssign(_type,value){if("="==value)return cont(expressionNoComma)}function vardefCont(type){if(","==type)return cont(vardef)}function maybeelse(type,value){if("keyword b"==type&&"else"==value)return cont(pushlex("form","else"),statement,poplex)}function forspec(type,value){return"await"==value?cont(forspec):"("==type?cont(pushlex(")"),forspec1,expect(")"),poplex):void 0}function forspec1(type){return"var"==type?cont(vardef,expect(";"),forspec2):";"==type?cont(forspec2):"variable"==type?cont(formaybeinof):pass(expression,expect(";"),forspec2)}function formaybeinof(_type,value){return"in"==value||"of"==value?(cx.marked="keyword",cont(expression)):cont(maybeoperatorComma,forspec2)}function forspec2(type,value){return";"==type?cont(forspec3):"in"==value||"of"==value?(cx.marked="keyword",cont(expression)):pass(expression,expect(";"),forspec3)}function forspec3(type){")"!=type&&cont(expression)}function functiondef(type,value){return"*"==value?(cx.marked="keyword",cont(functiondef)):"variable"==type?(register(value),cont(functiondef)):"("==type?cont(pushcontext,pushlex(")"),commasep(funarg,")"),poplex,mayberettype,statement,popcontext):isTS&&"<"==value?cont(pushlex(">"),commasep(typeparam,">"),poplex,functiondef):void 0}function funarg(type,value){return"@"==value&&cont(expression,funarg),"spread"==type?cont(funarg):isTS&&isModifier(value)?(cx.marked="keyword",cont(funarg)):pass(pattern,maybetype,maybeAssign)}function classExpression(type,value){return"variable"==type?className(type,value):classNameAfter(type,value)}function className(type,value){if("variable"==type)return register(value),cont(classNameAfter)}function classNameAfter(type,value){return"<"==value?cont(pushlex(">"),commasep(typeparam,">"),poplex,classNameAfter):"extends"==value||"implements"==value||isTS&&","==type?("implements"==value&&(cx.marked="keyword"),cont(isTS?typeexpr:expression,classNameAfter)):"{"==type?cont(pushlex("}"),classBody,poplex):void 0}function classBody(type,value){return"async"==type||"variable"==type&&("static"==value||"get"==value||"set"==value||isTS&&isModifier(value))&&cx.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(cx.marked="keyword",cont(classBody)):"variable"==type||"keyword"==cx.style?(cx.marked="property",cont(isTS?classfield:functiondef,classBody)):"["==type?cont(expression,maybetype,expect("]"),isTS?classfield:functiondef,classBody):"*"==value?(cx.marked="keyword",cont(classBody)):";"==type?cont(classBody):"}"==type?cont():"@"==value?cont(expression,classBody):void 0}function classfield(type,value){return"?"==value?cont(classfield):":"==type?cont(typeexpr,maybeAssign):"="==value?cont(expressionNoComma):pass(functiondef)}function afterExport(type,value){return"*"==value?(cx.marked="keyword",cont(maybeFrom,expect(";"))):"default"==value?(cx.marked="keyword",cont(expression,expect(";"))):"{"==type?cont(commasep(exportField,"}"),maybeFrom,expect(";")):pass(statement)}function exportField(type,value){return"as"==value?(cx.marked="keyword",cont(expect("variable"))):"variable"==type?pass(expressionNoComma,exportField):void 0}function afterImport(type){return"string"==type?cont():"("==type?pass(expression):pass(importSpec,maybeMoreImports,maybeFrom)}function importSpec(type,value){return"{"==type?contCommasep(importSpec,"}"):("variable"==type&®ister(value),"*"==value&&(cx.marked="keyword"),cont(maybeAs))}function maybeMoreImports(type){if(","==type)return cont(importSpec,maybeMoreImports)}function maybeAs(_type,value){if("as"==value)return cx.marked="keyword",cont(importSpec)}function maybeFrom(_type,value){if("from"==value)return cx.marked="keyword",cont(expression)}function arrayLiteral(type){return"]"==type?cont():pass(commasep(expressionNoComma,"]"))}function enumdef(){return pass(pushlex("form"),pattern,expect("{"),pushlex("}"),commasep(enummember,"}"),poplex,poplex)}function enummember(){return pass(pattern,maybeAssign)}function isContinuedStatement(state,textAfter){return"operator"==state.lastType||","==state.lastType||isOperatorChar.test(textAfter.charAt(0))||/[,.]/.test(textAfter.charAt(0))}function expressionAllowed(stream,state,backUp){return state.tokenize==tokenBase&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType)||"quasi"==state.lastType&&/\{\s*$/.test(stream.string.slice(0,stream.pos-(backUp||0)))}var indentUnit=config.indentUnit,statementIndent=parserConfig.statementIndent,jsonldMode=parserConfig.jsonld,jsonMode=parserConfig.json||jsonldMode,isTS=parserConfig.typescript,wordRE=parserConfig.wordCharacters||/[\w$\xa1-\uffff]/,keywords=function(){function kw(type){return{type:type,style:"keyword"}}var A=kw("keyword a"),B=kw("keyword b"),C=kw("keyword c"),D=kw("keyword d"),operator=kw("operator"),atom={type:"atom",style:"atom"};return{if:kw("if"),while:A,with:A,else:B,do:B,try:B,finally:B,return:D,break:D,continue:D,new:kw("new"),delete:C,void:C,throw:C,debugger:kw("debugger"),var:kw("var"),const:kw("var"),let:kw("var"),function:kw("function"),catch:kw("catch"),for:kw("for"),switch:kw("switch"),case:kw("case"),default:kw("default"),in:operator,typeof:operator,instanceof:operator,true:atom,false:atom,null:atom,undefined:atom,NaN:atom,Infinity:atom,this:kw("this"),class:kw("class"),super:kw("atom"),yield:C,export:kw("export"),import:kw("import"),extends:C,await:C}}(),isOperatorChar=/[+\-*&%=<>!?|~^@]/,isJsonldKeyword=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,brackets="([{}])",atomicTypes={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},cx={state:null,column:null,marked:null,cc:null},defaultVars=new Var("this",new Var("arguments",null)),type,content;return popcontext.lex=!0,poplex.lex=!0,{startState:function(basecolumn){var state={tokenize:tokenBase,lastType:"sof",cc:[],lexical:new JSLexical((basecolumn||0)-indentUnit,0,"block",!1),localVars:parserConfig.localVars,context:parserConfig.localVars&&new Context(null,null,!1),indented:basecolumn||0};return parserConfig.globalVars&&"object"==typeof parserConfig.globalVars&&(state.globalVars=parserConfig.globalVars),state},token:function(stream,state){if(stream.sol()&&(!state.lexical.hasOwnProperty("align")&&(state.lexical.align=!1),state.indented=stream.indentation(),findFatArrow(stream,state)),state.tokenize!=tokenComment&&stream.eatSpace())return null;var style=state.tokenize(stream,state);return"comment"==type?style:(state.lastType="operator"==type&&("++"==content||"--"==content)?"incdec":type,parseJS(state,style,type,content,stream))},indent:function(state,textAfter){if(state.tokenize==tokenComment)return CodeMirror.Pass;if(state.tokenize!=tokenBase)return 0;var firstChar=textAfter&&textAfter.charAt(0),lexical=state.lexical,top;if(!/^\s*else\b/.test(textAfter))for(var i=state.cc.length-1,c;0<=i;--i)if(c=state.cc[i],c==poplex)lexical=lexical.prev;else if(c!=maybeelse)break;for(;("stat"==lexical.type||"form"==lexical.type)&&("}"==firstChar||(top=state.cc[state.cc.length-1])&&(top==maybeoperatorComma||top==maybeoperatorNoComma)&&!/^[,\.=+\-*:?[\(]/.test(textAfter));)lexical=lexical.prev;statementIndent&&")"==lexical.type&&"stat"==lexical.prev.type&&(lexical=lexical.prev);var type=lexical.type,closing=firstChar==type;return"vardef"==type?lexical.indented+("operator"==state.lastType||","==state.lastType?lexical.info.length+1:0):"form"==type&&"{"==firstChar?lexical.indented:"form"==type?lexical.indented+indentUnit:"stat"==type?lexical.indented+(isContinuedStatement(state,textAfter)?statementIndent||indentUnit:0):"switch"!=lexical.info||closing||!1==parserConfig.doubleIndentSwitch?lexical.align?lexical.column+(closing?0:1):lexical.indented+(closing?0:indentUnit):lexical.indented+(/^(?:case|default)\b/.test(textAfter)?indentUnit:2*indentUnit)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:jsonMode?null:"/*",blockCommentEnd:jsonMode?null:"*/",blockCommentContinue:jsonMode?null:" * ",lineComment:jsonMode?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:jsonMode?"json":"javascript",jsonldMode:jsonldMode,jsonMode:jsonMode,expressionAllowed:expressionAllowed,skipExpression:function(state){var top=state.cc[state.cc.length-1];(top==expression||top==expressionNoComma)&&state.cc.pop()}}}),CodeMirror.registerHelper("wordChars","javascript",/[\w$]/),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("text/ecmascript","javascript"),CodeMirror.defineMIME("application/javascript","javascript"),CodeMirror.defineMIME("application/x-javascript","javascript"),CodeMirror.defineMIME("application/ecmascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMIME("application/x-json",{name:"javascript",json:!0}),CodeMirror.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),CodeMirror.defineMIME("text/typescript",{name:"javascript",typescript:!0}),CodeMirror.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},rAgE:function(module,exports,__webpack_require__){"use strict";function ZipEntries(loadOptions){this.files=[],this.loadOptions=loadOptions}var readerFor=__webpack_require__("9Uuy"),utils=__webpack_require__("dvMn"),sig=__webpack_require__("Ctqd"),ZipEntry=__webpack_require__("dFUs"),utf8=__webpack_require__("Sm7/"),support=__webpack_require__("untT");ZipEntries.prototype={checkSignature:function(expectedSignature){if(!this.reader.readAndCheckSignature(expectedSignature)){this.reader.index-=4;var signature=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+utils.pretty(signature)+", expected "+utils.pretty(expectedSignature)+")")}},isSignature:function(askedIndex,expectedSignature){var currentIndex=this.reader.index;this.reader.setIndex(askedIndex);var signature=this.reader.readString(4);return this.reader.setIndex(currentIndex),signature===expectedSignature},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var zipComment=this.reader.readData(this.zipCommentLength),decodeParamType=support.uint8array?"uint8array":"array",decodeContent=utils.transformTo(decodeParamType,zipComment);this.zipComment=this.loadOptions.decodeFileName(decodeContent)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var extraDataSize=this.zip64EndOfCentralSize-44,extraFieldId,extraFieldLength,extraFieldValue;0<extraDataSize;)extraFieldId=this.reader.readInt(2),extraFieldLength=this.reader.readInt(4),extraFieldValue=this.reader.readData(extraFieldLength),this.zip64ExtensibleData[extraFieldId]={id:extraFieldId,length:extraFieldLength,value:extraFieldValue}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var i,file;for(i=0;i<this.files.length;i++)file=this.files[i],this.reader.setIndex(file.localHeaderOffset),this.checkSignature(sig.LOCAL_FILE_HEADER),file.readLocalPart(this.reader),file.handleUTF8(),file.processAttributes()},readCentralDir:function(){var file;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(sig.CENTRAL_FILE_HEADER);)file=new ZipEntry({zip64:this.zip64},this.loadOptions),file.readCentralPart(this.reader),this.files.push(file);if(this.centralDirRecords!==this.files.length)if(0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length);else;},readEndOfCentral:function(){var offset=this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);if(0>offset){var isGarbage=!this.isSignature(0,sig.LOCAL_FILE_HEADER);if(isGarbage)throw new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");else throw new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(offset);var endOfCentralDirOffset=offset;if(this.checkSignature(sig.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===utils.MAX_VALUE_16BITS||this.diskWithCentralDirStart===utils.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===utils.MAX_VALUE_16BITS||this.centralDirRecords===utils.MAX_VALUE_16BITS||this.centralDirSize===utils.MAX_VALUE_32BITS||this.centralDirOffset===utils.MAX_VALUE_32BITS){if(this.zip64=!0,offset=this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR),0>offset)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(offset),this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,sig.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_END),0>this.relativeOffsetEndOfZip64CentralDir))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var expectedEndOfCentralDirOffset=this.centralDirOffset+this.centralDirSize;this.zip64&&(expectedEndOfCentralDirOffset+=20,expectedEndOfCentralDirOffset+=12+this.zip64EndOfCentralSize);var extraBytes=endOfCentralDirOffset-expectedEndOfCentralDirOffset;if(0<extraBytes)this.isSignature(endOfCentralDirOffset,sig.CENTRAL_FILE_HEADER)||(this.reader.zero=extraBytes);else if(0>extraBytes)throw new Error("Corrupted zip: missing "+Math.abs(extraBytes)+" bytes.")},prepareReader:function(data){this.reader=readerFor(data)},load:function(data){this.prepareReader(data),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},module.exports=ZipEntries},rbVD:function(module,exports,__webpack_require__){"use strict";var _Mathmax4=Math.max;(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){function Completion(cm,options){this.cm=cm,this.options=options,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var self=this;cm.on("cursorActivity",this.activityFunc=function(){self.cursorActivity()})}function parseOptions(cm,pos,options){var editor=cm.options.hintOptions,out={};for(var prop in defaultOptions)out[prop]=defaultOptions[prop];if(editor)for(var prop in editor)void 0!==editor[prop]&&(out[prop]=editor[prop]);if(options)for(var prop in options)void 0!==options[prop]&&(out[prop]=options[prop]);return out.hint.resolve&&(out.hint=out.hint.resolve(cm,pos)),out}function getText(completion){return"string"==typeof completion?completion:completion.text}function buildKeyMap(completion,handle){function addBinding(key,val){var bound;bound="string"==typeof val?baseMap.hasOwnProperty(val)?baseMap[val]:val:function(cm){return val(cm,handle)},ourMap[key]=bound}var baseMap={Up:function(){handle.moveFocus(-1)},Down:function(){handle.moveFocus(1)},PageUp:function(){handle.moveFocus(-handle.menuSize()+1,!0)},PageDown:function(){handle.moveFocus(handle.menuSize()-1,!0)},Home:function(){handle.setFocus(0)},End:function(){handle.setFocus(handle.length-1)},Enter:handle.pick,Tab:handle.pick,Esc:handle.close},custom=completion.options.customKeys,ourMap=custom?{}:baseMap;if(custom)for(var key in custom)custom.hasOwnProperty(key)&&addBinding(key,custom[key]);var extra=completion.options.extraKeys;if(extra)for(var key in extra)extra.hasOwnProperty(key)&&addBinding(key,extra[key]);return ourMap}function getHintElement(hintsElement,el){for(;el&&el!=hintsElement;){if("LI"===el.nodeName.toUpperCase()&&el.parentNode==hintsElement)return el;el=el.parentNode}}function Widget(completion,data){this.completion=completion,this.data=data,this.picked=!1;var widget=this,cm=completion.cm,hints=this.hints=document.createElement("ul");hints.className="CodeMirror-hints",this.selectedHint=data.selectedHint||0;for(var completions=data.list,i=0;i<completions.length;++i){var elt=hints.appendChild(document.createElement("li")),cur=completions[i],className=HINT_ELEMENT_CLASS+(i==this.selectedHint?" "+ACTIVE_HINT_ELEMENT_CLASS:"");null!=cur.className&&(className=cur.className+" "+className),elt.className=className,cur.render?cur.render(elt,data,cur):elt.appendChild(document.createTextNode(cur.displayText||getText(cur))),elt.hintId=i}var pos=cm.cursorCoords(completion.options.alignWithWord?data.from:null),left=pos.left,top=pos.bottom,below=!0;hints.style.left=left+"px",hints.style.top=top+"px";var winW=window.innerWidth||_Mathmax4(document.body.offsetWidth,document.documentElement.offsetWidth),winH=window.innerHeight||_Mathmax4(document.body.offsetHeight,document.documentElement.offsetHeight);(completion.options.container||document.body).appendChild(hints);var box=hints.getBoundingClientRect(),overlapY=box.bottom-winH,scrolls=hints.scrollHeight>hints.clientHeight+1,startScroll=cm.getScrollInfo();if(0<overlapY){var height=box.bottom-box.top,curTop=pos.top-(pos.bottom-box.top);if(0<curTop-height)hints.style.top=(top=pos.top-height)+"px",below=!1;else if(height>winH){hints.style.height=winH-5+"px",hints.style.top=(top=pos.bottom-box.top)+"px";var cursor=cm.getCursor();data.from.ch!=cursor.ch&&(pos=cm.cursorCoords(cursor),hints.style.left=(left=pos.left)+"px",box=hints.getBoundingClientRect())}}var overlapX=box.right-winW;if(0<overlapX&&(box.right-box.left>winW&&(hints.style.width=winW-5+"px",overlapX-=box.right-box.left-winW),hints.style.left=(left=pos.left-overlapX)+"px"),scrolls)for(var node=hints.firstChild;node;node=node.nextSibling)node.style.paddingRight=cm.display.nativeBarWidth+"px";if(cm.addKeyMap(this.keyMap=buildKeyMap(completion,{moveFocus:function(n,avoidWrap){widget.changeActive(widget.selectedHint+n,avoidWrap)},setFocus:function(n){widget.changeActive(n)},menuSize:function(){return widget.screenAmount()},length:completions.length,close:function(){completion.close()},pick:function(){widget.pick()},data:data})),completion.options.closeOnUnfocus){var closingOnBlur;cm.on("blur",this.onBlur=function(){closingOnBlur=setTimeout(function(){completion.close()},100)}),cm.on("focus",this.onFocus=function(){clearTimeout(closingOnBlur)})}return cm.on("scroll",this.onScroll=function(){var curScroll=cm.getScrollInfo(),editor=cm.getWrapperElement().getBoundingClientRect(),newTop=top+startScroll.top-curScroll.top,point=newTop-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return below||(point+=hints.offsetHeight),point<=editor.top||point>=editor.bottom?completion.close():void(hints.style.top=newTop+"px",hints.style.left=left+startScroll.left-curScroll.left+"px")}),CodeMirror.on(hints,"dblclick",function(e){var t=getHintElement(hints,e.target||e.srcElement);t&&null!=t.hintId&&(widget.changeActive(t.hintId),widget.pick())}),CodeMirror.on(hints,"click",function(e){var t=getHintElement(hints,e.target||e.srcElement);t&&null!=t.hintId&&(widget.changeActive(t.hintId),completion.options.completeOnSingleClick&&widget.pick())}),CodeMirror.on(hints,"mousedown",function(){setTimeout(function(){cm.focus()},20)}),CodeMirror.signal(data,"select",completions[this.selectedHint],hints.childNodes[this.selectedHint]),!0}function applicableHelpers(cm,helpers){if(!cm.somethingSelected())return helpers;for(var result=[],i=0;i<helpers.length;i++)helpers[i].supportsSelection&&result.push(helpers[i]);return result}function fetchHints(hint,cm,options,callback){if(hint.async)hint(cm,callback,options);else{var result=hint(cm,options);result&&result.then?result.then(callback):callback(result)}}var HINT_ELEMENT_CLASS="CodeMirror-hint",ACTIVE_HINT_ELEMENT_CLASS="CodeMirror-hint-active";CodeMirror.showHint=function(cm,getHints,options){if(!getHints)return cm.showHint(options);options&&options.async&&(getHints.async=!0);var newOpts={hint:getHints};if(options)for(var prop in options)newOpts[prop]=options[prop];return cm.showHint(newOpts)},CodeMirror.defineExtension("showHint",function(options){options=parseOptions(this,this.getCursor("start"),options);var selections=this.listSelections();if(!(1<selections.length)){if(this.somethingSelected()){if(!options.hint.supportsSelection)return;for(var i=0;i<selections.length;i++)if(selections[i].head.line!=selections[i].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var completion=this.state.completionActive=new Completion(this,options);completion.options.hint&&(CodeMirror.signal(this,"startCompletion",this),completion.update(!0))}});var requestAnimationFrame=window.requestAnimationFrame||function(fn){return setTimeout(fn,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||clearTimeout;Completion.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&CodeMirror.signal(this.data,"close"),this.widget&&this.widget.close(),CodeMirror.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(data,i){var completion=data.list[i];completion.hint?completion.hint(this.cm,data,completion):this.cm.replaceRange(getText(completion),completion.from||data.from,completion.to||data.to,"complete"),CodeMirror.signal(data,"pick",completion),this.close()},cursorActivity:function(){this.debounce&&(cancelAnimationFrame(this.debounce),this.debounce=0);var pos=this.cm.getCursor(),line=this.cm.getLine(pos.line);if(pos.line!=this.startPos.line||line.length-pos.ch!=this.startLen-this.startPos.ch||pos.ch<this.startPos.ch||this.cm.somethingSelected()||pos.ch&&this.options.closeCharacters.test(line.charAt(pos.ch-1)))this.close();else{var self=this;this.debounce=requestAnimationFrame(function(){self.update()}),this.widget&&this.widget.disable()}},update:function(first){if(null!=this.tick){var self=this,myTick=++this.tick;fetchHints(this.options.hint,this.cm,this.options,function(data){self.tick==myTick&&self.finishUpdate(data,first)})}},finishUpdate:function(data,first){this.data&&CodeMirror.signal(this.data,"update");var picked=this.widget&&this.widget.picked||first&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=data,data&&data.list.length&&(picked&&1==data.list.length?this.pick(data,0):(this.widget=new Widget(this,data),CodeMirror.signal(data,"shown")))}},Widget.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var cm=this.completion.cm;this.completion.options.closeOnUnfocus&&(cm.off("blur",this.onBlur),cm.off("focus",this.onFocus)),cm.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var widget=this;this.keyMap={Enter:function(){widget.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(i,avoidWrap){if(i>=this.data.list.length?i=avoidWrap?this.data.list.length-1:0:0>i&&(i=avoidWrap?0:this.data.list.length-1),this.selectedHint!=i){var node=this.hints.childNodes[this.selectedHint];node&&(node.className=node.className.replace(" "+ACTIVE_HINT_ELEMENT_CLASS,"")),node=this.hints.childNodes[this.selectedHint=i],node.className+=" "+ACTIVE_HINT_ELEMENT_CLASS,node.offsetTop<this.hints.scrollTop?this.hints.scrollTop=node.offsetTop-3:node.offsetTop+node.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=node.offsetTop+node.offsetHeight-this.hints.clientHeight+3),CodeMirror.signal(this.data,"select",this.data.list[this.selectedHint],node)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},CodeMirror.registerHelper("hint","auto",{resolve:function(cm,pos){var helpers=cm.getHelpers(pos,"hint"),words;if(helpers.length){var resolved=function(cm,callback,options){function run(i){return i==app.length?callback(null):void fetchHints(app[i],cm,options,function(result){result&&0<result.list.length?callback(result):run(i+1)})}var app=applicableHelpers(cm,helpers);run(0)};return resolved.async=!0,resolved.supportsSelection=!0,resolved}return(words=cm.getHelper(cm.getCursor(),"hintWords"))?function(cm){return CodeMirror.hint.fromList(cm,{words:words})}:CodeMirror.hint.anyword?function(cm,options){return CodeMirror.hint.anyword(cm,options)}:function(){}}}),CodeMirror.registerHelper("hint","fromList",function(cm,options){var cur=cm.getCursor(),token=cm.getTokenAt(cur),from=CodeMirror.Pos(cur.line,token.start),term;token.start<cur.ch&&/\w/.test(token.string.charAt(cur.ch-token.start-1))?term=token.string.substr(0,cur.ch-token.start):(term="",from=cur);for(var found=[],i=0,word;i<options.words.length;i++)word=options.words[i],word.slice(0,term.length)==term&&found.push(word);if(found.length)return{list:found,from:from,to:cur}}),CodeMirror.commands.autocomplete=CodeMirror.showHint;var defaultOptions={hint:CodeMirror.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};CodeMirror.defineOption("hintOptions",null)})},rc1b:function(module,exports){"use strict";function isQuote(code){return code===SINGLE_QUOTE||code===DOUBLE_QUOTE}function isNumber(code){return 47<code&&58>code}function isAlpha(code,from,to){return from=from||65,to=to||90,code&=-33,code>=from&&code<=to}function isWhiteSpace(code){return 32===code||9===code||160===code}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1,source;i<arguments.length;i++)for(var key in source=arguments[i],source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);return target},SINGLE_QUOTE=39,DOUBLE_QUOTE=34,defaultOptions={escape:92,throws:!1},eatQuoted=function(stream,options){options=options?_extends({},defaultOptions,options):defaultOptions;var start=stream.pos,quote=stream.peek();if(stream.eat(isQuote)){for(;!stream.eof();)switch(stream.next()){case quote:return stream.start=start,!0;case options.escape:stream.next();}if(stream.pos=start,options.throws)throw stream.error("Unable to consume quoted string")}return!1},defaultOptions$1={escape:92,throws:!1};exports.eatQuoted=eatQuoted,exports.isQuote=isQuote,exports.isAlpha=isAlpha,exports.isNumber=isNumber,exports.isAlphaNumeric=function(code){return isNumber(code)||isAlpha(code)},exports.isSpace=function(code){return isWhiteSpace(code)||10===code||13===code},exports.isWhiteSpace=isWhiteSpace,exports.eatPair=function(stream,open,close,options){options=options?_extends({},defaultOptions$1,options):defaultOptions$1;var start=stream.pos;if(stream.eat(open)){for(var stack=1,ch;!stream.eof();)if(!eatQuoted(stream,options))if(ch=stream.next(),ch===open)stack++;else if(ch!==close)ch===options.escape&&stream.next();else if(stack--,!stack)return stream.start=start,!0;if(stream.pos=start,options.throws)throw stream.error("Unable to find matching pair for "+String.fromCharCode(open))}return!1}},rmqo:function(module,exports,__webpack_require__){"use strict";var $export=__webpack_require__("cVWy"),$task=__webpack_require__("Ib92");$export($export.G+$export.B,{setImmediate:$task.set,clearImmediate:$task.clear})},s0rf:function(module,exports,__webpack_require__){"use strict";module.exports=!__webpack_require__("6TpT")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},sN8g:function(module,exports,__webpack_require__){"use strict";__webpack_require__("rmqo"),module.exports=__webpack_require__("KxJl").setImmediate},tMLt:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"),__webpack_require__("H+g/"))})(function(CodeMirror){function State(options){this.options=options,this.from=this.to=0}function parseOptions(opts){return!0===opts&&(opts={}),null==opts.gutter&&(opts.gutter="CodeMirror-foldgutter"),null==opts.indicatorOpen&&(opts.indicatorOpen="CodeMirror-foldgutter-open"),null==opts.indicatorFolded&&(opts.indicatorFolded="CodeMirror-foldgutter-folded"),opts}function isFolded(cm,line){for(var marks=cm.findMarks(Pos(line,0),Pos(line+1,0)),i=0;i<marks.length;++i)if(marks[i].__isFold&&marks[i].find().from.line==line)return marks[i]}function marker(spec){if("string"==typeof spec){var elt=document.createElement("div");return elt.className=spec+" CodeMirror-guttermarker-subtle",elt}return spec.cloneNode(!0)}function updateFoldInfo(cm,from,to){var opts=cm.state.foldGutter.options,cur=from,minSize=cm.foldOption(opts,"minFoldSize"),func=cm.foldOption(opts,"rangeFinder");cm.eachLine(from,to,function(line){var mark=null;if(isFolded(cm,cur))mark=marker(opts.indicatorFolded);else{var pos=Pos(cur,0),range=func&&func(cm,pos);range&&range.to.line-range.from.line>=minSize&&(mark=marker(opts.indicatorOpen))}cm.setGutterMarker(line,opts.gutter,mark),++cur})}function updateInViewport(cm){var vp=cm.getViewport(),state=cm.state.foldGutter;state&&(cm.operation(function(){updateFoldInfo(cm,vp.from,vp.to)}),state.from=vp.from,state.to=vp.to)}function onGutterClick(cm,line,gutter){var state=cm.state.foldGutter;if(state){var opts=state.options;if(gutter==opts.gutter){var folded=isFolded(cm,line);folded?folded.clear():cm.foldCode(Pos(line,0),opts.rangeFinder)}}}function onChange(cm){var state=cm.state.foldGutter;if(state){var opts=state.options;state.from=state.to=0,clearTimeout(state.changeUpdate),state.changeUpdate=setTimeout(function(){updateInViewport(cm)},opts.foldOnChangeTimeSpan||600)}}function onViewportChange(cm){var state=cm.state.foldGutter;if(state){var opts=state.options;clearTimeout(state.changeUpdate),state.changeUpdate=setTimeout(function(){var vp=cm.getViewport();state.from==state.to||20<vp.from-state.to||20<state.from-vp.to?updateInViewport(cm):cm.operation(function(){vp.from<state.from&&(updateFoldInfo(cm,vp.from,state.from),state.from=vp.from),vp.to>state.to&&(updateFoldInfo(cm,state.to,vp.to),state.to=vp.to)})},opts.updateViewportTimeSpan||400)}}function onFold(cm,from){var state=cm.state.foldGutter;if(state){var line=from.line;line>=state.from&&line<state.to&&updateFoldInfo(cm,line,line+1)}}CodeMirror.defineOption("foldGutter",!1,function(cm,val,old){old&&old!=CodeMirror.Init&&(cm.clearGutter(cm.state.foldGutter.options.gutter),cm.state.foldGutter=null,cm.off("gutterClick",onGutterClick),cm.off("change",onChange),cm.off("viewportChange",onViewportChange),cm.off("fold",onFold),cm.off("unfold",onFold),cm.off("swapDoc",onChange)),val&&(cm.state.foldGutter=new State(parseOptions(val)),updateInViewport(cm),cm.on("gutterClick",onGutterClick),cm.on("change",onChange),cm.on("viewportChange",onViewportChange),cm.on("fold",onFold),cm.on("unfold",onFold),cm.on("swapDoc",onChange))});var Pos=CodeMirror.Pos})},tQq4:function(module){"use strict";var _Mathceil=Math.ceil,_Mathabs=Math.abs,_Mathround2=Math.round,_Mathfloor4=Math.floor,_StringfromCharCode7=String.fromCharCode,_Mathmin6=Math.min,_Mathmax5=Math.max;(function(global,factory){module.exports=factory()})(void 0,function(){function classTest(cls){return new RegExp("(^|\\s)"+cls+"(?:$|\\s)\\s*")}function removeChildren(e){for(var count=e.childNodes.length;0<count;--count)e.removeChild(e.firstChild);return e}function removeChildrenAndAdd(parent,e){return removeChildren(parent).appendChild(e)}function elt(tag,content,className,style){var e=document.createElement(tag);if(className&&(e.className=className),style&&(e.style.cssText=style),"string"==typeof content)e.appendChild(document.createTextNode(content));else if(content)for(var i=0;i<content.length;++i)e.appendChild(content[i]);return e}function eltP(tag,content,className,style){var e=elt(tag,content,className,style);return e.setAttribute("role","presentation"),e}function contains(parent,child){if(3==child.nodeType&&(child=child.parentNode),parent.contains)return parent.contains(child);do if(11==child.nodeType&&(child=child.host),child==parent)return!0;while(child=child.parentNode)}function activeElt(){var activeElement;try{activeElement=document.activeElement}catch(e){activeElement=document.body||null}for(;activeElement&&activeElement.shadowRoot&&activeElement.shadowRoot.activeElement;)activeElement=activeElement.shadowRoot.activeElement;return activeElement}function addClass(node,cls){var current=node.className;classTest(cls).test(current)||(node.className+=(current?" ":"")+cls)}function joinClasses(a,b){for(var as=a.split(" "),i=0;i<as.length;i++)as[i]&&!classTest(as[i]).test(b)&&(b+=" "+as[i]);return b}function bind(f){var args=Array.prototype.slice.call(arguments,1);return function(){return f.apply(null,args)}}function copyObj(obj,target,overwrite){for(var prop in target||(target={}),obj)obj.hasOwnProperty(prop)&&(!1!==overwrite||!target.hasOwnProperty(prop))&&(target[prop]=obj[prop]);return target}function countColumn(string,end,tabSize,startIndex,startValue){null==end&&(end=string.search(/[^\s\u00a0]/),-1==end&&(end=string.length));for(var i=startIndex||0,n=startValue||0,nextTab;;){if(nextTab=string.indexOf("\t",i),0>nextTab||nextTab>=end)return n+(end-i);n+=nextTab-i,n+=tabSize-n%tabSize,i=nextTab+1}}function indexOf(array,elt){for(var i=0;i<array.length;++i)if(array[i]==elt)return i;return-1}function findColumn(string,goal,tabSize){for(var pos=0,col=0,nextTab;;){nextTab=string.indexOf("\t",pos),-1==nextTab&&(nextTab=string.length);var skipped=nextTab-pos;if(nextTab==string.length||col+skipped>=goal)return pos+_Mathmin6(skipped,goal-col);if(col+=nextTab-pos,col+=tabSize-col%tabSize,pos=nextTab+1,col>=goal)return pos}}function spaceStr(n){for(;spaceStrs.length<=n;)spaceStrs.push(lst(spaceStrs)+" ");return spaceStrs[n]}function lst(arr){return arr[arr.length-1]}function map(array,f){for(var out=[],i=0;i<array.length;i++)out[i]=f(array[i],i);return out}function insertSorted(array,value,score){for(var pos=0,priority=score(value);pos<array.length&&score(array[pos])<=priority;)pos++;array.splice(pos,0,value)}function nothing(){}function createObj(base,props){var inst;return Object.create?inst=Object.create(base):(nothing.prototype=base,inst=new nothing),props&©Obj(props,inst),inst}function isWordCharBasic(ch){return /\w/.test(ch)||"\x80"<ch&&(ch.toUpperCase()!=ch.toLowerCase()||nonASCIISingleCaseWordChar.test(ch))}function isWordChar(ch,helper){return helper?-1<helper.source.indexOf("\\w")&&isWordCharBasic(ch)||helper.test(ch):isWordCharBasic(ch)}function isEmpty(obj){for(var n in obj)if(obj.hasOwnProperty(n)&&obj[n])return!1;return!0}function isExtendingChar(ch){return 768<=ch.charCodeAt(0)&&extendingChars.test(ch)}function skipExtendingChars(str,pos,dir){for(;(0>dir?0<pos:pos<str.length)&&isExtendingChar(str.charAt(pos));)pos+=dir;return pos}function findFirst(pred,from,to){for(var dir=from>to?-1:1;;){if(from==to)return from;var midF=(from+to)/2,mid=0>dir?_Mathceil(midF):_Mathfloor4(midF);if(mid==from)return pred(mid)?from:to;pred(mid)?to=mid:from=mid+dir}}function Display(place,doc,input){var d=this;this.input=input,d.scrollbarFiller=elt("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=elt("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=eltP("div",null,"CodeMirror-code"),d.selectionDiv=elt("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=elt("div",null,"CodeMirror-cursors"),d.measure=elt("div",null,"CodeMirror-measure"),d.lineMeasure=elt("div",null,"CodeMirror-measure"),d.lineSpace=eltP("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none");var lines=eltP("div",[d.lineSpace],"CodeMirror-lines");d.mover=elt("div",[lines],null,"position: relative"),d.sizer=elt("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=elt("div",null,null,"position: absolute; height: "+scrollerGap+"px; width: 1px;"),d.gutters=elt("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=elt("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=elt("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),ie&&8>ie_version&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),webkit||gecko&&mobile||(d.scroller.draggable=!0),place&&(place.appendChild?place.appendChild(d.wrapper):place(d.wrapper)),d.viewFrom=d.viewTo=doc.first,d.reportedViewFrom=d.reportedViewTo=doc.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,input.init(d)}function getLine(doc,n){if(n-=doc.first,0>n||n>=doc.size)throw new Error("There is no line "+(n+doc.first)+" in the document.");for(var chunk=doc;!chunk.lines;)for(var i=0;;++i){var child=chunk.children[i],sz=child.chunkSize();if(n<sz){chunk=child;break}n-=sz}return chunk.lines[n]}function getBetween(doc,start,end){var out=[],n=start.line;return doc.iter(start.line,end.line+1,function(line){var text=line.text;n==end.line&&(text=text.slice(0,end.ch)),n==start.line&&(text=text.slice(start.ch)),out.push(text),++n}),out}function getLines(doc,from,to){var out=[];return doc.iter(from,to,function(line){out.push(line.text)}),out}function updateLineHeight(line,height){var diff=height-line.height;if(diff)for(var n=line;n;n=n.parent)n.height+=diff}function lineNo(line){if(null==line.parent)return null;for(var cur=line.parent,no=indexOf(cur.lines,line),chunk=cur.parent;chunk;cur=chunk,chunk=chunk.parent)for(var i=0;;++i){if(chunk.children[i]==cur)break;no+=chunk.children[i].chunkSize()}return no+cur.first}function _lineAtHeight(chunk,h){var n=chunk.first;outer:do{for(var i$1=0;i$1<chunk.children.length;++i$1){var child=chunk.children[i$1],ch=child.height;if(h<ch){chunk=child;continue outer}h-=ch,n+=child.chunkSize()}return n}while(!chunk.lines);for(var i=0;i<chunk.lines.length;++i){var line=chunk.lines[i],lh=line.height;if(h<lh)break;h-=lh}return n+i}function isLine(doc,l){return l>=doc.first&&l<doc.first+doc.size}function lineNumberFor(options,i){return options.lineNumberFormatter(i+options.firstLineNumber)+""}function Pos(line,ch,sticky){return void 0===sticky&&(sticky=null),this instanceof Pos?void(this.line=line,this.ch=ch,this.sticky=sticky):new Pos(line,ch,sticky)}function cmp(a,b){return a.line-b.line||a.ch-b.ch}function equalCursorPos(a,b){return a.sticky==b.sticky&&0==cmp(a,b)}function copyPos(x){return Pos(x.line,x.ch)}function maxPos(a,b){return 0>cmp(a,b)?b:a}function minPos(a,b){return 0>cmp(a,b)?a:b}function clipLine(doc,n){return _Mathmax5(doc.first,_Mathmin6(n,doc.first+doc.size-1))}function _clipPos(doc,pos){if(pos.line<doc.first)return Pos(doc.first,0);var last=doc.first+doc.size-1;return pos.line>last?Pos(last,getLine(doc,last).text.length):clipToLen(pos,getLine(doc,pos.line).text.length)}function clipToLen(pos,linelen){var ch=pos.ch;return null==ch||ch>linelen?Pos(pos.line,linelen):0>ch?Pos(pos.line,0):pos}function clipPosArray(doc,array){for(var out=[],i=0;i<array.length;i++)out[i]=_clipPos(doc,array[i]);return out}function seeReadOnlySpans(){sawReadOnlySpans=!0}function seeCollapsedSpans(){sawCollapsedSpans=!0}function MarkedSpan(marker,from,to){this.marker=marker,this.from=from,this.to=to}function getMarkedSpanFor(spans,marker){if(spans)for(var i=0,span;i<spans.length;++i)if(span=spans[i],span.marker==marker)return span}function removeMarkedSpan(spans,span){for(var i=0,r;i<spans.length;++i)spans[i]!=span&&(r||(r=[])).push(spans[i]);return r}function addMarkedSpan(line,span){line.markedSpans=line.markedSpans?line.markedSpans.concat([span]):[span],span.marker.attachLine(line)}function markedSpansBefore(old,startCh,isInsert){var nw;if(old)for(var i=0;i<old.length;++i){var span=old[i],marker=span.marker,startsBefore=null==span.from||(marker.inclusiveLeft?span.from<=startCh:span.from<startCh);if(startsBefore||span.from==startCh&&"bookmark"==marker.type&&(!isInsert||!span.marker.insertLeft)){var endsAfter=null==span.to||(marker.inclusiveRight?span.to>=startCh:span.to>startCh);(nw||(nw=[])).push(new MarkedSpan(marker,span.from,endsAfter?null:span.to))}}return nw}function markedSpansAfter(old,endCh,isInsert){var nw;if(old)for(var i=0;i<old.length;++i){var span=old[i],marker=span.marker,endsAfter=null==span.to||(marker.inclusiveRight?span.to>=endCh:span.to>endCh);if(endsAfter||span.from==endCh&&"bookmark"==marker.type&&(!isInsert||span.marker.insertLeft)){var startsBefore=null==span.from||(marker.inclusiveLeft?span.from<=endCh:span.from<endCh);(nw||(nw=[])).push(new MarkedSpan(marker,startsBefore?null:span.from-endCh,null==span.to?null:span.to-endCh))}}return nw}function stretchSpansOverChange(doc,change){if(change.full)return null;var oldFirst=isLine(doc,change.from.line)&&getLine(doc,change.from.line).markedSpans,oldLast=isLine(doc,change.to.line)&&getLine(doc,change.to.line).markedSpans;if(!oldFirst&&!oldLast)return null;var startCh=change.from.ch,endCh=change.to.ch,isInsert=0==cmp(change.from,change.to),first=markedSpansBefore(oldFirst,startCh,isInsert),last=markedSpansAfter(oldLast,endCh,isInsert),sameLine=1==change.text.length,offset=lst(change.text).length+(sameLine?startCh:0);if(first)for(var i=0,span;i<first.length;++i)if(span=first[i],null==span.to){var found=getMarkedSpanFor(last,span.marker);found?sameLine&&(span.to=null==found.to?null:found.to+offset):span.to=startCh}if(last)for(var i$1=0,span$1;i$1<last.length;++i$1)if(span$1=last[i$1],null!=span$1.to&&(span$1.to+=offset),null==span$1.from){var found$1=getMarkedSpanFor(first,span$1.marker);found$1||(span$1.from=offset,sameLine&&(first||(first=[])).push(span$1))}else span$1.from+=offset,sameLine&&(first||(first=[])).push(span$1);first&&(first=clearEmptySpans(first)),last&&last!=first&&(last=clearEmptySpans(last));var newMarkers=[first];if(!sameLine){var gap=change.text.length-2,gapMarkers;if(0<gap&&first)for(var i$2=0;i$2<first.length;++i$2)null==first[i$2].to&&(gapMarkers||(gapMarkers=[])).push(new MarkedSpan(first[i$2].marker,null,null));for(var i$3=0;i$3<gap;++i$3)newMarkers.push(gapMarkers);newMarkers.push(last)}return newMarkers}function clearEmptySpans(spans){for(var i=0,span;i<spans.length;++i)span=spans[i],null!=span.from&&span.from==span.to&&!1!==span.marker.clearWhenEmpty&&spans.splice(i--,1);return spans.length?spans:null}function removeReadOnlyRanges(doc,from,to){var markers=null;if(doc.iter(from.line,to.line+1,function(line){if(line.markedSpans)for(var i=0,mark;i<line.markedSpans.length;++i)mark=line.markedSpans[i].marker,mark.readOnly&&(!markers||-1==indexOf(markers,mark))&&(markers||(markers=[])).push(mark)}),!markers)return null;for(var parts=[{from:from,to:to}],i=0;i<markers.length;++i)for(var mk=markers[i],m=mk.find(0),j=0,p;j<parts.length;++j)if(p=parts[j],!(0>cmp(p.to,m.from)||0<cmp(p.from,m.to))){var newParts=[j,1],dfrom=cmp(p.from,m.from),dto=cmp(p.to,m.to);!(0>dfrom)&&(mk.inclusiveLeft||dfrom)||newParts.push({from:p.from,to:m.from}),!(0<dto)&&(mk.inclusiveRight||dto)||newParts.push({from:m.to,to:p.to}),parts.splice.apply(parts,newParts),j+=newParts.length-3}return parts}function detachMarkedSpans(line){var spans=line.markedSpans;if(spans){for(var i=0;i<spans.length;++i)spans[i].marker.detachLine(line);line.markedSpans=null}}function attachMarkedSpans(line,spans){if(spans){for(var i=0;i<spans.length;++i)spans[i].marker.attachLine(line);line.markedSpans=spans}}function extraLeft(marker){return marker.inclusiveLeft?-1:0}function extraRight(marker){return marker.inclusiveRight?1:0}function compareCollapsedMarkers(a,b){var lenDiff=a.lines.length-b.lines.length;if(0!=lenDiff)return lenDiff;var aPos=a.find(),bPos=b.find(),fromCmp=cmp(aPos.from,bPos.from)||extraLeft(a)-extraLeft(b);if(fromCmp)return-fromCmp;var toCmp=cmp(aPos.to,bPos.to)||extraRight(a)-extraRight(b);return toCmp?toCmp:b.id-a.id}function collapsedSpanAtSide(line,start){var sps=sawCollapsedSpans&&line.markedSpans,found;if(sps)for(var sp=void 0,i=0;i<sps.length;++i)sp=sps[i],sp.marker.collapsed&&null==(start?sp.from:sp.to)&&(!found||0>compareCollapsedMarkers(found,sp.marker))&&(found=sp.marker);return found}function collapsedSpanAtStart(line){return collapsedSpanAtSide(line,!0)}function collapsedSpanAtEnd(line){return collapsedSpanAtSide(line,!1)}function collapsedSpanAround(line,ch){var sps=sawCollapsedSpans&&line.markedSpans,found;if(sps)for(var i=0,sp;i<sps.length;++i)sp=sps[i],sp.marker.collapsed&&(null==sp.from||sp.from<ch)&&(null==sp.to||sp.to>ch)&&(!found||0>compareCollapsedMarkers(found,sp.marker))&&(found=sp.marker);return found}function conflictingCollapsedRange(doc,lineNo$$1,from,to,marker){var line=getLine(doc,lineNo$$1),sps=sawCollapsedSpans&&line.markedSpans;if(sps)for(var i=0,sp;i<sps.length;++i)if(sp=sps[i],!!sp.marker.collapsed){var found=sp.marker.find(0),fromCmp=cmp(found.from,from)||extraLeft(sp.marker)-extraLeft(marker),toCmp=cmp(found.to,to)||extraRight(sp.marker)-extraRight(marker);if(!(0<=fromCmp&&0>=toCmp||0>=fromCmp&&0<=toCmp)&&(0>=fromCmp&&(sp.marker.inclusiveRight&&marker.inclusiveLeft?0<=cmp(found.to,from):0<cmp(found.to,from))||0<=fromCmp&&(sp.marker.inclusiveRight&&marker.inclusiveLeft?0>=cmp(found.from,to):0>cmp(found.from,to))))return!0}}function visualLine(line){for(var merged;merged=collapsedSpanAtStart(line);)line=merged.find(-1,!0).line;return line}function visualLineEnd(line){for(var merged;merged=collapsedSpanAtEnd(line);)line=merged.find(1,!0).line;return line}function visualLineContinued(line){for(var merged,lines;merged=collapsedSpanAtEnd(line);)line=merged.find(1,!0).line,(lines||(lines=[])).push(line);return lines}function visualLineNo(doc,lineN){var line=getLine(doc,lineN),vis=visualLine(line);return line==vis?lineN:lineNo(vis)}function visualLineEndNo(doc,lineN){if(lineN>doc.lastLine())return lineN;var line=getLine(doc,lineN),merged;if(!lineIsHidden(doc,line))return lineN;for(;merged=collapsedSpanAtEnd(line);)line=merged.find(1,!0).line;return lineNo(line)+1}function lineIsHidden(doc,line){var sps=sawCollapsedSpans&&line.markedSpans;if(sps)for(var sp=void 0,i=0;i<sps.length;++i)if(sp=sps[i],!!sp.marker.collapsed){if(null==sp.from)return!0;if(!sp.marker.widgetNode&&0==sp.from&&sp.marker.inclusiveLeft&&lineIsHiddenInner(doc,line,sp))return!0}}function lineIsHiddenInner(doc,line,span){if(null==span.to){var end=span.marker.find(1,!0);return lineIsHiddenInner(doc,end.line,getMarkedSpanFor(end.line.markedSpans,span.marker))}if(span.marker.inclusiveRight&&span.to==line.text.length)return!0;for(var sp=void 0,i=0;i<line.markedSpans.length;++i)if(sp=line.markedSpans[i],sp.marker.collapsed&&!sp.marker.widgetNode&&sp.from==span.to&&(null==sp.to||sp.to!=span.from)&&(sp.marker.inclusiveLeft||span.marker.inclusiveRight)&&lineIsHiddenInner(doc,line,sp))return!0}function _heightAtLine(lineObj){lineObj=visualLine(lineObj);for(var h=0,chunk=lineObj.parent,i=0,line;i<chunk.lines.length&&(line=chunk.lines[i],line!=lineObj);++i)h+=line.height;for(var p=chunk.parent;p;chunk=p,p=chunk.parent)for(var i$1=0,cur;i$1<p.children.length&&(cur=p.children[i$1],cur!=chunk);++i$1)h+=cur.height;return h}function lineLength(line){if(0==line.height)return 0;for(var len=line.text.length,cur=line,merged,found;merged=collapsedSpanAtStart(cur);)found=merged.find(0,!0),cur=found.from.line,len+=found.from.ch-found.to.ch;for(cur=line;merged=collapsedSpanAtEnd(cur);){var found$1=merged.find(0,!0);len-=cur.text.length-found$1.from.ch,cur=found$1.to.line,len+=cur.text.length-found$1.to.ch}return len}function findMaxLine(cm){var d=cm.display,doc=cm.doc;d.maxLine=getLine(doc,doc.first),d.maxLineLength=lineLength(d.maxLine),d.maxLineChanged=!0,doc.iter(function(line){var len=lineLength(line);len>d.maxLineLength&&(d.maxLineLength=len,d.maxLine=line)})}function iterateBidiSections(order,from,to,f){if(!order)return f(from,to,"ltr",0);for(var found=!1,i=0,part;i<order.length;++i)part=order[i],(part.from<to&&part.to>from||from==to&&part.to==from)&&(f(_Mathmax5(part.from,from),_Mathmin6(part.to,to),1==part.level?"rtl":"ltr",i),found=!0);found||f(from,to,"ltr")}function getBidiPartAt(order,ch,sticky){var found;bidiOther=null;for(var i=0,cur;i<order.length;++i){if(cur=order[i],cur.from<ch&&cur.to>ch)return i;cur.to==ch&&(cur.from!=cur.to&&"before"==sticky?found=i:bidiOther=i),cur.from==ch&&(cur.from!=cur.to&&"before"!=sticky?found=i:bidiOther=i)}return null==found?bidiOther:found}function getOrder(line,direction){var order=line.order;return null==order&&(order=line.order=bidiOrdering(line.text,direction)),order}function getHandlers(emitter,type){return emitter._handlers&&emitter._handlers[type]||noHandlers}function off(emitter,type,f){if(emitter.removeEventListener)emitter.removeEventListener(type,f,!1);else if(emitter.detachEvent)emitter.detachEvent("on"+type,f);else{var map$$1=emitter._handlers,arr=map$$1&&map$$1[type];if(arr){var index=indexOf(arr,f);-1<index&&(map$$1[type]=arr.slice(0,index).concat(arr.slice(index+1)))}}}function signal(emitter,type){var handlers=getHandlers(emitter,type);if(handlers.length)for(var args=Array.prototype.slice.call(arguments,2),i=0;i<handlers.length;++i)handlers[i].apply(null,args)}function signalDOMEvent(cm,e,override){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),signal(cm,override||e.type,cm,e),e_defaultPrevented(e)||e.codemirrorIgnore}function signalCursorActivity(cm){var arr=cm._handlers&&cm._handlers.cursorActivity;if(arr)for(var set=cm.curOp.cursorActivityHandlers||(cm.curOp.cursorActivityHandlers=[]),i=0;i<arr.length;++i)-1==indexOf(set,arr[i])&&set.push(arr[i])}function hasHandler(emitter,type){return 0<getHandlers(emitter,type).length}function eventMixin(ctor){ctor.prototype.on=function(type,f){on(this,type,f)},ctor.prototype.off=function(type,f){off(this,type,f)}}function e_preventDefault(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function e_stopPropagation(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function e_defaultPrevented(e){return null==e.defaultPrevented?!1==e.returnValue:e.defaultPrevented}function e_stop(e){e_preventDefault(e),e_stopPropagation(e)}function e_target(e){return e.target||e.srcElement}function e_button(e){var b=e.which;return null==b&&(1&e.button?b=1:2&e.button?b=3:4&e.button&&(b=2)),mac&&e.ctrlKey&&1==b&&(b=3),b}function zeroWidthElement(measure){if(null==zwspSupported){var test=elt("span","\u200B");removeChildrenAndAdd(measure,elt("span",[test,document.createTextNode("x")])),0!=measure.firstChild.offsetHeight&&(zwspSupported=1>=test.offsetWidth&&2<test.offsetHeight&&!(ie&&8>ie_version))}var node=zwspSupported?elt("span","\u200B"):elt("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return node.setAttribute("cm-text",""),node}function hasBadBidiRects(measure){if(null!=badBidiRects)return badBidiRects;var txt=removeChildrenAndAdd(measure,document.createTextNode("A\u062EA")),r0=range(txt,0,1).getBoundingClientRect(),r1=range(txt,1,2).getBoundingClientRect();return removeChildren(measure),r0&&r0.left!=r0.right&&(badBidiRects=3>r1.right-r0.right)}function hasBadZoomedRects(measure){if(null!=badZoomedRects)return badZoomedRects;var node=removeChildrenAndAdd(measure,elt("span","x")),normal=node.getBoundingClientRect(),fromRange=range(node,0,1).getBoundingClientRect();return badZoomedRects=1<_Mathabs(normal.left-fromRange.left)}function defineMode(name,mode){2<arguments.length&&(mode.dependencies=Array.prototype.slice.call(arguments,2)),modes[name]=mode}function resolveMode(spec){if("string"==typeof spec&&mimeModes.hasOwnProperty(spec))spec=mimeModes[spec];else if(spec&&"string"==typeof spec.name&&mimeModes.hasOwnProperty(spec.name)){var found=mimeModes[spec.name];"string"==typeof found&&(found={name:found}),spec=createObj(found,spec),spec.name=found.name}else{if("string"==typeof spec&&/^[\w\-]+\/[\w\-]+\+xml$/.test(spec))return resolveMode("application/xml");if("string"==typeof spec&&/^[\w\-]+\/[\w\-]+\+json$/.test(spec))return resolveMode("application/json")}return"string"==typeof spec?{name:spec}:spec||{name:"null"}}function getMode(options,spec){spec=resolveMode(spec);var mfactory=modes[spec.name];if(!mfactory)return getMode(options,"text/plain");var modeObj=mfactory(options,spec);if(modeExtensions.hasOwnProperty(spec.name)){var exts=modeExtensions[spec.name];for(var prop in exts)exts.hasOwnProperty(prop)&&(modeObj.hasOwnProperty(prop)&&(modeObj["_"+prop]=modeObj[prop]),modeObj[prop]=exts[prop])}if(modeObj.name=spec.name,spec.helperType&&(modeObj.helperType=spec.helperType),spec.modeProps)for(var prop$1 in spec.modeProps)modeObj[prop$1]=spec.modeProps[prop$1];return modeObj}function extendMode(mode,properties){var exts=modeExtensions.hasOwnProperty(mode)?modeExtensions[mode]:modeExtensions[mode]={};copyObj(properties,exts)}function copyState(mode,state){if(!0===state)return state;if(mode.copyState)return mode.copyState(state);var nstate={};for(var n in state){var val=state[n];val instanceof Array&&(val=val.concat([])),nstate[n]=val}return nstate}function innerMode(mode,state){for(var info;mode.innerMode&&(info=mode.innerMode(state),info&&info.mode!=mode);)state=info.state,mode=info.mode;return info||{mode:mode,state:state}}function startState(mode,a1,a2){return!mode.startState||mode.startState(a1,a2)}function highlightLine(cm,line,context,forceToEnd){var st=[cm.state.modeGen],lineClasses={};runMode(cm,line.text,cm.doc.mode,context,function(end,style){return st.push(end,style)},lineClasses,forceToEnd);for(var state=context.state,loop=function(o){context.baseTokens=st;var overlay=cm.state.overlays[o],i=1,at=0;context.state=!0,runMode(cm,line.text,overlay.mode,context,function(end,style){for(var start=i,i_end;at<end;)i_end=st[i],i_end>end&&st.splice(i,1,end,st[i+1],i_end),i+=2,at=_Mathmin6(end,i_end);if(style)if(overlay.opaque)st.splice(start,i-start,end,"overlay "+style),i=start+2;else for(;start<i;start+=2){var cur=st[start+1];st[start+1]=(cur?cur+" ":"")+"overlay "+style}},lineClasses),context.state=state,context.baseTokens=null,context.baseTokenPos=1},o=0;o<cm.state.overlays.length;++o)loop(o);return{styles:st,classes:lineClasses.bgClass||lineClasses.textClass?lineClasses:null}}function getLineStyles(cm,line,updateFrontier){if(!line.styles||line.styles[0]!=cm.state.modeGen){var context=getContextBefore(cm,lineNo(line)),resetState=line.text.length>cm.options.maxHighlightLength&©State(cm.doc.mode,context.state),result=highlightLine(cm,line,context);resetState&&(context.state=resetState),line.stateAfter=context.save(!resetState),line.styles=result.styles,result.classes?line.styleClasses=result.classes:line.styleClasses&&(line.styleClasses=null),updateFrontier===cm.doc.highlightFrontier&&(cm.doc.modeFrontier=_Mathmax5(cm.doc.modeFrontier,++cm.doc.highlightFrontier))}return line.styles}function getContextBefore(cm,n,precise){var doc=cm.doc,display=cm.display;if(!doc.mode.startState)return new Context(doc,!0,n);var start=findStartLine(cm,n,precise),saved=start>doc.first&&getLine(doc,start-1).stateAfter,context=saved?Context.fromSaved(doc,saved,start):new Context(doc,startState(doc.mode),start);return doc.iter(start,n,function(line){processLine(cm,line.text,context);var pos=context.line;line.stateAfter=pos==n-1||0==pos%5||pos>=display.viewFrom&&pos<display.viewTo?context.save():null,context.nextLine()}),precise&&(doc.modeFrontier=context.line),context}function processLine(cm,text,context,startAt){var mode=cm.doc.mode,stream=new StringStream(text,cm.options.tabSize,context);for(stream.start=stream.pos=startAt||0,""==text&&callBlankLine(mode,context.state);!stream.eol();)readToken(mode,stream,context.state),stream.start=stream.pos}function callBlankLine(mode,state){if(mode.blankLine)return mode.blankLine(state);if(mode.innerMode){var inner=innerMode(mode,state);if(inner.mode.blankLine)return inner.mode.blankLine(inner.state)}}function readToken(mode,stream,state,inner){for(var i=0;10>i;i++){inner&&(inner[0]=innerMode(mode,state).mode);var style=mode.token(stream,state);if(stream.pos>stream.start)return style}throw new Error("Mode "+mode.name+" failed to advance stream.")}function takeToken(cm,pos,precise,asArray){var doc=cm.doc,mode=doc.mode,style;pos=_clipPos(doc,pos);var line=getLine(doc,pos.line),context=getContextBefore(cm,pos.line,precise),stream=new StringStream(line.text,cm.options.tabSize,context),tokens;for(asArray&&(tokens=[]);(asArray||stream.pos<pos.ch)&&!stream.eol();)stream.start=stream.pos,style=readToken(mode,stream,context.state),asArray&&tokens.push(new Token(stream,style,copyState(doc.mode,context.state)));return asArray?tokens:new Token(stream,style,context.state)}function extractLineClasses(type,output){if(type)for(;;){var lineClass=type.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!lineClass)break;type=type.slice(0,lineClass.index)+type.slice(lineClass.index+lineClass[0].length);var prop=lineClass[1]?"bgClass":"textClass";null==output[prop]?output[prop]=lineClass[2]:!new RegExp("(?:^|s)"+lineClass[2]+"(?:$|s)").test(output[prop])&&(output[prop]+=" "+lineClass[2])}return type}function runMode(cm,text,mode,context,f,lineClasses,forceToEnd){var flattenSpans=mode.flattenSpans;null==flattenSpans&&(flattenSpans=cm.options.flattenSpans);var curStart=0,curStyle=null,stream=new StringStream(text,cm.options.tabSize,context),inner=cm.options.addModeClass&&[null],style;for(""==text&&extractLineClasses(callBlankLine(mode,context.state),lineClasses);!stream.eol();){if(stream.pos>cm.options.maxHighlightLength?(flattenSpans=!1,forceToEnd&&processLine(cm,text,context,stream.pos),stream.pos=text.length,style=null):style=extractLineClasses(readToken(mode,stream,context.state,inner),lineClasses),inner){var mName=inner[0].name;mName&&(style="m-"+(style?mName+" "+style:mName))}if(!flattenSpans||curStyle!=style){for(;curStart<stream.start;)curStart=_Mathmin6(stream.start,curStart+5e3),f(curStart,curStyle);curStyle=style}stream.start=stream.pos}for(;curStart<stream.pos;){var pos=_Mathmin6(stream.pos,curStart+5e3);f(pos,curStyle),curStart=pos}}function findStartLine(cm,n,precise){for(var doc=cm.doc,lim=precise?-1:n-(cm.doc.mode.innerMode?1e3:100),search=n,minindent,minline;search>lim;--search){if(search<=doc.first)return doc.first;var line=getLine(doc,search-1),after=line.stateAfter;if(after&&(!precise||search+(after instanceof SavedContext?after.lookAhead:0)<=doc.modeFrontier))return search;var indented=countColumn(line.text,null,cm.options.tabSize);(null==minline||minindent>indented)&&(minline=search-1,minindent=indented)}return minline}function retreatFrontier(doc,n){if(doc.modeFrontier=_Mathmin6(doc.modeFrontier,n),!(doc.highlightFrontier<n-10)){for(var start=doc.first,line=n-1,saved;line>start;line--)if(saved=getLine(doc,line).stateAfter,saved&&(!(saved instanceof SavedContext)||line+saved.lookAhead<n)){start=line+1;break}doc.highlightFrontier=_Mathmin6(doc.highlightFrontier,start)}}function updateLine(line,text,markedSpans,estimateHeight){line.text=text,line.stateAfter&&(line.stateAfter=null),line.styles&&(line.styles=null),null!=line.order&&(line.order=null),detachMarkedSpans(line),attachMarkedSpans(line,markedSpans);var estHeight=estimateHeight?estimateHeight(line):1;estHeight!=line.height&&updateLineHeight(line,estHeight)}function cleanUpLine(line){line.parent=null,detachMarkedSpans(line)}function interpretTokenStyle(style,options){if(!style||/^\s*$/.test(style))return null;var cache=options.addModeClass?styleToClassCacheWithMode:styleToClassCache;return cache[style]||(cache[style]=style.replace(/\S+/g,"cm-$&"))}function buildLineContent(cm,lineView){var content=eltP("span",null,null,webkit?"padding-right: .1px":null),builder={pre:eltP("pre",[content],"CodeMirror-line"),content:content,col:0,pos:0,cm:cm,trailingSpace:!1,splitSpaces:(ie||webkit)&&cm.getOption("lineWrapping")};lineView.measure={};for(var i=0;i<=(lineView.rest?lineView.rest.length:0);i++){var line=i?lineView.rest[i-1]:lineView.line,order=void 0;builder.pos=0,builder.addToken=buildToken,hasBadBidiRects(cm.display.measure)&&(order=getOrder(line,cm.doc.direction))&&(builder.addToken=buildTokenBadBidi(builder.addToken,order)),builder.map=[];var allowFrontierUpdate=lineView!=cm.display.externalMeasured&&lineNo(line);insertLineContent(line,builder,getLineStyles(cm,line,allowFrontierUpdate)),line.styleClasses&&(line.styleClasses.bgClass&&(builder.bgClass=joinClasses(line.styleClasses.bgClass,builder.bgClass||"")),line.styleClasses.textClass&&(builder.textClass=joinClasses(line.styleClasses.textClass,builder.textClass||""))),0==builder.map.length&&builder.map.push(0,0,builder.content.appendChild(zeroWidthElement(cm.display.measure))),0==i?(lineView.measure.map=builder.map,lineView.measure.cache={}):((lineView.measure.maps||(lineView.measure.maps=[])).push(builder.map),(lineView.measure.caches||(lineView.measure.caches=[])).push({}))}if(webkit){var last=builder.content.lastChild;(/\bcm-tab\b/.test(last.className)||last.querySelector&&last.querySelector(".cm-tab"))&&(builder.content.className="cm-tab-wrap-hack")}return signal(cm,"renderLine",cm,lineView.line,builder.pre),builder.pre.className&&(builder.textClass=joinClasses(builder.pre.className,builder.textClass||"")),builder}function defaultSpecialCharPlaceholder(ch){var token=elt("span","\u2022","cm-invalidchar");return token.title="\\u"+ch.charCodeAt(0).toString(16),token.setAttribute("aria-label",token.title),token}function buildToken(builder,text,style,startStyle,endStyle,title,css){if(text){var displayText=builder.splitSpaces?splitSpaces(text,builder.trailingSpace):text,special=builder.cm.state.specialChars,mustWrap=!1,content;if(!special.test(text))builder.col+=text.length,content=document.createTextNode(displayText),builder.map.push(builder.pos,builder.pos+text.length,content),ie&&9>ie_version&&(mustWrap=!0),builder.pos+=text.length;else{content=document.createDocumentFragment();for(var pos=0;;){special.lastIndex=pos;var m=special.exec(text),skipped=m?m.index-pos:text.length-pos;if(skipped){var txt=document.createTextNode(displayText.slice(pos,pos+skipped));ie&&9>ie_version?content.appendChild(elt("span",[txt])):content.appendChild(txt),builder.map.push(builder.pos,builder.pos+skipped,txt),builder.col+=skipped,builder.pos+=skipped}if(!m)break;pos+=skipped+1;var txt$1=void 0;if("\t"==m[0]){var tabSize=builder.cm.options.tabSize,tabWidth=tabSize-builder.col%tabSize;txt$1=content.appendChild(elt("span",spaceStr(tabWidth),"cm-tab")),txt$1.setAttribute("role","presentation"),txt$1.setAttribute("cm-text","\t"),builder.col+=tabWidth}else"\r"==m[0]||"\n"==m[0]?(txt$1=content.appendChild(elt("span","\r"==m[0]?"\u240D":"\u2424","cm-invalidchar")),txt$1.setAttribute("cm-text",m[0]),builder.col+=1):(txt$1=builder.cm.options.specialCharPlaceholder(m[0]),txt$1.setAttribute("cm-text",m[0]),ie&&9>ie_version?content.appendChild(elt("span",[txt$1])):content.appendChild(txt$1),builder.col+=1);builder.map.push(builder.pos,builder.pos+1,txt$1),builder.pos++}}if(builder.trailingSpace=32==displayText.charCodeAt(text.length-1),style||startStyle||endStyle||mustWrap||css){var fullStyle=style||"";startStyle&&(fullStyle+=startStyle),endStyle&&(fullStyle+=endStyle);var token=elt("span",[content],fullStyle,css);return title&&(token.title=title),builder.content.appendChild(token)}builder.content.appendChild(content)}}function splitSpaces(text,trailingBefore){if(1<text.length&&!/ /.test(text))return text;for(var spaceBefore=trailingBefore,result="",i=0,ch;i<text.length;i++)ch=text.charAt(i)," "==ch&&spaceBefore&&(i==text.length-1||32==text.charCodeAt(i+1))&&(ch="\xA0"),result+=ch,spaceBefore=" "==ch;return result}function buildTokenBadBidi(inner,order){return function(builder,text,style,startStyle,endStyle,title,css){style=style?style+" cm-force-border":"cm-force-border";for(var start=builder.pos,end=start+text.length;;){for(var part=void 0,i=0;i<order.length&&(part=order[i],!(part.to>start&&part.from<=start));i++);if(part.to>=end)return inner(builder,text,style,startStyle,endStyle,title,css);inner(builder,text.slice(0,part.to-start),style,startStyle,null,title,css),startStyle=null,text=text.slice(part.to-start),start=part.to}}}function buildCollapsedSpan(builder,size,marker,ignoreWidget){var widget=!ignoreWidget&&marker.widgetNode;widget&&builder.map.push(builder.pos,builder.pos+size,widget),!ignoreWidget&&builder.cm.display.input.needsContentAttribute&&(!widget&&(widget=builder.content.appendChild(document.createElement("span"))),widget.setAttribute("cm-marker",marker.id)),widget&&(builder.cm.display.input.setUneditable(widget),builder.content.appendChild(widget)),builder.pos+=size,builder.trailingSpace=!1}function insertLineContent(line,builder,styles){var spans=line.markedSpans,allText=line.text,at=0;if(!spans){for(var i$1=1;i$1<styles.length;i$1+=2)builder.addToken(builder,allText.slice(at,at=styles[i$1]),interpretTokenStyle(styles[i$1+1],builder.cm.options));return}for(var len=allText.length,pos=0,i=1,text="",nextChange=0,style,css,spanStyle,spanEndStyle,spanStartStyle,title,collapsed;;){if(nextChange==pos){spanStyle=spanEndStyle=spanStartStyle=title=css="",collapsed=null,nextChange=Infinity;for(var foundBookmarks=[],endStyles=void 0,j=0;j<spans.length;++j){var sp=spans[j],m=sp.marker;"bookmark"==m.type&&sp.from==pos&&m.widgetNode?foundBookmarks.push(m):sp.from<=pos&&(null==sp.to||sp.to>pos||m.collapsed&&sp.to==pos&&sp.from==pos)?(null!=sp.to&&sp.to!=pos&&nextChange>sp.to&&(nextChange=sp.to,spanEndStyle=""),m.className&&(spanStyle+=" "+m.className),m.css&&(css=(css?css+";":"")+m.css),m.startStyle&&sp.from==pos&&(spanStartStyle+=" "+m.startStyle),m.endStyle&&sp.to==nextChange&&(endStyles||(endStyles=[])).push(m.endStyle,sp.to),m.title&&!title&&(title=m.title),m.collapsed&&(!collapsed||0>compareCollapsedMarkers(collapsed.marker,m))&&(collapsed=sp)):sp.from>pos&&nextChange>sp.from&&(nextChange=sp.from)}if(endStyles)for(var j$1=0;j$1<endStyles.length;j$1+=2)endStyles[j$1+1]==nextChange&&(spanEndStyle+=" "+endStyles[j$1]);if(!collapsed||collapsed.from==pos)for(var j$2=0;j$2<foundBookmarks.length;++j$2)buildCollapsedSpan(builder,0,foundBookmarks[j$2]);if(collapsed&&(collapsed.from||0)==pos){if(buildCollapsedSpan(builder,(null==collapsed.to?len+1:collapsed.to)-pos,collapsed.marker,null==collapsed.from),null==collapsed.to)return;collapsed.to==pos&&(collapsed=!1)}}if(pos>=len)break;for(var upto=_Mathmin6(len,nextChange);;){if(text){var end=pos+text.length;if(!collapsed){var tokenText=end>upto?text.slice(0,upto-pos):text;builder.addToken(builder,tokenText,style?style+spanStyle:spanStyle,spanStartStyle,pos+tokenText.length==nextChange?spanEndStyle:"",title,css)}if(end>=upto){text=text.slice(upto-pos),pos=upto;break}pos=end,spanStartStyle=""}text=allText.slice(at,at=styles[i++]),style=interpretTokenStyle(styles[i++],builder.cm.options)}}}function LineView(doc,line,lineN){this.line=line,this.rest=visualLineContinued(line),this.size=this.rest?lineNo(lst(this.rest))-lineN+1:1,this.node=this.text=null,this.hidden=lineIsHidden(doc,line)}function buildViewArray(cm,from,to){for(var array=[],pos=from,nextPos,view;pos<to;pos=nextPos)view=new LineView(cm.doc,getLine(cm.doc,pos),pos),nextPos=pos+view.size,array.push(view);return array}function pushOperation(op){operationGroup?operationGroup.ops.push(op):op.ownsGroup=operationGroup={ops:[op],delayedCallbacks:[]}}function fireCallbacksForOps(group){var callbacks=group.delayedCallbacks,i=0;do{for(;i<callbacks.length;i++)callbacks[i].call(null);for(var j=0,op;j<group.ops.length;j++)if(op=group.ops[j],op.cursorActivityHandlers)for(;op.cursorActivityCalled<op.cursorActivityHandlers.length;)op.cursorActivityHandlers[op.cursorActivityCalled++].call(null,op.cm)}while(i<callbacks.length)}function finishOperation(op,endCb){var group=op.ownsGroup;if(group)try{fireCallbacksForOps(group)}finally{operationGroup=null,endCb(group)}}function signalLater(emitter,type){var arr=getHandlers(emitter,type);if(arr.length){var args=Array.prototype.slice.call(arguments,2),list;operationGroup?list=operationGroup.delayedCallbacks:orphanDelayedCallbacks?list=orphanDelayedCallbacks:(list=orphanDelayedCallbacks=[],setTimeout(fireOrphanDelayed,0));for(var loop=function(i){list.push(function(){return arr[i].apply(null,args)})},i=0;i<arr.length;++i)loop(i)}}function fireOrphanDelayed(){var delayed=orphanDelayedCallbacks;orphanDelayedCallbacks=null;for(var i=0;i<delayed.length;++i)delayed[i]()}function updateLineForChanges(cm,lineView,lineN,dims){for(var j=0,type;j<lineView.changes.length;j++)type=lineView.changes[j],"text"==type?updateLineText(cm,lineView):"gutter"==type?updateLineGutter(cm,lineView,lineN,dims):"class"==type?updateLineClasses(cm,lineView):"widget"==type&&updateLineWidgets(cm,lineView,dims);lineView.changes=null}function ensureLineWrapped(lineView){return lineView.node==lineView.text&&(lineView.node=elt("div",null,null,"position: relative"),lineView.text.parentNode&&lineView.text.parentNode.replaceChild(lineView.node,lineView.text),lineView.node.appendChild(lineView.text),ie&&8>ie_version&&(lineView.node.style.zIndex=2)),lineView.node}function updateLineBackground(cm,lineView){var cls=lineView.bgClass?lineView.bgClass+" "+(lineView.line.bgClass||""):lineView.line.bgClass;if(cls&&(cls+=" CodeMirror-linebackground"),lineView.background)cls?lineView.background.className=cls:(lineView.background.parentNode.removeChild(lineView.background),lineView.background=null);else if(cls){var wrap=ensureLineWrapped(lineView);lineView.background=wrap.insertBefore(elt("div",null,cls),wrap.firstChild),cm.display.input.setUneditable(lineView.background)}}function getLineContent(cm,lineView){var ext=cm.display.externalMeasured;return ext&&ext.line==lineView.line?(cm.display.externalMeasured=null,lineView.measure=ext.measure,ext.built):buildLineContent(cm,lineView)}function updateLineText(cm,lineView){var cls=lineView.text.className,built=getLineContent(cm,lineView);lineView.text==lineView.node&&(lineView.node=built.pre),lineView.text.parentNode.replaceChild(built.pre,lineView.text),lineView.text=built.pre,built.bgClass!=lineView.bgClass||built.textClass!=lineView.textClass?(lineView.bgClass=built.bgClass,lineView.textClass=built.textClass,updateLineClasses(cm,lineView)):cls&&(lineView.text.className=cls)}function updateLineClasses(cm,lineView){updateLineBackground(cm,lineView),lineView.line.wrapClass?ensureLineWrapped(lineView).className=lineView.line.wrapClass:lineView.node!=lineView.text&&(lineView.node.className="");var textClass=lineView.textClass?lineView.textClass+" "+(lineView.line.textClass||""):lineView.line.textClass;lineView.text.className=textClass||""}function updateLineGutter(cm,lineView,lineN,dims){if(lineView.gutter&&(lineView.node.removeChild(lineView.gutter),lineView.gutter=null),lineView.gutterBackground&&(lineView.node.removeChild(lineView.gutterBackground),lineView.gutterBackground=null),lineView.line.gutterClass){var wrap=ensureLineWrapped(lineView);lineView.gutterBackground=elt("div",null,"CodeMirror-gutter-background "+lineView.line.gutterClass,"left: "+(cm.options.fixedGutter?dims.fixedPos:-dims.gutterTotalWidth)+"px; width: "+dims.gutterTotalWidth+"px"),cm.display.input.setUneditable(lineView.gutterBackground),wrap.insertBefore(lineView.gutterBackground,lineView.text)}var markers=lineView.line.gutterMarkers;if(cm.options.lineNumbers||markers){var wrap$1=ensureLineWrapped(lineView),gutterWrap=lineView.gutter=elt("div",null,"CodeMirror-gutter-wrapper","left: "+(cm.options.fixedGutter?dims.fixedPos:-dims.gutterTotalWidth)+"px");if(cm.display.input.setUneditable(gutterWrap),wrap$1.insertBefore(gutterWrap,lineView.text),lineView.line.gutterClass&&(gutterWrap.className+=" "+lineView.line.gutterClass),!cm.options.lineNumbers||markers&&markers["CodeMirror-linenumbers"]||(lineView.lineNumber=gutterWrap.appendChild(elt("div",lineNumberFor(cm.options,lineN),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+dims.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+cm.display.lineNumInnerWidth+"px"))),markers)for(var k=0;k<cm.options.gutters.length;++k){var id=cm.options.gutters[k],found=markers.hasOwnProperty(id)&&markers[id];found&&gutterWrap.appendChild(elt("div",[found],"CodeMirror-gutter-elt","left: "+dims.gutterLeft[id]+"px; width: "+dims.gutterWidth[id]+"px"))}}}function updateLineWidgets(cm,lineView,dims){lineView.alignable&&(lineView.alignable=null);for(var node=lineView.node.firstChild,next=void 0;node;node=next)next=node.nextSibling,"CodeMirror-linewidget"==node.className&&lineView.node.removeChild(node);insertLineWidgets(cm,lineView,dims)}function buildLineElement(cm,lineView,lineN,dims){var built=getLineContent(cm,lineView);return lineView.text=lineView.node=built.pre,built.bgClass&&(lineView.bgClass=built.bgClass),built.textClass&&(lineView.textClass=built.textClass),updateLineClasses(cm,lineView),updateLineGutter(cm,lineView,lineN,dims),insertLineWidgets(cm,lineView,dims),lineView.node}function insertLineWidgets(cm,lineView,dims){if(insertLineWidgetsFor(cm,lineView.line,lineView,dims,!0),lineView.rest)for(var i=0;i<lineView.rest.length;i++)insertLineWidgetsFor(cm,lineView.rest[i],lineView,dims,!1)}function insertLineWidgetsFor(cm,line,lineView,dims,allowAbove){if(line.widgets)for(var wrap=ensureLineWrapped(lineView),i=0,ws=line.widgets;i<ws.length;++i){var widget=ws[i],node=elt("div",[widget.node],"CodeMirror-linewidget");widget.handleMouseEvents||node.setAttribute("cm-ignore-events","true"),positionLineWidget(widget,node,lineView,dims),cm.display.input.setUneditable(node),allowAbove&&widget.above?wrap.insertBefore(node,lineView.gutter||lineView.text):wrap.appendChild(node),signalLater(widget,"redraw")}}function positionLineWidget(widget,node,lineView,dims){if(widget.noHScroll){(lineView.alignable||(lineView.alignable=[])).push(node);var width=dims.wrapperWidth;node.style.left=dims.fixedPos+"px",widget.coverGutter||(width-=dims.gutterTotalWidth,node.style.paddingLeft=dims.gutterTotalWidth+"px"),node.style.width=width+"px"}widget.coverGutter&&(node.style.zIndex=5,node.style.position="relative",!widget.noHScroll&&(node.style.marginLeft=-dims.gutterTotalWidth+"px"))}function widgetHeight(widget){if(null!=widget.height)return widget.height;var cm=widget.doc.cm;if(!cm)return 0;if(!contains(document.body,widget.node)){var parentStyle="position: relative;";widget.coverGutter&&(parentStyle+="margin-left: -"+cm.display.gutters.offsetWidth+"px;"),widget.noHScroll&&(parentStyle+="width: "+cm.display.wrapper.clientWidth+"px;"),removeChildrenAndAdd(cm.display.measure,elt("div",[widget.node],null,parentStyle))}return widget.height=widget.node.parentNode.offsetHeight}function eventInWidget(display,e){for(var n=e_target(e);n!=display.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==display.sizer&&n!=display.mover)return!0}function paddingTop(display){return display.lineSpace.offsetTop}function paddingVert(display){return display.mover.offsetHeight-display.lineSpace.offsetHeight}function paddingH(display){if(display.cachedPaddingH)return display.cachedPaddingH;var e=removeChildrenAndAdd(display.measure,elt("pre","x")),style=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,data={left:parseInt(style.paddingLeft),right:parseInt(style.paddingRight)};return isNaN(data.left)||isNaN(data.right)||(display.cachedPaddingH=data),data}function scrollGap(cm){return scrollerGap-cm.display.nativeBarWidth}function displayWidth(cm){return cm.display.scroller.clientWidth-scrollGap(cm)-cm.display.barWidth}function displayHeight(cm){return cm.display.scroller.clientHeight-scrollGap(cm)-cm.display.barHeight}function ensureLineHeights(cm,lineView,rect){var wrapping=cm.options.lineWrapping,curWidth=wrapping&&displayWidth(cm);if(!lineView.measure.heights||wrapping&&lineView.measure.width!=curWidth){var heights=lineView.measure.heights=[];if(wrapping){lineView.measure.width=curWidth;for(var rects=lineView.text.firstChild.getClientRects(),i=0;i<rects.length-1;i++){var cur=rects[i],next=rects[i+1];2<_Mathabs(cur.bottom-next.bottom)&&heights.push((cur.bottom+next.top)/2-rect.top)}}heights.push(rect.bottom-rect.top)}}function mapFromLineView(lineView,line,lineN){if(lineView.line==line)return{map:lineView.measure.map,cache:lineView.measure.cache};for(var i=0;i<lineView.rest.length;i++)if(lineView.rest[i]==line)return{map:lineView.measure.maps[i],cache:lineView.measure.caches[i]};for(var i$1=0;i$1<lineView.rest.length;i$1++)if(lineNo(lineView.rest[i$1])>lineN)return{map:lineView.measure.maps[i$1],cache:lineView.measure.caches[i$1],before:!0}}function updateExternalMeasurement(cm,line){line=visualLine(line);var lineN=lineNo(line),view=cm.display.externalMeasured=new LineView(cm.doc,line,lineN);view.lineN=lineN;var built=view.built=buildLineContent(cm,view);return view.text=built.pre,removeChildrenAndAdd(cm.display.lineMeasure,built.pre),view}function measureChar(cm,line,ch,bias){return measureCharPrepared(cm,prepareMeasureForLine(cm,line),ch,bias)}function findViewForLine(cm,lineN){if(lineN>=cm.display.viewFrom&&lineN<cm.display.viewTo)return cm.display.view[findViewIndex(cm,lineN)];var ext=cm.display.externalMeasured;if(ext&&lineN>=ext.lineN&&lineN<ext.lineN+ext.size)return ext}function prepareMeasureForLine(cm,line){var lineN=lineNo(line),view=findViewForLine(cm,lineN);view&&!view.text?view=null:view&&view.changes&&(updateLineForChanges(cm,view,lineN,getDimensions(cm)),cm.curOp.forceUpdate=!0),view||(view=updateExternalMeasurement(cm,line));var info=mapFromLineView(view,line,lineN);return{line:line,view:view,rect:null,map:info.map,cache:info.cache,before:info.before,hasHeights:!1}}function measureCharPrepared(cm,prepared,ch,bias,varHeight){prepared.before&&(ch=-1);var key=ch+(bias||""),found;return prepared.cache.hasOwnProperty(key)?found=prepared.cache[key]:(!prepared.rect&&(prepared.rect=prepared.view.text.getBoundingClientRect()),!prepared.hasHeights&&(ensureLineHeights(cm,prepared.view,prepared.rect),prepared.hasHeights=!0),found=measureCharInner(cm,prepared,ch,bias),!found.bogus&&(prepared.cache[key]=found)),{left:found.left,right:found.right,top:varHeight?found.rtop:found.top,bottom:varHeight?found.rbottom:found.bottom}}function nodeAndOffsetInLineMap(map$$1,ch,bias){for(var i=0,node,start,end,collapse,mStart,mEnd;i<map$$1.length;i+=3)if(mStart=map$$1[i],mEnd=map$$1[i+1],ch<mStart?(start=0,end=1,collapse="left"):ch<mEnd?(start=ch-mStart,end=start+1):(i==map$$1.length-3||ch==mEnd&&map$$1[i+3]>ch)&&(end=mEnd-mStart,start=end-1,ch>=mEnd&&(collapse="right")),null!=start){if(node=map$$1[i+2],mStart==mEnd&&bias==(node.insertLeft?"left":"right")&&(collapse=bias),"left"==bias&&0==start)for(;i&&map$$1[i-2]==map$$1[i-3]&&map$$1[i-1].insertLeft;)node=map$$1[(i-=3)+2],collapse="left";if("right"==bias&&start==mEnd-mStart)for(;i<map$$1.length-3&&map$$1[i+3]==map$$1[i+4]&&!map$$1[i+5].insertLeft;)node=map$$1[(i+=3)+2],collapse="right";break}return{node:node,start:start,end:end,collapse:collapse,coverStart:mStart,coverEnd:mEnd}}function getUsefulRect(rects,bias){var rect=nullRect;if("left"==bias)for(var i=0;i<rects.length&&(rect=rects[i]).left==rect.right;i++);else for(var i$1=rects.length-1;0<=i$1&&(rect=rects[i$1]).left==rect.right;i$1--);return rect}function measureCharInner(cm,prepared,ch,bias){var place=nodeAndOffsetInLineMap(prepared.map,ch,bias),node=place.node,start=place.start,end=place.end,collapse=place.collapse,rect;if(3==node.nodeType){for(var i$1=0;4>i$1;i$1++){for(;start&&isExtendingChar(prepared.line.text.charAt(place.coverStart+start));)--start;for(;place.coverStart+end<place.coverEnd&&isExtendingChar(prepared.line.text.charAt(place.coverStart+end));)++end;if(rect=ie&&9>ie_version&&0==start&&end==place.coverEnd-place.coverStart?node.parentNode.getBoundingClientRect():getUsefulRect(range(node,start,end).getClientRects(),bias),rect.left||rect.right||0==start)break;end=start,--start,collapse="right"}ie&&11>ie_version&&(rect=maybeUpdateRectForZooming(cm.display.measure,rect))}else{0<start&&(collapse=bias="right");var rects;rect=cm.options.lineWrapping&&1<(rects=node.getClientRects()).length?rects["right"==bias?rects.length-1:0]:node.getBoundingClientRect()}if(ie&&9>ie_version&&!start&&(!rect||!rect.left&&!rect.right)){var rSpan=node.parentNode.getClientRects()[0];rect=rSpan?{left:rSpan.left,right:rSpan.left+charWidth(cm.display),top:rSpan.top,bottom:rSpan.bottom}:nullRect}for(var rtop=rect.top-prepared.rect.top,rbot=rect.bottom-prepared.rect.top,heights=prepared.view.measure.heights,i=0;i<heights.length-1&&!((rtop+rbot)/2<heights[i]);i++);var top=i?heights[i-1]:0,bot=heights[i],result={left:("right"==collapse?rect.right:rect.left)-prepared.rect.left,right:("left"==collapse?rect.left:rect.right)-prepared.rect.left,top:top,bottom:bot};return rect.left||rect.right||(result.bogus=!0),cm.options.singleCursorHeightPerLine||(result.rtop=rtop,result.rbottom=rbot),result}function maybeUpdateRectForZooming(measure,rect){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!hasBadZoomedRects(measure))return rect;var scaleX=screen.logicalXDPI/screen.deviceXDPI,scaleY=screen.logicalYDPI/screen.deviceYDPI;return{left:rect.left*scaleX,right:rect.right*scaleX,top:rect.top*scaleY,bottom:rect.bottom*scaleY}}function clearLineMeasurementCacheFor(lineView){if(lineView.measure&&(lineView.measure.cache={},lineView.measure.heights=null,lineView.rest))for(var i=0;i<lineView.rest.length;i++)lineView.measure.caches[i]={}}function clearLineMeasurementCache(cm){cm.display.externalMeasure=null,removeChildren(cm.display.lineMeasure);for(var i=0;i<cm.display.view.length;i++)clearLineMeasurementCacheFor(cm.display.view[i])}function clearCaches(cm){clearLineMeasurementCache(cm),cm.display.cachedCharWidth=cm.display.cachedTextHeight=cm.display.cachedPaddingH=null,cm.options.lineWrapping||(cm.display.maxLineChanged=!0),cm.display.lineNumChars=null}function pageScrollX(){return chrome&&android?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function pageScrollY(){return chrome&&android?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function widgetTopHeight(lineObj){var height=0;if(lineObj.widgets)for(var i=0;i<lineObj.widgets.length;++i)lineObj.widgets[i].above&&(height+=widgetHeight(lineObj.widgets[i]));return height}function intoCoordSystem(cm,lineObj,rect,context,includeWidgets){if(!includeWidgets){var height=widgetTopHeight(lineObj);rect.top+=height,rect.bottom+=height}if("line"==context)return rect;context||(context="local");var yOff=_heightAtLine(lineObj);if("local"==context?yOff+=paddingTop(cm.display):yOff-=cm.display.viewOffset,"page"==context||"window"==context){var lOff=cm.display.lineSpace.getBoundingClientRect();yOff+=lOff.top+("window"==context?0:pageScrollY());var xOff=lOff.left+("window"==context?0:pageScrollX());rect.left+=xOff,rect.right+=xOff}return rect.top+=yOff,rect.bottom+=yOff,rect}function fromCoordSystem(cm,coords,context){if("div"==context)return coords;var left=coords.left,top=coords.top;if("page"==context)left-=pageScrollX(),top-=pageScrollY();else if("local"==context||!context){var localBox=cm.display.sizer.getBoundingClientRect();left+=localBox.left,top+=localBox.top}var lineSpaceBox=cm.display.lineSpace.getBoundingClientRect();return{left:left-lineSpaceBox.left,top:top-lineSpaceBox.top}}function _charCoords(cm,pos,context,lineObj,bias){return lineObj||(lineObj=getLine(cm.doc,pos.line)),intoCoordSystem(cm,lineObj,measureChar(cm,lineObj,pos.ch,bias),context)}function _cursorCoords(cm,pos,context,lineObj,preparedMeasure,varHeight){function get(ch,right){var m=measureCharPrepared(cm,preparedMeasure,ch,right?"right":"left",varHeight);return right?m.left=m.right:m.right=m.left,intoCoordSystem(cm,lineObj,m,context)}function getBidi(ch,partPos,invert){var part=order[partPos],right=1==part.level;return get(invert?ch-1:ch,right!=invert)}lineObj=lineObj||getLine(cm.doc,pos.line),preparedMeasure||(preparedMeasure=prepareMeasureForLine(cm,lineObj));var order=getOrder(lineObj,cm.doc.direction),ch=pos.ch,sticky=pos.sticky;if(ch>=lineObj.text.length?(ch=lineObj.text.length,sticky="before"):0>=ch&&(ch=0,sticky="after"),!order)return get("before"==sticky?ch-1:ch,"before"==sticky);var partPos=getBidiPartAt(order,ch,sticky),other=bidiOther,val=getBidi(ch,partPos,"before"==sticky);return null!=other&&(val.other=getBidi(ch,other,"before"!=sticky)),val}function estimateCoords(cm,pos){var left=0;pos=_clipPos(cm.doc,pos),cm.options.lineWrapping||(left=charWidth(cm.display)*pos.ch);var lineObj=getLine(cm.doc,pos.line),top=_heightAtLine(lineObj)+paddingTop(cm.display);return{left:left,right:left,top:top,bottom:top+lineObj.height}}function PosWithInfo(line,ch,sticky,outside,xRel){var pos=Pos(line,ch,sticky);return pos.xRel=xRel,outside&&(pos.outside=!0),pos}function _coordsChar(cm,x,y){var doc=cm.doc;if(y+=cm.display.viewOffset,0>y)return PosWithInfo(doc.first,0,null,!0,-1);var lineN=_lineAtHeight(doc,y),last=doc.first+doc.size-1;if(lineN>last)return PosWithInfo(doc.first+doc.size-1,getLine(doc,last).text.length,null,!0,1);0>x&&(x=0);for(var lineObj=getLine(doc,lineN);;){var found=coordsCharInner(cm,lineObj,lineN,x,y),collapsed=collapsedSpanAround(lineObj,found.ch+(0<found.xRel?1:0));if(!collapsed)return found;var rangeEnd=collapsed.find(1);if(rangeEnd.line==lineN)return rangeEnd;lineObj=getLine(doc,lineN=rangeEnd.line)}}function wrappedLineExtent(cm,lineObj,preparedMeasure,y){y-=widgetTopHeight(lineObj);var end=lineObj.text.length,begin=findFirst(function(ch){return measureCharPrepared(cm,preparedMeasure,ch-1).bottom<=y},end,0);return end=findFirst(function(ch){return measureCharPrepared(cm,preparedMeasure,ch).top>y},begin,end),{begin:begin,end:end}}function wrappedLineExtentChar(cm,lineObj,preparedMeasure,target){preparedMeasure||(preparedMeasure=prepareMeasureForLine(cm,lineObj));var targetTop=intoCoordSystem(cm,lineObj,measureCharPrepared(cm,preparedMeasure,target),"line").top;return wrappedLineExtent(cm,lineObj,preparedMeasure,targetTop)}function boxIsAfter(box,x,y,left){return!(box.bottom<=y)&&(!!(box.top>y)||(left?box.left:box.right)>x)}function coordsCharInner(cm,lineObj,lineNo$$1,x,y){y-=_heightAtLine(lineObj);var preparedMeasure=prepareMeasureForLine(cm,lineObj),widgetHeight$$1=widgetTopHeight(lineObj),begin=0,end=lineObj.text.length,ltr=!0,order=getOrder(lineObj,cm.doc.direction);if(order){var part=(cm.options.lineWrapping?coordsBidiPartWrapped:coordsBidiPart)(cm,lineObj,lineNo$$1,preparedMeasure,order,x,y);ltr=1!=part.level,begin=ltr?part.from:part.to-1,end=ltr?part.to:part.from-1}var chAround=null,boxAround=null,ch=findFirst(function(ch){var box=measureCharPrepared(cm,preparedMeasure,ch);return(box.top+=widgetHeight$$1,box.bottom+=widgetHeight$$1,!!boxIsAfter(box,x,y,!1))&&(box.top<=y&&box.left<=x&&(chAround=ch,boxAround=box),!0)},begin,end),outside=!1,baseX,sticky;if(boxAround){var atLeft=x-boxAround.left<boxAround.right-x,atStart=atLeft==ltr;ch=chAround+(atStart?0:1),sticky=atStart?"after":"before",baseX=atLeft?boxAround.left:boxAround.right}else{ltr||ch!=end&&ch!=begin||ch++,sticky=0==ch?"after":ch==lineObj.text.length?"before":measureCharPrepared(cm,preparedMeasure,ch-(ltr?1:0)).bottom+widgetHeight$$1<=y==ltr?"after":"before";var coords=_cursorCoords(cm,Pos(lineNo$$1,ch,sticky),"line",lineObj,preparedMeasure);baseX=coords.left,outside=y<coords.top||y>=coords.bottom}return ch=skipExtendingChars(lineObj.text,ch,1),PosWithInfo(lineNo$$1,ch,sticky,outside,x-baseX)}function coordsBidiPart(cm,lineObj,lineNo$$1,preparedMeasure,order,x,y){var index=findFirst(function(i){var part=order[i],ltr=1!=part.level;return boxIsAfter(_cursorCoords(cm,Pos(lineNo$$1,ltr?part.to:part.from,ltr?"before":"after"),"line",lineObj,preparedMeasure),x,y,!0)},0,order.length-1),part=order[index];if(0<index){var ltr=1!=part.level,start=_cursorCoords(cm,Pos(lineNo$$1,ltr?part.from:part.to,ltr?"after":"before"),"line",lineObj,preparedMeasure);boxIsAfter(start,x,y,!0)&&start.top>y&&(part=order[index-1])}return part}function coordsBidiPartWrapped(cm,lineObj,_lineNo,preparedMeasure,order,x,y){var ref=wrappedLineExtent(cm,lineObj,preparedMeasure,y),begin=ref.begin,end=ref.end;/\s/.test(lineObj.text.charAt(end-1))&&end--;for(var part=null,closestDist=null,i=0,p;i<order.length;i++)if(p=order[i],!(p.from>=end||p.to<=begin)){var ltr=1!=p.level,endX=measureCharPrepared(cm,preparedMeasure,ltr?_Mathmin6(end,p.to)-1:_Mathmax5(begin,p.from)).right,dist=endX<x?x-endX+1e9:endX-x;(!part||closestDist>dist)&&(part=p,closestDist=dist)}return part||(part=order[order.length-1]),part.from<begin&&(part={from:begin,to:part.to,level:part.level}),part.to>end&&(part={from:part.from,to:end,level:part.level}),part}function textHeight(display){if(null!=display.cachedTextHeight)return display.cachedTextHeight;if(null==measureText){measureText=elt("pre");for(var i=0;49>i;++i)measureText.appendChild(document.createTextNode("x")),measureText.appendChild(elt("br"));measureText.appendChild(document.createTextNode("x"))}removeChildrenAndAdd(display.measure,measureText);var height=measureText.offsetHeight/50;return 3<height&&(display.cachedTextHeight=height),removeChildren(display.measure),height||1}function charWidth(display){if(null!=display.cachedCharWidth)return display.cachedCharWidth;var anchor=elt("span","xxxxxxxxxx"),pre=elt("pre",[anchor]);removeChildrenAndAdd(display.measure,pre);var rect=anchor.getBoundingClientRect(),width=(rect.right-rect.left)/10;return 2<width&&(display.cachedCharWidth=width),width||10}function getDimensions(cm){for(var d=cm.display,left={},width={},gutterLeft=d.gutters.clientLeft,n=d.gutters.firstChild,i=0;n;n=n.nextSibling,++i)left[cm.options.gutters[i]]=n.offsetLeft+n.clientLeft+gutterLeft,width[cm.options.gutters[i]]=n.clientWidth;return{fixedPos:compensateForHScroll(d),gutterTotalWidth:d.gutters.offsetWidth,gutterLeft:left,gutterWidth:width,wrapperWidth:d.wrapper.clientWidth}}function compensateForHScroll(display){return display.scroller.getBoundingClientRect().left-display.sizer.getBoundingClientRect().left}function estimateHeight(cm){var th=textHeight(cm.display),wrapping=cm.options.lineWrapping,perLine=wrapping&&_Mathmax5(5,cm.display.scroller.clientWidth/charWidth(cm.display)-3);return function(line){if(lineIsHidden(cm.doc,line))return 0;var widgetsHeight=0;if(line.widgets)for(var i=0;i<line.widgets.length;i++)line.widgets[i].height&&(widgetsHeight+=line.widgets[i].height);return wrapping?widgetsHeight+(_Mathceil(line.text.length/perLine)||1)*th:widgetsHeight+th}}function estimateLineHeights(cm){var doc=cm.doc,est=estimateHeight(cm);doc.iter(function(line){var estHeight=est(line);estHeight!=line.height&&updateLineHeight(line,estHeight)})}function posFromMouse(cm,e,liberal,forRect){var display=cm.display;if(!liberal&&"true"==e_target(e).getAttribute("cm-not-content"))return null;var space=display.lineSpace.getBoundingClientRect(),x,y;try{x=e.clientX-space.left,y=e.clientY-space.top}catch(e){return null}var coords=_coordsChar(cm,x,y),line;if(forRect&&1==coords.xRel&&(line=getLine(cm.doc,coords.line).text).length==coords.ch){var colDiff=countColumn(line,line.length,cm.options.tabSize)-line.length;coords=Pos(coords.line,_Mathmax5(0,_Mathround2((x-paddingH(cm.display).left)/charWidth(cm.display))-colDiff))}return coords}function findViewIndex(cm,n){if(n>=cm.display.viewTo)return null;if(n-=cm.display.viewFrom,0>n)return null;for(var view=cm.display.view,i=0;i<view.length;i++)if(n-=view[i].size,0>n)return i}function updateSelection(cm){cm.display.input.showSelection(cm.display.input.prepareSelection())}function prepareSelection(cm,primary){void 0===primary&&(primary=!0);for(var doc=cm.doc,result={},curFragment=result.cursors=document.createDocumentFragment(),selFragment=result.selection=document.createDocumentFragment(),i=0;i<doc.sel.ranges.length;i++)if(primary||i!=doc.sel.primIndex){var range$$1=doc.sel.ranges[i];if(!(range$$1.from().line>=cm.display.viewTo||range$$1.to().line<cm.display.viewFrom)){var collapsed=range$$1.empty();(collapsed||cm.options.showCursorWhenSelecting)&&drawSelectionCursor(cm,range$$1.head,curFragment),collapsed||drawSelectionRange(cm,range$$1,selFragment)}}return result}function drawSelectionCursor(cm,head,output){var pos=_cursorCoords(cm,head,"div",null,null,!cm.options.singleCursorHeightPerLine),cursor=output.appendChild(elt("div","\xA0","CodeMirror-cursor"));if(cursor.style.left=pos.left+"px",cursor.style.top=pos.top+"px",cursor.style.height=_Mathmax5(0,pos.bottom-pos.top)*cm.options.cursorHeight+"px",pos.other){var otherCursor=output.appendChild(elt("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));otherCursor.style.display="",otherCursor.style.left=pos.other.left+"px",otherCursor.style.top=pos.other.top+"px",otherCursor.style.height=.85*(pos.other.bottom-pos.other.top)+"px"}}function cmpCoords(a,b){return a.top-b.top||a.left-b.left}function drawSelectionRange(cm,range$$1,output){function add(left,top,width,bottom){0>top&&(top=0),top=_Mathround2(top),bottom=_Mathround2(bottom),fragment.appendChild(elt("div",null,"CodeMirror-selected","position: absolute; left: "+left+"px;\n top: "+top+"px; width: "+(null==width?rightSide-left:width)+"px;\n height: "+(bottom-top)+"px"))}function drawForLine(line,fromArg,toArg){function coords(ch,bias){return _charCoords(cm,Pos(line,ch),"div",lineObj,bias)}function wrapX(pos,dir,side){var extent=wrappedLineExtentChar(cm,lineObj,null,pos),prop="ltr"==dir==("after"==side)?"left":"right",ch="after"==side?extent.begin:extent.end-(/\s/.test(lineObj.text.charAt(extent.end-1))?2:1);return coords(ch,prop)[prop]}var lineObj=getLine(doc,line),lineLen=lineObj.text.length,order=getOrder(lineObj,doc.direction),start,end;return iterateBidiSections(order,fromArg||0,null==toArg?lineLen:toArg,function(from,to,dir,i){var ltr="ltr"==dir,fromPos=coords(from,ltr?"left":"right"),toPos=coords(to-1,ltr?"right":"left"),openStart=null==fromArg&&0==from,openEnd=null==toArg&&to==lineLen,first=0==i,last=!order||i==order.length-1;if(3>=toPos.top-fromPos.top){var openLeft=(docLTR?openStart:openEnd)&&first,openRight=(docLTR?openEnd:openStart)&&last,left=openLeft?leftSide:(ltr?fromPos:toPos).left,right=openRight?rightSide:(ltr?toPos:fromPos).right;add(left,fromPos.top,right-left,fromPos.bottom)}else{var topLeft,topRight,botLeft,botRight;ltr?(topLeft=docLTR&&openStart&&first?leftSide:fromPos.left,topRight=docLTR?rightSide:wrapX(from,dir,"before"),botLeft=docLTR?leftSide:wrapX(to,dir,"after"),botRight=docLTR&&openEnd&&last?rightSide:toPos.right):(topLeft=docLTR?wrapX(from,dir,"before"):leftSide,topRight=!docLTR&&openStart&&first?rightSide:fromPos.right,botLeft=!docLTR&&openEnd&&last?leftSide:toPos.left,botRight=docLTR?wrapX(to,dir,"after"):rightSide),add(topLeft,fromPos.top,topRight-topLeft,fromPos.bottom),fromPos.bottom<toPos.top&&add(leftSide,fromPos.bottom,null,toPos.top),add(botLeft,toPos.top,botRight-botLeft,toPos.bottom)}(!start||0>cmpCoords(fromPos,start))&&(start=fromPos),0>cmpCoords(toPos,start)&&(start=toPos),(!end||0>cmpCoords(fromPos,end))&&(end=fromPos),0>cmpCoords(toPos,end)&&(end=toPos)}),{start:start,end:end}}var display=cm.display,doc=cm.doc,fragment=document.createDocumentFragment(),padding=paddingH(cm.display),leftSide=padding.left,rightSide=_Mathmax5(display.sizerWidth,displayWidth(cm)-display.sizer.offsetLeft)-padding.right,docLTR="ltr"==doc.direction,sFrom=range$$1.from(),sTo=range$$1.to();if(sFrom.line==sTo.line)drawForLine(sFrom.line,sFrom.ch,sTo.ch);else{var fromLine=getLine(doc,sFrom.line),toLine=getLine(doc,sTo.line),singleVLine=visualLine(fromLine)==visualLine(toLine),leftEnd=drawForLine(sFrom.line,sFrom.ch,singleVLine?fromLine.text.length+1:null).end,rightStart=drawForLine(sTo.line,singleVLine?0:null,sTo.ch).start;singleVLine&&(leftEnd.top<rightStart.top-2?(add(leftEnd.right,leftEnd.top,null,leftEnd.bottom),add(leftSide,rightStart.top,rightStart.left,rightStart.bottom)):add(leftEnd.right,leftEnd.top,rightStart.left-leftEnd.right,leftEnd.bottom)),leftEnd.bottom<rightStart.top&&add(leftSide,leftEnd.bottom,null,rightStart.top)}output.appendChild(fragment)}function restartBlink(cm){if(cm.state.focused){var display=cm.display;clearInterval(display.blinker);var on=!0;display.cursorDiv.style.visibility="",0<cm.options.cursorBlinkRate?display.blinker=setInterval(function(){return display.cursorDiv.style.visibility=(on=!on)?"":"hidden"},cm.options.cursorBlinkRate):0>cm.options.cursorBlinkRate&&(display.cursorDiv.style.visibility="hidden")}}function ensureFocus(cm){cm.state.focused||(cm.display.input.focus(),onFocus(cm))}function delayBlurEvent(cm){cm.state.delayingBlurEvent=!0,setTimeout(function(){cm.state.delayingBlurEvent&&(cm.state.delayingBlurEvent=!1,onBlur(cm))},100)}function onFocus(cm,e){cm.state.delayingBlurEvent&&(cm.state.delayingBlurEvent=!1),"nocursor"==cm.options.readOnly||(!cm.state.focused&&(signal(cm,"focus",cm,e),cm.state.focused=!0,addClass(cm.display.wrapper,"CodeMirror-focused"),!cm.curOp&&cm.display.selForContextMenu!=cm.doc.sel&&(cm.display.input.reset(),webkit&&setTimeout(function(){return cm.display.input.reset(!0)},20)),cm.display.input.receivedFocus()),restartBlink(cm))}function onBlur(cm,e){cm.state.delayingBlurEvent||(cm.state.focused&&(signal(cm,"blur",cm,e),cm.state.focused=!1,rmClass(cm.display.wrapper,"CodeMirror-focused")),clearInterval(cm.display.blinker),setTimeout(function(){cm.state.focused||(cm.display.shift=!1)},150))}function updateHeightsInViewport(cm){for(var display=cm.display,prevBottom=display.lineDiv.offsetTop,i=0;i<display.view.length;i++){var cur=display.view[i],height=void 0;if(!cur.hidden){if(ie&&8>ie_version){var bot=cur.node.offsetTop+cur.node.offsetHeight;height=bot-prevBottom,prevBottom=bot}else{var box=cur.node.getBoundingClientRect();height=box.bottom-box.top}var diff=cur.line.height-height;if(2>height&&(height=textHeight(display)),(.005<diff||-.005>diff)&&(updateLineHeight(cur.line,height),updateWidgetHeight(cur.line),cur.rest))for(var j=0;j<cur.rest.length;j++)updateWidgetHeight(cur.rest[j])}}}function updateWidgetHeight(line){if(line.widgets)for(var i=0;i<line.widgets.length;++i){var w=line.widgets[i],parent=w.node.parentNode;parent&&(w.height=parent.offsetHeight)}}function visibleLines(display,doc,viewport){var top=viewport&&null!=viewport.top?_Mathmax5(0,viewport.top):display.scroller.scrollTop;top=_Mathfloor4(top-paddingTop(display));var bottom=viewport&&null!=viewport.bottom?viewport.bottom:top+display.wrapper.clientHeight,from=_lineAtHeight(doc,top),to=_lineAtHeight(doc,bottom);if(viewport&&viewport.ensure){var ensureFrom=viewport.ensure.from.line,ensureTo=viewport.ensure.to.line;ensureFrom<from?(from=ensureFrom,to=_lineAtHeight(doc,_heightAtLine(getLine(doc,ensureFrom))+display.wrapper.clientHeight)):_Mathmin6(ensureTo,doc.lastLine())>=to&&(from=_lineAtHeight(doc,_heightAtLine(getLine(doc,ensureTo))-display.wrapper.clientHeight),to=ensureTo)}return{from:from,to:_Mathmax5(to,from+1)}}function alignHorizontally(cm){var display=cm.display,view=display.view;if(display.alignWidgets||display.gutters.firstChild&&cm.options.fixedGutter){for(var comp=compensateForHScroll(display)-display.scroller.scrollLeft+cm.doc.scrollLeft,gutterW=display.gutters.offsetWidth,left=comp+"px",i=0;i<view.length;i++)if(!view[i].hidden){cm.options.fixedGutter&&(view[i].gutter&&(view[i].gutter.style.left=left),view[i].gutterBackground&&(view[i].gutterBackground.style.left=left));var align=view[i].alignable;if(align)for(var j=0;j<align.length;j++)align[j].style.left=left}cm.options.fixedGutter&&(display.gutters.style.left=comp+gutterW+"px")}}function maybeUpdateLineNumberWidth(cm){if(!cm.options.lineNumbers)return!1;var doc=cm.doc,last=lineNumberFor(cm.options,doc.first+doc.size-1),display=cm.display;if(last.length!=display.lineNumChars){var test=display.measure.appendChild(elt("div",[elt("div",last)],"CodeMirror-linenumber CodeMirror-gutter-elt")),innerW=test.firstChild.offsetWidth,padding=test.offsetWidth-innerW;return display.lineGutter.style.width="",display.lineNumInnerWidth=_Mathmax5(innerW,display.lineGutter.offsetWidth-padding)+1,display.lineNumWidth=display.lineNumInnerWidth+padding,display.lineNumChars=display.lineNumInnerWidth?last.length:-1,display.lineGutter.style.width=display.lineNumWidth+"px",updateGutterSpace(cm),!0}return!1}function maybeScrollWindow(cm,rect){if(!signalDOMEvent(cm,"scrollCursorIntoView")){var display=cm.display,box=display.sizer.getBoundingClientRect(),doScroll=null;if(0>rect.top+box.top?doScroll=!0:rect.bottom+box.top>(window.innerHeight||document.documentElement.clientHeight)&&(doScroll=!1),null!=doScroll&&!phantom){var scrollNode=elt("div","\u200B",null,"position: absolute;\n top: "+(rect.top-display.viewOffset-paddingTop(cm.display))+"px;\n height: "+(rect.bottom-rect.top+scrollGap(cm)+display.barHeight)+"px;\n left: "+rect.left+"px; width: "+_Mathmax5(2,rect.right-rect.left)+"px;");cm.display.lineSpace.appendChild(scrollNode),scrollNode.scrollIntoView(doScroll),cm.display.lineSpace.removeChild(scrollNode)}}}function scrollPosIntoView(cm,pos,end,margin){null==margin&&(margin=0);var rect;cm.options.lineWrapping||pos!=end||(pos=pos.ch?Pos(pos.line,"before"==pos.sticky?pos.ch-1:pos.ch,"after"):pos,end="before"==pos.sticky?Pos(pos.line,pos.ch+1,"before"):pos);for(var limit=0;5>limit;limit++){var changed=!1,coords=_cursorCoords(cm,pos),endCoords=end&&end!=pos?_cursorCoords(cm,end):coords;rect={left:_Mathmin6(coords.left,endCoords.left),top:_Mathmin6(coords.top,endCoords.top)-margin,right:_Mathmax5(coords.left,endCoords.left),bottom:_Mathmax5(coords.bottom,endCoords.bottom)+margin};var scrollPos=calculateScrollPos(cm,rect),startTop=cm.doc.scrollTop,startLeft=cm.doc.scrollLeft;if(null!=scrollPos.scrollTop&&(updateScrollTop(cm,scrollPos.scrollTop),1<_Mathabs(cm.doc.scrollTop-startTop)&&(changed=!0)),null!=scrollPos.scrollLeft&&(setScrollLeft(cm,scrollPos.scrollLeft),1<_Mathabs(cm.doc.scrollLeft-startLeft)&&(changed=!0)),!changed)break}return rect}function scrollIntoView(cm,rect){var scrollPos=calculateScrollPos(cm,rect);null!=scrollPos.scrollTop&&updateScrollTop(cm,scrollPos.scrollTop),null!=scrollPos.scrollLeft&&setScrollLeft(cm,scrollPos.scrollLeft)}function calculateScrollPos(cm,rect){var display=cm.display,snapMargin=textHeight(cm.display);0>rect.top&&(rect.top=0);var screentop=cm.curOp&&null!=cm.curOp.scrollTop?cm.curOp.scrollTop:display.scroller.scrollTop,screen=displayHeight(cm),result={};rect.bottom-rect.top>screen&&(rect.bottom=rect.top+screen);var docBottom=cm.doc.height+paddingVert(display),atTop=rect.top<snapMargin,atBottom=rect.bottom>docBottom-snapMargin;if(rect.top<screentop)result.scrollTop=atTop?0:rect.top;else if(rect.bottom>screentop+screen){var newTop=_Mathmin6(rect.top,(atBottom?docBottom:rect.bottom)-screen);newTop!=screentop&&(result.scrollTop=newTop)}var screenleft=cm.curOp&&null!=cm.curOp.scrollLeft?cm.curOp.scrollLeft:display.scroller.scrollLeft,screenw=displayWidth(cm)-(cm.options.fixedGutter?display.gutters.offsetWidth:0),tooWide=rect.right-rect.left>screenw;return tooWide&&(rect.right=rect.left+screenw),10>rect.left?result.scrollLeft=0:rect.left<screenleft?result.scrollLeft=_Mathmax5(0,rect.left-(tooWide?0:10)):rect.right>screenw+screenleft-3&&(result.scrollLeft=rect.right+(tooWide?0:10)-screenw),result}function addToScrollTop(cm,top){null==top||(resolveScrollToPos(cm),cm.curOp.scrollTop=(null==cm.curOp.scrollTop?cm.doc.scrollTop:cm.curOp.scrollTop)+top)}function ensureCursorVisible(cm){resolveScrollToPos(cm);var cur=cm.getCursor();cm.curOp.scrollToPos={from:cur,to:cur,margin:cm.options.cursorScrollMargin}}function scrollToCoords(cm,x,y){(null!=x||null!=y)&&resolveScrollToPos(cm),null!=x&&(cm.curOp.scrollLeft=x),null!=y&&(cm.curOp.scrollTop=y)}function scrollToRange(cm,range$$1){resolveScrollToPos(cm),cm.curOp.scrollToPos=range$$1}function resolveScrollToPos(cm){var range$$1=cm.curOp.scrollToPos;if(range$$1){cm.curOp.scrollToPos=null;var from=estimateCoords(cm,range$$1.from),to=estimateCoords(cm,range$$1.to);scrollToCoordsRange(cm,from,to,range$$1.margin)}}function scrollToCoordsRange(cm,from,to,margin){var sPos=calculateScrollPos(cm,{left:_Mathmin6(from.left,to.left),top:_Mathmin6(from.top,to.top)-margin,right:_Mathmax5(from.right,to.right),bottom:_Mathmax5(from.bottom,to.bottom)+margin});scrollToCoords(cm,sPos.scrollLeft,sPos.scrollTop)}function updateScrollTop(cm,val){2>_Mathabs(cm.doc.scrollTop-val)||(!gecko&&updateDisplaySimple(cm,{top:val}),setScrollTop(cm,val,!0),gecko&&updateDisplaySimple(cm),startWorker(cm,100))}function setScrollTop(cm,val,forceScroll){val=_Mathmin6(cm.display.scroller.scrollHeight-cm.display.scroller.clientHeight,val),(cm.display.scroller.scrollTop!=val||forceScroll)&&(cm.doc.scrollTop=val,cm.display.scrollbars.setScrollTop(val),cm.display.scroller.scrollTop!=val&&(cm.display.scroller.scrollTop=val))}function setScrollLeft(cm,val,isScroller,forceScroll){val=_Mathmin6(val,cm.display.scroller.scrollWidth-cm.display.scroller.clientWidth),(isScroller?val==cm.doc.scrollLeft:2>_Mathabs(cm.doc.scrollLeft-val))&&!forceScroll||(cm.doc.scrollLeft=val,alignHorizontally(cm),cm.display.scroller.scrollLeft!=val&&(cm.display.scroller.scrollLeft=val),cm.display.scrollbars.setScrollLeft(val))}function measureForScrollbars(cm){var d=cm.display,gutterW=d.gutters.offsetWidth,docH=_Mathround2(cm.doc.height+paddingVert(cm.display));return{clientHeight:d.scroller.clientHeight,viewHeight:d.wrapper.clientHeight,scrollWidth:d.scroller.scrollWidth,clientWidth:d.scroller.clientWidth,viewWidth:d.wrapper.clientWidth,barLeft:cm.options.fixedGutter?gutterW:0,docHeight:docH,scrollHeight:docH+scrollGap(cm)+d.barHeight,nativeBarWidth:d.nativeBarWidth,gutterWidth:gutterW}}function updateScrollbars(cm,measure){measure||(measure=measureForScrollbars(cm));var startWidth=cm.display.barWidth,startHeight=cm.display.barHeight;updateScrollbarsInner(cm,measure);for(var i=0;4>i&&startWidth!=cm.display.barWidth||startHeight!=cm.display.barHeight;i++)startWidth!=cm.display.barWidth&&cm.options.lineWrapping&&updateHeightsInViewport(cm),updateScrollbarsInner(cm,measureForScrollbars(cm)),startWidth=cm.display.barWidth,startHeight=cm.display.barHeight}function updateScrollbarsInner(cm,measure){var d=cm.display,sizes=d.scrollbars.update(measure);d.sizer.style.paddingRight=(d.barWidth=sizes.right)+"px",d.sizer.style.paddingBottom=(d.barHeight=sizes.bottom)+"px",d.heightForcer.style.borderBottom=sizes.bottom+"px solid transparent",sizes.right&&sizes.bottom?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=sizes.bottom+"px",d.scrollbarFiller.style.width=sizes.right+"px"):d.scrollbarFiller.style.display="",sizes.bottom&&cm.options.coverGutterNextToScrollbar&&cm.options.fixedGutter?(d.gutterFiller.style.display="block",d.gutterFiller.style.height=sizes.bottom+"px",d.gutterFiller.style.width=measure.gutterWidth+"px"):d.gutterFiller.style.display=""}function initScrollbars(cm){cm.display.scrollbars&&(cm.display.scrollbars.clear(),cm.display.scrollbars.addClass&&rmClass(cm.display.wrapper,cm.display.scrollbars.addClass)),cm.display.scrollbars=new scrollbarModel[cm.options.scrollbarStyle](function(node){cm.display.wrapper.insertBefore(node,cm.display.scrollbarFiller),on(node,"mousedown",function(){cm.state.focused&&setTimeout(function(){return cm.display.input.focus()},0)}),node.setAttribute("cm-not-content","true")},function(pos,axis){"horizontal"==axis?setScrollLeft(cm,pos):updateScrollTop(cm,pos)},cm),cm.display.scrollbars.addClass&&addClass(cm.display.wrapper,cm.display.scrollbars.addClass)}function _startOperation(cm){cm.curOp={cm:cm,viewChanged:!1,startHeight:cm.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++nextOpId},pushOperation(cm.curOp)}function _endOperation(cm){var op=cm.curOp;finishOperation(op,function(group){for(var i=0;i<group.ops.length;i++)group.ops[i].cm.curOp=null;endOperations(group)})}function endOperations(group){for(var ops=group.ops,i=0;i<ops.length;i++)endOperation_R1(ops[i]);for(var i$1=0;i$1<ops.length;i$1++)endOperation_W1(ops[i$1]);for(var i$2=0;i$2<ops.length;i$2++)endOperation_R2(ops[i$2]);for(var i$3=0;i$3<ops.length;i$3++)endOperation_W2(ops[i$3]);for(var i$4=0;i$4<ops.length;i$4++)endOperation_finish(ops[i$4])}function endOperation_R1(op){var cm=op.cm,display=cm.display;maybeClipScrollbars(cm),op.updateMaxLine&&findMaxLine(cm),op.mustUpdate=op.viewChanged||op.forceUpdate||null!=op.scrollTop||op.scrollToPos&&(op.scrollToPos.from.line<display.viewFrom||op.scrollToPos.to.line>=display.viewTo)||display.maxLineChanged&&cm.options.lineWrapping,op.update=op.mustUpdate&&new DisplayUpdate(cm,op.mustUpdate&&{top:op.scrollTop,ensure:op.scrollToPos},op.forceUpdate)}function endOperation_W1(op){op.updatedDisplay=op.mustUpdate&&updateDisplayIfNeeded(op.cm,op.update)}function endOperation_R2(op){var cm=op.cm,display=cm.display;op.updatedDisplay&&updateHeightsInViewport(cm),op.barMeasure=measureForScrollbars(cm),display.maxLineChanged&&!cm.options.lineWrapping&&(op.adjustWidthTo=measureChar(cm,display.maxLine,display.maxLine.text.length).left+3,cm.display.sizerWidth=op.adjustWidthTo,op.barMeasure.scrollWidth=_Mathmax5(display.scroller.clientWidth,display.sizer.offsetLeft+op.adjustWidthTo+scrollGap(cm)+cm.display.barWidth),op.maxScrollLeft=_Mathmax5(0,display.sizer.offsetLeft+op.adjustWidthTo-displayWidth(cm))),(op.updatedDisplay||op.selectionChanged)&&(op.preparedSelection=display.input.prepareSelection())}function endOperation_W2(op){var cm=op.cm;null!=op.adjustWidthTo&&(cm.display.sizer.style.minWidth=op.adjustWidthTo+"px",op.maxScrollLeft<cm.doc.scrollLeft&&setScrollLeft(cm,_Mathmin6(cm.display.scroller.scrollLeft,op.maxScrollLeft),!0),cm.display.maxLineChanged=!1);var takeFocus=op.focus&&op.focus==activeElt();op.preparedSelection&&cm.display.input.showSelection(op.preparedSelection,takeFocus),(op.updatedDisplay||op.startHeight!=cm.doc.height)&&updateScrollbars(cm,op.barMeasure),op.updatedDisplay&&setDocumentHeight(cm,op.barMeasure),op.selectionChanged&&restartBlink(cm),cm.state.focused&&op.updateInput&&cm.display.input.reset(op.typing),takeFocus&&ensureFocus(op.cm)}function endOperation_finish(op){var cm=op.cm,display=cm.display,doc=cm.doc;if(op.updatedDisplay&&postUpdateDisplay(cm,op.update),null!=display.wheelStartX&&(null!=op.scrollTop||null!=op.scrollLeft||op.scrollToPos)&&(display.wheelStartX=display.wheelStartY=null),null!=op.scrollTop&&setScrollTop(cm,op.scrollTop,op.forceScroll),null!=op.scrollLeft&&setScrollLeft(cm,op.scrollLeft,!0,!0),op.scrollToPos){var rect=scrollPosIntoView(cm,_clipPos(doc,op.scrollToPos.from),_clipPos(doc,op.scrollToPos.to),op.scrollToPos.margin);maybeScrollWindow(cm,rect)}var hidden=op.maybeHiddenMarkers,unhidden=op.maybeUnhiddenMarkers;if(hidden)for(var i=0;i<hidden.length;++i)hidden[i].lines.length||signal(hidden[i],"hide");if(unhidden)for(var i$1=0;i$1<unhidden.length;++i$1)unhidden[i$1].lines.length&&signal(unhidden[i$1],"unhide");display.wrapper.offsetHeight&&(doc.scrollTop=cm.display.scroller.scrollTop),op.changeObjs&&signal(cm,"changes",cm,op.changeObjs),op.update&&op.update.finish()}function runInOp(cm,f){if(cm.curOp)return f();_startOperation(cm);try{return f()}finally{_endOperation(cm)}}function operation(cm,f){return function(){if(cm.curOp)return f.apply(cm,arguments);_startOperation(cm);try{return f.apply(cm,arguments)}finally{_endOperation(cm)}}}function methodOp(f){return function(){if(this.curOp)return f.apply(this,arguments);_startOperation(this);try{return f.apply(this,arguments)}finally{_endOperation(this)}}}function docMethodOp(f){return function(){var cm=this.cm;if(!cm||cm.curOp)return f.apply(this,arguments);_startOperation(cm);try{return f.apply(this,arguments)}finally{_endOperation(cm)}}}function regChange(cm,from,to,lendiff){null==from&&(from=cm.doc.first),null==to&&(to=cm.doc.first+cm.doc.size),lendiff||(lendiff=0);var display=cm.display;if(lendiff&&to<display.viewTo&&(null==display.updateLineNumbers||display.updateLineNumbers>from)&&(display.updateLineNumbers=from),cm.curOp.viewChanged=!0,from>=display.viewTo)sawCollapsedSpans&&visualLineNo(cm.doc,from)<display.viewTo&&resetView(cm);else if(to<=display.viewFrom)sawCollapsedSpans&&visualLineEndNo(cm.doc,to+lendiff)>display.viewFrom?resetView(cm):(display.viewFrom+=lendiff,display.viewTo+=lendiff);else if(from<=display.viewFrom&&to>=display.viewTo)resetView(cm);else if(from<=display.viewFrom){var cut=viewCuttingPoint(cm,to,to+lendiff,1);cut?(display.view=display.view.slice(cut.index),display.viewFrom=cut.lineN,display.viewTo+=lendiff):resetView(cm)}else if(to>=display.viewTo){var cut$1=viewCuttingPoint(cm,from,from,-1);cut$1?(display.view=display.view.slice(0,cut$1.index),display.viewTo=cut$1.lineN):resetView(cm)}else{var cutTop=viewCuttingPoint(cm,from,from,-1),cutBot=viewCuttingPoint(cm,to,to+lendiff,1);cutTop&&cutBot?(display.view=display.view.slice(0,cutTop.index).concat(buildViewArray(cm,cutTop.lineN,cutBot.lineN)).concat(display.view.slice(cutBot.index)),display.viewTo+=lendiff):resetView(cm)}var ext=display.externalMeasured;ext&&(to<ext.lineN?ext.lineN+=lendiff:from<ext.lineN+ext.size&&(display.externalMeasured=null))}function regLineChange(cm,line,type){cm.curOp.viewChanged=!0;var display=cm.display,ext=cm.display.externalMeasured;if(ext&&line>=ext.lineN&&line<ext.lineN+ext.size&&(display.externalMeasured=null),!(line<display.viewFrom||line>=display.viewTo)){var lineView=display.view[findViewIndex(cm,line)];if(null!=lineView.node){var arr=lineView.changes||(lineView.changes=[]);-1==indexOf(arr,type)&&arr.push(type)}}}function resetView(cm){cm.display.viewFrom=cm.display.viewTo=cm.doc.first,cm.display.view=[],cm.display.viewOffset=0}function viewCuttingPoint(cm,oldN,newN,dir){var index=findViewIndex(cm,oldN),view=cm.display.view,diff;if(!sawCollapsedSpans||newN==cm.doc.first+cm.doc.size)return{index:index,lineN:newN};for(var n=cm.display.viewFrom,i=0;i<index;i++)n+=view[i].size;if(n!=oldN){if(0<dir){if(index==view.length-1)return null;diff=n+view[index].size-oldN,index++}else diff=n-oldN;oldN+=diff,newN+=diff}for(;visualLineNo(cm.doc,newN)!=newN;){if(index==(0>dir?0:view.length-1))return null;newN+=dir*view[index-(0>dir?1:0)].size,index+=dir}return{index:index,lineN:newN}}function adjustView(cm,from,to){var display=cm.display,view=display.view;0==view.length||from>=display.viewTo||to<=display.viewFrom?(display.view=buildViewArray(cm,from,to),display.viewFrom=from):(display.viewFrom>from?display.view=buildViewArray(cm,from,display.viewFrom).concat(display.view):display.viewFrom<from&&(display.view=display.view.slice(findViewIndex(cm,from))),display.viewFrom=from,display.viewTo<to?display.view=display.view.concat(buildViewArray(cm,display.viewTo,to)):display.viewTo>to&&(display.view=display.view.slice(0,findViewIndex(cm,to)))),display.viewTo=to}function countDirtyView(cm){for(var view=cm.display.view,dirty=0,i=0,lineView;i<view.length;i++)lineView=view[i],lineView.hidden||lineView.node&&!lineView.changes||++dirty;return dirty}function startWorker(cm,time){cm.doc.highlightFrontier<cm.display.viewTo&&cm.state.highlight.set(time,bind(highlightWorker,cm))}function highlightWorker(cm){var doc=cm.doc;if(!(doc.highlightFrontier>=cm.display.viewTo)){var end=+new Date+cm.options.workTime,context=getContextBefore(cm,doc.highlightFrontier),changedLines=[];doc.iter(context.line,_Mathmin6(doc.first+doc.size,cm.display.viewTo+500),function(line){if(context.line>=cm.display.viewFrom){var oldStyles=line.styles,resetState=line.text.length>cm.options.maxHighlightLength?copyState(doc.mode,context.state):null,highlighted=highlightLine(cm,line,context,!0);resetState&&(context.state=resetState),line.styles=highlighted.styles;var oldCls=line.styleClasses,newCls=highlighted.classes;newCls?line.styleClasses=newCls:oldCls&&(line.styleClasses=null);for(var ischange=!oldStyles||oldStyles.length!=line.styles.length||oldCls!=newCls&&(!oldCls||!newCls||oldCls.bgClass!=newCls.bgClass||oldCls.textClass!=newCls.textClass),i=0;!ischange&&i<oldStyles.length;++i)ischange=oldStyles[i]!=line.styles[i];ischange&&changedLines.push(context.line),line.stateAfter=context.save(),context.nextLine()}else line.text.length<=cm.options.maxHighlightLength&&processLine(cm,line.text,context),line.stateAfter=0==context.line%5?context.save():null,context.nextLine();return+new Date>end?(startWorker(cm,cm.options.workDelay),!0):void 0}),doc.highlightFrontier=context.line,doc.modeFrontier=_Mathmax5(doc.modeFrontier,context.line),changedLines.length&&runInOp(cm,function(){for(var i=0;i<changedLines.length;i++)regLineChange(cm,changedLines[i],"text")})}}function maybeClipScrollbars(cm){var display=cm.display;!display.scrollbarsClipped&&display.scroller.offsetWidth&&(display.nativeBarWidth=display.scroller.offsetWidth-display.scroller.clientWidth,display.heightForcer.style.height=scrollGap(cm)+"px",display.sizer.style.marginBottom=-display.nativeBarWidth+"px",display.sizer.style.borderRightWidth=scrollGap(cm)+"px",display.scrollbarsClipped=!0)}function selectionSnapshot(cm){if(cm.hasFocus())return null;var active=activeElt();if(!active||!contains(cm.display.lineDiv,active))return null;var result={activeElt:active};if(window.getSelection){var sel=window.getSelection();sel.anchorNode&&sel.extend&&contains(cm.display.lineDiv,sel.anchorNode)&&(result.anchorNode=sel.anchorNode,result.anchorOffset=sel.anchorOffset,result.focusNode=sel.focusNode,result.focusOffset=sel.focusOffset)}return result}function restoreSelection(snapshot){if(snapshot&&snapshot.activeElt&&snapshot.activeElt!=activeElt()&&(snapshot.activeElt.focus(),snapshot.anchorNode&&contains(document.body,snapshot.anchorNode)&&contains(document.body,snapshot.focusNode))){var sel=window.getSelection(),range$$1=document.createRange();range$$1.setEnd(snapshot.anchorNode,snapshot.anchorOffset),range$$1.collapse(!1),sel.removeAllRanges(),sel.addRange(range$$1),sel.extend(snapshot.focusNode,snapshot.focusOffset)}}function updateDisplayIfNeeded(cm,update){var display=cm.display,doc=cm.doc;if(update.editorIsHidden)return resetView(cm),!1;if(!update.force&&update.visible.from>=display.viewFrom&&update.visible.to<=display.viewTo&&(null==display.updateLineNumbers||display.updateLineNumbers>=display.viewTo)&&display.renderedView==display.view&&0==countDirtyView(cm))return!1;maybeUpdateLineNumberWidth(cm)&&(resetView(cm),update.dims=getDimensions(cm));var end=doc.first+doc.size,from=_Mathmax5(update.visible.from-cm.options.viewportMargin,doc.first),to=_Mathmin6(end,update.visible.to+cm.options.viewportMargin);display.viewFrom<from&&20>from-display.viewFrom&&(from=_Mathmax5(doc.first,display.viewFrom)),display.viewTo>to&&20>display.viewTo-to&&(to=_Mathmin6(end,display.viewTo)),sawCollapsedSpans&&(from=visualLineNo(cm.doc,from),to=visualLineEndNo(cm.doc,to));var different=from!=display.viewFrom||to!=display.viewTo||display.lastWrapHeight!=update.wrapperHeight||display.lastWrapWidth!=update.wrapperWidth;adjustView(cm,from,to),display.viewOffset=_heightAtLine(getLine(cm.doc,display.viewFrom)),cm.display.mover.style.top=display.viewOffset+"px";var toUpdate=countDirtyView(cm);if(!different&&0==toUpdate&&!update.force&&display.renderedView==display.view&&(null==display.updateLineNumbers||display.updateLineNumbers>=display.viewTo))return!1;var selSnapshot=selectionSnapshot(cm);return 4<toUpdate&&(display.lineDiv.style.display="none"),patchDisplay(cm,display.updateLineNumbers,update.dims),4<toUpdate&&(display.lineDiv.style.display=""),display.renderedView=display.view,restoreSelection(selSnapshot),removeChildren(display.cursorDiv),removeChildren(display.selectionDiv),display.gutters.style.height=display.sizer.style.minHeight=0,different&&(display.lastWrapHeight=update.wrapperHeight,display.lastWrapWidth=update.wrapperWidth,startWorker(cm,400)),display.updateLineNumbers=null,!0}function postUpdateDisplay(cm,update){for(var viewport=update.viewport,first=!0;;first=!1){if((!first||!cm.options.lineWrapping||update.oldDisplayWidth==displayWidth(cm))&&(viewport&&null!=viewport.top&&(viewport={top:_Mathmin6(cm.doc.height+paddingVert(cm.display)-displayHeight(cm),viewport.top)}),update.visible=visibleLines(cm.display,cm.doc,viewport),update.visible.from>=cm.display.viewFrom&&update.visible.to<=cm.display.viewTo))break;if(!updateDisplayIfNeeded(cm,update))break;updateHeightsInViewport(cm);var barMeasure=measureForScrollbars(cm);updateSelection(cm),updateScrollbars(cm,barMeasure),setDocumentHeight(cm,barMeasure),update.force=!1}update.signal(cm,"update",cm),(cm.display.viewFrom!=cm.display.reportedViewFrom||cm.display.viewTo!=cm.display.reportedViewTo)&&(update.signal(cm,"viewportChange",cm,cm.display.viewFrom,cm.display.viewTo),cm.display.reportedViewFrom=cm.display.viewFrom,cm.display.reportedViewTo=cm.display.viewTo)}function updateDisplaySimple(cm,viewport){var update=new DisplayUpdate(cm,viewport);if(updateDisplayIfNeeded(cm,update)){updateHeightsInViewport(cm),postUpdateDisplay(cm,update);var barMeasure=measureForScrollbars(cm);updateSelection(cm),updateScrollbars(cm,barMeasure),setDocumentHeight(cm,barMeasure),update.finish()}}function patchDisplay(cm,updateNumbersFrom,dims){function rm(node){var next=node.nextSibling;return webkit&&mac&&cm.display.currentWheelTarget==node?node.style.display="none":node.parentNode.removeChild(node),next}for(var display=cm.display,lineNumbers=cm.options.lineNumbers,container=display.lineDiv,cur=container.firstChild,view=display.view,lineN=display.viewFrom,i=0,lineView;i<view.length;i++){if(lineView=view[i],lineView.hidden);else if(!lineView.node||lineView.node.parentNode!=container){var node=buildLineElement(cm,lineView,lineN,dims);container.insertBefore(node,cur)}else{for(;cur!=lineView.node;)cur=rm(cur);var updateNumber=lineNumbers&&null!=updateNumbersFrom&&updateNumbersFrom<=lineN&&lineView.lineNumber;lineView.changes&&(-1<indexOf(lineView.changes,"gutter")&&(updateNumber=!1),updateLineForChanges(cm,lineView,lineN,dims)),updateNumber&&(removeChildren(lineView.lineNumber),lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options,lineN)))),cur=lineView.node.nextSibling}lineN+=lineView.size}for(;cur;)cur=rm(cur)}function updateGutterSpace(cm){var width=cm.display.gutters.offsetWidth;cm.display.sizer.style.marginLeft=width+"px"}function setDocumentHeight(cm,measure){cm.display.sizer.style.minHeight=measure.docHeight+"px",cm.display.heightForcer.style.top=measure.docHeight+"px",cm.display.gutters.style.height=measure.docHeight+cm.display.barHeight+scrollGap(cm)+"px"}function updateGutters(cm){var gutters=cm.display.gutters,specs=cm.options.gutters;removeChildren(gutters);for(var i=0;i<specs.length;++i){var gutterClass=specs[i],gElt=gutters.appendChild(elt("div",null,"CodeMirror-gutter "+gutterClass));"CodeMirror-linenumbers"==gutterClass&&(cm.display.lineGutter=gElt,gElt.style.width=(cm.display.lineNumWidth||1)+"px")}gutters.style.display=i?"":"none",updateGutterSpace(cm)}function setGuttersForLineNumbers(options){var found=indexOf(options.gutters,"CodeMirror-linenumbers");-1==found&&options.lineNumbers?options.gutters=options.gutters.concat(["CodeMirror-linenumbers"]):-1<found&&!options.lineNumbers&&(options.gutters=options.gutters.slice(0),options.gutters.splice(found,1))}function wheelEventDelta(e){var dx=e.wheelDeltaX,dy=e.wheelDeltaY;return null==dx&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(dx=e.detail),null==dy&&e.detail&&e.axis==e.VERTICAL_AXIS?dy=e.detail:null==dy&&(dy=e.wheelDelta),{x:dx,y:dy}}function wheelEventPixels(e){var delta=wheelEventDelta(e);return delta.x*=wheelPixelsPerUnit,delta.y*=wheelPixelsPerUnit,delta}function onScrollWheel(cm,e){var delta=wheelEventDelta(e),dx=delta.x,dy=delta.y,display=cm.display,scroll=display.scroller,canScrollX=scroll.scrollWidth>scroll.clientWidth,canScrollY=scroll.scrollHeight>scroll.clientHeight;if(dx&&canScrollX||dy&&canScrollY){if(dy&&mac&&webkit)outer:for(var cur=e.target,view=display.view;cur!=scroll;cur=cur.parentNode)for(var i=0;i<view.length;i++)if(view[i].node==cur){cm.display.currentWheelTarget=cur;break outer}if(dx&&!gecko&&!presto&&null!=wheelPixelsPerUnit)return dy&&canScrollY&&updateScrollTop(cm,_Mathmax5(0,scroll.scrollTop+dy*wheelPixelsPerUnit)),setScrollLeft(cm,_Mathmax5(0,scroll.scrollLeft+dx*wheelPixelsPerUnit)),(!dy||dy&&canScrollY)&&e_preventDefault(e),void(display.wheelStartX=null);if(dy&&null!=wheelPixelsPerUnit){var pixels=dy*wheelPixelsPerUnit,top=cm.doc.scrollTop,bot=top+display.wrapper.clientHeight;0>pixels?top=_Mathmax5(0,top+pixels-50):bot=_Mathmin6(cm.doc.height,bot+pixels+50),updateDisplaySimple(cm,{top:top,bottom:bot})}20>wheelSamples&&(null==display.wheelStartX?(display.wheelStartX=scroll.scrollLeft,display.wheelStartY=scroll.scrollTop,display.wheelDX=dx,display.wheelDY=dy,setTimeout(function(){if(null!=display.wheelStartX){var movedX=scroll.scrollLeft-display.wheelStartX,movedY=scroll.scrollTop-display.wheelStartY,sample=movedY&&display.wheelDY&&movedY/display.wheelDY||movedX&&display.wheelDX&&movedX/display.wheelDX;display.wheelStartX=display.wheelStartY=null,sample&&(wheelPixelsPerUnit=(wheelPixelsPerUnit*wheelSamples+sample)/(wheelSamples+1),++wheelSamples)}},200)):(display.wheelDX+=dx,display.wheelDY+=dy))}}function normalizeSelection(ranges,primIndex){var prim=ranges[primIndex];ranges.sort(function(a,b){return cmp(a.from(),b.from())}),primIndex=indexOf(ranges,prim);for(var i=1;i<ranges.length;i++){var cur=ranges[i],prev=ranges[i-1];if(0<=cmp(prev.to(),cur.from())){var from=minPos(prev.from(),cur.from()),to=maxPos(prev.to(),cur.to()),inv=prev.empty()?cur.from()==cur.head:prev.from()==prev.head;i<=primIndex&&--primIndex,ranges.splice(--i,2,new Range(inv?to:from,inv?from:to))}}return new Selection(ranges,primIndex)}function simpleSelection(anchor,head){return new Selection([new Range(anchor,head||anchor)],0)}function changeEnd(change){return change.text?Pos(change.from.line+change.text.length-1,lst(change.text).length+(1==change.text.length?change.from.ch:0)):change.to}function adjustForChange(pos,change){if(0>cmp(pos,change.from))return pos;if(0>=cmp(pos,change.to))return changeEnd(change);var line=pos.line+change.text.length-(change.to.line-change.from.line)-1,ch=pos.ch;return pos.line==change.to.line&&(ch+=changeEnd(change).ch-change.to.ch),Pos(line,ch)}function computeSelAfterChange(doc,change){for(var out=[],i=0,range;i<doc.sel.ranges.length;i++)range=doc.sel.ranges[i],out.push(new Range(adjustForChange(range.anchor,change),adjustForChange(range.head,change)));return normalizeSelection(out,doc.sel.primIndex)}function offsetPos(pos,old,nw){return pos.line==old.line?Pos(nw.line,pos.ch-old.ch+nw.ch):Pos(nw.line+(pos.line-old.line),pos.ch)}function computeReplacedSel(doc,changes,hint){for(var out=[],oldPrev=Pos(doc.first,0),newPrev=oldPrev,i=0;i<changes.length;i++){var change=changes[i],from=offsetPos(change.from,oldPrev,newPrev),to=offsetPos(changeEnd(change),oldPrev,newPrev);if(oldPrev=change.to,newPrev=to,"around"==hint){var range=doc.sel.ranges[i],inv=0>cmp(range.head,range.anchor);out[i]=new Range(inv?to:from,inv?from:to)}else out[i]=new Range(from,from)}return new Selection(out,doc.sel.primIndex)}function loadMode(cm){cm.doc.mode=getMode(cm.options,cm.doc.modeOption),resetModeState(cm)}function resetModeState(cm){cm.doc.iter(function(line){line.stateAfter&&(line.stateAfter=null),line.styles&&(line.styles=null)}),cm.doc.modeFrontier=cm.doc.highlightFrontier=cm.doc.first,startWorker(cm,100),cm.state.modeGen++,cm.curOp&®Change(cm)}function isWholeLineUpdate(doc,change){return 0==change.from.ch&&0==change.to.ch&&""==lst(change.text)&&(!doc.cm||doc.cm.options.wholeLineUpdateBefore)}function updateDoc(doc,change,markedSpans,estimateHeight$$1){function spansFor(n){return markedSpans?markedSpans[n]:null}function update(line,text,spans){updateLine(line,text,spans,estimateHeight$$1),signalLater(line,"change",line,change)}function linesFor(start,end){for(var result=[],i=start;i<end;++i)result.push(new Line(text[i],spansFor(i),estimateHeight$$1));return result}var from=change.from,to=change.to,text=change.text,firstLine=getLine(doc,from.line),lastLine=getLine(doc,to.line),lastText=lst(text),lastSpans=spansFor(text.length-1),nlines=to.line-from.line;if(change.full)doc.insert(0,linesFor(0,text.length)),doc.remove(text.length,doc.size-text.length);else if(isWholeLineUpdate(doc,change)){var added=linesFor(0,text.length-1);update(lastLine,lastLine.text,lastSpans),nlines&&doc.remove(from.line,nlines),added.length&&doc.insert(from.line,added)}else if(firstLine==lastLine){if(1==text.length)update(firstLine,firstLine.text.slice(0,from.ch)+lastText+firstLine.text.slice(to.ch),lastSpans);else{var added$1=linesFor(1,text.length-1);added$1.push(new Line(lastText+firstLine.text.slice(to.ch),lastSpans,estimateHeight$$1)),update(firstLine,firstLine.text.slice(0,from.ch)+text[0],spansFor(0)),doc.insert(from.line+1,added$1)}}else if(1==text.length)update(firstLine,firstLine.text.slice(0,from.ch)+text[0]+lastLine.text.slice(to.ch),spansFor(0)),doc.remove(from.line+1,nlines);else{update(firstLine,firstLine.text.slice(0,from.ch)+text[0],spansFor(0)),update(lastLine,lastText+lastLine.text.slice(to.ch),lastSpans);var added$2=linesFor(1,text.length-1);1<nlines&&doc.remove(from.line+1,nlines-1),doc.insert(from.line+1,added$2)}signalLater(doc,"change",doc,change)}function linkedDocs(doc,f,sharedHistOnly){function propagate(doc,skip,sharedHist){if(doc.linked)for(var i=0,rel;i<doc.linked.length;++i)if(rel=doc.linked[i],rel.doc!=skip){var shared=sharedHist&&rel.sharedHist;(!sharedHistOnly||shared)&&(f(rel.doc,shared),propagate(rel.doc,doc,shared))}}propagate(doc,null,!0)}function attachDoc(cm,doc){if(doc.cm)throw new Error("This document is already in use.");cm.doc=doc,doc.cm=cm,estimateLineHeights(cm),loadMode(cm),setDirectionClass(cm),cm.options.lineWrapping||findMaxLine(cm),cm.options.mode=doc.modeOption,regChange(cm)}function setDirectionClass(cm){("rtl"==cm.doc.direction?addClass:rmClass)(cm.display.lineDiv,"CodeMirror-rtl")}function directionChanged(cm){runInOp(cm,function(){setDirectionClass(cm),regChange(cm)})}function History(startGen){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=startGen||1}function historyChangeFromChange(doc,change){var histChange={from:copyPos(change.from),to:changeEnd(change),text:getBetween(doc,change.from,change.to)};return attachLocalSpans(doc,histChange,change.from.line,change.to.line+1),linkedDocs(doc,function(doc){return attachLocalSpans(doc,histChange,change.from.line,change.to.line+1)},!0),histChange}function clearSelectionEvents(array){for(;array.length;){var last=lst(array);if(last.ranges)array.pop();else break}}function lastChangeEvent(hist,force){return force?(clearSelectionEvents(hist.done),lst(hist.done)):hist.done.length&&!lst(hist.done).ranges?lst(hist.done):1<hist.done.length&&!hist.done[hist.done.length-2].ranges?(hist.done.pop(),lst(hist.done)):void 0}function addChangeToHistory(doc,change,selAfter,opId){var hist=doc.history;hist.undone.length=0;var time=+new Date,cur,last;if((hist.lastOp==opId||hist.lastOrigin==change.origin&&change.origin&&("+"==change.origin.charAt(0)&&hist.lastModTime>time-(doc.cm?doc.cm.options.historyEventDelay:500)||"*"==change.origin.charAt(0)))&&(cur=lastChangeEvent(hist,hist.lastOp==opId)))last=lst(cur.changes),0==cmp(change.from,change.to)&&0==cmp(change.from,last.to)?last.to=changeEnd(change):cur.changes.push(historyChangeFromChange(doc,change));else{var before=lst(hist.done);for(before&&before.ranges||pushSelectionToHistory(doc.sel,hist.done),cur={changes:[historyChangeFromChange(doc,change)],generation:hist.generation},hist.done.push(cur);hist.done.length>hist.undoDepth;)hist.done.shift(),hist.done[0].ranges||hist.done.shift()}hist.done.push(selAfter),hist.generation=++hist.maxGeneration,hist.lastModTime=hist.lastSelTime=time,hist.lastOp=hist.lastSelOp=opId,hist.lastOrigin=hist.lastSelOrigin=change.origin,last||signal(doc,"historyAdded")}function selectionEventCanBeMerged(doc,origin,prev,sel){var ch=origin.charAt(0);return"*"==ch||"+"==ch&&prev.ranges.length==sel.ranges.length&&prev.somethingSelected()==sel.somethingSelected()&&new Date-doc.history.lastSelTime<=(doc.cm?doc.cm.options.historyEventDelay:500)}function addSelectionToHistory(doc,sel,opId,options){var hist=doc.history,origin=options&&options.origin;opId==hist.lastSelOp||origin&&hist.lastSelOrigin==origin&&(hist.lastModTime==hist.lastSelTime&&hist.lastOrigin==origin||selectionEventCanBeMerged(doc,origin,lst(hist.done),sel))?hist.done[hist.done.length-1]=sel:pushSelectionToHistory(sel,hist.done),hist.lastSelTime=+new Date,hist.lastSelOrigin=origin,hist.lastSelOp=opId,options&&!1!==options.clearRedo&&clearSelectionEvents(hist.undone)}function pushSelectionToHistory(sel,dest){var top=lst(dest);top&&top.ranges&&top.equals(sel)||dest.push(sel)}function attachLocalSpans(doc,change,from,to){var existing=change["spans_"+doc.id],n=0;doc.iter(_Mathmax5(doc.first,from),_Mathmin6(doc.first+doc.size,to),function(line){line.markedSpans&&((existing||(existing=change["spans_"+doc.id]={}))[n]=line.markedSpans),++n})}function removeClearedSpans(spans){if(!spans)return null;for(var i=0,out;i<spans.length;++i)spans[i].marker.explicitlyCleared?out||(out=spans.slice(0,i)):out&&out.push(spans[i]);return out?out.length?out:null:spans}function getOldSpans(doc,change){var found=change["spans_"+doc.id];if(!found)return null;for(var nw=[],i=0;i<change.text.length;++i)nw.push(removeClearedSpans(found[i]));return nw}function mergeOldSpans(doc,change){var old=getOldSpans(doc,change),stretched=stretchSpansOverChange(doc,change);if(!old)return stretched;if(!stretched)return old;for(var i=0;i<old.length;++i){var oldCur=old[i],stretchCur=stretched[i];if(oldCur&&stretchCur)spans:for(var j=0,span;j<stretchCur.length;++j){span=stretchCur[j];for(var k=0;k<oldCur.length;++k)if(oldCur[k].marker==span.marker)continue spans;oldCur.push(span)}else stretchCur&&(old[i]=stretchCur)}return old}function copyHistoryArray(events,newGroup,instantiateSel){for(var copy=[],i=0,event;i<events.length;++i){if(event=events[i],event.ranges){copy.push(instantiateSel?Selection.prototype.deepCopy.call(event):event);continue}var changes=event.changes,newChanges=[];copy.push({changes:newChanges});for(var j=0;j<changes.length;++j){var change=changes[j],m=void 0;if(newChanges.push({from:change.from,to:change.to,text:change.text}),newGroup)for(var prop in change)(m=prop.match(/^spans_(\d+)$/))&&-1<indexOf(newGroup,+m[1])&&(lst(newChanges)[prop]=change[prop],delete change[prop])}}return copy}function extendRange(range,head,other,extend){if(extend){var anchor=range.anchor;if(other){var posBefore=0>cmp(head,anchor);posBefore==0>cmp(other,anchor)?posBefore!=0>cmp(head,other)&&(head=other):(anchor=head,head=other)}return new Range(anchor,head)}return new Range(other||head,head)}function extendSelection(doc,head,other,options,extend){null==extend&&(extend=doc.cm&&(doc.cm.display.shift||doc.extend)),setSelection(doc,new Selection([extendRange(doc.sel.primary(),head,other,extend)],0),options)}function extendSelections(doc,heads,options){for(var out=[],extend=doc.cm&&(doc.cm.display.shift||doc.extend),i=0;i<doc.sel.ranges.length;i++)out[i]=extendRange(doc.sel.ranges[i],heads[i],null,extend);var newSel=normalizeSelection(out,doc.sel.primIndex);setSelection(doc,newSel,options)}function replaceOneSelection(doc,i,range,options){var ranges=doc.sel.ranges.slice(0);ranges[i]=range,setSelection(doc,normalizeSelection(ranges,doc.sel.primIndex),options)}function setSimpleSelection(doc,anchor,head,options){setSelection(doc,simpleSelection(anchor,head),options)}function filterSelectionChange(doc,sel,options){var obj={ranges:sel.ranges,update:function(ranges){var this$1=this;this.ranges=[];for(var i=0;i<ranges.length;i++)this$1.ranges[i]=new Range(_clipPos(doc,ranges[i].anchor),_clipPos(doc,ranges[i].head))},origin:options&&options.origin};return signal(doc,"beforeSelectionChange",doc,obj),doc.cm&&signal(doc.cm,"beforeSelectionChange",doc.cm,obj),obj.ranges==sel.ranges?sel:normalizeSelection(obj.ranges,obj.ranges.length-1)}function setSelectionReplaceHistory(doc,sel,options){var done=doc.history.done,last=lst(done);last&&last.ranges?(done[done.length-1]=sel,setSelectionNoUndo(doc,sel,options)):setSelection(doc,sel,options)}function setSelection(doc,sel,options){setSelectionNoUndo(doc,sel,options),addSelectionToHistory(doc,doc.sel,doc.cm?doc.cm.curOp.id:NaN,options)}function setSelectionNoUndo(doc,sel,options){(hasHandler(doc,"beforeSelectionChange")||doc.cm&&hasHandler(doc.cm,"beforeSelectionChange"))&&(sel=filterSelectionChange(doc,sel,options));var bias=options&&options.bias||(0>cmp(sel.primary().head,doc.sel.primary().head)?-1:1);setSelectionInner(doc,skipAtomicInSelection(doc,sel,bias,!0)),!(options&&!1===options.scroll)&&doc.cm&&ensureCursorVisible(doc.cm)}function setSelectionInner(doc,sel){sel.equals(doc.sel)||(doc.sel=sel,doc.cm&&(doc.cm.curOp.updateInput=doc.cm.curOp.selectionChanged=!0,signalCursorActivity(doc.cm)),signalLater(doc,"cursorActivity",doc))}function reCheckSelection(doc){setSelectionInner(doc,skipAtomicInSelection(doc,doc.sel,null,!1))}function skipAtomicInSelection(doc,sel,bias,mayClear){for(var i=0,out;i<sel.ranges.length;i++){var range=sel.ranges[i],old=sel.ranges.length==doc.sel.ranges.length&&doc.sel.ranges[i],newAnchor=skipAtomic(doc,range.anchor,old&&old.anchor,bias,mayClear),newHead=skipAtomic(doc,range.head,old&&old.head,bias,mayClear);(out||newAnchor!=range.anchor||newHead!=range.head)&&(!out&&(out=sel.ranges.slice(0,i)),out[i]=new Range(newAnchor,newHead))}return out?normalizeSelection(out,sel.primIndex):sel}function skipAtomicInner(doc,pos,oldPos,dir,mayClear){var line=getLine(doc,pos.line);if(line.markedSpans)for(var i=0;i<line.markedSpans.length;++i){var sp=line.markedSpans[i],m=sp.marker;if((null==sp.from||(m.inclusiveLeft?sp.from<=pos.ch:sp.from<pos.ch))&&(null==sp.to||(m.inclusiveRight?sp.to>=pos.ch:sp.to>pos.ch))){if(mayClear&&(signal(m,"beforeCursorEnter"),m.explicitlyCleared))if(!line.markedSpans)break;else{--i;continue}if(!m.atomic)continue;if(oldPos){var near=m.find(0>dir?1:-1),diff=void 0;if((0>dir?m.inclusiveRight:m.inclusiveLeft)&&(near=movePos(doc,near,-dir,near&&near.line==pos.line?line:null)),near&&near.line==pos.line&&(diff=cmp(near,oldPos))&&(0>dir?0>diff:0<diff))return skipAtomicInner(doc,near,pos,dir,mayClear)}var far=m.find(0>dir?-1:1);return(0>dir?m.inclusiveLeft:m.inclusiveRight)&&(far=movePos(doc,far,dir,far.line==pos.line?line:null)),far?skipAtomicInner(doc,far,pos,dir,mayClear):null}}return pos}function skipAtomic(doc,pos,oldPos,bias,mayClear){var dir=bias||1,found=skipAtomicInner(doc,pos,oldPos,dir,mayClear)||!mayClear&&skipAtomicInner(doc,pos,oldPos,dir,!0)||skipAtomicInner(doc,pos,oldPos,-dir,mayClear)||!mayClear&&skipAtomicInner(doc,pos,oldPos,-dir,!0);return found?found:(doc.cantEdit=!0,Pos(doc.first,0))}function movePos(doc,pos,dir,line){return 0>dir&&0==pos.ch?pos.line>doc.first?_clipPos(doc,Pos(pos.line-1)):null:0<dir&&pos.ch==(line||getLine(doc,pos.line)).text.length?pos.line<doc.first+doc.size-1?Pos(pos.line+1,0):null:new Pos(pos.line,pos.ch+dir)}function selectAll(cm){cm.setSelection(Pos(cm.firstLine(),0),Pos(cm.lastLine()),sel_dontScroll)}function filterChange(doc,change,update){var obj={canceled:!1,from:change.from,to:change.to,text:change.text,origin:change.origin,cancel:function(){return obj.canceled=!0}};return update&&(obj.update=function(from,to,text,origin){from&&(obj.from=_clipPos(doc,from)),to&&(obj.to=_clipPos(doc,to)),text&&(obj.text=text),void 0!==origin&&(obj.origin=origin)}),signal(doc,"beforeChange",doc,obj),doc.cm&&signal(doc.cm,"beforeChange",doc.cm,obj),obj.canceled?null:{from:obj.from,to:obj.to,text:obj.text,origin:obj.origin}}function makeChange(doc,change,ignoreReadOnly){if(doc.cm){if(!doc.cm.curOp)return operation(doc.cm,makeChange)(doc,change,ignoreReadOnly);if(doc.cm.state.suppressEdits)return}if(!((hasHandler(doc,"beforeChange")||doc.cm&&hasHandler(doc.cm,"beforeChange"))&&(change=filterChange(doc,change,!0),!change))){var split=sawReadOnlySpans&&!ignoreReadOnly&&removeReadOnlyRanges(doc,change.from,change.to);if(split)for(var i=split.length-1;0<=i;--i)makeChangeInner(doc,{from:split[i].from,to:split[i].to,text:i?[""]:change.text,origin:change.origin});else makeChangeInner(doc,change)}}function makeChangeInner(doc,change){if(1!=change.text.length||""!=change.text[0]||0!=cmp(change.from,change.to)){var selAfter=computeSelAfterChange(doc,change);addChangeToHistory(doc,change,selAfter,doc.cm?doc.cm.curOp.id:NaN),makeChangeSingleDoc(doc,change,selAfter,stretchSpansOverChange(doc,change));var rebased=[];linkedDocs(doc,function(doc,sharedHist){sharedHist||-1!=indexOf(rebased,doc.history)||(rebaseHist(doc.history,change),rebased.push(doc.history)),makeChangeSingleDoc(doc,change,null,stretchSpansOverChange(doc,change))})}}function makeChangeFromHistory(doc,type,allowSelectionOnly){var suppress=doc.cm&&doc.cm.state.suppressEdits;if(!suppress||allowSelectionOnly){for(var hist=doc.history,selAfter=doc.sel,source="undo"==type?hist.done:hist.undone,dest="undo"==type?hist.undone:hist.done,i=0,event;i<source.length&&(event=source[i],allowSelectionOnly?!event.ranges||event.equals(doc.sel):!!event.ranges);i++);if(i!=source.length){for(hist.lastOrigin=hist.lastSelOrigin=null;;)if(event=source.pop(),event.ranges){if(pushSelectionToHistory(event,dest),allowSelectionOnly&&!event.equals(doc.sel))return void setSelection(doc,event,{clearRedo:!1});selAfter=event}else{if(suppress)return void source.push(event);break}var antiChanges=[];pushSelectionToHistory(selAfter,dest),dest.push({changes:antiChanges,generation:hist.generation}),hist.generation=event.generation||++hist.maxGeneration;for(var filter=hasHandler(doc,"beforeChange")||doc.cm&&hasHandler(doc.cm,"beforeChange"),loop=function(i){var change=event.changes[i];if(change.origin=type,filter&&!filterChange(doc,change,!1))return source.length=0,{};antiChanges.push(historyChangeFromChange(doc,change));var after=i?computeSelAfterChange(doc,change):lst(source);makeChangeSingleDoc(doc,change,after,mergeOldSpans(doc,change)),!i&&doc.cm&&doc.cm.scrollIntoView({from:change.from,to:changeEnd(change)});var rebased=[];linkedDocs(doc,function(doc,sharedHist){sharedHist||-1!=indexOf(rebased,doc.history)||(rebaseHist(doc.history,change),rebased.push(doc.history)),makeChangeSingleDoc(doc,change,null,mergeOldSpans(doc,change))})},i$1=event.changes.length-1,returned;0<=i$1;--i$1)if(returned=loop(i$1),returned)return returned.v}}}function shiftDoc(doc,distance){if(0!=distance&&(doc.first+=distance,doc.sel=new Selection(map(doc.sel.ranges,function(range){return new Range(Pos(range.anchor.line+distance,range.anchor.ch),Pos(range.head.line+distance,range.head.ch))}),doc.sel.primIndex),doc.cm)){regChange(doc.cm,doc.first,doc.first-distance,distance);for(var d=doc.cm.display,l=d.viewFrom;l<d.viewTo;l++)regLineChange(doc.cm,l,"gutter")}}function makeChangeSingleDoc(doc,change,selAfter,spans){if(doc.cm&&!doc.cm.curOp)return operation(doc.cm,makeChangeSingleDoc)(doc,change,selAfter,spans);if(change.to.line<doc.first)return void shiftDoc(doc,change.text.length-1-(change.to.line-change.from.line));if(!(change.from.line>doc.lastLine())){if(change.from.line<doc.first){var shift=change.text.length-1-(doc.first-change.from.line);shiftDoc(doc,shift),change={from:Pos(doc.first,0),to:Pos(change.to.line+shift,change.to.ch),text:[lst(change.text)],origin:change.origin}}var last=doc.lastLine();change.to.line>last&&(change={from:change.from,to:Pos(last,getLine(doc,last).text.length),text:[change.text[0]],origin:change.origin}),change.removed=getBetween(doc,change.from,change.to),selAfter||(selAfter=computeSelAfterChange(doc,change)),doc.cm?makeChangeSingleDocInEditor(doc.cm,change,spans):updateDoc(doc,change,spans),setSelectionNoUndo(doc,selAfter,sel_dontScroll)}}function makeChangeSingleDocInEditor(cm,change,spans){var doc=cm.doc,display=cm.display,from=change.from,to=change.to,recomputeMaxLength=!1,checkWidthStart=from.line;cm.options.lineWrapping||(checkWidthStart=lineNo(visualLine(getLine(doc,from.line))),doc.iter(checkWidthStart,to.line+1,function(line){if(line==display.maxLine)return recomputeMaxLength=!0,!0})),-1<doc.sel.contains(change.from,change.to)&&signalCursorActivity(cm),updateDoc(doc,change,spans,estimateHeight(cm)),cm.options.lineWrapping||(doc.iter(checkWidthStart,from.line+change.text.length,function(line){var len=lineLength(line);len>display.maxLineLength&&(display.maxLine=line,display.maxLineLength=len,display.maxLineChanged=!0,recomputeMaxLength=!1)}),recomputeMaxLength&&(cm.curOp.updateMaxLine=!0)),retreatFrontier(doc,from.line),startWorker(cm,400);var lendiff=change.text.length-(to.line-from.line)-1;change.full?regChange(cm):from.line!=to.line||1!=change.text.length||isWholeLineUpdate(cm.doc,change)?regChange(cm,from.line,to.line+1,lendiff):regLineChange(cm,from.line,"text");var changesHandler=hasHandler(cm,"changes"),changeHandler=hasHandler(cm,"change");if(changeHandler||changesHandler){var obj={from:from,to:to,text:change.text,removed:change.removed,origin:change.origin};changeHandler&&signalLater(cm,"change",cm,obj),changesHandler&&(cm.curOp.changeObjs||(cm.curOp.changeObjs=[])).push(obj)}cm.display.selForContextMenu=null}function _replaceRange(doc,code,from,to,origin){if(to||(to=from),0>cmp(to,from)){var assign;assign=[to,from],from=assign[0],to=assign[1]}"string"==typeof code&&(code=doc.splitLines(code)),makeChange(doc,{from:from,to:to,text:code,origin:origin})}function rebaseHistSelSingle(pos,from,to,diff){to<pos.line?pos.line+=diff:from<pos.line&&(pos.line=from,pos.ch=0)}function rebaseHistArray(array,from,to,diff){for(var i=0;i<array.length;++i){var sub=array[i],ok=!0;if(sub.ranges){sub.copied||(sub=array[i]=sub.deepCopy(),sub.copied=!0);for(var j=0;j<sub.ranges.length;j++)rebaseHistSelSingle(sub.ranges[j].anchor,from,to,diff),rebaseHistSelSingle(sub.ranges[j].head,from,to,diff);continue}for(var j$1=0,cur;j$1<sub.changes.length;++j$1)if(cur=sub.changes[j$1],to<cur.from.line)cur.from=Pos(cur.from.line+diff,cur.from.ch),cur.to=Pos(cur.to.line+diff,cur.to.ch);else if(from<=cur.to.line){ok=!1;break}ok||(array.splice(0,i+1),i=0)}}function rebaseHist(hist,change){var from=change.from.line,to=change.to.line,diff=change.text.length-(to-from)-1;rebaseHistArray(hist.done,from,to,diff),rebaseHistArray(hist.undone,from,to,diff)}function changeLine(doc,handle,changeType,op){var no=handle,line=handle;return("number"==typeof handle?line=getLine(doc,clipLine(doc,handle)):no=lineNo(handle),null==no)?null:(op(line,no)&&doc.cm&®LineChange(doc.cm,no,changeType),line)}function LeafChunk(lines){var this$1=this;this.lines=lines,this.parent=null;for(var height=0,i=0;i<lines.length;++i)lines[i].parent=this$1,height+=lines[i].height;this.height=height}function BranchChunk(children){var this$1=this;this.children=children;for(var size=0,height=0,i=0,ch;i<children.length;++i)ch=children[i],size+=ch.chunkSize(),height+=ch.height,ch.parent=this$1;this.size=size,this.height=height,this.parent=null}function adjustScrollWhenAboveVisible(cm,line,diff){_heightAtLine(line)<(cm.curOp&&cm.curOp.scrollTop||cm.doc.scrollTop)&&addToScrollTop(cm,diff)}function addLineWidget(doc,handle,node,options){var widget=new LineWidget(doc,node,options),cm=doc.cm;return cm&&widget.noHScroll&&(cm.display.alignWidgets=!0),changeLine(doc,handle,"widget",function(line){var widgets=line.widgets||(line.widgets=[]);if(null==widget.insertAt?widgets.push(widget):widgets.splice(_Mathmin6(widgets.length-1,_Mathmax5(0,widget.insertAt)),0,widget),widget.line=line,cm&&!lineIsHidden(doc,line)){var aboveVisible=_heightAtLine(line)<doc.scrollTop;updateLineHeight(line,line.height+widgetHeight(widget)),aboveVisible&&addToScrollTop(cm,widget.height),cm.curOp.forceUpdate=!0}return!0}),cm&&signalLater(cm,"lineWidgetAdded",cm,widget,"number"==typeof handle?handle:lineNo(handle)),widget}function _markText(doc,from,to,options,type){if(options&&options.shared)return markTextShared(doc,from,to,options,type);if(doc.cm&&!doc.cm.curOp)return operation(doc.cm,_markText)(doc,from,to,options,type);var marker=new TextMarker(doc,type),diff=cmp(from,to);if(options&©Obj(options,marker,!1),0<diff||0==diff&&!1!==marker.clearWhenEmpty)return marker;if(marker.replacedWith&&(marker.collapsed=!0,marker.widgetNode=eltP("span",[marker.replacedWith],"CodeMirror-widget"),!options.handleMouseEvents&&marker.widgetNode.setAttribute("cm-ignore-events","true"),options.insertLeft&&(marker.widgetNode.insertLeft=!0)),marker.collapsed){if(conflictingCollapsedRange(doc,from.line,from,to,marker)||from.line!=to.line&&conflictingCollapsedRange(doc,to.line,from,to,marker))throw new Error("Inserting collapsed marker partially overlapping an existing one");seeCollapsedSpans()}marker.addToHistory&&addChangeToHistory(doc,{from:from,to:to,origin:"markText"},doc.sel,NaN);var curLine=from.line,cm=doc.cm,updateMaxLine;if(doc.iter(curLine,to.line+1,function(line){cm&&marker.collapsed&&!cm.options.lineWrapping&&visualLine(line)==cm.display.maxLine&&(updateMaxLine=!0),marker.collapsed&&curLine!=from.line&&updateLineHeight(line,0),addMarkedSpan(line,new MarkedSpan(marker,curLine==from.line?from.ch:null,curLine==to.line?to.ch:null)),++curLine}),marker.collapsed&&doc.iter(from.line,to.line+1,function(line){lineIsHidden(doc,line)&&updateLineHeight(line,0)}),marker.clearOnEnter&&on(marker,"beforeCursorEnter",function(){return marker.clear()}),marker.readOnly&&(seeReadOnlySpans(),(doc.history.done.length||doc.history.undone.length)&&doc.clearHistory()),marker.collapsed&&(marker.id=++nextMarkerId,marker.atomic=!0),cm){if(updateMaxLine&&(cm.curOp.updateMaxLine=!0),marker.collapsed)regChange(cm,from.line,to.line+1);else if(marker.className||marker.title||marker.startStyle||marker.endStyle||marker.css)for(var i=from.line;i<=to.line;i++)regLineChange(cm,i,"text");marker.atomic&&reCheckSelection(cm.doc),signalLater(cm,"markerAdded",cm,marker)}return marker}function markTextShared(doc,from,to,options,type){options=copyObj(options),options.shared=!1;var markers=[_markText(doc,from,to,options,type)],primary=markers[0],widget=options.widgetNode;return linkedDocs(doc,function(doc){widget&&(options.widgetNode=widget.cloneNode(!0)),markers.push(_markText(doc,_clipPos(doc,from),_clipPos(doc,to),options,type));for(var i=0;i<doc.linked.length;++i)if(doc.linked[i].isParent)return;primary=lst(markers)}),new SharedTextMarker(markers,primary)}function findSharedMarkers(doc){return doc.findMarks(Pos(doc.first,0),doc.clipPos(Pos(doc.lastLine())),function(m){return m.parent})}function copySharedMarkers(doc,markers){for(var i=0;i<markers.length;i++){var marker=markers[i],pos=marker.find(),mFrom=doc.clipPos(pos.from),mTo=doc.clipPos(pos.to);if(cmp(mFrom,mTo)){var subMark=_markText(doc,mFrom,mTo,marker.primary,marker.primary.type);marker.markers.push(subMark),subMark.parent=marker}}}function detachSharedMarkers(markers){for(var loop=function(i){var marker=markers[i],linked=[marker.primary.doc];linkedDocs(marker.primary.doc,function(d){return linked.push(d)});for(var j=0,subMarker;j<marker.markers.length;j++)subMarker=marker.markers[j],-1==indexOf(linked,subMarker.doc)&&(subMarker.parent=null,marker.markers.splice(j--,1))},i=0;i<markers.length;i++)loop(i)}function onDrop(e){var cm=this;if(clearDragCursor(cm),!(signalDOMEvent(cm,e)||eventInWidget(cm.display,e))){e_preventDefault(e),ie&&(lastDrop=+new Date);var pos=posFromMouse(cm,e,!0),files=e.dataTransfer.files;if(pos&&!cm.isReadOnly())if(files&&files.length&&window.FileReader&&window.File)for(var n=files.length,text=Array(n),read=0,loadFile=function(file,i){if(!(cm.options.allowDropFileTypes&&-1==indexOf(cm.options.allowDropFileTypes,file.type))){var reader=new FileReader;reader.onload=operation(cm,function(){var content=reader.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(content)&&(content=""),text[i]=content,++read==n){pos=_clipPos(cm.doc,pos);var change={from:pos,to:pos,text:cm.doc.splitLines(text.join(cm.doc.lineSeparator())),origin:"paste"};makeChange(cm.doc,change),setSelectionReplaceHistory(cm.doc,simpleSelection(pos,changeEnd(change)))}}),reader.readAsText(file)}},i=0;i<n;++i)loadFile(files[i],i);else{if(cm.state.draggingText&&-1<cm.doc.sel.contains(pos))return cm.state.draggingText(e),void setTimeout(function(){return cm.display.input.focus()},20);try{var text$1=e.dataTransfer.getData("Text");if(text$1){var selected;if(cm.state.draggingText&&!cm.state.draggingText.copy&&(selected=cm.listSelections()),setSelectionNoUndo(cm.doc,simpleSelection(pos,pos)),selected)for(var i$1=0;i$1<selected.length;++i$1)_replaceRange(cm.doc,"",selected[i$1].anchor,selected[i$1].head,"drag");cm.replaceSelection(text$1,"around","paste"),cm.display.input.focus()}}catch(e){}}}}function onDragStart(cm,e){if(ie&&(!cm.state.draggingText||100>+new Date-lastDrop))return void e_stop(e);if(!(signalDOMEvent(cm,e)||eventInWidget(cm.display,e))&&(e.dataTransfer.setData("Text",cm.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!safari)){var img=elt("img",null,null,"position: fixed; left: 0; top: 0;");img.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",presto&&(img.width=img.height=1,cm.display.wrapper.appendChild(img),img._top=img.offsetTop),e.dataTransfer.setDragImage(img,0,0),presto&&img.parentNode.removeChild(img)}}function onDragOver(cm,e){var pos=posFromMouse(cm,e);if(pos){var frag=document.createDocumentFragment();drawSelectionCursor(cm,pos,frag),cm.display.dragCursor||(cm.display.dragCursor=elt("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),cm.display.lineSpace.insertBefore(cm.display.dragCursor,cm.display.cursorDiv)),removeChildrenAndAdd(cm.display.dragCursor,frag)}}function clearDragCursor(cm){cm.display.dragCursor&&(cm.display.lineSpace.removeChild(cm.display.dragCursor),cm.display.dragCursor=null)}function forEachCodeMirror(f){if(document.getElementsByClassName)for(var byClass=document.getElementsByClassName("CodeMirror"),i=0,cm;i<byClass.length;i++)cm=byClass[i].CodeMirror,cm&&f(cm)}function ensureGlobalHandlers(){globalsRegistered||(registerGlobalHandlers(),globalsRegistered=!0)}function registerGlobalHandlers(){var resizeTimer;on(window,"resize",function(){null==resizeTimer&&(resizeTimer=setTimeout(function(){resizeTimer=null,forEachCodeMirror(onResize)},100))}),on(window,"blur",function(){return forEachCodeMirror(onBlur)})}function onResize(cm){var d=cm.display;d.lastWrapHeight==d.wrapper.clientHeight&&d.lastWrapWidth==d.wrapper.clientWidth||(d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.scrollbarsClipped=!1,cm.setSize())}function normalizeKeyName(name){var parts=name.split(/-(?!$)/);name=parts[parts.length-1];for(var i=0,alt,ctrl,shift,cmd,mod;i<parts.length-1;i++)if(mod=parts[i],/^(cmd|meta|m)$/i.test(mod))cmd=!0;else if(/^a(lt)?$/i.test(mod))alt=!0;else if(/^(c|ctrl|control)$/i.test(mod))ctrl=!0;else if(/^s(hift)?$/i.test(mod))shift=!0;else throw new Error("Unrecognized modifier name: "+mod);return alt&&(name="Alt-"+name),ctrl&&(name="Ctrl-"+name),cmd&&(name="Cmd-"+name),shift&&(name="Shift-"+name),name}function normalizeKeyMap(keymap){var copy={};for(var keyname in keymap)if(keymap.hasOwnProperty(keyname)){var value=keymap[keyname];if(/^(name|fallthrough|(de|at)tach)$/.test(keyname))continue;if("..."==value){delete keymap[keyname];continue}for(var keys=map(keyname.split(" "),normalizeKeyName),i=0;i<keys.length;i++){var val=void 0,name=void 0;i==keys.length-1?(name=keys.join(" "),val=value):(name=keys.slice(0,i+1).join(" "),val="...");var prev=copy[name];if(!prev)copy[name]=val;else if(prev!=val)throw new Error("Inconsistent bindings for "+name)}delete keymap[keyname]}for(var prop in copy)keymap[prop]=copy[prop];return keymap}function lookupKey(key,map$$1,handle,context){map$$1=getKeyMap(map$$1);var found=map$$1.call?map$$1.call(key,context):map$$1[key];if(!1===found)return"nothing";if("..."===found)return"multi";if(null!=found&&handle(found))return"handled";if(map$$1.fallthrough){if("[object Array]"!=Object.prototype.toString.call(map$$1.fallthrough))return lookupKey(key,map$$1.fallthrough,handle,context);for(var i=0,result;i<map$$1.fallthrough.length;i++)if(result=lookupKey(key,map$$1.fallthrough[i],handle,context),result)return result}}function isModifierKey(value){var name="string"==typeof value?value:keyNames[value.keyCode];return"Ctrl"==name||"Alt"==name||"Shift"==name||"Mod"==name}function addModifierNames(name,event,noShift){var base=name;return event.altKey&&"Alt"!=base&&(name="Alt-"+name),(flipCtrlCmd?event.metaKey:event.ctrlKey)&&"Ctrl"!=base&&(name="Ctrl-"+name),(flipCtrlCmd?event.ctrlKey:event.metaKey)&&"Cmd"!=base&&(name="Cmd-"+name),!noShift&&event.shiftKey&&"Shift"!=base&&(name="Shift-"+name),name}function keyName(event,noShift){if(presto&&34==event.keyCode&&event.char)return!1;var name=keyNames[event.keyCode];return null==name||event.altGraphKey?!1:(3==event.keyCode&&event.code&&(name=event.code),addModifierNames(name,event,noShift))}function getKeyMap(val){return"string"==typeof val?keyMap[val]:val}function deleteNearSelection(cm,compute){for(var ranges=cm.doc.sel.ranges,kill=[],i=0,toKill;i<ranges.length;i++){for(toKill=compute(ranges[i]);kill.length&&0>=cmp(toKill.from,lst(kill).to);){var replaced=kill.pop();if(0>cmp(replaced.from,toKill.from)){toKill.from=replaced.from;break}}kill.push(toKill)}runInOp(cm,function(){for(var i=kill.length-1;0<=i;i--)_replaceRange(cm.doc,"",kill[i].from,kill[i].to,"+delete");ensureCursorVisible(cm)})}function moveCharLogically(line,ch,dir){var target=skipExtendingChars(line.text,ch+dir,dir);return 0>target||target>line.text.length?null:target}function moveLogically(line,start,dir){var ch=moveCharLogically(line,start.ch,dir);return null==ch?null:new Pos(start.line,ch,0>dir?"after":"before")}function endOfLine(visually,cm,lineObj,lineNo,dir){if(visually){var order=getOrder(lineObj,cm.doc.direction);if(order){var part=0>dir?lst(order):order[0],moveInStorageOrder=0>dir==(1==part.level),sticky=moveInStorageOrder?"after":"before",ch;if(0<part.level||"rtl"==cm.doc.direction){var prep=prepareMeasureForLine(cm,lineObj);ch=0>dir?lineObj.text.length-1:0;var targetTop=measureCharPrepared(cm,prep,ch).top;ch=findFirst(function(ch){return measureCharPrepared(cm,prep,ch).top==targetTop},0>dir==(1==part.level)?part.from:part.to-1,ch),"before"==sticky&&(ch=moveCharLogically(lineObj,ch,1))}else ch=0>dir?part.to:part.from;return new Pos(lineNo,ch,sticky)}}return new Pos(lineNo,0>dir?lineObj.text.length:0,0>dir?"before":"after")}function moveVisually(cm,line,start,dir){var bidi=getOrder(line,cm.doc.direction);if(!bidi)return moveLogically(line,start,dir);start.ch>=line.text.length?(start.ch=line.text.length,start.sticky="before"):0>=start.ch&&(start.ch=0,start.sticky="after");var partPos=getBidiPartAt(bidi,start.ch,start.sticky),part=bidi[partPos];if("ltr"==cm.doc.direction&&0==part.level%2&&(0<dir?part.to>start.ch:part.from<start.ch))return moveLogically(line,start,dir);var mv=function(pos,dir){return moveCharLogically(line,pos instanceof Pos?pos.ch:pos,dir)},getWrappedLineExtent=function(ch){return cm.options.lineWrapping?(prep=prep||prepareMeasureForLine(cm,line),wrappedLineExtentChar(cm,line,prep,ch)):{begin:0,end:line.text.length}},wrappedLineExtent=getWrappedLineExtent("before"==start.sticky?mv(start,-1):start.ch),prep;if("rtl"==cm.doc.direction||1==part.level){var moveInStorageOrder=1==part.level==0>dir,ch=mv(start,moveInStorageOrder?1:-1);if(null!=ch&&(moveInStorageOrder?ch<=part.to&&ch<=wrappedLineExtent.end:ch>=part.from&&ch>=wrappedLineExtent.begin)){var sticky=moveInStorageOrder?"before":"after";return new Pos(start.line,ch,sticky)}}var searchInVisualLine=function(partPos,dir,wrappedLineExtent){for(var getRes=function(ch,moveInStorageOrder){return moveInStorageOrder?new Pos(start.line,mv(ch,1),"before"):new Pos(start.line,ch,"after")};0<=partPos&&partPos<bidi.length;partPos+=dir){var part=bidi[partPos],moveInStorageOrder=0<dir==(1!=part.level),ch=moveInStorageOrder?wrappedLineExtent.begin:mv(wrappedLineExtent.end,-1);if(part.from<=ch&&ch<part.to)return getRes(ch,moveInStorageOrder);if(ch=moveInStorageOrder?part.from:mv(part.to,-1),wrappedLineExtent.begin<=ch&&ch<wrappedLineExtent.end)return getRes(ch,moveInStorageOrder)}},res=searchInVisualLine(partPos+dir,dir,wrappedLineExtent);if(res)return res;var nextCh=0<dir?wrappedLineExtent.end:mv(wrappedLineExtent.begin,-1);return null!=nextCh&&!(0<dir&&nextCh==line.text.length)&&(res=searchInVisualLine(0<dir?0:bidi.length-1,dir,getWrappedLineExtent(nextCh)),res)?res:null}function lineStart(cm,lineN){var line=getLine(cm.doc,lineN),visual=visualLine(line);return visual!=line&&(lineN=lineNo(visual)),endOfLine(!0,cm,visual,lineN,1)}function lineEnd(cm,lineN){var line=getLine(cm.doc,lineN),visual=visualLineEnd(line);return visual!=line&&(lineN=lineNo(visual)),endOfLine(!0,cm,line,lineN,-1)}function lineStartSmart(cm,pos){var start=lineStart(cm,pos.line),line=getLine(cm.doc,start.line),order=getOrder(line,cm.doc.direction);if(!order||0==order[0].level){var firstNonWS=_Mathmax5(0,line.text.search(/\S/)),inWS=pos.line==start.line&&pos.ch<=firstNonWS&&pos.ch;return Pos(start.line,inWS?0:firstNonWS,start.sticky)}return start}function doHandleBinding(cm,bound,dropShift){if("string"==typeof bound&&(bound=commands[bound],!bound))return!1;cm.display.input.ensurePolled();var prevShift=cm.display.shift,done=!1;try{cm.isReadOnly()&&(cm.state.suppressEdits=!0),dropShift&&(cm.display.shift=!1),done=bound(cm)!=Pass}finally{cm.display.shift=prevShift,cm.state.suppressEdits=!1}return done}function lookupKeyForEditor(cm,name,handle){for(var i=0,result;i<cm.state.keyMaps.length;i++)if(result=lookupKey(name,cm.state.keyMaps[i],handle,cm),result)return result;return cm.options.extraKeys&&lookupKey(name,cm.options.extraKeys,handle,cm)||lookupKey(name,cm.options.keyMap,handle,cm)}function dispatchKey(cm,name,e,handle){var seq=cm.state.keySeq;if(seq){if(isModifierKey(name))return"handled";if(/\'$/.test(name)?cm.state.keySeq=null:stopSeq.set(50,function(){cm.state.keySeq==seq&&(cm.state.keySeq=null,cm.display.input.reset())}),dispatchKeyInner(cm,seq+" "+name,e,handle))return!0}return dispatchKeyInner(cm,name,e,handle)}function dispatchKeyInner(cm,name,e,handle){var result=lookupKeyForEditor(cm,name,handle);return"multi"==result&&(cm.state.keySeq=name),"handled"==result&&signalLater(cm,"keyHandled",cm,name,e),("handled"==result||"multi"==result)&&(e_preventDefault(e),restartBlink(cm)),!!result}function handleKeyBinding(cm,e){var name=keyName(e,!0);return!!name&&(e.shiftKey&&!cm.state.keySeq?dispatchKey(cm,"Shift-"+name,e,function(b){return doHandleBinding(cm,b,!0)})||dispatchKey(cm,name,e,function(b){if("string"==typeof b?/^go[A-Z]/.test(b):b.motion)return doHandleBinding(cm,b)}):dispatchKey(cm,name,e,function(b){return doHandleBinding(cm,b)}))}function handleCharBinding(cm,e,ch){return dispatchKey(cm,"'"+ch+"'",e,function(b){return doHandleBinding(cm,b,!0)})}function onKeyDown(e){var cm=this;if(cm.curOp.focus=activeElt(),!signalDOMEvent(cm,e)){ie&&11>ie_version&&27==e.keyCode&&(e.returnValue=!1);var code=e.keyCode;cm.display.shift=16==code||e.shiftKey;var handled=handleKeyBinding(cm,e);presto&&(lastStoppedKey=handled?code:null,!handled&&88==code&&!hasCopyEvent&&(mac?e.metaKey:e.ctrlKey)&&cm.replaceSelection("",null,"cut")),18!=code||/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)||showCrossHair(cm)}}function showCrossHair(cm){function up(e){18!=e.keyCode&&e.altKey||(rmClass(lineDiv,"CodeMirror-crosshair"),off(document,"keyup",up),off(document,"mouseover",up))}var lineDiv=cm.display.lineDiv;addClass(lineDiv,"CodeMirror-crosshair"),on(document,"keyup",up),on(document,"mouseover",up)}function onKeyUp(e){16==e.keyCode&&(this.doc.sel.shift=!1),signalDOMEvent(this,e)}function onKeyPress(e){var cm=this;if(!(eventInWidget(cm.display,e)||signalDOMEvent(cm,e)||e.ctrlKey&&!e.altKey||mac&&e.metaKey)){var keyCode=e.keyCode,charCode=e.charCode;if(presto&&keyCode==lastStoppedKey)return lastStoppedKey=null,void e_preventDefault(e);if(!(presto&&(!e.which||10>e.which)&&handleKeyBinding(cm,e))){var ch=_StringfromCharCode7(null==charCode?keyCode:charCode);"\b"==ch||handleCharBinding(cm,e,ch)||cm.display.input.onKeyPress(e)}}}function clickRepeat(pos,button){var now=+new Date;return lastDoubleClick&&lastDoubleClick.compare(now,pos,button)?(lastClick=lastDoubleClick=null,"triple"):lastClick&&lastClick.compare(now,pos,button)?(lastDoubleClick=new PastClick(now,pos,button),lastClick=null,"double"):(lastClick=new PastClick(now,pos,button),lastDoubleClick=null,"single")}function onMouseDown(e){var cm=this,display=cm.display;if(!(signalDOMEvent(cm,e)||display.activeTouch&&display.input.supportsTouch())){if(display.input.ensurePolled(),display.shift=e.shiftKey,eventInWidget(display,e))return void(webkit||(display.scroller.draggable=!1,setTimeout(function(){return display.scroller.draggable=!0},100)));if(!clickInGutter(cm,e)){var pos=posFromMouse(cm,e),button=e_button(e),repeat=pos?clickRepeat(pos,button):"single";window.focus(),1==button&&cm.state.selectingText&&cm.state.selectingText(e),pos&&handleMappedButton(cm,button,pos,repeat,e)||(1==button?pos?leftButtonDown(cm,pos,repeat,e):e_target(e)==display.scroller&&e_preventDefault(e):2==button?(pos&&extendSelection(cm.doc,pos),setTimeout(function(){return display.input.focus()},20)):3==button&&(captureRightClick?onContextMenu(cm,e):delayBlurEvent(cm)))}}}function handleMappedButton(cm,button,pos,repeat,event){var name="Click";return"double"==repeat?name="Double"+name:"triple"==repeat&&(name="Triple"+name),name=(1==button?"Left":2==button?"Middle":"Right")+name,dispatchKey(cm,addModifierNames(name,event),event,function(bound){if("string"==typeof bound&&(bound=commands[bound]),!bound)return!1;var done=!1;try{cm.isReadOnly()&&(cm.state.suppressEdits=!0),done=bound(cm,pos)!=Pass}finally{cm.state.suppressEdits=!1}return done})}function configureMouse(cm,repeat,event){var option=cm.getOption("configureMouse"),value=option?option(cm,repeat,event):{};if(null==value.unit){var rect=chromeOS?event.shiftKey&&event.metaKey:event.altKey;value.unit=rect?"rectangle":"single"==repeat?"char":"double"==repeat?"word":"line"}return(null==value.extend||cm.doc.extend)&&(value.extend=cm.doc.extend||event.shiftKey),null==value.addNew&&(value.addNew=mac?event.metaKey:event.ctrlKey),null==value.moveOnDrag&&(value.moveOnDrag=mac?!event.altKey:!event.ctrlKey),value}function leftButtonDown(cm,pos,repeat,event){ie?setTimeout(bind(ensureFocus,cm),0):cm.curOp.focus=activeElt();var behavior=configureMouse(cm,repeat,event),sel=cm.doc.sel,contained;cm.options.dragDrop&&dragAndDrop&&!cm.isReadOnly()&&"single"==repeat&&-1<(contained=sel.contains(pos))&&(0>cmp((contained=sel.ranges[contained]).from(),pos)||0<pos.xRel)&&(0<cmp(contained.to(),pos)||0>pos.xRel)?leftButtonStartDrag(cm,event,pos,behavior):leftButtonSelect(cm,event,pos,behavior)}function leftButtonStartDrag(cm,event,pos,behavior){var display=cm.display,moved=!1,dragEnd=operation(cm,function(e){webkit&&(display.scroller.draggable=!1),cm.state.draggingText=!1,off(display.wrapper.ownerDocument,"mouseup",dragEnd),off(display.wrapper.ownerDocument,"mousemove",mouseMove),off(display.scroller,"dragstart",dragStart),off(display.scroller,"drop",dragEnd),moved||(e_preventDefault(e),!behavior.addNew&&extendSelection(cm.doc,pos,null,null,behavior.extend),webkit||ie&&9==ie_version?setTimeout(function(){display.wrapper.ownerDocument.body.focus(),display.input.focus()},20):display.input.focus())}),mouseMove=function(e2){moved=moved||10<=_Mathabs(event.clientX-e2.clientX)+_Mathabs(event.clientY-e2.clientY)},dragStart=function(){return moved=!0};webkit&&(display.scroller.draggable=!0),cm.state.draggingText=dragEnd,dragEnd.copy=!behavior.moveOnDrag,display.scroller.dragDrop&&display.scroller.dragDrop(),on(display.wrapper.ownerDocument,"mouseup",dragEnd),on(display.wrapper.ownerDocument,"mousemove",mouseMove),on(display.scroller,"dragstart",dragStart),on(display.scroller,"drop",dragEnd),delayBlurEvent(cm),setTimeout(function(){return display.input.focus()},20)}function rangeForUnit(cm,pos,unit){if("char"==unit)return new Range(pos,pos);if("word"==unit)return cm.findWordAt(pos);if("line"==unit)return new Range(Pos(pos.line,0),_clipPos(cm.doc,Pos(pos.line+1,0)));var result=unit(cm,pos);return new Range(result.from,result.to)}function leftButtonSelect(cm,event,start,behavior){function extendTo(pos){if(0!=cmp(lastPos,pos))if(lastPos=pos,"rectangle"==behavior.unit){for(var ranges=[],tabSize=cm.options.tabSize,startCol=countColumn(getLine(doc,start.line).text,start.ch,tabSize),posCol=countColumn(getLine(doc,pos.line).text,pos.ch,tabSize),left=_Mathmin6(startCol,posCol),right=_Mathmax5(startCol,posCol),line=_Mathmin6(start.line,pos.line),end=_Mathmin6(cm.lastLine(),_Mathmax5(start.line,pos.line));line<=end;line++){var text=getLine(doc,line).text,leftPos=findColumn(text,left,tabSize);left==right?ranges.push(new Range(Pos(line,leftPos),Pos(line,leftPos))):text.length>leftPos&&ranges.push(new Range(Pos(line,leftPos),Pos(line,findColumn(text,right,tabSize))))}ranges.length||ranges.push(new Range(start,start)),setSelection(doc,normalizeSelection(startSel.ranges.slice(0,ourIndex).concat(ranges),ourIndex),{origin:"*mouse",scroll:!1}),cm.scrollIntoView(pos)}else{var oldRange=ourRange,range$$1=rangeForUnit(cm,pos,behavior.unit),anchor=oldRange.anchor,head;0<cmp(range$$1.anchor,anchor)?(head=range$$1.head,anchor=minPos(oldRange.from(),range$$1.anchor)):(head=range$$1.anchor,anchor=maxPos(oldRange.to(),range$$1.head));var ranges$1=startSel.ranges.slice(0);ranges$1[ourIndex]=bidiSimplify(cm,new Range(_clipPos(doc,anchor),head)),setSelection(doc,normalizeSelection(ranges$1,ourIndex),sel_mouse)}}function extend(e){var curCount=++counter,cur=posFromMouse(cm,e,!0,"rectangle"==behavior.unit);if(cur)if(0!=cmp(cur,lastPos)){cm.curOp.focus=activeElt(),extendTo(cur);var visible=visibleLines(display,doc);(cur.line>=visible.to||cur.line<visible.from)&&setTimeout(operation(cm,function(){counter==curCount&&extend(e)}),150)}else{var outside=e.clientY<editorSize.top?-20:e.clientY>editorSize.bottom?20:0;outside&&setTimeout(operation(cm,function(){counter!=curCount||(display.scroller.scrollTop+=outside,extend(e))}),50)}}function done(e){cm.state.selectingText=!1,counter=Infinity,e_preventDefault(e),display.input.focus(),off(display.wrapper.ownerDocument,"mousemove",move),off(display.wrapper.ownerDocument,"mouseup",up),doc.history.lastSelOrigin=null}var display=cm.display,doc=cm.doc;e_preventDefault(event);var startSel=doc.sel,ranges=startSel.ranges,ourRange,ourIndex;if(behavior.addNew&&!behavior.extend?(ourIndex=doc.sel.contains(start),ourRange=-1<ourIndex?ranges[ourIndex]:new Range(start,start)):(ourRange=doc.sel.primary(),ourIndex=doc.sel.primIndex),"rectangle"==behavior.unit)behavior.addNew||(ourRange=new Range(start,start)),start=posFromMouse(cm,event,!0,!0),ourIndex=-1;else{var range$$1=rangeForUnit(cm,start,behavior.unit);ourRange=behavior.extend?extendRange(ourRange,range$$1.anchor,range$$1.head,behavior.extend):range$$1}behavior.addNew?-1==ourIndex?(ourIndex=ranges.length,setSelection(doc,normalizeSelection(ranges.concat([ourRange]),ourIndex),{scroll:!1,origin:"*mouse"})):1<ranges.length&&ranges[ourIndex].empty()&&"char"==behavior.unit&&!behavior.extend?(setSelection(doc,normalizeSelection(ranges.slice(0,ourIndex).concat(ranges.slice(ourIndex+1)),0),{scroll:!1,origin:"*mouse"}),startSel=doc.sel):replaceOneSelection(doc,ourIndex,ourRange,sel_mouse):(ourIndex=0,setSelection(doc,new Selection([ourRange],0),sel_mouse),startSel=doc.sel);var lastPos=start,editorSize=display.wrapper.getBoundingClientRect(),counter=0,move=operation(cm,function(e){0!==e.buttons&&e_button(e)?extend(e):done(e)}),up=operation(cm,done);cm.state.selectingText=up,on(display.wrapper.ownerDocument,"mousemove",move),on(display.wrapper.ownerDocument,"mouseup",up)}function bidiSimplify(cm,range$$1){var anchor=range$$1.anchor,head=range$$1.head,anchorLine=getLine(cm.doc,anchor.line);if(0==cmp(anchor,head)&&anchor.sticky==head.sticky)return range$$1;var order=getOrder(anchorLine);if(!order)return range$$1;var index=getBidiPartAt(order,anchor.ch,anchor.sticky),part=order[index];if(part.from!=anchor.ch&&part.to!=anchor.ch)return range$$1;var boundary=index+(part.from==anchor.ch==(1!=part.level)?0:1);if(0==boundary||boundary==order.length)return range$$1;var leftSide;if(head.line!=anchor.line)leftSide=0<(head.line-anchor.line)*("ltr"==cm.doc.direction?1:-1);else{var headIndex=getBidiPartAt(order,head.ch,head.sticky),dir=headIndex-index||(head.ch-anchor.ch)*(1==part.level?-1:1);leftSide=headIndex==boundary-1||headIndex==boundary?0>dir:0<dir}var usePart=order[boundary+(leftSide?-1:0)],from=leftSide==(1==usePart.level),ch=from?usePart.from:usePart.to,sticky=from?"after":"before";return anchor.ch==ch&&anchor.sticky==sticky?range$$1:new Range(new Pos(anchor.line,ch,sticky),head)}function gutterEvent(cm,e,type,prevent){var mX,mY;if(e.touches)mX=e.touches[0].clientX,mY=e.touches[0].clientY;else try{mX=e.clientX,mY=e.clientY}catch(e){return!1}if(mX>=_Mathfloor4(cm.display.gutters.getBoundingClientRect().right))return!1;prevent&&e_preventDefault(e);var display=cm.display,lineBox=display.lineDiv.getBoundingClientRect();if(mY>lineBox.bottom||!hasHandler(cm,type))return e_defaultPrevented(e);mY-=lineBox.top-display.viewOffset;for(var i=0,g;i<cm.options.gutters.length;++i)if(g=display.gutters.childNodes[i],g&&g.getBoundingClientRect().right>=mX){var line=_lineAtHeight(cm.doc,mY),gutter=cm.options.gutters[i];return signal(cm,type,cm,line,gutter,e),e_defaultPrevented(e)}}function clickInGutter(cm,e){return gutterEvent(cm,e,"gutterClick",!0)}function onContextMenu(cm,e){eventInWidget(cm.display,e)||contextMenuInGutter(cm,e)||signalDOMEvent(cm,e,"contextmenu")||cm.display.input.onContextMenu(e)}function contextMenuInGutter(cm,e){return!!hasHandler(cm,"gutterContextMenu")&&gutterEvent(cm,e,"gutterContextMenu",!1)}function themeChanged(cm){cm.display.wrapper.className=cm.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+cm.options.theme.replace(/(^|\s)\s*/g," cm-s-"),clearCaches(cm)}function guttersChanged(cm){updateGutters(cm),regChange(cm),alignHorizontally(cm)}function dragDropChanged(cm,value,old){if(!value!=!(old&&old!=Init)){var funcs=cm.display.dragFunctions,toggle=value?on:off;toggle(cm.display.scroller,"dragstart",funcs.start),toggle(cm.display.scroller,"dragenter",funcs.enter),toggle(cm.display.scroller,"dragover",funcs.over),toggle(cm.display.scroller,"dragleave",funcs.leave),toggle(cm.display.scroller,"drop",funcs.drop)}}function wrappingChanged(cm){cm.options.lineWrapping?(addClass(cm.display.wrapper,"CodeMirror-wrap"),cm.display.sizer.style.minWidth="",cm.display.sizerWidth=null):(rmClass(cm.display.wrapper,"CodeMirror-wrap"),findMaxLine(cm)),estimateLineHeights(cm),regChange(cm),clearCaches(cm),setTimeout(function(){return updateScrollbars(cm)},100)}function CodeMirror$1(place,options){var this$1=this;if(!(this instanceof CodeMirror$1))return new CodeMirror$1(place,options);this.options=options=options?copyObj(options):{},copyObj(defaults,options,!1),setGuttersForLineNumbers(options);var doc=options.value;"string"==typeof doc&&(doc=new Doc(doc,options.mode,null,options.lineSeparator,options.direction)),this.doc=doc;var input=new CodeMirror$1.inputStyles[options.inputStyle](this),display=this.display=new Display(place,doc,input);for(var opt in display.wrapper.CodeMirror=this,updateGutters(this),themeChanged(this),options.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),initScrollbars(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 Delayed,keySeq:null,specialChars:null},options.autofocus&&!mobile&&display.input.focus(),ie&&11>ie_version&&setTimeout(function(){return this$1.display.input.reset(!0)},20),registerEventHandlers(this),ensureGlobalHandlers(),_startOperation(this),this.curOp.forceUpdate=!0,attachDoc(this,doc),options.autofocus&&!mobile||this.hasFocus()?setTimeout(bind(onFocus,this),20):onBlur(this),optionHandlers)optionHandlers.hasOwnProperty(opt)&&optionHandlers[opt](this$1,options[opt],Init);maybeUpdateLineNumberWidth(this),options.finishInit&&options.finishInit(this);for(var i=0;i<initHooks.length;++i)initHooks[i](this$1);_endOperation(this),webkit&&options.lineWrapping&&"optimizelegibility"==getComputedStyle(display.lineDiv).textRendering&&(display.lineDiv.style.textRendering="auto")}function registerEventHandlers(cm){function finishTouch(){d.activeTouch&&(touchFinished=setTimeout(function(){return d.activeTouch=null},1e3),prevTouch=d.activeTouch,prevTouch.end=+new Date)}function isMouseLikeTouchEvent(e){if(1!=e.touches.length)return!1;var touch=e.touches[0];return 1>=touch.radiusX&&1>=touch.radiusY}function farAway(touch,other){if(null==other.left)return!0;var dx=other.left-touch.left,dy=other.top-touch.top;return 400<dx*dx+dy*dy}var d=cm.display;on(d.scroller,"mousedown",operation(cm,onMouseDown)),ie&&11>ie_version?on(d.scroller,"dblclick",operation(cm,function(e){if(!signalDOMEvent(cm,e)){var pos=posFromMouse(cm,e);if(!(!pos||clickInGutter(cm,e)||eventInWidget(cm.display,e))){e_preventDefault(e);var word=cm.findWordAt(pos);extendSelection(cm.doc,word.anchor,word.head)}}})):on(d.scroller,"dblclick",function(e){return signalDOMEvent(cm,e)||e_preventDefault(e)}),captureRightClick||on(d.scroller,"contextmenu",function(e){return onContextMenu(cm,e)});var prevTouch={end:0},touchFinished;on(d.scroller,"touchstart",function(e){if(!signalDOMEvent(cm,e)&&!isMouseLikeTouchEvent(e)&&!clickInGutter(cm,e)){d.input.ensurePolled(),clearTimeout(touchFinished);var now=+new Date;d.activeTouch={start:now,moved:!1,prev:300>=now-prevTouch.end?prevTouch:null},1==e.touches.length&&(d.activeTouch.left=e.touches[0].pageX,d.activeTouch.top=e.touches[0].pageY)}}),on(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)}),on(d.scroller,"touchend",function(e){var touch=d.activeTouch;if(touch&&!eventInWidget(d,e)&&null!=touch.left&&!touch.moved&&300>new Date-touch.start){var pos=cm.coordsChar(d.activeTouch,"page"),range;range=!touch.prev||farAway(touch,touch.prev)?new Range(pos,pos):!touch.prev.prev||farAway(touch,touch.prev.prev)?cm.findWordAt(pos):new Range(Pos(pos.line,0),_clipPos(cm.doc,Pos(pos.line+1,0))),cm.setSelection(range.anchor,range.head),cm.focus(),e_preventDefault(e)}finishTouch()}),on(d.scroller,"touchcancel",finishTouch),on(d.scroller,"scroll",function(){d.scroller.clientHeight&&(updateScrollTop(cm,d.scroller.scrollTop),setScrollLeft(cm,d.scroller.scrollLeft,!0),signal(cm,"scroll",cm))}),on(d.scroller,"mousewheel",function(e){return onScrollWheel(cm,e)}),on(d.scroller,"DOMMouseScroll",function(e){return onScrollWheel(cm,e)}),on(d.wrapper,"scroll",function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0}),d.dragFunctions={enter:function(e){signalDOMEvent(cm,e)||e_stop(e)},over:function(e){signalDOMEvent(cm,e)||(onDragOver(cm,e),e_stop(e))},start:function(e){return onDragStart(cm,e)},drop:operation(cm,onDrop),leave:function(e){signalDOMEvent(cm,e)||clearDragCursor(cm)}};var inp=d.input.getField();on(inp,"keyup",function(e){return onKeyUp.call(cm,e)}),on(inp,"keydown",operation(cm,onKeyDown)),on(inp,"keypress",operation(cm,onKeyPress)),on(inp,"focus",function(e){return onFocus(cm,e)}),on(inp,"blur",function(e){return onBlur(cm,e)})}function indentLine(cm,n,how,aggressive){var doc=cm.doc,state;null==how&&(how="add"),"smart"==how&&(doc.mode.indent?state=getContextBefore(cm,n).state:how="prev");var tabSize=cm.options.tabSize,line=getLine(doc,n),curSpace=countColumn(line.text,null,tabSize);line.stateAfter&&(line.stateAfter=null);var curSpaceString=line.text.match(/^\s*/)[0],indentation;if(!aggressive&&!/\S/.test(line.text))indentation=0,how="not";else if("smart"==how&&(indentation=doc.mode.indent(state,line.text.slice(curSpaceString.length),line.text),indentation==Pass||150<indentation)){if(!aggressive)return;how="prev"}"prev"==how?n>doc.first?indentation=countColumn(getLine(doc,n-1).text,null,tabSize):indentation=0:"add"==how?indentation=curSpace+cm.options.indentUnit:"subtract"==how?indentation=curSpace-cm.options.indentUnit:"number"==typeof how&&(indentation=curSpace+how),indentation=_Mathmax5(0,indentation);var indentString="",pos=0;if(cm.options.indentWithTabs)for(var i=_Mathfloor4(indentation/tabSize);i;--i)pos+=tabSize,indentString+="\t";if(pos<indentation&&(indentString+=spaceStr(indentation-pos)),indentString!=curSpaceString)return _replaceRange(doc,indentString,Pos(n,0),Pos(n,curSpaceString.length),"+input"),line.stateAfter=null,!0;for(var i$1=0,range;i$1<doc.sel.ranges.length;i$1++)if(range=doc.sel.ranges[i$1],range.head.line==n&&range.head.ch<curSpaceString.length){var pos$1=Pos(n,curSpaceString.length);replaceOneSelection(doc,i$1,new Range(pos$1,pos$1));break}}function setLastCopied(newLastCopied){lastCopied=newLastCopied}function applyTextInput(cm,inserted,deleted,sel,origin){var doc=cm.doc;cm.display.shift=!1,sel||(sel=doc.sel);var paste=cm.state.pasteIncoming||"paste"==origin,textLines=splitLinesAuto(inserted),multiPaste=null;if(paste&&1<sel.ranges.length)if(!(lastCopied&&lastCopied.text.join("\n")==inserted))textLines.length==sel.ranges.length&&cm.options.pasteLinesPerSelection&&(multiPaste=map(textLines,function(l){return[l]}));else if(0==sel.ranges.length%lastCopied.text.length){multiPaste=[];for(var i=0;i<lastCopied.text.length;i++)multiPaste.push(doc.splitLines(lastCopied.text[i]))}for(var i$1=sel.ranges.length-1,updateInput;0<=i$1;i$1--){var range$$1=sel.ranges[i$1],from=range$$1.from(),to=range$$1.to();range$$1.empty()&&(deleted&&0<deleted?from=Pos(from.line,from.ch-deleted):cm.state.overwrite&&!paste?to=Pos(to.line,_Mathmin6(getLine(doc,to.line).text.length,to.ch+lst(textLines).length)):lastCopied&&lastCopied.lineWise&&lastCopied.text.join("\n")==inserted&&(from=to=Pos(from.line,0))),updateInput=cm.curOp.updateInput;var changeEvent={from:from,to:to,text:multiPaste?multiPaste[i$1%multiPaste.length]:textLines,origin:origin||(paste?"paste":cm.state.cutIncoming?"cut":"+input")};makeChange(cm.doc,changeEvent),signalLater(cm,"inputRead",cm,changeEvent)}inserted&&!paste&&triggerElectric(cm,inserted),ensureCursorVisible(cm),cm.curOp.updateInput=updateInput,cm.curOp.typing=!0,cm.state.pasteIncoming=cm.state.cutIncoming=!1}function handlePaste(e,cm){var pasted=e.clipboardData&&e.clipboardData.getData("Text");if(pasted)return e.preventDefault(),cm.isReadOnly()||cm.options.disableInput||runInOp(cm,function(){return applyTextInput(cm,pasted,0,null,"paste")}),!0}function triggerElectric(cm,inserted){if(cm.options.electricChars&&cm.options.smartIndent)for(var sel=cm.doc.sel,i=sel.ranges.length-1,range$$1;0<=i;i--)if(range$$1=sel.ranges[i],!(100<range$$1.head.ch||i&&sel.ranges[i-1].head.line==range$$1.head.line)){var mode=cm.getModeAt(range$$1.head),indented=!1;if(mode.electricChars){for(var j=0;j<mode.electricChars.length;j++)if(-1<inserted.indexOf(mode.electricChars.charAt(j))){indented=indentLine(cm,range$$1.head.line,"smart");break}}else mode.electricInput&&mode.electricInput.test(getLine(cm.doc,range$$1.head.line).text.slice(0,range$$1.head.ch))&&(indented=indentLine(cm,range$$1.head.line,"smart"));indented&&signalLater(cm,"electricInput",cm,range$$1.head.line)}}function copyableRanges(cm){for(var text=[],ranges=[],i=0;i<cm.doc.sel.ranges.length;i++){var line=cm.doc.sel.ranges[i].head.line,lineRange={anchor:Pos(line,0),head:Pos(line+1,0)};ranges.push(lineRange),text.push(cm.getRange(lineRange.anchor,lineRange.head))}return{text:text,ranges:ranges}}function disableBrowserMagic(field,spellcheck){field.setAttribute("autocorrect","off"),field.setAttribute("autocapitalize","off"),field.setAttribute("spellcheck",!!spellcheck)}function hiddenTextarea(){var te=elt("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),div=elt("div",[te],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return webkit?te.style.width="1000px":te.setAttribute("wrap","off"),ios&&(te.style.border="1px solid black"),disableBrowserMagic(te),div}function _findPosH(doc,pos,dir,unit,visually){function findNextLine(){var l=pos.line+dir;return l<doc.first||l>=doc.first+doc.size?!1:(pos=new Pos(l,pos.ch,pos.sticky),lineObj=getLine(doc,l))}function moveOnce(boundToLine){var next;if(next=visually?moveVisually(doc.cm,lineObj,pos,dir):moveLogically(lineObj,pos,dir),null!=next)pos=next;else if(!boundToLine&&findNextLine())pos=endOfLine(visually,doc.cm,lineObj,pos.line,dir);else return!1;return!0}var oldPos=pos,origDir=dir,lineObj=getLine(doc,pos.line);if("char"==unit)moveOnce();else if("column"==unit)moveOnce(!0);else if("word"==unit||"group"==unit)for(var sawType=null,group="group"==unit,helper=doc.cm&&doc.cm.getHelper(pos,"wordChars"),first=!0;;first=!1){if(0>dir&&!moveOnce(!first))break;var cur=lineObj.text.charAt(pos.ch)||"\n",type=isWordChar(cur,helper)?"w":group&&"\n"==cur?"n":!group||/\s/.test(cur)?null:"p";if(!group||first||type||(type="s"),sawType&&sawType!=type){0>dir&&(dir=1,moveOnce(),pos.sticky="after");break}if(type&&(sawType=type),0<dir&&!moveOnce(!first))break}var result=skipAtomic(doc,pos,oldPos,origDir,!0);return equalCursorPos(oldPos,result)&&(result.hitSide=!0),result}function _findPosV(cm,pos,dir,unit){var doc=cm.doc,x=pos.left,y;if("page"==unit){var pageSize=_Mathmin6(cm.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),moveAmount=_Mathmax5(pageSize-.5*textHeight(cm.display),3);y=(0<dir?pos.bottom:pos.top)+dir*moveAmount}else"line"==unit&&(y=0<dir?pos.bottom+3:pos.top-3);for(var target;;){if(target=_coordsChar(cm,x,y),!target.outside)break;if(0>dir?0>=y:y>=doc.height){target.hitSide=!0;break}y+=5*dir}return target}function posToDOM(cm,pos){var view=findViewForLine(cm,pos.line);if(!view||view.hidden)return null;var line=getLine(cm.doc,pos.line),info=mapFromLineView(view,line,pos.line),order=getOrder(line,cm.doc.direction),side="left";if(order){var partPos=getBidiPartAt(order,pos.ch);side=partPos%2?"right":"left"}var result=nodeAndOffsetInLineMap(info.map,pos.ch,side);return result.offset="right"==result.collapse?result.end:result.start,result}function isInGutter(node){for(var scan=node;scan;scan=scan.parentNode)if(/CodeMirror-gutter-wrapper/.test(scan.className))return!0;return!1}function badPos(pos,bad){return bad&&(pos.bad=!0),pos}function domTextBetween(cm,from,to,fromLine,toLine){function recognizeMarker(id){return function(marker){return marker.id==id}}function close(){closing&&(text+=lineSep,extraLinebreak&&(text+=lineSep),closing=extraLinebreak=!1)}function addText(str){str&&(close(),text+=str)}function walk(node){if(1==node.nodeType){var cmText=node.getAttribute("cm-text");if(cmText)return void addText(cmText);var markerID=node.getAttribute("cm-marker"),range$$1;if(markerID){var found=cm.findMarks(Pos(fromLine,0),Pos(toLine+1,0),recognizeMarker(+markerID));return void(found.length&&(range$$1=found[0].find(0))&&addText(getBetween(cm.doc,range$$1.from,range$$1.to).join(lineSep)))}if("false"==node.getAttribute("contenteditable"))return;var isBlock=/^(pre|div|p|li|table|br)$/i.test(node.nodeName);if(!/^br$/i.test(node.nodeName)&&0==node.textContent.length)return;isBlock&&close();for(var i=0;i<node.childNodes.length;i++)walk(node.childNodes[i]);/^(pre|p)$/i.test(node.nodeName)&&(extraLinebreak=!0),isBlock&&(closing=!0)}else 3==node.nodeType&&addText(node.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(var text="",closing=!1,lineSep=cm.doc.lineSeparator(),extraLinebreak=!1;;){if(walk(from),from==to)break;from=from.nextSibling,extraLinebreak=!1}return text}function domToPos(cm,node,offset){var lineNode;if(node==cm.display.lineDiv){if(lineNode=cm.display.lineDiv.childNodes[offset],!lineNode)return badPos(cm.clipPos(Pos(cm.display.viewTo-1)),!0);node=null,offset=0}else for(lineNode=node;;lineNode=lineNode.parentNode){if(!lineNode||lineNode==cm.display.lineDiv)return null;if(lineNode.parentNode&&lineNode.parentNode==cm.display.lineDiv)break}for(var i=0,lineView;i<cm.display.view.length;i++)if(lineView=cm.display.view[i],lineView.node==lineNode)return locateNodeInLineView(lineView,node,offset)}function locateNodeInLineView(lineView,node,offset){function find(textNode,topNode,offset){for(var i=-1,map$$1;i<(maps?maps.length:0);i++){map$$1=0>i?measure.map:maps[i];for(var j=0,curNode;j<map$$1.length;j+=3)if(curNode=map$$1[j+2],curNode==textNode||curNode==topNode){var line=lineNo(0>i?lineView.line:lineView.rest[i]),ch=map$$1[j]+offset;return(0>offset||curNode!=textNode)&&(ch=map$$1[j+(offset?1:0)]),Pos(line,ch)}}}var wrapper=lineView.text.firstChild,bad=!1;if(!node||!contains(wrapper,node))return badPos(Pos(lineNo(lineView.line),0),!0);if(node==wrapper&&(bad=!0,node=wrapper.childNodes[offset],offset=0,!node)){var line=lineView.rest?lst(lineView.rest):lineView.line;return badPos(Pos(lineNo(line),line.text.length),bad)}var textNode=3==node.nodeType?node:null,topNode=node;for(textNode||1!=node.childNodes.length||3!=node.firstChild.nodeType||(textNode=node.firstChild,offset&&(offset=textNode.nodeValue.length));topNode.parentNode!=wrapper;)topNode=topNode.parentNode;var measure=lineView.measure,maps=measure.maps,found=find(textNode,topNode,offset);if(found)return badPos(found,bad);for(var after=topNode.nextSibling,dist=textNode?textNode.nodeValue.length-offset:0;after;after=after.nextSibling){if(found=find(after,after.firstChild,0),found)return badPos(Pos(found.line,found.ch-dist),bad);dist+=after.textContent.length}for(var before=topNode.previousSibling,dist$1=offset;before;before=before.previousSibling){if(found=find(before,before.firstChild,-1),found)return badPos(Pos(found.line,found.ch+dist$1),bad);dist$1+=before.textContent.length}}var userAgent=navigator.userAgent,platform=navigator.platform,gecko=/gecko\/\d/i.test(userAgent),ie_upto10=/MSIE \d/.test(userAgent),ie_11up=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent),edge=/Edge\/(\d+)/.exec(userAgent),ie=ie_upto10||ie_11up||edge,ie_version=ie&&(ie_upto10?document.documentMode||6:+(edge||ie_11up)[1]),webkit=!edge&&/WebKit\//.test(userAgent),qtwebkit=webkit&&/Qt\/\d+\.\d+/.test(userAgent),chrome=!edge&&/Chrome\//.test(userAgent),presto=/Opera\//.test(userAgent),safari=/Apple Computer/.test(navigator.vendor),mac_geMountainLion=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent),phantom=/PhantomJS/.test(userAgent),ios=!edge&&/AppleWebKit/.test(userAgent)&&/Mobile\/\w+/.test(userAgent),android=/Android/.test(userAgent),mobile=ios||android||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent),mac=ios||/Mac/.test(platform),chromeOS=/\bCrOS\b/.test(userAgent),windows=/win/i.test(platform),presto_version=presto&&userAgent.match(/Version\/(\d*\.\d*)/);presto_version&&(presto_version=+presto_version[1]),presto_version&&15<=presto_version&&(presto=!1,webkit=!0);var flipCtrlCmd=mac&&(qtwebkit||presto&&(null==presto_version||12.11>presto_version)),captureRightClick=gecko||ie&&9<=ie_version,rmClass=function(node,cls){var current=node.className,match=classTest(cls).exec(current);if(match){var after=current.slice(match.index+match[0].length);node.className=current.slice(0,match.index)+(after?match[1]+after:"")}},range;range=document.createRange?function(node,start,end,endNode){var r=document.createRange();return r.setEnd(endNode||node,end),r.setStart(node,start),r}:function(node,start,end){var r=document.body.createTextRange();try{r.moveToElementText(node.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",end),r.moveStart("character",start),r};var selectInput=function(node){node.select()};ios?selectInput=function(node){node.selectionStart=0,node.selectionEnd=node.value.length}:ie&&(selectInput=function(node){try{node.select()}catch(_e){}});var Delayed=function(){this.id=null};Delayed.prototype.set=function(ms,f){clearTimeout(this.id),this.id=setTimeout(f,ms)};var scrollerGap=30,Pass={toString:function(){return"CodeMirror.Pass"}},sel_dontScroll={scroll:!1},sel_mouse={origin:"*mouse"},sel_move={origin:"+move"},spaceStrs=[""],nonASCIISingleCaseWordChar=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,extendingChars=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,sawReadOnlySpans=!1,sawCollapsedSpans=!1,bidiOther=null,bidiOrdering=function(){function charType(code){return 247>=code?lowTypes.charAt(code):1424<=code&&1524>=code?"R":1536<=code&&1785>=code?arabicTypes.charAt(code-1536):1774<=code&&2220>=code?"r":8192<=code&&8203>=code?"w":8204==code?"b":"L"}function BidiSpan(level,from,to){this.level=level,this.from=from,this.to=to}var lowTypes="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",arabicTypes="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",bidiRE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,isNeutral=/[stwN]/,isStrong=/[LRr]/,countsAsLeft=/[Lb1n]/,countsAsNum=/[1n]/;return function(str,direction){var outerType="ltr"==direction?"L":"R";if(0==str.length||"ltr"==direction&&!bidiRE.test(str))return!1;for(var len=str.length,types=[],i=0;i<len;++i)types.push(charType(str.charCodeAt(i)));for(var i$1=0,prev=outerType,type;i$1<len;++i$1)type=types[i$1],"m"==type?types[i$1]=prev:prev=type;for(var i$2=0,cur=outerType,type$1;i$2<len;++i$2)type$1=types[i$2],"1"==type$1&&"r"==cur?types[i$2]="n":isStrong.test(type$1)&&(cur=type$1,"r"==type$1&&(types[i$2]="R"));for(var i$3=1,prev$1=types[0],type$2;i$3<len-1;++i$3)type$2=types[i$3],"+"==type$2&&"1"==prev$1&&"1"==types[i$3+1]?types[i$3]="1":","==type$2&&prev$1==types[i$3+1]&&("1"==prev$1||"n"==prev$1)&&(types[i$3]=prev$1),prev$1=type$2;for(var i$4=0,type$3;i$4<len;++i$4)if(type$3=types[i$4],","==type$3)types[i$4]="N";else if("%"==type$3){var end=void 0;for(end=i$4+1;end<len&&"%"==types[end];++end);for(var replace=i$4&&"!"==types[i$4-1]||end<len&&"1"==types[end]?"1":"N",j=i$4;j<end;++j)types[j]=replace;i$4=end-1}for(var i$5=0,cur$1=outerType,type$4;i$5<len;++i$5)type$4=types[i$5],"L"==cur$1&&"1"==type$4?types[i$5]="L":isStrong.test(type$4)&&(cur$1=type$4);for(var i$6=0;i$6<len;++i$6)if(isNeutral.test(types[i$6])){var end$1=void 0;for(end$1=i$6+1;end$1<len&&isNeutral.test(types[end$1]);++end$1);for(var before="L"==(i$6?types[i$6-1]:outerType),after="L"==(end$1<len?types[end$1]:outerType),replace$1=before==after?before?"L":"R":outerType,j$1=i$6;j$1<end$1;++j$1)types[j$1]=replace$1;i$6=end$1-1}for(var order=[],i$7=0,m;i$7<len;)if(countsAsLeft.test(types[i$7])){var start=i$7;for(++i$7;i$7<len&&countsAsLeft.test(types[i$7]);++i$7);order.push(new BidiSpan(0,start,i$7))}else{var pos=i$7,at=order.length;for(++i$7;i$7<len&&"L"!=types[i$7];++i$7);for(var j$2=pos;j$2<i$7;)if(countsAsNum.test(types[j$2])){pos<j$2&&order.splice(at,0,new BidiSpan(1,pos,j$2));var nstart=j$2;for(++j$2;j$2<i$7&&countsAsNum.test(types[j$2]);++j$2);order.splice(at,0,new BidiSpan(2,nstart,j$2)),pos=j$2}else++j$2;pos<i$7&&order.splice(at,0,new BidiSpan(1,pos,i$7))}return"ltr"==direction&&(1==order[0].level&&(m=str.match(/^\s+/))&&(order[0].from=m[0].length,order.unshift(new BidiSpan(0,0,m[0].length))),1==lst(order).level&&(m=str.match(/\s+$/))&&(lst(order).to-=m[0].length,order.push(new BidiSpan(0,len-m[0].length,len)))),"rtl"==direction?order.reverse():order}}(),noHandlers=[],on=function(emitter,type,f){if(emitter.addEventListener)emitter.addEventListener(type,f,!1);else if(emitter.attachEvent)emitter.attachEvent("on"+type,f);else{var map$$1=emitter._handlers||(emitter._handlers={});map$$1[type]=(map$$1[type]||noHandlers).concat(f)}},dragAndDrop=function(){if(ie&&9>ie_version)return!1;var div=elt("div");return"draggable"in div||"dragDrop"in div}(),splitLinesAuto=3=="\n\nb".split(/\n/).length?function(string){return string.split(/\r\n?|\n/)}:function(string){for(var pos=0,result=[],l=string.length,nl;pos<=l;){nl=string.indexOf("\n",pos),-1==nl&&(nl=string.length);var line=string.slice(pos,"\r"==string.charAt(nl-1)?nl-1:nl),rt=line.indexOf("\r");-1==rt?(result.push(line),pos=nl+1):(result.push(line.slice(0,rt)),pos+=rt+1)}return result},hasSelection=window.getSelection?function(te){try{return te.selectionStart!=te.selectionEnd}catch(e){return!1}}:function(te){var range$$1;try{range$$1=te.ownerDocument.selection.createRange()}catch(e){}return range$$1&&range$$1.parentElement()==te&&0!=range$$1.compareEndPoints("StartToEnd",range$$1)},hasCopyEvent=function(){var e=elt("div");return!!("oncopy"in e)||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),badZoomedRects=null,modes={},mimeModes={},modeExtensions={},StringStream=function(string,tabSize,lineOracle){this.pos=this.start=0,this.string=string,this.tabSize=tabSize||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=lineOracle},zwspSupported,badBidiRects;StringStream.prototype.eol=function(){return this.pos>=this.string.length},StringStream.prototype.sol=function(){return this.pos==this.lineStart},StringStream.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},StringStream.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},StringStream.prototype.eat=function(match){var ch=this.string.charAt(this.pos),ok;if(ok="string"==typeof match?ch==match:ch&&(match.test?match.test(ch):match(ch)),ok)return++this.pos,ch},StringStream.prototype.eatWhile=function(match){for(var start=this.pos;this.eat(match););return this.pos>start},StringStream.prototype.eatSpace=function(){for(var this$1=this,start=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this$1.pos;return this.pos>start},StringStream.prototype.skipToEnd=function(){this.pos=this.string.length},StringStream.prototype.skipTo=function(ch){var found=this.string.indexOf(ch,this.pos);if(-1<found)return this.pos=found,!0},StringStream.prototype.backUp=function(n){this.pos-=n},StringStream.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=countColumn(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},StringStream.prototype.indentation=function(){return countColumn(this.string,null,this.tabSize)-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},StringStream.prototype.match=function(pattern,consume,caseInsensitive){if("string"==typeof pattern){var cased=function(str){return caseInsensitive?str.toLowerCase():str},substr=this.string.substr(this.pos,pattern.length);if(cased(substr)==cased(pattern))return!1!==consume&&(this.pos+=pattern.length),!0}else{var match=this.string.slice(this.pos).match(pattern);return match&&0<match.index?null:(match&&!1!==consume&&(this.pos+=match[0].length),match)}},StringStream.prototype.current=function(){return this.string.slice(this.start,this.pos)},StringStream.prototype.hideFirstChars=function(n,inner){this.lineStart+=n;try{return inner()}finally{this.lineStart-=n}},StringStream.prototype.lookAhead=function(n){var oracle=this.lineOracle;return oracle&&oracle.lookAhead(n)},StringStream.prototype.baseToken=function(){var oracle=this.lineOracle;return oracle&&oracle.baseToken(this.pos)};var SavedContext=function(state,lookAhead){this.state=state,this.lookAhead=lookAhead},Context=function(doc,state,line,lookAhead){this.state=state,this.doc=doc,this.line=line,this.maxLookAhead=lookAhead||0,this.baseTokens=null,this.baseTokenPos=1};Context.prototype.lookAhead=function(n){var line=this.doc.getLine(this.line+n);return null!=line&&n>this.maxLookAhead&&(this.maxLookAhead=n),line},Context.prototype.baseToken=function(n){var this$1=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=n;)this$1.baseTokenPos+=2;var type=this.baseTokens[this.baseTokenPos+1];return{type:type&&type.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-n}},Context.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},Context.fromSaved=function(doc,saved,line){return saved instanceof SavedContext?new Context(doc,copyState(doc.mode,saved.state),line,saved.lookAhead):new Context(doc,copyState(doc.mode,saved),line)},Context.prototype.save=function(copy){var state=!1===copy?this.state:copyState(this.doc.mode,this.state);return 0<this.maxLookAhead?new SavedContext(state,this.maxLookAhead):state};var Token=function(stream,type,state){this.start=stream.start,this.end=stream.pos,this.string=stream.current(),this.type=type||null,this.state=state},Line=function(text,markedSpans,estimateHeight){this.text=text,attachMarkedSpans(this,markedSpans),this.height=estimateHeight?estimateHeight(this):1};Line.prototype.lineNo=function(){return lineNo(this)},eventMixin(Line);var styleToClassCache={},styleToClassCacheWithMode={},operationGroup=null,orphanDelayedCallbacks=null,nullRect={left:0,right:0,top:0,bottom:0},NativeScrollbars=function(place,scroll,cm){this.cm=cm;var vert=this.vert=elt("div",[elt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),horiz=this.horiz=elt("div",[elt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");vert.tabIndex=horiz.tabIndex=-1,place(vert),place(horiz),on(vert,"scroll",function(){vert.clientHeight&&scroll(vert.scrollTop,"vertical")}),on(horiz,"scroll",function(){horiz.clientWidth&&scroll(horiz.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ie&&8>ie_version&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")},measureText;NativeScrollbars.prototype.update=function(measure){var needsH=measure.scrollWidth>measure.clientWidth+1,needsV=measure.scrollHeight>measure.clientHeight+1,sWidth=measure.nativeBarWidth;if(needsV){this.vert.style.display="block",this.vert.style.bottom=needsH?sWidth+"px":"0";var totalHeight=measure.viewHeight-(needsH?sWidth:0);this.vert.firstChild.style.height=_Mathmax5(0,measure.scrollHeight-measure.clientHeight+totalHeight)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(needsH){this.horiz.style.display="block",this.horiz.style.right=needsV?sWidth+"px":"0",this.horiz.style.left=measure.barLeft+"px";var totalWidth=measure.viewWidth-measure.barLeft-(needsV?sWidth:0);this.horiz.firstChild.style.width=_Mathmax5(0,measure.scrollWidth-measure.clientWidth+totalWidth)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&0<measure.clientHeight&&(0==sWidth&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:needsV?sWidth:0,bottom:needsH?sWidth:0}},NativeScrollbars.prototype.setScrollLeft=function(pos){this.horiz.scrollLeft!=pos&&(this.horiz.scrollLeft=pos),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},NativeScrollbars.prototype.setScrollTop=function(pos){this.vert.scrollTop!=pos&&(this.vert.scrollTop=pos),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},NativeScrollbars.prototype.zeroWidthHack=function(){var w=mac&&!mac_geMountainLion?"12px":"18px";this.horiz.style.height=this.vert.style.width=w,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Delayed,this.disableVert=new Delayed},NativeScrollbars.prototype.enableZeroWidthBar=function(bar,delay,type){function maybeDisable(){var box=bar.getBoundingClientRect(),elt$$1="vert"==type?document.elementFromPoint(box.right-1,(box.top+box.bottom)/2):document.elementFromPoint((box.right+box.left)/2,box.bottom-1);elt$$1==bar?delay.set(1e3,maybeDisable):bar.style.pointerEvents="none"}bar.style.pointerEvents="auto",delay.set(1e3,maybeDisable)},NativeScrollbars.prototype.clear=function(){var parent=this.horiz.parentNode;parent.removeChild(this.horiz),parent.removeChild(this.vert)};var NullScrollbars=function(){};NullScrollbars.prototype.update=function(){return{bottom:0,right:0}},NullScrollbars.prototype.setScrollLeft=function(){},NullScrollbars.prototype.setScrollTop=function(){},NullScrollbars.prototype.clear=function(){};var scrollbarModel={native:NativeScrollbars,null:NullScrollbars},nextOpId=0,DisplayUpdate=function(cm,viewport,force){var display=cm.display;this.viewport=viewport,this.visible=visibleLines(display,cm.doc,viewport),this.editorIsHidden=!display.wrapper.offsetWidth,this.wrapperHeight=display.wrapper.clientHeight,this.wrapperWidth=display.wrapper.clientWidth,this.oldDisplayWidth=displayWidth(cm),this.force=force,this.dims=getDimensions(cm),this.events=[]};DisplayUpdate.prototype.signal=function(emitter,type){hasHandler(emitter,type)&&this.events.push(arguments)},DisplayUpdate.prototype.finish=function(){for(var this$1=this,i=0;i<this.events.length;i++)signal.apply(null,this$1.events[i])};var wheelSamples=0,wheelPixelsPerUnit=null;ie?wheelPixelsPerUnit=-.53:gecko?wheelPixelsPerUnit=15:chrome?wheelPixelsPerUnit=-.7:safari&&(wheelPixelsPerUnit=-1/3);var Selection=function(ranges,primIndex){this.ranges=ranges,this.primIndex=primIndex};Selection.prototype.primary=function(){return this.ranges[this.primIndex]},Selection.prototype.equals=function(other){var this$1=this;if(other==this)return!0;if(other.primIndex!=this.primIndex||other.ranges.length!=this.ranges.length)return!1;for(var i=0;i<this.ranges.length;i++){var here=this$1.ranges[i],there=other.ranges[i];if(!equalCursorPos(here.anchor,there.anchor)||!equalCursorPos(here.head,there.head))return!1}return!0},Selection.prototype.deepCopy=function(){for(var this$1=this,out=[],i=0;i<this.ranges.length;i++)out[i]=new Range(copyPos(this$1.ranges[i].anchor),copyPos(this$1.ranges[i].head));return new Selection(out,this.primIndex)},Selection.prototype.somethingSelected=function(){for(var this$1=this,i=0;i<this.ranges.length;i++)if(!this$1.ranges[i].empty())return!0;return!1},Selection.prototype.contains=function(pos,end){var this$1=this;end||(end=pos);for(var i=0,range;i<this.ranges.length;i++)if(range=this$1.ranges[i],0<=cmp(end,range.from())&&0>=cmp(pos,range.to()))return i;return-1};var Range=function(anchor,head){this.anchor=anchor,this.head=head};Range.prototype.from=function(){return minPos(this.anchor,this.head)},Range.prototype.to=function(){return maxPos(this.anchor,this.head)},Range.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},LeafChunk.prototype={chunkSize:function(){return this.lines.length},removeInner:function(at,n){for(var this$1=this,i=at,line;i<at+n;++i)line=this$1.lines[i],this$1.height-=line.height,cleanUpLine(line),signalLater(line,"delete");this.lines.splice(at,n)},collapse:function(lines){lines.push.apply(lines,this.lines)},insertInner:function(at,lines,height){var this$1=this;this.height+=height,this.lines=this.lines.slice(0,at).concat(lines).concat(this.lines.slice(at));for(var i=0;i<lines.length;++i)lines[i].parent=this$1},iterN:function(at,n,op){for(var this$1=this,e=at+n;at<e;++at)if(op(this$1.lines[at]))return!0}},BranchChunk.prototype={chunkSize:function(){return this.size},removeInner:function(at,n){var this$1=this;this.size-=n;for(var i=0;i<this.children.length;++i){var child=this$1.children[i],sz=child.chunkSize();if(at<sz){var rm=_Mathmin6(n,sz-at),oldHeight=child.height;if(child.removeInner(at,rm),this$1.height-=oldHeight-child.height,sz==rm&&(this$1.children.splice(i--,1),child.parent=null),0==(n-=rm))break;at=0}else at-=sz}if(25>this.size-n&&(1<this.children.length||!(this.children[0]instanceof LeafChunk))){var lines=[];this.collapse(lines),this.children=[new LeafChunk(lines)],this.children[0].parent=this}},collapse:function(lines){for(var this$1=this,i=0;i<this.children.length;++i)this$1.children[i].collapse(lines)},insertInner:function(at,lines,height){var this$1=this;this.size+=lines.length,this.height+=height;for(var i=0;i<this.children.length;++i){var child=this$1.children[i],sz=child.chunkSize();if(at<=sz){if(child.insertInner(at,lines,height),child.lines&&50<child.lines.length){for(var remaining=child.lines.length%25+25,pos=remaining,leaf;pos<child.lines.length;)leaf=new LeafChunk(child.lines.slice(pos,pos+=25)),child.height-=leaf.height,this$1.children.splice(++i,0,leaf),leaf.parent=this$1;child.lines=child.lines.slice(0,remaining),this$1.maybeSpill()}break}at-=sz}},maybeSpill:function(){if(!(10>=this.children.length)){var me=this;do{var spilled=me.children.splice(me.children.length-5,5),sibling=new BranchChunk(spilled);if(!me.parent){var copy=new BranchChunk(me.children);copy.parent=me,me.children=[copy,sibling],me=copy}else{me.size-=sibling.size,me.height-=sibling.height;var myIndex=indexOf(me.parent.children,me);me.parent.children.splice(myIndex+1,0,sibling)}sibling.parent=me.parent}while(10<me.children.length);me.parent.maybeSpill()}},iterN:function(at,n,op){for(var this$1=this,i=0;i<this.children.length;++i){var child=this$1.children[i],sz=child.chunkSize();if(at<sz){var used=_Mathmin6(n,sz-at);if(child.iterN(at,used,op))return!0;if(0==(n-=used))break;at=0}else at-=sz}}};var LineWidget=function(doc,node,options){var this$1=this;if(options)for(var opt in options)options.hasOwnProperty(opt)&&(this$1[opt]=options[opt]);this.doc=doc,this.node=node};LineWidget.prototype.clear=function(){var this$1=this,cm=this.doc.cm,ws=this.line.widgets,line=this.line,no=lineNo(line);if(null!=no&&ws){for(var i=0;i<ws.length;++i)ws[i]==this$1&&ws.splice(i--,1);ws.length||(line.widgets=null);var height=widgetHeight(this);updateLineHeight(line,_Mathmax5(0,line.height-height)),cm&&(runInOp(cm,function(){adjustScrollWhenAboveVisible(cm,line,-height),regLineChange(cm,no,"widget")}),signalLater(cm,"lineWidgetCleared",cm,this,no))}},LineWidget.prototype.changed=function(){var this$1=this,oldH=this.height,cm=this.doc.cm,line=this.line;this.height=null;var diff=widgetHeight(this)-oldH;diff&&(updateLineHeight(line,line.height+diff),cm&&runInOp(cm,function(){cm.curOp.forceUpdate=!0,adjustScrollWhenAboveVisible(cm,line,diff),signalLater(cm,"lineWidgetChanged",cm,this$1,lineNo(line))}))},eventMixin(LineWidget);var nextMarkerId=0,TextMarker=function(doc,type){this.lines=[],this.type=type,this.doc=doc,this.id=++nextMarkerId};TextMarker.prototype.clear=function(){var this$1=this;if(!this.explicitlyCleared){var cm=this.doc.cm,withOp=cm&&!cm.curOp;if(withOp&&_startOperation(cm),hasHandler(this,"clear")){var found=this.find();found&&signalLater(this,"clear",found.from,found.to)}for(var min=null,max=null,i=0;i<this.lines.length;++i){var line=this$1.lines[i],span=getMarkedSpanFor(line.markedSpans,this$1);cm&&!this$1.collapsed?regLineChange(cm,lineNo(line),"text"):cm&&(null!=span.to&&(max=lineNo(line)),null!=span.from&&(min=lineNo(line))),line.markedSpans=removeMarkedSpan(line.markedSpans,span),null==span.from&&this$1.collapsed&&!lineIsHidden(this$1.doc,line)&&cm&&updateLineHeight(line,textHeight(cm.display))}if(cm&&this.collapsed&&!cm.options.lineWrapping)for(var i$1=0;i$1<this.lines.length;++i$1){var visual=visualLine(this$1.lines[i$1]),len=lineLength(visual);len>cm.display.maxLineLength&&(cm.display.maxLine=visual,cm.display.maxLineLength=len,cm.display.maxLineChanged=!0)}null!=min&&cm&&this.collapsed&®Change(cm,min,max+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,cm&&reCheckSelection(cm.doc)),cm&&signalLater(cm,"markerCleared",cm,this,min,max),withOp&&_endOperation(cm),this.parent&&this.parent.clear()}},TextMarker.prototype.find=function(side,lineObj){var this$1=this;null==side&&"bookmark"==this.type&&(side=1);for(var i=0,from,to;i<this.lines.length;++i){var line=this$1.lines[i],span=getMarkedSpanFor(line.markedSpans,this$1);if(null!=span.from&&(from=Pos(lineObj?line:lineNo(line),span.from),-1==side))return from;if(null!=span.to&&(to=Pos(lineObj?line:lineNo(line),span.to),1==side))return to}return from&&{from:from,to:to}},TextMarker.prototype.changed=function(){var this$1=this,pos=this.find(-1,!0),widget=this,cm=this.doc.cm;pos&&cm&&runInOp(cm,function(){var line=pos.line,lineN=lineNo(pos.line),view=findViewForLine(cm,lineN);if(view&&(clearLineMeasurementCacheFor(view),cm.curOp.selectionChanged=cm.curOp.forceUpdate=!0),cm.curOp.updateMaxLine=!0,!lineIsHidden(widget.doc,line)&&null!=widget.height){var oldHeight=widget.height;widget.height=null;var dHeight=widgetHeight(widget)-oldHeight;dHeight&&updateLineHeight(line,line.height+dHeight)}signalLater(cm,"markerChanged",cm,this$1)})},TextMarker.prototype.attachLine=function(line){if(!this.lines.length&&this.doc.cm){var op=this.doc.cm.curOp;op.maybeHiddenMarkers&&-1!=indexOf(op.maybeHiddenMarkers,this)||(op.maybeUnhiddenMarkers||(op.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(line)},TextMarker.prototype.detachLine=function(line){if(this.lines.splice(indexOf(this.lines,line),1),!this.lines.length&&this.doc.cm){var op=this.doc.cm.curOp;(op.maybeHiddenMarkers||(op.maybeHiddenMarkers=[])).push(this)}},eventMixin(TextMarker);var SharedTextMarker=function(markers,primary){var this$1=this;this.markers=markers,this.primary=primary;for(var i=0;i<markers.length;++i)markers[i].parent=this$1};SharedTextMarker.prototype.clear=function(){var this$1=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var i=0;i<this.markers.length;++i)this$1.markers[i].clear();signalLater(this,"clear")}},SharedTextMarker.prototype.find=function(side,lineObj){return this.primary.find(side,lineObj)},eventMixin(SharedTextMarker);var nextDocId=0,Doc=function Doc(text,mode,firstLine,lineSep,direction){if(!(this instanceof Doc))return new Doc(text,mode,firstLine,lineSep,direction);null==firstLine&&(firstLine=0),BranchChunk.call(this,[new LeafChunk([new Line("",null)])]),this.first=firstLine,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=firstLine;var start=Pos(firstLine,0);this.sel=simpleSelection(start),this.history=new History(null),this.id=++nextDocId,this.modeOption=mode,this.lineSep=lineSep,this.direction="rtl"==direction?"rtl":"ltr",this.extend=!1,"string"==typeof text&&(text=this.splitLines(text)),updateDoc(this,{from:start,to:start,text:text}),setSelection(this,simpleSelection(start),sel_dontScroll)};Doc.prototype=createObj(BranchChunk.prototype,{constructor:Doc,iter:function(from,to,op){op?this.iterN(from-this.first,to-from,op):this.iterN(this.first,this.first+this.size,from)},insert:function(at,lines){for(var height=0,i=0;i<lines.length;++i)height+=lines[i].height;this.insertInner(at-this.first,lines,height)},remove:function(at,n){this.removeInner(at-this.first,n)},getValue:function(lineSep){var lines=getLines(this,this.first,this.first+this.size);return!1===lineSep?lines:lines.join(lineSep||this.lineSeparator())},setValue:docMethodOp(function(code){var top=Pos(this.first,0),last=this.first+this.size-1;makeChange(this,{from:top,to:Pos(last,getLine(this,last).text.length),text:this.splitLines(code),origin:"setValue",full:!0},!0),this.cm&&scrollToCoords(this.cm,0,0),setSelection(this,simpleSelection(top),sel_dontScroll)}),replaceRange:function(code,from,to,origin){from=_clipPos(this,from),to=to?_clipPos(this,to):from,_replaceRange(this,code,from,to,origin)},getRange:function(from,to,lineSep){var lines=getBetween(this,_clipPos(this,from),_clipPos(this,to));return!1===lineSep?lines:lines.join(lineSep||this.lineSeparator())},getLine:function(line){var l=this.getLineHandle(line);return l&&l.text},getLineHandle:function(line){if(isLine(this,line))return getLine(this,line)},getLineNumber:function(line){return lineNo(line)},getLineHandleVisualStart:function(line){return"number"==typeof line&&(line=getLine(this,line)),visualLine(line)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(pos){return _clipPos(this,pos)},getCursor:function(start){var range$$1=this.sel.primary(),pos;return pos=null==start||"head"==start?range$$1.head:"anchor"==start?range$$1.anchor:"end"==start||"to"==start||!1===start?range$$1.to():range$$1.from(),pos},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:docMethodOp(function(line,ch,options){setSimpleSelection(this,_clipPos(this,"number"==typeof line?Pos(line,ch||0):line),null,options)}),setSelection:docMethodOp(function(anchor,head,options){setSimpleSelection(this,_clipPos(this,anchor),_clipPos(this,head||anchor),options)}),extendSelection:docMethodOp(function(head,other,options){extendSelection(this,_clipPos(this,head),other&&_clipPos(this,other),options)}),extendSelections:docMethodOp(function(heads,options){extendSelections(this,clipPosArray(this,heads),options)}),extendSelectionsBy:docMethodOp(function(f,options){var heads=map(this.sel.ranges,f);extendSelections(this,clipPosArray(this,heads),options)}),setSelections:docMethodOp(function(ranges,primary,options){var this$1=this;if(ranges.length){for(var out=[],i=0;i<ranges.length;i++)out[i]=new Range(_clipPos(this$1,ranges[i].anchor),_clipPos(this$1,ranges[i].head));null==primary&&(primary=_Mathmin6(ranges.length-1,this.sel.primIndex)),setSelection(this,normalizeSelection(out,primary),options)}}),addSelection:docMethodOp(function(anchor,head,options){var ranges=this.sel.ranges.slice(0);ranges.push(new Range(_clipPos(this,anchor),_clipPos(this,head||anchor))),setSelection(this,normalizeSelection(ranges,ranges.length-1),options)}),getSelection:function(lineSep){for(var this$1=this,ranges=this.sel.ranges,i=0,lines,sel;i<ranges.length;i++)sel=getBetween(this$1,ranges[i].from(),ranges[i].to()),lines=lines?lines.concat(sel):sel;return!1===lineSep?lines:lines.join(lineSep||this.lineSeparator())},getSelections:function(lineSep){for(var this$1=this,parts=[],ranges=this.sel.ranges,i=0,sel;i<ranges.length;i++)sel=getBetween(this$1,ranges[i].from(),ranges[i].to()),!1!==lineSep&&(sel=sel.join(lineSep||this$1.lineSeparator())),parts[i]=sel;return parts},replaceSelection:function(code,collapse,origin){for(var dup=[],i=0;i<this.sel.ranges.length;i++)dup[i]=code;this.replaceSelections(dup,collapse,origin||"+input")},replaceSelections:docMethodOp(function(code,collapse,origin){for(var this$1=this,changes=[],sel=this.sel,i=0,range$$1;i<sel.ranges.length;i++)range$$1=sel.ranges[i],changes[i]={from:range$$1.from(),to:range$$1.to(),text:this$1.splitLines(code[i]),origin:origin};for(var newSel=collapse&&"end"!=collapse&&computeReplacedSel(this,changes,collapse),i$1=changes.length-1;0<=i$1;i$1--)makeChange(this$1,changes[i$1]);newSel?setSelectionReplaceHistory(this,newSel):this.cm&&ensureCursorVisible(this.cm)}),undo:docMethodOp(function(){makeChangeFromHistory(this,"undo")}),redo:docMethodOp(function(){makeChangeFromHistory(this,"redo")}),undoSelection:docMethodOp(function(){makeChangeFromHistory(this,"undo",!0)}),redoSelection:docMethodOp(function(){makeChangeFromHistory(this,"redo",!0)}),setExtending:function(val){this.extend=val},getExtending:function(){return this.extend},historySize:function(){for(var hist=this.history,done=0,undone=0,i=0;i<hist.done.length;i++)hist.done[i].ranges||++done;for(var i$1=0;i$1<hist.undone.length;i$1++)hist.undone[i$1].ranges||++undone;return{undo:done,redo:undone}},clearHistory:function(){this.history=new History(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(forceSplit){return forceSplit&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(gen){return this.history.generation==(gen||this.cleanGeneration)},getHistory:function(){return{done:copyHistoryArray(this.history.done),undone:copyHistoryArray(this.history.undone)}},setHistory:function(histData){var hist=this.history=new History(this.history.maxGeneration);hist.done=copyHistoryArray(histData.done.slice(0),null,!0),hist.undone=copyHistoryArray(histData.undone.slice(0),null,!0)},setGutterMarker:docMethodOp(function(line,gutterID,value){return changeLine(this,line,"gutter",function(line){var markers=line.gutterMarkers||(line.gutterMarkers={});return markers[gutterID]=value,!value&&isEmpty(markers)&&(line.gutterMarkers=null),!0})}),clearGutter:docMethodOp(function(gutterID){var this$1=this;this.iter(function(line){line.gutterMarkers&&line.gutterMarkers[gutterID]&&changeLine(this$1,line,"gutter",function(){return line.gutterMarkers[gutterID]=null,isEmpty(line.gutterMarkers)&&(line.gutterMarkers=null),!0})})}),lineInfo:function(line){var n;if("number"==typeof line){if(!isLine(this,line))return null;if(n=line,line=getLine(this,line),!line)return null}else if(n=lineNo(line),null==n)return null;return{line:n,handle:line,text:line.text,gutterMarkers:line.gutterMarkers,textClass:line.textClass,bgClass:line.bgClass,wrapClass:line.wrapClass,widgets:line.widgets}},addLineClass:docMethodOp(function(handle,where,cls){return changeLine(this,handle,"gutter"==where?"gutter":"class",function(line){var prop="text"==where?"textClass":"background"==where?"bgClass":"gutter"==where?"gutterClass":"wrapClass";if(!line[prop])line[prop]=cls;else{if(classTest(cls).test(line[prop]))return!1;line[prop]+=" "+cls}return!0})}),removeLineClass:docMethodOp(function(handle,where,cls){return changeLine(this,handle,"gutter"==where?"gutter":"class",function(line){var prop="text"==where?"textClass":"background"==where?"bgClass":"gutter"==where?"gutterClass":"wrapClass",cur=line[prop];if(!cur)return!1;if(null==cls)line[prop]=null;else{var found=cur.match(classTest(cls));if(!found)return!1;var end=found.index+found[0].length;line[prop]=cur.slice(0,found.index)+(found.index&&end!=cur.length?" ":"")+cur.slice(end)||null}return!0})}),addLineWidget:docMethodOp(function(handle,node,options){return addLineWidget(this,handle,node,options)}),removeLineWidget:function(widget){widget.clear()},markText:function(from,to,options){return _markText(this,_clipPos(this,from),_clipPos(this,to),options,options&&options.type||"range")},setBookmark:function(pos,options){var realOpts={replacedWith:options&&(null==options.nodeType?options.widget:options),insertLeft:options&&options.insertLeft,clearWhenEmpty:!1,shared:options&&options.shared,handleMouseEvents:options&&options.handleMouseEvents};return pos=_clipPos(this,pos),_markText(this,pos,pos,realOpts,"bookmark")},findMarksAt:function(pos){pos=_clipPos(this,pos);var markers=[],spans=getLine(this,pos.line).markedSpans;if(spans)for(var i=0,span;i<spans.length;++i)span=spans[i],(null==span.from||span.from<=pos.ch)&&(null==span.to||span.to>=pos.ch)&&markers.push(span.marker.parent||span.marker);return markers},findMarks:function(from,to,filter){from=_clipPos(this,from),to=_clipPos(this,to);var found=[],lineNo$$1=from.line;return this.iter(from.line,to.line+1,function(line){var spans=line.markedSpans;if(spans)for(var i=0,span;i<spans.length;i++)span=spans[i],null!=span.to&&lineNo$$1==from.line&&from.ch>=span.to||null==span.from&&lineNo$$1!=from.line||null!=span.from&&lineNo$$1==to.line&&span.from>=to.ch||filter&&!filter(span.marker)||found.push(span.marker.parent||span.marker);++lineNo$$1}),found},getAllMarks:function(){var markers=[];return this.iter(function(line){var sps=line.markedSpans;if(sps)for(var i=0;i<sps.length;++i)null!=sps[i].from&&markers.push(sps[i].marker)}),markers},posFromIndex:function(off){var lineNo$$1=this.first,sepSize=this.lineSeparator().length,ch;return this.iter(function(line){var sz=line.text.length+sepSize;return sz>off?(ch=off,!0):void(off-=sz,++lineNo$$1)}),_clipPos(this,Pos(lineNo$$1,ch))},indexFromPos:function(coords){coords=_clipPos(this,coords);var index=coords.ch;if(coords.line<this.first||0>coords.ch)return 0;var sepSize=this.lineSeparator().length;return this.iter(this.first,coords.line,function(line){index+=line.text.length+sepSize}),index},copy:function(copyHistory){var doc=new Doc(getLines(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return doc.scrollTop=this.scrollTop,doc.scrollLeft=this.scrollLeft,doc.sel=this.sel,doc.extend=!1,copyHistory&&(doc.history.undoDepth=this.history.undoDepth,doc.setHistory(this.getHistory())),doc},linkedDoc:function(options){options||(options={});var from=this.first,to=this.first+this.size;null!=options.from&&options.from>from&&(from=options.from),null!=options.to&&options.to<to&&(to=options.to);var copy=new Doc(getLines(this,from,to),options.mode||this.modeOption,from,this.lineSep,this.direction);return options.sharedHist&&(copy.history=this.history),(this.linked||(this.linked=[])).push({doc:copy,sharedHist:options.sharedHist}),copy.linked=[{doc:this,isParent:!0,sharedHist:options.sharedHist}],copySharedMarkers(copy,findSharedMarkers(this)),copy},unlinkDoc:function(other){var this$1=this;if(other instanceof CodeMirror$1&&(other=other.doc),this.linked)for(var i=0,link;i<this.linked.length;++i)if(link=this$1.linked[i],link.doc==other){this$1.linked.splice(i,1),other.unlinkDoc(this$1),detachSharedMarkers(findSharedMarkers(this$1));break}if(other.history==this.history){var splitIds=[other.id];linkedDocs(other,function(doc){return splitIds.push(doc.id)},!0),other.history=new History(null),other.history.done=copyHistoryArray(this.history.done,splitIds),other.history.undone=copyHistoryArray(this.history.undone,splitIds)}},iterLinkedDocs:function(f){linkedDocs(this,f)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(str){return this.lineSep?str.split(this.lineSep):splitLinesAuto(str)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:docMethodOp(function(dir){"rtl"!=dir&&(dir="ltr"),dir==this.direction||(this.direction=dir,this.iter(function(line){return line.order=null}),this.cm&&directionChanged(this.cm))})}),Doc.prototype.eachLine=Doc.prototype.iter;for(var lastDrop=0,globalsRegistered=!1,keyNames={3:"Pause",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",145:"ScrollLock",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"},i=0;10>i;i++)keyNames[i+48]=keyNames[i+96]=i+"";for(var i$1=65;90>=i$1;i$1++)keyNames[i$1]=_StringfromCharCode7(i$1);for(var i$2=1;12>=i$2;i$2++)keyNames[i$2+111]=keyNames[i$2+63235]="F"+i$2;var keyMap={};keyMap.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},keyMap.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},keyMap.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},keyMap.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},keyMap["default"]=mac?keyMap.macDefault:keyMap.pcDefault;var commands={selectAll:selectAll,singleSelection:function(cm){return cm.setSelection(cm.getCursor("anchor"),cm.getCursor("head"),sel_dontScroll)},killLine:function(cm){return deleteNearSelection(cm,function(range){if(range.empty()){var len=getLine(cm.doc,range.head.line).text.length;return range.head.ch==len&&range.head.line<cm.lastLine()?{from:range.head,to:Pos(range.head.line+1,0)}:{from:range.head,to:Pos(range.head.line,len)}}return{from:range.from(),to:range.to()}})},deleteLine:function(cm){return deleteNearSelection(cm,function(range){return{from:Pos(range.from().line,0),to:_clipPos(cm.doc,Pos(range.to().line+1,0))}})},delLineLeft:function(cm){return deleteNearSelection(cm,function(range){return{from:Pos(range.from().line,0),to:range.from()}})},delWrappedLineLeft:function(cm){return deleteNearSelection(cm,function(range){var top=cm.charCoords(range.head,"div").top+5,leftPos=cm.coordsChar({left:0,top:top},"div");return{from:leftPos,to:range.from()}})},delWrappedLineRight:function(cm){return deleteNearSelection(cm,function(range){var top=cm.charCoords(range.head,"div").top+5,rightPos=cm.coordsChar({left:cm.display.lineDiv.offsetWidth+100,top:top},"div");return{from:range.from(),to:rightPos}})},undo:function(cm){return cm.undo()},redo:function(cm){return cm.redo()},undoSelection:function(cm){return cm.undoSelection()},redoSelection:function(cm){return cm.redoSelection()},goDocStart:function(cm){return cm.extendSelection(Pos(cm.firstLine(),0))},goDocEnd:function(cm){return cm.extendSelection(Pos(cm.lastLine()))},goLineStart:function(cm){return cm.extendSelectionsBy(function(range){return lineStart(cm,range.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(cm){return cm.extendSelectionsBy(function(range){return lineStartSmart(cm,range.head)},{origin:"+move",bias:1})},goLineEnd:function(cm){return cm.extendSelectionsBy(function(range){return lineEnd(cm,range.head.line)},{origin:"+move",bias:-1})},goLineRight:function(cm){return cm.extendSelectionsBy(function(range){var top=cm.cursorCoords(range.head,"div").top+5;return cm.coordsChar({left:cm.display.lineDiv.offsetWidth+100,top:top},"div")},sel_move)},goLineLeft:function(cm){return cm.extendSelectionsBy(function(range){var top=cm.cursorCoords(range.head,"div").top+5;return cm.coordsChar({left:0,top:top},"div")},sel_move)},goLineLeftSmart:function(cm){return cm.extendSelectionsBy(function(range){var top=cm.cursorCoords(range.head,"div").top+5,pos=cm.coordsChar({left:0,top:top},"div");return pos.ch<cm.getLine(pos.line).search(/\S/)?lineStartSmart(cm,range.head):pos},sel_move)},goLineUp:function(cm){return cm.moveV(-1,"line")},goLineDown:function(cm){return cm.moveV(1,"line")},goPageUp:function(cm){return cm.moveV(-1,"page")},goPageDown:function(cm){return cm.moveV(1,"page")},goCharLeft:function(cm){return cm.moveH(-1,"char")},goCharRight:function(cm){return cm.moveH(1,"char")},goColumnLeft:function(cm){return cm.moveH(-1,"column")},goColumnRight:function(cm){return cm.moveH(1,"column")},goWordLeft:function(cm){return cm.moveH(-1,"word")},goGroupRight:function(cm){return cm.moveH(1,"group")},goGroupLeft:function(cm){return cm.moveH(-1,"group")},goWordRight:function(cm){return cm.moveH(1,"word")},delCharBefore:function(cm){return cm.deleteH(-1,"char")},delCharAfter:function(cm){return cm.deleteH(1,"char")},delWordBefore:function(cm){return cm.deleteH(-1,"word")},delWordAfter:function(cm){return cm.deleteH(1,"word")},delGroupBefore:function(cm){return cm.deleteH(-1,"group")},delGroupAfter:function(cm){return cm.deleteH(1,"group")},indentAuto:function(cm){return cm.indentSelection("smart")},indentMore:function(cm){return cm.indentSelection("add")},indentLess:function(cm){return cm.indentSelection("subtract")},insertTab:function(cm){return cm.replaceSelection("\t")},insertSoftTab:function(cm){for(var spaces=[],ranges=cm.listSelections(),tabSize=cm.options.tabSize,i=0;i<ranges.length;i++){var pos=ranges[i].from(),col=countColumn(cm.getLine(pos.line),pos.ch,tabSize);spaces.push(spaceStr(tabSize-col%tabSize))}cm.replaceSelections(spaces)},defaultTab:function(cm){cm.somethingSelected()?cm.indentSelection("add"):cm.execCommand("insertTab")},transposeChars:function(cm){return runInOp(cm,function(){for(var ranges=cm.listSelections(),newSel=[],i=0;i<ranges.length;i++)if(ranges[i].empty()){var cur=ranges[i].head,line=getLine(cm.doc,cur.line).text;if(line)if(cur.ch==line.length&&(cur=new Pos(cur.line,cur.ch-1)),0<cur.ch)cur=new Pos(cur.line,cur.ch+1),cm.replaceRange(line.charAt(cur.ch-1)+line.charAt(cur.ch-2),Pos(cur.line,cur.ch-2),cur,"+transpose");else if(cur.line>cm.doc.first){var prev=getLine(cm.doc,cur.line-1).text;prev&&(cur=new Pos(cur.line,1),cm.replaceRange(line.charAt(0)+cm.doc.lineSeparator()+prev.charAt(prev.length-1),Pos(cur.line-1,prev.length-1),cur,"+transpose"))}newSel.push(new Range(cur,cur))}cm.setSelections(newSel)})},newlineAndIndent:function(cm){return runInOp(cm,function(){for(var sels=cm.listSelections(),i=sels.length-1;0<=i;i--)cm.replaceRange(cm.doc.lineSeparator(),sels[i].anchor,sels[i].head,"+input");sels=cm.listSelections();for(var i$1=0;i$1<sels.length;i$1++)cm.indentLine(sels[i$1].from().line,null,!0);ensureCursorVisible(cm)})},openLine:function(cm){return cm.replaceSelection("\n","start")},toggleOverwrite:function(cm){return cm.toggleOverwrite()}},stopSeq=new Delayed,lastStoppedKey=null,PastClick=function(time,pos,button){this.time=time,this.pos=pos,this.button=button};PastClick.prototype.compare=function(time,pos,button){return this.time+400>time&&0==cmp(pos,this.pos)&&button==this.button};var Init={toString:function(){return"CodeMirror.Init"}},defaults={},optionHandlers={},lastClick,lastDoubleClick;CodeMirror$1.defaults=defaults,CodeMirror$1.optionHandlers=optionHandlers;var initHooks=[];CodeMirror$1.defineInitHook=function(f){return initHooks.push(f)};var lastCopied=null,ContentEditableInput=function(cm){this.cm=cm,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Delayed,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ContentEditableInput.prototype.init=function(display){function onCopyCut(e){if(!signalDOMEvent(cm,e)){if(cm.somethingSelected())setLastCopied({lineWise:!1,text:cm.getSelections()}),"cut"==e.type&&cm.replaceSelection("",null,"cut");else{if(!cm.options.lineWiseCopyCut)return;var ranges=copyableRanges(cm);setLastCopied({lineWise:!0,text:ranges.text}),"cut"==e.type&&cm.operation(function(){cm.setSelections(ranges.ranges,0,sel_dontScroll),cm.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var content=lastCopied.text.join("\n");if(e.clipboardData.setData("Text",content),e.clipboardData.getData("Text")==content)return void e.preventDefault()}var kludge=hiddenTextarea(),te=kludge.firstChild;cm.display.lineSpace.insertBefore(kludge,cm.display.lineSpace.firstChild),te.value=lastCopied.text.join("\n");var hadFocus=document.activeElement;selectInput(te),setTimeout(function(){cm.display.lineSpace.removeChild(kludge),hadFocus.focus(),hadFocus==div&&input.showPrimarySelection()},50)}}var this$1=this,input=this,cm=input.cm,div=input.div=display.lineDiv;disableBrowserMagic(div,cm.options.spellcheck),on(div,"paste",function(e){signalDOMEvent(cm,e)||handlePaste(e,cm)||11>=ie_version&&setTimeout(operation(cm,function(){return this$1.updateFromDOM()}),20)}),on(div,"compositionstart",function(e){this$1.composing={data:e.data,done:!1}}),on(div,"compositionupdate",function(e){this$1.composing||(this$1.composing={data:e.data,done:!1})}),on(div,"compositionend",function(e){this$1.composing&&(e.data!=this$1.composing.data&&this$1.readFromDOMSoon(),this$1.composing.done=!0)}),on(div,"touchstart",function(){return input.forceCompositionEnd()}),on(div,"input",function(){this$1.composing||this$1.readFromDOMSoon()}),on(div,"copy",onCopyCut),on(div,"cut",onCopyCut)},ContentEditableInput.prototype.prepareSelection=function(){var result=prepareSelection(this.cm,!1);return result.focus=this.cm.state.focused,result},ContentEditableInput.prototype.showSelection=function(info,takeFocus){info&&this.cm.display.view.length&&((info.focus||takeFocus)&&this.showPrimarySelection(),this.showMultipleSelections(info))},ContentEditableInput.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ContentEditableInput.prototype.showPrimarySelection=function(){var sel=this.getSelection(),cm=this.cm,prim=cm.doc.sel.primary(),from=prim.from(),to=prim.to();if(cm.display.viewTo==cm.display.viewFrom||from.line>=cm.display.viewTo||to.line<cm.display.viewFrom)return void sel.removeAllRanges();var curAnchor=domToPos(cm,sel.anchorNode,sel.anchorOffset),curFocus=domToPos(cm,sel.focusNode,sel.focusOffset);if(!curAnchor||curAnchor.bad||!curFocus||curFocus.bad||0!=cmp(minPos(curAnchor,curFocus),from)||0!=cmp(maxPos(curAnchor,curFocus),to)){var view=cm.display.view,start=from.line>=cm.display.viewFrom&&posToDOM(cm,from)||{node:view[0].measure.map[2],offset:0},end=to.line<cm.display.viewTo&&posToDOM(cm,to);if(!end){var measure=view[view.length-1].measure,map$$1=measure.maps?measure.maps[measure.maps.length-1]:measure.map;end={node:map$$1[map$$1.length-1],offset:map$$1[map$$1.length-2]-map$$1[map$$1.length-3]}}if(!start||!end)return void sel.removeAllRanges();var old=sel.rangeCount&&sel.getRangeAt(0),rng;try{rng=range(start.node,start.offset,end.offset,end.node)}catch(e){}rng&&(!gecko&&cm.state.focused?(sel.collapse(start.node,start.offset),!rng.collapsed&&(sel.removeAllRanges(),sel.addRange(rng))):(sel.removeAllRanges(),sel.addRange(rng)),old&&null==sel.anchorNode?sel.addRange(old):gecko&&this.startGracePeriod()),this.rememberSelection()}},ContentEditableInput.prototype.startGracePeriod=function(){var this$1=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){this$1.gracePeriod=!1,this$1.selectionChanged()&&this$1.cm.operation(function(){return this$1.cm.curOp.selectionChanged=!0})},20)},ContentEditableInput.prototype.showMultipleSelections=function(info){removeChildrenAndAdd(this.cm.display.cursorDiv,info.cursors),removeChildrenAndAdd(this.cm.display.selectionDiv,info.selection)},ContentEditableInput.prototype.rememberSelection=function(){var sel=this.getSelection();this.lastAnchorNode=sel.anchorNode,this.lastAnchorOffset=sel.anchorOffset,this.lastFocusNode=sel.focusNode,this.lastFocusOffset=sel.focusOffset},ContentEditableInput.prototype.selectionInEditor=function(){var sel=this.getSelection();if(!sel.rangeCount)return!1;var node=sel.getRangeAt(0).commonAncestorContainer;return contains(this.div,node)},ContentEditableInput.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(!this.selectionInEditor()&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ContentEditableInput.prototype.blur=function(){this.div.blur()},ContentEditableInput.prototype.getField=function(){return this.div},ContentEditableInput.prototype.supportsTouch=function(){return!0},ContentEditableInput.prototype.receivedFocus=function(){function poll(){input.cm.state.focused&&(input.pollSelection(),input.polling.set(input.cm.options.pollInterval,poll))}var input=this;this.selectionInEditor()?this.pollSelection():runInOp(this.cm,function(){return input.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,poll)},ContentEditableInput.prototype.selectionChanged=function(){var sel=this.getSelection();return sel.anchorNode!=this.lastAnchorNode||sel.anchorOffset!=this.lastAnchorOffset||sel.focusNode!=this.lastFocusNode||sel.focusOffset!=this.lastFocusOffset},ContentEditableInput.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var sel=this.getSelection(),cm=this.cm;if(android&&chrome&&this.cm.options.gutters.length&&isInGutter(sel.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:_Mathabs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var anchor=domToPos(cm,sel.anchorNode,sel.anchorOffset),head=domToPos(cm,sel.focusNode,sel.focusOffset);anchor&&head&&runInOp(cm,function(){setSelection(cm.doc,simpleSelection(anchor,head),sel_dontScroll),(anchor.bad||head.bad)&&(cm.curOp.selectionChanged=!0)})}}},ContentEditableInput.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var cm=this.cm,display=cm.display,sel=cm.doc.sel.primary(),from=sel.from(),to=sel.to();if(0==from.ch&&from.line>cm.firstLine()&&(from=Pos(from.line-1,getLine(cm.doc,from.line-1).length)),to.ch==getLine(cm.doc,to.line).text.length&&to.line<cm.lastLine()&&(to=Pos(to.line+1,0)),from.line<display.viewFrom||to.line>display.viewTo-1)return!1;var fromIndex,fromLine,fromNode;from.line==display.viewFrom||0==(fromIndex=findViewIndex(cm,from.line))?(fromLine=lineNo(display.view[0].line),fromNode=display.view[0].node):(fromLine=lineNo(display.view[fromIndex].line),fromNode=display.view[fromIndex-1].node.nextSibling);var toIndex=findViewIndex(cm,to.line),toLine,toNode;if(toIndex==display.view.length-1?(toLine=display.viewTo-1,toNode=display.lineDiv.lastChild):(toLine=lineNo(display.view[toIndex+1].line)-1,toNode=display.view[toIndex+1].node.previousSibling),!fromNode)return!1;for(var newText=cm.doc.splitLines(domTextBetween(cm,fromNode,toNode,fromLine,toLine)),oldText=getBetween(cm.doc,Pos(fromLine,0),Pos(toLine,getLine(cm.doc,toLine).text.length));1<newText.length&&1<oldText.length;)if(lst(newText)==lst(oldText))newText.pop(),oldText.pop(),toLine--;else if(newText[0]==oldText[0])newText.shift(),oldText.shift(),fromLine++;else break;for(var cutFront=0,cutEnd=0,newTop=newText[0],oldTop=oldText[0],maxCutFront=_Mathmin6(newTop.length,oldTop.length);cutFront<maxCutFront&&newTop.charCodeAt(cutFront)==oldTop.charCodeAt(cutFront);)++cutFront;for(var newBot=lst(newText),oldBot=lst(oldText),maxCutEnd=_Mathmin6(newBot.length-(1==newText.length?cutFront:0),oldBot.length-(1==oldText.length?cutFront:0));cutEnd<maxCutEnd&&newBot.charCodeAt(newBot.length-cutEnd-1)==oldBot.charCodeAt(oldBot.length-cutEnd-1);)++cutEnd;if(1==newText.length&&1==oldText.length&&fromLine==from.line)for(;cutFront&&cutFront>from.ch&&newBot.charCodeAt(newBot.length-cutEnd-1)==oldBot.charCodeAt(oldBot.length-cutEnd-1);)cutFront--,cutEnd++;newText[newText.length-1]=newBot.slice(0,newBot.length-cutEnd).replace(/^\u200b+/,""),newText[0]=newText[0].slice(cutFront).replace(/\u200b+$/,"");var chFrom=Pos(fromLine,cutFront),chTo=Pos(toLine,oldText.length?lst(oldText).length-cutEnd:0);if(1<newText.length||newText[0]||cmp(chFrom,chTo))return _replaceRange(cm.doc,newText,chFrom,chTo,"+input"),!0},ContentEditableInput.prototype.ensurePolled=function(){this.forceCompositionEnd()},ContentEditableInput.prototype.reset=function(){this.forceCompositionEnd()},ContentEditableInput.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ContentEditableInput.prototype.readFromDOMSoon=function(){var this$1=this;null!=this.readDOMTimeout||(this.readDOMTimeout=setTimeout(function(){if(this$1.readDOMTimeout=null,this$1.composing)if(this$1.composing.done)this$1.composing=null;else return;this$1.updateFromDOM()},80))},ContentEditableInput.prototype.updateFromDOM=function(){var this$1=this;(this.cm.isReadOnly()||!this.pollContent())&&runInOp(this.cm,function(){return regChange(this$1.cm)})},ContentEditableInput.prototype.setUneditable=function(node){node.contentEditable="false"},ContentEditableInput.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),!this.cm.isReadOnly()&&operation(this.cm,applyTextInput)(this.cm,_StringfromCharCode7(null==e.charCode?e.keyCode:e.charCode),0))},ContentEditableInput.prototype.readOnlyChanged=function(val){this.div.contentEditable=("nocursor"!=val)+""},ContentEditableInput.prototype.onContextMenu=function(){},ContentEditableInput.prototype.resetPosition=function(){},ContentEditableInput.prototype.needsContentAttribute=!0;var TextareaInput=function(cm){this.cm=cm,this.prevInput="",this.pollingFast=!1,this.polling=new Delayed,this.hasSelection=!1,this.composing=null};TextareaInput.prototype.init=function(display){function prepareCopyCut(e){if(!signalDOMEvent(cm,e)){if(cm.somethingSelected())setLastCopied({lineWise:!1,text:cm.getSelections()});else{if(!cm.options.lineWiseCopyCut)return;var ranges=copyableRanges(cm);setLastCopied({lineWise:!0,text:ranges.text}),"cut"==e.type?cm.setSelections(ranges.ranges,null,sel_dontScroll):(input.prevInput="",te.value=ranges.text.join("\n"),selectInput(te))}"cut"==e.type&&(cm.state.cutIncoming=!0)}}var this$1=this,input=this,cm=this.cm;this.createField(display);var te=this.textarea;display.wrapper.insertBefore(this.wrapper,display.wrapper.firstChild),ios&&(te.style.width="0px"),on(te,"input",function(){ie&&9<=ie_version&&this$1.hasSelection&&(this$1.hasSelection=null),input.poll()}),on(te,"paste",function(e){signalDOMEvent(cm,e)||handlePaste(e,cm)||(cm.state.pasteIncoming=!0,input.fastPoll())}),on(te,"cut",prepareCopyCut),on(te,"copy",prepareCopyCut),on(display.scroller,"paste",function(e){eventInWidget(display,e)||signalDOMEvent(cm,e)||(cm.state.pasteIncoming=!0,input.focus())}),on(display.lineSpace,"selectstart",function(e){eventInWidget(display,e)||e_preventDefault(e)}),on(te,"compositionstart",function(){var start=cm.getCursor("from");input.composing&&input.composing.range.clear(),input.composing={start:start,range:cm.markText(start,cm.getCursor("to"),{className:"CodeMirror-composing"})}}),on(te,"compositionend",function(){input.composing&&(input.poll(),input.composing.range.clear(),input.composing=null)})},TextareaInput.prototype.createField=function(){this.wrapper=hiddenTextarea(),this.textarea=this.wrapper.firstChild},TextareaInput.prototype.prepareSelection=function(){var cm=this.cm,display=cm.display,doc=cm.doc,result=prepareSelection(cm);if(cm.options.moveInputWithCursor){var headPos=_cursorCoords(cm,doc.sel.primary().head,"div"),wrapOff=display.wrapper.getBoundingClientRect(),lineOff=display.lineDiv.getBoundingClientRect();result.teTop=_Mathmax5(0,_Mathmin6(display.wrapper.clientHeight-10,headPos.top+lineOff.top-wrapOff.top)),result.teLeft=_Mathmax5(0,_Mathmin6(display.wrapper.clientWidth-10,headPos.left+lineOff.left-wrapOff.left))}return result},TextareaInput.prototype.showSelection=function(drawn){var cm=this.cm,display=cm.display;removeChildrenAndAdd(display.cursorDiv,drawn.cursors),removeChildrenAndAdd(display.selectionDiv,drawn.selection),null!=drawn.teTop&&(this.wrapper.style.top=drawn.teTop+"px",this.wrapper.style.left=drawn.teLeft+"px")},TextareaInput.prototype.reset=function(typing){if(!(this.contextMenuPending||this.composing)){var cm=this.cm;if(cm.somethingSelected()){this.prevInput="";var content=cm.getSelection();this.textarea.value=content,cm.state.focused&&selectInput(this.textarea),ie&&9<=ie_version&&(this.hasSelection=content)}else typing||(this.prevInput=this.textarea.value="",ie&&9<=ie_version&&(this.hasSelection=null))}},TextareaInput.prototype.getField=function(){return this.textarea},TextareaInput.prototype.supportsTouch=function(){return!1},TextareaInput.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!mobile||activeElt()!=this.textarea))try{this.textarea.focus()}catch(e){}},TextareaInput.prototype.blur=function(){this.textarea.blur()},TextareaInput.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},TextareaInput.prototype.receivedFocus=function(){this.slowPoll()},TextareaInput.prototype.slowPoll=function(){var this$1=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){this$1.poll(),this$1.cm.state.focused&&this$1.slowPoll()})},TextareaInput.prototype.fastPoll=function(){function p(){var changed=input.poll();changed||missed?(input.pollingFast=!1,input.slowPoll()):(missed=!0,input.polling.set(60,p))}var missed=!1,input=this;input.pollingFast=!0,input.polling.set(20,p)},TextareaInput.prototype.poll=function(){var this$1=this,cm=this.cm,input=this.textarea,prevInput=this.prevInput;if(this.contextMenuPending||!cm.state.focused||hasSelection(input)&&!prevInput&&!this.composing||cm.isReadOnly()||cm.options.disableInput||cm.state.keySeq)return!1;var text=input.value;if(text==prevInput&&!cm.somethingSelected())return!1;if(ie&&9<=ie_version&&this.hasSelection===text||mac&&/[\uf700-\uf7ff]/.test(text))return cm.display.input.reset(),!1;if(cm.doc.sel==cm.display.selForContextMenu){var first=text.charCodeAt(0);if(8203!=first||prevInput||(prevInput="\u200B"),8666==first)return this.reset(),this.cm.execCommand("undo")}for(var same=0,l=_Mathmin6(prevInput.length,text.length);same<l&&prevInput.charCodeAt(same)==text.charCodeAt(same);)++same;return runInOp(cm,function(){applyTextInput(cm,text.slice(same),prevInput.length-same,null,this$1.composing?"*compose":null),1e3<text.length||-1<text.indexOf("\n")?input.value=this$1.prevInput="":this$1.prevInput=text,this$1.composing&&(this$1.composing.range.clear(),this$1.composing.range=cm.markText(this$1.composing.start,cm.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},TextareaInput.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},TextareaInput.prototype.onKeyPress=function(){ie&&9<=ie_version&&(this.hasSelection=null),this.fastPoll()},TextareaInput.prototype.onContextMenu=function(e){function prepareSelectAllHack(){if(null!=te.selectionStart){var selected=cm.somethingSelected(),extval="\u200B"+(selected?te.value:"");te.value="\u21DA",te.value=extval,input.prevInput=selected?"":"\u200B",te.selectionStart=1,te.selectionEnd=extval.length,display.selForContextMenu=cm.doc.sel}}function rehide(){if(input.contextMenuPending=!1,input.wrapper.style.cssText=oldWrapperCSS,te.style.cssText=oldCSS,ie&&9>ie_version&&display.scrollbars.setScrollTop(display.scroller.scrollTop=scrollPos),null!=te.selectionStart){(!ie||ie&&9>ie_version)&&prepareSelectAllHack();var i=0,poll=function poll(){display.selForContextMenu==cm.doc.sel&&0==te.selectionStart&&0<te.selectionEnd&&"\u200B"==input.prevInput?operation(cm,selectAll)(cm):10>i++?display.detectingSelectAll=setTimeout(poll,500):(display.selForContextMenu=null,display.input.reset())};display.detectingSelectAll=setTimeout(poll,200)}}var input=this,cm=input.cm,display=cm.display,te=input.textarea,pos=posFromMouse(cm,e),scrollPos=display.scroller.scrollTop;if(pos&&!presto){var reset=cm.options.resetSelectionOnContextMenu;reset&&-1==cm.doc.sel.contains(pos)&&operation(cm,setSelection)(cm.doc,simpleSelection(pos),sel_dontScroll);var oldCSS=te.style.cssText,oldWrapperCSS=input.wrapper.style.cssText;input.wrapper.style.cssText="position: absolute";var wrapperBox=input.wrapper.getBoundingClientRect();te.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-wrapperBox.top-5)+"px; left: "+(e.clientX-wrapperBox.left-5)+"px;\n z-index: 1000; background: "+(ie?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var oldScrollY;if(webkit&&(oldScrollY=window.scrollY),display.input.focus(),webkit&&window.scrollTo(null,oldScrollY),display.input.reset(),cm.somethingSelected()||(te.value=input.prevInput=" "),input.contextMenuPending=!0,display.selForContextMenu=cm.doc.sel,clearTimeout(display.detectingSelectAll),ie&&9<=ie_version&&prepareSelectAllHack(),captureRightClick){e_stop(e);var mouseup=function mouseup(){off(window,"mouseup",mouseup),setTimeout(rehide,20)};on(window,"mouseup",mouseup)}else setTimeout(rehide,50)}},TextareaInput.prototype.readOnlyChanged=function(val){val||this.reset(),this.textarea.disabled="nocursor"==val},TextareaInput.prototype.setUneditable=function(){},TextareaInput.prototype.needsContentAttribute=!1,function(CodeMirror){function option(name,deflt,handle,notOnInit){CodeMirror.defaults[name]=deflt,handle&&(optionHandlers[name]=notOnInit?function(cm,val,old){old!=Init&&handle(cm,val,old)}:handle)}var optionHandlers=CodeMirror.optionHandlers;CodeMirror.defineOption=option,CodeMirror.Init=Init,option("value","",function(cm,val){return cm.setValue(val)},!0),option("mode",null,function(cm,val){cm.doc.modeOption=val,loadMode(cm)},!0),option("indentUnit",2,loadMode,!0),option("indentWithTabs",!1),option("smartIndent",!0),option("tabSize",4,function(cm){resetModeState(cm),clearCaches(cm),regChange(cm)},!0),option("lineSeparator",null,function(cm,val){if(cm.doc.lineSep=val,!!val){var newBreaks=[],lineNo=cm.doc.first;cm.doc.iter(function(line){for(var pos=0,found;;){if(found=line.text.indexOf(val,pos),-1==found)break;pos=found+val.length,newBreaks.push(Pos(lineNo,found))}lineNo++});for(var i=newBreaks.length-1;0<=i;i--)_replaceRange(cm.doc,val,newBreaks[i],Pos(newBreaks[i].line,newBreaks[i].ch+val.length))}}),option("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(cm,val,old){cm.state.specialChars=new RegExp(val.source+(val.test("\t")?"":"|\t"),"g"),old!=Init&&cm.refresh()}),option("specialCharPlaceholder",defaultSpecialCharPlaceholder,function(cm){return cm.refresh()},!0),option("electricChars",!0),option("inputStyle",mobile?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),option("spellcheck",!1,function(cm,val){return cm.getInputField().spellcheck=val},!0),option("rtlMoveVisually",!windows),option("wholeLineUpdateBefore",!0),option("theme","default",function(cm){themeChanged(cm),guttersChanged(cm)},!0),option("keyMap","default",function(cm,val,old){var next=getKeyMap(val),prev=old!=Init&&getKeyMap(old);prev&&prev.detach&&prev.detach(cm,next),next.attach&&next.attach(cm,prev||null)}),option("extraKeys",null),option("configureMouse",null),option("lineWrapping",!1,wrappingChanged,!0),option("gutters",[],function(cm){setGuttersForLineNumbers(cm.options),guttersChanged(cm)},!0),option("fixedGutter",!0,function(cm,val){cm.display.gutters.style.left=val?compensateForHScroll(cm.display)+"px":"0",cm.refresh()},!0),option("coverGutterNextToScrollbar",!1,function(cm){return updateScrollbars(cm)},!0),option("scrollbarStyle","native",function(cm){initScrollbars(cm),updateScrollbars(cm),cm.display.scrollbars.setScrollTop(cm.doc.scrollTop),cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft)},!0),option("lineNumbers",!1,function(cm){setGuttersForLineNumbers(cm.options),guttersChanged(cm)},!0),option("firstLineNumber",1,guttersChanged,!0),option("lineNumberFormatter",function(integer){return integer},guttersChanged,!0),option("showCursorWhenSelecting",!1,updateSelection,!0),option("resetSelectionOnContextMenu",!0),option("lineWiseCopyCut",!0),option("pasteLinesPerSelection",!0),option("readOnly",!1,function(cm,val){"nocursor"==val&&(onBlur(cm),cm.display.input.blur()),cm.display.input.readOnlyChanged(val)}),option("disableInput",!1,function(cm,val){val||cm.display.input.reset()},!0),option("dragDrop",!0,dragDropChanged),option("allowDropFileTypes",null),option("cursorBlinkRate",530),option("cursorScrollMargin",0),option("cursorHeight",1,updateSelection,!0),option("singleCursorHeightPerLine",!0,updateSelection,!0),option("workTime",100),option("workDelay",100),option("flattenSpans",!0,resetModeState,!0),option("addModeClass",!1,resetModeState,!0),option("pollInterval",100),option("undoDepth",200,function(cm,val){return cm.doc.history.undoDepth=val}),option("historyEventDelay",1250),option("viewportMargin",10,function(cm){return cm.refresh()},!0),option("maxHighlightLength",1e4,resetModeState,!0),option("moveInputWithCursor",!0,function(cm,val){val||cm.display.input.resetPosition()}),option("tabindex",null,function(cm,val){return cm.display.input.getField().tabIndex=val||""}),option("autofocus",null),option("direction","ltr",function(cm,val){return cm.doc.setDirection(val)},!0)}(CodeMirror$1),function(CodeMirror){var optionHandlers=CodeMirror.optionHandlers,helpers=CodeMirror.helpers={};CodeMirror.prototype={constructor:CodeMirror,focus:function(){window.focus(),this.display.input.focus()},setOption:function(option,value){var options=this.options,old=options[option];options[option]==value&&"mode"!=option||(options[option]=value,optionHandlers.hasOwnProperty(option)&&operation(this,optionHandlers[option])(this,value,old),signal(this,"optionChange",this,option))},getOption:function(option){return this.options[option]},getDoc:function(){return this.doc},addKeyMap:function(map$$1,bottom){this.state.keyMaps[bottom?"push":"unshift"](getKeyMap(map$$1))},removeKeyMap:function(map$$1){for(var maps=this.state.keyMaps,i=0;i<maps.length;++i)if(maps[i]==map$$1||maps[i].name==map$$1)return maps.splice(i,1),!0},addOverlay:methodOp(function(spec,options){var mode=spec.token?spec:CodeMirror.getMode(this.options,spec);if(mode.startState)throw new Error("Overlays may not be stateful.");insertSorted(this.state.overlays,{mode:mode,modeSpec:spec,opaque:options&&options.opaque,priority:options&&options.priority||0},function(overlay){return overlay.priority}),this.state.modeGen++,regChange(this)}),removeOverlay:methodOp(function(spec){for(var this$1=this,overlays=this.state.overlays,i=0,cur;i<overlays.length;++i)if(cur=overlays[i].modeSpec,cur==spec||"string"==typeof spec&&cur.name==spec)return overlays.splice(i,1),this$1.state.modeGen++,void regChange(this$1)}),indentLine:methodOp(function(n,dir,aggressive){"string"!=typeof dir&&"number"!=typeof dir&&(null==dir?dir=this.options.smartIndent?"smart":"prev":dir=dir?"add":"subtract"),isLine(this.doc,n)&&indentLine(this,n,dir,aggressive)}),indentSelection:methodOp(function(how){for(var this$1=this,ranges=this.doc.sel.ranges,end=-1,i=0,range$$1;i<ranges.length;i++)if(range$$1=ranges[i],!range$$1.empty()){var from=range$$1.from(),to=range$$1.to(),start=_Mathmax5(end,from.line);end=_Mathmin6(this$1.lastLine(),to.line-(to.ch?0:1))+1;for(var j=start;j<end;++j)indentLine(this$1,j,how);var newRanges=this$1.doc.sel.ranges;0==from.ch&&ranges.length==newRanges.length&&0<newRanges[i].from().ch&&replaceOneSelection(this$1.doc,i,new Range(from,newRanges[i].to()),sel_dontScroll)}else range$$1.head.line>end&&(indentLine(this$1,range$$1.head.line,how,!0),end=range$$1.head.line,i==this$1.doc.sel.primIndex&&ensureCursorVisible(this$1))}),getTokenAt:function(pos,precise){return takeToken(this,pos,precise)},getLineTokens:function(line,precise){return takeToken(this,Pos(line),precise,!0)},getTokenTypeAt:function(pos){pos=_clipPos(this.doc,pos);var styles=getLineStyles(this,getLine(this.doc,pos.line)),before=0,after=(styles.length-1)/2,ch=pos.ch,type;if(0==ch)type=styles[2];else for(;;){var mid=before+after>>1;if((mid?styles[2*mid-1]:0)>=ch)after=mid;else if(styles[2*mid+1]<ch)before=mid+1;else{type=styles[2*mid+2];break}}var cut=type?type.indexOf("overlay "):-1;return 0>cut?type:0==cut?null:type.slice(0,cut-1)},getModeAt:function(pos){var mode=this.doc.mode;return mode.innerMode?CodeMirror.innerMode(mode,this.getTokenAt(pos).state).mode:mode},getHelper:function(pos,type){return this.getHelpers(pos,type)[0]},getHelpers:function(pos,type){var this$1=this,found=[];if(!helpers.hasOwnProperty(type))return found;var help=helpers[type],mode=this.getModeAt(pos);if("string"==typeof mode[type])help[mode[type]]&&found.push(help[mode[type]]);else if(mode[type])for(var i=0,val;i<mode[type].length;i++)val=help[mode[type][i]],val&&found.push(val);else mode.helperType&&help[mode.helperType]?found.push(help[mode.helperType]):help[mode.name]&&found.push(help[mode.name]);for(var i$1=0,cur;i$1<help._global.length;i$1++)cur=help._global[i$1],cur.pred(mode,this$1)&&-1==indexOf(found,cur.val)&&found.push(cur.val);return found},getStateAfter:function(line,precise){var doc=this.doc;return line=clipLine(doc,null==line?doc.first+doc.size-1:line),getContextBefore(this,line+1,precise).state},cursorCoords:function(start,mode){var range$$1=this.doc.sel.primary(),pos;return pos=null==start?range$$1.head:"object"==typeof start?_clipPos(this.doc,start):start?range$$1.from():range$$1.to(),_cursorCoords(this,pos,mode||"page")},charCoords:function(pos,mode){return _charCoords(this,_clipPos(this.doc,pos),mode||"page")},coordsChar:function(coords,mode){return coords=fromCoordSystem(this,coords,mode||"page"),_coordsChar(this,coords.left,coords.top)},lineAtHeight:function(height,mode){return height=fromCoordSystem(this,{top:height,left:0},mode||"page").top,_lineAtHeight(this.doc,height+this.display.viewOffset)},heightAtLine:function(line,mode,includeWidgets){var end=!1,lineObj;if("number"==typeof line){var last=this.doc.first+this.doc.size-1;line<this.doc.first?line=this.doc.first:line>last&&(line=last,end=!0),lineObj=getLine(this.doc,line)}else lineObj=line;return intoCoordSystem(this,lineObj,{top:0,left:0},mode||"page",includeWidgets||end).top+(end?this.doc.height-_heightAtLine(lineObj):0)},defaultTextHeight:function(){return textHeight(this.display)},defaultCharWidth:function(){return charWidth(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(pos,node,scroll,vert,horiz){var display=this.display;pos=_cursorCoords(this,_clipPos(this.doc,pos));var top=pos.bottom,left=pos.left;if(node.style.position="absolute",node.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(node),display.sizer.appendChild(node),"over"==vert)top=pos.top;else if("above"==vert||"near"==vert){var vspace=_Mathmax5(display.wrapper.clientHeight,this.doc.height),hspace=_Mathmax5(display.sizer.clientWidth,display.lineSpace.clientWidth);("above"==vert||pos.bottom+node.offsetHeight>vspace)&&pos.top>node.offsetHeight?top=pos.top-node.offsetHeight:pos.bottom+node.offsetHeight<=vspace&&(top=pos.bottom),left+node.offsetWidth>hspace&&(left=hspace-node.offsetWidth)}node.style.top=top+"px",node.style.left=node.style.right="","right"==horiz?(left=display.sizer.clientWidth-node.offsetWidth,node.style.right="0px"):("left"==horiz?left=0:"middle"==horiz&&(left=(display.sizer.clientWidth-node.offsetWidth)/2),node.style.left=left+"px"),scroll&&scrollIntoView(this,{left:left,top:top,right:left+node.offsetWidth,bottom:top+node.offsetHeight})},triggerOnKeyDown:methodOp(onKeyDown),triggerOnKeyPress:methodOp(onKeyPress),triggerOnKeyUp:onKeyUp,triggerOnMouseDown:methodOp(onMouseDown),execCommand:function(cmd){if(commands.hasOwnProperty(cmd))return commands[cmd].call(null,this)},triggerElectric:methodOp(function(text){triggerElectric(this,text)}),findPosH:function(from,amount,unit,visually){var this$1=this,dir=1;0>amount&&(dir=-1,amount=-amount);for(var cur=_clipPos(this.doc,from),i=0;i<amount&&(cur=_findPosH(this$1.doc,cur,dir,unit,visually),!cur.hitSide);++i);return cur},moveH:methodOp(function(dir,unit){var this$1=this;this.extendSelectionsBy(function(range$$1){return this$1.display.shift||this$1.doc.extend||range$$1.empty()?_findPosH(this$1.doc,range$$1.head,dir,unit,this$1.options.rtlMoveVisually):0>dir?range$$1.from():range$$1.to()},sel_move)}),deleteH:methodOp(function(dir,unit){var sel=this.doc.sel,doc=this.doc;sel.somethingSelected()?doc.replaceSelection("",null,"+delete"):deleteNearSelection(this,function(range$$1){var other=_findPosH(doc,range$$1.head,dir,unit,!1);return 0>dir?{from:other,to:range$$1.head}:{from:range$$1.head,to:other}})}),findPosV:function(from,amount,unit,goalColumn){var this$1=this,dir=1,x=goalColumn;0>amount&&(dir=-1,amount=-amount);for(var cur=_clipPos(this.doc,from),i=0,coords;i<amount&&(coords=_cursorCoords(this$1,cur,"div"),null==x?x=coords.left:coords.left=x,cur=_findPosV(this$1,coords,dir,unit),!cur.hitSide);++i);return cur},moveV:methodOp(function(dir,unit){var this$1=this,doc=this.doc,goals=[],collapse=!this.display.shift&&!doc.extend&&doc.sel.somethingSelected();if(doc.extendSelectionsBy(function(range$$1){if(collapse)return 0>dir?range$$1.from():range$$1.to();var headPos=_cursorCoords(this$1,range$$1.head,"div");null!=range$$1.goalColumn&&(headPos.left=range$$1.goalColumn),goals.push(headPos.left);var pos=_findPosV(this$1,headPos,dir,unit);return"page"==unit&&range$$1==doc.sel.primary()&&addToScrollTop(this$1,_charCoords(this$1,pos,"div").top-headPos.top),pos},sel_move),goals.length)for(var i=0;i<doc.sel.ranges.length;i++)doc.sel.ranges[i].goalColumn=goals[i]}),findWordAt:function(pos){var doc=this.doc,line=getLine(doc,pos.line).text,start=pos.ch,end=pos.ch;if(line){var helper=this.getHelper(pos,"wordChars");("before"==pos.sticky||end==line.length)&&start?--start:++end;for(var startChar=line.charAt(start),check=isWordChar(startChar,helper)?function(ch){return isWordChar(ch,helper)}:/\s/.test(startChar)?function(ch){return /\s/.test(ch)}:function(ch){return!/\s/.test(ch)&&!isWordChar(ch)};0<start&&check(line.charAt(start-1));)--start;for(;end<line.length&&check(line.charAt(end));)++end}return new Range(Pos(pos.line,start),Pos(pos.line,end))},toggleOverwrite:function(value){null!=value&&value==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?addClass(this.display.cursorDiv,"CodeMirror-overwrite"):rmClass(this.display.cursorDiv,"CodeMirror-overwrite"),signal(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==activeElt()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:methodOp(function(x,y){scrollToCoords(this,x,y)}),getScrollInfo:function(){var scroller=this.display.scroller;return{left:scroller.scrollLeft,top:scroller.scrollTop,height:scroller.scrollHeight-scrollGap(this)-this.display.barHeight,width:scroller.scrollWidth-scrollGap(this)-this.display.barWidth,clientHeight:displayHeight(this),clientWidth:displayWidth(this)}},scrollIntoView:methodOp(function(range$$1,margin){null==range$$1?(range$$1={from:this.doc.sel.primary().head,to:null},null==margin&&(margin=this.options.cursorScrollMargin)):"number"==typeof range$$1?range$$1={from:Pos(range$$1,0),to:null}:null==range$$1.from&&(range$$1={from:range$$1,to:null}),range$$1.to||(range$$1.to=range$$1.from),range$$1.margin=margin||0,null==range$$1.from.line?scrollToCoordsRange(this,range$$1.from,range$$1.to,range$$1.margin):scrollToRange(this,range$$1)}),setSize:methodOp(function(width,height){var this$1=this,interpret=function(val){return"number"==typeof val||/^\d+$/.test(val+"")?val+"px":val};null!=width&&(this.display.wrapper.style.width=interpret(width)),null!=height&&(this.display.wrapper.style.height=interpret(height)),this.options.lineWrapping&&clearLineMeasurementCache(this);var lineNo$$1=this.display.viewFrom;this.doc.iter(lineNo$$1,this.display.viewTo,function(line){if(line.widgets)for(var i=0;i<line.widgets.length;i++)if(line.widgets[i].noHScroll){regLineChange(this$1,lineNo$$1,"widget");break}++lineNo$$1}),this.curOp.forceUpdate=!0,signal(this,"refresh",this)}),operation:function(f){return runInOp(this,f)},startOperation:function(){return _startOperation(this)},endOperation:function(){return _endOperation(this)},refresh:methodOp(function(){var oldHeight=this.display.cachedTextHeight;regChange(this),this.curOp.forceUpdate=!0,clearCaches(this),scrollToCoords(this,this.doc.scrollLeft,this.doc.scrollTop),updateGutterSpace(this),(null==oldHeight||.5<_Mathabs(oldHeight-textHeight(this.display)))&&estimateLineHeights(this),signal(this,"refresh",this)}),swapDoc:methodOp(function(doc){var old=this.doc;return old.cm=null,attachDoc(this,doc),clearCaches(this),this.display.input.reset(),scrollToCoords(this,doc.scrollLeft,doc.scrollTop),this.curOp.forceScroll=!0,signalLater(this,"swapDoc",this,old),old}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},eventMixin(CodeMirror),CodeMirror.registerHelper=function(type,name,value){helpers.hasOwnProperty(type)||(helpers[type]=CodeMirror[type]={_global:[]}),helpers[type][name]=value},CodeMirror.registerGlobalHelper=function(type,name,predicate,value){CodeMirror.registerHelper(type,name,value),helpers[type]._global.push({pred:predicate,val:value})}}(CodeMirror$1);var dontDelegate=["iter","insert","remove","copy","getEditor","constructor"];for(var prop in Doc.prototype)Doc.prototype.hasOwnProperty(prop)&&0>indexOf(dontDelegate,prop)&&(CodeMirror$1.prototype[prop]=function(method){return function(){return method.apply(this.doc,arguments)}}(Doc.prototype[prop]));return eventMixin(Doc),CodeMirror$1.inputStyles={textarea:TextareaInput,contenteditable:ContentEditableInput},CodeMirror$1.defineMode=function(name){CodeMirror$1.defaults.mode||"null"==name||(CodeMirror$1.defaults.mode=name),defineMode.apply(this,arguments)},CodeMirror$1.defineMIME=function(mime,spec){mimeModes[mime]=spec},CodeMirror$1.defineMode("null",function(){return{token:function(stream){return stream.skipToEnd()}}}),CodeMirror$1.defineMIME("text/plain","null"),CodeMirror$1.defineExtension=function(name,func){CodeMirror$1.prototype[name]=func},CodeMirror$1.defineDocExtension=function(name,func){Doc.prototype[name]=func},CodeMirror$1.fromTextArea=function(textarea,options){function save(){textarea.value=cm.getValue()}if(options=options?copyObj(options):{},options.value=textarea.value,!options.tabindex&&textarea.tabIndex&&(options.tabindex=textarea.tabIndex),!options.placeholder&&textarea.placeholder&&(options.placeholder=textarea.placeholder),null==options.autofocus){var hasFocus=activeElt();options.autofocus=hasFocus==textarea||null!=textarea.getAttribute("autofocus")&&hasFocus==document.body}var realSubmit;if(textarea.form&&(on(textarea.form,"submit",save),!options.leaveSubmitMethodAlone)){var form=textarea.form;realSubmit=form.submit;try{var wrappedSubmit=form.submit=function(){save(),form.submit=realSubmit,form.submit(),form.submit=wrappedSubmit}}catch(e){}}options.finishInit=function(cm){cm.save=save,cm.getTextArea=function(){return textarea},cm.toTextArea=function(){cm.toTextArea=isNaN,save(),textarea.parentNode.removeChild(cm.getWrapperElement()),textarea.style.display="",textarea.form&&(off(textarea.form,"submit",save),"function"==typeof textarea.form.submit&&(textarea.form.submit=realSubmit))}},textarea.style.display="none";var cm=CodeMirror$1(function(node){return textarea.parentNode.insertBefore(node,textarea.nextSibling)},options);return cm},function(CodeMirror){CodeMirror.off=off,CodeMirror.on=on,CodeMirror.wheelEventPixels=wheelEventPixels,CodeMirror.Doc=Doc,CodeMirror.splitLines=splitLinesAuto,CodeMirror.countColumn=countColumn,CodeMirror.findColumn=findColumn,CodeMirror.isWordChar=isWordCharBasic,CodeMirror.Pass=Pass,CodeMirror.signal=signal,CodeMirror.Line=Line,CodeMirror.changeEnd=changeEnd,CodeMirror.scrollbarModel=scrollbarModel,CodeMirror.Pos=Pos,CodeMirror.cmpPos=cmp,CodeMirror.modes=modes,CodeMirror.mimeModes=mimeModes,CodeMirror.resolveMode=resolveMode,CodeMirror.getMode=getMode,CodeMirror.modeExtensions=modeExtensions,CodeMirror.extendMode=extendMode,CodeMirror.copyState=copyState,CodeMirror.startState=startState,CodeMirror.innerMode=innerMode,CodeMirror.commands=commands,CodeMirror.keyMap=keyMap,CodeMirror.keyName=keyName,CodeMirror.isModifierKey=isModifierKey,CodeMirror.lookupKey=lookupKey,CodeMirror.normalizeKeyMap=normalizeKeyMap,CodeMirror.StringStream=StringStream,CodeMirror.SharedTextMarker=SharedTextMarker,CodeMirror.TextMarker=TextMarker,CodeMirror.LineWidget=LineWidget,CodeMirror.e_preventDefault=e_preventDefault,CodeMirror.e_stopPropagation=e_stopPropagation,CodeMirror.e_stop=e_stop,CodeMirror.addClass=addClass,CodeMirror.contains=contains,CodeMirror.rmClass=rmClass,CodeMirror.keyNames=keyNames}(CodeMirror$1),CodeMirror$1.version="5.38.0",CodeMirror$1})},tbG5:function(module,exports){"use strict";function _has(obj,key){return Object.prototype.hasOwnProperty.call(obj,key)}var TYPED_OK="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;exports.assign=function(obj){for(var sources=Array.prototype.slice.call(arguments,1),source;sources.length;)if(source=sources.shift(),source){if("object"!=typeof source)throw new TypeError(source+"must be non-object");for(var p in source)_has(source,p)&&(obj[p]=source[p])}return obj},exports.shrinkBuf=function(buf,size){return buf.length===size?buf:buf.subarray?buf.subarray(0,size):(buf.length=size,buf)};var fnTyped={arraySet:function(dest,src,src_offs,len,dest_offs){if(src.subarray&&dest.subarray)return void dest.set(src.subarray(src_offs,src_offs+len),dest_offs);for(var i=0;i<len;i++)dest[dest_offs+i]=src[src_offs+i]},flattenChunks:function(chunks){var i,l,len,pos,chunk,result;for(len=0,i=0,l=chunks.length;i<l;i++)len+=chunks[i].length;for(result=new Uint8Array(len),pos=0,(i=0,l=chunks.length);i<l;i++)chunk=chunks[i],result.set(chunk,pos),pos+=chunk.length;return result}},fnUntyped={arraySet:function(dest,src,src_offs,len,dest_offs){for(var i=0;i<len;i++)dest[dest_offs+i]=src[src_offs+i]},flattenChunks:function(chunks){return[].concat.apply([],chunks)}};exports.setTyped=function(on){on?(exports.Buf8=Uint8Array,exports.Buf16=Uint16Array,exports.Buf32=Int32Array,exports.assign(exports,fnTyped)):(exports.Buf8=Array,exports.Buf16=Array,exports.Buf32=Array,exports.assign(exports,fnUntyped))},exports.setTyped(TYPED_OK)},tzeh:function(module,exports,__webpack_require__){"use strict";exports=module.exports=__webpack_require__("DHrQ"),exports.Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__("WSyY"),exports.Duplex=__webpack_require__("Hba+"),exports.Transform=__webpack_require__("7tlB"),exports.PassThrough=__webpack_require__("nwyA")},uQIK:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){function findMatchingBracket(cm,where,config){var line=cm.getLineHandle(where.line),pos=where.ch-1,afterCursor=config&&config.afterCursor;null==afterCursor&&(afterCursor=/(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className));var match=!afterCursor&&0<=pos&&matching[line.text.charAt(pos)]||matching[line.text.charAt(++pos)];if(!match)return null;var dir=">"==match.charAt(1)?1:-1;if(config&&config.strict&&0<dir!=(pos==where.ch))return null;var style=cm.getTokenTypeAt(Pos(where.line,pos+1)),found=scanForBracket(cm,Pos(where.line,pos+(0<dir?1:0)),dir,style||null,config);return null==found?null:{from:Pos(where.line,pos),to:found&&found.pos,match:found&&found.ch==match.charAt(0),forward:0<dir}}function scanForBracket(cm,where,dir,style,config){for(var maxScanLen=config&&config.maxScanLineLength||1e4,maxScanLines=config&&config.maxScanLines||1e3,stack=[],re=config&&config.bracketRegex?config.bracketRegex:/[(){}[\]]/,lineEnd=0<dir?Math.min(where.line+maxScanLines,cm.lastLine()+1):Math.max(cm.firstLine()-1,where.line-maxScanLines),lineNo=where.line,line;lineNo!=lineEnd;lineNo+=dir)if(line=cm.getLine(lineNo),line){var pos=0<dir?0:line.length-1,end=0<dir?line.length:-1;if(!(line.length>maxScanLen))for(lineNo==where.line&&(pos=where.ch-(0>dir?1:0));pos!=end;pos+=dir){var ch=line.charAt(pos);if(re.test(ch)&&(void 0===style||cm.getTokenTypeAt(Pos(lineNo,pos+1))==style)){var match=matching[ch];if(">"==match.charAt(1)==0<dir)stack.push(ch);else{if(!stack.length)return{pos:Pos(lineNo,pos),ch:ch};stack.pop()}}}}return lineNo-dir!=(0<dir?cm.lastLine():cm.firstLine())&&null}function matchBrackets(cm,autoclear,config){for(var maxHighlightLen=cm.state.matchBrackets.maxHighlightLineLength||1e3,marks=[],ranges=cm.listSelections(),i=0,match;i<ranges.length;i++)if(match=ranges[i].empty()&&findMatchingBracket(cm,ranges[i].head,config),match&&cm.getLine(match.from.line).length<=maxHighlightLen){var style=match.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";marks.push(cm.markText(match.from,Pos(match.from.line,match.from.ch+1),{className:style})),match.to&&cm.getLine(match.to.line).length<=maxHighlightLen&&marks.push(cm.markText(match.to,Pos(match.to.line,match.to.ch+1),{className:style}))}if(marks.length){ie_lt8&&cm.state.focused&&cm.focus();var clear=function(){cm.operation(function(){for(var i=0;i<marks.length;i++)marks[i].clear()})};if(autoclear)setTimeout(clear,800);else return clear}}function doMatchBrackets(cm){cm.operation(function(){cm.state.matchBrackets.currentlyHighlighted&&(cm.state.matchBrackets.currentlyHighlighted(),cm.state.matchBrackets.currentlyHighlighted=null),cm.state.matchBrackets.currentlyHighlighted=matchBrackets(cm,!1,cm.state.matchBrackets)})}var ie_lt8=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||8>document.documentMode),Pos=CodeMirror.Pos,matching={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};CodeMirror.defineOption("matchBrackets",!1,function(cm,val,old){old&&old!=CodeMirror.Init&&(cm.off("cursorActivity",doMatchBrackets),cm.state.matchBrackets&&cm.state.matchBrackets.currentlyHighlighted&&(cm.state.matchBrackets.currentlyHighlighted(),cm.state.matchBrackets.currentlyHighlighted=null)),val&&(cm.state.matchBrackets="object"==typeof val?val:{},cm.on("cursorActivity",doMatchBrackets))}),CodeMirror.defineExtension("matchBrackets",function(){matchBrackets(this,!0)}),CodeMirror.defineExtension("findMatchingBracket",function(pos,config,oldConfig){return(oldConfig||"boolean"==typeof config)&&(oldConfig?(oldConfig.strict=config,config=oldConfig):config=config?{strict:!0}:null),findMatchingBracket(this,pos,config)}),CodeMirror.defineExtension("scanForBracket",function(pos,dir,style,config){return scanForBracket(this,pos,dir,style,config)})})},uUPe:function(module,exports,__webpack_require__){"use strict";(function(global){function nextTick(){draining=!0;for(var len=queue.length,i,oldQueue;len;){for(oldQueue=queue,queue=[],i=-1;++i<len;)oldQueue[i]();len=queue.length}draining=!1}var Mutation=global.MutationObserver||global.WebKitMutationObserver,scheduleDrain;if(Mutation){var called=0,observer=new Mutation(nextTick),element=global.document.createTextNode("");observer.observe(element,{characterData:!0}),scheduleDrain=function(){element.data=called=++called%2}}else if(!global.setImmediate&&"undefined"!=typeof global.MessageChannel){var channel=new global.MessageChannel;channel.port1.onmessage=nextTick,scheduleDrain=function(){channel.port2.postMessage(0)}}else scheduleDrain="document"in global&&"onreadystatechange"in global.document.createElement("script")?function(){var scriptEl=global.document.createElement("script");scriptEl.onreadystatechange=function(){nextTick(),scriptEl.onreadystatechange=null,scriptEl.parentNode.removeChild(scriptEl),scriptEl=null},global.document.documentElement.appendChild(scriptEl)}:function(){setTimeout(nextTick,0)};var queue=[],draining;module.exports=function(task){1!==queue.push(task)||draining||scheduleDrain()}}).call(exports,__webpack_require__("h6ac"))},ueHA:function(module,exports,__webpack_require__){"use strict";var _Mathround3=Math.round,_Mathfloor5=Math.floor,_Mathmax6=Math.max;(function(global){function l(a){return"string"==typeof a}function m(a,b){a=a.split("."),b=b||h;for(var c=0;c<a.length;c++)if(b=b[a[c]],null==b)return null;return b}function aa(){}function ba(a){var b=typeof a;if("object"==b){if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";}else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function n(a){return"array"==ba(a)}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function q(a){return"function"==ba(a)}function r(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ea(a){return a.call.apply(a.bind,arguments)}function fa(a,b){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(c,d),a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function u(){return u=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:fa,u.apply(null,arguments)}function v(a){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();return b.push.apply(b,arguments),a.apply(this,b)}}function x(a,b){function c(){}c.prototype=b.prototype,a.L=b.prototype,a.prototype=new c,a.prototype.constructor=a,a.mh=function(a,c){for(var d=Array(arguments.length-2),f=2;f<arguments.length;f++)d[f-2]=arguments[f];return b.prototype[c].apply(a,d)}}function y(a){if(Error.captureStackTrace)Error.captureStackTrace(this,y);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=a+"")}function ha(a,b){a=a.split("%s");for(var c="",d=a.length-1,f=0;f<d;f++)c+=a[f]+(f<b.length?b[f]:"%s");y.call(this,c+a[d])}function ia(a){throw new ha("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1))}function z(){0!=ja&&(ka[this[t]||(this[t]=++da)]=this),this.Ka=this.Ka,this.Qa=this.Qa}function pa(a){a:{for(var b=qa,c=a.length,d=l(a)?a.split(""):a,f=0;f<c;f++)if(f in d&&b.call(void 0,d[f],f,a)){b=f;break a}b=-1}return 0>b?null:l(a)?a.charAt(b):a[b]}function ra(a){if(!n(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0}function sa(a,b){b=la(a,b);var c;return(c=0<=b)&&Array.prototype.splice.call(a,b,1),c}function ta(){return Array.prototype.concat.apply([],arguments)}function ua(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]}function va(a){return /^[\s\xa0]*$/.test(a)}function xa(a,b){return a<b?-1:a>b?1:0}function B(a){return-1!=A.indexOf(a)}function Aa(a,b,c){for(var d in a)b.call(c,a[d],d,a)}function Ba(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Ca(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}function Da(a){var b={},c;for(c in a)b[c]=a[c];return b}function Fa(a){for(var f=1,c,d;f<arguments.length;f++){for(c in d=arguments[f],d)a[c]=d[c];for(var g=0;g<Ea.length;g++)c=Ea[g],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}}function Ga(a){return Ga[" "](a),a}function Ha(a,b){var c=Ia;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)}function Oa(){var a=h.document;return a?a.documentMode:void 0}function Ta(a){return Ha(a,function(){for(var b=0,c=wa(Pa+"").split("."),d=wa(a+"").split("."),f=_Mathmax6(c.length,d.length),g=0;0==b&&g<f;g++){var k=c[g]||"",p=d[g]||"";do{if(k=/(\d*)(\D*)(.*)/.exec(k)||["","","",""],p=/(\d*)(\D*)(.*)/.exec(p)||["","","",""],0==k[0].length&&0==p[0].length)break;b=xa(0==k[1].length?0:parseInt(k[1],10),0==p[1].length?0:parseInt(p[1],10))||xa(0==k[2].length,0==p[2].length)||xa(k[2],p[2]),k=k[3],p=p[3]}while(0==b)}return 0<=b})}function D(a,b){this.type=a,this.currentTarget=this.target=b,this.defaultPrevented=this.Ea=!1,this.Be=!0}function E(a,b){D.call(this,a?a.type:""),this.relatedTarget=this.currentTarget=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0,this.key="",this.charCode=this.keyCode=0,this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.fb=null,a&&this.Kf(a,b)}function F(a){return a&&a[ab]}function cb(a,b,c,d,f){this.listener=a,this.proxy=null,this.src=b,this.type=c,this.capture=!!d,this.Ob=f,this.key=++bb,this.Sa=this.Eb=!1}function db(a){this.src=a,this.J={},this.xb=0}function eb(a,b,c,d){for(var f=0,g;f<a.length;++f)if(g=a[f],!g.Sa&&g.listener==b&&g.capture==!!c&&g.Ob==d)return f;return-1}function ib(a,b,c,d,f){if(d&&d.once)return jb(a,b,c,d,f);if(n(b)){for(var g=0;g<b.length;g++)ib(a,b[g],c,d,f);return null}return c=kb(c),F(a)?a.nb(b,c,r(d)?!!d.capture:!!d,f):lb(a,b,c,!1,d,f)}function lb(a,b,c,d,f,g){if(!b)throw Error("Invalid event type");var k=r(f)?!!f.capture:!!f,p=G(a);if(p||(a[fb]=p=new db(a)),c=p.add(b,c,d,k,g),c.proxy)return c;if(d=mb(),c.proxy=d,d.src=a,d.listener=c,a.addEventListener)Za||(f=k),void 0===f&&(f=!1),a.addEventListener(b.toString(),d,f);else if(a.attachEvent)a.attachEvent(nb(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error("addEventListener and attachEvent are unavailable.");return c}function mb(){var a=ob,b=Xa?function(c){return a.call(b.src,b.listener,c)}:function(c){if(c=a.call(b.src,b.listener,c),!c)return c};return b}function jb(a,b,c,d,f){if(n(b)){for(var g=0;g<b.length;g++)jb(a,b[g],c,d,f);return null}return c=kb(c),F(a)?a.Oc(b,c,r(d)?!!d.capture:!!d,f):lb(a,b,c,!0,d,f)}function pb(a,b,c,d,f){if(n(b))for(var g=0;g<b.length;g++)pb(a,b[g],c,d,f);else d=r(d)?!!d.capture:!!d,c=kb(c),F(a)?a.ed(b,c,d,f):a&&(a=G(a))&&(b=a.jb(b,c,d,f))&&qb(b)}function qb(a){if("number"!=typeof a&&a&&!a.Sa){var b=a.src;if(F(b))b.Le(a);else{var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(nb(c),d):b.addListener&&b.removeListener&&b.removeListener(d),(c=G(b))?(c.ye(a),0==c.xb&&(c.src=null,b[fb]=null)):a.Vb()}}}function nb(a){return a in gb?gb[a]:gb[a]="on"+a}function rb(a,b,c,d){var f=!0;if((a=G(a))&&(b=a.J[b.toString()]))for(b=b.concat(),a=0;a<b.length;a++){var g=b[a];g&&g.capture==c&&!g.Sa&&(g=sb(g,d),f=f&&!1!==g)}return f}function sb(a,b){var c=a.listener,d=a.Ob||a.src;return a.Eb&&qb(a),c.call(d,b)}function ob(a,b){if(a.Sa)return!0;if(!Xa){var c=b||m("window.event");b=new E(c,this);var d=!0;if(!(0>c.keyCode||void 0!=c.returnValue)){a:{var f=!1;if(0==c.keyCode)try{c.keyCode=-1;break a}catch(k){f=!0}(f||void 0==c.returnValue)&&(c.returnValue=!0)}for(c=[],f=b.currentTarget;f;f=f.parentNode)c.push(f);for(a=a.type,f=c.length-1;!b.Ea&&0<=f;f--){b.currentTarget=c[f];var g=rb(c[f],a,!0,b);d=d&&g}for(f=0;!b.Ea&&f<c.length;f++)b.currentTarget=c[f],g=rb(c[f],a,!1,b),d=d&&g}return d}return sb(a,new E(b,this))}function G(a){return a=a[fb],a instanceof db?a:null}function kb(a){return q(a)?a:(a[tb]||(a[tb]=function(b){return a.handleEvent(b)}),a[tb])}function H(){z.call(this),this.ka=new db(this),this.Pe=this,this.Uc=null}function vb(a,b){this.Sf=100,this.ef=a,this.ug=b,this.Zb=0,this.Pb=null}function I(){this.lc=this.Va=null}function wb(){this.next=this.scope=this.Gc=null}function yb(a){h.setTimeout(function(){throw a},0)}function Ab(){var a=h.MessageChannel;if("undefined"==typeof a&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!B("Presto")&&(a=function(){var a=document.createElement("IFRAME");a.style.display="none",a.src="",document.documentElement.appendChild(a);var b=a.contentWindow;a=b.document,a.open(),a.write(""),a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+"//"+b.location.host;a=u(function(a){("*"==d||a.origin==d)&&a.data==c&&this.port1.onmessage()},this),b.addEventListener("message",a,!1),this.port1={},this.port2={postMessage:function(){b.postMessage(c,d)}}}),"undefined"!=typeof a&&!B("Trident")&&!B("MSIE")){var b=new a,c={},d=c;return b.port1.onmessage=function(){if(void 0!==c.next){c=c.next;var a=c.rd;c.rd=null,a()}},function(a){d.next={rd:a},d=d.next,b.port2.postMessage(0)}}return"undefined"!=typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?function(a){var b=document.createElement("SCRIPT");b.onreadystatechange=function(){b.onreadystatechange=null,b.parentNode.removeChild(b),b=null,a(),a=null},document.documentElement.appendChild(b)}:function(a){h.setTimeout(a,0)}}function Cb(){if(h.Promise&&h.Promise.resolve){var a=h.Promise.resolve(void 0);Bb=function(){a.then(Db)}}else Bb=function(){var a=Db;!q(h.setImmediate)||h.Window&&h.Window.prototype&&!B("Edge")&&h.Window.prototype.setImmediate==h.setImmediate?(zb||(zb=Ab()),zb(a)):h.setImmediate(a)}}function Db(){for(var a;a=Fb.remove();){try{a.Gc.call(a.scope)}catch(b){yb(b)}Fb.wg(a)}Eb=!1}function Gb(a,b){H.call(this),this.Na=a||1,this.wb=b||h,this.nd=u(this.Rg,this),this.ie=w()}function Hb(a,b,c){if(q(a))c&&(a=u(a,c));else if(a&&"function"==typeof a.handleEvent)a=u(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<+b?-1:h.setTimeout(a,b||0)}function Ib(a,b,c){z.call(this),this.Uf=null==c?a:u(a,c),this.Na=b,this.Xe=u(this.fg,this),this.qc=[]}function Jb(a){z.call(this),this.i=a,this.o={}}function J(a,b,c){this.reset(a,b,c,void 0,void 0)}function Mb(a){this.pe=a,this.Zd=this.uc=this.mb=this.$b=null}function K(a,b){this.name=a,this.value=b}function Vb(a){Tb||(Tb=new Mb(""),Sb[""]=Tb,Tb.Ge(Qb));var b;if(!(b=Sb[a])){b=new Mb(a);var c=a.lastIndexOf("."),d=a.substr(c+1);c=Vb(a.substr(0,c)),c.Qe(d,b),b.Fg(c),Sb[a]=b}return b}function Wb(a,b){a&&a.info(b,void 0)}function L(a,b){a&&a.lf(b)}function Xb(){this.s=Vb("goog.labs.net.webChannel.WebChannelDebug"),this.Wc=!0}function Yb(a){D.call(this,"serverreachability",a)}function N(a){M.dispatchEvent(new Yb(M,a))}function Zb(a,b){D.call(this,"statevent",a),this.stat=b}function O(a){M.dispatchEvent(new Zb(M,a))}function $b(a,b,c){D.call(this,"timingevent",a),this.size=b,this.rtt=c}function ac(a,b,c){M.dispatchEvent(new $b(M,a,b,c))}function P(a,b){if(!q(a))throw Error("Fn must not be null and must be a function");return h.setTimeout(function(){a()},b)}function dc(){}function ec(){}function fc(){D.call(this,"d")}function gc(){D.call(this,"c")}function ic(){}function R(a,b,c,d,f){this.b=a,this.a=b,this.ra=c,this.R=d,this.Xc=f||1,this.Fc=new Jb(this),this.Ua=jc,a=La?125:void 0,this.Vc=new Gb(a),this.A=null,this.S=!1,this.Da=this.pa=this.ua=this.ic=this.qb=this.hd=this.Ga=null,this.ba=[],this.h=null,this.Bb=0,this.I=this.Fa=null,this.w=-1,this.Za=!1,this.Ra=0,this.ac=null,this.lb=this.Ed=this.yc=!1}function kc(a,b){return 0===a?"Non-200 return code ("+b+")":1===a?"XMLHTTP failure (no data)":2===a?"HttpConnection timeout":"Unknown error"}function nc(a){if(a.H&&"function"==typeof a.H)return a.H();if(l(a))return a.split("");if(ca(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Ba(a)}function oc(a,b,c){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,c);else if(ca(a)||l(a))na(a,b,c);else{if(a.W&&"function"==typeof a.W)var d=a.W();else if(a.H&&"function"==typeof a.H)d=void 0;else if(ca(a)||l(a)){d=[];for(var f=a.length,g=0;g<f;g++)d.push(g)}else d=Ca(a);f=nc(a),g=f.length;for(var k=0;k<g;k++)b.call(c,f[k],d&&d[k],a)}}function S(a){this.D={},this.o=[],this.j=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.addAll(a)}function T(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function qc(a,b){if(a){a=a.split("&");for(var c=0;c<a.length;c++){var d=a[c].indexOf("="),f=null;if(0<=d){var g=a[c].substring(0,d);f=a[c].substring(d+1)}else g=a[c];b(g,f?decodeURIComponent(f.replace(/\+/g," ")):"")}}}function U(a,b){this.xa=this.zb=this.qa="",this.Ca=null,this.ib=this.K="",this.O=this.Qf=!1;var c;a instanceof U?(this.O=void 0===b?a.O:b,this.tb(a.qa),this.cd(a.zb),this.rb(a.xa),this.sb(a.Ca),this.ec(a.K),this.bd(a.P.clone()),this.$c(a.ib)):a&&(c=(a+"").match(pc))?(this.O=!!b,this.tb(c[1]||"",!0),this.cd(c[2]||"",!0),this.rb(c[3]||"",!0),this.sb(c[4]),this.ec(c[5]||"",!0),this.bd(c[6]||"",!0),this.$c(c[7]||"",!0)):(this.O=!!b,this.P=new rc(null,this.O))}function Ac(a){return a instanceof U?a.clone():new U(a,void 0)}function Bc(a,b,c,d){var f=new U(null,void 0);return a&&f.tb(a),b&&f.rb(b),c&&f.sb(c),d&&f.ec(d),f}function yc(a,b){return a?b?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""}function sc(a,b,c){return l(a)?(a=encodeURI(a).replace(b,Cc),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Cc(a){return a=a.charCodeAt(0),"%"+(15&a>>4).toString(16)+(15&a).toString(16)}function rc(a,b){this.j=this.m=null,this.ja=a||null,this.O=!!b}function Hc(a,b){this.b=a,this.a=b,this.f=this.A=null,this.bc=!1,this.K=null,this.w=-1,this.Ad=this.na=null}function Ic(){this.od=this.$d=null}function Jc(a){this.D=new S,a&&this.addAll(a)}function Kc(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+(a[t]||(a[t]=++da)):b.substr(0,1)+a}function Lc(a,b){this.Pc=a,this.map=b,this.context=null}function Mc(a){this.me=a||Nc,h.PerformanceNavigationTiming?(a=h.performance.getEntriesByType("navigation"),a=0<a.length&&("hq"==a[0].nextHopProtocol||"h2"==a[0].nextHopProtocol)):a=!!(h.vc&&h.vc.ke&&h.vc.ke()&&h.vc.ke().nh),this.Xb=a?this.me:1,this.v=null,1<this.Xb&&(this.v=new Jc),this.f=null,this.ba=[]}function Oc(){this.xg=this.rg=void 0}function Pc(){this.jg=new Oc}function Qc(a,b){var c=new Xb;c.debug("TestLoadImage: loading "+a);var d=new Image;d.onload=v(Rc,c,d,"TestLoadImage: loaded",!0,b),d.onerror=v(Rc,c,d,"TestLoadImage: error",!1,b),d.onabort=v(Rc,c,d,"TestLoadImage: abort",!1,b),d.ontimeout=v(Rc,c,d,"TestLoadImage: timeout",!1,b),h.setTimeout(function(){d.ontimeout&&d.ontimeout()},1E4),d.src=a}function Rc(a,b,c,d,f){try{a.debug(c),b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,f(d)}catch(g){a.cb(g)}}function V(a){H.call(this),this.headers=new S,this.Xa=a||null,this.ha=!1,this.mc=this.c=null,this.ge=this.Tb="",this.Pa=0,this.I="",this.Aa=this.Lc=this.Qb=this.Ec=!1,this.vb=0,this.hc=null,this.Ae=Tc,this.jc=this.lg=this.Ab=!1}function Wc(a){return C&&Ta(9)&&"number"==typeof a.timeout&&void 0!==a.ontimeout}function qa(a){return"content-type"==a.toLowerCase()}function Xc(a,b){return{type:b,lengthComputable:a.lengthComputable,loaded:a.loaded,total:a.total}}function Yc(a){var b="";return Aa(a,function(a,d){b+=d,b+=":",b+=a,b+="\r\n"}),b}function Zc(a,b,c){a:{for(d in c){var d=!1;break a}d=!0}if(d)return a;if(c=Yc(c),l(a)){if(b=encodeURIComponent(b+""),c=null==c?"":"="+encodeURIComponent(c+""),b+=c){if(c=a.indexOf("#"),0>c&&(c=a.length),d=a.indexOf("?"),0>d||d>c){d=c;var f=""}else f=a.substring(d+1,c);a=[a.substr(0,d),f,a.substr(c)],c=a[1],a[1]=b?c?c+"&"+b:b:c,a=a[0]+(a[1]?"?"+a[1]:"")+a[2]}return a}return a.l(b,c),a}function $c(a){this.Bd=22,this.De=0,this.M=[],this.a=new Xb,this.Ib=new Ic,this.na=this.md=this.hb=this.K=this.u=this.Kc=this.aa=this.gb=this.N=this.Rb=this.A=null,this.Te=!0,this.ag=this.Yb=0,this.kf=!!m("internalChannelParams.failFast",a),this.fd=this.Ja=this.wa=this.ia=this.ea=this.i=null,this.Se=!0,this.w=this.he=this.Sb=-1,this.rc=this.Ha=this.La=0,this.Ve=m("internalChannelParams.baseRetryDelayMs",a)||5E3,this.vg=m("internalChannelParams.retryDelaySeedMs",a)||1E4,this.nf=m("internalChannelParams.forwardChannelMaxRetries",a)||2,this.Od=m("internalChannelParams.forwardChannelRequestTimeoutMs",a)||2E4,this.Xa=a&&a.oh||void 0,this.Db=void 0,this.Ra=0,this.gc=a&&a.supportsCrossDomainXhr||!1,this.ra="",this.G=new Mc(a&&a.concurrentRequestLimit),this.kc=new Pc,this.ta=a&&void 0!==a.backgroundChannelTest?a.backgroundChannelTest:!0,(this.Nd=a&&a.fastHandshake||!1)&&!this.ta&&(this.a.T("Force backgroundChannelTest when fastHandshake is enabled."),this.ta=!0),a&&a.Id&&this.a.Id()}function ad(){}function bd(){for(var b=arguments[0],c=1,d;c<arguments.length;c++)if(d=arguments[c],0==d.lastIndexOf("/",0))b=d;else{var f;(f=""==b)||(f=b.length-1,f=0<=f&&b.indexOf("/",f)==f),b=f?b+d:b+("/"+d)}return b}function cd(){if(C&&!(10<=+Ua))throw Error("Environmental error: no available transport.")}function W(a,b){H.call(this),this.b=new $c(b),this.yb=a,this.Qg=b&&b.testUrl?b.testUrl:bd(this.yb,"test"),this.s=Vb("goog.labs.net.webChannel.WebChannelBaseTransport"),this.Rc=b&&b.messageUrlParams||null,a=b&&b.messageHeaders||null,b&&b.clientProtocolHeaderRequired&&(a?a["X-Client-Protocol"]="webchannel":a={"X-Client-Protocol":"webchannel"}),this.b.ga(a),a=b&&b.initMessageHeaders||null,b&&b.messageContentType&&(a?a["X-WebChannel-Content-Type"]=b.messageContentType:a={"X-WebChannel-Content-Type":b.messageContentType}),b&&b.zd&&(a?a["X-WebChannel-Client-Profile"]=b.zd:a={"X-WebChannel-Client-Profile":b.zd}),this.b.Eg(a),(a=b&&b.httpHeadersOverwriteParam)&&!va(a)&&this.b.Cg(a),this.Og=b&&b.supportsCrossDomainXhr||!1,this.zg=b&&b.sendRawJson||!1,(b=b&&b.httpSessionIdParam)&&!va(b)&&(this.b.Dg(b),a=this.Rc,null!==a&&b in a&&(a=this.Rc,b in a&&delete a[b],(a=this.s)&&a.T("Ignore httpSessionIdParam also specified with messageUrlParams: "+b,void 0))),this.vd=new X(this)}function dd(a){fc.call(this);var b=a.__sm__;if(b){a:{for(var c in b){a=c;break a}a=void 0}(this.ne=a)&&(a=this.ne,b=null!==b&&a in b?b[a]:void 0),this.data=b}else this.data=a}function ed(a){gc.call(this),this.status=1,this.errorCode=a}function X(a){this.b=a}function gd(){this.V=[],this.Z=[]}function hd(a,b){if(z.call(this),this.oe=a||0,this.Wb=b||10,this.oe>this.Wb)throw Error(id);this.fa=new gd,this.oa=new Jc,this.Ac=0,this.Nc=null,this.Cb()}function jd(a,b){this.fe=a,this.gd=b}function kd(a){this.Y=[],a&&this.Lf(a)}function ld(){kd.call(this)}function Y(a,b){this.Gd=void 0,this.cc=new ld,hd.call(this,a,b)}function Z(a,b,c,d){this.Jf=a,this.Ab=!!d,Y.call(this,b,c)}exports.__esModule=!0;var commonjsGlobal="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?{}:self:global:window,goog=goog||{},h=commonjsGlobal,t="closure_uid_"+(1E9*Math.random()>>>0),da=0,w=Date.now||function(){return+new Date},e;x(y,Error),y.prototype.name="CustomError",x(ha,y),ha.prototype.name="AssertionError";var ja=0,ka={};z.prototype.Ka=!1,z.prototype.bb=function(){},z.prototype.F=function(){if(this.Qa)for(;this.Qa.length;)this.Qa.shift()()};var la=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(l(a))return l(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},ma=Array.prototype.lastIndexOf?function(a,b){return Array.prototype.lastIndexOf.call(a,b,a.length-1)}:function(a,b){var c=a.length-1;if(0>c&&(c=_Mathmax6(0,a.length+c)),l(a))return l(b)&&1==b.length?a.lastIndexOf(b,c):-1;for(;0<=c;c--)if(c in a&&a[c]===b)return c;return-1},na=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,f=l(a)?a.split(""):a,g=0;g<d;g++)g in f&&b.call(c,f[g],g,a)},oa=Array.prototype.some?function(a,b){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=l(a)?a.split(""):a,f=0;f<c;f++)if(f in d&&b.call(void 0,d[f],f,a))return!0;return!1},wa=String.prototype.trim?function(a){return a.trim()}:function(a){return /^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]},A;a:{var ya=h.navigator;if(ya){var za=ya.userAgent;if(za){A=za;break a}}A=""}var Ea=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];Ga[" "]=aa;var Ja=B("Opera"),C=B("Trident")||B("MSIE"),Ka=B("Edge"),La=Ka||C,Ma=B("Gecko")&&(-1==A.toLowerCase().indexOf("webkit")||B("Edge"))&&!(B("Trident")||B("MSIE"))&&!B("Edge"),Na=-1!=A.toLowerCase().indexOf("webkit")&&!B("Edge"),Pa;a:{var Qa="",Ra=function(){var a=A;return Ma?/rv:([^\);]+)(\)|;)/.exec(a):Ka?/Edge\/([\d\.]+)/.exec(a):C?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a):Na?/WebKit\/(\S+)/.exec(a):Ja?/(?:Version)[ \/]?(\S+)/.exec(a):void 0}();if(Ra&&(Qa=Ra?Ra[1]:""),C){var Sa=Oa();if(null!=Sa&&Sa>parseFloat(Qa)){Pa=Sa+"";break a}}Pa=Qa}var Ia={},Va=h.document,Ua;Ua=Va&&C?Oa()||("CSS1Compat"==Va.compatMode?parseInt(Pa,10):5):void 0;var Wa=Object.freeze||function(a){return a},Xa=!C||9<=+Ua,Ya=C&&!Ta("9"),Za=function(){if(!h.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},"passive",{get:function(){a=!0}});try{h.addEventListener("test",aa,b),h.removeEventListener("test",aa,b)}catch(c){}return a}();D.prototype.stopPropagation=function(){this.Ea=!0},D.prototype.preventDefault=function(){this.defaultPrevented=!0,this.Be=!1},x(E,D);var $a=Wa({2:"touch",3:"pen",4:"mouse"});E.prototype.Kf=function(a,b){var c=this.type=a.type,d=a.changedTouches?a.changedTouches[0]:null;if(this.target=a.target||a.srcElement,this.currentTarget=b,!(b=a.relatedTarget))"mouseover"==c?b=a.fromElement:"mouseout"==c&&(b=a.toElement);else if(Ma){a:{try{Ga(b.nodeName);var f=!0;break a}catch(g){}f=!1}f||(b=null)}this.relatedTarget=b,null===d?(this.offsetX=Na||void 0!==a.offsetX?a.offsetX:a.layerX,this.offsetY=Na||void 0!==a.offsetY?a.offsetY:a.layerY,this.clientX=void 0===a.clientX?a.pageX:a.clientX,this.clientY=void 0===a.clientY?a.pageY:a.clientY,this.screenX=a.screenX||0,this.screenY=a.screenY||0):(this.clientX=void 0===d.clientX?d.pageX:d.clientX,this.clientY=void 0===d.clientY?d.pageY:d.clientY,this.screenX=d.screenX||0,this.screenY=d.screenY||0),this.button=a.button,this.keyCode=a.keyCode||0,this.key=a.key||"",this.charCode=a.charCode||("keypress"==c?a.keyCode:0),this.ctrlKey=a.ctrlKey,this.altKey=a.altKey,this.shiftKey=a.shiftKey,this.metaKey=a.metaKey,this.pointerId=a.pointerId||0,this.pointerType=l(a.pointerType)?a.pointerType:$a[a.pointerType]||"",this.state=a.state,this.fb=a,a.defaultPrevented&&this.preventDefault()},E.prototype.stopPropagation=function(){E.L.stopPropagation.call(this),this.fb.stopPropagation?this.fb.stopPropagation():this.fb.cancelBubble=!0},E.prototype.preventDefault=function(){E.L.preventDefault.call(this);var a=this.fb;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Ya)try{(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)&&(a.keyCode=-1)}catch(b){}};var ab="closure_listenable_"+(0|1E6*Math.random()),bb=0;cb.prototype.Vb=function(){this.Sa=!0,this.Ob=this.src=this.proxy=this.listener=null},e=db.prototype,e.add=function(a,b,c,d,f){var g=a.toString();a=this.J[g],a||(a=this.J[g]=[],this.xb++);var k=eb(a,b,d,f);return-1<k?(b=a[k],c||(b.Eb=!1)):(b=new cb(b,this.src,g,!!d,f),b.Eb=c,a.push(b)),b},e.remove=function(a,b,c,d){if(a=a.toString(),!(a in this.J))return!1;var f=this.J[a];return b=eb(f,b,c,d),!!(-1<b)&&(f[b].Vb(),Array.prototype.splice.call(f,b,1),0==f.length&&(delete this.J[a],this.xb--),!0)},e.ye=function(a){var b=a.type;b in this.J&&sa(this.J[b],a)&&(a.Vb(),0==this.J[b].length&&(delete this.J[b],this.xb--))},e.pb=function(a){a=a&&a.toString();for(var c in this.J)if(!a||c==a){for(var d=this.J[c],f=0;f<d.length;f++)d[f].Vb();delete this.J[c],this.xb--}},e.jb=function(a,b,c,d){a=this.J[a.toString()];var f=-1;return a&&(f=eb(a,b,c,d)),-1<f?a[f]:null};var fb="closure_lm_"+(0|1E6*Math.random()),gb={},tb="__closure_events_fn_"+(1E9*Math.random()>>>0);x(H,z),H.prototype[ab]=!0,e=H.prototype,e.addEventListener=function(a,b,c,d){ib(this,a,b,c,d)},e.removeEventListener=function(a,b,c,d){pb(this,a,b,c,d)},e.dispatchEvent=function(a){var c=this.Uc,b;if(c)for(b=[];c;c=c.Uc)b.push(c);c=this.Pe;var d=a.type||a;if(l(a))a=new D(a,c);else if(a instanceof D)a.target=a.target||c;else{var f=a;a=new D(d,c),Fa(a,f)}if(f=!0,b)for(var g=b.length-1,k;!a.Ea&&0<=g;g--)k=a.currentTarget=b[g],f=k.Lb(d,!0,a)&&f;if(a.Ea||(k=a.currentTarget=c,f=k.Lb(d,!0,a)&&f,a.Ea||(f=k.Lb(d,!1,a)&&f)),b)for(g=0;!a.Ea&&g<b.length;g++)k=a.currentTarget=b[g],f=k.Lb(d,!1,a)&&f;return f},e.F=function(){H.L.F.call(this),this.pg(),this.Uc=null},e.nb=function(a,b,c,d){return this.ka.add(a+"",b,!1,c,d)},e.Oc=function(a,b,c,d){return this.ka.add(a+"",b,!0,c,d)},e.ed=function(a,b,c,d){this.ka.remove(a+"",b,c,d)},e.Le=function(a){this.ka.ye(a)},e.pg=function(){this.ka&&this.ka.pb(void 0)},e.Lb=function(a,b,c){if(a=this.ka.J[a+""],!a)return!0;a=a.concat();for(var d=!0,f=0,g;f<a.length;++f)if(g=a[f],g&&!g.Sa&&g.capture==b){var k=g.listener,p=g.Ob||g.src;g.Eb&&this.Le(g),d=!1!==k.call(p,c)&&d}return d&&0!=c.Be},e.jb=function(a,b,c,d){return this.ka.jb(a+"",b,c,d)};var ub=h.JSON.stringify;vb.prototype.get=function(){if(0<this.Zb){this.Zb--;var a=this.Pb;this.Pb=a.next,a.next=null}else a=this.ef();return a},vb.prototype.put=function(a){this.ug(a),this.Zb<this.Sf&&(this.Zb++,a.next=this.Pb,this.Pb=a)};var xb=new vb(function(){return new wb},function(a){a.reset()});I.prototype.add=function(a,b){var c=this.Af();c.set(a,b),this.lc?this.lc.next=c:this.Va=c,this.lc=c},I.prototype.remove=function(){var a=null;return this.Va&&(a=this.Va,this.Va=this.Va.next,this.Va||(this.lc=null),a.next=null),a},I.prototype.wg=function(a){xb.put(a)},I.prototype.Af=function(){return xb.get()},wb.prototype.set=function(a,b){this.Gc=a,this.scope=b,this.next=null},wb.prototype.reset=function(){this.next=this.scope=this.Gc=null};var Eb=!1,Fb=new I,zb,Bb;x(Gb,H),e=Gb.prototype,e.enabled=!1,e.B=null,e.setInterval=function(a){this.Na=a,this.B&&this.enabled?(this.stop(),this.start()):this.B&&this.stop()},e.Rg=function(){if(this.enabled){var a=w()-this.ie;0<a&&a<.8*this.Na?this.B=this.wb.setTimeout(this.nd,this.Na-a):(this.B&&(this.wb.clearTimeout(this.B),this.B=null),this.ff(),this.enabled&&(this.stop(),this.start()))}},e.ff=function(){this.dispatchEvent("tick")},e.start=function(){this.enabled=!0,this.B||(this.B=this.wb.setTimeout(this.nd,this.Na),this.ie=w())},e.stop=function(){this.enabled=!1,this.B&&(this.wb.clearTimeout(this.B),this.B=null)},e.F=function(){Gb.L.F.call(this),this.stop(),delete this.wb},x(Ib,z),e=Ib.prototype,e.Ta=!1,e.ob=0,e.B=null,e.mf=function(){this.qc=arguments,this.B||this.ob?this.Ta=!0:this.Cc()},e.stop=function(){this.B&&(h.clearTimeout(this.B),this.B=null,this.Ta=!1,this.qc=[])},e.pause=function(){this.ob++},e.resume=function(){this.ob--,this.ob||!this.Ta||this.B||(this.Ta=!1,this.Cc())},e.F=function(){Ib.L.F.call(this),this.stop()},e.fg=function(){this.B=null,this.Ta&&!this.ob&&(this.Ta=!1,this.Cc())},e.Cc=function(){this.B=Hb(this.Xe,this.Na),this.Uf.apply(null,this.qc)},x(Jb,z);var Kb=[];e=Jb.prototype,e.nb=function(a,b,c,d){return this.Tf(a,b,c,d)},e.Tf=function(a,b,c,d){n(b)||(b&&(Kb[0]=b.toString()),b=Kb);for(var f=0,g;f<b.length&&(g=ib(a,b[f],c||this.handleEvent,d||!1,this.i||this),!!g);f++)this.o[g.key]=g;return this},e.Oc=function(a,b,c,d){return this.je(a,b,c,d)},e.je=function(a,b,c,d,f){if(n(b))for(var g=0;g<b.length;g++)this.je(a,b[g],c,d,f);else{if(a=jb(a,b,c||this.handleEvent,d,f||this.i||this),!a)return this;this.o[a.key]=a}return this},e.ed=function(a,b,c,d,f){if(n(b))for(var g=0;g<b.length;g++)this.ed(a,b[g],c,d,f);else c=c||this.handleEvent,d=r(d)?!!d.capture:!!d,f=f||this.i||this,c=kb(c),d=!!d,b=F(a)?a.jb(b,c,d,f):a?(a=G(a))?a.jb(b,c,d,f):null:null,b&&(qb(b),delete this.o[b.key])},e.pb=function(){Aa(this.o,function(a,b){this.o.hasOwnProperty(b)&&qb(a)},this),this.o={}},e.F=function(){Jb.L.F.call(this),this.pb()},e.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},J.prototype.Md=null,J.prototype.reset=function(a){this.mb=a,delete this.Md},J.prototype.Bg=function(a){this.Md=a},J.prototype.Ge=function(a){this.mb=a},K.prototype.toString=function(){return this.name};var Nb=new K("SEVERE",1E3),Ob=new K("WARNING",900),Pb=new K("INFO",800),Qb=new K("CONFIG",700),Rb=new K("FINE",500);e=Mb.prototype,e.getName=function(){return this.pe},e.getParent=function(){return this.$b},e.pf=function(){return this.uc||(this.uc={}),this.uc},e.Ge=function(a){this.mb=a},e.Qd=function(){return this.mb?this.mb:this.$b?this.$b.Qd():(ia("Root logger has no level set."),null)},e.Pf=function(a){return a.value>=this.Qd().value},e.log=function(a,b,c){this.Pf(a)&&(q(b)&&(b=b()),this.gf(this.uf(a,b,c)))},e.uf=function(a,b,c){return a=new J(a,b+"",this.pe),c&&a.Bg(c),a},e.ca=function(a,b){this.log(Nb,a,b)},e.T=function(a,b){this.log(Ob,a,b)},e.info=function(a,b){this.log(Pb,a,b)},e.lf=function(a){this.log(Rb,a,void 0)},e.gf=function(a){for(var b=this;b;)b.We(a),b=b.getParent()},e.We=function(a){if(this.Zd)for(var b=0,c;c=this.Zd[b];b++)c(a)},e.Fg=function(a){this.$b=a},e.Qe=function(a,b){this.pf()[a]=b};var Sb={},Tb=null;e=Xb.prototype,e.Id=function(){this.Wc=!1},e.Tg=function(a,b,c,d,f){var g=this;this.info(function(){return"XMLHTTP REQ ("+c+") [attempt "+d+"]: "+a+"\n"+b+"\n"+g.Xf(f)})},e.Ug=function(a,b,c,d,f,g){this.info(function(){return"XMLHTTP RESP ("+c+") [ attempt "+d+"]: "+a+"\n"+b+"\n"+f+" "+g})},e.Wa=function(a,b,c){var d=this;this.info(function(){return"XMLHTTP TEXT ("+a+"): "+d.ng(b)+(c?" "+c:"")})},e.Sg=function(a){this.info(function(){return"TIMEOUT: "+a})},e.debug=function(a){L(this.s,a)},e.cb=function(a,b){var c=this.s;c&&c.ca(b||"Exception",a)},e.info=function(a){Wb(this.s,a)},e.T=function(a){var b=this.s;b&&b.T(a,void 0)},e.ca=function(a){var b=this.s;b&&b.ca(a,void 0)},e.ng=function(a){if(!this.Wc)return a;if(!a)return null;try{var b=JSON.parse(a);if(b)for(var c=0;c<b.length;c++)n(b[c])&&this.Wf(b[c]);return ub(b)}catch(d){return this.debug("Exception parsing expected JS array - probably was not JS"),a}},e.Wf=function(a){if(!(2>a.length||(a=a[1],!n(a)||1>a.length))){var b=a[0];if("noop"!=b&&"stop"!=b&&"close"!=b)for(b=1;b<a.length;b++)a[b]=""}},e.Xf=function(a){if(!this.Wc)return a;if(!a)return null;var b="";a=a.split("&");for(var c=0,d;c<a.length;c++)if(d=a[c].split("="),1<d.length){var f=d[0];d=d[1];var g=f.split("_");b=2<=g.length&&"type"==g[1]?b+(f+"="+d+"&"):b+(f+"=redacted&")}return b};var M=new H;x(Yb,D),x(Zb,D),x($b,D);var bc={NO_ERROR:0,Vg:1,bh:2,ah:3,Yg:4,$g:5,dh:6,Ne:7,TIMEOUT:8,gh:9},cc={Xg:"complete",kh:"success",Oe:"error",Ne:"abort",ih:"ready",jh:"readystatechange",TIMEOUT:"timeout",eh:"incrementaldata",hh:"progress",Zg:"downloadprogress",lh:"uploadprogress"};dc.prototype.pd=null,dc.prototype.Vd=function(){return this.pd||(this.pd=this.Mf())};var Q={OPEN:"a",Wg:"b",Oe:"c",fh:"d"};x(fc,D),x(gc,D);var hc;x(ic,dc),ic.prototype.Dd=function(){var a=this.Wd();return a?new ActiveXObject(a):new XMLHttpRequest},ic.prototype.Mf=function(){var a={};return this.Wd()&&(a[0]=!0,a[1]=!0),a},ic.prototype.Wd=function(){if(!this.be&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var a=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],b=0,c;b<a.length;b++){c=a[b];try{return new ActiveXObject(c),this.be=c}catch(d){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return this.be},hc=new ic;var jc=45E3,lc={},mc={};e=R.prototype,e.ga=function(a){this.A=a},e.setTimeout=function(a){this.Ua=a},e.He=function(a){this.Ra=a},e.Gg=function(a){this.ba=a},e.la=function(){return this.ba},e.kd=function(a,b){this.ic=1,this.ua=a.clone().Ub(),this.Da=b,this.yc=!0,this.Ce(null)},e.jd=function(a,b,c){this.ic=1,this.ua=a.clone().Ub(),this.Da=null,this.yc=b,this.Ce(c)},e.Ce=function(a){this.qb=w(),this.eb(),this.pa=this.ua.clone(),this.pa.dc("t",this.Xc),this.Bb=0,this.h=this.b.Jb(this.b.fc()?a:null),0<this.Ra&&(this.ac=new Ib(u(this.Me,this,this.h),this.Ra)),this.Fc.nb(this.h,"readystatechange",this.mg),a=this.A?Da(this.A):{},this.Da?(this.Fa||(this.Fa="POST"),a["Content-Type"]="application/x-www-form-urlencoded",this.h.send(this.pa,this.Fa,this.Da,a)):(this.Fa="GET",this.h.send(this.pa,this.Fa,null,a)),N(1),this.a.Tg(this.Fa,this.pa,this.R,this.Xc,this.Da)},e.mg=function(a){a=a.target;var b=this.ac;b&&3==a.ma()?(this.a.debug("Throttling readystatechange."),b.mf()):this.Me(a)},e.Me=function(a){try{a==this.h?this.hg():this.a.T("Called back with an unexpected xmlhttp")}catch(c){if(this.a.debug("Failed call to OnXmlHttpReadyStateChanged_"),this.h&&this.h.ya()){var b=this;this.a.cb(c,function(){return"ResponseText: "+b.h.ya()})}else this.a.cb(c,"No response text")}finally{}},e.hg=function(){var a=this.h.ma(),b=this.h.Ud(),c=this.h.za();if(!(3>a)&&(3!=a||La||this.h.ya())){this.Za||4!=a||7==b||(8==b||0>=c?N(3):N(2)),this.Fb();var d=this.h.za();if(this.w=d,b=this.h.ya(),!b){var f=this;this.a.debug(function(){return"No response text for uri "+f.pa+" status "+d})}if(this.S=200==d,this.a.Ug(this.Fa,this.pa,this.R,this.Xc,a,d),this.S){if(this.Ig())if(c=this.sf())this.a.Wa(this.R,c,"Initial handshake response via X-HTTP-Initial-Response"),this.lb=!0,this.Yc(c);else return this.S=!1,this.I=3,O(12),this.a.T("XMLHTTP Missing X_HTTP_INITIAL_RESPONSE ("+this.R+")"),this.Ia(),void this.Kb();this.yc?(this.Fd(a,b),La&&this.S&&3==a&&this.Ng()):(this.a.Wa(this.R,b,null),this.Yc(b)),4==a&&this.Ia(),this.S&&!this.Za&&(4==a?this.b.Tc(this):(this.S=!1,this.eb()))}else 400==d&&0<b.indexOf("Unknown SID")?(this.I=3,O(12),this.a.T("XMLHTTP Unknown SID ("+this.R+")")):(this.I=0,O(13),this.a.T("XMLHTTP Bad status "+d+" ("+this.R+")")),this.Ia(),this.Kb()}},e.Ig=function(){return this.Ed&&!this.lb},e.sf=function(){if(this.h){var a=this.h.kb("X-HTTP-Initial-Response");if(a&&!va(a))return a}return null},e.Ag=function(){this.Ed=!0},e.Fd=function(a,b){for(var c=!0,d;!this.Za&&this.Bb<b.length;)if(d=this.vf(b),d==mc){4==a&&(this.I=4,O(14),c=!1),this.a.Wa(this.R,null,"[Incomplete Response]");break}else if(d==lc){this.I=4,O(15),this.a.Wa(this.R,b,"[Invalid Chunk]"),c=!1;break}else this.a.Wa(this.R,d,null),this.Yc(d);4==a&&0==b.length&&(this.I=1,O(16),c=!1),this.S=this.S&&c,c||(this.a.Wa(this.R,b,"[Invalid Chunked Response]"),this.Ia(),this.Kb())},e.kg=function(){if(this.h){var a=this.h.ma(),b=this.h.ya();this.Bb<b.length&&(this.Fb(),this.Fd(a,b),this.S&&4!=a&&this.eb())}},e.Ng=function(){this.Fc.nb(this.Vc,"tick",this.kg),this.Vc.start()},e.vf=function(a){var b=this.Bb,c=a.indexOf("\n",b);return-1==c?mc:(b=+a.substring(b,c),isNaN(b))?lc:(c+=1,c+b>a.length)?mc:(a=a.substr(c,b),this.Bb=c+b,a)},e.yg=function(a){this.ic=2,this.ua=a.clone().Ub(),a=!1,h.navigator&&h.navigator.sendBeacon&&(a=h.navigator.sendBeacon(this.ua.toString(),"")),!a&&h.Image&&(new Image().src=this.ua,a=!0),a||(this.h=this.b.Jb(null),this.h.send(this.ua)),this.qb=w(),this.eb()},e.cancel=function(){this.Za=!0,this.Ia()},e.tg=function(a){a&&this.setTimeout(a),this.Ga&&(this.Fb(),this.eb())},e.eb=function(){this.hd=w()+this.Ua,this.Ke(this.Ua)},e.Ke=function(a){if(null!=this.Ga)throw Error("WatchDog timer not null");this.Ga=P(u(this.gg,this),a)},e.Fb=function(){this.Ga&&(h.clearTimeout(this.Ga),this.Ga=null)},e.gg=function(){this.Ga=null;var a=w();0<=a-this.hd?this.Df():(this.a.T("WatchDog timer called too early"),this.Ke(this.hd-a))},e.Df=function(){this.S&&this.a.ca("Received watchdog timeout even though request loaded successfully"),this.a.Sg(this.pa),2!=this.ic&&(N(3),O(17)),this.Ia(),this.I=2,this.Kb()},e.Kb=function(){this.b.de()||this.Za||this.b.Tc(this)},e.Ia=function(){this.Fb();var a=this.ac;a&&"function"==typeof a.bb&&a.bb(),this.ac=null,this.Vc.stop(),this.Fc.pb(),this.h&&(a=this.h,this.h=null,a.abort(),a.bb())},e.Hc=function(){return this.I},e.Yc=function(a){try{this.b.ue(this,a),N(4)}catch(b){this.a.cb(b,"Error in httprequest callback")}},e=S.prototype,e.C=function(){return this.j},e.H=function(){this.wc();for(var a=[],b=0;b<this.o.length;b++)a.push(this.D[this.o[b]]);return a},e.W=function(){return this.wc(),this.o.concat()},e.va=function(a){return T(this.D,a)},e.X=function(){return 0==this.j},e.clear=function(){this.D={},this.j=this.o.length=0},e.remove=function(a){return!!T(this.D,a)&&(delete this.D[a],this.j--,this.o.length>2*this.j&&this.wc(),!0)},e.wc=function(){if(this.j!=this.o.length){for(var a=0,b=0,c;a<this.o.length;)c=this.o[a],T(this.D,c)&&(this.o[b++]=c),a++;this.o.length=b}if(this.j!=this.o.length){var d={};for(b=a=0;a<this.o.length;)c=this.o[a],T(d,c)||(this.o[b++]=c,d[c]=1),a++;this.o.length=b}},e.get=function(a,b){return T(this.D,a)?this.D[a]:b},e.set=function(a,b){T(this.D,a)||(this.j++,this.o.push(a)),this.D[a]=b},e.addAll=function(a){if(a instanceof S)for(var b=a.W(),c=0;c<b.length;c++)this.set(b[c],a.get(b[c]));else for(b in a)this.set(b,a[b])},e.forEach=function(a,b){for(var c=this.W(),d=0;d<c.length;d++){var f=c[d],g=this.get(f);a.call(b,g,f,this)}},e.clone=function(){return new S(this)};var pc=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;e=U.prototype,e.toString=function(){var a=[],b=this.qa;b&&a.push(sc(b,tc,!0),":");var c=this.xa;return(c||"file"==b)&&(a.push("//"),(b=this.zb)&&a.push(sc(b,tc,!0),"@"),a.push(encodeURIComponent(c+"").replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c=this.Ca,null!=c&&a.push(":",c+"")),(c=this.K)&&(this.Ic()&&"/"!=c.charAt(0)&&a.push("/"),a.push(sc(c,"/"==c.charAt(0)?uc:wc,!0))),(c=this.Rd())&&a.push("?",c),(c=this.ib)&&a.push("#",sc(c,xc)),a.join("")},e.resolve=function(a){var b=this.clone(),c=a.Hf();c?b.tb(a.qa):c=a.If(),c?b.cd(a.zb):c=a.Ic(),c?b.rb(a.xa):c=a.Ff();var d=a.K;if(c)b.sb(a.Ca);else if(c=a.ae()){if("/"!=d.charAt(0))if(this.Ic()&&!this.ae())d="/"+d;else{var f=b.K.lastIndexOf("/");-1!=f&&(d=b.K.substr(0,f+1)+d)}if(f=d,".."==f||"."==f)d="";else if(-1!=f.indexOf("./")||-1!=f.indexOf("/.")){d=0==f.lastIndexOf("/",0),f=f.split("/");for(var g=[],k=0,p;k<f.length;)p=f[k++],"."==p?d&&k==f.length&&g.push(""):".."==p?((1<g.length||1==g.length&&""!=g[0])&&g.pop(),d&&k==f.length&&g.push("")):(g.push(p),d=!0);d=g.join("/")}else d=f}return c?b.ec(d):c=a.Gf(),c?b.bd(a.P.clone()):c=a.Ef(),c&&b.$c(a.ib),b},e.clone=function(){return new U(this)},e.tb=function(a,b){this.U(),(this.qa=b?yc(a,!0):a)&&(this.qa=this.qa.replace(/:$/,""))},e.Hf=function(){return!!this.qa},e.cd=function(a,b){this.U(),this.zb=b?yc(a):a},e.If=function(){return!!this.zb},e.rb=function(a,b){this.U(),this.xa=b?yc(a,!0):a},e.Ic=function(){return!!this.xa},e.sb=function(a){if(this.U(),a){if(a=+a,isNaN(a)||0>a)throw Error("Bad port number "+a);this.Ca=a}else this.Ca=null},e.Ff=function(){return null!=this.Ca},e.ec=function(a,b){this.U(),this.K=b?yc(a,!0):a},e.ae=function(){return!!this.K},e.Gf=function(){return""!==this.P.toString()},e.bd=function(a,b){this.U(),a instanceof rc?(this.P=a,this.P.ad(this.O)):(b||(a=sc(a,zc)),this.P=new rc(a,this.O))},e.Rd=function(){return this.P.toString()},e.getQuery=function(){return this.Rd()},e.l=function(a,b){this.U(),this.P.set(a,b)},e.dc=function(a,b){this.U(),n(b)||(b=[b+""]),this.P.Ie(a,b)},e.$c=function(a,b){this.U(),this.ib=b?yc(a):a},e.Ef=function(){return!!this.ib},e.Ub=function(){return this.U(),this.l("zx",_Mathfloor5(2147483648*Math.random()).toString(36)+Math.abs(_Mathfloor5(2147483648*Math.random())^w()).toString(36)),this},e.removeParameter=function(a){return this.U(),this.P.remove(a),this},e.U=function(){if(this.Qf)throw Error("Tried to modify a read-only Uri")},e.ad=function(a){this.O=a,this.P&&this.P.ad(a)};var tc=/[#\/\?@]/g,wc=/[#\?:]/g,uc=/[#\?]/g,zc=/[#\?@]/g,xc=/#/g;e=rc.prototype,e.$=function(){if(!this.m&&(this.m=new S,this.j=0,this.ja)){var a=this;qc(this.ja,function(b,c){a.add(decodeURIComponent(b.replace(/\+/g," ")),c)})}},e.C=function(){return this.$(),this.j},e.add=function(a,b){this.$(),this.Oa(),a=this.Ma(a);var c=this.m.get(a);return c||this.m.set(a,c=[]),c.push(b),this.j+=1,this},e.remove=function(a){return this.$(),a=this.Ma(a),!!this.m.va(a)&&(this.Oa(),this.j-=this.m.get(a).length,this.m.remove(a))},e.clear=function(){this.Oa(),this.m=null,this.j=0},e.X=function(){return this.$(),0==this.j},e.va=function(a){return this.$(),a=this.Ma(a),this.m.va(a)},e.forEach=function(a,b){this.$(),this.m.forEach(function(c,d){na(c,function(c){a.call(b,c,d,this)},this)},this)},e.W=function(){this.$();for(var a=this.m.H(),b=this.m.W(),c=[],d=0;d<b.length;d++)for(var f=a[d],g=0;g<f.length;g++)c.push(b[d]);return c},e.H=function(a){this.$();var b=[];if(l(a))this.va(a)&&(b=ta(b,this.m.get(this.Ma(a))));else{a=this.m.H();for(var c=0;c<a.length;c++)b=ta(b,a[c])}return b},e.set=function(a,b){return this.$(),this.Oa(),a=this.Ma(a),this.va(a)&&(this.j-=this.m.get(a).length),this.m.set(a,[b]),this.j+=1,this},e.get=function(a,b){return a?(a=this.H(a),0<a.length?a[0]+"":b):b},e.Ie=function(a,b){this.remove(a),0<b.length&&(this.Oa(),this.m.set(this.Ma(a),ua(b)),this.j+=b.length)},e.toString=function(){if(this.ja)return this.ja;if(!this.m)return"";for(var a=[],b=this.m.W(),c=0;c<b.length;c++){var d=b[c],f=encodeURIComponent(d+"");d=this.H(d);for(var g=0,k;g<d.length;g++)k=f,""!==d[g]&&(k+="="+encodeURIComponent(d[g]+"")),a.push(k)}return this.ja=a.join("&")},e.Oa=function(){this.ja=null},e.clone=function(){var a=new rc;return a.ja=this.ja,this.m&&(a.m=this.m.clone(),a.j=this.j),a},e.Ma=function(a){return a+="",this.O&&(a=a.toLowerCase()),a},e.ad=function(a){a&&!this.O&&(this.$(),this.Oa(),this.m.forEach(function(a,c){var b=c.toLowerCase();c!=b&&(this.remove(c),this.Ie(b,a))},this)),this.O=a},e.extend=function(){for(var b=0;b<arguments.length;b++)oc(arguments[b],function(a,b){this.add(b,a)},this)},x(function(){},function(){}),e=Hc.prototype,e.g=null,e.ga=function(a){this.A=a},e.connect=function(a){this.K=a,a=this.b.Sd(this.K),O(3);var b=this.b.Ib.$d;null==b?(a.dc("MODE","init"),!this.b.ta&&this.b.aa&&a.dc("X-HTTP-Session-Id",this.b.aa),this.f=new R(this,this.a,void 0,void 0,void 0),this.f.ga(this.A),this.f.jd(a,!1,null),this.g=0):(this.na=this.b.$a(b[0]),this.g=1,this.xd())},e.xd=function(){this.a.debug("TestConnection: starting stage 2");var a=this.b.Ib.od;if(null!=a)this.a.debug(function(){return"Buffered"}),O(4),a?(O(10),this.b.ub(this,!1)):(O(11),this.b.ub(this,!0));else{this.f=new R(this,this.a,void 0,void 0,void 0),this.f.ga(this.A);var b=this.b.Pd(this.na,this.K);O(4),b.dc("TYPE","xmlhttp");var c=this.b.aa,d=this.b.Kc;c&&d&&b.l(c,d),this.f.jd(b,!1,this.na)}},e.Jb=function(a){return this.b.Jb(a)},e.abort=function(){this.f&&(this.f.cancel(),this.f=null),this.w=-1},e.de=function(){return!1},e.ue=function(a,b){if(this.w=a.w,0!=this.g)1==this.g&&(this.bc?O(6):"11111"==b?(O(5),this.bc=!0,this.Ze()&&(this.w=200,this.f.cancel(),this.a.debug("Test connection succeeded; using streaming connection"),O(11),this.b.ub(this,!0))):(O(7),this.bc=!1));else if(this.a.debug("TestConnection: Got data for stage 1"),this.pc(a),b){try{var c=this.b.kc.zc(b)}catch(d){return this.a.cb(d),void this.b.dd(this)}this.na=this.b.$a(c[0])}else this.a.debug("TestConnection: Null responseText"),this.b.dd(this)},e.Tc=function(){this.w=this.f.w,this.f.S?0==this.g?(this.g=1,this.a.debug("TestConnection: request complete for initial check"),this.xd()):1==this.g&&(this.a.debug("TestConnection: request complete for stage 2"),this.bc?(this.a.debug("Test connection succeeded; using streaming connection"),O(11),this.b.ub(this,!0)):(this.a.debug("Test connection failed; not using streaming"),O(10),this.b.ub(this,!1))):(this.a.debug("TestConnection: request failed, in state "+this.g),0==this.g?O(8):1==this.g&&O(9),this.b.dd(this))},e.pc=function(a){if(!this.b.ta&&(a=a.h)){var b=a.kb("X-Client-Wire-Protocol");this.Ad=b?b:null,this.b.aa&&((a=a.kb("X-HTTP-Session-Id"))?this.b.Fe(a):this.a.T("Missing X_HTTP_SESSION_ID in the handshake response"))}},e.fc=function(){return this.b.fc()},e.Ba=function(){return this.b.Ba()},e.Ze=function(){return!C||10<=+Ua},e=Jc.prototype,e.C=function(){return this.D.C()},e.add=function(a){this.D.set(Kc(a),a)},e.addAll=function(a){a=nc(a);for(var b=a.length,c=0;c<b;c++)this.add(a[c])},e.pb=function(a){a=nc(a);for(var b=a.length,c=0;c<b;c++)this.remove(a[c])},e.remove=function(a){return this.D.remove(Kc(a))},e.clear=function(){this.D.clear()},e.X=function(){return this.D.X()},e.contains=function(a){return this.D.va(Kc(a))},e.H=function(){return this.D.H()},e.clone=function(){return new Jc(this)};var Nc=10;e=Mc.prototype,e.ld=function(a){this.v||-1==a.indexOf("spdy")&&-1==a.indexOf("quic")&&-1==a.indexOf("h2")||(this.Xb=this.me,this.v=new Jc,this.f&&(this.oc(this.f),this.f=null))},e.ee=function(){return!!this.f||!!this.v&&this.v.C()>=this.Xb},e.xf=function(){return this.f?1:this.v?this.v.C():0},e.Jc=function(a){return this.f?this.f==a:!!this.v&&this.v.contains(a)},e.oc=function(a){this.v?this.v.add(a):this.f=a},e.ze=function(a){this.f&&this.f==a?this.f=null:this.v&&this.v.contains(a)&&this.v.remove(a)},e.cancel=function(){this.ba=this.la(),this.f?(this.f.cancel(),this.f=null):this.v&&!this.v.X()&&(na(this.v.H(),function(a){a.cancel()}),this.v.clear())},e.la=function(){if(null!=this.f)return this.ba.concat(this.f.la());if(null!=this.v&&!this.v.X()){var a=this.ba;return na(this.v.H(),function(b){a=a.concat(b.la())}),a}return ua(this.ba)},e.Re=function(a){this.ba=this.ba.concat(a)},e.$e=function(){this.ba.length=0},Oc.prototype.stringify=function(a){return h.JSON.stringify(a,this.rg)},Oc.prototype.parse=function(a){return h.JSON.parse(a,this.xg)},Pc.prototype.hf=function(a,b,c){var d=c||"";try{oc(a,function(a,c){var f=a;r(a)&&(f=ub(a)),b.push(d+c+"="+encodeURIComponent(f))})}catch(f){throw b.push(d+"type="+encodeURIComponent("_badmap")),f}},Pc.prototype.jf=function(a,b,c){for(var d=-1,f;;){f=["count="+b],-1==d?0<b?(d=a[0].Pc,f.push("ofs="+d)):d=0:f.push("ofs="+d);for(var g=!0,k=0;k<b;k++){var p=a[k].Pc,Ub=a[k].map;if(p-=d,0>p)d=_Mathmax6(0,a[k].Pc-100),g=!1;else try{this.hf(Ub,f,"req"+p+"_")}catch(md){c&&c(Ub)}}if(g)return f.join("&")}},Pc.prototype.zc=function(a){return this.jg.parse(a)};var Sc=h.JSON.parse;x(V,H);var Tc="";V.prototype.s=Vb("goog.net.XhrIo");var Uc=/^https?$/i,Vc=["POST","PUT"];e=V.prototype,e.Je=function(a){this.Ab=a},e.send=function(a,b,c,d){if(this.c)throw Error("[goog.net.XhrIo] Object is active with another request="+this.Tb+"; newUri="+a);b=b?b.toUpperCase():"GET",this.Tb=a,this.I="",this.Pa=0,this.ge=b,this.Ec=!1,this.ha=!0,this.c=this.df(),this.mc=this.Xa?this.Xa.Vd():hc.Vd(),this.c.onreadystatechange=u(this.te,this),this.lg&&"onprogress"in this.c&&(this.c.onprogress=u(function(a){this.re(a,!0)},this),this.c.upload&&(this.c.upload.onprogress=u(this.re,this)));try{L(this.s,this.da("Opening Xhr")),this.Lc=!0,this.c.open(b,a+"",!0),this.Lc=!1}catch(g){return L(this.s,this.da("Error opening Xhr: "+g.message)),void this.Ld(g)}a=c||"";var f=this.headers.clone();d&&oc(d,function(a,b){f.set(b,a)}),d=pa(f.W()),c=h.FormData&&a instanceof h.FormData,!(0<=la(Vc,b))||d||c||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),f.forEach(function(a,b){this.c.setRequestHeader(b,a)},this),this.Ae&&(this.c.responseType=this.Ae),"withCredentials"in this.c&&this.c.withCredentials!==this.Ab&&(this.c.withCredentials=this.Ab);try{this.yd(),0<this.vb&&(this.jc=Wc(this.c),L(this.s,this.da("Will abort after "+this.vb+"ms if incomplete, xhr2 "+this.jc)),this.jc?(this.c.timeout=this.vb,this.c.ontimeout=u(this.Ua,this)):this.hc=Hb(this.Ua,this.vb,this)),L(this.s,this.da("Sending request")),this.Qb=!0,this.c.send(a),this.Qb=!1}catch(g){L(this.s,this.da("Send error: "+g.message)),this.Ld(g)}},e.df=function(){return this.Xa?this.Xa.Dd():hc.Dd()},e.Ua=function(){"undefined"!=typeof goog&&this.c&&(this.I="Timed out after "+this.vb+"ms, aborting",this.Pa=8,L(this.s,this.da(this.I)),this.dispatchEvent("timeout"),this.abort(8))},e.Ld=function(a){this.ha=!1,this.c&&(this.Aa=!0,this.c.abort(),this.Aa=!1),this.I=a,this.Pa=5,this.Jd(),this.Gb()},e.Jd=function(){this.Ec||(this.Ec=!0,this.dispatchEvent("complete"),this.dispatchEvent("error"))},e.abort=function(a){this.c&&this.ha&&(L(this.s,this.da("Aborting")),this.ha=!1,this.Aa=!0,this.c.abort(),this.Aa=!1,this.Pa=a||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),this.Gb())},e.F=function(){this.c&&(this.ha&&(this.ha=!1,this.Aa=!0,this.c.abort(),this.Aa=!1),this.Gb(!0)),V.L.F.call(this)},e.te=function(){this.Ka||(this.Lc||this.Qb||this.Aa?this.se():this.eg())},e.eg=function(){this.se()},e.se=function(){if(this.ha&&"undefined"!=typeof goog)if(this.mc[1]&&4==this.ma()&&2==this.za())L(this.s,this.da("Local request error detected and ignored"));else if(this.Qb&&4==this.ma())Hb(this.te,0,this);else if(this.dispatchEvent("readystatechange"),this.Mc()){L(this.s,this.da("Request complete")),this.ha=!1;try{this.Rf()?(this.dispatchEvent("complete"),this.dispatchEvent("success")):(this.Pa=6,this.I=this.Yd()+" ["+this.za()+"]",this.Jd())}finally{this.Gb()}}},e.re=function(a,b){this.dispatchEvent(Xc(a,"progress")),this.dispatchEvent(Xc(a,b?"downloadprogress":"uploadprogress"))},e.Gb=function(a){if(this.c){this.yd();var b=this.c,c=this.mc[0]?aa:null;this.mc=this.c=null,a||this.dispatchEvent("ready");try{b.onreadystatechange=c}catch(d){(a=this.s)&&a.ca("Problem encountered resetting onreadystatechange: "+d.message,void 0)}}},e.yd=function(){this.c&&this.jc&&(this.c.ontimeout=null),this.hc&&(h.clearTimeout(this.hc),this.hc=null)},e.Ba=function(){return!!this.c},e.Mc=function(){return 4==this.ma()},e.Rf=function(){var a=this.za();a:switch(a){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break a;default:b=!1;}return b||0===a&&!this.Of()},e.Of=function(){var a=(this.Tb+"").match(pc)[1]||null;return!a&&h.self&&h.self.location&&(a=h.self.location.protocol,a=a.substr(0,a.length-1)),Uc.test(a?a.toLowerCase():"")},e.ma=function(){return this.c?this.c.readyState:0},e.za=function(){try{return 2<this.ma()?this.c.status:-1}catch(a){return-1}},e.Yd=function(){try{return 2<this.ma()?this.c.statusText:""}catch(a){return L(this.s,"Can not get status: "+a.message),""}},e.ya=function(){try{return this.c?this.c.responseText:""}catch(a){return L(this.s,"Can not get responseText: "+a.message),""}},e.yf=function(a){if(this.c){var b=this.c.responseText;return a&&0==b.indexOf(a)&&(b=b.substring(a.length)),Sc(b)}},e.getResponseHeader=function(a){if(this.c&&this.Mc())return a=this.c.getResponseHeader(a),null===a?void 0:a},e.getAllResponseHeaders=function(){return this.c&&this.Mc()?this.c.getAllResponseHeaders()||"":""},e.kb=function(a){return this.c?this.c.getResponseHeader(a):null},e.Ud=function(){return this.Pa},e.Hc=function(){return l(this.I)?this.I:this.I+""},e.da=function(a){return a+" ["+this.ge+" "+this.Tb+" "+this.za()+"]"},e=$c.prototype,e.tc=8,e.g=1,e.connect=function(a,b,c,d,f){this.a.debug("connect()"),O(0),this.K=b,this.gb=c||{},d&&void 0!==f&&(this.gb.OSID=d,this.gb.OAID=f),this.ta&&(this.a.debug("connect() bypassed channel-test."),this.Ib.$d=[],this.Ib.od=!1),this.bf(a)},e.disconnect=function(){if(this.a.debug("disconnect()"),this.qd(),3==this.g){var a=this.Yb++,b=this.hb.clone();b.l("SID",this.ra),b.l("RID",a),b.l("TYPE","terminate"),this.Ya(b),new R(this,this.a,this.ra,a,void 0).yg(b)}this.qe()},e.bf=function(a){this.a.debug("connectTest_()"),this.Ja=new Hc(this,this.a),null===this.N&&this.Ja.ga(this.A);var b=a;this.N&&this.A&&(b=Zc(a,this.N,this.A)),this.Ja.connect(b)},e.af=function(){this.a.debug("connectChannel_()"),this.hb=this.Sd(this.K),this.Dc()},e.qd=function(){this.Ja&&(this.Ja.abort(),this.Ja=null),this.u&&(this.u.cancel(),this.u=null),this.ia&&(h.clearTimeout(this.ia),this.ia=null),this.Hb(),this.G.cancel(),this.ea&&(h.clearTimeout(this.ea),this.ea=null)},e.ga=function(a){this.A=a},e.Eg=function(a){this.Rb=a},e.Cg=function(a){this.N=a},e.Dg=function(a){this.aa=a},e.Fe=function(a){this.Kc=a},e.He=function(a){this.Ra=a},e.Hg=function(){this.gc=!0},e.Ee=function(a){this.i=a},e.Nf=function(){return!this.fd},e.Zc=function(a){1E3==this.M.length&&this.a.ca(function(){return"Already have 1000 queued maps upon queueing "+ub(a)}),this.M.push(new Lc(this.ag++,a)),3==this.g&&this.Dc()},e.qf=function(){return this.kf?0:this.nf},e.de=function(){return 0==this.g},e.getState=function(){return this.g},e.Dc=function(){this.G.ee()||this.ea||(this.ea=P(u(this.we,this),0),this.La=0)},e.Yf=function(a){return this.G.xf()>=this.G.Xb-(this.ea?1:0)?(this.a.ca("Unexpected retry request is scheduled."),!1):this.ea?(this.a.debug("Use the retry request that is already scheduled."),this.M=a.la().concat(this.M),!0):1==this.g||2==this.g||this.La>=this.qf()?!1:(this.a.debug("Going to retry POST"),this.ea=P(u(this.we,this,a),this.Xd(this.La)),this.La++,!0)},e.we=function(a){this.ea=null,this.Mg(a)},e.Mg=function(a){this.a.debug("startForwardChannel_"),1==this.g?a?this.a.ca("Not supposed to retry the open"):(this.ig(),this.g=2):3==this.g&&(a?this.le(a):0==this.M.length?this.a.debug("startForwardChannel_ returned: nothing to send"):this.G.ee()?this.a.ca("startForwardChannel_ returned: connection already in progress"):(this.le(),this.a.debug("startForwardChannel_ finished, sent request")))},e.ig=function(){this.a.debug("open_()"),this.Yb=_Mathfloor5(1E5*Math.random());var a=this.Yb++,b=new R(this,this.a,"",a,void 0),c=this.A;this.Rb&&(c?(c=Da(c),Fa(c,this.Rb)):c=this.Rb),null===this.N&&b.ga(c);var d=this.Hd(b),f=this.hb.clone();f.l("RID",a),0<this.Bd&&f.l("CVER",this.Bd),this.ta&&this.aa&&f.l("X-HTTP-Session-Id",this.aa),this.Ya(f),this.N&&c&&Zc(f,this.N,c),this.G.oc(b),this.Nd?(f.l("$req",d),f.l("SID","null"),b.Ag(),b.kd(f,null)):b.kd(f,d)},e.le=function(a){var b=a?a.R:this.Yb++,c=this.hb.clone();c.l("SID",this.ra),c.l("RID",b),c.l("AID",this.Sb),this.Ya(c),this.N&&this.A&&Zc(c,this.N,this.A),b=new R(this,this.a,this.ra,b,this.La+1),null===this.N&&b.ga(this.A),a&&this.sg(a),a=this.Hd(b),b.setTimeout(_Mathround3(.5*this.Od)+_Mathround3(.5*this.Od*Math.random())),this.G.oc(b),b.kd(c,a)},e.Ya=function(a){this.i&&oc({},function(b,c){a.l(c,b)})},e.Hd=function(a){var b=Math.min(this.M.length,1E3),c=this.i?u(this.i.Ue,this.i,this):null;return c=this.kc.jf(this.M,b,c),a.Gg(this.M.splice(0,b)),c},e.sg=function(a){this.M=a.la().concat(this.M)},e.Kd=function(){if(!this.u&&!this.ia){this.rc=1;var a=this.ve;Bb||Cb(),Eb||(Bb(),Eb=!0),Fb.add(a,this),this.Ha=0}},e.Qc=function(){return this.u||this.ia?(this.a.ca("Request already in progress"),!1):!(3<=this.Ha)&&(this.a.debug("Going to retry GET"),this.rc++,this.ia=P(u(this.ve,this),this.Xd(this.Ha)),this.Ha++,!0)},e.ve=function(){this.ia=null,this.Kg()},e.Kg=function(){this.a.debug("Creating new HttpRequest"),this.u=new R(this,this.a,this.ra,"rpc",this.rc),null===this.N&&this.u.ga(this.A),this.u.He(this.Ra);var a=this.md.clone();a.l("RID","rpc"),a.l("SID",this.ra),a.l("CI",this.fd?"0":"1"),a.l("AID",this.Sb),this.Ya(a),a.l("TYPE","xmlhttp"),this.N&&this.A&&Zc(a,this.N,this.A),this.Db&&this.u.setTimeout(this.Db),this.u.jd(a,!0,this.na),this.a.debug("New Request created")},e.ub=function(a,b){this.a.debug("Test Connection Finished");var c=a.Ad;c&&this.G.ld(c),this.fd=this.Se&&b,this.w=a.w,this.af()},e.dd=function(a){this.a.debug("Test Connection Failed"),this.w=a.w,this.sa(2)},e.ue=function(a,b){if(0!=this.g&&(this.u==a||this.G.Jc(a)))if(this.w=a.w,!a.lb&&this.G.Jc(a)&&3==this.g){try{var c=this.kc.zc(b)}catch(d){c=null}n(c)&&3==c.length?this.Cf(c,a):(this.a.debug("Bad POST response data returned"),this.sa(11))}else(a.lb||this.u==a)&&this.Hb(),va(b)||(c=this.kc.zc(b),this.dg(c,a))},e.Cf=function(a,b){0==a[0]?this.Bf(b):(this.he=a[1],b=this.he-this.Sb,0<b&&(a=a[2],this.a.debug(a+" bytes (in "+b+" arrays) are outstanding on the BackChannel"),this.Jg(a)&&!this.wa&&(this.wa=P(u(this.bg,this),6E3))))},e.Bf=function(a){if(this.a.debug("Server claims our backchannel is missing."),this.ia)this.a.debug("But we are currently starting the request.");else{if(!this.u)this.a.T("We do not have a BackChannel established");else if(this.u.qb+3E3<a.qb)this.Hb(),this.u.cancel(),this.u=null;else return;this.Qc(),O(18)}},e.Jg=function(a){return 37500>a&&!this.Nf()&&0==this.Ha},e.$a=function(a){return this.Te?this.i?this.i.$a(a):a:null},e.bg=function(){null!=this.wa&&(this.wa=null,this.u.cancel(),this.u=null,this.Qc(),O(19))},e.Hb=function(){null!=this.wa&&(h.clearTimeout(this.wa),this.wa=null)},e.Tc=function(a){this.a.debug("Request complete");var b=null;if(this.u==a){this.Hb(),this.u=null;var c=2}else if(this.G.Jc(a))b=a.la(),this.G.ze(a),c=1;else return;if(this.w=a.w,0!=this.g)if(a.S)1==c?(ac(a.Da?a.Da.length:0,w()-a.qb,this.La),this.Dc()):this.Kd();else{var d=a.Hc();if(3==d||0==d&&0<this.w)this.a.debug("Not retrying due to error type");else{var f=this;if(this.a.debug(function(){return"Maybe retrying, last error: "+kc(d,f.w)}),1==c&&this.Yf(a)||2==c&&this.Qc())return;this.a.debug("Exceeded max number of retries")}b&&0<b.length&&this.G.Re(b),this.a.debug("Error: HTTP request failed"),1===d?this.sa(5):4===d?this.sa(10):3===d?this.sa(6):this.sa(2)}},e.Xd=function(a){var b=this.Ve+_Mathfloor5(Math.random()*this.vg);return this.Ba()||(this.a.debug("Inactive channel"),b*=2),b*a},e.pc=function(a){if(this.ta&&(a=a.h)){var b=a.kb("X-Client-Wire-Protocol");b&&this.G.ld(b),this.aa&&((a=a.kb("X-HTTP-Session-Id"))?(this.Fe(a),this.hb.l(this.aa,a)):this.a.T("Missing X_HTTP_SESSION_ID in the handshake response"))}},e.dg=function(a,b){for(var c=this.i&&this.i.sc?[]:null,d=0,f;d<a.length;d++)if(f=a[d],this.Sb=f[0],f=f[1],2!=this.g)3==this.g&&("stop"==f[0]||"close"==f[0]?(c&&0!=c.length&&(this.i.sc(this,c),c.length=0),"stop"==f[0]?this.sa(7):this.disconnect()):"noop"!=f[0]&&(c?c.push(f):this.i&&this.i.ud(f)),this.Ha=0);else if("c"==f[0]){this.ra=f[1],this.na=this.$a(f[2]);var g=f[3];null!=g&&(this.tc=g,this.a.info("VER="+this.tc)),g=f[4],null!=g&&(this.De=g,this.a.info("SVER="+this.De)),f=f[5],null!=f&&"number"==typeof f&&0<f&&(this.Db=f*=1.5,this.a.info("backChannelRequestTimeoutMs_="+f)),this.pc(b),this.g=3,this.i&&this.i.wd(),this.Lg(b)}else"stop"!=f[0]&&"close"!=f[0]||this.sa(7);c&&0!=c.length&&this.i.sc(this,c)},e.Lg=function(a){this.md=this.Pd(this.na,this.K),a.lb?(this.a.debug("Upgrade the handshake request to a backchannel."),this.G.ze(a),a.tg(this.Db),this.u=a):this.Kd()},e.sa=function(a){if(this.a.info("Error code "+a),2==a){var b=null;this.i&&(b=null);var c=u(this.Pg,this);b||(b=new U("//www.google.com/images/cleardot.gif"),h.location&&"http"==h.location.protocol||b.tb("https"),b.Ub()),Qc(b.toString(),c)}else O(2);this.cg(a)},e.Pg=function(a){a?(this.a.info("Successfully pinged google.com"),O(2)):(this.a.info("Failed to ping google.com"),O(1))},e.cg=function(a){this.a.debug("HttpChannel: error - "+a),this.g=0,this.i&&this.i.td(a),this.qe(),this.qd()},e.qe=function(){if(this.g=0,this.w=-1,this.i){var a=this.G.la();if(0!=a.length||0!=this.M.length){var b=this;this.a.debug(function(){return"Number of undelivered maps, pending: "+a.length+", outgoing: "+b.M.length}),this.G.$e(),ua(this.M),this.M.length=0}this.i.sd()}},e.Sd=function(a){return a=this.Cd(null,a),this.a.debug("GetForwardChannelUri: "+a),a},e.Pd=function(a,b){return a=this.Cd(this.fc()?a:null,b),this.a.debug("GetBackChannelUri: "+a),a},e.Cd=function(a,b){var c=Ac(b);if(""!=c.xa)a&&c.rb(a+"."+c.xa),c.sb(c.Ca);else{var d=h.location;c=Bc(d.protocol,a?a+"."+d.hostname:d.hostname,+d.port,b)}return this.gb&&Aa(this.gb,function(a,b){c.l(b,a)}),a=this.aa,b=this.Kc,a&&b&&c.l(a,b),c.l("VER",this.tc),this.Ya(c),c},e.Jb=function(a){if(a&&!this.gc)throw Error("Can't create secondary domain capable XhrIo object.");return a=new V(this.Xa),a.Je(this.gc),a},e.Ba=function(){return!!this.i&&this.i.Ba()},e.fc=function(){return this.gc},e=ad.prototype,e.sc=null,e.wd=function(){},e.ud=function(){},e.td=function(){},e.sd=function(){},e.Ba=function(){return!0},e.Ue=function(){},e.$a=function(a){return a},cd.prototype.cf=function(a,b){return new W(a,b)},x(W,H),e=W.prototype,e.addEventListener=function(a,b,c,d){W.L.addEventListener.call(this,a,b,c,d)},e.removeEventListener=function(a,b,c,d){W.L.removeEventListener.call(this,a,b,c,d)},e.open=function(){this.b.Ee(this.vd),this.Og&&this.b.Hg(),this.b.connect(this.Qg,this.yb,this.Rc||void 0)},e.close=function(){this.b.disconnect()},e.send=function(a){if(l(a)){var b={};b.__data__=a,this.b.Zc(b)}else this.zg?(b={},b.__data__=ub(a),this.b.Zc(b)):this.b.Zc(a)},e.F=function(){this.b.Ee(null),delete this.vd,this.b.disconnect(),delete this.b,W.L.F.call(this)},x(dd,fc),x(ed,gc),x(X,ad),X.prototype.wd=function(){Wb(this.b.s,"WebChannel opened on "+this.b.yb),this.b.dispatchEvent("a")},X.prototype.ud=function(a){this.b.dispatchEvent(new dd(a))},X.prototype.td=function(a){Wb(this.b.s,"WebChannel aborted on "+this.b.yb+" due to channel error: "+a),this.b.dispatchEvent(new ed(a))},X.prototype.sd=function(){Wb(this.b.s,"WebChannel closed on "+this.b.yb),this.b.dispatchEvent("b")};var fd=v(function(a){function c(){}c.prototype=a.prototype;var d=new c;return a.apply(d,Array.prototype.slice.call(arguments,1)),d},cd);e=gd.prototype,e.Vf=function(){0==this.V.length&&(this.V=this.Z,this.V.reverse(),this.Z=[])},e.enqueue=function(a){this.Z.push(a)},e.ab=function(){return this.Vf(),this.V.pop()},e.C=function(){return this.V.length+this.Z.length},e.X=function(){return 0==this.V.length&&0==this.Z.length},e.clear=function(){this.V=[],this.Z=[]},e.contains=function(a){return 0<=la(this.V,a)||0<=la(this.Z,a)},e.remove=function(a){var b=this.V,c=ma(b,a);return 0<=c?(Array.prototype.splice.call(b,c,1),b=!0):b=!1,b||sa(this.Z,a)},e.H=function(){for(var a=[],b=this.V.length-1;0<=b;--b)a.push(this.V[b]);var c=this.Z.length;for(b=0;b<c;++b)a.push(this.Z[b]);return a},x(hd,z);var id="[goog.structs.Pool] Min can not be greater than max";e=hd.prototype,e.Mb=function(){var a=w();if(!(null!=this.Nc&&a-this.Nc<this.Ac)){var b=this.qg();return b&&(this.Nc=a,this.oa.add(b)),b}},e.og=function(a){return!!this.oa.remove(a)&&(this.nc(a),!0)},e.qg=function(){for(var a;0<this.Td()&&(a=this.fa.ab(),!this.Sc(a));)this.Cb();return!a&&this.C()<this.Wb&&(a=this.xc()),a},e.nc=function(a){this.oa.remove(a),this.Sc(a)&&this.C()<this.Wb?this.fa.enqueue(a):this.Bc(a)},e.Cb=function(){for(var a=this.fa;this.C()<this.oe;)a.enqueue(this.xc());for(;this.C()>this.Wb&&0<this.Td();)this.Bc(a.ab())},e.xc=function(){return{}},e.Bc=function(a){if("function"==typeof a.bb)a.bb();else for(var b in a)a[b]=null},e.Sc=function(a){return"function"!=typeof a.Ye||a.Ye()},e.contains=function(a){return this.fa.contains(a)||this.oa.contains(a)},e.C=function(){return this.fa.C()+this.oa.C()},e.rf=function(){return this.oa.C()},e.Td=function(){return this.fa.C()},e.X=function(){return this.fa.X()&&this.oa.X()},e.F=function(){if(hd.L.F.call(this),0<this.rf())throw Error("[goog.structs.Pool] Objects not released");delete this.oa;for(var a=this.fa;!a.X();)this.Bc(a.ab());delete this.fa},jd.prototype.getKey=function(){return this.fe},jd.prototype.clone=function(){return new jd(this.fe,this.gd)},e=kd.prototype,e.ce=function(a,b){var c=this.Y;c.push(new jd(a,b)),this.$f(c.length-1)},e.Lf=function(a){if(a instanceof kd){var b=a.W();if(a=a.H(),0>=this.C()){for(var c=this.Y,d=0;d<b.length;d++)c.push(new jd(b[d],a[d]));return}}else b=Ca(a),a=Ba(a);for(d=0;d<b.length;d++)this.ce(b[d],a[d])},e.remove=function(){var a=this.Y,b=a.length,c=a[0];if(!(0>=b))return 1==b?ra(a):(a[0]=a.pop(),this.Zf()),c.gd},e.Zf=function(){for(var a=0,b=this.Y,c=b.length,d=b[a];a<c>>1;){var f=this.tf(a),g=this.zf(a);if(f=g<c&&b[g].getKey()<b[f].getKey()?g:f,b[f].getKey()>d.getKey())break;b[a]=b[f],a=f}b[a]=d},e.$f=function(a){for(var b=this.Y,c=b[a],d;0<a&&(d=this.wf(a),b[d].getKey()>c.getKey());)b[a]=b[d],a=d;b[a]=c},e.tf=function(a){return 2*a+1},e.zf=function(a){return 2*a+2},e.wf=function(a){return a-1>>1},e.H=function(){for(var a=this.Y,b=[],c=a.length,d=0;d<c;d++)b.push(a[d].gd);return b},e.W=function(){for(var a=this.Y,b=[],c=a.length,d=0;d<c;d++)b.push(a[d].getKey());return b},e.va=function(a){return oa(this.Y,function(b){return b.getKey()==a})},e.clone=function(){return new kd(this)},e.C=function(){return this.Y.length},e.X=function(){return 0==this.Y.length},e.clear=function(){ra(this.Y)},x(ld,kd),ld.prototype.enqueue=function(a,b){this.ce(a,b)},ld.prototype.ab=function(){return this.remove()},x(Y,hd),e=Y.prototype,e.Mb=function(a,b){return a?void(this.cc.enqueue(void 0===b?100:b,a),this.Nb()):((a=Y.L.Mb.call(this))&&this.Ac&&(this.Gd=h.setTimeout(u(this.Nb,this),this.Ac)),a)},e.Nb=function(){for(var a=this.cc,b;0<a.C()&&(b=this.Mb(),b);)a.ab().apply(this,[b])},e.nc=function(a){Y.L.nc.call(this,a),this.Nb()},e.Cb=function(){Y.L.Cb.call(this),this.Nb()},e.F=function(){Y.L.F.call(this),h.clearTimeout(this.Gd),this.cc.clear(),this.cc=null},x(Z,Y),Z.prototype.xc=function(){var a=new V,b=this.Jf;return b&&b.forEach(function(b,d){a.headers.set(d,b)}),this.Ab&&a.Je(!0),a},Z.prototype.Sc=function(a){return!a.Ka&&!a.Ba()},cd.prototype.createWebChannel=cd.prototype.cf,W.prototype.send=W.prototype.send,W.prototype.open=W.prototype.open,W.prototype.close=W.prototype.close,bc.NO_ERROR=0,bc.TIMEOUT=8,bc.HTTP_ERROR=6,cc.COMPLETE="complete",ec.EventType=Q,Q.OPEN="a",Q.CLOSE="b",Q.ERROR="c",Q.MESSAGE="d",H.prototype.listen=H.prototype.nb,Z.prototype.getObject=Z.prototype.Mb,Z.prototype.releaseObject=Z.prototype.og,V.prototype.listenOnce=V.prototype.Oc,V.prototype.getLastError=V.prototype.Hc,V.prototype.getLastErrorCode=V.prototype.Ud,V.prototype.getStatus=V.prototype.za,V.prototype.getStatusText=V.prototype.Yd,V.prototype.getResponseJson=V.prototype.yf,V.prototype.getResponseText=V.prototype.ya,V.prototype.getResponseText=V.prototype.ya,V.prototype.send=V.prototype.send;var src={createWebChannelTransport:fd,ErrorCode:bc,EventType:cc,WebChannel:ec,XhrIoPool:Z},src_1=src.createWebChannelTransport,src_2=src.ErrorCode,src_3=src.EventType,src_4=src.WebChannel,src_5=src.XhrIoPool;exports.default=src,exports.createWebChannelTransport=src_1,exports.ErrorCode=src_2,exports.EventType=src_3,exports.WebChannel=src_4,exports.XhrIoPool=src_5}).call(exports,__webpack_require__("h6ac"))},untT:function(module,exports,__webpack_require__){"use strict";if(exports.base64=!0,exports.array=!0,exports.string=!0,exports.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,exports.nodebuffer="undefined"!=typeof Buffer,exports.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)exports.blob=!1;else{var buffer=new ArrayBuffer(0);try{exports.blob=0===new Blob([buffer],{type:"application/zip"}).size}catch(e){try{var Builder=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,builder=new Builder;builder.append(buffer),exports.blob=0===builder.getBlob("application/zip").size}catch(e){exports.blob=!1}}}try{exports.nodestream=!!__webpack_require__("fOjT").Readable}catch(e){exports.nodestream=!1}},uxo6:function(module){"use strict";module.exports=function(adler,buf,len,pos){for(var s1=0|65535&adler,s2=0|65535&adler>>>16,n=0;0!==len;){n=2e3<len?2e3:len,len-=n;do s1=0|s1+buf[pos++],s2=0|s2+s1;while(--n);s1%=65521,s2%=65521}return 0|(s1|s2<<16)}},vCxL:function(module,exports){"use strict";function __values(o){var m="function"==typeof Symbol&&o[Symbol.iterator],i=0;return m?m.call(o):{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}}}function __read(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var i=m.call(o),ar=[],r,e;try{for(;(void 0===n||0<n--)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error:error}}finally{try{r&&!r.done&&(m=i["return"])&&m.call(i)}finally{if(e)throw e.error}}return ar}function __await(v){return this instanceof __await?(this.v=v,this):new __await(v)}exports.__esModule=!0,exports.__extends=function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},exports.__rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&0>e.indexOf(p)&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)0>e.indexOf(p[i])&&(t[p[i]]=s[p[i]]);return t},exports.__decorate=function(decorators,target,key,desc){var c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r},exports.__param=function(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex)}},exports.__metadata=function(metadataKey,metadataValue){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(metadataKey,metadataValue)},exports.__awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):new P(function(resolve){resolve(result.value)}).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},exports.__generator=function(thisArg,body){function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=y[2&op[0]?"return":op[0]?"throw":"next"])&&!(t=t.call(y,op[1])).done)return t;switch((y=0,t)&&(op=[0,t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if((t=_.trys,!(t=0<t.length&&t[t.length-1]))&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue;}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}var _={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g},exports.__exportStar=function(m,exports){for(var p in m)exports.hasOwnProperty(p)||(exports[p]=m[p])},exports.__values=__values,exports.__read=__read,exports.__spread=function(){for(var ar=[],i=0;i<arguments.length;i++)ar=ar.concat(__read(arguments[i]));return ar},exports.__await=__await,exports.__asyncGenerator=function(thisArg,_arguments,generator){function verb(n){g[n]&&(i[n]=function(v){return new Promise(function(a,b){1<q.push([n,v,a,b])||resume(n,v)})})}function resume(n,v){try{step(g[n](v))}catch(e){settle(q[0][3],e)}}function step(r){r.value instanceof __await?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f,v){(f(v),q.shift(),q.length)&&resume(q[0][0],q[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g=generator.apply(thisArg,_arguments||[]),q=[],i;return i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i},exports.__asyncDelegator=function(o){function verb(n,f){o[n]&&(i[n]=function(v){return(p=!p)?{value:__await(o[n](v)),done:"return"===n}:f?f(v):v})}var i,p;return i={},verb("next"),verb("throw",function(e){throw e}),verb("return"),i[Symbol.iterator]=function(){return this},i},exports.__asyncValues=function(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var m=o[Symbol.asyncIterator];return m?m.call(o):"function"==typeof __values?__values(o):o[Symbol.iterator]()},exports.__makeTemplateObject=function(cooked,raw){return Object.defineProperty?Object.defineProperty(cooked,"raw",{value:raw}):cooked.raw=raw,cooked},exports.__importStar=function(mod){if(mod&&mod.__esModule)return mod;var result={};if(null!=mod)for(var k in mod)Object.hasOwnProperty.call(mod,k)&&(result[k]=mod[k]);return result.default=mod,result},exports.__importDefault=function(mod){return mod&&mod.__esModule?mod:{default:mod}};var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},__assign=exports.__assign=Object.assign||function(t){for(var i=1,n=arguments.length,s;i<n;i++)for(var p in s=arguments[i],s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}},vexR:function(module){"use strict";module.exports=function(arg){return arg&&"object"==typeof arg&&"function"==typeof arg.copy&&"function"==typeof arg.fill&&"function"==typeof arg.readUInt8}},wGjj:function(module,exports,__webpack_require__){"use strict";var _Mathmin7=Math.min;(function(global){function noop(){}function bind(fn,thisArg){return function(){fn.apply(thisArg,arguments)}}function Promise(fn){if(!(this instanceof Promise))throw new TypeError("Promises must be constructed via new");if("function"!=typeof fn)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],doResolve(fn,this)}function handle(self,deferred){for(;3===self._state;)self=self._value;return 0===self._state?void self._deferreds.push(deferred):void(self._handled=!0,Promise._immediateFn(function(){var cb=1===self._state?deferred.onFulfilled:deferred.onRejected;if(null===cb)return void(1===self._state?resolve:reject)(deferred.promise,self._value);var ret;try{ret=cb(self._value)}catch(e){return void reject(deferred.promise,e)}resolve(deferred.promise,ret)}))}function resolve(self,newValue){try{if(newValue===self)throw new TypeError("A promise cannot be resolved with itself.");if(newValue&&("object"==typeof newValue||"function"==typeof newValue)){var then=newValue.then;if(newValue instanceof Promise)return self._state=3,self._value=newValue,void finale(self);if("function"==typeof then)return void doResolve(bind(then,newValue),self)}self._state=1,self._value=newValue,finale(self)}catch(e){reject(self,e)}}function reject(self,newValue){self._state=2,self._value=newValue,finale(self)}function finale(self){2===self._state&&0===self._deferreds.length&&Promise._immediateFn(function(){self._handled||Promise._unhandledRejectionFn(self._value)});for(var i=0,len=self._deferreds.length;i<len;i++)handle(self,self._deferreds[i]);self._deferreds=null}function Handler(onFulfilled,onRejected,promise){this.onFulfilled="function"==typeof onFulfilled?onFulfilled:null,this.onRejected="function"==typeof onRejected?onRejected:null,this.promise=promise}function doResolve(fn,self){var done=!1;try{fn(function(value){done||(done=!0,resolve(self,value))},function(reason){done||(done=!0,reject(self,reason))})}catch(ex){if(done)return;done=!0,reject(self,ex)}}function createCommonjsModule(fn,module){return module={exports:{}},fn(module,module.exports),module.exports}__webpack_require__("MCp7");var setTimeoutFunc=setTimeout;Promise.prototype["catch"]=function(onRejected){return this.then(null,onRejected)},Promise.prototype.then=function(onFulfilled,onRejected){var prom=new this.constructor(noop);return handle(this,new Handler(onFulfilled,onRejected,prom)),prom},Promise.prototype["finally"]=function(callback){var constructor=this.constructor;return this.then(function(value){return constructor.resolve(callback()).then(function(){return value})},function(reason){return constructor.resolve(callback()).then(function(){return constructor.reject(reason)})})},Promise.all=function(arr){return new Promise(function(resolve,reject){function res(i,val){try{if(val&&("object"==typeof val||"function"==typeof val)){var then=val.then;if("function"==typeof then)return void then.call(val,function(val){res(i,val)},reject)}args[i]=val,0==--remaining&&resolve(args)}catch(ex){reject(ex)}}if(!arr||"undefined"==typeof arr.length)throw new TypeError("Promise.all accepts an array");var args=Array.prototype.slice.call(arr);if(0===args.length)return resolve([]);for(var remaining=args.length,i=0;i<args.length;i++)res(i,args[i])})},Promise.resolve=function(value){return value&&"object"==typeof value&&value.constructor===Promise?value:new Promise(function(resolve){resolve(value)})},Promise.reject=function(value){return new Promise(function(resolve,reject){reject(value)})},Promise.race=function(values){return new Promise(function(resolve,reject){for(var i=0,len=values.length;i<len;i++)values[i].then(resolve,reject)})},Promise._immediateFn="function"==typeof setImmediate&&function(fn){setImmediate(fn)}||function(fn){setTimeoutFunc(fn,0)},Promise._unhandledRejectionFn=function(err){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",err)};var globalNS=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();globalNS.Promise||(globalNS.Promise=Promise);var _global=createCommonjsModule(function(module){var global=module.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=global)}),_core=createCommonjsModule(function(module){var core=module.exports={version:"2.5.5"};"number"==typeof __e&&(__e=core)}),_core_1=_core.version,_isObject=function(it){return"object"==typeof it?null!==it:"function"==typeof it},_anObject=function(it){if(!_isObject(it))throw TypeError(it+" is not an object!");return it},_fails=function(exec){try{return!!exec()}catch(e){return!0}},_descriptors=!_fails(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),document=_global.document,is=_isObject(document)&&_isObject(document.createElement),_domCreate=function(it){return is?document.createElement(it):{}},_ie8DomDefine=!_descriptors&&!_fails(function(){return 7!=Object.defineProperty(_domCreate("div"),"a",{get:function(){return 7}}).a}),_toPrimitive=function(it,S){if(!_isObject(it))return it;var fn,val;if(S&&"function"==typeof(fn=it.toString)&&!_isObject(val=fn.call(it)))return val;if("function"==typeof(fn=it.valueOf)&&!_isObject(val=fn.call(it)))return val;if(!S&&"function"==typeof(fn=it.toString)&&!_isObject(val=fn.call(it)))return val;throw TypeError("Can't convert object to primitive value")},dP=Object.defineProperty,f=_descriptors?Object.defineProperty:function(O,P,Attributes){if(_anObject(O),P=_toPrimitive(P,!0),_anObject(Attributes),_ie8DomDefine)try{return dP(O,P,Attributes)}catch(e){}if("get"in Attributes||"set"in Attributes)throw TypeError("Accessors not supported!");return"value"in Attributes&&(O[P]=Attributes.value),O},_objectDp={f:f},_propertyDesc=function(bitmap,value){return{enumerable:!(1&bitmap),configurable:!(2&bitmap),writable:!(4&bitmap),value:value}},_hide=_descriptors?function(object,key,value){return _objectDp.f(object,key,_propertyDesc(1,value))}:function(object,key,value){return object[key]=value,object},hasOwnProperty={}.hasOwnProperty,_has=function(it,key){return hasOwnProperty.call(it,key)},id=0,px=Math.random(),_uid=function(key){return"Symbol(".concat(void 0===key?"":key,")_",(++id+px).toString(36))},_redefine=createCommonjsModule(function(module){var SRC=_uid("src"),TO_STRING="toString",$toString=Function[TO_STRING],TPL=(""+$toString).split(TO_STRING);_core.inspectSource=function(it){return $toString.call(it)},(module.exports=function(O,key,val,safe){var isFunction="function"==typeof val;isFunction&&(_has(val,"name")||_hide(val,"name",key)),O[key]===val||(isFunction&&(_has(val,SRC)||_hide(val,SRC,O[key]?""+O[key]:TPL.join(key+""))),O===_global?O[key]=val:safe?O[key]?O[key]=val:_hide(O,key,val):(delete O[key],_hide(O,key,val)))})(Function.prototype,TO_STRING,function(){return"function"==typeof this&&this[SRC]||$toString.call(this)})}),_aFunction=function(it){if("function"!=typeof it)throw TypeError(it+" is not a function!");return it},_ctx=function(fn,that,length){return(_aFunction(fn),void 0===that)?fn:1===length?function(a){return fn.call(that,a)}:2===length?function(a,b){return fn.call(that,a,b)}:3===length?function(a,b,c){return fn.call(that,a,b,c)}:function(){return fn.apply(that,arguments)}},PROTOTYPE="prototype",$export=function $export(type,name,source){var IS_FORCED=type&$export.F,IS_GLOBAL=type&$export.G,IS_STATIC=type&$export.S,IS_PROTO=type&$export.P,IS_BIND=type&$export.B,target=IS_GLOBAL?_global:IS_STATIC?_global[name]||(_global[name]={}):(_global[name]||{})[PROTOTYPE],exports=IS_GLOBAL?_core:_core[name]||(_core[name]={}),expProto=exports[PROTOTYPE]||(exports[PROTOTYPE]={}),key,own,out,exp;for(key in IS_GLOBAL&&(source=name),source)own=!IS_FORCED&&target&&void 0!==target[key],out=(own?target:source)[key],exp=IS_BIND&&own?_ctx(out,_global):IS_PROTO&&"function"==typeof out?_ctx(Function.call,out):out,target&&_redefine(target,key,out,type&$export.U),exports[key]!=out&&_hide(exports,key,exp),IS_PROTO&&expProto[key]!=out&&(expProto[key]=out)};_global.core=_core,$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,$export.U=64,$export.R=128;var _export=$export,toString={}.toString,_cof=function(it){return toString.call(it).slice(8,-1)},_iobject=Object("z").propertyIsEnumerable(0)?Object:function(it){return"String"==_cof(it)?it.split(""):Object(it)},_defined=function(it){if(void 0==it)throw TypeError("Can't call method on "+it);return it},_toObject=function(it){return Object(_defined(it))},ceil=Math.ceil,floor=Math.floor,_toInteger=function(it){return isNaN(it=+it)?0:(0<it?floor:ceil)(it)},_toLength=function(it){return 0<it?_Mathmin7(_toInteger(it),9007199254740991):0},_isArray=Array.isArray||function(arg){return"Array"==_cof(arg)},SHARED="__core-js_shared__",store=_global[SHARED]||(_global[SHARED]={}),_shared=function(key){return store[key]||(store[key]={})},_wks=createCommonjsModule(function(module){var store=_shared("wks"),Symbol=_global.Symbol,USE_SYMBOL="function"==typeof Symbol,$exports=module.exports=function(name){return store[name]||(store[name]=USE_SYMBOL&&Symbol[name]||(USE_SYMBOL?Symbol:_uid)("Symbol."+name))};$exports.store=store}),SPECIES=_wks("species"),_arraySpeciesConstructor=function(original){var C;return _isArray(original)&&(C=original.constructor,"function"==typeof C&&(C===Array||_isArray(C.prototype))&&(C=void 0),_isObject(C)&&(C=C[SPECIES],null===C&&(C=void 0))),void 0===C?Array:C},_arraySpeciesCreate=function(original,length){return new(_arraySpeciesConstructor(original))(length)},_arrayMethods=function(TYPE,$create){var IS_MAP=1==TYPE,IS_EVERY=4==TYPE,IS_FIND_INDEX=6==TYPE,create=$create||_arraySpeciesCreate;return function($this,callbackfn,that){for(var O=_toObject($this),self=_iobject(O),f=_ctx(callbackfn,that,3),length=_toLength(self.length),index=0,result=IS_MAP?create($this,length):2==TYPE?create($this,0):void 0,val,res;length>index;index++)if((5==TYPE||IS_FIND_INDEX||index in self)&&(val=self[index],res=f(val,index,O),TYPE))if(IS_MAP)result[index]=res;else if(res)switch(TYPE){case 3:return!0;case 5:return val;case 6:return index;case 2:result.push(val);}else if(IS_EVERY)return!1;return IS_FIND_INDEX?-1:3==TYPE||IS_EVERY?IS_EVERY:result}},UNSCOPABLES=_wks("unscopables"),ArrayProto=Array.prototype;void 0==ArrayProto[UNSCOPABLES]&&_hide(ArrayProto,UNSCOPABLES,{});var _addToUnscopables=function(key){ArrayProto[UNSCOPABLES][key]=!0},$find=_arrayMethods(5),KEY="find",forced=!0;KEY in[]&&[,][KEY](function(){forced=!1}),_export(_export.P+_export.F*forced,"Array",{find:function(callbackfn){return $find(this,callbackfn,1<arguments.length?arguments[1]:void 0)}}),_addToUnscopables(KEY);var find=_core.Array.find,$find$1=_arrayMethods(6),KEY$1="findIndex",forced$1=!0;KEY$1 in[]&&[,][KEY$1](function(){forced$1=!1}),_export(_export.P+_export.F*forced$1,"Array",{findIndex:function(callbackfn){return $find$1(this,callbackfn,1<arguments.length?arguments[1]:void 0)}}),_addToUnscopables(KEY$1);var findIndex=_core.Array.findIndex,_toIobject=function(it){return _iobject(_defined(it))},max=Math.max,_toAbsoluteIndex=function(index,length){return index=_toInteger(index),0>index?max(index+length,0):_Mathmin7(index,length)},shared=_shared("keys"),_sharedKey=function(key){return shared[key]||(shared[key]=_uid(key))},arrayIndexOf=function(IS_INCLUDES){return function($this,el,fromIndex){var O=_toIobject($this),length=_toLength(O.length),index=_toAbsoluteIndex(fromIndex,length),value;if(IS_INCLUDES&&el!=el){for(;length>index;)if(value=O[index++],value!=value)return!0;}else for(;length>index;index++)if((IS_INCLUDES||index in O)&&O[index]===el)return IS_INCLUDES||index||0;return!IS_INCLUDES&&-1}}(!1),IE_PROTO=_sharedKey("IE_PROTO"),_objectKeysInternal=function(object,names){var O=_toIobject(object),i=0,result=[],key;for(key in O)key!=IE_PROTO&&_has(O,key)&&result.push(key);for(;names.length>i;)_has(O,key=names[i++])&&(~arrayIndexOf(result,key)||result.push(key));return result},_enumBugKeys=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_objectKeys=Object.keys||function(O){return _objectKeysInternal(O,_enumBugKeys)},f$1=Object.getOwnPropertySymbols,_objectGops={f:f$1},f$2={}.propertyIsEnumerable,_objectPie={f:f$2},$assign=Object.assign,_objectAssign=!$assign||_fails(function(){var A={},B={},S=Symbol(),K="abcdefghijklmnopqrst";return A[S]=7,K.split("").forEach(function(k){B[k]=k}),7!=$assign({},A)[S]||Object.keys($assign({},B)).join("")!=K})?function(target){for(var T=_toObject(target),aLen=arguments.length,index=1,getSymbols=_objectGops.f,isEnum=_objectPie.f;aLen>index;)for(var S=_iobject(arguments[index++]),keys=getSymbols?_objectKeys(S).concat(getSymbols(S)):_objectKeys(S),length=keys.length,j=0,key;length>j;)isEnum.call(S,key=keys[j++])&&(T[key]=S[key]);return T}:$assign;_export(_export.S+_export.F,"Object",{assign:_objectAssign});var assign=_core.Object.assign,MATCH=_wks("match"),_isRegexp=function(it){var isRegExp;return _isObject(it)&&(void 0===(isRegExp=it[MATCH])?"RegExp"==_cof(it):!!isRegExp)},_stringContext=function(that,searchString,NAME){if(_isRegexp(searchString))throw TypeError("String#"+NAME+" doesn't accept regex!");return _defined(that)+""},MATCH$1=_wks("match"),STARTS_WITH="startsWith",$startsWith=""[STARTS_WITH];_export(_export.P+_export.F*function(KEY){var re=/./;try{"/./"[KEY](re)}catch(e){try{return re[MATCH$1]=!1,!"/./"[KEY](re)}catch(f){}}return!0}(STARTS_WITH),"String",{startsWith:function(searchString){var that=_stringContext(this,searchString,STARTS_WITH),index=_toLength(_Mathmin7(1<arguments.length?arguments[1]:void 0,that.length)),search=searchString+"";return that.slice(index,index+search.length)===search}});var startsWith=_core.String.startsWith;_export(_export.P,"String",{repeat:function(count){var str=_defined(this)+"",res="",n=_toInteger(count);if(0>n||n==Infinity)throw RangeError("Count can't be negative");for(;0<n;(n>>>=1)&&(str+=str))1&n&&(res+=str);return res}});var repeat=_core.String.repeat,_meta=createCommonjsModule(function(module){var META=_uid("meta"),setDesc=_objectDp.f,id=0,isExtensible=Object.isExtensible||function(){return!0},FREEZE=!_fails(function(){return isExtensible(Object.preventExtensions({}))}),setMeta=function(it){setDesc(it,META,{value:{i:"O"+ ++id,w:{}}})},meta=module.exports={KEY:META,NEED:!1,fastKey:function(it,create){if(!_isObject(it))return"symbol"==typeof it?it:("string"==typeof it?"S":"P")+it;if(!_has(it,META)){if(!isExtensible(it))return"F";if(!create)return"E";setMeta(it)}return it[META].i},getWeak:function(it,create){if(!_has(it,META)){if(!isExtensible(it))return!0;if(!create)return!1;setMeta(it)}return it[META].w},onFreeze:function(it){return FREEZE&&meta.NEED&&isExtensible(it)&&!_has(it,META)&&setMeta(it),it}}}),_meta_1=_meta.KEY,_meta_2=_meta.NEED,_meta_3=_meta.fastKey,_meta_4=_meta.getWeak,_meta_5=_meta.onFreeze,def=_objectDp.f,TAG=_wks("toStringTag"),_setToStringTag=function(it,tag,stat){it&&!_has(it=stat?it:it.prototype,TAG)&&def(it,TAG,{configurable:!0,value:tag})},_wksExt={f:_wks},_library=!1,defineProperty=_objectDp.f,_wksDefine=function(name){var $Symbol=_core.Symbol||(_core.Symbol=_global.Symbol||{});"_"==name.charAt(0)||name in $Symbol||defineProperty($Symbol,name,{value:_wksExt.f(name)})},_enumKeys=function(it){var result=_objectKeys(it),getSymbols=_objectGops.f;if(getSymbols)for(var symbols=getSymbols(it),isEnum=_objectPie.f,i=0,key;symbols.length>i;)isEnum.call(it,key=symbols[i++])&&result.push(key);return result},_objectDps=_descriptors?Object.defineProperties:function(O,Properties){_anObject(O);for(var keys=_objectKeys(Properties),length=keys.length,i=0,P;length>i;)_objectDp.f(O,P=keys[i++],Properties[P]);return O},document$1=_global.document,_html=document$1&&document$1.documentElement,IE_PROTO$1=_sharedKey("IE_PROTO"),Empty=function(){},PROTOTYPE$1="prototype",_createDict=function(){var iframe=_domCreate("iframe"),i=_enumBugKeys.length,lt="<",gt=">",iframeDocument;for(iframe.style.display="none",_html.appendChild(iframe),iframe.src="javascript:",iframeDocument=iframe.contentWindow.document,iframeDocument.open(),iframeDocument.write(lt+"script"+gt+"document.F=Object"+lt+"/script"+gt),iframeDocument.close(),_createDict=iframeDocument.F;i--;)delete _createDict[PROTOTYPE$1][_enumBugKeys[i]];return _createDict()},_objectCreate=Object.create||function(O,Properties){var result;return null===O?result=_createDict():(Empty[PROTOTYPE$1]=_anObject(O),result=new Empty,Empty[PROTOTYPE$1]=null,result[IE_PROTO$1]=O),void 0===Properties?result:_objectDps(result,Properties)},hiddenKeys=_enumBugKeys.concat("length","prototype"),f$4=Object.getOwnPropertyNames||function(O){return _objectKeysInternal(O,hiddenKeys)},_objectGopn={f:f$4},gOPN=_objectGopn.f,toString$1={}.toString,windowNames="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(it){try{return gOPN(it)}catch(e){return windowNames.slice()}},_objectGopnExt={f:function(it){return windowNames&&"[object Window]"==toString$1.call(it)?getWindowNames(it):gOPN(_toIobject(it))}},gOPD=Object.getOwnPropertyDescriptor,f$6=_descriptors?gOPD:function(O,P){if(O=_toIobject(O),P=_toPrimitive(P,!0),_ie8DomDefine)try{return gOPD(O,P)}catch(e){}return _has(O,P)?_propertyDesc(!_objectPie.f.call(O,P),O[P]):void 0},_objectGopd={f:f$6},META=_meta.KEY,gOPD$1=_objectGopd.f,dP$1=_objectDp.f,gOPN$1=_objectGopnExt.f,$Symbol=_global.Symbol,$JSON=_global.JSON,_stringify=$JSON&&$JSON.stringify,PROTOTYPE$2="prototype",HIDDEN=_wks("_hidden"),TO_PRIMITIVE=_wks("toPrimitive"),isEnum={}.propertyIsEnumerable,SymbolRegistry=_shared("symbol-registry"),AllSymbols=_shared("symbols"),OPSymbols=_shared("op-symbols"),ObjectProto=Object[PROTOTYPE$2],USE_NATIVE="function"==typeof $Symbol,QObject=_global.QObject,setter=!QObject||!QObject[PROTOTYPE$2]||!QObject[PROTOTYPE$2].findChild,setSymbolDesc=_descriptors&&_fails(function(){return 7!=_objectCreate(dP$1({},"a",{get:function(){return dP$1(this,"a",{value:7}).a}})).a})?function(it,key,D){var protoDesc=gOPD$1(ObjectProto,key);protoDesc&&delete ObjectProto[key],dP$1(it,key,D),protoDesc&&it!==ObjectProto&&dP$1(ObjectProto,key,protoDesc)}:dP$1,wrap=function(tag){var sym=AllSymbols[tag]=_objectCreate($Symbol[PROTOTYPE$2]);return sym._k=tag,sym},isSymbol=USE_NATIVE&&"symbol"==typeof $Symbol.iterator?function(it){return"symbol"==typeof it}:function(it){return it instanceof $Symbol},$defineProperty=function(it,key,D){return it===ObjectProto&&$defineProperty(OPSymbols,key,D),_anObject(it),key=_toPrimitive(key,!0),_anObject(D),_has(AllSymbols,key)?(D.enumerable?(_has(it,HIDDEN)&&it[HIDDEN][key]&&(it[HIDDEN][key]=!1),D=_objectCreate(D,{enumerable:_propertyDesc(0,!1)})):(!_has(it,HIDDEN)&&dP$1(it,HIDDEN,_propertyDesc(1,{})),it[HIDDEN][key]=!0),setSymbolDesc(it,key,D)):dP$1(it,key,D)},$defineProperties=function(it,P){_anObject(it);for(var keys=_enumKeys(P=_toIobject(P)),i=0,l=keys.length,key;l>i;)$defineProperty(it,key=keys[i++],P[key]);return it},$propertyIsEnumerable=function(key){var E=isEnum.call(this,key=_toPrimitive(key,!0));return this===ObjectProto&&_has(AllSymbols,key)&&!_has(OPSymbols,key)?!1:E||!_has(this,key)||!_has(AllSymbols,key)||_has(this,HIDDEN)&&this[HIDDEN][key]?E:!0},$getOwnPropertyDescriptor=function(it,key){if(it=_toIobject(it),key=_toPrimitive(key,!0),it!==ObjectProto||!_has(AllSymbols,key)||_has(OPSymbols,key)){var D=gOPD$1(it,key);return D&&_has(AllSymbols,key)&&!(_has(it,HIDDEN)&&it[HIDDEN][key])&&(D.enumerable=!0),D}},$getOwnPropertyNames=function(it){for(var names=gOPN$1(_toIobject(it)),result=[],i=0,key;names.length>i;)_has(AllSymbols,key=names[i++])||key==HIDDEN||key==META||result.push(key);return result},$getOwnPropertySymbols=function(it){for(var IS_OP=it===ObjectProto,names=gOPN$1(IS_OP?OPSymbols:_toIobject(it)),result=[],i=0,key;names.length>i;)_has(AllSymbols,key=names[i++])&&(!IS_OP||_has(ObjectProto,key))&&result.push(AllSymbols[key]);return result};USE_NATIVE||($Symbol=function(){if(this instanceof $Symbol)throw TypeError("Symbol is not a constructor!");var tag=_uid(0<arguments.length?arguments[0]:void 0);return _descriptors&&setter&&setSymbolDesc(ObjectProto,tag,{configurable:!0,set:function $set(value){this===ObjectProto&&$set.call(OPSymbols,value),_has(this,HIDDEN)&&_has(this[HIDDEN],tag)&&(this[HIDDEN][tag]=!1),setSymbolDesc(this,tag,_propertyDesc(1,value))}}),wrap(tag)},_redefine($Symbol[PROTOTYPE$2],"toString",function(){return this._k}),_objectGopd.f=$getOwnPropertyDescriptor,_objectDp.f=$defineProperty,_objectGopn.f=_objectGopnExt.f=$getOwnPropertyNames,_objectPie.f=$propertyIsEnumerable,_objectGops.f=$getOwnPropertySymbols,_descriptors&&!_library&&_redefine(ObjectProto,"propertyIsEnumerable",$propertyIsEnumerable,!0),_wksExt.f=function(name){return wrap(_wks(name))}),_export(_export.G+_export.W+_export.F*!USE_NATIVE,{Symbol:$Symbol});for(var es6Symbols=["hasInstance","isConcatSpreadable","iterator","match","replace","search","species","split","toPrimitive","toStringTag","unscopables"],j=0;es6Symbols.length>j;)_wks(es6Symbols[j++]);for(var wellKnownSymbols=_objectKeys(_wks.store),k=0;wellKnownSymbols.length>k;)_wksDefine(wellKnownSymbols[k++]);_export(_export.S+_export.F*!USE_NATIVE,"Symbol",{for:function(key){return _has(SymbolRegistry,key+="")?SymbolRegistry[key]:SymbolRegistry[key]=$Symbol(key)},keyFor:function(sym){if(!isSymbol(sym))throw TypeError(sym+" is not a symbol!");for(var key in SymbolRegistry)if(SymbolRegistry[key]===sym)return key},useSetter:function(){setter=!0},useSimple:function(){setter=!1}}),_export(_export.S+_export.F*!USE_NATIVE,"Object",{create:function(it,P){return void 0===P?_objectCreate(it):$defineProperties(_objectCreate(it),P)},defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor,getOwnPropertyNames:$getOwnPropertyNames,getOwnPropertySymbols:$getOwnPropertySymbols}),$JSON&&_export(_export.S+_export.F*(!USE_NATIVE||_fails(function(){var S=$Symbol();return"[null]"!=_stringify([S])||"{}"!=_stringify({a:S})||"{}"!=_stringify(Object(S))})),"JSON",{stringify:function(it){for(var args=[it],i=1,replacer,$replacer;arguments.length>i;)args.push(arguments[i++]);if($replacer=replacer=args[1],(_isObject(replacer)||void 0!==it)&&!isSymbol(it))return _isArray(replacer)||(replacer=function(key,value){if("function"==typeof $replacer&&(value=$replacer.call(this,key,value)),!isSymbol(value))return value}),args[1]=replacer,_stringify.apply($JSON,args)}}),$Symbol[PROTOTYPE$2][TO_PRIMITIVE]||_hide($Symbol[PROTOTYPE$2],TO_PRIMITIVE,$Symbol[PROTOTYPE$2].valueOf),_setToStringTag($Symbol,"Symbol"),_setToStringTag(Math,"Math",!0),_setToStringTag(_global.JSON,"JSON",!0);var TAG$1=_wks("toStringTag"),ARG="Arguments"==_cof(function(){return arguments}()),tryGet=function(it,key){try{return it[key]}catch(e){}},_classof=function(it){var O,T,B;return void 0===it?"Undefined":null===it?"Null":"string"==typeof(T=tryGet(O=Object(it),TAG$1))?T:ARG?_cof(O):"Object"==(B=_cof(O))&&"function"==typeof O.callee?"Arguments":B};({})[_wks("toStringTag")]="z",_redefine(Object.prototype,"toString",function(){return"[object "+_classof(this)+"]"},!0),_wksDefine("asyncIterator"),_wksDefine("observable");var symbol=_core.Symbol,_iterators={},IteratorPrototype={};_hide(IteratorPrototype,_wks("iterator"),function(){return this});var _iterCreate=function(Constructor,NAME,next){Constructor.prototype=_objectCreate(IteratorPrototype,{next:_propertyDesc(1,next)}),_setToStringTag(Constructor,NAME+" Iterator")},IE_PROTO$2=_sharedKey("IE_PROTO"),ObjectProto$1=Object.prototype,_objectGpo=Object.getPrototypeOf||function(O){return O=_toObject(O),_has(O,IE_PROTO$2)?O[IE_PROTO$2]:"function"==typeof O.constructor&&O instanceof O.constructor?O.constructor.prototype:O instanceof Object?ObjectProto$1:null},ITERATOR=_wks("iterator"),BUGGY=!([].keys&&"next"in[].keys()),KEYS="keys",VALUES="values",returnThis=function(){return this},_iterDefine=function(Base,NAME,Constructor,next,DEFAULT,IS_SET,FORCED){_iterCreate(Constructor,NAME,next);var getMethod=function(kind){return!BUGGY&&kind in proto?proto[kind]:kind===KEYS?function(){return new Constructor(this,kind)}:kind===VALUES?function(){return new Constructor(this,kind)}:function(){return new Constructor(this,kind)}},TAG=NAME+" Iterator",DEF_VALUES=DEFAULT==VALUES,VALUES_BUG=!1,proto=Base.prototype,$native=proto[ITERATOR]||proto["@@iterator"]||DEFAULT&&proto[DEFAULT],$default=$native||getMethod(DEFAULT),$entries=DEFAULT?DEF_VALUES?getMethod("entries"):$default:void 0,$anyNative="Array"==NAME?proto.entries||$native:$native,methods,key,IteratorPrototype;if($anyNative&&(IteratorPrototype=_objectGpo($anyNative.call(new Base)),IteratorPrototype!==Object.prototype&&IteratorPrototype.next&&(_setToStringTag(IteratorPrototype,TAG,!0),"function"!=typeof IteratorPrototype[ITERATOR]&&_hide(IteratorPrototype,ITERATOR,returnThis))),DEF_VALUES&&$native&&$native.name!==VALUES&&(VALUES_BUG=!0,$default=function(){return $native.call(this)}),(BUGGY||VALUES_BUG||!proto[ITERATOR])&&_hide(proto,ITERATOR,$default),_iterators[NAME]=$default,_iterators[TAG]=returnThis,DEFAULT)if(methods={values:DEF_VALUES?$default:getMethod(VALUES),keys:IS_SET?$default:getMethod(KEYS),entries:$entries},FORCED)for(key in methods)key in proto||_redefine(proto,key,methods[key]);else _export(_export.P+_export.F*(BUGGY||VALUES_BUG),NAME,methods);return methods},$at=function(TO_STRING){return function(that,pos){var s=_defined(that)+"",i=_toInteger(pos),l=s.length,a,b;return 0>i||i>=l?TO_STRING?"":void 0:(a=s.charCodeAt(i),55296>a||56319<a||i+1===l||56320>(b=s.charCodeAt(i+1))||57343<b?TO_STRING?s.charAt(i):a:TO_STRING?s.slice(i,i+2):(a-55296<<10)+(b-56320)+65536)}}(!0);_iterDefine(String,"String",function(iterated){this._t=iterated+"",this._i=0},function(){var O=this._t,index=this._i,point;return index>=O.length?{value:void 0,done:!0}:(point=$at(O,index),this._i+=point.length,{value:point,done:!1})});var _iterStep=function(done,value){return{value:value,done:!!done}},es6_array_iterator=_iterDefine(Array,"Array",function(iterated,kind){this._t=_toIobject(iterated),this._i=0,this._k=kind},function(){var O=this._t,kind=this._k,index=this._i++;return!O||index>=O.length?(this._t=void 0,_iterStep(1)):"keys"==kind?_iterStep(0,index):"values"==kind?_iterStep(0,O[index]):_iterStep(0,[index,O[index]])},"values");_iterators.Arguments=_iterators.Array,_addToUnscopables("keys"),_addToUnscopables("values"),_addToUnscopables("entries");for(var ITERATOR$1=_wks("iterator"),TO_STRING_TAG=_wks("toStringTag"),ArrayValues=_iterators.Array,DOMIterables={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},collections=_objectKeys(DOMIterables),i=0;i<collections.length;i++){var NAME=collections[i],explicit=DOMIterables[NAME],Collection=_global[NAME],proto=Collection&&Collection.prototype,key;if(proto&&(proto[ITERATOR$1]||_hide(proto,ITERATOR$1,ArrayValues),proto[TO_STRING_TAG]||_hide(proto,TO_STRING_TAG,NAME),_iterators[NAME]=ArrayValues,explicit))for(key in es6_array_iterator)proto[key]||_redefine(proto,key,es6_array_iterator[key],!0)}_wksExt.f("iterator")}).call(exports,__webpack_require__("h6ac"))},wOgZ:function(module,exports,__webpack_require__){"use strict";function StringReader(data){DataReader.call(this,data)}var DataReader=__webpack_require__("ML/b"),utils=__webpack_require__("dvMn");utils.inherits(StringReader,DataReader),StringReader.prototype.byteAt=function(i){return this.data.charCodeAt(this.zero+i)},StringReader.prototype.lastIndexOfSignature=function(sig){return this.data.lastIndexOf(sig)-this.zero},StringReader.prototype.readAndCheckSignature=function(sig){var data=this.readData(4);return sig===data},StringReader.prototype.readData=function(size){this.checkOffset(size);var result=this.data.slice(this.zero+this.index,this.zero+this.index+size);return this.index+=size,result},module.exports=StringReader},"wl+m":function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function copyBuffer(src,target,offset){src.copy(target,offset)}var Buffer=__webpack_require__("38Wu").Buffer,util=__webpack_require__(1);module.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};0<this.length?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var ret=Buffer.allocUnsafe(n>>>0),p=this.head,i=0;p;)copyBuffer(p.data,ret,i),i+=p.data.length,p=p.next;return ret},BufferList}(),util&&util.inspect&&util.inspect.custom&&(module.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})},xUUw:function(module){"use strict";module.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},xdvC:function(module,exports,__webpack_require__){"use strict";(function(mod){mod(__webpack_require__("tQq4"),__webpack_require__("1JcR"))})(function(CodeMirror){function clear(cm){cm.state.tagHit&&cm.state.tagHit.clear(),cm.state.tagOther&&cm.state.tagOther.clear(),cm.state.tagHit=cm.state.tagOther=null}function doMatchTags(cm){cm.state.failedTagMatch=!1,cm.operation(function(){if(clear(cm),!cm.somethingSelected()){var cur=cm.getCursor(),range=cm.getViewport();range.from=Math.min(range.from,cur.line),range.to=Math.max(cur.line+1,range.to);var match=CodeMirror.findMatchingTag(cm,cur,range);if(match){if(cm.state.matchBothTags){var hit="open"==match.at?match.open:match.close;hit&&(cm.state.tagHit=cm.markText(hit.from,hit.to,{className:"CodeMirror-matchingtag"}))}var other="close"==match.at?match.open:match.close;other?cm.state.tagOther=cm.markText(other.from,other.to,{className:"CodeMirror-matchingtag"}):cm.state.failedTagMatch=!0}}})}function maybeUpdateMatch(cm){cm.state.failedTagMatch&&doMatchTags(cm)}CodeMirror.defineOption("matchTags",!1,function(cm,val,old){old&&old!=CodeMirror.Init&&(cm.off("cursorActivity",doMatchTags),cm.off("viewportChange",maybeUpdateMatch),clear(cm)),val&&(cm.state.matchBothTags="object"==typeof val&&val.bothTags,cm.on("cursorActivity",doMatchTags),cm.on("viewportChange",maybeUpdateMatch),doMatchTags(cm))}),CodeMirror.commands.toMatchingTag=function(cm){var found=CodeMirror.findMatchingTag(cm,cm.getCursor());if(found){var other="close"==found.at?found.open:found.close;other&&cm.extendSelection(other.to,other.from)}}})},xtj2:function(module,exports,__webpack_require__){"use strict";function ZipFileWorker(streamFiles,comment,platform,encodeFileName){GenericWorker.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=comment,this.zipPlatform=platform,this.encodeFileName=encodeFileName,this.streamFiles=streamFiles,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}var utils=__webpack_require__("dvMn"),GenericWorker=__webpack_require__("ZKdc"),utf8=__webpack_require__("Sm7/"),crc32=__webpack_require__("cvyR"),signature=__webpack_require__("Ctqd"),decToHex=function(dec,bytes){var hex="",i;for(i=0;i<bytes;i++)hex+=String.fromCharCode(255&dec),dec>>>=8;return hex},generateUnixExternalFileAttr=function(unixPermissions,isDir){var result=unixPermissions;return unixPermissions||(result=isDir?16893:33204),(65535&result)<<16},generateDosExternalFileAttr=function(dosPermissions){return 63&(dosPermissions||0)},generateZipParts=function(streamInfo,streamedContent,streamingEnded,offset,platform,encodeFileName){var file=streamInfo.file,compression=streamInfo.compression,useCustomEncoding=encodeFileName!==utf8.utf8encode,encodedFileName=utils.transformTo("string",encodeFileName(file.name)),utfEncodedFileName=utils.transformTo("string",utf8.utf8encode(file.name)),comment=file.comment,encodedComment=utils.transformTo("string",encodeFileName(comment)),utfEncodedComment=utils.transformTo("string",utf8.utf8encode(comment)),useUTF8ForFileName=utfEncodedFileName.length!==file.name.length,useUTF8ForComment=utfEncodedComment.length!==comment.length,extraFields="",unicodePathExtraField="",unicodeCommentExtraField="",dir=file.dir,date=file.date,dataInfo={crc32:0,compressedSize:0,uncompressedSize:0},dosTime,dosDate;(!streamedContent||streamingEnded)&&(dataInfo.crc32=streamInfo.crc32,dataInfo.compressedSize=streamInfo.compressedSize,dataInfo.uncompressedSize=streamInfo.uncompressedSize);var bitflag=0;streamedContent&&(bitflag|=8),!useCustomEncoding&&(useUTF8ForFileName||useUTF8ForComment)&&(bitflag|=2048);var extFileAttr=0,versionMadeBy=0;dir&&(extFileAttr|=16),"UNIX"===platform?(versionMadeBy=798,extFileAttr|=generateUnixExternalFileAttr(file.unixPermissions,dir)):(versionMadeBy=20,extFileAttr|=generateDosExternalFileAttr(file.dosPermissions,dir)),dosTime=date.getUTCHours(),dosTime<<=6,dosTime|=date.getUTCMinutes(),dosTime<<=5,dosTime|=date.getUTCSeconds()/2,dosDate=date.getUTCFullYear()-1980,dosDate<<=4,dosDate|=date.getUTCMonth()+1,dosDate<<=5,dosDate|=date.getUTCDate(),useUTF8ForFileName&&(unicodePathExtraField=decToHex(1,1)+decToHex(crc32(encodedFileName),4)+utfEncodedFileName,extraFields+="up"+decToHex(unicodePathExtraField.length,2)+unicodePathExtraField),useUTF8ForComment&&(unicodeCommentExtraField=decToHex(1,1)+decToHex(crc32(encodedComment),4)+utfEncodedComment,extraFields+="uc"+decToHex(unicodeCommentExtraField.length,2)+unicodeCommentExtraField);var header="";header+="\n\0",header+=decToHex(bitflag,2),header+=compression.magic,header+=decToHex(dosTime,2),header+=decToHex(dosDate,2),header+=decToHex(dataInfo.crc32,4),header+=decToHex(dataInfo.compressedSize,4),header+=decToHex(dataInfo.uncompressedSize,4),header+=decToHex(encodedFileName.length,2),header+=decToHex(extraFields.length,2);var fileRecord=signature.LOCAL_FILE_HEADER+header+encodedFileName+extraFields,dirRecord=signature.CENTRAL_FILE_HEADER+decToHex(versionMadeBy,2)+header+decToHex(encodedComment.length,2)+"\0\0\0\0"+decToHex(extFileAttr,4)+decToHex(offset,4)+encodedFileName+extraFields+encodedComment;return{fileRecord:fileRecord,dirRecord:dirRecord}},generateCentralDirectoryEnd=function(entriesCount,centralDirLength,localDirLength,comment,encodeFileName){var dirEnd="",encodedComment=utils.transformTo("string",encodeFileName(comment));return dirEnd=signature.CENTRAL_DIRECTORY_END+"\0\0\0\0"+decToHex(entriesCount,2)+decToHex(entriesCount,2)+decToHex(centralDirLength,4)+decToHex(localDirLength,4)+decToHex(encodedComment.length,2)+encodedComment,dirEnd},generateDataDescriptors=function(streamInfo){var descriptor="";return descriptor=signature.DATA_DESCRIPTOR+decToHex(streamInfo.crc32,4)+decToHex(streamInfo.compressedSize,4)+decToHex(streamInfo.uncompressedSize,4),descriptor};utils.inherits(ZipFileWorker,GenericWorker),ZipFileWorker.prototype.push=function(chunk){var currentFilePercent=chunk.meta.percent||0,entriesCount=this.entriesCount,remainingFiles=this._sources.length;this.accumulate?this.contentBuffer.push(chunk):(this.bytesWritten+=chunk.data.length,GenericWorker.prototype.push.call(this,{data:chunk.data,meta:{currentFile:this.currentFile,percent:entriesCount?(currentFilePercent+100*(entriesCount-remainingFiles-1))/entriesCount:100}}))},ZipFileWorker.prototype.openedSource=function(streamInfo){this.currentSourceOffset=this.bytesWritten,this.currentFile=streamInfo.file.name;var streamedContent=this.streamFiles&&!streamInfo.file.dir;if(streamedContent){var record=generateZipParts(streamInfo,streamedContent,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:record.fileRecord,meta:{percent:0}})}else this.accumulate=!0},ZipFileWorker.prototype.closedSource=function(streamInfo){this.accumulate=!1;var streamedContent=this.streamFiles&&!streamInfo.file.dir,record=generateZipParts(streamInfo,streamedContent,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(record.dirRecord),streamedContent)this.push({data:generateDataDescriptors(streamInfo),meta:{percent:100}});else for(this.push({data:record.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},ZipFileWorker.prototype.flush=function(){for(var localDirLength=this.bytesWritten,i=0;i<this.dirRecords.length;i++)this.push({data:this.dirRecords[i],meta:{percent:100}});var centralDirLength=this.bytesWritten-localDirLength,dirEnd=generateCentralDirectoryEnd(this.dirRecords.length,centralDirLength,localDirLength,this.zipComment,this.encodeFileName);this.push({data:dirEnd,meta:{percent:100}})},ZipFileWorker.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},ZipFileWorker.prototype.registerPrevious=function(previous){this._sources.push(previous);var self=this;return previous.on("data",function(chunk){self.processChunk(chunk)}),previous.on("end",function(){self.closedSource(self.previous.streamInfo),self._sources.length?self.prepareNextSource():self.end()}),previous.on("error",function(e){self.error(e)}),this},ZipFileWorker.prototype.resume=function(){return!!GenericWorker.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},ZipFileWorker.prototype.error=function(e){var sources=this._sources;if(!GenericWorker.prototype.error.call(this,e))return!1;for(var i=0;i<sources.length;i++)try{sources[i].error(e)}catch(e){}return!0},ZipFileWorker.prototype.lock=function(){GenericWorker.prototype.lock.call(this);for(var sources=this._sources,i=0;i<sources.length;i++)sources[i].lock()},module.exports=ZipFileWorker},xz3w:function(module,exports,__webpack_require__){"use strict";function INTERNAL(){}function Promise(resolver){if("function"!=typeof resolver)throw new TypeError("resolver must be a function");this.state=PENDING,this.queue=[],this.outcome=void 0,resolver!==INTERNAL&&safelyResolveThenable(this,resolver)}function QueueItem(promise,onFulfilled,onRejected){this.promise=promise,"function"==typeof onFulfilled&&(this.onFulfilled=onFulfilled,this.callFulfilled=this.otherCallFulfilled),"function"==typeof onRejected&&(this.onRejected=onRejected,this.callRejected=this.otherCallRejected)}function unwrap(promise,func,value){immediate(function(){var returnValue;try{returnValue=func(value)}catch(e){return handlers.reject(promise,e)}returnValue===promise?handlers.reject(promise,new TypeError("Cannot resolve promise with itself")):handlers.resolve(promise,returnValue)})}function getThen(obj){var then=obj&&obj.then;if(obj&&("object"==typeof obj||"function"==typeof obj)&&"function"==typeof then)return function(){then.apply(obj,arguments)}}function safelyResolveThenable(self,thenable){function onError(value){called||(called=!0,handlers.reject(self,value))}function onSuccess(value){called||(called=!0,handlers.resolve(self,value))}var called=!1,result=tryCatch(function(){thenable(onSuccess,onError)});"error"===result.status&&onError(result.value)}function tryCatch(func,value){var out={};try{out.value=func(value),out.status="success"}catch(e){out.status="error",out.value=e}return out}var immediate=__webpack_require__("uUPe"),handlers={},REJECTED=["REJECTED"],FULFILLED=["FULFILLED"],PENDING=["PENDING"];module.exports=Promise,Promise.prototype["catch"]=function(onRejected){return this.then(null,onRejected)},Promise.prototype.then=function(onFulfilled,onRejected){if("function"!=typeof onFulfilled&&this.state===FULFILLED||"function"!=typeof onRejected&&this.state===REJECTED)return this;var promise=new this.constructor(INTERNAL);if(this.state!==PENDING){var resolver=this.state===FULFILLED?onFulfilled:onRejected;unwrap(promise,resolver,this.outcome)}else this.queue.push(new QueueItem(promise,onFulfilled,onRejected));return promise},QueueItem.prototype.callFulfilled=function(value){handlers.resolve(this.promise,value)},QueueItem.prototype.otherCallFulfilled=function(value){unwrap(this.promise,this.onFulfilled,value)},QueueItem.prototype.callRejected=function(value){handlers.reject(this.promise,value)},QueueItem.prototype.otherCallRejected=function(value){unwrap(this.promise,this.onRejected,value)},handlers.resolve=function(self,value){var result=tryCatch(getThen,value);if("error"===result.status)return handlers.reject(self,result.value);var thenable=result.value;if(thenable)safelyResolveThenable(self,thenable);else{self.state=FULFILLED,self.outcome=value;for(var i=-1,len=self.queue.length;++i<len;)self.queue[i].callFulfilled(value)}return self},handlers.reject=function(self,error){self.state=REJECTED,self.outcome=error;for(var i=-1,len=self.queue.length;++i<len;)self.queue[i].callRejected(error);return self},Promise.resolve=function(value){return value instanceof this?value:handlers.resolve(new this(INTERNAL),value)},Promise.reject=function(reason){var promise=new this(INTERNAL);return handlers.reject(promise,reason)},Promise.all=function(iterable){function allResolver(value,i){self.resolve(value).then(function(outValue){values[i]=outValue,++resolved!==len||called||(called=!0,handlers.resolve(promise,values))},function(error){called||(called=!0,handlers.reject(promise,error))})}var self=this;if("[object Array]"!==Object.prototype.toString.call(iterable))return this.reject(new TypeError("must be an array"));var len=iterable.length,called=!1;if(!len)return this.resolve([]);for(var values=Array(len),resolved=0,i=-1,promise=new this(INTERNAL);++i<len;)allResolver(iterable[i],i);return promise},Promise.race=function(iterable){function resolver(value){self.resolve(value).then(function(response){called||(called=!0,handlers.resolve(promise,response))},function(error){called||(called=!0,handlers.reject(promise,error))})}var self=this;if("[object Array]"!==Object.prototype.toString.call(iterable))return this.reject(new TypeError("must be an array"));var len=iterable.length,called=!1;if(!len)return this.resolve([]);for(var i=-1,promise=new this(INTERNAL);++i<len;)resolver(iterable[i]);return promise}},yLr7:function(module,exports,__webpack_require__){"use strict";var _Mathabs2=Math.abs,_Mathfloor6=Math.floor,_StringfromCharCode8=String.fromCharCode,_Mathmin8=Math.min,_Mathmax7=Math.max;(function(mod){mod(__webpack_require__("tQq4"),__webpack_require__("29F7"),__webpack_require__("4e7A"),__webpack_require__("uQIK"))})(function(CodeMirror){var defaultKeymap=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",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:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",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<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<character>",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:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",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:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",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:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",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<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<character>",type:"action",action:"replayMacro"},{keys:"q<character>",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:"<C-r>",type:"action",action:"redo"},{keys:"m<character>",type:"action",action:"setMark"},{keys:"\"<character>",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<CR>",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:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<character>",type:"motion",motion:"textObjectManipulation"},{keys:"i<character>",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"}],defaultExCommandMap=[{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"}],Pos=CodeMirror.Pos;CodeMirror.Vim=function(){function enterVimMode(cm){cm.setOption("disableInput",!0),cm.setOption("showCursorWhenSelecting",!1),CodeMirror.signal(cm,"vim-mode-change",{mode:"normal"}),cm.on("cursorActivity",onCursorActivity),maybeInitVimState(cm),CodeMirror.on(cm.getInputField(),"paste",getOnPasteFn(cm))}function leaveVimMode(cm){cm.setOption("disableInput",!1),cm.off("cursorActivity",onCursorActivity),CodeMirror.off(cm.getInputField(),"paste",getOnPasteFn(cm)),cm.state.vim=null}function detachVimMap(cm,next){this==CodeMirror.keyMap.vim&&(CodeMirror.rmClass(cm.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==cm.getOption("inputStyle")&&null!=document.body.style.caretColor&&(disableFatCursorMark(cm),cm.getInputField().style.caretColor="")),next&&next.attach==attachVimMap||leaveVimMode(cm)}function attachVimMap(cm,prev){this==CodeMirror.keyMap.vim&&(CodeMirror.addClass(cm.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==cm.getOption("inputStyle")&&null!=document.body.style.caretColor&&(enableFatCursorMark(cm),cm.getInputField().style.caretColor="transparent")),prev&&prev.attach==attachVimMap||enterVimMode(cm)}function fatCursorMarks(cm){for(var ranges=cm.listSelections(),result=[],i=0,range;i<ranges.length;i++)if(range=ranges[i],range.empty())if(range.anchor.ch<cm.getLine(range.anchor.line).length)result.push(cm.markText(range.anchor,Pos(range.anchor.line,range.anchor.ch+1),{className:"cm-fat-cursor-mark"}));else{var widget=document.createElement("span");widget.textContent="\xA0",widget.className="cm-fat-cursor-mark",result.push(cm.setBookmark(range.anchor,{widget:widget}))}return result}function updateFatCursorMark(cm){var marks=cm.state.fatCursorMarks;if(marks)for(var i=0;i<marks.length;i++)marks[i].clear();cm.state.fatCursorMarks=fatCursorMarks(cm)}function enableFatCursorMark(cm){cm.state.fatCursorMarks=fatCursorMarks(cm),cm.on("cursorActivity",updateFatCursorMark)}function disableFatCursorMark(cm){var marks=cm.state.fatCursorMarks;if(marks)for(var i=0;i<marks.length;i++)marks[i].clear();cm.state.fatCursorMarks=null,cm.off("cursorActivity",updateFatCursorMark)}function cmKey(key,cm){if(cm){if(this[key])return this[key];var vimKey=cmKeyToVimKey(key);if(!vimKey)return!1;var cmd=CodeMirror.Vim.findKey(cm,vimKey);return"function"==typeof cmd&&CodeMirror.signal(cm,"vim-keypress",vimKey),cmd}}function cmKeyToVimKey(key){if("'"==key.charAt(0))return key.charAt(1);var pieces=key.split(/-(?!$)/),lastPiece=pieces[pieces.length-1];if(1==pieces.length&&1==pieces[0].length)return!1;if(2==pieces.length&&"Shift"==pieces[0]&&1==lastPiece.length)return!1;for(var hasCharacter=!1,i=0,piece;i<pieces.length;i++)piece=pieces[i],piece in modifiers?pieces[i]=modifiers[piece]:hasCharacter=!0,piece in specialKeys&&(pieces[i]=specialKeys[piece]);return!!hasCharacter&&(isUpperCase(lastPiece)&&(pieces[pieces.length-1]=lastPiece.toLowerCase()),"<"+pieces.join("-")+">")}function getOnPasteFn(cm){var vim=cm.state.vim;return vim.onPasteFn||(vim.onPasteFn=function(){vim.insertMode||(cm.setCursor(offsetCursor(cm.getCursor(),0,1)),actions.enterInsertMode(cm,{},vim))}),vim.onPasteFn}function makeKeyRange(start,size){for(var keys=[],i=start;i<start+size;i++)keys.push(_StringfromCharCode8(i));return keys}function isLine(cm,line){return line>=cm.firstLine()&&line<=cm.lastLine()}function isLowerCase(k){return /^[a-z]$/.test(k)}function isMatchableSymbol(k){return-1!="()[]{}".indexOf(k)}function isNumber(k){return numberRegex.test(k)}function isUpperCase(k){return /^[A-Z]$/.test(k)}function isWhiteSpaceString(k){return /^\s*$/.test(k)}function isEndOfSentenceSymbol(k){return-1!=".?!".indexOf(k)}function inArray(val,arr){for(var i=0;i<arr.length;i++)if(arr[i]==val)return!0;return!1}function defineOption(name,defaultValue,type,aliases,callback){if(void 0===defaultValue&&!callback)throw Error("defaultValue is required unless callback is provided");if(type||(type="string"),options[name]={type:type,defaultValue:defaultValue,callback:callback},aliases)for(var i=0;i<aliases.length;i++)options[aliases[i]]=options[name];defaultValue&&setOption(name,defaultValue)}function setOption(name,value,cm,cfg){var option=options[name];cfg=cfg||{};var scope=cfg.scope;if(!option)return new Error("Unknown option: "+name);if("boolean"==option.type){if(value&&!0!==value)return new Error("Invalid argument: "+name+"="+value);!1!==value&&(value=!0)}option.callback?("local"!==scope&&option.callback(value,void 0),"global"!==scope&&cm&&option.callback(value,cm)):("local"!==scope&&(option.value="boolean"==option.type?!!value:value),"global"!==scope&&cm&&(cm.state.vim.options[name]={value:value}))}function getOption(name,cm,cfg){var option=options[name];cfg=cfg||{};var scope=cfg.scope;if(!option)return new Error("Unknown option: "+name);if(option.callback){var local=cm&&option.callback(void 0,cm);return"global"!==scope&&void 0!==local?local:"local"===scope?void 0:option.callback()}var local="global"!==scope&&cm&&cm.state.vim.options[name];return(local||"local"!==scope&&option||{}).value}function MacroModeState(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=createInsertModeChanges()}function maybeInitVimState(cm){return cm.state.vim||(cm.state.vim={inputState:new InputState,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},fakeCursor:null,insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),cm.state.vim}function resetVimGlobalState(){for(var optionName in vimGlobalState={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:createCircularJumpList(),macroModeState:new MacroModeState,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new RegisterController({}),searchHistoryController:new HistoryController,exCommandHistoryController:new HistoryController},options){var option=options[optionName];option.value=option.defaultValue}}function InputState(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function clearInputState(cm,reason){cm.state.vim.inputState=new InputState,CodeMirror.signal(cm,"vim-command-done",reason)}function Register(text,linewise,blockwise){this.clear(),this.keyBuffer=[text||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!linewise,this.blockwise=!!blockwise}function RegisterController(registers){this.registers=registers,this.unnamedRegister=registers["\""]=new Register,registers["."]=new Register,registers[":"]=new Register,registers["/"]=new Register}function HistoryController(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}function fillArray(val,times){for(var arr=[],i=0;i<times;i++)arr.push(val);return arr}function clipCursorToContent(cm,cur,includeLineBreak){var line=_Mathmin8(_Mathmax7(cm.firstLine(),cur.line),cm.lastLine()),maxCh=lineLength(cm,line)-1;maxCh=includeLineBreak?maxCh+1:maxCh;var ch=_Mathmin8(_Mathmax7(0,cur.ch),maxCh);return Pos(line,ch)}function copyArgs(args){var ret={};for(var prop in args)args.hasOwnProperty(prop)&&(ret[prop]=args[prop]);return ret}function offsetCursor(cur,offsetLine,offsetCh){return"object"==typeof offsetLine&&(offsetCh=offsetLine.ch,offsetLine=offsetLine.line),Pos(cur.line+offsetLine,cur.ch+offsetCh)}function getOffset(anchor,head){return{line:head.line-anchor.line,ch:head.line-anchor.line}}function commandMatches(keys,keyMap,context,inputState){for(var partial=[],full=[],i=0,match,command;i<keyMap.length;i++)(command=keyMap[i],!("insert"==context&&"insert"!=command.context||command.context&&command.context!=context||inputState.operator&&"action"==command.type||!(match=commandMatch(keys,command.keys))))&&("partial"==match&&partial.push(command),"full"==match&&full.push(command));return{partial:partial.length&&partial,full:full.length&&full}}function commandMatch(pressed,mapped){if("<character>"==mapped.slice(-11)){var prefixLen=mapped.length-11,pressedPrefix=pressed.slice(0,prefixLen),mappedPrefix=mapped.slice(0,prefixLen);return pressedPrefix==mappedPrefix&&pressed.length>prefixLen?"full":0==mappedPrefix.indexOf(pressedPrefix)&&"partial"}return pressed==mapped?"full":0==mapped.indexOf(pressed)&&"partial"}function lastChar(keys){var match=/^.*(<[^>]+>)$/.exec(keys),selectedCharacter=match?match[1]:keys.slice(-1);return 1<selectedCharacter.length&&(selectedCharacter="<CR>"===selectedCharacter?"\n":"<Space>"===selectedCharacter?" ":""),selectedCharacter}function repeatFn(cm,fn,repeat){return function(){for(var i=0;i<repeat;i++)fn(cm)}}function copyCursor(cur){return Pos(cur.line,cur.ch)}function cursorEqual(cur1,cur2){return cur1.ch==cur2.ch&&cur1.line==cur2.line}function cursorIsBefore(cur1,cur2){return!!(cur1.line<cur2.line)||cur1.line==cur2.line&&cur1.ch<cur2.ch}function cursorMin(cur1,cur2){return 2<arguments.length&&(cur2=cursorMin.apply(void 0,Array.prototype.slice.call(arguments,1))),cursorIsBefore(cur1,cur2)?cur1:cur2}function cursorMax(cur1,cur2){return 2<arguments.length&&(cur2=cursorMax.apply(void 0,Array.prototype.slice.call(arguments,1))),cursorIsBefore(cur1,cur2)?cur2:cur1}function cursorIsBetween(cur1,cur2,cur3){var cur1before2=cursorIsBefore(cur1,cur2),cur2before3=cursorIsBefore(cur2,cur3);return cur1before2&&cur2before3}function lineLength(cm,lineNum){return cm.getLine(lineNum).length}function trim(s){return s.trim?s.trim():s.replace(/^\s+|\s+$/g,"")}function escapeRegex(s){return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function extendLineToColumn(cm,lineNum,column){var endCh=lineLength(cm,lineNum),spaces=Array(column-endCh+1).join(" ");cm.setCursor(Pos(lineNum,endCh)),cm.replaceRange(spaces,cm.getCursor())}function selectBlock(cm,selectionEnd){var selections=[],ranges=cm.listSelections(),head=copyCursor(cm.clipPos(selectionEnd)),isClipped=!cursorEqual(selectionEnd,head),curHead=cm.getCursor("head"),primIndex=getIndex(ranges,curHead),wasClipped=cursorEqual(ranges[primIndex].head,ranges[primIndex].anchor),max=ranges.length-1,index=max-primIndex>primIndex?max:0,base=ranges[index].anchor,firstLine=_Mathmin8(base.line,head.line),lastLine=_Mathmax7(base.line,head.line),baseCh=base.ch,headCh=head.ch,dir=ranges[index].head.ch-baseCh,newDir=headCh-baseCh;0<dir&&0>=newDir?(baseCh++,!isClipped&&headCh--):0>dir&&0<=newDir?(baseCh--,!wasClipped&&headCh++):0>dir&&-1==newDir&&(baseCh--,headCh++);for(var line=firstLine,range;line<=lastLine;line++)range={anchor:new Pos(line,baseCh),head:new Pos(line,headCh)},selections.push(range);return cm.setSelections(selections),selectionEnd.ch=headCh,base.ch=baseCh,base}function selectForInsert(cm,head,height){for(var sel=[],i=0,lineHead;i<height;i++)lineHead=offsetCursor(head,i,0),sel.push({anchor:lineHead,head:lineHead});cm.setSelections(sel,0)}function getIndex(ranges,cursor,end){for(var i=0;i<ranges.length;i++){var atAnchor="head"!=end&&cursorEqual(ranges[i].anchor,cursor),atHead="anchor"!=end&&cursorEqual(ranges[i].head,cursor);if(atAnchor||atHead)return i}return-1}function getSelectedAreaRange(cm,vim){var lastSelection=vim.lastSelection;return vim.visualMode?function(){var selections=cm.listSelections(),start=selections[0],end=selections[selections.length-1],selectionStart=cursorIsBefore(start.anchor,start.head)?start.anchor:start.head,selectionEnd=cursorIsBefore(end.anchor,end.head)?end.head:end.anchor;return[selectionStart,selectionEnd]}():function(){var selectionStart=cm.getCursor(),selectionEnd=cm.getCursor(),block=lastSelection.visualBlock;if(block){var width=block.width,height=block.height;selectionEnd=Pos(selectionStart.line+height,selectionStart.ch+width);for(var selections=[],i=selectionStart.line;i<selectionEnd.line;i++){var anchor=Pos(i,selectionStart.ch),head=Pos(i,selectionEnd.ch);selections.push({anchor:anchor,head:head})}cm.setSelections(selections)}else{var start=lastSelection.anchorMark.find(),end=lastSelection.headMark.find(),line=end.line-start.line,ch=end.ch-start.ch;selectionEnd={line:selectionEnd.line+line,ch:line?selectionEnd.ch:ch+selectionEnd.ch},lastSelection.visualLine&&(selectionStart=Pos(selectionStart.line,0),selectionEnd=Pos(selectionEnd.line,lineLength(cm,selectionEnd.line))),cm.setSelection(selectionStart,selectionEnd)}return[selectionStart,selectionEnd]}()}function updateLastSelection(cm,vim){var anchor=vim.sel.anchor,head=vim.sel.head;vim.lastPastedText&&(head=cm.posFromIndex(cm.indexFromPos(anchor)+vim.lastPastedText.length),vim.lastPastedText=null),vim.lastSelection={anchorMark:cm.setBookmark(anchor),headMark:cm.setBookmark(head),anchor:copyCursor(anchor),head:copyCursor(head),visualMode:vim.visualMode,visualLine:vim.visualLine,visualBlock:vim.visualBlock}}function expandSelection(cm,start,end){var sel=cm.state.vim.sel,head=sel.head,anchor=sel.anchor,tmp;return cursorIsBefore(end,start)&&(tmp=end,end=start,start=tmp),cursorIsBefore(head,anchor)?(head=cursorMin(start,head),anchor=cursorMax(anchor,end)):(anchor=cursorMin(start,anchor),head=cursorMax(head,end),head=offsetCursor(head,0,-1),-1==head.ch&&head.line!=cm.firstLine()&&(head=Pos(head.line-1,lineLength(cm,head.line-1)))),[anchor,head]}function updateCmSelection(cm,sel,mode){var vim=cm.state.vim;sel=sel||vim.sel;var mode=mode||vim.visualLine?"line":vim.visualBlock?"block":"char",cmSel=makeCmSelection(cm,sel,mode);cm.setSelections(cmSel.ranges,cmSel.primary),updateFakeCursor(cm)}function makeCmSelection(cm,sel,mode,exclusive){var head=copyCursor(sel.head),anchor=copyCursor(sel.anchor);if("char"==mode){var headOffset=exclusive||cursorIsBefore(sel.head,sel.anchor)?0:1,anchorOffset=cursorIsBefore(sel.head,sel.anchor)?1:0;return head=offsetCursor(sel.head,0,headOffset),anchor=offsetCursor(sel.anchor,0,anchorOffset),{ranges:[{anchor:anchor,head:head}],primary:0}}if("line"==mode){if(!cursorIsBefore(sel.head,sel.anchor)){anchor.ch=0;var lastLine=cm.lastLine();head.line>lastLine&&(head.line=lastLine),head.ch=lineLength(cm,head.line)}else head.ch=0,anchor.ch=lineLength(cm,anchor.line);return{ranges:[{anchor:anchor,head:head}],primary:0}}if("block"==mode){for(var top=_Mathmin8(anchor.line,head.line),left=_Mathmin8(anchor.ch,head.ch),bottom=_Mathmax7(anchor.line,head.line),right=_Mathmax7(anchor.ch,head.ch)+1,height=bottom-top+1,primary=head.line==top?0:height-1,ranges=[],i=0;i<height;i++)ranges.push({anchor:Pos(top+i,left),head:Pos(top+i,right)});return{ranges:ranges,primary:primary}}}function getHead(cm){var cur=cm.getCursor("head");return 1==cm.getSelection().length&&(cur=cursorMin(cur,cm.getCursor("anchor"))),cur}function exitVisualMode(cm,moveHead){var vim=cm.state.vim;!1!==moveHead&&cm.setCursor(clipCursorToContent(cm,vim.sel.head)),updateLastSelection(cm,vim),vim.visualMode=!1,vim.visualLine=!1,vim.visualBlock=!1,CodeMirror.signal(cm,"vim-mode-change",{mode:"normal"}),vim.fakeCursor&&vim.fakeCursor.clear()}function clipToLine(cm,curStart,curEnd){var selection=cm.getRange(curStart,curEnd);if(/\n\s*$/.test(selection)){var lines=selection.split("\n");lines.pop();for(var line=lines.pop(),line;0<lines.length&&line&&isWhiteSpaceString(line);line=lines.pop())curEnd.line--,curEnd.ch=0;line?(curEnd.line--,curEnd.ch=lineLength(cm,curEnd.line)):curEnd.ch=0}}function expandSelectionToLine(_cm,curStart,curEnd){curStart.ch=0,curEnd.ch=0,curEnd.line++}function findFirstNonWhiteSpaceCharacter(text){if(!text)return 0;var firstNonWS=text.search(/\S/);return-1==firstNonWS?text.length:firstNonWS}function expandWordUnderCursor(cm,inclusive,_forward,bigWord,noSymbol){for(var cur=getHead(cm),line=cm.getLine(cur.line),idx=cur.ch,test=noSymbol?wordCharTest[0]:bigWordCharTest[0];!test(line.charAt(idx));)if(idx++,idx>=line.length)return null;bigWord?test=bigWordCharTest[0]:(test=wordCharTest[0],!test(line.charAt(idx))&&(test=wordCharTest[1]));for(var end=idx,start=idx;test(line.charAt(end))&&end<line.length;)end++;for(;test(line.charAt(start))&&0<=start;)start--;if(start++,inclusive){for(var wordEnd=end;/\s/.test(line.charAt(end))&&end<line.length;)end++;if(wordEnd==end){for(var wordStart=start;/\s/.test(line.charAt(start-1))&&0<start;)start--;start||(start=wordStart)}}return{start:Pos(cur.line,start),end:Pos(cur.line,end)}}function recordJumpPosition(cm,oldCur,newCur){cursorEqual(oldCur,newCur)||vimGlobalState.jumpList.add(cm,oldCur,newCur)}function recordLastCharacterSearch(increment,args){vimGlobalState.lastCharacterSearch.increment=increment,vimGlobalState.lastCharacterSearch.forward=args.forward,vimGlobalState.lastCharacterSearch.selectedCharacter=args.selectedCharacter}function findSymbol(cm,repeat,forward,symb){var cur=copyCursor(cm.getCursor()),increment=forward?1:-1,endLine=forward?cm.lineCount():-1,curCh=cur.ch,line=cur.line,lineText=cm.getLine(line),state={lineText:lineText,nextCh:lineText.charAt(curCh),lastCh:null,index:curCh,symb:symb,reverseSymb:(forward?{")":"(","}":"{"}:{"(":")","{":"}"})[symb],forward:forward,depth:0,curMoveThrough:!1},mode=symbolToMode[symb];if(!mode)return cur;var init=findSymbolModes[mode].init,isComplete=findSymbolModes[mode].isComplete;for(init&&init(state);line!==endLine&&repeat;){if(state.index+=increment,state.nextCh=state.lineText.charAt(state.index),!state.nextCh){if(line+=increment,state.lineText=cm.getLine(line)||"",0<increment)state.index=0;else{var lineLen=state.lineText.length;state.index=0<lineLen?lineLen-1:0}state.nextCh=state.lineText.charAt(state.index)}isComplete(state)&&(cur.line=line,cur.ch=state.index,repeat--)}return state.nextCh||state.curMoveThrough?Pos(line,state.index):cur}function findWord(cm,cur,forward,bigWord,emptyLineIsWord){var lineNum=cur.line,pos=cur.ch,line=cm.getLine(lineNum),dir=forward?1:-1,charTests=bigWord?bigWordCharTest:wordCharTest;if(emptyLineIsWord&&""==line){if(lineNum+=dir,line=cm.getLine(lineNum),!isLine(cm,lineNum))return null;pos=forward?0:line.length}for(;;){if(emptyLineIsWord&&""==line)return{from:0,to:0,line:lineNum};for(var stop=0<dir?line.length:-1,wordStart=stop,wordEnd=stop;pos!=stop;){for(var foundWord=!1,i=0;i<charTests.length&&!foundWord;++i)if(charTests[i](line.charAt(pos))){for(wordStart=pos;pos!=stop&&charTests[i](line.charAt(pos));)pos+=dir;if(wordEnd=pos,foundWord=wordStart!=wordEnd,wordStart==cur.ch&&lineNum==cur.line&&wordEnd==wordStart+dir)continue;else return{from:_Mathmin8(wordStart,wordEnd+1),to:_Mathmax7(wordStart,wordEnd),line:lineNum}}foundWord||(pos+=dir)}if(lineNum+=dir,!isLine(cm,lineNum))return null;line=cm.getLine(lineNum),pos=0<dir?0:line.length}}function moveToWord(cm,cur,repeat,forward,wordEnd,bigWord){var curStart=copyCursor(cur),words=[];(forward&&!wordEnd||!forward&&wordEnd)&&repeat++;for(var i=0,word;i<repeat;i++){if(word=findWord(cm,cur,forward,bigWord,!(forward&&wordEnd)),!word){var eodCh=lineLength(cm,cm.lastLine());words.push(forward?{line:cm.lastLine(),from:eodCh,to:eodCh}:{line:0,from:0,to:0});break}words.push(word),cur=Pos(word.line,forward?word.to-1:word.from)}var shortCircuit=words.length!=repeat,firstWord=words[0],lastWord=words.pop();return forward&&!wordEnd?(shortCircuit||firstWord.from==curStart.ch&&firstWord.line==curStart.line||(lastWord=words.pop()),Pos(lastWord.line,lastWord.from)):forward&&wordEnd?Pos(lastWord.line,lastWord.to-1):!forward&&wordEnd?(shortCircuit||firstWord.to==curStart.ch&&firstWord.line==curStart.line||(lastWord=words.pop()),Pos(lastWord.line,lastWord.to)):Pos(lastWord.line,lastWord.from)}function _moveToCharacter(cm,repeat,forward,character){for(var cur=cm.getCursor(),start=cur.ch,i=0,idx,line;i<repeat;i++){if(line=cm.getLine(cur.line),idx=charIdxInLine(start,line,character,forward,!0),-1==idx)return null;start=idx}return Pos(cm.getCursor().line,idx)}function _moveToColumn(cm,repeat){var line=cm.getCursor().line;return clipCursorToContent(cm,Pos(line,repeat-1))}function updateMark(cm,vim,markName,pos){inArray(markName,validMarks)&&(vim.marks[markName]&&vim.marks[markName].clear(),vim.marks[markName]=cm.setBookmark(pos))}function charIdxInLine(start,line,character,forward,includeChar){var idx;return forward?(idx=line.indexOf(character,start+1),-1!=idx&&!includeChar&&(idx-=1)):(idx=line.lastIndexOf(character,start-1),-1!=idx&&!includeChar&&(idx+=1)),idx}function findParagraph(cm,head,repeat,dir,inclusive){function isEmpty(i){return!cm.getLine(i)}function isBoundary(i,dir,any){return any?isEmpty(i)!=isEmpty(i+dir):!isEmpty(i)&&isEmpty(i+dir)}var line=head.line,min=cm.firstLine(),max=cm.lastLine(),i=line,start,end;if(dir){for(;min<=i&&i<=max&&0<repeat;)isBoundary(i,dir)&&repeat--,i+=dir;return new Pos(i,0)}var vim=cm.state.vim;if(vim.visualLine&&isBoundary(line,1,!0)){var anchor=vim.sel.anchor;isBoundary(anchor.line,-1,!0)&&(!inclusive||anchor.line!=line)&&(line+=1)}var startState=isEmpty(line);for(i=line;i<=max&&repeat;i++)isBoundary(i,1,!0)&&(inclusive&&isEmpty(i)==startState||repeat--);for(end=new Pos(i,0),i>max&&!startState?startState=!0:inclusive=!1,i=line;i>min&&(inclusive&&isEmpty(i)!=startState&&i!=line||!isBoundary(i,-1,!0));i--);return start=new Pos(i,0),{start:start,end:end}}function findSentence(cm,cur,repeat,dir){function nextChar(cm,idx){if(0>idx.pos+idx.dir||idx.pos+idx.dir>=idx.line.length){if(idx.ln+=idx.dir,!isLine(cm,idx.ln))return idx.line=null,idx.ln=null,void(idx.pos=null);idx.line=cm.getLine(idx.ln),idx.pos=0<idx.dir?0:idx.line.length-1}else idx.pos+=idx.dir}function forward(cm,ln,pos,dir){var line=cm.getLine(ln),stop=""===line,curr={line:line,ln:ln,pos:pos,dir:dir},last_valid={ln:curr.ln,pos:curr.pos},skip_empty_lines=""===curr.line;for(nextChar(cm,curr);null!==curr.line;){if(last_valid.ln=curr.ln,last_valid.pos=curr.pos,""===curr.line&&!skip_empty_lines)return{ln:curr.ln,pos:curr.pos};if(stop&&""!==curr.line&&!isWhiteSpaceString(curr.line[curr.pos]))return{ln:curr.ln,pos:curr.pos};isEndOfSentenceSymbol(curr.line[curr.pos])&&!stop&&(curr.pos===curr.line.length-1||isWhiteSpaceString(curr.line[curr.pos+1]))&&(stop=!0),nextChar(cm,curr)}var line=cm.getLine(last_valid.ln);last_valid.pos=0;for(var i=line.length-1;0<=i;--i)if(!isWhiteSpaceString(line[i])){last_valid.pos=i;break}return last_valid}function reverse(cm,ln,pos,dir){var line=cm.getLine(ln),curr={line:line,ln:ln,pos:pos,dir:dir},last_valid={ln:curr.ln,pos:null},skip_empty_lines=""===curr.line;for(nextChar(cm,curr);null!==curr.line;){if(""===curr.line&&!skip_empty_lines)return null===last_valid.pos?{ln:curr.ln,pos:curr.pos}:last_valid;if(isEndOfSentenceSymbol(curr.line[curr.pos])&&null!==last_valid.pos&&(curr.ln!==last_valid.ln||curr.pos+1!==last_valid.pos))return last_valid;""===curr.line||isWhiteSpaceString(curr.line[curr.pos])||(skip_empty_lines=!1,last_valid={ln:curr.ln,pos:curr.pos}),nextChar(cm,curr)}var line=cm.getLine(last_valid.ln);last_valid.pos=0;for(var i=0;i<line.length;++i)if(!isWhiteSpaceString(line[i])){last_valid.pos=i;break}return last_valid}for(var curr_index={ln:cur.line,pos:cur.ch};0<repeat;)curr_index=0>dir?reverse(cm,curr_index.ln,curr_index.pos,dir):forward(cm,curr_index.ln,curr_index.pos,dir),repeat--;return Pos(curr_index.ln,curr_index.pos)}function selectCompanionObject(cm,head,symb,inclusive){var cur=head,bracketRegexp={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[symb],openSym={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[symb],curChar=cm.getLine(cur.line).charAt(cur.ch),offset=curChar===openSym?1:0,start,end;if(start=cm.scanForBracket(Pos(cur.line,cur.ch+offset),-1,void 0,{bracketRegex:bracketRegexp}),end=cm.scanForBracket(Pos(cur.line,cur.ch+offset),1,void 0,{bracketRegex:bracketRegexp}),!start||!end)return{start:cur,end:cur};if(start=start.pos,end=end.pos,start.line==end.line&&start.ch>end.ch||start.line>end.line){var tmp=start;start=end,end=tmp}return inclusive?end.ch+=1:start.ch+=1,{start:start,end:end}}function findBeginningAndEnd(cm,head,symb,inclusive){var cur=copyCursor(head),line=cm.getLine(cur.line),chars=line.split(""),firstIndex=chars.indexOf(symb),start,end,i,len;if(cur.ch<firstIndex?cur.ch=firstIndex:firstIndex<cur.ch&&chars[cur.ch]==symb&&(end=cur.ch,--cur.ch),chars[cur.ch]==symb&&!end)start=cur.ch+1;else for(i=cur.ch;-1<i&&!start;i--)chars[i]==symb&&(start=i+1);if(start&&!end)for(i=start,len=chars.length;i<len&&!end;i++)chars[i]==symb&&(end=i);return start&&end?(inclusive&&(--start,++end),{start:Pos(cur.line,start),end:Pos(cur.line,end)}):{start:cur,end:cur}}function SearchState(){}function getSearchState(cm){var vim=cm.state.vim;return vim.searchState_||(vim.searchState_=new SearchState)}function dialog(cm,template,shortText,onClose,options){cm.openDialog?cm.openDialog(template,onClose,{bottom:!0,value:options.value,onKeyDown:options.onKeyDown,onKeyUp:options.onKeyUp,selectValueOnOpen:!1}):onClose(prompt(shortText,""))}function splitBySlash(argString){return splitBySeparator(argString,"/")}function findUnescapedSlashes(argString){return findUnescapedSeparators(argString,"/")}function splitBySeparator(argString,separator){var slashes=findUnescapedSeparators(argString,separator)||[];if(!slashes.length)return[];var tokens=[];if(0===slashes[0]){for(var i=0;i<slashes.length;i++)"number"==typeof slashes[i]&&tokens.push(argString.substring(slashes[i]+1,slashes[i+1]));return tokens}}function findUnescapedSeparators(str,separator){separator||(separator="/");for(var escapeNextChar=!1,slashes=[],i=0,c;i<str.length;i++)c=str.charAt(i),escapeNextChar||c!=separator||slashes.push(i),escapeNextChar=!escapeNextChar&&"\\"==c;return slashes}function translateRegex(str){for(var escapeNextChar=!1,out=[],i=-1;i<str.length;i++){var c=str.charAt(i)||"",n=str.charAt(i+1)||"",specialComesNext=n&&-1!="|(){".indexOf(n);escapeNextChar?(("\\"!==c||!specialComesNext)&&out.push(c),escapeNextChar=!1):"\\"===c?(escapeNextChar=!0,n&&-1!="}".indexOf(n)&&(specialComesNext=!0),(!specialComesNext||"\\"===n)&&out.push(c)):(out.push(c),specialComesNext&&"\\"!==n&&out.push("\\"))}return out.join("")}function translateRegexReplace(str){for(var escapeNextChar=!1,out=[],i=-1;i<str.length;i++){var c=str.charAt(i)||"",n=str.charAt(i+1)||"";charUnescapes[c+n]?(out.push(charUnescapes[c+n]),i++):escapeNextChar?(out.push(c),escapeNextChar=!1):"\\"===c?(escapeNextChar=!0,isNumber(n)||"$"===n?out.push("$"):"/"!==n&&"\\"!==n&&out.push("\\")):("$"===c&&out.push("$"),out.push(c),"/"===n&&out.push("\\"))}return out.join("")}function unescapeRegexReplace(str){for(var stream=new CodeMirror.StringStream(str),output=[];!stream.eol();){for(;stream.peek()&&"\\"!=stream.peek();)output.push(stream.next());var matched=!1;for(var matcher in unescapes)if(stream.match(matcher,!0)){matched=!0,output.push(unescapes[matcher]);break}matched||output.push(stream.next())}return output.join("")}function parseQuery(query,ignoreCase,smartCase){var lastSearchRegister=vimGlobalState.registerController.getRegister("/");if(lastSearchRegister.setText(query),query instanceof RegExp)return query;var slashes=findUnescapedSlashes(query),regexPart,forceIgnoreCase;if(!slashes.length)regexPart=query;else{regexPart=query.substring(0,slashes[0]);var flagsPart=query.substring(slashes[0]);forceIgnoreCase=-1!=flagsPart.indexOf("i")}if(!regexPart)return null;getOption("pcre")||(regexPart=translateRegex(regexPart)),smartCase&&(ignoreCase=/^[^A-Z]*$/.test(regexPart));var regexp=new RegExp(regexPart,ignoreCase||forceIgnoreCase?"i":void 0);return regexp}function showConfirm(cm,text){cm.openNotification?cm.openNotification("<span style=\"color: red\">"+text+"</span>",{bottom:!0,duration:5e3}):alert(text)}function makePrompt(prefix,desc){var raw="<span style=\"font-family: monospace; white-space: pre\">"+(prefix||"")+"<input type=\"text\"></span>";return desc&&(raw+=" <span style=\"color: #888\">"+desc+"</span>"),raw}function showPrompt(cm,options){var shortText=(options.prefix||"")+" "+(options.desc||""),prompt=makePrompt(options.prefix,options.desc);dialog(cm,prompt,shortText,options.onClose,options)}function regexEqual(r1,r2){if(r1 instanceof RegExp&&r2 instanceof RegExp){for(var props=["global","multiline","ignoreCase","source"],i=0,prop;i<props.length;i++)if(prop=props[i],r1[prop]!==r2[prop])return!1;return!0}return!1}function updateSearchQuery(cm,rawQuery,ignoreCase,smartCase){if(rawQuery){var state=getSearchState(cm),query=parseQuery(rawQuery,!!ignoreCase,!!smartCase);if(query)return(highlightSearchMatches(cm,query),regexEqual(query,state.getQuery()))?query:(state.setQuery(query),query)}}function searchOverlay(query){if("^"==query.source.charAt(0));return{token:function(stream){if(!stream.sol())return void stream.skipToEnd();var match=stream.match(query,!1);if(match)return 0==match[0].length?(stream.next(),"searching"):!stream.sol()&&(stream.backUp(1),!query.exec(stream.next()+match[0]))?(stream.next(),null):(stream.match(query),"searching");for(;!stream.eol()&&(stream.next(),!stream.match(query,!1)););},query:query}}function highlightSearchMatches(cm,query){var searchState=getSearchState(cm),overlay=searchState.getOverlay();overlay&&query==overlay.query||(overlay&&cm.removeOverlay(overlay),overlay=searchOverlay(query),cm.addOverlay(overlay),cm.showMatchesOnScrollbar&&(searchState.getScrollbarAnnotate()&&searchState.getScrollbarAnnotate().clear(),searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query))),searchState.setOverlay(overlay))}function _findNext(cm,prev,query,repeat){return void 0===repeat&&(repeat=1),cm.operation(function(){for(var pos=cm.getCursor(),cursor=cm.getSearchCursor(query,pos),i=0,found;i<repeat;i++)if(found=cursor.find(prev),0==i&&found&&cursorEqual(cursor.from(),pos)&&(found=cursor.find(prev)),!found&&(cursor=cm.getSearchCursor(query,prev?Pos(cm.lastLine()):Pos(cm.firstLine(),0)),!cursor.find(prev)))return;return cursor.from()})}function clearSearchHighlight(cm){var state=getSearchState(cm);cm.removeOverlay(getSearchState(cm).getOverlay()),state.setOverlay(null),state.getScrollbarAnnotate()&&(state.getScrollbarAnnotate().clear(),state.setScrollbarAnnotate(null))}function isInRange(pos,start,end){return"number"!=typeof pos&&(pos=pos.line),start instanceof Array?inArray(pos,start):end?pos>=start&&pos<=end:pos==start}function getUserVisibleLines(cm){var scrollInfo=cm.getScrollInfo(),from=cm.coordsChar({left:0,top:6+scrollInfo.top},"local"),bottomY=scrollInfo.clientHeight-10+scrollInfo.top,to=cm.coordsChar({left:0,top:bottomY},"local");return{top:from.line,bottom:to.line}}function getMarkPos(cm,vim,markName){if("'"==markName){var history=cm.doc.history.done,event=history[history.length-2];return event&&event.ranges&&event.ranges[0].head}if("."==markName){if(0==cm.doc.history.lastModTime)return;var changeHistory=cm.doc.history.done.filter(function(el){if(void 0!==el.changes)return el});changeHistory.reverse();var lastEditPos=changeHistory[0].changes[0].to;return lastEditPos}var mark=vim.marks[markName];return mark&&mark.find()}function doReplace(cm,confirm,global,lineStart,lineEnd,searchCursor,query,replaceWith,callback){function replaceAll(){cm.operation(function(){for(;!done;)replace(),next();stop()})}function replace(){var text=cm.getRange(searchCursor.from(),searchCursor.to()),newText=text.replace(query,replaceWith);searchCursor.replace(newText)}function next(){for(;searchCursor.findNext()&&isInRange(searchCursor.from(),lineStart,lineEnd);)if(global||!lastPos||searchCursor.from().line!=lastPos.line)return cm.scrollIntoView(searchCursor.from(),30),cm.setSelection(searchCursor.from(),searchCursor.to()),lastPos=searchCursor.from(),void(done=!1);done=!0}function stop(close){if(close&&close(),cm.focus(),lastPos){cm.setCursor(lastPos);var vim=cm.state.vim;vim.exMode=!1,vim.lastHPos=vim.lastHSPos=lastPos.ch}callback&&callback()}cm.state.vim.exMode=!0;var done=!1,lastPos=searchCursor.from();return next(),done?void showConfirm(cm,"No matches for "+query.source):confirm?void showPrompt(cm,{prefix:"replace with <strong>"+replaceWith+"</strong> (y/n/a/q/l)",onKeyDown:function(e,_value,close){CodeMirror.e_stop(e);var keyName=CodeMirror.keyName(e);switch(keyName){case"Y":replace(),next();break;case"N":next();break;case"A":var savedCallback=callback;callback=void 0,cm.operation(replaceAll),callback=savedCallback;break;case"L":replace();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":stop(close);}return done&&stop(close),!0}}):(replaceAll(),void(callback&&callback()))}function exitInsertMode(cm){var vim=cm.state.vim,macroModeState=vimGlobalState.macroModeState,insertModeChangeRegister=vimGlobalState.registerController.getRegister("."),isPlaying=macroModeState.isPlaying,lastChange=macroModeState.lastInsertModeChanges,text=[];if(!isPlaying){for(var selLength=lastChange.inVisualBlock&&vim.lastSelection?vim.lastSelection.visualBlock.height:1,changes=lastChange.changes,text=[],i=0;i<changes.length;)text.push(changes[i]),changes[i]instanceof InsertModeKey?i++:i+=selLength;lastChange.changes=text,cm.off("change",onChange),CodeMirror.off(cm.getInputField(),"keydown",onKeyEventTargetKeyDown)}!isPlaying&&1<vim.insertModeRepeat&&(_repeatLastEdit(cm,vim,vim.insertModeRepeat-1,!0),vim.lastEditInputState.repeatOverride=vim.insertModeRepeat),delete vim.insertModeRepeat,vim.insertMode=!1,cm.setCursor(cm.getCursor().line,cm.getCursor().ch-1),cm.setOption("keyMap","vim"),cm.setOption("disableInput",!0),cm.toggleOverwrite(!1),insertModeChangeRegister.setText(lastChange.changes.join("")),CodeMirror.signal(cm,"vim-mode-change",{mode:"normal"}),macroModeState.isRecording&&logInsertModeChange(macroModeState)}function _mapCommand(command){defaultKeymap.unshift(command)}function executeMacroRegister(cm,vim,macroModeState,registerName){var register=vimGlobalState.registerController.getRegister(registerName);if(":"==registerName)return register.keyBuffer[0]&&exCommandDispatcher.processCommand(cm,register.keyBuffer[0]),void(macroModeState.isPlaying=!1);var keyBuffer=register.keyBuffer,imc=0;macroModeState.isPlaying=!0,macroModeState.replaySearchQueries=register.searchQueries.slice(0);for(var i=0;i<keyBuffer.length;i++)for(var text=keyBuffer[i],match,key;text;)if(match=/<\w+-.+?>|<\w+>|./.exec(text),key=match[0],text=text.substring(match.index+key.length),CodeMirror.Vim.handleKey(cm,key,"macro"),vim.insertMode){var changes=register.insertModeChanges[imc++].changes;vimGlobalState.macroModeState.lastInsertModeChanges.changes=changes,repeatInsertModeChanges(cm,changes,1),exitInsertMode(cm)}macroModeState.isPlaying=!1}function logKey(macroModeState,key){if(!macroModeState.isPlaying){var registerName=macroModeState.latestRegister,register=vimGlobalState.registerController.getRegister(registerName);register&®ister.pushText(key)}}function logInsertModeChange(macroModeState){if(!macroModeState.isPlaying){var registerName=macroModeState.latestRegister,register=vimGlobalState.registerController.getRegister(registerName);register&®ister.pushInsertModeChanges&®ister.pushInsertModeChanges(macroModeState.lastInsertModeChanges)}}function logSearchQuery(macroModeState,query){if(!macroModeState.isPlaying){var registerName=macroModeState.latestRegister,register=vimGlobalState.registerController.getRegister(registerName);register&®ister.pushSearchQuery&®ister.pushSearchQuery(query)}}function onChange(cm,changeObj){var macroModeState=vimGlobalState.macroModeState,lastChange=macroModeState.lastInsertModeChanges;if(!macroModeState.isPlaying)for(;changeObj;){if(lastChange.expectCursorActivityForChange=!0,"+input"==changeObj.origin||"paste"==changeObj.origin||void 0===changeObj.origin){var text=changeObj.text.join("\n");lastChange.maybeReset&&(lastChange.changes=[],lastChange.maybeReset=!1),cm.state.overwrite&&!/\n/.test(text)?lastChange.changes.push([text]):lastChange.changes.push(text)}changeObj=changeObj.next}}function onCursorActivity(cm){var vim=cm.state.vim;if(vim.insertMode){var macroModeState=vimGlobalState.macroModeState;if(macroModeState.isPlaying)return;var lastChange=macroModeState.lastInsertModeChanges;lastChange.expectCursorActivityForChange?lastChange.expectCursorActivityForChange=!1:lastChange.maybeReset=!0}else cm.curOp.isVimOp||handleExternalSelection(cm,vim);vim.visualMode&&updateFakeCursor(cm)}function updateFakeCursor(cm){var vim=cm.state.vim,from=clipCursorToContent(cm,copyCursor(vim.sel.head)),to=offsetCursor(from,0,1);vim.fakeCursor&&vim.fakeCursor.clear(),vim.fakeCursor=cm.markText(from,to,{className:"cm-animate-fat-cursor"})}function handleExternalSelection(cm,vim){var anchor=cm.getCursor("anchor"),head=cm.getCursor("head");if(vim.visualMode&&!cm.somethingSelected()?exitVisualMode(cm,!1):!vim.visualMode&&!vim.insertMode&&cm.somethingSelected()&&(vim.visualMode=!0,vim.visualLine=!1,CodeMirror.signal(cm,"vim-mode-change",{mode:"visual"})),vim.visualMode){var headOffset=cursorIsBefore(head,anchor)?0:-1,anchorOffset=cursorIsBefore(head,anchor)?-1:0;head=offsetCursor(head,0,headOffset),anchor=offsetCursor(anchor,0,anchorOffset),vim.sel={anchor:anchor,head:head},updateMark(cm,vim,"<",cursorMin(head,anchor)),updateMark(cm,vim,">",cursorMax(head,anchor))}else vim.insertMode||(vim.lastHPos=cm.getCursor().ch)}function InsertModeKey(keyName){this.keyName=keyName}function onKeyEventTargetKeyDown(e){var macroModeState=vimGlobalState.macroModeState,lastChange=macroModeState.lastInsertModeChanges,keyName=CodeMirror.keyName(e);keyName&&(-1==keyName.indexOf("Delete")&&-1==keyName.indexOf("Backspace")||CodeMirror.lookupKey(keyName,"vim-insert",function(){return lastChange.maybeReset&&(lastChange.changes=[],lastChange.maybeReset=!1),lastChange.changes.push(new InsertModeKey(keyName)),!0}))}function _repeatLastEdit(cm,vim,repeat,repeatForInsert){function repeatCommand(){isAction?commandDispatcher.processAction(cm,vim,vim.lastEditActionCommand):commandDispatcher.evalInput(cm,vim)}function repeatInsert(repeat){if(0<macroModeState.lastInsertModeChanges.changes.length){repeat=vim.lastEditActionCommand?repeat:1;var changeObject=macroModeState.lastInsertModeChanges;repeatInsertModeChanges(cm,changeObject.changes,repeat)}}var macroModeState=vimGlobalState.macroModeState;macroModeState.isPlaying=!0;var isAction=!!vim.lastEditActionCommand,cachedInputState=vim.inputState;if(vim.inputState=vim.lastEditInputState,isAction&&vim.lastEditActionCommand.interlaceInsertRepeat)for(var i=0;i<repeat;i++)repeatCommand(),repeatInsert(1);else repeatForInsert||repeatCommand(),repeatInsert(repeat);vim.inputState=cachedInputState,vim.insertMode&&!repeatForInsert&&exitInsertMode(cm),macroModeState.isPlaying=!1}function repeatInsertModeChanges(cm,changes,repeat){function keyHandler(binding){return"string"==typeof binding?CodeMirror.commands[binding](cm):binding(cm),!0}var head=cm.getCursor("head"),inVisualBlock=vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock;if(inVisualBlock){var vim=cm.state.vim,lastSel=vim.lastSelection,offset=getOffset(lastSel.anchor,lastSel.head);selectForInsert(cm,head,offset.line+1),repeat=cm.listSelections().length,cm.setCursor(head)}for(var i=0;i<repeat;i++){inVisualBlock&&cm.setCursor(offsetCursor(head,i,0));for(var j=0,change;j<changes.length;j++)if(change=changes[j],change instanceof InsertModeKey)CodeMirror.lookupKey(change.keyName,"vim-insert",keyHandler);else if("string"==typeof change){var cur=cm.getCursor();cm.replaceRange(change,cur,cur)}else{var start=cm.getCursor(),end=offsetCursor(start,0,change[0].length);cm.replaceRange(change[0],start,end)}}inVisualBlock&&cm.setCursor(offsetCursor(head,0,1))}CodeMirror.defineOption("vimMode",!1,function(cm,val,prev){val&&"vim"!=cm.getOption("keyMap")?cm.setOption("keyMap","vim"):!val&&prev!=CodeMirror.Init&&/^vim/.test(cm.getOption("keyMap"))&&cm.setOption("keyMap","default")});var modifiers={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A"},specialKeys={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"},numberRegex=/[\d]/,wordCharTest=[CodeMirror.isWordChar,function(ch){return ch&&!CodeMirror.isWordChar(ch)&&!/\s/.test(ch)}],bigWordCharTest=[function(ch){return /\S/.test(ch)}],upperCaseAlphabet=makeKeyRange(65,26),lowerCaseAlphabet=makeKeyRange(97,26),numbers=makeKeyRange(48,10),validMarks=[].concat(upperCaseAlphabet,lowerCaseAlphabet,numbers,["<",">"]),validRegisters=[].concat(upperCaseAlphabet,lowerCaseAlphabet,numbers,["-","\"",".",":","/"]),options={};defineOption("filetype",void 0,"string",["ft"],function(name,cm){if(void 0!==cm){if(void 0===name){var mode=cm.getOption("mode");return"null"==mode?"":mode}var mode=""==name?"null":name;cm.setOption("mode",mode)}});var createCircularJumpList=function(){var size=100,pointer=-1,head=0,tail=0,buffer=Array(size);return{cachedCursor:void 0,add:function(cm,oldCur,newCur){function useNextSlot(cursor){var next=++pointer%size,trashMark=buffer[next];trashMark&&trashMark.clear(),buffer[next]=cm.setBookmark(cursor)}var current=pointer%size,curMark=buffer[current];if(curMark){var markPos=curMark.find();markPos&&!cursorEqual(markPos,oldCur)&&useNextSlot(oldCur)}else useNextSlot(oldCur);useNextSlot(newCur),head=pointer,tail=pointer-size+1,0>tail&&(tail=0)},move:function(cm,offset){pointer+=offset,pointer>head?pointer=head:pointer<tail&&(pointer=tail);var mark=buffer[(size+pointer)%size];if(mark&&!mark.find()){var inc=0<offset?1:-1,oldCur=cm.getCursor(),newCur;do if(pointer+=inc,mark=buffer[(size+pointer)%size],mark&&(newCur=mark.find())&&!cursorEqual(oldCur,newCur))break;while(pointer<head&&pointer>tail)}return mark}}},createInsertModeChanges=function(c){return c?{changes:c.changes,expectCursorActivityForChange:c.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};MacroModeState.prototype={exitMacroRecordMode:function(){var macroModeState=vimGlobalState.macroModeState;macroModeState.onRecordingDone&¯oModeState.onRecordingDone(),macroModeState.onRecordingDone=void 0,macroModeState.isRecording=!1},enterMacroRecordMode:function(cm,registerName){var register=vimGlobalState.registerController.getRegister(registerName);register&&(register.clear(),this.latestRegister=registerName,cm.openDialog&&(this.onRecordingDone=cm.openDialog("(recording)["+registerName+"]",null,{bottom:!0})),this.isRecording=!0)}};var vimGlobalState,lastInsertModeKeyTimer;InputState.prototype.pushRepeatDigit=function(n){this.operator?this.motionRepeat=this.motionRepeat.concat(n):this.prefixRepeat=this.prefixRepeat.concat(n)},InputState.prototype.getRepeat=function(){var repeat=0;return(0<this.prefixRepeat.length||0<this.motionRepeat.length)&&(repeat=1,0<this.prefixRepeat.length&&(repeat*=parseInt(this.prefixRepeat.join(""),10)),0<this.motionRepeat.length&&(repeat*=parseInt(this.motionRepeat.join(""),10))),repeat},Register.prototype={setText:function(text,linewise,blockwise){this.keyBuffer=[text||""],this.linewise=!!linewise,this.blockwise=!!blockwise},pushText:function(text,linewise){linewise&&(!this.linewise&&this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(text)},pushInsertModeChanges:function(changes){this.insertModeChanges.push(createInsertModeChanges(changes))},pushSearchQuery:function(query){this.searchQueries.push(query)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},RegisterController.prototype={pushText:function(registerName,operator,text,linewise,blockwise){linewise&&"\n"!==text.charAt(text.length-1)&&(text+="\n");var register=this.isValidRegister(registerName)?this.getRegister(registerName):null;if(!register)return"yank"===operator?this.registers[0]=new Register(text,linewise,blockwise):"delete"===operator||"change"===operator?-1==text.indexOf("\n")?this.registers["-"]=new Register(text,linewise):(this.shiftNumericRegisters_(),this.registers[1]=new Register(text,linewise)):void 0,void this.unnamedRegister.setText(text,linewise,blockwise);var append=isUpperCase(registerName);append?register.pushText(text,linewise):register.setText(text,linewise,blockwise),this.unnamedRegister.setText(register.toString(),linewise)},getRegister:function(name){return this.isValidRegister(name)?(name=name.toLowerCase(),this.registers[name]||(this.registers[name]=new Register),this.registers[name]):this.unnamedRegister},isValidRegister:function(name){return name&&inArray(name,validRegisters)},shiftNumericRegisters_:function(){for(var i=9;2<=i;i--)this.registers[i]=this.getRegister(""+(i-1))}},HistoryController.prototype={nextMatch:function(input,up){var historyBuffer=this.historyBuffer,dir=up?-1:1;null===this.initialPrefix&&(this.initialPrefix=input);for(var i=this.iterator+dir,element;up?0<=i:i<historyBuffer.length;i+=dir){element=historyBuffer[i];for(var j=0;j<=element.length;j++)if(this.initialPrefix==element.substring(0,j))return this.iterator=i,element}return i>=historyBuffer.length?(this.iterator=historyBuffer.length,this.initialPrefix):0>i?input:void 0},pushInput:function(input){var index=this.historyBuffer.indexOf(input);-1<index&&this.historyBuffer.splice(index,1),input.length&&this.historyBuffer.push(input)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var commandDispatcher={matchCommand:function(keys,keyMap,inputState,context){var matches=commandMatches(keys,keyMap,context,inputState);if(!matches.full&&!matches.partial)return{type:"none"};if(!matches.full&&matches.partial)return{type:"partial"};for(var i=0,bestMatch,match;i<matches.full.length;i++)match=matches.full[i],bestMatch||(bestMatch=match);if("<character>"==bestMatch.keys.slice(-11)){var character=lastChar(keys);if(!character)return{type:"none"};inputState.selectedCharacter=character}return{type:"full",command:bestMatch}},processCommand:function(cm,vim,command){switch(vim.inputState.repeatOverride=command.repeatOverride,command.type){case"motion":this.processMotion(cm,vim,command);break;case"operator":this.processOperator(cm,vim,command);break;case"operatorMotion":this.processOperatorMotion(cm,vim,command);break;case"action":this.processAction(cm,vim,command);break;case"search":this.processSearch(cm,vim,command);break;case"ex":case"keyToEx":this.processEx(cm,vim,command);break;default:}},processMotion:function(cm,vim,command){vim.inputState.motion=command.motion,vim.inputState.motionArgs=copyArgs(command.motionArgs),this.evalInput(cm,vim)},processOperator:function(cm,vim,command){var inputState=vim.inputState;if(inputState.operator){if(inputState.operator==command.operator)return inputState.motion="expandToLine",inputState.motionArgs={linewise:!0},void this.evalInput(cm,vim);clearInputState(cm)}inputState.operator=command.operator,inputState.operatorArgs=copyArgs(command.operatorArgs),vim.visualMode&&this.evalInput(cm,vim)},processOperatorMotion:function(cm,vim,command){var visualMode=vim.visualMode,operatorMotionArgs=copyArgs(command.operatorMotionArgs);operatorMotionArgs&&visualMode&&operatorMotionArgs.visualLine&&(vim.visualLine=!0),this.processOperator(cm,vim,command),visualMode||this.processMotion(cm,vim,command)},processAction:function(cm,vim,command){var inputState=vim.inputState,repeat=inputState.getRepeat(),actionArgs=copyArgs(command.actionArgs)||{};inputState.selectedCharacter&&(actionArgs.selectedCharacter=inputState.selectedCharacter),command.operator&&this.processOperator(cm,vim,command),command.motion&&this.processMotion(cm,vim,command),(command.motion||command.operator)&&this.evalInput(cm,vim),actionArgs.repeat=repeat||1,actionArgs.repeatIsExplicit=!!repeat,actionArgs.registerName=inputState.registerName,clearInputState(cm),vim.lastMotion=null,command.isEdit&&this.recordLastEdit(vim,inputState,command),actions[command.action](cm,actionArgs,vim)},processSearch:function(cm,vim,command){function handleQuery(query,ignoreCase,smartCase){vimGlobalState.searchHistoryController.pushInput(query),vimGlobalState.searchHistoryController.reset();try{updateSearchQuery(cm,query,ignoreCase,smartCase)}catch(e){return showConfirm(cm,"Invalid regex: "+query),void clearInputState(cm)}commandDispatcher.processMotion(cm,vim,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:command.searchArgs.toJumplist}})}function onPromptClose(query){cm.scrollTo(originalScrollPos.left,originalScrollPos.top),handleQuery(query,!0,!0);var macroModeState=vimGlobalState.macroModeState;macroModeState.isRecording&&logSearchQuery(macroModeState,query)}function onPromptKeyUp(e,query,close){var keyName=CodeMirror.keyName(e),up,offset;"Up"==keyName||"Down"==keyName?(up="Up"==keyName,offset=e.target?e.target.selectionEnd:0,query=vimGlobalState.searchHistoryController.nextMatch(query,up)||"",close(query),offset&&e.target&&(e.target.selectionEnd=e.target.selectionStart=_Mathmin8(offset,e.target.value.length))):"Left"!=keyName&&"Right"!=keyName&&"Ctrl"!=keyName&&"Alt"!=keyName&&"Shift"!=keyName&&vimGlobalState.searchHistoryController.reset();var parsedQuery;try{parsedQuery=updateSearchQuery(cm,query,!0,!0)}catch(e){}parsedQuery?cm.scrollIntoView(_findNext(cm,!forward,parsedQuery),30):(clearSearchHighlight(cm),cm.scrollTo(originalScrollPos.left,originalScrollPos.top))}function onPromptKeyDown(e,query,close){var keyName=CodeMirror.keyName(e);"Esc"==keyName||"Ctrl-C"==keyName||"Ctrl-["==keyName||"Backspace"==keyName&&""==query?(vimGlobalState.searchHistoryController.pushInput(query),vimGlobalState.searchHistoryController.reset(),updateSearchQuery(cm,originalQuery),clearSearchHighlight(cm),cm.scrollTo(originalScrollPos.left,originalScrollPos.top),CodeMirror.e_stop(e),clearInputState(cm),close(),cm.focus()):"Up"==keyName||"Down"==keyName?CodeMirror.e_stop(e):"Ctrl-U"==keyName&&(CodeMirror.e_stop(e),close(""))}if(cm.getSearchCursor){var forward=command.searchArgs.forward,wholeWordOnly=command.searchArgs.wholeWordOnly;getSearchState(cm).setReversed(!forward);var promptPrefix=forward?"/":"?",originalQuery=getSearchState(cm).getQuery(),originalScrollPos=cm.getScrollInfo();switch(command.searchArgs.querySrc){case"prompt":var macroModeState=vimGlobalState.macroModeState;if(macroModeState.isPlaying){var query=macroModeState.replaySearchQueries.shift();handleQuery(query,!0,!1)}else showPrompt(cm,{onClose:onPromptClose,prefix:promptPrefix,desc:searchPromptDesc,onKeyUp:onPromptKeyUp,onKeyDown:onPromptKeyDown});break;case"wordUnderCursor":var word=expandWordUnderCursor(cm,!1,!0,!1,!0),isKeyword=!0;if(word||(word=expandWordUnderCursor(cm,!1,!0,!1,!1),isKeyword=!1),!word)return;var query=cm.getLine(word.start.line).substring(word.start.ch,word.end.ch);query=isKeyword&&wholeWordOnly?"\\b"+query+"\\b":escapeRegex(query),vimGlobalState.jumpList.cachedCursor=cm.getCursor(),cm.setCursor(word.start),handleQuery(query,!0,!1);}}},processEx:function(cm,vim,command){function onPromptClose(input){vimGlobalState.exCommandHistoryController.pushInput(input),vimGlobalState.exCommandHistoryController.reset(),exCommandDispatcher.processCommand(cm,input)}function onPromptKeyDown(e,input,close){var keyName=CodeMirror.keyName(e),up,offset;("Esc"==keyName||"Ctrl-C"==keyName||"Ctrl-["==keyName||"Backspace"==keyName&&""==input)&&(vimGlobalState.exCommandHistoryController.pushInput(input),vimGlobalState.exCommandHistoryController.reset(),CodeMirror.e_stop(e),clearInputState(cm),close(),cm.focus()),"Up"==keyName||"Down"==keyName?(CodeMirror.e_stop(e),up="Up"==keyName,offset=e.target?e.target.selectionEnd:0,input=vimGlobalState.exCommandHistoryController.nextMatch(input,up)||"",close(input),offset&&e.target&&(e.target.selectionEnd=e.target.selectionStart=_Mathmin8(offset,e.target.value.length))):"Ctrl-U"==keyName?(CodeMirror.e_stop(e),close("")):"Left"!=keyName&&"Right"!=keyName&&"Ctrl"!=keyName&&"Alt"!=keyName&&"Shift"!=keyName&&vimGlobalState.exCommandHistoryController.reset()}"keyToEx"==command.type?exCommandDispatcher.processCommand(cm,command.exArgs.input):vim.visualMode?showPrompt(cm,{onClose:onPromptClose,prefix:":",value:"'<,'>",onKeyDown:onPromptKeyDown,selectValueOnOpen:!1}):showPrompt(cm,{onClose:onPromptClose,prefix:":",onKeyDown:onPromptKeyDown})},evalInput:function(cm,vim){var inputState=vim.inputState,motion=inputState.motion,motionArgs=inputState.motionArgs||{},operator=inputState.operator,operatorArgs=inputState.operatorArgs||{},registerName=inputState.registerName,sel=vim.sel,origHead=copyCursor(vim.visualMode?clipCursorToContent(cm,sel.head):cm.getCursor("head")),origAnchor=copyCursor(vim.visualMode?clipCursorToContent(cm,sel.anchor):cm.getCursor("anchor")),oldHead=copyCursor(origHead),oldAnchor=copyCursor(origAnchor),newHead,newAnchor,repeat;if(operator&&this.recordLastEdit(vim,inputState),repeat=void 0===inputState.repeatOverride?inputState.getRepeat():inputState.repeatOverride,0<repeat&&motionArgs.explicitRepeat?motionArgs.repeatIsExplicit=!0:(motionArgs.noRepeat||!motionArgs.explicitRepeat&&0===repeat)&&(repeat=1,motionArgs.repeatIsExplicit=!1),inputState.selectedCharacter&&(motionArgs.selectedCharacter=operatorArgs.selectedCharacter=inputState.selectedCharacter),motionArgs.repeat=repeat,clearInputState(cm),motion){var motionResult=motions[motion](cm,origHead,motionArgs,vim);if(vim.lastMotion=motions[motion],!motionResult)return;if(motionArgs.toJumplist){var jumpList=vimGlobalState.jumpList,cachedCursor=jumpList.cachedCursor;cachedCursor?(recordJumpPosition(cm,cachedCursor,motionResult),delete jumpList.cachedCursor):recordJumpPosition(cm,origHead,motionResult)}motionResult instanceof Array?(newAnchor=motionResult[0],newHead=motionResult[1]):newHead=motionResult,newHead||(newHead=copyCursor(origHead)),vim.visualMode?(!(vim.visualBlock&&newHead.ch===Infinity)&&(newHead=clipCursorToContent(cm,newHead,vim.visualBlock)),newAnchor&&(newAnchor=clipCursorToContent(cm,newAnchor,!0)),newAnchor=newAnchor||oldAnchor,sel.anchor=newAnchor,sel.head=newHead,updateCmSelection(cm),updateMark(cm,vim,"<",cursorIsBefore(newAnchor,newHead)?newAnchor:newHead),updateMark(cm,vim,">",cursorIsBefore(newAnchor,newHead)?newHead:newAnchor)):!operator&&(newHead=clipCursorToContent(cm,newHead),cm.setCursor(newHead.line,newHead.ch))}if(operator){if(operatorArgs.lastSel){newAnchor=oldAnchor;var lastSel=operatorArgs.lastSel,lineOffset=_Mathabs2(lastSel.head.line-lastSel.anchor.line),chOffset=_Mathabs2(lastSel.head.ch-lastSel.anchor.ch);newHead=lastSel.visualLine?Pos(oldAnchor.line+lineOffset,oldAnchor.ch):lastSel.visualBlock?Pos(oldAnchor.line+lineOffset,oldAnchor.ch+chOffset):lastSel.head.line==lastSel.anchor.line?Pos(oldAnchor.line,oldAnchor.ch+chOffset):Pos(oldAnchor.line+lineOffset,oldAnchor.ch),vim.visualMode=!0,vim.visualLine=lastSel.visualLine,vim.visualBlock=lastSel.visualBlock,sel=vim.sel={anchor:newAnchor,head:newHead},updateCmSelection(cm)}else vim.visualMode&&(operatorArgs.lastSel={anchor:copyCursor(sel.anchor),head:copyCursor(sel.head),visualBlock:vim.visualBlock,visualLine:vim.visualLine});var curStart,curEnd,linewise,mode,cmSel;if(!vim.visualMode){if(curStart=copyCursor(newAnchor||oldAnchor),curEnd=copyCursor(newHead||oldHead),cursorIsBefore(curEnd,curStart)){var tmp=curStart;curStart=curEnd,curEnd=tmp}linewise=motionArgs.linewise||operatorArgs.linewise,linewise?expandSelectionToLine(cm,curStart,curEnd):motionArgs.forward&&clipToLine(cm,curStart,curEnd),mode="char";var exclusive=!motionArgs.inclusive||linewise;cmSel=makeCmSelection(cm,{anchor:curStart,head:curEnd},mode,exclusive)}else if(curStart=cursorMin(sel.head,sel.anchor),curEnd=cursorMax(sel.head,sel.anchor),linewise=vim.visualLine||operatorArgs.linewise,mode=vim.visualBlock?"block":linewise?"line":"char",cmSel=makeCmSelection(cm,{anchor:curStart,head:curEnd},mode),linewise){var ranges=cmSel.ranges;if("block"==mode)for(var i=0;i<ranges.length;i++)ranges[i].head.ch=lineLength(cm,ranges[i].head.line);else"line"==mode&&(ranges[0].head=Pos(ranges[0].head.line+1,0))}cm.setSelections(cmSel.ranges,cmSel.primary),vim.lastMotion=null,operatorArgs.repeat=repeat,operatorArgs.registerName=registerName,operatorArgs.linewise=linewise;var operatorMoveTo=operators[operator](cm,operatorArgs,cmSel.ranges,oldAnchor,newHead);vim.visualMode&&exitVisualMode(cm,null!=operatorMoveTo),operatorMoveTo&&cm.setCursor(operatorMoveTo)}},recordLastEdit:function(vim,inputState,actionCommand){var macroModeState=vimGlobalState.macroModeState;macroModeState.isPlaying||(vim.lastEditInputState=inputState,vim.lastEditActionCommand=actionCommand,macroModeState.lastInsertModeChanges.changes=[],macroModeState.lastInsertModeChanges.expectCursorActivityForChange=!1)}},motions={moveToTopLine:function(cm,_head,motionArgs){var line=getUserVisibleLines(cm).top+motionArgs.repeat-1;return Pos(line,findFirstNonWhiteSpaceCharacter(cm.getLine(line)))},moveToMiddleLine:function(cm){var range=getUserVisibleLines(cm),line=_Mathfloor6(0.5*(range.top+range.bottom));return Pos(line,findFirstNonWhiteSpaceCharacter(cm.getLine(line)))},moveToBottomLine:function(cm,_head,motionArgs){var line=getUserVisibleLines(cm).bottom-motionArgs.repeat+1;return Pos(line,findFirstNonWhiteSpaceCharacter(cm.getLine(line)))},expandToLine:function(_cm,head,motionArgs){return Pos(head.line+motionArgs.repeat-1,Infinity)},findNext:function(cm,_head,motionArgs){var state=getSearchState(cm),query=state.getQuery();if(query){var prev=!motionArgs.forward;return prev=state.isReversed()?!prev:prev,highlightSearchMatches(cm,query),_findNext(cm,prev,query,motionArgs.repeat)}},goToMark:function(cm,_head,motionArgs,vim){var pos=getMarkPos(cm,vim,motionArgs.selectedCharacter);return pos?motionArgs.linewise?{line:pos.line,ch:findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line))}:pos:null},moveToOtherHighlightedEnd:function(cm,_head,motionArgs,vim){if(vim.visualBlock&&motionArgs.sameLine){var sel=vim.sel;return[clipCursorToContent(cm,Pos(sel.anchor.line,sel.head.ch)),clipCursorToContent(cm,Pos(sel.head.line,sel.anchor.ch))]}return[vim.sel.head,vim.sel.anchor]},jumpToMark:function(cm,head,motionArgs,vim){for(var best=head,i=0,cursor;i<motionArgs.repeat;i++)for(var key in cursor=best,vim.marks)if(isLowerCase(key)){var mark=vim.marks[key].find(),isWrongDirection=motionArgs.forward?cursorIsBefore(mark,cursor):cursorIsBefore(cursor,mark);if(!isWrongDirection&&!(motionArgs.linewise&&mark.line==cursor.line)){var equal=cursorEqual(cursor,best),between=motionArgs.forward?cursorIsBetween(cursor,mark,best):cursorIsBetween(best,mark,cursor);(equal||between)&&(best=mark)}}return motionArgs.linewise&&(best=Pos(best.line,findFirstNonWhiteSpaceCharacter(cm.getLine(best.line)))),best},moveByCharacters:function(_cm,head,motionArgs){var cur=head,repeat=motionArgs.repeat,ch=motionArgs.forward?cur.ch+repeat:cur.ch-repeat;return Pos(cur.line,ch)},moveByLines:function(cm,head,motionArgs,vim){var cur=head,endCh=cur.ch;switch(vim.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:endCh=vim.lastHPos;break;default:vim.lastHPos=endCh;}var repeat=motionArgs.repeat+(motionArgs.repeatOffset||0),line=motionArgs.forward?cur.line+repeat:cur.line-repeat,first=cm.firstLine(),last=cm.lastLine();return line<first&&cur.line==first?this.moveToStartOfLine(cm,head,motionArgs,vim):line>last&&cur.line==last?this.moveToEol(cm,head,motionArgs,vim):(motionArgs.toFirstChar&&(endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line)),vim.lastHPos=endCh),vim.lastHSPos=cm.charCoords(Pos(line,endCh),"div").left,Pos(line,endCh))},moveByDisplayLines:function(cm,head,motionArgs,vim){var cur=head;switch(vim.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:vim.lastHSPos=cm.charCoords(cur,"div").left;}var repeat=motionArgs.repeat,res=cm.findPosV(cur,motionArgs.forward?repeat:-repeat,"line",vim.lastHSPos);if(res.hitSide)if(motionArgs.forward)var lastCharCoords=cm.charCoords(res,"div"),goalCoords={top:lastCharCoords.top+8,left:vim.lastHSPos},res=cm.coordsChar(goalCoords,"div");else{var resCoords=cm.charCoords(Pos(cm.firstLine(),0),"div");resCoords.left=vim.lastHSPos,res=cm.coordsChar(resCoords,"div")}return vim.lastHPos=res.ch,res},moveByPage:function(cm,head,motionArgs){var repeat=motionArgs.repeat;return cm.findPosV(head,motionArgs.forward?repeat:-repeat,"page")},moveByParagraph:function(cm,head,motionArgs){var dir=motionArgs.forward?1:-1;return findParagraph(cm,head,motionArgs.repeat,dir)},moveBySentence:function(cm,head,motionArgs){var dir=motionArgs.forward?1:-1;return findSentence(cm,head,motionArgs.repeat,dir)},moveByScroll:function(cm,head,motionArgs,vim){var scrollbox=cm.getScrollInfo(),curEnd=null,repeat=motionArgs.repeat;repeat||(repeat=scrollbox.clientHeight/(2*cm.defaultTextHeight()));var orig=cm.charCoords(head,"local");motionArgs.repeat=repeat;var curEnd=motions.moveByDisplayLines(cm,head,motionArgs,vim);if(!curEnd)return null;var dest=cm.charCoords(curEnd,"local");return cm.scrollTo(null,scrollbox.top+dest.top-orig.top),curEnd},moveByWords:function(cm,head,motionArgs){return moveToWord(cm,head,motionArgs.repeat,!!motionArgs.forward,!!motionArgs.wordEnd,!!motionArgs.bigWord)},moveTillCharacter:function(cm,_head,motionArgs){var repeat=motionArgs.repeat,curEnd=_moveToCharacter(cm,repeat,motionArgs.forward,motionArgs.selectedCharacter),increment=motionArgs.forward?-1:1;return(recordLastCharacterSearch(increment,motionArgs),!curEnd)?null:(curEnd.ch+=increment,curEnd)},moveToCharacter:function(cm,head,motionArgs){var repeat=motionArgs.repeat;return recordLastCharacterSearch(0,motionArgs),_moveToCharacter(cm,repeat,motionArgs.forward,motionArgs.selectedCharacter)||head},moveToSymbol:function(cm,head,motionArgs){var repeat=motionArgs.repeat;return findSymbol(cm,repeat,motionArgs.forward,motionArgs.selectedCharacter)||head},moveToColumn:function(cm,head,motionArgs,vim){var repeat=motionArgs.repeat;return vim.lastHPos=repeat-1,vim.lastHSPos=cm.charCoords(head,"div").left,_moveToColumn(cm,repeat)},moveToEol:function(cm,head,motionArgs,vim){vim.lastHPos=Infinity;var retval=Pos(head.line+motionArgs.repeat-1,Infinity),end=cm.clipPos(retval);return end.ch--,vim.lastHSPos=cm.charCoords(end,"div").left,retval},moveToFirstNonWhiteSpaceCharacter:function(cm,head){var cursor=head;return Pos(cursor.line,findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line)))},moveToMatchedSymbol:function(cm,head){for(var cursor=head,line=cursor.line,ch=cursor.ch,lineText=cm.getLine(line),symbol;ch<lineText.length;ch++)if(symbol=lineText.charAt(ch),symbol&&isMatchableSymbol(symbol)){var style=cm.getTokenTypeAt(Pos(line,ch+1));if("string"!==style&&"comment"!==style)break}if(ch<lineText.length){var matched=cm.findMatchingBracket(Pos(line,ch));return matched.to}return cursor},moveToStartOfLine:function(_cm,head){return Pos(head.line,0)},moveToLineOrEdgeOfDocument:function(cm,_head,motionArgs){var lineNum=motionArgs.forward?cm.lastLine():cm.firstLine();return motionArgs.repeatIsExplicit&&(lineNum=motionArgs.repeat-cm.getOption("firstLineNumber")),Pos(lineNum,findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum)))},textObjectManipulation:function(cm,head,motionArgs,vim){var character=motionArgs.selectedCharacter;"b"==character?character="(":"B"==character&&(character="{");var inclusive=!motionArgs.textObjectInner,tmp;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"["}[character])tmp=selectCompanionObject(cm,head,character,inclusive);else if({"'":!0,'"':!0}[character])tmp=findBeginningAndEnd(cm,head,character,inclusive);else if("W"===character)tmp=expandWordUnderCursor(cm,inclusive,!0,!0);else if("w"===character)tmp=expandWordUnderCursor(cm,inclusive,!0,!1);else{if("p"!==character)return null;if(tmp=findParagraph(cm,head,motionArgs.repeat,0,inclusive),motionArgs.linewise=!0,vim.visualMode)vim.visualLine||(vim.visualLine=!0);else{var operatorArgs=vim.inputState.operatorArgs;operatorArgs&&(operatorArgs.linewise=!0),tmp.end.line--}}return cm.state.vim.visualMode?expandSelection(cm,tmp.start,tmp.end):[tmp.start,tmp.end]},repeatLastCharacterSearch:function(cm,head,motionArgs){var lastSearch=vimGlobalState.lastCharacterSearch,repeat=motionArgs.repeat,forward=motionArgs.forward===lastSearch.forward,increment=(lastSearch.increment?1:0)*(forward?-1:1);cm.moveH(-increment,"char"),motionArgs.inclusive=!!forward;var curEnd=_moveToCharacter(cm,repeat,forward,lastSearch.selectedCharacter);return curEnd?(curEnd.ch+=increment,curEnd):(cm.moveH(increment,"char"),head)}},operators={change:function(cm,args,ranges){var _NumberMAX_VALUE=Number.MAX_VALUE,vim=cm.state.vim,finalHead,text;if(vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock=vim.visualBlock,!vim.visualMode){var anchor=ranges[0].anchor,head=ranges[0].head;text=cm.getRange(anchor,head);var lastState=vim.lastEditInputState||{};if("moveByWords"==lastState.motion&&!isWhiteSpaceString(text)){var match=/\s+$/.exec(text);match&&lastState.motionArgs&&lastState.motionArgs.forward&&(head=offsetCursor(head,0,-match[0].length),text=text.slice(0,-match[0].length))}var prevLineEnd=new Pos(anchor.line-1,_NumberMAX_VALUE),wasLastLine=cm.firstLine()==cm.lastLine();head.line>cm.lastLine()&&args.linewise&&!wasLastLine?cm.replaceRange("",prevLineEnd,head):cm.replaceRange("",anchor,head),args.linewise&&(!wasLastLine&&(cm.setCursor(prevLineEnd),CodeMirror.commands.newlineAndIndent(cm)),anchor.ch=_NumberMAX_VALUE),finalHead=anchor}else{text=cm.getSelection();var replacement=fillArray("",ranges.length);cm.replaceSelections(replacement),finalHead=cursorMin(ranges[0].head,ranges[0].anchor)}vimGlobalState.registerController.pushText(args.registerName,"change",text,args.linewise,1<ranges.length),actions.enterInsertMode(cm,{head:finalHead},cm.state.vim)},delete:function(cm,args,ranges){var vim=cm.state.vim,finalHead,text;if(!vim.visualBlock){var anchor=ranges[0].anchor,head=ranges[0].head;args.linewise&&head.line!=cm.firstLine()&&anchor.line==cm.lastLine()&&anchor.line==head.line-1&&(anchor.line==cm.firstLine()?anchor.ch=0:anchor=Pos(anchor.line-1,lineLength(cm,anchor.line-1))),text=cm.getRange(anchor,head),cm.replaceRange("",anchor,head),finalHead=anchor,args.linewise&&(finalHead=motions.moveToFirstNonWhiteSpaceCharacter(cm,anchor))}else{text=cm.getSelection();var replacement=fillArray("",ranges.length);cm.replaceSelections(replacement),finalHead=ranges[0].anchor}vimGlobalState.registerController.pushText(args.registerName,"delete",text,args.linewise,vim.visualBlock);var includeLineBreak=vim.insertMode;return clipCursorToContent(cm,finalHead,includeLineBreak)},indent:function(cm,args,ranges){var vim=cm.state.vim,startLine=ranges[0].anchor.line,endLine=vim.visualBlock?ranges[ranges.length-1].anchor.line:ranges[0].head.line,repeat=vim.visualMode?args.repeat:1;args.linewise&&endLine--;for(var i=startLine;i<=endLine;i++)for(var j=0;j<repeat;j++)cm.indentLine(i,args.indentRight);return motions.moveToFirstNonWhiteSpaceCharacter(cm,ranges[0].anchor)},changeCase:function(cm,args,ranges,oldAnchor,newHead){for(var selections=cm.getSelections(),swapped=[],toLower=args.toLower,j=0;j<selections.length;j++){var toSwap=selections[j],text="";if(!0===toLower)text=toSwap.toLowerCase();else if(!1===toLower)text=toSwap.toUpperCase();else for(var i=0,character;i<toSwap.length;i++)character=toSwap.charAt(i),text+=isUpperCase(character)?character.toLowerCase():character.toUpperCase();swapped.push(text)}return cm.replaceSelections(swapped),args.shouldMoveCursor?newHead:!cm.state.vim.visualMode&&args.linewise&&ranges[0].anchor.line+1==ranges[0].head.line?motions.moveToFirstNonWhiteSpaceCharacter(cm,oldAnchor):args.linewise?oldAnchor:cursorMin(ranges[0].anchor,ranges[0].head)},yank:function(cm,args,ranges,oldAnchor){var vim=cm.state.vim,text=cm.getSelection(),endPos=vim.visualMode?cursorMin(vim.sel.anchor,vim.sel.head,ranges[0].head,ranges[0].anchor):oldAnchor;return vimGlobalState.registerController.pushText(args.registerName,"yank",text,args.linewise,vim.visualBlock),endPos}},actions={jumpListWalk:function(cm,actionArgs,vim){if(!vim.visualMode){var repeat=actionArgs.repeat,forward=actionArgs.forward,jumpList=vimGlobalState.jumpList,mark=jumpList.move(cm,forward?repeat:-repeat),markPos=mark?mark.find():void 0;markPos=markPos?markPos:cm.getCursor(),cm.setCursor(markPos)}},scroll:function(cm,actionArgs,vim){if(!vim.visualMode){var repeat=actionArgs.repeat||1,lineHeight=cm.defaultTextHeight(),top=cm.getScrollInfo().top,delta=lineHeight*repeat,newPos=actionArgs.forward?top+delta:top-delta,cursor=copyCursor(cm.getCursor()),cursorCoords=cm.charCoords(cursor,"local");if(actionArgs.forward)newPos>cursorCoords.top?(cursor.line+=(newPos-cursorCoords.top)/lineHeight,cursor.line=Math.ceil(cursor.line),cm.setCursor(cursor),cursorCoords=cm.charCoords(cursor,"local"),cm.scrollTo(null,cursorCoords.top)):cm.scrollTo(null,newPos);else{var newBottom=newPos+cm.getScrollInfo().clientHeight;newBottom<cursorCoords.bottom?(cursor.line-=(cursorCoords.bottom-newBottom)/lineHeight,cursor.line=_Mathfloor6(cursor.line),cm.setCursor(cursor),cursorCoords=cm.charCoords(cursor,"local"),cm.scrollTo(null,cursorCoords.bottom-cm.getScrollInfo().clientHeight)):cm.scrollTo(null,newPos)}}},scrollToCursor:function(cm,actionArgs){var lineNum=cm.getCursor().line,charCoords=cm.charCoords(Pos(lineNum,0),"local"),height=cm.getScrollInfo().clientHeight,y=charCoords.top,lineHeight=charCoords.bottom-y;switch(actionArgs.position){case"center":y=y-height/2+lineHeight;break;case"bottom":y=y-height+lineHeight;}cm.scrollTo(null,y)},replayMacro:function(cm,actionArgs,vim){var registerName=actionArgs.selectedCharacter,repeat=actionArgs.repeat,macroModeState=vimGlobalState.macroModeState;for("@"==registerName&&(registerName=macroModeState.latestRegister);repeat--;)executeMacroRegister(cm,vim,macroModeState,registerName)},enterMacroRecordMode:function(cm,actionArgs){var macroModeState=vimGlobalState.macroModeState,registerName=actionArgs.selectedCharacter;vimGlobalState.registerController.isValidRegister(registerName)&¯oModeState.enterMacroRecordMode(cm,registerName)},toggleOverwrite:function(cm){cm.state.overwrite?(cm.toggleOverwrite(!1),cm.setOption("keyMap","vim-insert"),CodeMirror.signal(cm,"vim-mode-change",{mode:"insert"})):(cm.toggleOverwrite(!0),cm.setOption("keyMap","vim-replace"),CodeMirror.signal(cm,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(cm,actionArgs,vim){if(!cm.getOption("readOnly")){vim.insertMode=!0,vim.insertModeRepeat=actionArgs&&actionArgs.repeat||1;var insertAt=actionArgs?actionArgs.insertAt:null,sel=vim.sel,head=actionArgs.head||cm.getCursor("head"),height=cm.listSelections().length;if("eol"==insertAt)head=Pos(head.line,lineLength(cm,head.line));else if("charAfter"==insertAt)head=offsetCursor(head,0,1);else if("firstNonBlank"==insertAt)head=motions.moveToFirstNonWhiteSpaceCharacter(cm,head);else if("startOfSelectedArea"==insertAt)vim.visualBlock?(head=Pos(_Mathmin8(sel.head.line,sel.anchor.line),_Mathmin8(sel.head.ch,sel.anchor.ch)),height=_Mathabs2(sel.head.line-sel.anchor.line)+1):sel.head.line<sel.anchor.line?head=sel.head:head=Pos(sel.anchor.line,0);else if("endOfSelectedArea"==insertAt)vim.visualBlock?(head=Pos(_Mathmin8(sel.head.line,sel.anchor.line),_Mathmax7(sel.head.ch+1,sel.anchor.ch)),height=_Mathabs2(sel.head.line-sel.anchor.line)+1):sel.head.line>=sel.anchor.line?head=offsetCursor(sel.head,0,1):head=Pos(sel.anchor.line,0);else if("inplace"==insertAt&&vim.visualMode)return;cm.setOption("disableInput",!1),actionArgs&&actionArgs.replace?(cm.toggleOverwrite(!0),cm.setOption("keyMap","vim-replace"),CodeMirror.signal(cm,"vim-mode-change",{mode:"replace"})):(cm.toggleOverwrite(!1),cm.setOption("keyMap","vim-insert"),CodeMirror.signal(cm,"vim-mode-change",{mode:"insert"})),vimGlobalState.macroModeState.isPlaying||(cm.on("change",onChange),CodeMirror.on(cm.getInputField(),"keydown",onKeyEventTargetKeyDown)),vim.visualMode&&exitVisualMode(cm),selectForInsert(cm,head,height)}},toggleVisualMode:function(cm,actionArgs,vim){var repeat=actionArgs.repeat,anchor=cm.getCursor(),head;vim.visualMode?vim.visualLine^actionArgs.linewise||vim.visualBlock^actionArgs.blockwise?(vim.visualLine=!!actionArgs.linewise,vim.visualBlock=!!actionArgs.blockwise,CodeMirror.signal(cm,"vim-mode-change",{mode:"visual",subMode:vim.visualLine?"linewise":vim.visualBlock?"blockwise":""}),updateCmSelection(cm)):exitVisualMode(cm):(vim.visualMode=!0,vim.visualLine=!!actionArgs.linewise,vim.visualBlock=!!actionArgs.blockwise,head=clipCursorToContent(cm,Pos(anchor.line,anchor.ch+repeat-1),!0),vim.sel={anchor:anchor,head:head},CodeMirror.signal(cm,"vim-mode-change",{mode:"visual",subMode:vim.visualLine?"linewise":vim.visualBlock?"blockwise":""}),updateCmSelection(cm),updateMark(cm,vim,"<",cursorMin(anchor,head)),updateMark(cm,vim,">",cursorMax(anchor,head)))},reselectLastSelection:function(cm,_actionArgs,vim){var lastSelection=vim.lastSelection;if(vim.visualMode&&updateLastSelection(cm,vim),lastSelection){var anchor=lastSelection.anchorMark.find(),head=lastSelection.headMark.find();if(!anchor||!head)return;vim.sel={anchor:anchor,head:head},vim.visualMode=!0,vim.visualLine=lastSelection.visualLine,vim.visualBlock=lastSelection.visualBlock,updateCmSelection(cm),updateMark(cm,vim,"<",cursorMin(anchor,head)),updateMark(cm,vim,">",cursorMax(anchor,head)),CodeMirror.signal(cm,"vim-mode-change",{mode:"visual",subMode:vim.visualLine?"linewise":vim.visualBlock?"blockwise":""})}},joinLines:function(cm,actionArgs,vim){var curStart,curEnd;if(vim.visualMode){if(curStart=cm.getCursor("anchor"),curEnd=cm.getCursor("head"),cursorIsBefore(curEnd,curStart)){var tmp=curEnd;curEnd=curStart,curStart=tmp}curEnd.ch=lineLength(cm,curEnd.line)-1}else{var repeat=_Mathmax7(actionArgs.repeat,2);curStart=cm.getCursor(),curEnd=clipCursorToContent(cm,Pos(curStart.line+repeat-1,Infinity))}for(var finalCh=0,i=curStart.line;i<curEnd.line;i++){finalCh=lineLength(cm,curStart.line);var tmp=Pos(curStart.line+1,lineLength(cm,curStart.line+1)),text=cm.getRange(curStart,tmp);text=text.replace(/\n\s*/g," "),cm.replaceRange(text,curStart,tmp)}var curFinalPos=Pos(curStart.line,finalCh);vim.visualMode&&exitVisualMode(cm,!1),cm.setCursor(curFinalPos)},newLineAndEnterInsertMode:function(cm,actionArgs,vim){vim.insertMode=!0;var insertAt=copyCursor(cm.getCursor());if(insertAt.line===cm.firstLine()&&!actionArgs.after)cm.replaceRange("\n",Pos(cm.firstLine(),0)),cm.setCursor(cm.firstLine(),0);else{insertAt.line=actionArgs.after?insertAt.line:insertAt.line-1,insertAt.ch=lineLength(cm,insertAt.line),cm.setCursor(insertAt);var newlineFn=CodeMirror.commands.newlineAndIndentContinueComment||CodeMirror.commands.newlineAndIndent;newlineFn(cm)}this.enterInsertMode(cm,{repeat:actionArgs.repeat},vim)},paste:function(cm,actionArgs,vim){var cur=copyCursor(cm.getCursor()),register=vimGlobalState.registerController.getRegister(actionArgs.registerName),text=register.toString();if(text){if(actionArgs.matchIndent){var tabSize=cm.getOption("tabSize"),whitespaceLength=function(str){var tabs=str.split("\t").length-1,spaces=str.split(" ").length-1;return tabs*tabSize+1*spaces},currentLine=cm.getLine(cm.getCursor().line),indent=whitespaceLength(currentLine.match(/^\s*/)[0]),chompedText=text.replace(/\n$/,""),wasChomped=text!==chompedText,firstIndent=whitespaceLength(text.match(/^\s*/)[0]),text=chompedText.replace(/^\s*/gm,function(wspace){var newIndent=indent+(whitespaceLength(wspace)-firstIndent);if(0>newIndent)return"";if(cm.getOption("indentWithTabs")){var quotient=_Mathfloor6(newIndent/tabSize);return Array(quotient+1).join("\t")}return Array(newIndent+1).join(" ")});text+=wasChomped?"\n":""}if(1<actionArgs.repeat)var text=Array(actionArgs.repeat+1).join(text);var linewise=register.linewise,blockwise=register.blockwise;if(linewise)vim.visualMode?text=vim.visualLine?text.slice(0,-1):"\n"+text.slice(0,text.length-1)+"\n":actionArgs.after?(text="\n"+text.slice(0,text.length-1),cur.ch=lineLength(cm,cur.line)):cur.ch=0;else{if(blockwise){text=text.split("\n");for(var i=0;i<text.length;i++)text[i]=""==text[i]?" ":text[i]}cur.ch+=actionArgs.after?1:0}var curPosFinal,idx;if(vim.visualMode){vim.lastPastedText=text;var selectedArea=getSelectedAreaRange(cm,vim),selectionStart=selectedArea[0],selectionEnd=selectedArea[1],selectedText=cm.getSelection(),selections=cm.listSelections(),emptyStrings=Array(selections.length).join("1").split("1"),lastSelectionCurEnd;vim.lastSelection&&(lastSelectionCurEnd=vim.lastSelection.headMark.find()),vimGlobalState.registerController.unnamedRegister.setText(selectedText),blockwise?(cm.replaceSelections(emptyStrings),selectionEnd=Pos(selectionStart.line+text.length-1,selectionStart.ch),cm.setCursor(selectionStart),selectBlock(cm,selectionEnd),cm.replaceSelections(text),curPosFinal=selectionStart):vim.visualBlock?(cm.replaceSelections(emptyStrings),cm.setCursor(selectionStart),cm.replaceRange(text,selectionStart,selectionStart),curPosFinal=selectionStart):(cm.replaceRange(text,selectionStart,selectionEnd),curPosFinal=cm.posFromIndex(cm.indexFromPos(selectionStart)+text.length-1)),lastSelectionCurEnd&&(vim.lastSelection.headMark=cm.setBookmark(lastSelectionCurEnd)),linewise&&(curPosFinal.ch=0)}else if(blockwise){cm.setCursor(cur);for(var i=0,line;i<text.length;i++){line=cur.line+i,line>cm.lastLine()&&cm.replaceRange("\n",Pos(line,0));var lastCh=lineLength(cm,line);lastCh<cur.ch&&extendLineToColumn(cm,line,cur.ch)}cm.setCursor(cur),selectBlock(cm,Pos(cur.line+text.length-1,cur.ch)),cm.replaceSelections(text),curPosFinal=cur}else cm.replaceRange(text,cur),linewise&&actionArgs.after?curPosFinal=Pos(cur.line+1,findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line+1))):linewise&&!actionArgs.after?curPosFinal=Pos(cur.line,findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line))):!linewise&&actionArgs.after?(idx=cm.indexFromPos(cur),curPosFinal=cm.posFromIndex(idx+text.length-1)):(idx=cm.indexFromPos(cur),curPosFinal=cm.posFromIndex(idx+text.length));vim.visualMode&&exitVisualMode(cm,!1),cm.setCursor(curPosFinal)}},undo:function(cm,actionArgs){cm.operation(function(){repeatFn(cm,CodeMirror.commands.undo,actionArgs.repeat)(),cm.setCursor(cm.getCursor("anchor"))})},redo:function(cm,actionArgs){repeatFn(cm,CodeMirror.commands.redo,actionArgs.repeat)()},setRegister:function(_cm,actionArgs,vim){vim.inputState.registerName=actionArgs.selectedCharacter},setMark:function(cm,actionArgs,vim){var markName=actionArgs.selectedCharacter;updateMark(cm,vim,markName,cm.getCursor())},replace:function(cm,actionArgs,vim){var replaceWith=actionArgs.selectedCharacter,curStart=cm.getCursor(),selections=cm.listSelections(),replaceTo,curEnd;if(vim.visualMode)curStart=cm.getCursor("start"),curEnd=cm.getCursor("end");else{var line=cm.getLine(curStart.line);replaceTo=curStart.ch+actionArgs.repeat,replaceTo>line.length&&(replaceTo=line.length),curEnd=Pos(curStart.line,replaceTo)}if("\n"==replaceWith)vim.visualMode||cm.replaceRange("",curStart,curEnd),(CodeMirror.commands.newlineAndIndentContinueComment||CodeMirror.commands.newlineAndIndent)(cm);else{var replaceWithStr=cm.getRange(curStart,curEnd);if(replaceWithStr=replaceWithStr.replace(/[^\n]/g,replaceWith),vim.visualBlock){var spaces=Array(cm.getOption("tabSize")+1).join(" ");replaceWithStr=cm.getSelection(),replaceWithStr=replaceWithStr.replace(/\t/g,spaces).replace(/[^\n]/g,replaceWith).split("\n"),cm.replaceSelections(replaceWithStr)}else cm.replaceRange(replaceWithStr,curStart,curEnd);vim.visualMode?(curStart=cursorIsBefore(selections[0].anchor,selections[0].head)?selections[0].anchor:selections[0].head,cm.setCursor(curStart),exitVisualMode(cm,!1)):cm.setCursor(offsetCursor(curEnd,0,-1))}},incrementNumberToken:function(cm,actionArgs){for(var cur=cm.getCursor(),lineStr=cm.getLine(cur.line),re=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,match,start,end,numberStr;null!==(match=re.exec(lineStr))&&(start=match.index,end=start+match[0].length,!(cur.ch<end)););if(actionArgs.backtrack||!(end<=cur.ch)){if(match){var baseStr=match[2]||match[4],digits=match[3]||match[5],increment=actionArgs.increase?1:-1,base={0:8,"0b":2,"":10,"0x":16}[baseStr.toLowerCase()],number=parseInt(match[1]+digits,base)+increment*actionArgs.repeat;numberStr=number.toString(base);var zeroPadding=baseStr?Array(digits.length-numberStr.length+1+match[1].length).join("0"):"";numberStr="-"===numberStr.charAt(0)?"-"+baseStr+zeroPadding+numberStr.substr(1):baseStr+zeroPadding+numberStr;var from=Pos(cur.line,start),to=Pos(cur.line,end);cm.replaceRange(numberStr,from,to)}else return;cm.setCursor(Pos(cur.line,start+numberStr.length-1))}},repeatLastEdit:function(cm,actionArgs,vim){var lastEditInputState=vim.lastEditInputState;if(lastEditInputState){var repeat=actionArgs.repeat;repeat&&actionArgs.repeatIsExplicit?vim.lastEditInputState.repeatOverride=repeat:repeat=vim.lastEditInputState.repeatOverride||repeat,_repeatLastEdit(cm,vim,repeat,!1)}},indent:function(cm,actionArgs){cm.indentLine(cm.getCursor().line,actionArgs.indentRight)},exitInsertMode:exitInsertMode},symbolToMode={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},findSymbolModes={bracket:{isComplete:function(state){if(state.nextCh!==state.symb)state.nextCh===state.reverseSymb&&state.depth--;else if(state.depth++,1<=state.depth)return!0;return!1}},section:{init:function(state){state.curMoveThrough=!0,state.symb=(state.forward?"]":"[")===state.symb?"{":"}"},isComplete:function(state){return 0===state.index&&state.nextCh===state.symb}},comment:{isComplete:function(state){var found="*"===state.lastCh&&"/"===state.nextCh;return state.lastCh=state.nextCh,found}},method:{init:function(state){state.symb="m"===state.symb?"{":"}",state.reverseSymb="{"===state.symb?"}":"{"},isComplete:function(state){return state.nextCh===state.symb}},preprocess:{init:function(state){state.index=0},isComplete:function(state){if("#"===state.nextCh){var token=state.lineText.match(/#(\w+)/)[1];if("endif"===token){if(state.forward&&0===state.depth)return!0;state.depth++}else if("if"===token){if(!state.forward&&0===state.depth)return!0;state.depth--}if("else"===token&&0===state.depth)return!0}return!1}}};defineOption("pcre",!0,"boolean"),SearchState.prototype={getQuery:function(){return vimGlobalState.query},setQuery:function(query){vimGlobalState.query=query},getOverlay:function(){return this.searchOverlay},setOverlay:function(overlay){this.searchOverlay=overlay},isReversed:function(){return vimGlobalState.isReversed},setReversed:function(reversed){vimGlobalState.isReversed=reversed},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(annotate){this.annotate=annotate}};var charUnescapes={"\\n":"\n","\\r":"\r","\\t":"\t"},unescapes={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t"},searchPromptDesc="(Javascript regexp)",ExCommandDispatcher=function(){this.buildCommandMap_()};ExCommandDispatcher.prototype={processCommand:function(cm,input,opt_params){var that=this;cm.operation(function(){cm.curOp.isVimOp=!0,that._processCommand(cm,input,opt_params)})},_processCommand:function(cm,input,opt_params){var vim=cm.state.vim,commandHistoryRegister=vimGlobalState.registerController.getRegister(":"),previousCommand=commandHistoryRegister.toString();vim.visualMode&&exitVisualMode(cm);var inputStream=new CodeMirror.StringStream(input);commandHistoryRegister.setText(input);var params=opt_params||{};params.input=input;try{this.parseInput_(cm,inputStream,params)}catch(e){throw showConfirm(cm,e),e}var command,commandName;if(!params.commandName)void 0!==params.line&&(commandName="move");else if(command=this.matchCommand_(params.commandName),command){if(commandName=command.name,command.excludeFromCommandHistory&&commandHistoryRegister.setText(previousCommand),this.parseCommandArgs_(inputStream,params,command),"exToKey"==command.type){for(var i=0;i<command.toKeys.length;i++)CodeMirror.Vim.handleKey(cm,command.toKeys[i],"mapping");return}if("exToEx"==command.type)return void this.processCommand(cm,command.toInput)}if(!commandName)return void showConfirm(cm,"Not an editor command \":"+input+"\"");try{exCommands[commandName](cm,params),command&&command.possiblyAsync||!params.callback||params.callback()}catch(e){throw showConfirm(cm,e),e}},parseInput_:function(cm,inputStream,result){inputStream.eatWhile(":"),inputStream.eat("%")?(result.line=cm.firstLine(),result.lineEnd=cm.lastLine()):(result.line=this.parseLineSpec_(cm,inputStream),void 0!==result.line&&inputStream.eat(",")&&(result.lineEnd=this.parseLineSpec_(cm,inputStream)));var commandMatch=inputStream.match(/^(\w+)/);return result.commandName=commandMatch?commandMatch[1]:inputStream.match(/.*/)[0],result},parseLineSpec_:function(cm,inputStream){var numberMatch=inputStream.match(/^(\d+)/);if(numberMatch)return parseInt(numberMatch[1],10)-1;switch(inputStream.next()){case".":return this.parseLineSpecOffset_(inputStream,cm.getCursor().line);case"$":return this.parseLineSpecOffset_(inputStream,cm.lastLine());case"'":var markName=inputStream.next(),markPos=getMarkPos(cm,cm.state.vim,markName);if(!markPos)throw new Error("Mark not set");return this.parseLineSpecOffset_(inputStream,markPos.line);case"-":case"+":return inputStream.backUp(1),this.parseLineSpecOffset_(inputStream,cm.getCursor().line);default:return void inputStream.backUp(1);}},parseLineSpecOffset_:function(inputStream,line){var offsetMatch=inputStream.match(/^([+-])?(\d+)/);if(offsetMatch){var offset=parseInt(offsetMatch[2],10);"-"==offsetMatch[1]?line-=offset:line+=offset}return line},parseCommandArgs_:function(inputStream,params,command){if(!inputStream.eol()){params.argString=inputStream.match(/.*/)[0];var delim=command.argDelimiter||/\s+/,args=trim(params.argString).split(delim);args.length&&args[0]&&(params.args=args)}},matchCommand_:function(commandName){for(var i=commandName.length,prefix;0<i;i--)if(prefix=commandName.substring(0,i),this.commandMap_[prefix]){var command=this.commandMap_[prefix];if(0===command.name.indexOf(commandName))return command}return null},buildCommandMap_:function(){this.commandMap_={};for(var i=0;i<defaultExCommandMap.length;i++){var command=defaultExCommandMap[i],key=command.shortName||command.name;this.commandMap_[key]=command}},map:function(lhs,rhs,ctx){if(":"!=lhs&&":"==lhs.charAt(0)){if(ctx)throw Error("Mode not supported for ex mappings");var commandName=lhs.substring(1);this.commandMap_[commandName]=":"!=rhs&&":"==rhs.charAt(0)?{name:commandName,type:"exToEx",toInput:rhs.substring(1),user:!0}:{name:commandName,type:"exToKey",toKeys:rhs,user:!0}}else if(":"!=rhs&&":"==rhs.charAt(0)){var mapping={keys:lhs,type:"keyToEx",exArgs:{input:rhs.substring(1)}};ctx&&(mapping.context=ctx),defaultKeymap.unshift(mapping)}else{var mapping={keys:lhs,type:"keyToKey",toKeys:rhs};ctx&&(mapping.context=ctx),defaultKeymap.unshift(mapping)}},unmap:function(lhs,ctx){if(":"!=lhs&&":"==lhs.charAt(0)){if(ctx)throw Error("Mode not supported for ex mappings");var commandName=lhs.substring(1);if(this.commandMap_[commandName]&&this.commandMap_[commandName].user)return void delete this.commandMap_[commandName]}else for(var i=0;i<defaultKeymap.length;i++)if(lhs==defaultKeymap[i].keys&&defaultKeymap[i].context===ctx)return void defaultKeymap.splice(i,1);throw Error("No such mapping.")}};var exCommands={colorscheme:function(cm,params){return!params.args||1>params.args.length?void showConfirm(cm,cm.getOption("theme")):void cm.setOption("theme",params.args[0])},map:function(cm,params,ctx){var mapArgs=params.args;return!mapArgs||2>mapArgs.length?void(cm&&showConfirm(cm,"Invalid mapping: "+params.input)):void exCommandDispatcher.map(mapArgs[0],mapArgs[1],ctx)},imap:function(cm,params){this.map(cm,params,"insert")},nmap:function(cm,params){this.map(cm,params,"normal")},vmap:function(cm,params){this.map(cm,params,"visual")},unmap:function(cm,params,ctx){var mapArgs=params.args;return!mapArgs||1>mapArgs.length?void(cm&&showConfirm(cm,"No such mapping: "+params.input)):void exCommandDispatcher.unmap(mapArgs[0],ctx)},move:function(cm,params){commandDispatcher.processCommand(cm,cm.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:params.line+1})},set:function(cm,params){var setArgs=params.args,setCfg=params.setCfg||{};if(!setArgs||1>setArgs.length)return void(cm&&showConfirm(cm,"Invalid mapping: "+params.input));var expr=setArgs[0].split("="),optionName=expr[0],value=expr[1],forceGet=!1;if("?"==optionName.charAt(optionName.length-1)){if(value)throw Error("Trailing characters: "+params.argString);optionName=optionName.substring(0,optionName.length-1),forceGet=!0}void 0===value&&"no"==optionName.substring(0,2)&&(optionName=optionName.substring(2),value=!1);var optionIsBoolean=options[optionName]&&"boolean"==options[optionName].type;if(optionIsBoolean&&void 0==value&&(value=!0),!optionIsBoolean&&void 0===value||forceGet){var oldValue=getOption(optionName,cm,setCfg);oldValue instanceof Error?showConfirm(cm,oldValue.message):!0===oldValue||!1===oldValue?showConfirm(cm," "+(oldValue?"":"no")+optionName):showConfirm(cm," "+optionName+"="+oldValue)}else{var setOptionReturn=setOption(optionName,value,cm,setCfg);setOptionReturn instanceof Error&&showConfirm(cm,setOptionReturn.message)}},setlocal:function(cm,params){params.setCfg={scope:"local"},this.set(cm,params)},setglobal:function(cm,params){params.setCfg={scope:"global"},this.set(cm,params)},registers:function(cm,params){var regArgs=params.args,registers=vimGlobalState.registerController.registers,regInfo="----------Registers----------<br><br>";if(!regArgs)for(var registerName in registers){var text=registers[registerName].toString();text.length&&(regInfo+="\""+registerName+" "+text+"<br>")}else{var registerName;regArgs=regArgs.join("");for(var i=0;i<regArgs.length;i++)if(registerName=regArgs.charAt(i),!!vimGlobalState.registerController.isValidRegister(registerName)){var register=registers[registerName]||new Register;regInfo+="\""+registerName+" "+register.toString()+"<br>"}}showConfirm(cm,regInfo)},sort:function(cm,params){function compareFn(a,b){if(reverse){var tmp;tmp=a,a=b,b=tmp}ignoreCase&&(a=a.toLowerCase(),b=b.toLowerCase());var anum=number&&numberRegex.exec(a),bnum=number&&numberRegex.exec(b);return anum?(anum=parseInt((anum[1]+anum[2]).toLowerCase(),radix),bnum=parseInt((bnum[1]+bnum[2]).toLowerCase(),radix),anum-bnum):a<b?-1:1}function comparePatternFn(a,b){if(reverse){var tmp;tmp=a,a=b,b=tmp}return ignoreCase&&(a[0]=a[0].toLowerCase(),b[0]=b[0].toLowerCase()),a[0]<b[0]?-1:1}var err=function(){if(params.argString){var args=new CodeMirror.StringStream(params.argString);if(args.eat("!")&&(reverse=!0),args.eol())return;if(!args.eatSpace())return"Invalid arguments";var opts=args.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!opts&&!args.eol())return"Invalid arguments";if(opts[1]){ignoreCase=-1!=opts[1].indexOf("i"),unique=-1!=opts[1].indexOf("u");var decimal=-1!=opts[1].indexOf("d")||-1!=opts[1].indexOf("n")&&1,hex=-1!=opts[1].indexOf("x")&&1,octal=-1!=opts[1].indexOf("o")&&1;if(1<decimal+hex+octal)return"Invalid arguments";number=decimal&&"decimal"||hex&&"hex"||octal&&"octal"}opts[2]&&(pattern=new RegExp(opts[2].substr(1,opts[2].length-2),ignoreCase?"i":""))}}(),reverse,ignoreCase,unique,number,pattern;if(err)return void showConfirm(cm,err+": "+params.argString);var lineStart=params.line||cm.firstLine(),lineEnd=params.lineEnd||params.line||cm.lastLine();if(lineStart!=lineEnd){var curStart=Pos(lineStart,0),curEnd=Pos(lineEnd,lineLength(cm,lineEnd)),text=cm.getRange(curStart,curEnd).split("\n"),numberRegex=pattern?pattern:"decimal"==number?/(-?)([\d]+)/:"hex"==number?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==number?/([0-7]+)/:null,radix="decimal"==number?10:"hex"==number?16:"octal"==number?8:null,numPart=[],textPart=[];if(number||pattern)for(var i=0,matchPart;i<text.length;i++)matchPart=pattern?text[i].match(pattern):null,matchPart&&""!=matchPart[0]?numPart.push(matchPart):!pattern&&numberRegex.exec(text[i])?numPart.push(text[i]):textPart.push(text[i]);else textPart=text;if(numPart.sort(pattern?comparePatternFn:compareFn),pattern)for(var i=0;i<numPart.length;i++)numPart[i]=numPart[i].input;else number||textPart.sort(compareFn);if(text=reverse?numPart.concat(textPart):textPart.concat(numPart),unique){var textOld=text,lastLine;text=[];for(var i=0;i<textOld.length;i++)textOld[i]!=lastLine&&text.push(textOld[i]),lastLine=textOld[i]}cm.replaceRange(text.join("\n"),curStart,curEnd)}},global:function(cm,params){var argString=params.argString;if(!argString)return void showConfirm(cm,"Regular Expression missing from global");var lineStart=void 0===params.line?cm.firstLine():params.line,lineEnd=params.lineEnd||params.line||cm.lastLine(),tokens=splitBySlash(argString),regexPart=argString,cmd;if(tokens.length&&(regexPart=tokens[0],cmd=tokens.slice(1,tokens.length).join("/")),regexPart)try{updateSearchQuery(cm,regexPart,!0,!0)}catch(e){return void showConfirm(cm,"Invalid regex: "+regexPart)}for(var query=getSearchState(cm).getQuery(),matchedLines=[],content="",i=lineStart,matched;i<=lineEnd;i++)matched=query.test(cm.getLine(i)),matched&&(matchedLines.push(i+1),content+=cm.getLine(i)+"<br>");if(!cmd)return void showConfirm(cm,content);var index=0;(function nextCommand(){if(index<matchedLines.length){var command=matchedLines[index]+cmd;exCommandDispatcher.processCommand(cm,command,{callback:nextCommand})}index++})()},substitute:function(cm,params){if(!cm.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var argString=params.argString,tokens=argString?splitBySeparator(argString,argString[0]):[],replacePart="",confirm=!1,global=!1,regexPart,trailing,flagsPart,count;if(tokens.length)regexPart=tokens[0],replacePart=tokens[1],regexPart&&"$"===regexPart[regexPart.length-1]&&(regexPart=regexPart.slice(0,regexPart.length-1)+"\\n",replacePart=replacePart?replacePart+"\n":"\n"),void 0!==replacePart&&(replacePart=getOption("pcre")?unescapeRegexReplace(replacePart):translateRegexReplace(replacePart),vimGlobalState.lastSubstituteReplacePart=replacePart),trailing=tokens[2]?tokens[2].split(" "):[];else if(argString&&argString.length)return void showConfirm(cm,"Substitutions should be of the form :s/pattern/replace/");if(trailing&&(flagsPart=trailing[0],count=parseInt(trailing[1]),flagsPart&&(-1!=flagsPart.indexOf("c")&&(confirm=!0,flagsPart.replace("c","")),-1!=flagsPart.indexOf("g")&&(global=!0,flagsPart.replace("g","")),regexPart=regexPart.replace(/\//g,"\\/")+"/"+flagsPart)),regexPart)try{updateSearchQuery(cm,regexPart,!0,!0)}catch(e){return void showConfirm(cm,"Invalid regex: "+regexPart)}if(replacePart=replacePart||vimGlobalState.lastSubstituteReplacePart,void 0===replacePart)return void showConfirm(cm,"No previous substitute regular expression");var state=getSearchState(cm),query=state.getQuery(),lineStart=void 0===params.line?cm.getCursor().line:params.line,lineEnd=params.lineEnd||lineStart;lineStart==cm.firstLine()&&lineEnd==cm.lastLine()&&(lineEnd=Infinity),count&&(lineStart=lineEnd,lineEnd=lineStart+count-1);var startPos=clipCursorToContent(cm,Pos(lineStart,0)),cursor=cm.getSearchCursor(query,startPos);doReplace(cm,confirm,global,lineStart,lineEnd,cursor,query,replacePart,params.callback)},redo:CodeMirror.commands.redo,undo:CodeMirror.commands.undo,write:function(cm){CodeMirror.commands.save?CodeMirror.commands.save(cm):cm.save&&cm.save()},nohlsearch:function(cm){clearSearchHighlight(cm)},yank:function(cm){var cur=copyCursor(cm.getCursor()),line=cur.line,lineText=cm.getLine(line);vimGlobalState.registerController.pushText("0","yank",lineText,!0,!0)},delmarks:function(cm,params){if(!params.argString||!trim(params.argString))return void showConfirm(cm,"Argument required");for(var state=cm.state.vim,stream=new CodeMirror.StringStream(trim(params.argString));!stream.eol();){stream.eatSpace();var count=stream.pos;if(!stream.match(/[a-zA-Z]/,!1))return void showConfirm(cm,"Invalid argument: "+params.argString.substring(count));var sym=stream.next();if(stream.match("-",!0)){if(!stream.match(/[a-zA-Z]/,!1))return void showConfirm(cm,"Invalid argument: "+params.argString.substring(count));var startMark=sym,finishMark=stream.next();if(isLowerCase(startMark)&&isLowerCase(finishMark)||isUpperCase(startMark)&&isUpperCase(finishMark)){var start=startMark.charCodeAt(0),finish=finishMark.charCodeAt(0);if(start>=finish)return void showConfirm(cm,"Invalid argument: "+params.argString.substring(count));for(var j=0,mark;j<=finish-start;j++)mark=_StringfromCharCode8(start+j),delete state.marks[mark]}else return void showConfirm(cm,"Invalid argument: "+startMark+"-")}else delete state.marks[sym]}}},exCommandDispatcher=new ExCommandDispatcher;return CodeMirror.keyMap.vim={attach:attachVimMap,detach:detachVimMap,call:cmKey},defineOption("insertModeEscKeysTimeout",200,"number"),CodeMirror.keyMap["vim-insert"]={fallthrough:["default"],attach:attachVimMap,detach:detachVimMap,call:cmKey},CodeMirror.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:attachVimMap,detach:detachVimMap,call:cmKey},resetVimGlobalState(),{buildKeyMap:function(){},getRegisterController:function(){return vimGlobalState.registerController},resetVimGlobalState_:resetVimGlobalState,getVimGlobalState_:function(){return vimGlobalState},maybeInitVimState_:maybeInitVimState,suppressErrorLogging:!1,InsertModeKey:InsertModeKey,map:function(lhs,rhs,ctx){exCommandDispatcher.map(lhs,rhs,ctx)},unmap:function(lhs,ctx){exCommandDispatcher.unmap(lhs,ctx)},setOption:setOption,getOption:getOption,defineOption:defineOption,defineEx:function(name,prefix,func){if(!prefix)prefix=name;else if(0!==name.indexOf(prefix))throw new Error("(Vim.defineEx) \""+prefix+"\" is not a prefix of \""+name+"\", command not registered");exCommands[name]=func,exCommandDispatcher.commandMap_[prefix]={name:name,shortName:prefix,type:"api"}},handleKey:function(cm,key,origin){var command=this.findKey(cm,key,origin);if("function"==typeof command)return command()},findKey:function(cm,key,origin){function handleMacroRecording(){var macroModeState=vimGlobalState.macroModeState;if(macroModeState.isRecording){if("q"==key)return macroModeState.exitMacroRecordMode(),clearInputState(cm),!0;"mapping"!=origin&&logKey(macroModeState,key)}}function handleEsc(){if("<Esc>"==key)return clearInputState(cm),vim.visualMode?exitVisualMode(cm):vim.insertMode&&exitInsertMode(cm),!0}function doKeyToKey(keys){for(var match;keys;)match=/<\w+-.+?>|<\w+>|./.exec(keys),key=match[0],keys=keys.substring(match.index+key.length),CodeMirror.Vim.handleKey(cm,key,"mapping")}var vim=maybeInitVimState(cm),command;return command=vim.insertMode?function(){if(handleEsc())return!0;for(var keys=vim.inputState.keyBuffer+=key,keysAreChars=1==key.length,match=commandDispatcher.matchCommand(keys,defaultKeymap,vim.inputState,"insert");1<keys.length&&"full"!=match.type;){var keys=vim.inputState.keyBuffer=keys.slice(1),thisMatch=commandDispatcher.matchCommand(keys,defaultKeymap,vim.inputState,"insert");"none"!=thisMatch.type&&(match=thisMatch)}if("none"==match.type)return clearInputState(cm),!1;if("partial"==match.type)return lastInsertModeKeyTimer&&window.clearTimeout(lastInsertModeKeyTimer),lastInsertModeKeyTimer=window.setTimeout(function(){vim.insertMode&&vim.inputState.keyBuffer&&clearInputState(cm)},getOption("insertModeEscKeysTimeout")),!keysAreChars;if(lastInsertModeKeyTimer&&window.clearTimeout(lastInsertModeKeyTimer),keysAreChars){for(var selections=cm.listSelections(),i=0,here;i<selections.length;i++)here=selections[i].head,cm.replaceRange("",offsetCursor(here,0,-(keys.length-1)),here,"+input");vimGlobalState.macroModeState.lastInsertModeChanges.changes.pop()}return clearInputState(cm),match.command}():function(){if(handleMacroRecording()||handleEsc())return!0;var keys=vim.inputState.keyBuffer+=key;if(/^[1-9]\d*$/.test(keys))return!0;var keysMatcher=/^(\d*)(.*)$/.exec(keys);if(!keysMatcher)return clearInputState(cm),!1;var context=vim.visualMode?"visual":"normal",match=commandDispatcher.matchCommand(keysMatcher[2]||keysMatcher[1],defaultKeymap,vim.inputState,context);if("none"==match.type)return clearInputState(cm),!1;if("partial"==match.type)return!0;vim.inputState.keyBuffer="";var keysMatcher=/^(\d*)(.*)$/.exec(keys);return keysMatcher[1]&&"0"!=keysMatcher[1]&&vim.inputState.pushRepeatDigit(keysMatcher[1]),match.command}(),!1===command?vim.insertMode||1!==key.length?void 0:function(){return!0}:!0===command?function(){return!0}:function(){return cm.operation(function(){cm.curOp.isVimOp=!0;try{"keyToKey"==command.type?doKeyToKey(command.toKeys):commandDispatcher.processCommand(cm,vim,command)}catch(e){throw cm.state.vim=void 0,maybeInitVimState(cm),CodeMirror.Vim.suppressErrorLogging||console.log(e),e}return!0})}},handleEx:function(cm,input){exCommandDispatcher.processCommand(cm,input)},defineMotion:function(name,fn){motions[name]=fn},defineAction:function(name,fn){actions[name]=fn},defineOperator:function(name,fn){operators[name]=fn},mapCommand:function(keys,type,name,args,extra){var command={keys:keys,type:type};for(var key in command[type]=name,command[type+"Args"]=args,extra)command[key]=extra[key];_mapCommand(command)},_mapCommand:_mapCommand,defineRegister:function(name,register){var registers=vimGlobalState.registerController.registers;if(!name||1!=name.length)throw Error("Register name must be 1 character");if(registers[name])throw Error("Register already defined "+name);registers[name]=register,validRegisters.push(name)},exitVisualMode:exitVisualMode,exitInsertMode:exitInsertMode}}()})},yM1o:function(module,exports,__webpack_require__){"use strict";(function(global){function config(name){try{if(!global.localStorage)return!1}catch(_){return!1}var val=global.localStorage[name];return null!=val&&"true"===(val+"").toLowerCase()}module.exports=function(fn,msg){if(config("noDeprecation"))return fn;var warned=!1;return function(){if(!warned){if(config("throwDeprecation"))throw new Error(msg);else config("traceDeprecation")?console.trace(msg):console.warn(msg);warned=!0}return fn.apply(this,arguments)}}}).call(exports,__webpack_require__("h6ac"))},yPXq:function(module,exports,__webpack_require__){"use strict";function ConvertWorker(destType){GenericWorker.call(this,"ConvertWorker to "+destType),this.destType=destType}var GenericWorker=__webpack_require__("ZKdc"),utils=__webpack_require__("dvMn");utils.inherits(ConvertWorker,GenericWorker),ConvertWorker.prototype.processChunk=function(chunk){this.push({data:utils.transformTo(this.destType,chunk.data),meta:chunk.meta})},module.exports=ConvertWorker},yh9p:function(module,exports){"use strict";function getLens(b64){var len=b64.length;if(0<len%4)throw new Error("Invalid string. Length must be a multiple of 4");var validLen=b64.indexOf("=");-1===validLen&&(validLen=len);var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function _byteLength(b64,validLen,placeHoldersLen){return 3*(validLen+placeHoldersLen)/4-placeHoldersLen}function tripletToBase64(num){return lookup[63&num>>18]+lookup[63&num>>12]+lookup[63&num>>6]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var output=[],i=start,tmp;i<end;i+=3)tmp=(16711680&uint8[i]<<16)+(65280&uint8[i+1]<<8)+(255&uint8[i+2]),output.push(tripletToBase64(tmp));return output.join("")}exports.byteLength=function(b64){var lens=getLens(b64),validLen=lens[0],placeHoldersLen=lens[1];return 3*(validLen+placeHoldersLen)/4-placeHoldersLen},exports.toByteArray=function(b64){for(var lens=getLens(b64),validLen=lens[0],placeHoldersLen=lens[1],arr=new Arr(_byteLength(b64,validLen,placeHoldersLen)),curByte=0,len=0<placeHoldersLen?validLen-4:validLen,i=0,tmp;i<len;i+=4)tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)],arr[curByte++]=255&tmp>>16,arr[curByte++]=255&tmp>>8,arr[curByte++]=255&tmp;return 2===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[curByte++]=255&tmp),1===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[curByte++]=255&tmp>>8,arr[curByte++]=255&tmp),arr},exports.fromByteArray=function(uint8){for(var len=uint8.length,extraBytes=len%3,parts=[],maxChunkLength=16383,i=0,len2=len-extraBytes,tmp;i<len2;i+=maxChunkLength)parts.push(encodeChunk(uint8,i,i+maxChunkLength>len2?len2:i+maxChunkLength));return 1==extraBytes?(tmp=uint8[len-1],parts.push(lookup[tmp>>2]+lookup[63&tmp<<4]+"==")):2==extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],parts.push(lookup[tmp>>10]+lookup[63&tmp>>4]+lookup[63&tmp<<2]+"=")),parts.join("")};for(var lookup=[],revLookup=[],Arr="undefined"==typeof Uint8Array?Array:Uint8Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup[45]=62,revLookup[95]=63},z3uY:function(module,exports,__webpack_require__){"use strict";var anObject=__webpack_require__("4McY"),IE8_DOM_DEFINE=__webpack_require__("IDli"),toPrimitive=__webpack_require__("8Agl"),dP=Object.defineProperty;exports.f=__webpack_require__("s0rf")?Object.defineProperty:function(O,P,Attributes){if(anObject(O),P=toPrimitive(P,!0),anObject(Attributes),IE8_DOM_DEFINE)try{return dP(O,P,Attributes)}catch(e){}if("get"in Attributes||"set"in Attributes)throw TypeError("Accessors not supported!");return"value"in Attributes&&(O[P]=Attributes.value),O}},zH6J:function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__("3Vd+").document&&document.documentElement},zKjx:function(module,exports,__webpack_require__){"use strict";__webpack_require__("EkFk")},zs1I:function(module,exports,__webpack_require__){"use strict";var _Mathmin9=Math.min;(function(mod){mod(__webpack_require__("tQq4"))})(function(CodeMirror){CodeMirror.registerHelper("fold","brace",function(cm,start){function findOpening(openCh){for(var at=start.ch,pass=0,found;;){if(found=0>=at?-1:lineText.lastIndexOf(openCh,at-1),-1==found){if(1==pass)break;pass=1,at=lineText.length;continue}if(1==pass&&found<start.ch)break;if(tokenType=cm.getTokenTypeAt(CodeMirror.Pos(line,found+1)),!/^(comment|string)/.test(tokenType))return found+1;at=found-1}}var line=start.line,lineText=cm.getLine(line),startToken="{",endToken="}",startCh=findOpening("{"),tokenType;if(null==startCh&&(startToken="[",endToken="]",startCh=findOpening("[")),null!=startCh){var count=1,lastLine=cm.lastLine(),end,endCh;outer:for(var i=line;i<=lastLine;++i)for(var text=cm.getLine(i),pos=i==line?startCh:0;;){var nextOpen=text.indexOf(startToken,pos),nextClose=text.indexOf(endToken,pos);if(0>nextOpen&&(nextOpen=text.length),0>nextClose&&(nextClose=text.length),pos=_Mathmin9(nextOpen,nextClose),pos==text.length)break;if(cm.getTokenTypeAt(CodeMirror.Pos(i,pos+1))==tokenType)if(pos==nextOpen)++count;else if(! --count){end=i,endCh=pos;break outer}++pos}return null==end||line==end&&endCh==startCh?void 0:{from:CodeMirror.Pos(line,startCh),to:CodeMirror.Pos(end,endCh)}}}),CodeMirror.registerHelper("fold","import",function(cm,start){function hasImport(line){if(line<cm.firstLine()||line>cm.lastLine())return null;var start=cm.getTokenAt(CodeMirror.Pos(line,1));if(/\S/.test(start.string)||(start=cm.getTokenAt(CodeMirror.Pos(line,start.end+1))),"keyword"!=start.type||"import"!=start.string)return null;for(var i=line,e=_Mathmin9(cm.lastLine(),line+10);i<=e;++i){var text=cm.getLine(i),semi=text.indexOf(";");if(-1!=semi)return{startCh:start.end,end:CodeMirror.Pos(i,semi)}}}var startLine=start.line,has=hasImport(startLine),prev;if(!has||hasImport(startLine-1)||(prev=hasImport(startLine-2))&&prev.end.line==startLine-1)return null;for(var end=has.end,next;;){if(next=hasImport(end.line+1),null==next)break;end=next.end}return{from:cm.clipPos(CodeMirror.Pos(startLine,has.startCh+1)),to:end}}),CodeMirror.registerHelper("fold","include",function(cm,start){function hasInclude(line){if(line<cm.firstLine()||line>cm.lastLine())return null;var start=cm.getTokenAt(CodeMirror.Pos(line,1));if(/\S/.test(start.string)||(start=cm.getTokenAt(CodeMirror.Pos(line,start.end+1))),"meta"==start.type&&"#include"==start.string.slice(0,8))return start.start+8}var startLine=start.line,has=hasInclude(startLine);if(null==has||null!=hasInclude(startLine-1))return null;for(var end=startLine,next;;){if(next=hasInclude(end+1),null==next)break;++end}return{from:CodeMirror.Pos(startLine,has+1),to:cm.clipPos(CodeMirror.Pos(end))}})})}}); |