/*! jio v3.21.0 2017-08-10 */functionparseStringToObject(a){varb=function(){vara,b,c=[],d=arguments;for(a=0;a<d.length;a+=1)for(b=0;b<d[a].length;b+=1)c.push(d[a][b]);returnc},c=function(a,b,c){vard={type:"simple",key:a,value:b};returnvoid0!==c&&(d.operator=c),d},d=function(a){return"NOT"===a.operator?a.query_list[0]:{type:"complex",operator:"NOT",query_list:[a]}},e=function(a,c){vard,e=[];for(d=0;d<c.length;d+=1)c[d].operator===a?e=b(e,c[d].query_list):e.push(c[d]);return{type:"complex",operator:a,query_list:e}},f=function(a,b){varc;if("complex"===a.type){for(c=0;c<a.query_list.length;++c)f(a.query_list[c],b);return!0}return"simple"!==a.type||a.key?!1:(a.key=b,!0)},g=function(){functiona(){this.yy={}}varb=function(a,b,c,d){for(c=c||{},d=a.length;d--;c[a[d]]=b);returnc},g=[1,5],h=[1,7],i=[1,8],j=[1,10],k=[1,12],l=[1,6,7,15],m=[1,6,7,9,12,14,15,16,19,21],n=[1,6,7,9,11,12,14,15,16,19,21],o=[2,17],p={trace:function(){},yy:{},symbols_:{error:2,begin:3,search_text:4,end:5,EOF:6,NEWLINE:7,and_expression:8,OR:9,boolean_expression:10,AND:11,NOT:12,expression:13,LEFT_PARENTHESE:14,RIGHT_PARENTHESE:15,WORD:16,DEFINITION:17,value:18,OPERATOR:19,string:20,QUOTE:21,QUOTED_STRING:22,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"NEWLINE",9:"OR",11:"AND",12:"NOT",14:"LEFT_PARENTHESE",15:"RIGHT_PARENTHESE",16:"WORD",17:"DEFINITION",19:"OPERATOR",21:"QUOTE",22:"QUOTED_STRING"},productions_:[0,[3,2],[5,0],[5,1],[5,1],[4,1],[4,2],[4,3],[8,1],[8,3],[10,2],[10,1],[13,3],[13,3],[13,1],[18,2],[18,1],[20,1],[20,3]],performAction:function(a,b,g,h,i,j,k){varl=j.length-1;switch(i){case1:returnj[l-1];case5:case8:case11:case14:case16:this.$=j[l];break;case6:this.$=e("AND",[j[l-1],j[l]]);break;case7:this.$=e("OR",[j[l-2],j[l]]);break;case9:this.$=e("AND",[j[l-2],j[l]]);break;case10:this.$=d(j[l]);break;case12:this.$=j[l-1];break;case13:f(j[l],j[l-2]),this.$=j[l];break;case15:j[l].operator=j[l-1],this.$=j[l];break;case17:this.$=c("",j[l]);break;case18:this.$=c("",j[l-1])}},table:[{3:1,4:2,8:3,10:4,12:g,13:6,14:h,16:i,18:9,19:j,20:11,21:k},{1:[3]},{1:[2,2],5:13,6:[1,14],7:[1,15]},b(l,[2,5],{8:3,10:4,13:6,18:9,20:11,4:16,9:[1,17],12:g,14:h,16:i,19:j,21:k}),b(m,[2,8],{11:[1,18]}),{13:19,14:h,16:i,18:9,19:j,20:11,21:k},b(n,[2,11]),{4:20,8:3,10:4,12:g,13:6,14:h,16:i,18:9,19:j,20:11,21:k},b(n,o,{17:[1,21]}),b(n,[2,14]),{16:[1,23],20:22,21:k},b(n,[2,16]),{22:[1,24]},{1:[2,1]},{1:[2,3]},{1:[2,4]},b(l,[2,6]),{4:25,8:3,10:4,12:g,13:6,14:h,16:i,18:9,19:j,20:11,21:k},{8:26,10:4,12:g,13:6,14:h,16:i,18:9,19:j,20:11,21:k},b(n,[2,10]),{15:[1,27]},{13:28,14:h,16:i,18:9,19:j,20:11,21:k},b(n,[2,15]),b(n,o),{21:[1,29]},b(l,[2,7]),b(m,[2,9]),b(n,[2,12]),b(n,[2,13]),b(n,[2,18])],defaultActions:{13:[2,1],14:[2,3],15:[2,4]},parseError:function(a,b){functionc(a,b){this.message=a,this.hash=b}if(!b.recoverable)throwc.prototype=newError,newc(a,b);this.trace(a)},parse:function(a){varb=this,c=[0],d=[null],e=[],f=this.table,g="",h=0,i=0,j=0,k=2,l=1,m=e.slice.call(arguments,1),n=Object.create(this.lexer),o={yy:{}};for(varpinthis.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(o.yy[p]=this.yy[p]);n.setInput(a,o.yy),o.yy.lexer=n,o.yy.parser=this,"undefined"==typeofn.yylloc&&(n.yylloc={});varq=n.yylloc;e.push(q);varr=n.options&&n.options.ranges;"function"==typeofo.yy.parseError?this.parseError=o.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(vars,t,u,v,w,x,y,z,A,B=function(){vara;returna=n.lex()||l,"number"!=typeofa&&(a=b.symbols_[a]||a),a},C={};;){if(u=c[c.length-1],this.defaultActions[u]?v=this.defaultActions[u]:((null===s||"undefined"==typeofs)&&(s=B()),v=f[u]&&f[u][s]),"undefined"==typeofv||!v.length||!v[0]){varD="";A=[];for(xinf[u])this.terminals_[x]&&x>k&&A.push("'"+this.terminals_[x]+"'");D=n.showPosition?"Parse error on line "+(h+1)+":\n"+n.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[s]||s)+"'":"Parse error on line "+(h+1)+": Unexpected "+(s==l?"end of input":"'"+(this.terminals_[s]||s)+"'"),this.parseError(D,{text:n.match,token:this.terminals_[s]||s,line:n.yylineno,loc:q,expected:A})}if(v[0]instanceofArray&&v.length>1)thrownewError("Parse Error: multiple actions possible at state: "+u+", token: "+s);switch(v[0]){case1:c.push(s),d.push(n.yytext),e.push(n.yylloc),c.push(v[1]),s=null,t?(s=t,t=null):(i=n.yyleng,g=n.yytext,h=n.yylineno,q=n.yylloc,j>0&&j--);break;case2:if(y=this.productions_[v[1]][1],C.$=d[d.length-y],C._$={first_line:e[e.length-(y||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(y||1)].first_column,last_column:e[e.length-1].last_column},r&&(C._$.range=[e[e.length-(y||1)].range[0],e[e.length-1].range[1]]),w=this.performAction.apply(C,[g,i,h,o.yy,v[1],d,e].concat(m)),"undefined"!=typeofw)returnw;y&&(c=c.slice(0,-1*y*2),d=d.slice(0,-1*y),e=e.slice(0,-1*y)),c.push(this.productions_[v[1]][0]),d.push(C.$),e.push(C._$),z=f[c[c.length-2]][c[c.length-1]],c.push(z);break;case3:return!0}}return!0}},q=function(){vara={EOF:1,parseError:function(a,b){if(!this.yy.parser)thrownewError(a);this.yy.parser.parseError(a,b)},setInput:function(a,b){returnthis.yy=b||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){vara=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;varb=a.match(/(?:\r\n?|\n).*/g);returnb?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){varb=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;vard=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);vare=this.yylloc.range;returnthis.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},more:function(){returnthis._more=!0,this},reject:function(){returnthis.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){vara=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){vara=this.match;returna.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){vara=this.pastInput(),b=newArray(a.length+1).join("-");returna+this.upcomingInput()+"\n"+b+"^"},test_match:function(a,b){varc,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),d=a[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)returnc;if(this._backtrack){for(varfine)this[f]=e[f];return!1}return!1},next:function(){if(this.done)returnthis.EOF;this._input||(this.done=!0);vara,b,c,d;this._more||(this.yytext="",this.match="");for(vare=this._currentRules(),f=0;f<e.length;f++)if(c=this._input.match(this.rules[e[f]]),c&&(!b||c[0].length>b[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(a=this.test_match(c,e[f]),a!==!1)returna;if(this._backtrack){b=!1;continue}return!1}if(!this.options.flex)break}returnb?(a=this.test_match(b,e[d]),a!==!1?a:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){vara=this.next();returna?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){vara=this.conditionStack.length-1;returna>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){returnthis.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(a){returna=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},pushState:function(a){this.begin(a)},stateStackSize:function(){returnthis.conditionStack.length},options:{},performAction:function(a,b,c,d){switch(c){case0:returnthis.begin("letsquote"),"QUOTE";case1:returnthis.popState(),this.begin("endquote"),"QUOTED_STRING";case2:returnthis.popState(),"QUOTE";case3:break;case4:return"LEFT_PARENTHESE";case5:return"RIGHT_PARENTHESE";case6:return"AND";case7:return"OR";case8:return"NOT";case9:return"DEFINITION";case10:return19;case11:return16;case12:return6}},rules:[/^(?:")/,/^(?:(\\"|[^"])*)/,/^(?:")/,/^(?:[^\S]+)/,/^(?:\()/,/^(?:\))/,/^(?:AND\b)/,/^(?:OR\b)/,/^(?:NOT\b)/,/^(?::)/,/^(?:(!?=|<=?|>=?))/,/^(?:[^\s\n"():><!=]+)/,/^(?:$)/],conditions:{endquote:{rules:[2],inclusive:!1},letsquote:{rules:[1],inclusive:!1},INITIAL:{rules:[0,3,4,5,6,7,8,9,10,11,12],inclusive:!0}}};returna}();returnp.lexer=q,a.prototype=p,p.Parser=a,newa}();returng.parse(a)}!function(a,b){"object"==typeofexports?module.exports=b():"function"==typeofdefine&&define.amd?define(b):a.IPv6=b(a)}(this,function(a){varb=a&&a.IPv6;return{best:function(a){a=a.toLowerCase().split(":");varb=a.length,c=8;""===a[0]&&""===a[1]&&""===a[2]?(a.shift(),a.shift()):""===a[0]&&""===a[1]?a.shift():""===a[b-1]&&""===a[b-2]&&a.pop(),b=a.length,-1!==a[b-1].indexOf(".")&&(c=7);vard;for(d=0;b>d&&""!==a[d];d++);if(c>d)for(a.splice(d,1,"0000");a.length<c;)a.splice(d,0,"0000");for(d=0;c>d;d++){for(varb=a[d].split(""),e=0;3>e&&("0"===b[0]&&1<b.length);e++)b.splice(0,1);a[d]=b.join("")}varb=-1,f=e=0,g=-1,h=!1;for(d=0;c>d;d++)h?"0"===a[d]?f+=1:(h=!1,f>e&&(b=g,e=f)):"0"==a[d]&&(h=!0,g=d,f=1);for(f>e&&(b=g,e=f),e>1&&a.splice(b,e,""),b=a.length,c="",""===a[0]&&(beststr=":"),d=0;b>d&&(c+=a[d],d!==b-1);d++)c+=":";return""===a[b-1]&&(c+=":"),c},noConflict:function(){returna.IPv6===this&&(a.IPv6=b),this}}}),function(a){functionb(a){throwRangeError(B[a])}functionc(a,b){for(varc=a.length;c--;)a[c]=b(a[c]);returna}functiond(a,b){returnc(a.split(A),b).join(".")}functione(a){for(varb,c,d=[],e=0,f=a.length;f>e;)b=a.charCodeAt(e++),b>=55296&&56319>=b&&f>e?(c=a.charCodeAt(e++),56320==(64512&c)?d.push(((1023&b)<<10)+(1023&c)+65536):(d.push(b),e--)):d.push(b);returnd}functionf(a){returnc(a,function(a){varb="";returna>65535&&(a-=65536,b+=E(a>>>10&1023|55296),a=56320|1023&a),b+=E(a)}).join("")}functiong(a,b){returna+22+75*(26>a)-((0!=b)<<5)}functionh(a,b,c){vard=0;for(a=c?D(a/u):a>>1,a+=D(a/b);a>C*s>>1;d+=q)a=D(a/C);returnD(d+(C+1)*a/(a+t))}functioni(a){varc,d,e,g,i,j,k=[],l=a.length,m=0,n=w,o=v;for(d=a.lastIndexOf(x),0>d&&(d=0),e=0;d>e;++e)128<=a.charCodeAt(e)&&b("not-basic"),k.push(a.charCodeAt(e));for(d=d>0?d+1:0;l>d;){for(e=m,c=1,g=q;d>=l&&b("invalid-input"),i=a.charCodeAt(d++),i=10>i-48?i-22:26>i-65?i-65:26>i-97?i-97:q,(i>=q||i>D((p-m)/c))&&b("overflow"),m+=i*c,j=o>=g?r:g>=o+s?s:g-o,!(j>i);g+=q)i=q-j,c>D(p/i)&&b("overflow"),c*=i;c=k.length+1,o=h(m-e,c,0==e),D(m/c)>p-n&&b("overflow"),n+=D(m/c),m%=c,k.splice(m++,0,n)}returnf(k)}functionj(a){varc,d,f,i,j,k,l,m,n,o,t,u,y=[];for(a=e(a),o=a.length,c=w,d=0,j=v,k=0;o>k;++k)n=a[k],128>n&&y.push(E(n));for((f=i=y.length)&&y.push(x);o>f;){for(l=p,k=0;o>k;++k)n=a[k],n>=c&&l>n&&(l=n);for(t=f+1,l-c>D((p-d)/t)&&b("overflow"),d+=(l-c)*t,c=l,k=0;o>k;++k)if(n=a[k],c>n&&++d>p&&b("overflow"),n==c){for(m=d,l=q;n=j>=l?r:l>=j+s?s:l-j,!(n>m);l+=q)u=m-n,m=q-n,y.push(E(g(n+u%m,0))),m=D(u/m);y.push(E(g(m,0))),j=h(d,t,f==i),d=0,++f}++d,++c}returny.join("")}vark="object"==typeofexports&&exports,l="object"==typeofmodule&&module&&module.exports==k&&module,m="object"==typeofglobal&&global;(m.global===m||m.window===m)&&(a=m);varn,o,p=2147483647,q=36,r=1,s=26,t=38,u=700,v=72,w=128,x="-",y=/^xn--/,z=/[^ -~]/,A=/\x2E|\u3002|\uFF0E|\uFF61/g,B={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=q-r,D=Math.floor,E=String.fromCharCode;if(n={version:"1.2.3",ucs2:{decode:e,encode:f},decode:i,encode:j,toASCII:function(a){returnd(a,function(a){returnz.test(a)?"xn--"+j(a):a})},toUnicode:function(a){returnd(a,function(a){returny.test(a)?i(a.slice(4).toLowerCase()):a})}},"function"==typeofdefine&&"object"==typeofdefine.amd&&define.amd)define(function(){returnn});elseif(k&&!k.nodeType)if(l)l.exports=n;elsefor(oinn)n.hasOwnProperty(o)&&(k[o]=n[o]);elsea.punycode=n}(this),function(a,b){"object"==typeofexports?module.exports=b():"function"==typeofdefine&&define.amd?define(b):a.SecondLevelDomains=b(a)}(this,function(a){varb=a&&a.SecondLevelDomains,c=Object.prototype.hasOwnProperty,d={list:{ac:"com|gov|mil|net|org",ae:"ac|co|gov|mil|name|net|org|pro|sch",af:"com|edu|gov|net|org",al:"com|edu|gov|mil|net|org",ao:"co|ed|gv|it|og|pb",ar:"com|edu|gob|gov|int|mil|net|org|tur",at:"ac|co|gv|or",au:"asn|com|csiro|edu|gov|id|net|org",ba:"co|com|edu|gov|mil|net|org|rs|unbi|unmo|unsa|untz|unze",bb:"biz|co|com|edu|gov|info|net|org|store|tv",bh:"biz|cc|com|edu|gov|info|net|org",bn:"com|edu|gov|net|org",bo:"com|edu|gob|gov|int|mil|net|org|tv",br:"adm|adv|agr|am|arq|art|ato|b|bio|blog|bmd|cim|cng|cnt|com|coop|ecn|edu|eng|esp|etc|eti|far|flog|fm|fnd|fot|fst|g12|ggf|gov|imb|ind|inf|jor|jus|lel|mat|med|mil|mus|net|nom|not|ntr|odo|org|ppg|pro|psc|psi|qsl|rec|slg|srv|tmp|trd|tur|tv|vet|vlog|wiki|zlg",bs:"com|edu|gov|net|org",bz:"du|et|om|ov|rg",ca:"ab|bc|mb|nb|nf|nl|ns|nt|nu|on|pe|qc|sk|yk",ck:"biz|co|edu|gen|gov|info|net|org",cn:"ac|ah|bj|com|cq|edu|fj|gd|gov|gs|gx|gz|ha|hb|he|hi|hl|hn|jl|js|jx|ln|mil|net|nm|nx|org|qh|sc|sd|sh|sn|sx|tj|tw|xj|xz|yn|zj",co:"com|edu|gov|mil|net|nom|org",cr:"ac|c|co|ed|fi|go|or|sa",cy:"ac|biz|com|ekloges|gov|ltd|name|net|org|parliament|press|pro|tm","do":"art|com|edu|gob|gov|mil|net|org|sld|web",dz:"art|asso|com|edu|gov|net|org|pol",ec:"com|edu|fin|gov|info|med|mil|net|org|pro",eg:"com|edu|eun|gov|mil|name|net|org|sci",er:"com|edu|gov|ind|mil|net|org|rochest|w",es:"com|edu|gob|nom|org",et:"biz|com|edu|gov|info|name|net|org",fj:"ac|biz|com|info|mil|name|net|org|pro",fk:"ac|co|gov|net|nom|org",fr:"asso|com|f|gouv|nom|prd|presse|tm",gg:"co|net|org",gh:"com|edu|gov|mil|org",gn:"ac|com|gov|net|org",gr:"com|edu|gov|mil|net|org",gt:"com|edu|gob|ind|mil|net|org",gu:"com|edu|gov|net|org",hk:"com|edu|gov|idv|net|org",id:"ac|co|go|mil|net|or|sch|web",il:"ac|co|gov|idf|k12|muni|net|org","in":"ac|co|edu|ernet|firm|gen|gov|i|ind|mil|net|nic|org|res",iq:"com|edu|gov|i|mil|net|org",ir:"ac|co|dnssec|gov|i|id|net|org|sch",it:"edu|gov",je:"co|net|org",jo:"com|edu|gov|mil|name|net|org|sch",jp:"ac|ad|co|ed|go|gr|lg|ne|or",ke:"ac|co|go|info|me|mobi|ne|or|sc",kh:"com|edu|gov|mil|net|org|per",ki:"biz|com|de|edu|gov|info|mob|net|org|tel",km:"asso|com|coop|edu|gouv|k|medecin|mil|nom|notaires|pharmaciens|presse|tm|veterinaire",kn:"edu|gov|net|org",kr:"ac|busan|chungbuk|chungnam|co|daegu|daejeon|es|gangwon|go|gwangju|gyeongbuk|gyeonggi|gyeongnam|hs|incheon|jeju|jeonbuk|jeonnam|k|kg|mil|ms|ne|or|pe|re|sc|seoul|ulsan",kw:"com|edu|gov|net|org",ky:"com|edu|gov|net|org",kz:"com|edu|gov|mil|net|org",lb:"com|edu|gov|net|org",lk:"assn|com|edu|gov|grp|hotel|int|ltd|net|ngo|org|sch|soc|web",lr:"com|edu|gov|net|org",lv:"asn|com|conf|edu|gov|id|mil|net|org",ly:"com|edu|gov|id|med|net|org|plc|sch",ma:"ac|co|gov|m|net|org|press",mc:"asso|tm",me:"ac|co|edu|gov|its|net|org|priv",mg:"com|edu|gov|mil|nom|org|prd|tm",mk:"com|edu|gov|inf|name|net|org|pro",ml:"com|edu|gov|net|org|presse",mn:"edu|gov|org",mo:"com|edu|gov|net|org",mt:"com|edu|gov|net|org",mv:"aero|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro",mw:"ac|co|com|coop|edu|gov|int|museum|net|org",mx:"com|edu|gob|net|org",my:"com|edu|gov|mil|name|net|org|sch",nf:"arts|com|firm|info|net|other|per|rec|store|web",ng:"biz|com|edu|gov|mil|mobi|name|net|org|sch",ni:"ac|co|com|edu|gob|mil|net|nom|org",np:"com|edu|gov|mil|net|org",nr:"biz|com|edu|gov|info|net|org",om:"ac|biz|co|com|edu|gov|med|mil|museum|net|org|pro|sch",pe:"com|edu|gob|mil|net|nom|org|sld",ph:"com|edu|gov|i|mil|net|ngo|org",pk:"biz|com|edu|fam|gob|gok|gon|gop|gos|gov|net|org|web",pl:"art|bialystok|biz|com|edu|gda|gdansk|gorzow|gov|info|katowice|krakow|lodz|lublin|mil|net|ngo|olsztyn|org|poznan|pwr|radom|slupsk|szczecin|torun|warszawa|waw|wroc|wroclaw|zgora",pr:"ac|biz|com|edu|est|gov|info|isla|name|net|org|pro|prof",ps:"com|edu|gov|net|org|plo|sec",pw:"belau|co|ed|go|ne|or",ro:"arts|com|firm|info|nom|nt|org|rec|store|tm|www",rs:"ac|co|edu|gov|in|org",sb:"com|edu|gov|net|org",sc:"com|edu|gov|net|org",sh:"co|com|edu|gov|net|nom|org",sl:"com|edu|gov|net|org",st:"co|com|consulado|edu|embaixada|gov|mil|net|org|principe|saotome|store",sv:"com|edu|gob|org|red",sz:"ac|co|org",tr:"av|bbs|bel|biz|com|dr|edu|gen|gov|info|k12|name|net|org|pol|tel|tsk|tv|web",tt:"aero|biz|cat|co|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel",tw:"club|com|ebiz|edu|game|gov|idv|mil|net|org",mu:"ac|co|com|gov|net|or|org",mz:"ac|co|edu|gov|org",na:"co|com",nz:"ac|co|cri|geek|gen|govt|health|iwi|maori|mil|net|org|parliament|school",pa:"abo|ac|com|edu|gob|ing|med|net|nom|org|sld",pt:"com|edu|gov|int|net|nome|org|publ",py:"com|edu|gov|mil|net|org",qa:"com|edu|gov|mil|net|org",re:"asso|com|nom",ru:"ac|adygeya|altai|amur|arkhangelsk|astrakhan|bashkiria|belgorod|bir|bryansk|buryatia|cbg|chel|chelyabinsk|chita|chukotka|chuvashia|com|dagestan|e-burg|edu|gov|grozny|int|irkutsk|ivanovo|izhevsk|jar|joshkar-ola|kalmykia|kaluga|kamchatka|karelia|kazan|kchr|kemerovo|khabarovsk|khakassia|khv|kirov|koenig|komi|kostroma|kranoyarsk|kuban|kurgan|kursk|lipetsk|magadan|mari|mari-el|marine|mil|mordovia|mosreg|msk|murmansk|nalchik|net|nnov|nov|novosibirsk|nsk|omsk|orenburg|org|oryol|penza|perm|pp|pskov|ptz|rnd|ryazan|sakhalin|samara|saratov|simbirsk|smolensk|spb|stavropol|stv|surgut|tambov|tatarstan|tom|tomsk|tsaritsyn|tsk|tula|tuva|tver|tyumen|udm|udmurtia|ulan-ude|vladikavkaz|vladimir|vladivostok|volgograd|vologda|voronezh|vrn|vyatka|yakutia|yamal|yekaterinburg|yuzhno-sakhalinsk",rw:"ac|co|com|edu|gouv|gov|int|mil|net",sa:"com|edu|gov|med|net|org|pub|sch",sd:"com|edu|gov|info|med|net|org|tv",se:"a|ac|b|bd|c|d|e|f|g|h|i|k|l|m|n|o|org|p|parti|pp|press|r|s|t|tm|u|w|x|y|z",sg:"com|edu|gov|idn|net|org|per",sn:"art|com|edu|gouv|org|perso|univ",sy:"com|edu|gov|mil|net|news|org",th:"ac|co|go|in|mi|net|or",tj:"ac|biz|co|com|edu|go|gov|info|int|mil|name|net|nic|org|test|web",tn:"agrinet|com|defense|edunet|ens|fin|gov|ind|info|intl|mincom|nat|net|org|perso|rnrt|rns|rnu|tourism",tz:"ac|co|go|ne|or",ua:"biz|cherkassy|chernigov|chernovtsy|ck|cn|co|com|crimea|cv|dn|dnepropetrovsk|donetsk|dp|edu|gov|if|in|ivano-frankivsk|kh|kharkov|kherson|khmelnitskiy|kiev|kirovograd|km|kr|ks|kv|lg|lugansk|lutsk|lviv|me|mk|net|nikolaev|od|odessa|org|pl|poltava|pp|rovno|rv|sebastopol|sumy|te|ternopil|uzhgorod|vinnica|vn|zaporizhzhe|zhitomir|zp|zt",ug:"ac|co|go|ne|or|org|sc",uk:"ac|bl|british-library|co|cym|gov|govt|icnet|jet|lea|ltd|me|mil|mod|national-library-scotland|nel|net|nhs|nic|nls|org|orgn|parliament|plc|police|sch|scot|soc",us:"dni|fed|isa|kids|nsn",uy:"com|edu|gub|mil|net|org",ve:"co|com|edu|gob|info|mil|net|org|web",vi:"co|com|k12|net|org",vn:"ac|biz|com|edu|gov|health|info|int|name|net|org|pro",ye:"co|com|gov|ltd|me|net|org|plc",yu:"ac|co|edu|gov|org",za:"ac|agric|alt|bourse|city|co|cybernet|db|edu|gov|grondar|iaccess|imt|inca|landesign|law|mil|net|ngo|nis|nom|olivetti|org|pix|school|tm|web",zm:"ac|co|com|edu|gov|net|org|sch"},has_expression:null,is_expression:null,has:function(a){return!!a.match(d.has_expression)},is:function(a){return!!a.match(d.is_expression)},get:function(a){return(a=a.match(d.has_expression))&&a[1]||null},noConflict:function(){returna.SecondLevelDomains===this&&(a.SecondLevelDomains=b),this},init:function(){vara,b="";for(aind.list)c.call(d.list,a)&&(b+="|("+("("+d.list[a]+")."+a)+")");d.has_expression=RegExp("\\.("+b.substr(1)+")$","i"),d.is_expression=RegExp("^("+b.substr(1)+")$","i")}};returnd.init(),d}),function(a,b){"object"==typeofexports?module.exports=b(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"==typeofdefine&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],b):a.URI=b(a.punycode,a.IPv6,a.SecondLevelDomains,a)}(this,function(a,b,c,d){functione(a,b){returnthisinstanceofe?(void0===a&&(a="undefined"!=typeoflocation?location.href+"":""),this.href(a),void0!==b?this.absoluteTo(b):this):newe(a,b)}functionf(a){returna.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}functiong(a){returnvoid0===a?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}functionh(a){return"Array"===g(a)}functioni(a,b){varc,d;if(h(b)){for(c=0,d=b.length;d>c;c++)if(!i(a,b[c]))return!1;return!0}vare=g(b);for(c=0,d=a.length;d>c;c++)if("RegExp"===e){if("string"==typeofa[c]&&a[c].match(b))return!0}elseif(a[c]===b)return!0;return!1}functionj(a,b){if(!h(a)||!h(b)||a.length!==b.length)return!1;a.sort(),b.sort();for(varc=0,d=a.length;d>c;c++)if(a[c]!==b[c])return!1;return!0}functionk(a){returnescape(a)}functionl(a){returnencodeURIComponent(a).replace(/[!'()*]/g,k).replace(/\*/g,"%2A")}varm=d&&d.URI;e.version="1.12.0";varn=e.prototype,o=Object.prototype.hasOwnProperty;e._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,duplicateQueryParameters:e.duplicateQueryParameters,escapeQuerySpace:e.escapeQuerySpace}},e.duplicateQueryParameters=!1,e.escapeQuerySpace=!0,e.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,e.idn_expression=/[^a-z0-9\.-]/i,e.punycode_expression=/(xn--)/i,e.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,e.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,e.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/gi,e.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u201e\u2018\u2019]+$/},e.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},e.invalid_hostname_characters=/[^a-zA-Z0-9\.-]/,e.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src"},e.getDomAttribute=function(a){if(a&&a.nodeName){varb=a.nodeName.toLowerCase();return"input"===b&&"image"!==a.type?void0:e.domAttributes[b]}},e.encode=l,e.decode=decodeURIComponent,e.iso8859=function(){e.encode=escape,e.decode=unescape},e.unicode=function(){e.encode=l,e.decode=decodeURIComponent},e.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}}},e.encodeQuery=function(a,b){varc=e.encode(a+"");returnb?c.replace(/%20/g,"+"):c},e.decodeQuery=function(a,b){a+="";try{returne.decode(b?a.replace(/\+/g,"%20"):a)}catch(c){returna}},e.recodePath=function(a){a=(a+"").split("/");for(varb=0,c=a.length;c>b;b++)a[b]=e.encodePathSegment(e.decode(a[b]));returna.join("/")},e.decodePath=function(a){a=(a+"").split("/");for(varb=0,c=a.length;c>b;b++)a[b]=e.decodePathSegment(a[b]);returna.join("/")};varp,q={encode:"encode",decode:"decode"},r=function(a,b){returnfunction(c){returne[b](c+"").replace(e.characters[a][b].expression,function(c){returne.characters[a][b].map[c]})}};for(pinq)e[p+"PathSegment"]=r("pathname",q[p]);e.encodeReserved=r("reserved","encode"),e.parse=function(a,b){varc;returnb||(b={}),c=a.indexOf("#"),c>-1&&(b.fragment=a.substring(c+1)||null,a=a.substring(0,c)),c=a.indexOf("?"),c>-1&&(b.query=a.substring(c+1)||null,a=a.substring(0,c)),"//"===a.substring(0,2)?(b.protocol=null,a=a.substring(2),a=e.parseAuthority(a,b)):(c=a.indexOf(":"),c>-1&&(b.protocol=a.substring(0,c)||null,b.protocol&&!b.protocol.match(e.protocol_expression)?b.protocol=void0:"file"===b.protocol?a=a.substring(c+3):"//"===a.substring(c+1,c+3)?(a=a.substring(c+3),a=e.parseAuthority(a,b)):(a=a.substring(c+1),b.urn=!0))),b.path=a,b},e.parseHost=function(a,b){varc,d=a.indexOf("/");return-1===d&&(d=a.length),"["===a.charAt(0)?(c=a.indexOf("]"),b.hostname=a.substring(1,c)||null,b.port=a.substring(c+2,d)||null):a.indexOf(":")!==a.lastIndexOf(":")?(b.hostname=a.substring(0,d)||null,b.port=null):(c=a.substring(0,d).split(":"),b.hostname=c[0]||null,b.port=c[1]||null),b.hostname&&"/"!==a.substring(d).charAt(0)&&(d++,a="/"+a),a.substring(d)||"/"},e.parseAuthority=function(a,b){returna=e.parseUserinfo(a,b),e.parseHost(a,b)},e.parseUserinfo=function(a,b){varc=a.indexOf("/"),d=c>-1?a.lastIndexOf("@",c):a.indexOf("@");returnd>-1&&(-1===c||c>d)?(c=a.substring(0,d).split(":"),b.username=c[0]?e.decode(c[0]):null,c.shift(),b.password=c[0]?e.decode(c.join(":")):null,a=a.substring(d+1)):(b.username=null,b.password=null),a},e.parseQuery=function(a,b){if(!a)return{};if(a=a.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!a)return{};for(varc,d,f={},g=a.split("&"),h=g.length,i=0;h>i;i++)c=g[i].split("="),d=e.decodeQuery(c.shift(),b),c=c.length?e.decodeQuery(c.join("="),b):null,f[d]?("string"==typeoff[d]&&(f[d]=[f[d]]),f[d].push(c)):f[d]=c;returnf},e.build=function(a){varb="";returna.protocol&&(b+=a.protocol+":"),a.urn||!b&&!a.hostname||(b+="//"),b+=e.buildAuthority(a)||"","string"==typeofa.path&&("/"!==a.path.charAt(0)&&"string"==typeofa.hostname&&(b+="/"),b+=a.path),"string"==typeofa.query&&a.query&&(b+="?"+a.query),"string"==typeofa.fragment&&a.fragment&&(b+="#"+a.fragment),b},e.buildHost=function(a){varb="";returna.hostname?(e.ip6_expression.test(a.hostname)?b=a.port?b+("["+a.hostname+"]:"+a.port):b+a.hostname:(b+=a.hostname,a.port&&(b+=":"+a.port)),b):""},e.buildAuthority=function(a){returne.buildUserinfo(a)+e.buildHost(a)},e.buildUserinfo=function(a){varb="";returna.username&&(b+=e.encode(a.username),a.password&&(b+=":"+e.encode(a.password)),b+="@"),b},e.buildQuery=function(a,b,c){vard,f,g,i,j="";for(fina)if(o.call(a,f)&&f)if(h(a[f]))for(d={},g=0,i=a[f].length;i>g;g++)void0!==a[f][g]&&void0===d[a[f][g]+""]&&(j+="&"+e.buildQueryParameter(f,a[f][g],c),!0!==b&&(d[a[f][g]+""]=!0));elsevoid0!==a[f]&&(j+="&"+e.buildQueryParameter(f,a[f],c));returnj.substring(1)},e.buildQueryParameter=function(a,b,c){returne.encodeQuery(a,c)+(null!==b?"="+e.encodeQuery(b,c):"")},e.addQuery=function(a,b,c){if("object"==typeofb)for(vardinb)o.call(b,d)&&e.addQuery(a,d,b[d]);else{if("string"!=typeofb)thrownewTypeError("URI.addQuery() accepts an object, string as the name parameter");void0===a[b]?a[b]=c:("string"==typeofa[b]&&(a[b]=[a[b]]),h(c)||(c=[c]),a[b]=a[b].concat(c))}},e.removeQuery=function(a,b,c){vard;if(h(b))for(c=0,d=b.length;d>c;c++)a[b[c]]=void0;elseif("object"==typeofb)for(dinb)o.call(b,d)&&e.removeQuery(a,d,b[d]);else{if("string"!=typeofb)thrownewTypeError("URI.addQuery() accepts an object, string as the first parameter");if(void0!==c){if(a[b]===c)a[b]=void0;elseif(h(a[b])){d=a[b];varf,g,i={};if(h(c))for(f=0,g=c.length;g>f;f++)i[c[f]]=!0;elsei[c]=!0;for(f=0,g=d.length;g>f;f++)void0!==i[d[f]]&&(d.splice(f,1),g--,f--);a[b]=d}}elsea[b]=void0}},e.hasQuery=function(a,b,c,d){if("object"==typeofb){for(varfinb)if(o.call(b,f)&&!e.hasQuery(a,f,b[f]))return!1;return!0}if("string"!=typeofb)thrownewTypeError("URI.hasQuery() accepts an object, string as the name parameter");switch(g(c)){case"Undefined":returnbina;case"Boolean":returna=Boolean(h(a[b])?a[b].length:a[b]),c===a;case"Function":return!!c(a[b],b,a);case"Array":returnh(a[b])?(d?i:j)(a[b],c):!1;case"RegExp":returnh(a[b])?d?i(a[b],c):!1:Boolean(a[b]&&a[b].match(c));case"Number":c=String(c);case"String":returnh(a[b])?d?i(a[b],c):!1:a[b]===c;default:thrownewTypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},e.commonPath=function(a,b){varc,d=Math.min(a.length,b.length);for(c=0;d>c;c++)if(a.charAt(c)!==b.charAt(c)){c--;break}return1>c?a.charAt(0)===b.charAt(0)&&"/"===a.charAt(0)?"/":"":(("/"!==a.charAt(c)||"/"!==b.charAt(c))&&(c=a.substring(0,c).lastIndexOf("/")),a.substring(0,c+1))},e.withinString=function(a,b,c){c||(c={});vard=c.start||e.findUri.start,f=c.end||e.findUri.end,g=c.trim||e.findUri.trim,h=/[a-z0-9-]=["']?$/i;for(d.lastIndex=0;;){vari=d.exec(a);if(!i)break;if(i=i.index,c.ignoreHtml){varj=a.slice(Math.max(i-3,0),i);if(j&&h.test(j))continue}varj=i+a.slice(i).search(f),k=a.slice(i,j).replace(g,"");c.ignore&&c.ignore.test(k)||(j=i+k.length,k=b(k,i,j,a),a=a.slice(0,i)+k+a.slice(j),d.lastIndex=i+k.length)}returnd.lastIndex=0,a},e.ensureValidHostname=function(b){if(b.match(e.invalid_hostname_characters)){if(!a)thrownewTypeError("Hostname '"+b+"' contains characters other than [A-Z0-9.-] and Punycode.js is not available");
if(a.toASCII(b).match(e.invalid_hostname_characters))thrownewTypeError("Hostname '"+b+"' contains characters other than [A-Z0-9.-]")}},e.noConflict=function(a){returna?(a={URI:this.noConflict()},URITemplate&&"function"==typeofURITemplate.noConflict&&(a.URITemplate=URITemplate.noConflict()),b&&"function"==typeofb.noConflict&&(a.IPv6=b.noConflict()),SecondLevelDomains&&"function"==typeofSecondLevelDomains.noConflict&&(a.SecondLevelDomains=SecondLevelDomains.noConflict()),a):(d.URI===this&&(d.URI=m),this)},n.build=function(a){return!0===a?this._deferred_build=!0:(void0===a||this._deferred_build)&&(this._string=e.build(this._parts),this._deferred_build=!1),this},n.clone=function(){returnnewe(this)},n.valueOf=n.toString=function(){returnthis.build(!1)._string},q={protocol:"protocol",username:"username",password:"password",hostname:"hostname",port:"port"},r=function(a){returnfunction(b,c){returnvoid0===b?this._parts[a]||"":(this._parts[a]=b||null,this.build(!c),this)}};for(pinq)n[p]=r(q[p]);q={query:"?",fragment:"#"},r=function(a,b){returnfunction(c,d){returnvoid0===c?this._parts[a]||"":(null!==c&&(c+="",c.charAt(0)===b&&(c=c.substring(1))),this._parts[a]=c,this.build(!d),this)}};for(pinq)n[p]=r(p,q[p]);q={search:["?","query"],hash:["#","fragment"]},r=function(a,b){returnfunction(c,d){vare=this[a](c,d);return"string"==typeofe&&e.length?b+e:e}};for(pinq)n[p]=r(q[p][1],q[p][0]);n.pathname=function(a,b){if(void0===a||!0===a){varc=this._parts.path||(this._parts.hostname?"/":"");returna?e.decodePath(c):c}returnthis._parts.path=a?e.recodePath(a):"/",this.build(!b),this},n.path=n.pathname,n.href=function(a,b){varc;if(void0===a)returnthis.toString();this._string="",this._parts=e._parts();vard=ainstanceofe,f="object"==typeofa&&(a.hostname||a.path||a.pathname);if(a.nodeName&&(f=e.getDomAttribute(a),a=a[f]||"",f=!1),!d&&f&&void0!==a.pathname&&(a=a.toString()),"string"==typeofa)this._parts=e.parse(a,this._parts);else{if(!d&&!f)thrownewTypeError("invalid input");for(cind=d?a._parts:a)o.call(this._parts,c)&&(this._parts[c]=d[c])}returnthis.build(!b),this},n.is=function(a){varb=!1,d=!1,f=!1,g=!1,h=!1,i=!1,j=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,d=e.ip4_expression.test(this._parts.hostname),f=e.ip6_expression.test(this._parts.hostname),b=d||f,h=(g=!b)&&c&&c.has(this._parts.hostname),i=g&&e.idn_expression.test(this._parts.hostname),j=g&&e.punycode_expression.test(this._parts.hostname)),a.toLowerCase()){case"relative":returnk;case"absolute":return!k;case"domain":case"name":returng;case"sld":returnh;case"ip":returnb;case"ip4":case"ipv4":case"inet4":returnd;case"ip6":case"ipv6":case"inet6":returnf;case"idn":returni;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":returnj}returnnull};vars=n.protocol,t=n.port,u=n.hostname;n.protocol=function(a,b){if(void0!==a&&a&&(a=a.replace(/:(\/\/)?$/,""),!a.match(e.protocol_expression)))thrownewTypeError("Protocol '"+a+"' contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");returns.call(this,a,b)},n.scheme=n.protocol,n.port=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0!==a&&(0===a&&(a=null),a&&(a+="",":"===a.charAt(0)&&(a=a.substring(1)),a.match(/[^0-9]/))))thrownewTypeError("Port '"+a+"' contains characters other than [0-9]");returnt.call(this,a,b)},n.hostname=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0!==a){varc={};e.parseHost(a,c),a=c.hostname}returnu.call(this,a,b)},n.host=function(a,b){returnthis._parts.urn?void0===a?"":this:void0===a?this._parts.hostname?e.buildHost(this._parts):"":(e.parseHost(a,this._parts),this.build(!b),this)},n.authority=function(a,b){returnthis._parts.urn?void0===a?"":this:void0===a?this._parts.hostname?e.buildAuthority(this._parts):"":(e.parseAuthority(a,this._parts),this.build(!b),this)},n.userinfo=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0===a){if(!this._parts.username)return"";varc=e.buildUserinfo(this._parts);returnc.substring(0,c.length-1)}return"@"!==a[a.length-1]&&(a+="@"),e.parseUserinfo(a,this._parts),this.build(!b),this},n.resource=function(a,b){varc;returnvoid0===a?this.path()+this.search()+this.hash():(c=e.parse(a),this._parts.path=c.path,this._parts.query=c.query,this._parts.fragment=c.fragment,this.build(!b),this)},n.subdomain=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0===a){if(!this._parts.hostname||this.is("IP"))return"";varc=this._parts.hostname.length-this.domain().length-1;returnthis._parts.hostname.substring(0,c)||""}returnc=this._parts.hostname.length-this.domain().length,c=this._parts.hostname.substring(0,c),c=RegExp("^"+f(c)),a&&"."!==a.charAt(a.length-1)&&(a+="."),a&&e.ensureValidHostname(a),this._parts.hostname=this._parts.hostname.replace(c,a),this.build(!b),this},n.domain=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if("boolean"==typeofa&&(b=a,a=void0),void0===a){if(!this._parts.hostname||this.is("IP"))return"";varc=this._parts.hostname.match(/\./g);returnc&&2>c.length?this._parts.hostname:(c=this._parts.hostname.length-this.tld(b).length-1,c=this._parts.hostname.lastIndexOf(".",c-1)+1,this._parts.hostname.substring(c)||"")}if(!a)thrownewTypeError("cannot set domain empty");returne.ensureValidHostname(a),!this._parts.hostname||this.is("IP")?this._parts.hostname=a:(c=RegExp(f(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(c,a)),this.build(!b),this},n.tld=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if("boolean"==typeofa&&(b=a,a=void0),void0===a){if(!this._parts.hostname||this.is("IP"))return"";vard=this._parts.hostname.lastIndexOf("."),d=this._parts.hostname.substring(d+1);return!0!==b&&c&&c.list[d.toLowerCase()]?c.get(this._parts.hostname)||d:d}if(!a)thrownewTypeError("cannot set TLD empty");if(a.match(/[^a-zA-Z0-9-]/)){if(!c||!c.is(a))thrownewTypeError("TLD '"+a+"' contains characters other than [A-Z0-9]");d=RegExp(f(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(d,a)}else{if(!this._parts.hostname||this.is("IP"))thrownewReferenceError("cannot set TLD on non-domain host");d=RegExp(f(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(d,a)}returnthis.build(!b),this},n.directory=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0===a||!0===a){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";varc=this._parts.path.length-this.filename().length-1,c=this._parts.path.substring(0,c)||(this._parts.hostname?"/":"");returna?e.decodePath(c):c}returnc=this._parts.path.length-this.filename().length,c=this._parts.path.substring(0,c),c=RegExp("^"+f(c)),this.is("relative")||(a||(a="/"),"/"!==a.charAt(0)&&(a="/"+a)),a&&"/"!==a.charAt(a.length-1)&&(a+="/"),a=e.recodePath(a),this._parts.path=this._parts.path.replace(c,a),this.build(!b),this},n.filename=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";varc=this._parts.path.lastIndexOf("/"),c=this._parts.path.substring(c+1);returna?e.decodePathSegment(c):c}c=!1,"/"===a.charAt(0)&&(a=a.substring(1)),a.match(/\.?\//)&&(c=!0);vard=RegExp(f(this.filename())+"$");returna=e.recodePath(a),this._parts.path=this._parts.path.replace(d,a),c?this.normalizePath(b):this.build(!b),this},n.suffix=function(a,b){if(this._parts.urn)returnvoid0===a?"":this;if(void0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";varc=this.filename(),d=c.lastIndexOf(".");return-1===d?"":(c=c.substring(d+1),c=/^[a-z0-9%]+$/i.test(c)?c:"",a?e.decodePathSegment(c):c)}if("."===a.charAt(0)&&(a=a.substring(1)),c=this.suffix())d=a?RegExp(f(c)+"$"):RegExp(f("."+c)+"$");else{if(!a)returnthis;this._parts.path+="."+e.recodePath(a)}returnd&&(a=e.recodePath(a),this._parts.path=this._parts.path.replace(d,a)),this.build(!b),this},n.segment=function(a,b,c){vard=this._parts.urn?":":"/",e=this.path(),f="/"===e.substring(0,1),e=e.split(d);if(void0!==a&&"number"!=typeofa&&(c=b,b=a,a=void0),void0!==a&&"number"!=typeofa)throwError("Bad segment '"+a+"', must be 0-based integer");if(f&&e.shift(),0>a&&(a=Math.max(e.length+a,0)),void0===b)returnvoid0===a?e:e[a];if(null===a||void0===e[a])if(h(b)){e=[],a=0;for(varg=b.length;g>a;a++)(b[a].length||e.length&&e[e.length-1].length)&&(e.length&&!e[e.length-1].length&&e.pop(),e.push(b[a]))}else(b||"string"==typeofb)&&(""===e[e.length-1]?e[e.length-1]=b:e.push(b));elseb||"string"==typeofb&&b.length?e[a]=b:e.splice(a,1);returnf&&e.unshift(""),this.path(e.join(d),c)},n.segmentCoded=function(a,b,c){vard,f;if("number"!=typeofa&&(c=b,b=a,a=void0),void0===b){if(a=this.segment(a,b,c),h(a))for(d=0,f=a.length;f>d;d++)a[d]=e.decode(a[d]);elsea=void0!==a?e.decode(a):void0;returna}if(h(b))for(d=0,f=b.length;f>d;d++)b[d]=e.decode(b[d]);elseb="string"==typeofb?e.encode(b):b;returnthis.segment(a,b,c)};varv=n.query;returnn.query=function(a,b){if(!0===a)returne.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeofa){varc=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace),d=a.call(this,c);returnthis._parts.query=e.buildQuery(d||c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!b),this}returnvoid0!==a&&"string"!=typeofa?(this._parts.query=e.buildQuery(a,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!b),this):v.call(this,a,b)},n.setQuery=function(a,b,c){vard=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("object"==typeofa)for(varfina)o.call(a,f)&&(d[f]=a[f]);else{if("string"!=typeofa)thrownewTypeError("URI.addQuery() accepts an object, string as the name parameter");d[a]=void0!==b?b:null}returnthis._parts.query=e.buildQuery(d,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeofa&&(c=b),this.build(!c),this},n.addQuery=function(a,b,c){vard=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);returne.addQuery(d,a,void0===b?null:b),this._parts.query=e.buildQuery(d,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeofa&&(c=b),this.build(!c),this},n.removeQuery=function(a,b,c){vard=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);returne.removeQuery(d,a,b),this._parts.query=e.buildQuery(d,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeofa&&(c=b),this.build(!c),this},n.hasQuery=function(a,b,c){vard=e.parseQuery(this._parts.query,this._parts.escapeQuerySpace);returne.hasQuery(d,a,b,c)},n.setSearch=n.setQuery,n.addSearch=n.addQuery,n.removeSearch=n.removeQuery,n.hasSearch=n.hasQuery,n.normalize=function(){returnthis._parts.urn?this.normalizeProtocol(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},n.normalizeProtocol=function(a){return"string"==typeofthis._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!a)),this},n.normalizeHostname=function(c){returnthis._parts.hostname&&(this.is("IDN")&&a?this._parts.hostname=a.toASCII(this._parts.hostname):this.is("IPv6")&&b&&(this._parts.hostname=b.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!c)),this},n.normalizePort=function(a){return"string"==typeofthis._parts.protocol&&this._parts.port===e.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!a)),this},n.normalizePath=function(a){if(this._parts.urn||!this._parts.path||"/"===this._parts.path)returnthis;varb,c,d,f=this._parts.path,g="";for("/"!==f.charAt(0)&&(b=!0,f="/"+f),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),b&&(g=f.substring(1).match(/^(\.\.\/)+/)||"")&&(g=g[0]);c=f.indexOf("/.."),-1!==c;)0!==c?(d=f.substring(0,c).lastIndexOf("/"),-1===d&&(d=c),f=f.substring(0,d)+f.substring(c+3)):f=f.substring(3);returnb&&this.is("relative")&&(f=g+f.substring(1)),f=e.recodePath(f),this._parts.path=f,this.build(!a),this},n.normalizePathname=n.normalizePath,n.normalizeQuery=function(a){return"string"==typeofthis._parts.query&&(this._parts.query.length?this.query(e.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!a)),this},n.normalizeFragment=function(a){returnthis._parts.fragment||(this._parts.fragment=null,this.build(!a)),this},n.normalizeSearch=n.normalizeQuery,n.normalizeHash=n.normalizeFragment,n.iso8859=function(){vara=e.encode,b=e.decode;returne.encode=escape,e.decode=decodeURIComponent,this.normalize(),e.encode=a,e.decode=b,this},n.unicode=function(){vara=e.encode,b=e.decode;returne.encode=l,e.decode=unescape,this.normalize(),e.encode=a,e.decode=b,this},n.readable=function(){varb=this.clone();b.username("").password("").normalize();varc="";if(b._parts.protocol&&(c+=b._parts.protocol+"://"),b._parts.hostname&&(b.is("punycode")&&a?(c+=a.toUnicode(b._parts.hostname),b._parts.port&&(c+=":"+b._parts.port)):c+=b.host()),b._parts.hostname&&b._parts.path&&"/"!==b._parts.path.charAt(0)&&(c+="/"),c+=b.path(!0),b._parts.query){for(vard="",f=0,g=b._parts.query.split("&"),h=g.length;h>f;f++){vari=(g[f]||"").split("="),d=d+("&"+e.decodeQuery(i[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"));void0!==i[1]&&(d+="="+e.decodeQuery(i[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}c+="?"+d.substring(1)}returnc+=e.decodeQuery(b.hash(),!0)},n.absoluteTo=function(a){varb,c,d=this.clone(),f=["protocol","username","password","hostname","port"];if(this._parts.urn)throwError("URNs do not have any generally defined hierarchical components");if(ainstanceofe||(a=newe(a)),d._parts.protocol||(d._parts.protocol=a._parts.protocol),this._parts.hostname)returnd;for(b=0;c=f[b];b++)d._parts[c]=a._parts[c];returnd._parts.path?".."===d._parts.path.substring(-2)&&(d._parts.path+="/"):(d._parts.path=a._parts.path,d._parts.query||(d._parts.query=a._parts.query)),"/"!==d.path().charAt(0)&&(a=a.directory(),d._parts.path=(a?a+"/":"")+d._parts.path,d.normalizePath()),d.build(),d},n.relativeTo=function(a){varb,c,d,f,g=this.clone().normalize();if(g._parts.urn)throwError("URNs do not have any generally defined hierarchical components");if(a=newe(a).normalize(),b=g._parts,c=a._parts,d=g.path(),f=a.path(),"/"!==d.charAt(0))throwError("URI is already relative");if("/"!==f.charAt(0))throwError("Cannot calculate a URI relative to another relative URI");returnb.protocol===c.protocol&&(b.protocol=null),b.username!==c.username||b.password!==c.password||null!==b.protocol||null!==b.username||null!==b.password||b.hostname!==c.hostname||b.port!==c.port?g.build():(b.hostname=null,b.port=null,d===f?(b.path="",g.build()):(a=e.commonPath(g.path(),a.path()))?(c=c.path.substring(a.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../"),b.path=c+b.path.substring(a.length),g.build()):g.build())},n.equals=function(a){varb=this.clone();a=newe(a);varc,d={},f={},g={};if(b.normalize(),a.normalize(),b.toString()===a.toString())return!0;if(d=b.query(),f=a.query(),b.query(""),a.query(""),b.toString()!==a.toString()||d.length!==f.length)return!1;d=e.parseQuery(d,this._parts.escapeQuerySpace),f=e.parseQuery(f,this._parts.escapeQuerySpace);for(cind)if(o.call(d,c)){if(h(d[c])){if(!j(d[c],f[c]))return!1}elseif(d[c]!==f[c])return!1;g[c]=!0}for(cinf)if(o.call(f,c)&&!g[c])return!1;return!0},n.duplicateQueryParameters=function(a){returnthis._parts.duplicateQueryParameters=!!a,this},n.escapeQuerySpace=function(a){returnthis._parts.escapeQuerySpace=!!a,this},e}),function(a,b){"object"==typeofexports?module.exports=b(require("./URI")):"function"==typeofdefine&&define.amd?define(["./URI"],b):b(a.URI)}(this,function(a){varb=a.prototype,c=b.fragment;a.fragmentPrefix="?";vard=a._parts;returna._parts=function(){varb=d();returnb.fragmentPrefix=a.fragmentPrefix,b},b.fragmentPrefix=function(a){returnthis._parts.fragmentPrefix=a,this},b.fragment=function(b,d){vare=this._parts.fragmentPrefix,f=this._parts.fragment||"";return!0===b?f.substring(0,e.length)!==e?{}:a.parseQuery(f.substring(e.length)):void0!==b&&"string"!=typeofb?(this._parts.fragment=e+a.buildQuery(b),this.build(!d),this):c.call(this,b,d)},b.addFragment=function(b,c,d){vare=this._parts.fragmentPrefix,f=a.parseQuery((this._parts.fragment||"").substring(e.length));returna.addQuery(f,b,c),this._parts.fragment=e+a.buildQuery(f),"string"!=typeofb&&(d=c),this.build(!d),this},b.removeFragment=function(b,c,d){vare=this._parts.fragmentPrefix,f=a.parseQuery((this._parts.fragment||"").substring(e.length));returna.removeQuery(f,b,c),this._parts.fragment=e+a.buildQuery(f),"string"!=typeofb&&(d=c),this.build(!d),this},b.addHash=b.addFragment,b.removeHash=b.removeFragment,{}}),function(a){"use strict";functionb(a){varc;if(null===a||void0===a)return!1;if(d.isArray(a))returna.length>0;if("string"==typeofa||"number"==typeofa||"boolean"==typeofa)return!0;for(cina)if(a.hasOwnProperty(c)&&b(a[c]))return!0;return!1}varc=function(){functiona(a){this.options=a}returna.prototype.toString=function(){returnJSON&&JSON.stringify?JSON.stringify(this.options):this.options},a}(),d=function(){functiona(a){return"[object Array]"===Object.prototype.toString.apply(a)}functionb(a){return"[object String]"===Object.prototype.toString.apply(a)}functionc(a){return"[object Number]"===Object.prototype.toString.apply(a)}functiond(a){return"[object Boolean]"===Object.prototype.toString.apply(a)}functione(a,b){varc,d="",e=!0;for(c=0;c<a.length;c+=1)e?e=!1:d+=b,d+=a[c];returnd}functionf(a,b){for(varc=[],d=0;d<a.length;d+=1)c.push(b(a[d]));returnc}functiong(a,b){for(varc=[],d=0;d<a.length;d+=1)b(a[d])&&c.push(a[d]);returnc}functionh(a){if("object"!=typeofa||null===a)returna;Object.freeze(a);varb,c;for(cina)a.hasOwnProperty(c)&&(b=a[c],"object"!=typeofb||binstanceofRegExp||i(b));returna}functioni(a){return"function"==typeofObject.freeze?h(a):a}return{isArray:a,isString:b,isNumber:c,isBoolean:d,join:e,map:f,filter:g,deepFreeze:i}}(),e=function(){functiona(a){returna>="a"&&"z">=a||a>="A"&&"Z">=a}functionb(a){returna>="0"&&"9">=a}functionc(a){returnb(a)||a>="a"&&"f">=a||a>="A"&&"F">=a}return{isAlpha:a,isDigit:b,isHexDigit:c}}(),f=function(){functiona(a){varb,c,d="",e=g.encode(a);for(c=0;c<e.length;c+=1)b=e.charCodeAt(c),d+="%"+(16>b?"0":"")+b.toString(16).toUpperCase();returnd}functionb(a,b){return"%"===a.charAt(b)&&e.isHexDigit(a.charAt(b+1))&&e.isHexDigit(a.charAt(b+2))}functionc(a,b){returnparseInt(a.substr(b,2),16)}functiond(a){if(!b(a,0))return!1;vard=c(a,1),e=g.numBytes(d);if(0===e)return!1;for(varf=1;e>f;f+=1)if(!b(a,3*f)||!g.isValidFollowingCharCode(c(a,3*f+1)))return!1;return!0}functionf(a,d){vare=a.charAt(d);if(!b(a,d))returne;varf=c(a,d+1),h=g.numBytes(f);if(0===h)returne;for(vari=1;h>i;i+=1)if(!b(a,d+3*i)||!g.isValidFollowingCharCode(c(a,d+3*i+1)))returne;returna.substr(d,3*h)}varg={encode:function(a){returnunescape(encodeURIComponent(a))},numBytes:function(a){return127>=a?1:a>=194&&223>=a?2:a>=224&&239>=a?3:a>=240&&244>=a?4:0},isValidFollowingCharCode:function(a){returna>=128&&191>=a}};return{encodeCharacter:a,isPctEncoded:d,pctCharAt:f}}(),g=function(){functiona(a){returne.isAlpha(a)||e.isDigit(a)||"_"===a||f.isPctEncoded(a)}functionb(a){returne.isAlpha(a)||e.isDigit(a)||"-"===a||"."===a||"_"===a||"~"===a}functionc(a){return":"===a||"/"===a||"?"===a||"#"===a||"["===a||"]"===a||"@"===a||"!"===a||"$"===a||"&"===a||"("===a||")"===a||"*"===a||"+"===a||","===a||";"===a||"="===a||"'"===a}return{isVarchar:a,isUnreserved:b,isReserved:c}}(),h=function(){functiona(a,b){varc,d="",e="";for(("number"==typeofa||"boolean"==typeofa)&&(a=a.toString()),c=0;c<a.length;c+=e.length)e=a.charAt(c),d+=g.isUnreserved(e)||b&&g.isReserved(e)?e:f.encodeCharacter(e);returnd}functionb(b){returna(b,!0)}functionc(a,b){varc=f.pctCharAt(a,b);returnc.length>1?c:g.isReserved(c)||g.isUnreserved(c)?c:f.encodeCharacter(c)}functiond(a){varb,c="",d="";for(b=0;b<a.length;b+=d.length)d=f.pctCharAt(a,b),c+=d.length>1?d:g.isReserved(d)||g.isUnreserved(d)?d:f.encodeCharacter(d);returnc}return{encode:a,encodePassReserved:b,encodeLiteral:d,encodeLiteralCharacter:c}}(),i=function(){functiona(a){b[a]={symbol:a,separator:"?"===a?"&":""===a||"+"===a||"#"===a?",":a,named:";"===a||"&"===a||"?"===a,ifEmpty:"&"===a||"?"===a?"=":"",first:"+"===a?"":a,encode:"+"===a||"#"===a?h.encodePassReserved:h.encode,toString:function(){returnthis.symbol}}}varb={};returna(""),a("+"),a("#"),a("."),a("/"),a(";"),a("?"),a("&"),{valueOf:function(a){returnb[a]?b[a]:"=,!@|".indexOf(a)>=0?null:b[""]}}}(),j=function(){functiona(a){this.literal=h.encodeLiteral(a)}returna.prototype.expand=function(){returnthis.literal},a.prototype.toString=a.prototype.expand,a}(),k=function(){functiona(a){functionb(){varb=a.substring(n,j);if(0===b.length)thrownewc({expressionText:a,message:"a varname must be specified",position:j});m={varname:b,exploded:!1,maxLength:null},n=null}functiond(){if(o===j)thrownewc({expressionText:a,message:"after a ':' you have to specify the length",position:j});m.maxLength=parseInt(a.substring(o,j),10),o=null}varh,j,k=[],m=null,n=null,o=null,p="";for(h=function(b){vard=i.valueOf(b);if(null===d)thrownewc({expressionText:a,message:"illegal use of reserved operator",position:j,operator:b});returnd}(a.charAt(0)),j=h.symbol.length,n=j;j<a.length;j+=p.length){if(p=f.pctCharAt(a,j),null!==n){if("."===p){if(n===j)thrownewc({expressionText:a,message:"a varname MUST NOT start with a dot",position:j});continue}if(g.isVarchar(p))continue;b()}if(null!==o){if(j===o&&"0"===p)thrownewc({expressionText:a,message:"A :prefix must not start with digit 0",position:j});if(e.isDigit(p)){if(j-o>=4)thrownewc({expressionText:a,message:"A :prefix must have max 4 digits",position:j});continue}d()}if(":"!==p)if("*"!==p){if(","!==p)thrownewc({expressionText:a,message:"illegal character",character:p,position:j});k.push(m),m=null,n=j+1}else{if(null===m)thrownewc({expressionText:a,message:"exploded without varspec",position:j});if(m.exploded)thrownewc({expressionText:a,message:"exploded twice",position:j});if(m.maxLength)thrownewc({expressionText:a,message:"an explode (*) MUST NOT follow to a prefix",position:j});m.exploded=!0}else{if(null!==m.maxLength)thrownewc({expressionText:a,message:"only one :maxLength is allowed per varspec",position:j});if(m.exploded)thrownewc({expressionText:a,message:"an exploeded varspec MUST NOT be varspeced",position:j});o=j+1}}returnnull!==n&&b(),null!==o&&d(),k.push(m),newl(a,h,k)}functionb(a){returna.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}functiond(d){vare,f,g,h=[],i=null,k="",l=!0,n=0;for(e=0;e<d.length;e+=1)if(f=d.charAt(e),null===n){if(null===i)thrownewError("reached unreachable code");if("{"===f)thrownewc({templateText:d,message:"brace already opened",position:e});if("}"===f){if(i+1===e)thrownewc({templateText:d,message:"empty braces",position:i});try{g=a(d.substring(i+1,e))}catch(o){if(o.prototype===c.prototype)thrownewc({templateText:d,message:o.options.message,position:i+o.options.position,details:o.options});throwo}h.push(g),0===g.operator.symbol.length?k+="([^/]+)":l=!1,i=null,n=e+1}}else{if("}"===f)thrownewc({templateText:d,message:"unopened brace closed",position:e});"{"===f&&(e>n&&(g=newj(d.substring(n,e)),h.push(g),k+=b(g.literal)),n=null,i=e)}if(null!==i)thrownewc({templateText:d,message:"unclosed brace",position:i});returnn<d.length&&(g=newj(d.substring(n)),h.push(g),k+=b(g.literal)),l===!1&&(k=void0),newm(d,h,k)}returnd}(),l=function(){functiona(a){returnJSON&&JSON.stringify?JSON.stringify(a):a}functionc(a){if(!b(a))return!0;if(d.isString(a))return""===a;if(d.isNumber(a)||d.isBoolean(a))return!1;if(d.isArray(a))return0===a.length;for(varcina)if(a.hasOwnProperty(c))return!1;return!0}functione(a){varb,c=[];for(bina)a.hasOwnProperty(b)&&c.push({name:b,value:a[b]});returnc}functionf(a,b,c){this.templateText=a,this.operator=b,this.varspecs=c}functiong(a,b,c){vard="";if(c=c.toString(),b.named){if(d+=h.encodeLiteral(a.varname),""===c)returnd+=b.ifEmpty;d+="="}returnnull!==a.maxLength&&(c=c.substr(0,a.maxLength)),d+=b.encode(c)}functioni(a){returnb(a.value)}functionj(a,f,g){varj=[],k="";if(f.named){if(k+=h.encodeLiteral(a.varname),c(g))returnk+=f.ifEmpty;k+="="}returnd.isArray(g)?(j=g,j=d.filter(j,b),j=d.map(j,f.encode),k+=d.join(j,",")):(j=e(g),j=d.filter(j,i),j=d.map(j,function(a){returnf.encode(a.name)+","+f.encode(a.value)}),k+=d.join(j,",")),k}functionk(a,f,g){varj=d.isArray(g),k=[];returnj?(k=g,k=d.filter(k,b),k=d.map(k,function(b){vard=h.encodeLiteral(a.varname);returnd+=c(b)?f.ifEmpty:"="+f.encode(b)})):(k=e(g),k=d.filter(k,i),k=d.map(k,function(a){varb=h.encodeLiteral(a.name);returnb+=c(a.value)?f.ifEmpty:"="+f.encode(a.value)})),d.join(k,f.separator)}functionl(a,c){varf=[],g="";returnd.isArray(c)?(f=c,f=d.filter(f,b),f=d.map(f,a.encode),g+=d.join(f,a.separator)):(f=e(c),f=d.filter(f,function(a){returnb(a.value)}),f=d.map(f,function(b){returna.encode(b.name)+"="+a.encode(b.value)}),g+=d.join(f,a.separator)),g}returnf.prototype.toString=function(){returnthis.templateText},f.prototype.expand=function(e){varf,h,i,m,n=[],o=!1,p=this.operator;for(f=0;f<this.varspecs.length;f+=1)if(h=this.varspecs[f],i=e[h.varname],null!==i&&void0!==i)if(h.exploded&&(o=!0),m=d.isArray(i),"string"==typeofi||"number"==typeofi||"boolean"==typeofi)n.push(g(h,p,i));else{if(h.maxLength&&b(i))thrownewError("Prefix modifiers are not applicable to variables that have composite values. You tried to expand "+this+" with "+a(i));h.exploded?b(i)&&(p.named?n.push(k(h,p,i)):n.push(l(p,i))):(p.named||!c(i))&&n.push(j(h,p,i))}return0===n.length?"":p.first+d.join(n,p.separator)},f}(),m=function(){functiona(a,b,c){this.templateText=a,this.expressions=b,void0!==c&&(this.regexp=newRegExp("^"+c+"$")),d.deepFreeze(this)}returna.prototype.toString=function(){returnthis.templateText},a.prototype.expand=function(a){varb,c="";for(b=0;b<this.expressions.length;b+=1)c+=this.expressions[b].expand(a);returnc},a.prototype.extract=function(a){varb,c,d,e,f=1,g=!0,h={};if(void0!==this.regexp&&this.regexp.test(a)){for(e=this.regexp.exec(a),b=0;b<this.expressions.length;b+=1)c=this.expressions[b],void0===c.literal&&(void0!==c.operator&&0===c.operator.symbol.length&&1===c.varspecs.length?(d=c.varspecs[0],d.exploded===!1&&null===d.maxLength&&-1===e[f].indexOf(",")?(h[d.varname]=decodeURIComponent(e[f]),f+=1):g=!1):g=!1);if(g)returnh}return!1},a.parse=k,a.UriTemplateError=c,a}();a(m)}(function(a){"use strict";"undefined"!=typeofmodule?module.exports=a:"function"==typeofdefine?define([],function(){returna}):"undefined"!=typeofwindow?window.UriTemplate=a:global.UriTemplate=a});varLZString=function(){functiona(a,b){if(!e[a]){e[a]={};for(varc=0;c<a.length;c++)e[a][a.charAt(c)]=c}returne[a][b]}varb=String.fromCharCode,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",e={},f={compressToBase64:function(a){if(null==a)return"";varb=f._compress(a,6,function(a){returnc.charAt(a)});switch(b.length%4){default:case0:returnb;case1:returnb+"===";case2:returnb+"==";case3:returnb+"="}},decompressFromBase64:function(b){returnnull==b?"":""==b?null:f._decompress(b.length,32,function(d){returna(c,b.charAt(d))})},compressToUTF16:function(a){returnnull==a?"":f._compress(a,15,function(a){returnb(a+32)})+""},decompressFromUTF16:function(a){returnnull==a?"":""==a?null:f._decompress(a.length,16384,function(b){returna.charCodeAt(b)-32})},compressToUint8Array:function(a){for(varb=f.compress(a),c=newUint8Array(2*b.length),d=0,e=b.length;e>d;d++){varg=b.charCodeAt(d);c[2*d]=g>>>8,c[2*d+1]=g%256}returnc},decompressFromUint8Array:function(a){if(null===a||void0===a)returnf.decompress(a);for(varc=newArray(a.length/2),d=0,e=c.length;e>d;d++)c[d]=256*a[2*d]+a[2*d+1];varg=[];returnc.forEach(function(a){g.push(b(a))}),f.decompress(g.join(""))},compressToEncodedURIComponent:function(a){returnnull==a?"":f._compress(a,6,function(a){returnd.charAt(a)})},decompressFromEncodedURIComponent:function(b){returnnull==b?"":""==b?null:(b=b.replace(/ /g,"+"),f._decompress(b.length,32,function(c){returna(d,b.charAt(c))}))},compress:function(a){returnf._compress(a,16,function(a){returnb(a)})},_compress:function(a,b,c){if(null==a)return"";vard,e,f,g={},h={},i="",j="",k="",l=2,m=3,n=2,o=[],p=0,q=0;for(f=0;f<a.length;f+=1)if(i=a.charAt(f),Object.prototype.hasOwnProperty.call(g,i)||(g[i]=m++,h[i]=!0),j=k+i,Object.prototype.hasOwnProperty.call(g,j))k=j;else{if(Object.prototype.hasOwnProperty.call(h,k)){if(k.charCodeAt(0)<256){for(d=0;n>d;d++)p<<=1,q==b-1?(q=0,o.push(c(p)),p=0):q++;for(e=k.charCodeAt(0),d=0;8>d;d++)p=p<<1|1&e,q==b-1?(q=0,o.push(c(p)),p=0):q++,e>>=1}else{for(e=1,d=0;n>d;d++)p=p<<1|e,q==b-1?(q=0,o.push(c(p)),p=0):q++,e=0;for(e=k.charCodeAt(0),d=0;16>d;d++)p=p<<1|1&e,q==b-1?(q=0,o.push(c(p)),p=0):q++,e>>=1}l--,0==l&&(l=Math.pow(2,n),n++),deleteh[k]}elsefor(e=g[k],d=0;n>d;d++)p=p<<1|1&e,q==b-1?(q=0,o.push(c(p)),p=0):q++,e>>=1;l--,0==l&&(l=Math.pow(2,n),n++),g[j]=m++,k=String(i)}if(""!==k){if(Object.prototype.hasOwnProperty.call(h,k)){if(k.charCodeAt(0)<256){for(d=0;n>d;d++)p<<=1,q==b-1?(q=0,o.push(c(p)),p=0):q++;for(e=k.charCodeAt(0),d=0;8>d;d++)p=p<<1|1&e,q==b-1?(q=0,o.push(c(p)),p=0):q++,e>>=1}else{for(e=1,d=0;n>d;d++)p=p<<1|e,q==b-1?(q=0,o.push(c(p)),p=0):q++,e=0;for(e=k.charCodeAt(0),d=0;16>d;d++)p=p<<1|1&e,q==b-1?(q=0,o.push(c(p)),p=0):q++,e>>=1}l--,0==l&&(l=Math.pow(2,n),n++),deleteh[k]}elsefor(e=g[k],d=0;n>d;d++)p=p<<1|1&e,q==b-1?(q=0,o.push(c(p)),p=0):q++,e>>=1;l--,0==l&&(l=Math.pow(2,n),n++)}for(e=2,d=0;n>d;d++)p=p<<1|1&e,q==b-1?(q=0,o.push(c(p)),p=0):q++,e>>=1;for(;;){if(p<<=1,q==b-1){o.push(c(p));break}q++}returno.join("")},decompress:function(a){returnnull==a?"":""==a?null:f._decompress(a.length,32768,function(b){returna.charCodeAt(b)})},_decompress:function(a,c,d){vare,f,g,h,i,j,k,l,m=[],n=4,o=4,p=3,q="",r=[],s={val:d(0),position:c,index:1};for(f=0;3>f;f+=1)m[f]=f;for(h=0,j=Math.pow(2,2),k=1;k!=j;)i=s.val&s.position,s.position>>=1,0==s.position&&(s.position=c,s.val=d(s.index++)),h|=(i>0?1:0)*k,k<<=1;switch(e=h){case0:for(h=0,j=Math.pow(2,8),k=1;k!=j;)i=s.val&s.position,s.position>>=1,0==s.position&&(s.position=c,s.val=d(s.index++)),h|=(i>0?1:0)*k,k<<=1;l=b(h);break;case1:for(h=0,j=Math.pow(2,16),k=1;k!=j;)i=s.val&s.position,s.position>>=1,0==s.position&&(s.position=c,s.val=d(s.index++)),h|=(i>0?1:0)*k,k<<=1;l=b(h);break;case2:return""}for(m[3]=l,g=l,r.push(l);;){if(s.index>a)return"";for(h=0,j=Math.pow(2,p),k=1;k!=j;)i=s.val&s.position,s.position>>=1,0==s.position&&(s.position=c,s.val=d(s.index++)),h|=(i>0?1:0)*k,k<<=1;switch(l=h){case0:for(h=0,j=Math.pow(2,8),k=1;k!=j;)i=s.val&s.position,s.position>>=1,0==s.position&&(s.position=c,s.val=d(s.index++)),h|=(i>0?1:0)*k,k<<=1;m[o++]=b(h),l=o-1,n--;break;case1:for(h=0,j=Math.pow(2,16),k=1;k!=j;)i=s.val&s.position,s.position>>=1,0==s.position&&(s.position=c,s.val=d(s.index++)),h|=(i>0?1:0)*k,k<<=1;m[o++]=b(h),l=o-1,n--;break;case2:returnr.join("")}if(0==n&&(n=Math.pow(2,p),p++),m[l])q=m[l];else{if(l!==o)returnnull;q=g+g.charAt(0)}r.push(q),m[o++]=g+q.charAt(0),n--,g=q,0==n&&(n=Math.pow(2,p),p++)}}};returnf}();"function"==typeofdefine&&define.amd?define(function(){returnLZString}):"undefined"!=typeofmodule&&null!=module&&(module.exports=LZString),function(a,b){"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=b():"function"==typeofdefine&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";functiona(){returnfd.apply(null,arguments)}functionb(a){fd=a}functionc(a){returnainstanceofArray||"[object Array]"===Object.prototype.toString.call(a)}functiond(a){returnainstanceofDate||"[object Date]"===Object.prototype.toString.call(a);}functione(a,b){varc,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));returnd}functionf(a,b){returnObject.prototype.hasOwnProperty.call(a,b)}functiong(a,b){for(varcinb)f(b,c)&&(a[c]=b[c]);returnf(b,"toString")&&(a.toString=b.toString),f(b,"valueOf")&&(a.valueOf=b.valueOf),a}functionh(a,b,c,d){returnJa(a,b,c,d,!0).utc()}functioni(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}functionj(a){returnnull==a._pf&&(a._pf=i()),a._pf}functionk(a){if(null==a._isValid){varb=j(a),c=gd.call(b.parsedDateParts,function(a){returnnull!=a});a._isValid=!isNaN(a._d.getTime())&&b.overflow<0&&!b.empty&&!b.invalidMonth&&!b.invalidWeekday&&!b.nullInput&&!b.invalidFormat&&!b.userInvalidated&&(!b.meridiem||b.meridiem&&c),a._strict&&(a._isValid=a._isValid&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void0===b.bigHour)}returna._isValid}functionl(a){varb=h(NaN);returnnull!=a?g(j(b),a):j(b).userInvalidated=!0,b}functionm(a){returnvoid0===a}functionn(a,b){varc,d,e;if(m(b._isAMomentObject)||(a._isAMomentObject=b._isAMomentObject),m(b._i)||(a._i=b._i),m(b._f)||(a._f=b._f),m(b._l)||(a._l=b._l),m(b._strict)||(a._strict=b._strict),m(b._tzm)||(a._tzm=b._tzm),m(b._isUTC)||(a._isUTC=b._isUTC),m(b._offset)||(a._offset=b._offset),m(b._pf)||(a._pf=j(b)),m(b._locale)||(a._locale=b._locale),hd.length>0)for(cinhd)d=hd[c],e=b[d],m(e)||(a[d]=e);returna}functiono(b){n(this,b),this._d=newDate(null!=b._d?b._d.getTime():NaN),id===!1&&(id=!0,a.updateOffset(this),id=!1)}functionp(a){returnainstanceofo||null!=a&&null!=a._isAMomentObject}functionq(a){return0>a?Math.ceil(a):Math.floor(a)}functionr(a){varb=+a,c=0;return0!==b&&isFinite(b)&&(c=q(b)),c}functions(a,b,c){vard,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;returng+f}functiont(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeofconsole&&console.warn&&console.warn("Deprecation warning: "+b)}functionu(b,c){vard=!0;returng(function(){returnnull!=a.deprecationHandler&&a.deprecationHandler(null,b),d&&(t(b+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(newError).stack),d=!1),c.apply(this,arguments)},c)}functionv(b,c){null!=a.deprecationHandler&&a.deprecationHandler(b,c),jd[b]||(t(c),jd[b]=!0)}functionw(a){returnainstanceofFunction||"[object Function]"===Object.prototype.toString.call(a)}functionx(a){return"[object Object]"===Object.prototype.toString.call(a)}functiony(a){varb,c;for(cina)b=a[c],w(b)?this[c]=b:this["_"+c]=b;this._config=a,this._ordinalParseLenient=newRegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}functionz(a,b){varc,d=g({},a);for(cinb)f(b,c)&&(x(a[c])&&x(b[c])?(d[c]={},g(d[c],a[c]),g(d[c],b[c])):null!=b[c]?d[c]=b[c]:deleted[c]);returnd}functionA(a){null!=a&&this.set(a)}functionB(a){returna?a.toLowerCase().replace("_","-"):a}functionC(a){for(varb,c,d,e,f=0;f<a.length;){for(e=B(a[f]).split("-"),b=e.length,c=B(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=D(e.slice(0,b).join("-")))returnd;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}returnnull}functionD(a){varb=null;if(!nd[a]&&"undefined"!=typeofmodule&&module&&module.exports)try{b=ld._abbr,require("./locale/"+a),E(b)}catch(c){}returnnd[a]}functionE(a,b){varc;returna&&(c=m(b)?H(a):F(a,b),c&&(ld=c)),ld._abbr}functionF(a,b){returnnull!==b?(b.abbr=a,null!=nd[a]?(v("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),b=z(nd[a]._config,b)):null!=b.parentLocale&&(null!=nd[b.parentLocale]?b=z(nd[b.parentLocale]._config,b):v("parentLocaleUndefined","specified parentLocale is not defined yet")),nd[a]=newA(b),E(a),nd[a]):(deletend[a],null)}functionG(a,b){if(null!=b){varc;null!=nd[a]&&(b=z(nd[a]._config,b)),c=newA(b),c.parentLocale=nd[a],nd[a]=c,E(a)}elsenull!=nd[a]&&(null!=nd[a].parentLocale?nd[a]=nd[a].parentLocale:null!=nd[a]&&deletend[a]);returnnd[a]}functionH(a){varb;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)returnld;if(!c(a)){if(b=D(a))returnb;a=[a]}returnC(a)}functionI(){returnkd(nd)}functionJ(a,b){varc=a.toLowerCase();od[c]=od[c+"s"]=od[b]=a}functionK(a){return"string"==typeofa?od[a]||od[a.toLowerCase()]:void0}functionL(a){varb,c,d={};for(cina)f(a,c)&&(b=K(c),b&&(d[b]=a[c]));returnd}functionM(b,c){returnfunction(d){returnnull!=d?(O(this,b,d),a.updateOffset(this,c),this):N(this,b)}}functionN(a,b){returna.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}functionO(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}functionP(a,b){varc;if("object"==typeofa)for(cina)this.set(c,a[c]);elseif(a=K(a),w(this[a]))returnthis[a](b);returnthis}functionQ(a,b,c){vard=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}functionR(a,b,c,d){vare=d;"string"==typeofd&&(e=function(){returnthis[d]()}),a&&(sd[a]=e),b&&(sd[b[0]]=function(){returnQ(e.apply(this,arguments),b[1],b[2])}),c&&(sd[c]=function(){returnthis.localeData().ordinal(e.apply(this,arguments),a)})}functionS(a){returna.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}functionT(a){varb,c,d=a.match(pd);for(b=0,c=d.length;c>b;b++)sd[d[b]]?d[b]=sd[d[b]]:d[b]=S(d[b]);returnfunction(b){vare,f="";for(e=0;c>e;e++)f+=d[e]instanceofFunction?d[e].call(b,a):d[e];returnf}}functionU(a,b){returna.isValid()?(b=V(b,a.localeData()),rd[b]=rd[b]||T(b),rd[b](a)):a.localeData().invalidDate()}functionV(a,b){functionc(a){returnb.longDateFormat(a)||a}vard=5;for(qd.lastIndex=0;d>=0&&qd.test(a);)a=a.replace(qd,c),qd.lastIndex=0,d-=1;returna}functionW(a,b,c){Kd[a]=w(b)?b:function(a,d){returna&&c?c:b}}functionX(a,b){returnf(Kd,a)?Kd[a](b._strict,b._locale):newRegExp(Y(a))}functionY(a){returnZ(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){returnb||c||d||e}))}functionZ(a){returna.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function$(a,b){varc,d=b;for("string"==typeofa&&(a=[a]),"number"==typeofb&&(d=function(a,c){c[b]=r(a)}),c=0;c<a.length;c++)Ld[a[c]]=d}function_(a,b){$(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}functionaa(a,b,c){null!=b&&f(Ld,a)&&Ld[a](b,c._a,c,a)}functionba(a,b){returnnewDate(Date.UTC(a,b+1,0)).getUTCDate()}functionca(a,b){returnc(this._months)?this._months[a.month()]:this._months[Vd.test(b)?"format":"standalone"][a.month()]}functionda(a,b){returnc(this._monthsShort)?this._monthsShort[a.month()]:this._monthsShort[Vd.test(b)?"format":"standalone"][a.month()]}functionea(a,b,c){vard,e,f,g=a.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;12>d;++d)f=h([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(f,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(f,"").toLocaleLowerCase();returnc?"MMM"===b?(e=md.call(this._shortMonthsParse,g),-1!==e?e:null):(e=md.call(this._longMonthsParse,g),-1!==e?e:null):"MMM"===b?(e=md.call(this._shortMonthsParse,g),-1!==e?e:(e=md.call(this._longMonthsParse,g),-1!==e?e:null)):(e=md.call(this._longMonthsParse,g),-1!==e?e:(e=md.call(this._shortMonthsParse,g),-1!==e?e:null))}functionfa(a,b,c){vard,e,f;if(this._monthsParseExact)returnea.call(this,a,b,c);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=newRegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=newRegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=newRegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))returnd;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))returnd;if(!c&&this._monthsParse[d].test(a))returnd}}functionga(a,b){varc;if(!a.isValid())returna;if("string"==typeofb)if(/^\d+$/.test(b))b=r(b);elseif(b=a.localeData().monthsParse(b),"number"!=typeofb)returna;returnc=Math.min(a.date(),ba(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}functionha(b){returnnull!=b?(ga(this,b),a.updateOffset(this,!0),this):N(this,"Month")}functionia(){returnba(this.year(),this.month())}functionja(a){returnthis._monthsParseExact?(f(this,"_monthsRegex")||la.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}functionka(a){returnthis._monthsParseExact?(f(this,"_monthsRegex")||la.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}functionla(){functiona(a,b){returnb.length-a.length}varb,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=Z(d[b]),e[b]=Z(e[b]),f[b]=Z(f[b]);this._monthsRegex=newRegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=newRegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=newRegExp("^("+d.join("|")+")","i")}functionma(a){varb,c=a._a;returnc&&-2===j(a).overflow&&(b=c[Nd]<0||c[Nd]>11?Nd:c[Od]<1||c[Od]>ba(c[Md],c[Nd])?Od:c[Pd]<0||c[Pd]>24||24===c[Pd]&&(0!==c[Qd]||0!==c[Rd]||0!==c[Sd])?Pd:c[Qd]<0||c[Qd]>59?Qd:c[Rd]<0||c[Rd]>59?Rd:c[Sd]<0||c[Sd]>999?Sd:-1,j(a)._overflowDayOfYear&&(Md>b||b>Od)&&(b=Od),j(a)._overflowWeeks&&-1===b&&(b=Td),j(a)._overflowWeekday&&-1===b&&(b=Ud),j(a).overflow=b),a}functionna(a){varb,c,d,e,f,g,h=a._i,i=$d.exec(h)||_d.exec(h);if(i){for(j(a).iso=!0,b=0,c=be.length;c>b;b++)if(be[b][1].exec(i[1])){e=be[b][0],d=be[b][2]!==!1;break}if(null==e)returnvoid(a._isValid=!1);if(i[3]){for(b=0,c=ce.length;c>b;b++)if(ce[b][1].exec(i[3])){f=(i[2]||"")+ce[b][0];break}if(null==f)returnvoid(a._isValid=!1)}if(!d&&null!=f)returnvoid(a._isValid=!1);if(i[4]){if(!ae.exec(i[4]))returnvoid(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),Ca(a)}elsea._isValid=!1}functionoa(b){varc=de.exec(b._i);returnnull!==c?void(b._d=newDate(+c[1])):(na(b),void(b._isValid===!1&&(deleteb._isValid,a.createFromInputFallback(b))))}functionpa(a,b,c,d,e,f,g){varh=newDate(a,b,c,d,e,f,g);return100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}functionqa(a){varb=newDate(Date.UTC.apply(null,arguments));return100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}functionra(a){returnsa(a)?366:365}functionsa(a){returna%4===0&&a%100!==0||a%400===0}functionta(){returnsa(this.year())}functionua(a,b,c){vard=7+b-c,e=(7+qa(a,0,d).getUTCDay()-b)%7;return-e+d-1}functionva(a,b,c,d,e){varf,g,h=(7+c-d)%7,i=ua(a,d,e),j=1+7*(b-1)+h+i;return0>=j?(f=a-1,g=ra(f)+j):j>ra(a)?(f=a+1,g=j-ra(a)):(f=a,g=j),{year:f,dayOfYear:g}}functionwa(a,b,c){vard,e,f=ua(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return1>g?(e=a.year()-1,d=g+xa(e,b,c)):g>xa(a.year(),b,c)?(d=g-xa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}functionxa(a,b,c){vard=ua(a,b,c),e=ua(a+1,b,c);return(ra(a)-d+e)/7}functionya(a,b,c){returnnull!=a?a:null!=b?b:c}functionza(b){varc=newDate(a.now());returnb._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}functionAa(a){varb,c,d,e,f=[];if(!a._d){for(d=za(a),a._w&&null==a._a[Od]&&null==a._a[Nd]&&Ba(a),a._dayOfYear&&(e=ya(a._a[Md],d[Md]),a._dayOfYear>ra(e)&&(j(a)._overflowDayOfYear=!0),c=qa(e,0,a._dayOfYear),a._a[Nd]=c.getUTCMonth(),a._a[Od]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[Pd]&&0===a._a[Qd]&&0===a._a[Rd]&&0===a._a[Sd]&&(a._nextDay=!0,a._a[Pd]=0),a._d=(a._useUTC?qa:pa).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Pd]=24)}}functionBa(a){varb,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=ya(b.GG,a._a[Md],wa(Ka(),1,4).year),d=ya(b.W,1),e=ya(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=ya(b.gg,a._a[Md],wa(Ka(),f,g).year),d=ya(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>xa(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=va(c,d,e,f,g),a._a[Md]=h.year,a._dayOfYear=h.dayOfYear)}functionCa(b){if(b._f===a.ISO_8601)returnvoidna(b);b._a=[],j(b).empty=!0;varc,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=V(b._f,b._locale).match(pd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(X(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),sd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),aa(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[Pd]<=12&&b._a[Pd]>0&&(j(b).bigHour=void0),j(b).parsedDateParts=b._a.slice(0),j(b).meridiem=b._meridiem,b._a[Pd]=Da(b._locale,b._a[Pd],b._meridiem),Aa(b),ma(b)}functionDa(a,b,c){vard;returnnull==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}functionEa(a){varb,c,d,e,f;if(0===a._f.length)returnj(a).invalidFormat=!0,void(a._d=newDate(NaN));for(e=0;e<a._f.length;e++)f=0,b=n({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],Ca(b),k(b)&&(f+=j(b).charsLeftOver,f+=10*j(b).unusedTokens.length,j(b).score=f,(null==d||d>f)&&(d=f,c=b));g(a,c||b)}functionFa(a){if(!a._d){varb=L(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){returna&&parseInt(a,10)}),Aa(a)}}functionGa(a){varb=newo(ma(Ha(a)));returnb._nextDay&&(b.add(1,"d"),b._nextDay=void0),b}functionHa(a){varb=a._i,e=a._f;returna._locale=a._locale||H(a._l),null===b||void0===e&&""===b?l({nullInput:!0}):("string"==typeofb&&(a._i=b=a._locale.preparse(b)),p(b)?newo(ma(b)):(c(e)?Ea(a):e?Ca(a):d(b)?a._d=b:Ia(a),k(a)||(a._d=null),a))}functionIa(b){varf=b._i;void0===f?b._d=newDate(a.now()):d(f)?b._d=newDate(f.valueOf()):"string"==typeoff?oa(b):c(f)?(b._a=e(f.slice(0),function(a){returnparseInt(a,10)}),Aa(b)):"object"==typeoff?Fa(b):"number"==typeoff?b._d=newDate(f):a.createFromInputFallback(b)}functionJa(a,b,c,d,e){varf={};return"boolean"==typeofc&&(d=c,c=void0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Ga(f)}functionKa(a,b,c,d){returnJa(a,b,c,d,!1)}functionLa(a,b){vard,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)returnKa();for(d=b[0],e=1;e<b.length;++e)(!b[e].isValid()||b[e][a](d))&&(d=b[e]);returnd}functionMa(){vara=[].slice.call(arguments,0);returnLa("isBefore",a)}functionNa(){vara=[].slice.call(arguments,0);returnLa("isAfter",a)}functionOa(a){varb=L(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+1e3*h*60*60,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=H(),this._bubble()}functionPa(a){returnainstanceofOa}functionQa(a,b){R(a,0,0,function(){vara=this.utcOffset(),c="+";return0>a&&(a=-a,c="-"),c+Q(~~(a/60),2)+b+Q(~~a%60,2)})}functionRa(a,b){varc=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(ie)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}functionSa(b,c){vare,f;returnc._isUTC?(e=c.clone(),f=(p(b)||d(b)?b.valueOf():Ka(b).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+f),a.updateOffset(e,!1),e):Ka(b).local()}functionTa(a){return15*-Math.round(a._d.getTimezoneOffset()/15)}functionUa(b,c){vard,e=this._offset||0;returnthis.isValid()?null!=b?("string"==typeofb?b=Ra(Hd,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ta(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?jb(this,db(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ta(this):null!=b?this:NaN}functionVa(a,b){returnnull!=a?("string"!=typeofa&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}functionWa(a){returnthis.utcOffset(0,a)}functionXa(a){returnthis._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ta(this),"m")),this}functionYa(){returnthis._tzm?this.utcOffset(this._tzm):"string"==typeofthis._i&&this.utcOffset(Ra(Gd,this._i)),this}functionZa(a){returnthis.isValid()?(a=a?Ka(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function$a(){returnthis.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function_a(){if(!m(this._isDSTShifted))returnthis._isDSTShifted;vara={};if(n(a,this),a=Ha(a),a._a){varb=a._isUTC?h(a._a):Ka(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}elsethis._isDSTShifted=!1;returnthis._isDSTShifted}functionab(){returnthis.isValid()?!this._isUTC:!1}functionbb(){returnthis.isValid()?this._isUTC:!1}functioncb(){returnthis.isValid()?this._isUTC&&0===this._offset:!1}functiondb(a,b){varc,d,e,g=a,h=null;returnPa(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeofa?(g={},b?g[b]=a:g.milliseconds=a):(h=je.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[Od])*c,h:r(h[Pd])*c,m:r(h[Qd])*c,s:r(h[Rd])*c,ms:r(h[Sd])*c}):(h=ke.exec(a))?(c="-"===h[1]?-1:1,g={y:eb(h[2],c),M:eb(h[3],c),w:eb(h[4],c),d:eb(h[5],c),h:eb(h[6],c),m:eb(h[7],c),s:eb(h[8],c)}):null==g?g={}:"object"==typeofg&&("from"ing||"to"ing)&&(e=gb(Ka(g.from),Ka(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=newOa(g),Pa(a)&&f(a,"_locale")&&(d._locale=a._locale),d}functioneb(a,b){varc=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}functionfb(a,b){varc={milliseconds:0,months:0};returnc.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}functiongb(a,b){varc;returna.isValid()&&b.isValid()?(b=Sa(b,a),a.isBefore(b)?c=fb(a,b):(c=fb(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}functionhb(a){return0>a?-1*Math.round(-1*a):Math.round(a)}functionib(a,b){returnfunction(c,d){vare,f;returnnull===d||isNaN(+d)||(v(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeofc?+c:c,e=db(c,d),jb(this,e,a),this}}functionjb(b,c,d,e){varf=c._milliseconds,g=hb(c._days),h=hb(c._months);b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(b._d.valueOf()+f*d),g&&O(b,"Date",N(b,"Date")+g*d),h&&ga(b,N(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}functionkb(a,b){varc=a||Ka(),d=Sa(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(w(b[f])?b[f]():b[f]);returnthis.format(g||this.localeData().calendar(f,this,Ka(c)))}functionlb(){returnnewo(this)}functionmb(a,b){varc=p(a)?a:Ka(a);returnthis.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?this.valueOf()>c.valueOf():c.valueOf()<this.clone().startOf(b).valueOf()):!1}functionnb(a,b){varc=p(a)?a:Ka(a);returnthis.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?this.valueOf()<c.valueOf():this.clone().endOf(b).valueOf()<c.valueOf()):!1}functionob(a,b,c,d){returnd=d||"()",("("===d[0]?this.isAfter(a,c):!this.isBefore(a,c))&&(")"===d[1]?this.isBefore(b,c):!this.isAfter(b,c))}functionpb(a,b){varc,d=p(a)?a:Ka(a);returnthis.isValid()&&d.isValid()?(b=K(b||"millisecond"),"millisecond"===b?this.valueOf()===d.valueOf():(c=d.valueOf(),this.clone().startOf(b).valueOf()<=c&&c<=this.clone().endOf(b).valueOf())):!1}functionqb(a,b){returnthis.isSame(a,b)||this.isAfter(a,b)}functionrb(a,b){returnthis.isSame(a,b)||this.isBefore(a,b)}functionsb(a,b,c){vard,e,f,g;returnthis.isValid()?(d=Sa(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=K(b),"year"===b||"month"===b||"quarter"===b?(g=tb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}functiontb(a,b){varc,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)||0}functionub(){returnthis.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}functionvb(){vara=this.clone().utc();return0<a.year()&&a.year()<=9999?w(Date.prototype.toISOString)?this.toDate().toISOString():U(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):U(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}functionwb(b){b||(b=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);varc=U(this,b);returnthis.localeData().postformat(c)}functionxb(a,b){returnthis.isValid()&&(p(a)&&a.isValid()||Ka(a).isValid())?db({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}functionyb(a){returnthis.from(Ka(),a)}functionzb(a,b){returnthis.isValid()&&(p(a)&&a.isValid()||Ka(a).isValid())?db({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}functionAb(a){returnthis.to(Ka(),a)}functionBb(a){varb;returnvoid0===a?this._locale._abbr:(b=H(a),null!=b&&(this._locale=b),this)}functionCb(){returnthis._locale}functionDb(a){switch(a=K(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}functionEb(a){returna=K(a),void0===a||"millisecond"===a?this:("date"===a&&(a="day"),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms"))}functionFb(){returnthis._d.valueOf()-6e4*(this._offset||0)}functionGb(){returnMath.floor(this.valueOf()/1e3)}functionHb(){returnthis._offset?newDate(this.valueOf()):this._d}functionIb(){vara=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}functionJb(){vara=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}functionKb(){returnthis.isValid()?this.toISOString():null}functionLb(){returnk(this)}functionMb(){returng({},j(this))}functionNb(){returnj(this).overflow}functionOb(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}functionPb(a,b){R(0,[a,a.length],0,b)}functionQb(a){returnUb.call(this,a,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}functionRb(a){returnUb.call(this,a,this.isoWeek(),this.isoWeekday(),1,4)}functionSb(){returnxa(this.year(),1,4)}functionTb(){vara=this.localeData()._week;returnxa(this.year(),a.dow,a.doy)}functionUb(a,b,c,d,e){varf;returnnull==a?wa(this,d,e).year:(f=xa(a,d,e),b>f&&(b=f),Vb.call(this,a,b,c,d,e))}functionVb(a,b,c,d,e){varf=va(a,b,c,d,e),g=qa(f.year,0,f.dayOfYear);returnthis.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}functionWb(a){returnnull==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}functionXb(a){returnwa(a,this._week.dow,this._week.doy).week}functionYb(){returnthis._week.dow}functionZb(){returnthis._week.doy}function$b(a){varb=this.localeData().week(this);returnnull==a?b:this.add(7*(a-b),"d")}function_b(a){varb=wa(this,1,4).week;returnnull==a?b:this.add(7*(a-b),"d")}functionac(a,b){return"string"!=typeofa?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeofa?a:null):parseInt(a,10)}functionbc(a,b){returnc(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}functioncc(a){returnthis._weekdaysShort[a.day()]}functiondc(a){returnthis._weekdaysMin[a.day()]}functionec(a,b,c){vard,e,f,g=a.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;7>d;++d)f=h([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(f,"").toLocaleLowerCase();returnc?"dddd"===b?(e=md.call(this._weekdaysParse,g),-1!==e?e:null):"ddd"===b?(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:null):(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null):"dddd"===b?(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null))):"ddd"===b?(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null))):(e=md.call(this._minWeekdaysParse,g),-1!==e?e:(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:null)))}functionfc(a,b,c){vard,e,f;if(this._weekdaysParseExact)returnec.call(this,a,b,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=h([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=newRegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=newRegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=newRegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=newRegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))returnd;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))returnd;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))returnd;if(!c&&this._weekdaysParse[d].test(a))returnd}}functiongc(a){if(!this.isValid())returnnull!=a?this:NaN;varb=this._isUTC?this._d.getUTCDay():this._d.getDay();returnnull!=a?(a=ac(a,this.localeData()),this.add(a-b,"d")):b}functionhc(a){if(!this.isValid())returnnull!=a?this:NaN;varb=(this.day()+7-this.localeData()._week.dow)%7;returnnull==a?b:this.add(a-b,"d")}functionic(a){returnthis.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}functionjc(a){returnthis._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&a?this._weekdaysStrictRegex:this._weekdaysRegex}functionkc(a){returnthis._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}functionlc(a){returnthis._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}functionmc(){functiona(a,b){returnb.length-a.length}varb,c,d,e,f,g=[],i=[],j=[],k=[];for(b=0;7>b;b++)c=h([2e3,1]).day(b),d=this.weekdaysMin(c,""),e=this.weekdaysShort(c,""),f=this.weekdays(c,""),g.push(d),i.push(e),j.push(f),k.push(d),k.push(e),k.push(f);for(g.sort(a),i.sort(a),j.sort(a),k.sort(a),b=0;7>b;b++)i[b]=Z(i[b]),j[b]=Z(j[b]),k[b]=Z(k[b]);this._weekdaysRegex=newRegExp("^("+k.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=newRegExp("^("+j.join("|")+")","i"),this._weekdaysShortStrictRegex=newRegExp("^("+i.join("|")+")","i"),this._weekdaysMinStrictRegex=newRegExp("^("+g.join("|")+")","i")}functionnc(a){varb=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;returnnull==a?b:this.add(a-b,"d")}functionoc(){returnthis.hours()%12||12}functionpc(){returnthis.hours()||24}functionqc(a,b){R(a,0,0,function(){returnthis.localeData().meridiem(this.hours(),this.minutes(),b)})}functionrc(a,b){returnb._meridiemParse}functionsc(a){return"p"===(a+"").toLowerCase().charAt(0)}functiontc(a,b,c){returna>11?c?"pm":"PM":c?"am":"AM"}functionuc(a,b){b[Sd]=r(1e3*("0."+a))}functionvc(){returnthis._isUTC?"UTC":""}functionwc(){returnthis._isUTC?"Coordinated Universal Time":""}functionxc(a){returnKa(1e3*a)}functionyc(){returnKa.apply(null,arguments).parseZone()}functionzc(a,b,c){vard=this._calendar[a];returnw(d)?d.call(b,c):d}functionAc(a){varb=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];returnb||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){returna.slice(1)}),this._longDateFormat[a])}functionBc(){returnthis._invalidDate}functionCc(a){returnthis._ordinal.replace("%d",a)}functionDc(a){returna}functionEc(a,b,c,d){vare=this._relativeTime[c];returnw(e)?e(a,b,c,d):e.replace(/%d/i,a)}functionFc(a,b){varc=this._relativeTime[a>0?"future":"past"];returnw(c)?c(b):c.replace(/%s/i,b)}functionGc(a,b,c,d){vare=H(),f=h().set(d,b);returne[c](f,a)}functionHc(a,b,c){if("number"==typeofa&&(b=a,a=void0),a=a||"",null!=b)returnGc(a,b,c,"month");vard,e=[];for(d=0;12>d;d++)e[d]=Gc(a,d,c,"month");returne}functionIc(a,b,c,d){"boolean"==typeofa?("number"==typeofb&&(c=b,b=void0),b=b||""):(b=a,c=b,a=!1,"number"==typeofb&&(c=b,b=void0),b=b||"");vare=H(),f=a?e._week.dow:0;if(null!=c)returnGc(b,(c+f)%7,d,"day");varg,h=[];for(g=0;7>g;g++)h[g]=Gc(b,(g+f)%7,d,"day");returnh}functionJc(a,b){returnHc(a,b,"months")}functionKc(a,b){returnHc(a,b,"monthsShort")}functionLc(a,b,c){returnIc(a,b,c,"weekdays")}functionMc(a,b,c){returnIc(a,b,c,"weekdaysShort")}functionNc(a,b,c){returnIc(a,b,c,"weekdaysMin")}functionOc(){vara=this._data;returnthis._milliseconds=Le(this._milliseconds),this._days=Le(this._days),this._months=Le(this._months),a.milliseconds=Le(a.milliseconds),a.seconds=Le(a.seconds),a.minutes=Le(a.minutes),a.hours=Le(a.hours),a.months=Le(a.months),a.years=Le(a.years),this}functionPc(a,b,c,d){vare=db(b,c);returna._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}functionQc(a,b){returnPc(this,a,b,1)}functionRc(a,b){returnPc(this,a,b,-1)}functionSc(a){return0>a?Math.floor(a):Math.ceil(a)}functionTc(){vara,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;returnf>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Sc(Vc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Uc(g)),h+=e,g-=Sc(Vc(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}functionUc(a){return4800*a/146097}functionVc(a){return146097*a/4800}functionWc(a){varb,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)returnb=this._days+d/864e5,c=this._months+Uc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Vc(this._months)),a){case"week":returnb/7+d/6048e5;case"day":returnb+d/864e5;case"hour":return24*b+d/36e5;case"minute":return1440*b+d/6e4;case"second":return86400*b+d/1e3;case"millisecond":returnMath.floor(864e5*b)+d;default:thrownewError("Unknown unit "+a)}}functionXc(){returnthis._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}functionYc(a){returnfunction(){returnthis.as(a)}}functionZc(a){returna=K(a),this[a+"s"]()}function$c(a){returnfunction(){returnthis._data[a]}}function_c(){returnq(this.days()/7)}functionad(a,b,c,d,e){returne.relativeTime(b||1,!!c,a,d)}functionbd(a,b,c){vard=db(a).abs(),e=_e(d.as("s")),f=_e(d.as("m")),g=_e(d.as("h")),h=_e(d.as("d")),i=_e(d.as("M")),j=_e(d.as("y")),k=e<af.s&&["s",e]||1>=f&&["m"]||f<af.m&&["mm",f]||1>=g&&["h"]||g<af.h&&["hh",g]||1>=h&&["d"]||h<af.d&&["dd",h]||1>=i&&["M"]||i<af.M&&["MM",i]||1>=j&&["y"]||["yy",j];
returnk[2]=b,k[3]=+a>0,k[4]=c,ad.apply(null,k)}functioncd(a,b){returnvoid0===af[a]?!1:void0===b?af[a]:(af[a]=b,!0)}functiondd(a){varb=this.localeData(),c=bd(this,!a,b);returna&&(c=b.pastFuture(+this,c)),b.postformat(c)}functioned(){vara,b,c,d=bf(this._milliseconds)/1e3,e=bf(this._days),f=bf(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;varg=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();returnm?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}varfd,gd;gd=Array.prototype.some?Array.prototype.some:function(a){for(varb=Object(this),c=b.length>>>0,d=0;c>d;d++)if(dinb&&a.call(this,b[d],d,b))return!0;return!1};varhd=a.momentProperties=[],id=!1,jd={};a.suppressDeprecationWarnings=!1,a.deprecationHandler=null;varkd;kd=Object.keys?Object.keys:function(a){varb,c=[];for(bina)f(a,b)&&c.push(b);returnc};varld,md,nd={},od={},pd=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,qd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,rd={},sd={},td=/\d/,ud=/\d\d/,vd=/\d{3}/,wd=/\d{4}/,xd=/[+-]?\d{6}/,yd=/\d\d?/,zd=/\d\d\d\d?/,Ad=/\d\d\d\d\d\d?/,Bd=/\d{1,3}/,Cd=/\d{1,4}/,Dd=/[+-]?\d{1,6}/,Ed=/\d+/,Fd=/[+-]?\d+/,Gd=/Z|[+-]\d\d:?\d\d/gi,Hd=/Z|[+-]\d\d(?::?\d\d)?/gi,Id=/[+-]?\d+(\.\d{1,3})?/,Jd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Kd={},Ld={},Md=0,Nd=1,Od=2,Pd=3,Qd=4,Rd=5,Sd=6,Td=7,Ud=8;md=Array.prototype.indexOf?Array.prototype.indexOf:function(a){varb;for(b=0;b<this.length;++b)if(this[b]===a)returnb;return-1},R("M",["MM",2],"Mo",function(){returnthis.month()+1}),R("MMM",0,0,function(a){returnthis.localeData().monthsShort(this,a)}),R("MMMM",0,0,function(a){returnthis.localeData().months(this,a)}),J("month","M"),W("M",yd),W("MM",yd,ud),W("MMM",function(a,b){returnb.monthsShortRegex(a)}),W("MMMM",function(a,b){returnb.monthsRegex(a)}),$(["M","MM"],function(a,b){b[Nd]=r(a)-1}),$(["MMM","MMMM"],function(a,b,c,d){vare=c._locale.monthsParse(a,d,c._strict);null!=e?b[Nd]=e:j(c).invalidMonth=a});varVd=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Wd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Xd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Yd=Jd,Zd=Jd,$d=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,_d=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,ae=/Z|[+-]\d\d(?::?\d\d)?/,be=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],ce=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],de=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=u("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=newDate(a._i+(a._useUTC?" UTC":""))}),R("Y",0,0,function(){vara=this.year();return9999>=a?""+a:"+"+a}),R(0,["YY",2],0,function(){returnthis.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),J("year","y"),W("Y",Fd),W("YY",yd,ud),W("YYYY",Cd,wd),W("YYYYY",Dd,xd),W("YYYYYY",Dd,xd),$(["YYYYY","YYYYYY"],Md),$("YYYY",function(b,c){c[Md]=2===b.length?a.parseTwoDigitYear(b):r(b)}),$("YY",function(b,c){c[Md]=a.parseTwoDigitYear(b)}),$("Y",function(a,b){b[Md]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){returnr(a)+(r(a)>68?1900:2e3)};varee=M("FullYear",!0);a.ISO_8601=function(){};varfe=u("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){vara=Ka.apply(null,arguments);returnthis.isValid()&&a.isValid()?this>a?this:a:l()}),ge=u("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){vara=Ka.apply(null,arguments);returnthis.isValid()&&a.isValid()?a>this?this:a:l()}),he=function(){returnDate.now?Date.now():+newDate};Qa("Z",":"),Qa("ZZ",""),W("Z",Hd),W("ZZ",Hd),$(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ra(Hd,a)});varie=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};varje=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,ke=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;db.fn=Oa.prototype;varle=ib(1,"add"),me=ib(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";varne=u("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){returnvoid0===a?this.localeData():this.locale(a)});R(0,["gg",2],0,function(){returnthis.weekYear()%100}),R(0,["GG",2],0,function(){returnthis.isoWeekYear()%100}),Pb("gggg","weekYear"),Pb("ggggg","weekYear"),Pb("GGGG","isoWeekYear"),Pb("GGGGG","isoWeekYear"),J("weekYear","gg"),J("isoWeekYear","GG"),W("G",Fd),W("g",Fd),W("GG",yd,ud),W("gg",yd,ud),W("GGGG",Cd,wd),W("gggg",Cd,wd),W("GGGGG",Dd,xd),W("ggggg",Dd,xd),_(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),_(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),R("Q",0,"Qo","quarter"),J("quarter","Q"),W("Q",td),$("Q",function(a,b){b[Nd]=3*(r(a)-1)}),R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),J("week","w"),J("isoWeek","W"),W("w",yd),W("ww",yd,ud),W("W",yd),W("WW",yd,ud),_(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});varoe={dow:0,doy:6};R("D",["DD",2],"Do","date"),J("date","D"),W("D",yd),W("DD",yd,ud),W("Do",function(a,b){returna?b._ordinalParse:b._ordinalParseLenient}),$(["D","DD"],Od),$("Do",function(a,b){b[Od]=r(a.match(yd)[0],10)});varpe=M("Date",!0);R("d",0,"do","day"),R("dd",0,0,function(a){returnthis.localeData().weekdaysMin(this,a)}),R("ddd",0,0,function(a){returnthis.localeData().weekdaysShort(this,a)}),R("dddd",0,0,function(a){returnthis.localeData().weekdays(this,a)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),J("day","d"),J("weekday","e"),J("isoWeekday","E"),W("d",yd),W("e",yd),W("E",yd),W("dd",function(a,b){returnb.weekdaysMinRegex(a)}),W("ddd",function(a,b){returnb.weekdaysShortRegex(a)}),W("dddd",function(a,b){returnb.weekdaysRegex(a)}),_(["dd","ddd","dddd"],function(a,b,c,d){vare=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),_(["d","e","E"],function(a,b,c,d){b[d]=r(a)});varqe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),re="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),se="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),te=Jd,ue=Jd,ve=Jd;R("DDD",["DDDD",3],"DDDo","dayOfYear"),J("dayOfYear","DDD"),W("DDD",Bd),W("DDDD",vd),$(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),R("H",["HH",2],0,"hour"),R("h",["hh",2],0,oc),R("k",["kk",2],0,pc),R("hmm",0,0,function(){return""+oc.apply(this)+Q(this.minutes(),2)}),R("hmmss",0,0,function(){return""+oc.apply(this)+Q(this.minutes(),2)+Q(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+Q(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+Q(this.minutes(),2)+Q(this.seconds(),2)}),qc("a",!0),qc("A",!1),J("hour","h"),W("a",rc),W("A",rc),W("H",yd),W("h",yd),W("HH",yd,ud),W("hh",yd,ud),W("hmm",zd),W("hmmss",Ad),W("Hmm",zd),W("Hmmss",Ad),$(["H","HH"],Pd),$(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),$(["h","hh"],function(a,b,c){b[Pd]=r(a),j(c).bigHour=!0}),$("hmm",function(a,b,c){vard=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d)),j(c).bigHour=!0}),$("hmmss",function(a,b,c){vard=a.length-4,e=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d,2)),b[Rd]=r(a.substr(e)),j(c).bigHour=!0}),$("Hmm",function(a,b,c){vard=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d))}),$("Hmmss",function(a,b,c){vard=a.length-4,e=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d,2)),b[Rd]=r(a.substr(e))});varwe=/[ap]\.?m?\.?/i,xe=M("Hours",!0);R("m",["mm",2],0,"minute"),J("minute","m"),W("m",yd),W("mm",yd,ud),$(["m","mm"],Qd);varye=M("Minutes",!1);R("s",["ss",2],0,"second"),J("second","s"),W("s",yd),W("ss",yd,ud),$(["s","ss"],Rd);varze=M("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return1e6*this.millisecond()}),J("millisecond","ms"),W("S",Bd,td),W("SS",Bd,ud),W("SSS",Bd,vd);varAe;for(Ae="SSSS";Ae.length<=9;Ae+="S")W(Ae,Ed);for(Ae="S";Ae.length<=9;Ae+="S")$(Ae,uc);varBe=M("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");varCe=o.prototype;Ce.add=le,Ce.calendar=kb,Ce.clone=lb,Ce.diff=sb,Ce.endOf=Eb,Ce.format=wb,Ce.from=xb,Ce.fromNow=yb,Ce.to=zb,Ce.toNow=Ab,Ce.get=P,Ce.invalidAt=Nb,Ce.isAfter=mb,Ce.isBefore=nb,Ce.isBetween=ob,Ce.isSame=pb,Ce.isSameOrAfter=qb,Ce.isSameOrBefore=rb,Ce.isValid=Lb,Ce.lang=ne,Ce.locale=Bb,Ce.localeData=Cb,Ce.max=ge,Ce.min=fe,Ce.parsingFlags=Mb,Ce.set=P,Ce.startOf=Db,Ce.subtract=me,Ce.toArray=Ib,Ce.toObject=Jb,Ce.toDate=Hb,Ce.toISOString=vb,Ce.toJSON=Kb,Ce.toString=ub,Ce.unix=Gb,Ce.valueOf=Fb,Ce.creationData=Ob,Ce.year=ee,Ce.isLeapYear=ta,Ce.weekYear=Qb,Ce.isoWeekYear=Rb,Ce.quarter=Ce.quarters=Wb,Ce.month=ha,Ce.daysInMonth=ia,Ce.week=Ce.weeks=$b,Ce.isoWeek=Ce.isoWeeks=_b,Ce.weeksInYear=Tb,Ce.isoWeeksInYear=Sb,Ce.date=pe,Ce.day=Ce.days=gc,Ce.weekday=hc,Ce.isoWeekday=ic,Ce.dayOfYear=nc,Ce.hour=Ce.hours=xe,Ce.minute=Ce.minutes=ye,Ce.second=Ce.seconds=ze,Ce.millisecond=Ce.milliseconds=Be,Ce.utcOffset=Ua,Ce.utc=Wa,Ce.local=Xa,Ce.parseZone=Ya,Ce.hasAlignedHourOffset=Za,Ce.isDST=$a,Ce.isDSTShifted=_a,Ce.isLocal=ab,Ce.isUtcOffset=bb,Ce.isUtc=cb,Ce.isUTC=cb,Ce.zoneAbbr=vc,Ce.zoneName=wc,Ce.dates=u("dates accessor is deprecated. Use date instead.",pe),Ce.months=u("months accessor is deprecated. Use month instead",ha),Ce.years=u("years accessor is deprecated. Use year instead",ee),Ce.zone=u("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Va);varDe=Ce,Ee={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Fe={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Ge="Invalid date",He="%d",Ie=/\d{1,2}/,Je={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Ke=A.prototype;Ke._calendar=Ee,Ke.calendar=zc,Ke._longDateFormat=Fe,Ke.longDateFormat=Ac,Ke._invalidDate=Ge,Ke.invalidDate=Bc,Ke._ordinal=He,Ke.ordinal=Cc,Ke._ordinalParse=Ie,Ke.preparse=Dc,Ke.postformat=Dc,Ke._relativeTime=Je,Ke.relativeTime=Ec,Ke.pastFuture=Fc,Ke.set=y,Ke.months=ca,Ke._months=Wd,Ke.monthsShort=da,Ke._monthsShort=Xd,Ke.monthsParse=fa,Ke._monthsRegex=Zd,Ke.monthsRegex=ka,Ke._monthsShortRegex=Yd,Ke.monthsShortRegex=ja,Ke.week=Xb,Ke._week=oe,Ke.firstDayOfYear=Zb,Ke.firstDayOfWeek=Yb,Ke.weekdays=bc,Ke._weekdays=qe,Ke.weekdaysMin=dc,Ke._weekdaysMin=se,Ke.weekdaysShort=cc,Ke._weekdaysShort=re,Ke.weekdaysParse=fc,Ke._weekdaysRegex=te,Ke.weekdaysRegex=jc,Ke._weekdaysShortRegex=ue,Ke.weekdaysShortRegex=kc,Ke._weekdaysMinRegex=ve,Ke.weekdaysMinRegex=lc,Ke.isPM=sc,Ke._meridiemParse=we,Ke.meridiem=tc,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){varb=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";returna+c}}),a.lang=u("moment.lang is deprecated. Use moment.locale instead.",E),a.langData=u("moment.langData is deprecated. Use moment.localeData instead.",H);varLe=Math.abs,Me=Yc("ms"),Ne=Yc("s"),Oe=Yc("m"),Pe=Yc("h"),Qe=Yc("d"),Re=Yc("w"),Se=Yc("M"),Te=Yc("y"),Ue=$c("milliseconds"),Ve=$c("seconds"),We=$c("minutes"),Xe=$c("hours"),Ye=$c("days"),Ze=$c("months"),$e=$c("years"),_e=Math.round,af={s:45,m:45,h:22,d:26,M:11},bf=Math.abs,cf=Oa.prototype;cf.abs=Oc,cf.add=Qc,cf.subtract=Rc,cf.as=Wc,cf.asMilliseconds=Me,cf.asSeconds=Ne,cf.asMinutes=Oe,cf.asHours=Pe,cf.asDays=Qe,cf.asWeeks=Re,cf.asMonths=Se,cf.asYears=Te,cf.valueOf=Xc,cf._bubble=Tc,cf.get=Zc,cf.milliseconds=Ue,cf.seconds=Ve,cf.minutes=We,cf.hours=Xe,cf.days=Ye,cf.weeks=_c,cf.months=Ze,cf.years=$e,cf.humanize=dd,cf.toISOString=ed,cf.toString=ed,cf.toJSON=ed,cf.locale=Bb,cf.localeData=Cb,cf.toIsoString=u("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ed),cf.lang=ne,R("X",0,0,"unix"),R("x",0,0,"valueOf"),W("x",Fd),W("X",Id),$("X",function(a,b,c){c._d=newDate(1e3*parseFloat(a,10))}),$("x",function(a,b,c){c._d=newDate(r(a))}),a.version="2.13.0",b(Ka),a.fn=De,a.min=Ma,a.max=Na,a.now=he,a.utc=h,a.unix=xc,a.months=Jc,a.isDate=d,a.locale=E,a.invalid=l,a.duration=db,a.isMoment=p,a.weekdays=Lc,a.parseZone=yc,a.localeData=H,a.isDuration=Pa,a.monthsShort=Kc,a.weekdaysMin=Nc,a.defineLocale=F,a.updateLocale=G,a.locales=I,a.weekdaysShort=Mc,a.normalizeUnits=K,a.relativeTimeThreshold=cd,a.prototype=De;vardf=a;returndf}),function(a,b,c){"use strict";functiond(a){varb,c=[];if(void0===a)returnvoid0;for(Array.isArray(a)||(a=[a]),b=0;b<a.length;b+=1)"object"==typeofa[b]?c[b]=a[b].content:c[b]=a[b];returnc}functione(a,b){varc;if("descending"===b)c=1;else{if("ascending"!==b)thrownewTypeError("Query.sortFunction(): Argument 2 must be 'ascending' or 'descending'");c=-1}returnfunction(b,e){varf,g;for(b=d(b[a])||[],e=d(e[a])||[],g=b.length>e.length?b.length:e.length,f=0;g>f;f+=1){if(void0===b[f])returnc;if(void0===e[f])return-c;if(b[f]>e[f])return-c;if(b[f]<e[f])returnc}return0}}functionf(a,b){varc;if(!Array.isArray(a))thrownewTypeError("jioquery.sortOn(): Argument 1 is not of type 'array'");for(c=a.length-1;c>=0;c-=1)b.sort(e(a[c][0],a[c][1]));returnb}functiong(a,b){if(!Array.isArray(a))thrownewTypeError("jioquery.limit(): Argument 1 is not of type 'array'");if(!Array.isArray(b))thrownewTypeError("jioquery.limit(): Argument 2 is not of type 'array'");returnb.splice(0,a[0]),a[1]&&b.splice(a[1]),b}functionh(a,b){varc,d,e;if(!Array.isArray(a))thrownewTypeError("jioquery.select(): Argument 1 is not of type Array");if(!Array.isArray(b))thrownewTypeError("jioquery.select(): Argument 2 is not of type Array");for(c=0;c<b.length;c+=1){for(e={},d=0;d<a.length;d+=1)b[c].hasOwnProperty([a[d]])&&(e[a[d]]=b[c][a[d]]);for(dine)if(e.hasOwnProperty(d)){b[c]=e;break}}returnb}functioni(){}functionj(){}functionk(a){returna.replace(t,"\\$&")}functionl(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{configurable:!0,enumerable:!1,writable:!0,value:a}})}functionm(a,b){if("string"!=typeofa)thrownewTypeError("jioquery.searchTextToRegExp(): Argument 1 is not of type 'string'");returnb===!1?newRegExp("^"+k(a)+"$"):newRegExp("^"+k(a).replace(u,"[\\s\\S]*").replace(v,".")+"$")}functionn(a,b){i.call(this),this.operator=a.operator,this.query_list=a.query_list||[],this.query_list=this.query_list.map(function(a){returnj.create(a,b)})}functiono(a){varb=[];if("complex"===a.type)returnb.push("("),(a.query_list||[]).forEach(function(c){b.push(o(c)),b.push(a.operator)}),b.length-=1,b.push(")"),b.join("");if("simple"===a.type)return(a.key?a.key+": ":"")+(a.operator||"")+' "'+a.value+'"';thrownewTypeError("This object is not a query")}functionp(a){varb;if(void0!==a){if("object"!=typeofa)thrownewTypeError("SimpleQuery().create(): key_schema is not of type 'object'");if(void0===a.key_set)thrownewTypeError("SimpleQuery().create(): key_schema has no 'key_set' property");for(bina)if(a.hasOwnProperty(b))switch(b){case"key_set":case"cast_lookup":case"match_lookup":break;default:thrownewTypeError("SimpleQuery().create(): key_schema has unknown property '"+b+"'")}}}functionq(a,b){i.call(this),p(b),this._key_schema=b||{},this.operator=a.operator,this.key=a.key,this.value=a.value}functionr(a){varb;if(void0===a.read_from)thrownewTypeError("Custom key is missing the read_from property");for(bina)if(a.hasOwnProperty(b))switch(b){case"read_from":case"cast_to":case"equal_match":break;default:thrownewTypeError("Custom key has unknown property '"+b+"'")}}vars={},t=/[\-\[\]{}()*+?.,\\\^$|#\s]/g,u=/%/g,v=/_/g,w=/^(?:AND|OR|NOT)$/i,x=/^(?:!?=|<=?|>=?)$/i;i.prototype.exec=function(b,c){if(!Array.isArray(b))thrownewTypeError("Query().exec(): Argument 1 is not of type 'array'");if(void0===c&&(c={}),"object"!=typeofc)thrownewTypeError("Query().exec(): Optional argument 2 is not of type 'object'");vard,e=this;for(d=b.length-1;d>=0;d-=1)e.match(b[d])||b.splice(d,1);returnc.sort_on&&f(c.sort_on,b),c.limit&&g(c.limit,b),h(c.select_list||[],b),(newa.Queue).push(function(){returnb})},i.prototype.match=function(){return!0},i.prototype.parse=function(b){functionc(b,d){functionf(a){i.push(function(){returnb.parsed=h.query_list[a],c(b,d)}).push(function(){h.query_list[a]=b.parsed})}varg,h=b.parsed,i=newa.Queue;if("complex"===h.type){for(g=0;g<h.query_list.length;g+=1)f(g);returni.push(function(){returnb.parsed=h,e.onParseComplexQuery(b,d)})}return"simple"===h.type?e.onParseSimpleQuery(b,d):void0}vard,e=this;returnd={parsed:JSON.parse(JSON.stringify(e.serialized()))},(newa.Queue).push(function(){returne.onParseStart(d,b)}).push(function(){returnc(d,b)}).push(function(){returne.onParseEnd(d,b)}).push(function(){returnd.parsed})},i.prototype.toString=function(){return""},i.prototype.serialized=function(){returnvoid0},l(n,i),n.prototype.operator="AND",n.prototype.type="complex",n.prototype.match=function(a){varb=this.operator;returnw.test(b)||(b="AND"),this[b.toUpperCase()](a)},n.prototype.toString=function(){vara=[],b=this.operator;return"NOT"===this.operator?(a.push("NOT ("),a.push(this.query_list[0].toString()),a.push(")"),a.join("")):(this.query_list.forEach(function(c){a.push("("),a.push(c.toString()),a.push(")"),a.push(b)}),a.length-=1,a.join(""))},n.prototype.serialized=function(){vara={type:"complex",operator:this.operator,query_list:[]};returnthis.query_list.forEach(function(b){a.query_list.push("function"==typeofb.toJSON?b.toJSON():b)}),a},n.prototype.toJSON=n.prototype.serialized,n.prototype.AND=function(a){for(varb=!0,c=0;b&&c!==this.query_list.length;)b=this.query_list[c].match(a),c+=1;returnb},n.prototype.OR=function(a){for(varb=!1,c=0;!b&&c!==this.query_list.length;)b=this.query_list[c].match(a),c+=1;returnb},n.prototype.NOT=function(a){return!this.query_list[0].match(a)},j.create=function(a,b){if(""===a)returnnewi;if("string"==typeofa&&(a=c(a)),"string"==typeof(a||{}).type&&s[a.type])returnnews[a.type](a,b);thrownewTypeError("QueryFactory.create(): Argument 1 is not a search text or a parsable object")},l(q,i),q.prototype.type="simple",q.prototype.match=function(a){varb,c=null,d=null,e=null,f=null,g=this.operator,h=null,i=this.key;if(x.test(g)||(g=u.test(this.value)?"like":"="),f=this[g],this._key_schema.key_set&&void0!==this._key_schema.key_set[i]&&(i=this._key_schema.key_set[i]),""===i){f=this.like,h="%"+this.value+"%";for(bina)if(a.hasOwnProperty(b)&&"__id"!==b&&f(a[b],h)===!0)return!0;return!1}if("object"==typeofi){if(r(i),c=a[i.read_from],d=i.equal_match,"string"==typeofd&&(d=this._key_schema.match_lookup[d]),void0!==d&&(f="="===g||"like"===g?d:f),h=this.value,e=i.cast_to){"string"==typeofe&&(e=this._key_schema.cast_lookup[e]);try{h=e(h)}catch(j){h=void0}try{c=e(c)}catch(j){c=void0}}}elsec=a[i],h=this.value;returnvoid0===c||void0===h?!1:f(c,h)},q.prototype.toString=function(){return(this.key?this.key+":":"")+(this.operator?""+this.operator:"")+' "'+this.value+'"'},q.prototype.serialized=function(){vara={type:"simple",key:this.key,value:this.value};returnvoid0!==this.operator&&(a.operator=this.operator),a},q.prototype.toJSON=q.prototype.serialized,q.prototype["="]=function(a,b){varc,d;for(Array.isArray(a)||(a=[a]),d=0;d<a.length;d+=1){if(c=a[d],"object"==typeofc&&c.hasOwnProperty("content")&&(c=c.content),"function"==typeofc.cmp)return0===c.cmp(b);if(b.toString()===c.toString())return!0}return!1},q.prototype.like=function(a,b){varc,d;for(Array.isArray(a)||(a=[a]),d=0;d<a.length;d+=1){if(c=a[d],"object"==typeofc&&c.hasOwnProperty("content")&&(c=c.content),"function"==typeofc.cmp)return0===c.cmp(b);if(m(b.toString()).test(c.toString()))return!0}return!1},q.prototype["!="]=function(a,b){varc,d;for(Array.isArray(a)||(a=[a]),d=0;d<a.length;d+=1){if(c=a[d],"object"==typeofc&&c.hasOwnProperty("content")&&(c=c.content),"function"==typeofc.cmp)return0!==c.cmp(b);if(b.toString()===c.toString())return!1}return!0},q.prototype["<"]=function(a,b){varc;returnArray.isArray(a)||(a=[a]),c=a[0],"object"==typeofc&&c.hasOwnProperty("content")&&(c=c.content),"function"==typeofc.cmp?c.cmp(b)<0:b>c},q.prototype["<="]=function(a,b){varc;returnArray.isArray(a)||(a=[a]),c=a[0],"object"==typeofc&&c.hasOwnProperty("content")&&(c=c.content),"function"==typeofc.cmp?c.cmp(b)<=0:b>=c},q.prototype[">"]=function(a,b){varc;returnArray.isArray(a)||(a=[a]),c=a[0],"object"==typeofc&&c.hasOwnProperty("content")&&(c=c.content),"function"==typeofc.cmp?c.cmp(b)>0:c>b},q.prototype[">="]=function(a,b){varc;returnArray.isArray(a)||(a=[a]),c=a[0],"object"==typeofc&&c.hasOwnProperty("content")&&(c=c.content),"function"==typeofc.cmp?c.cmp(b)>=0:c>=b},s.simple=q,s.complex=n,i.parseStringToObject=c,i.objectToSearchText=o,b.Query=i,b.SimpleQuery=q,b.ComplexQuery=n,b.QueryFactory=j}(RSVP,window,parseStringToObject),function(a,b){"use strict";varc,d="year",e="month",f="day",g="hour",h="minute",i="second",j="millisecond",k={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},l=function(a,b){returnk[a]<k[b]?a:b};c=function(a){if(!(thisinstanceofc))returnnewc(a);if(ainstanceofc)returnthis.mom=a.mom.clone(),void(this._precision=a._precision);if(void0===a)returnthis.mom=b(),voidthis.setPrecision(j);if(this.mom=null,this._str=a,a.match(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+\-][0-2]\d:[0-5]\d|Z)/)||a.match(/\d\d\d\d-\d\d-\d\d\d\d:\d\d:\d\d\.\d\d\d/)?(this.mom=b(a),this.setPrecision(j)):a.match(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+\-][0-2]\d:[0-5]\d|Z)/)||a.match(/\d\d\d\d-\d\d-\d\d\d\d:\d\d:\d\d/)?(this.mom=b(a),this.setPrecision(i)):a.match(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+\-][0-2]\d:[0-5]\d|Z)/)||a.match(/\d\d\d\d-\d\d-\d\d\d\d:\d\d/)?(this.mom=b(a),this.setPrecision(h)):a.match(/\d\d\d\d-\d\d-\d\d\d\d/)?(this.mom=b(a),this.setPrecision(g)):a.match(/\d\d\d\d-\d\d-\d\d/)?(this.mom=b(a),this.setPrecision(f)):a.match(/\d\d\d\d-\d\d/)?(this.mom=b(a),this.setPrecision(e)):a.match(/\d\d\d\d/)&&(this.mom=b(a,"YYYY"),this.setPrecision(d)),!this.mom)thrownewError("Cannot parse: "+a)},c.prototype.setPrecision=function(a){this._precision=a},c.prototype.getPrecision=function(){returnthis._precision},c.prototype.cmp=function(a){varb=this.mom,c=a.mom,d=l(this._precision,a._precision);returnb.isBefore(c,d)?-1:b.isSame(c,d)?0:1},c.prototype.toPrecisionString=function(a){varb;if(a=a||this._precision,b={millisecond:"YYYY-MM-DD HH:mm:ss.SSS",second:"YYYY-MM-DD HH:mm:ss",minute:"YYYY-MM-DD HH:mm",hour:"YYYY-MM-DD HH",day:"YYYY-MM-DD",month:"YYYY-MM",year:"YYYY"}[a],!b)thrownewTypeError("Unsupported precision value '"+a+"'");returnthis.mom.format(b)},c.prototype.toString=function(){returnthis._str},a.jiodate={JIODate:c,YEAR:d,MONTH:e,DAY:f,HOUR:g,MIN:h,SEC:i,MSEC:j}}(window,moment),function(a,b,c,d,e,f,g,h,i,j){"use strict";functionk(a,b){if(void0!==a&&"string"!=typeofa)thrownewTypeError("You must pass a string.");this.message=a||"Default Message",this.status_code=b||500}functionl(a){varc=newXMLHttpRequest;returnnewb.Promise(function(b,d,e){varf;if(c.open(a.type||"GET",a.url,!0),c.responseType=a.dataType||"","object"==typeofa.headers&&null!==a.headers)for(fina.headers)a.headers.hasOwnProperty(f)&&c.setRequestHeader(f,a.headers[f]);if(c.addEventListener("load",function(a){returna.target.status>=400?d(a):voidb(a)}),c.addEventListener("error",d),c.addEventListener("progress",e),"object"==typeofa.xhrFields&&null!==a.xhrFields)for(fina.xhrFields)a.xhrFields.hasOwnProperty(f)&&(c[f]=a.xhrFields[f]);"function"==typeofa.beforeSend&&a.beforeSend(c),c.send(a.data)},function(){c.abort()})}functionm(a,c){vard=newg;returnnewb.Promise(function(b,e,f){d.addEventListener("load",b),d.addEventListener("error",e),d.addEventListener("progress",f),d.readAsText(a,c)},function(){d.abort()})}functionn(a){varc=newg;returnnewb.Promise(function(b,d,e){c.addEventListener("load",b),c.addEventListener("error",d),c.addEventListener("progress",e),c.readAsArrayBuffer(a)},function(){c.abort()})}functiono(a){varc=newg;returnnewb.Promise(function(b,d,e){c.addEventListener("load",b),c.addEventListener("error",d),c.addEventListener("progress",e),c.readAsDataURL(a)},function(){c.abort()})}functionp(a){varb,c,d,e,f;if(void0===a)returnvoid0;if(a.constructor===Object){for(c=Object.keys(a).sort(),f=[],d=0;d<c.length;d+=1)b=c[d],e=p(a[b]),void0!==e&&f.push(p(b)+":"+e);return"{"+f.join(",")+"}"}if(a.constructor===Array){for(f=[],d=0;d<a.length;d+=1)f.push(p(a[d]));return"["+f.join(",")+"]"}returnJSON.stringify(a)}functionq(a){if("data:"===a)returnnewc;varb,d=f(a.split(",")[1]),e=a.split(",")[0].split(":")[1],g=newh(d.length),j=newi(g);for(e=e.slice(0,e.length-";base64".length),b=0;b<d.length;b+=1)j[b]=d.charCodeAt(b);returnnewc([g],{type:e})}functionr(a,b,c){if("string"!=typeofa[0]||""===a[0])throwneww.util.jIOError("Document id must be a non empty string on '"+b.__type+"."+c+"'.",400)}functions(a,b,c){if("string"!=typeofa[1]||""===a[1])throwneww.util.jIOError("Attachment id must be a non empty string on '"+b.__type+"."+c+"'.",400)}functiont(a,c,d,e){returna.prototype[c]=function(){vara,f=arguments,g=this;return(newb.Queue).push(function(){returnvoid0!==d?d.apply(g.__storage,[f,g,c]):void0}).push(function(b){vard=g.__storage[c];if(a=b,void0===d)throwneww.util.jIOError("Capacity '"+c+"' is not implemented on '"+g.__type+"'",501);returnd.apply(g.__storage,f)}).push(function(b){returnvoid0!==e?e.call(g,f,b,a):b})},this}functionu(a,b){returnthisinstanceofu?(this.__type=a,void(this.__storage=b)):newu}functionv(){returnthisinstanceofv?void(this.__storage_types={}):newv}void0===a.openDatabase&&(a.openDatabase=function(){thrownewError("WebSQL is not supported by "+j.userAgent)}),void0===a.DOMError&&(a.DOMError={});varw,x={};k.prototype=newError,k.prototype.constructor=k,x.jIOError=k,x.ajax=l,x.readBlobAsText=m,x.readBlobAsArrayBuffer=n,x.readBlobAsDataURL=o,x.stringify=p,x.dataURItoBlob=q,t(u,"put",r,function(a){returna[0]}),t(u,"get",r),t(u,"bulk"),t(u,"remove",r,function(a){returna[0]}),u.prototype.post=function(){vara=this,c=arguments;return(newb.Queue).push(function(){varb=a.__storage.post;if(void0===b)throwneww.util.jIOError("Capacity 'post' is not implemented on '"+a.__type+"'",501);returna.__storage.post.apply(a.__storage,c)})},t(u,"putAttachment",function(a,b,d){r(a,b,d),s(a,b,d);vare=a[3]||{};if("string"==typeofa[2])a[2]=newc([a[2]],{type:e._content_type||e._mimetype||"text/plain;charset=utf-8"});elseif(!(a[2]instanceofc))throwneww.util.jIOError("Attachment content is not a blob",400)}),t(u,"removeAttachment",function(a,b,c){r(a,b,c),s(a,b,c)}),t(u,"getAttachment",function(a,b,c){vard="blob";returnr(a,b,c),s(a,b,c),void0!==a[2]&&(d=a[2].format||d,deletea[2].format),d},function(a,d,e){varf;if(!(dinstanceofc))throwneww.util.jIOError("'getAttachment' ("+a[0]+" , "+a[1]+") on '"+this.__type+"' does not return a Blob.",501);if("blob"===e)f=d;elseif("data_url"===e)f=(newb.Queue).push(function(){returnw.util.readBlobAsDataURL(d)}).push(function(a){returna.target.result});elseif("array_buffer"===e)f=(newb.Queue).push(function(){returnw.util.readBlobAsArrayBuffer(d)}).push(function(a){returna.target.result});elseif("text"===e)f=(newb.Queue).push(function(){returnw.util.readBlobAsText(d)}).push(function(a){returna.target.result});else{if("json"!==e)throwneww.util.jIOError(this.__type+".getAttachment format: '"+e+"' is not supported",400);f=(newb.Queue).push(function(){returnw.util.readBlobAsText(d)}).push(function(a){returnJSON.parse(a.target.result)})}returnf}),u.prototype.buildQuery=function(){vara=this.__storage.buildQuery,c=this,d=arguments;if(void0===a)throwneww.util.jIOError("Capacity 'buildQuery' is not implemented on '"+this.__type+"'",501);return(newb.Queue).push(function(){returna.apply(c.__storage,d)})},u.prototype.hasCapacity=function(a){varb=this.__storage.hasCapacity,c=this.__storage[a];if(void0!==c)return!0;if(void0===b||!b.apply(this.__storage,arguments))throwneww.util.jIOError("Capacity '"+a+"' is not implemented on '"+this.__type+"'",501);return!0},u.prototype.allDocs=function(a){varc=this;returnvoid0===a&&(a={}),(newb.Queue).push(function(){return!c.hasCapacity("list")||void0!==a.query&&!c.hasCapacity("query")||void0!==a.sort_on&&!c.hasCapacity("sort")||void0!==a.select_list&&!c.hasCapacity("select")||void0!==a.include_docs&&!c.hasCapacity("include")||void0!==a.limit&&!c.hasCapacity("limit")?void0:c.buildQuery(a)}).push(function(a){return{data:{rows:a,total_rows:a.length}}})},t(u,"allAttachments",r),t(u,"repair"),u.prototype.repair=function(){vara=this,c=arguments;return(newb.Queue).push(function(){varb=a.__storage.repair;returnvoid0!==b?a.__storage.repair.apply(a.__storage,c):void0})},v.prototype.createJIO=function(a,b){if("string"!=typeofa.type)thrownewTypeError("Invalid storage description");if(!this.__storage_types[a.type])thrownewTypeError("Unknown storage '"+a.type+"'");returnnewu(a.type,newthis.__storage_types[a.type](a,b))},v.prototype.addStorage=function(a,b){if("string"!=typeofa)thrownewTypeError("jIO.addStorage(): Argument 1 is not of type 'string'");if("function"!=typeofb)thrownewTypeError("jIO.addStorage(): Argument 2 is not of type 'function'");if(void0!==this.__storage_types[a])thrownewTypeError("jIO.addStorage(): Storage type already exists");this.__storage_types[a]=b},v.prototype.util=x,v.prototype.QueryFactory=d,v.prototype.Query=e,w=newv,a.jIO=w}(window,RSVP,Blob,QueryFactory,Query,atob,FileReader,ArrayBuffer,Uint8Array,navigator),function(){functiona(a){"use strict";vard={fill:0},f=function(a){for(a+=9;a%64>0;a+=1);returna},g=function(a,b){for(varc=b>>2;c<a.length;c++)a[c]=0},h=function(a,b,c){a[b>>2]|=128<<24-(b%4<<3),a[((b>>2)+2&-16)+14]=c>>29,a[((b>>2)+2&-16)+15]=c<<3},i=function(a,b,c,d,e){varf,g=this,h=e%4,i=d%4,j=d-i;if(j>0)switch(h){case0:a[e+3|0]=g.charCodeAt(c);case1:a[e+2|0]=g.charCodeAt(c+1);case2:a[e+1|0]=g.charCodeAt(c+2);case3:a[0|e]=g.charCodeAt(c+3)}for(f=h;j>f;f=f+4|0)b[e+f>>2]=g.charCodeAt(c+f)<<24|g.charCodeAt(c+f+1)<<16|g.charCodeAt(c+f+2)<<8|g.charCodeAt(c+f+3);switch(i){case3:a[e+j+1|0]=g.charCodeAt(c+j+2);case2:a[e+j+2|0]=g.charCodeAt(c+j+1);case1:a[e+j+3|0]=g.charCodeAt(c+j)}},j=function(a,b,c,d,e){varf,g=this,h=e%4,i=d%4,j=d-i;if(j>0)switch(h){case0:a[e+3|0]=g[c];case1:a[e+2|0]=g[c+1];case2:a[e+1|0]=g[c+2];case3:a[0|e]=g[c+3]}for(f=4-h;j>f;f=f+=4)b[e+f>>2]=g[c+f]<<24|g[c+f+1]<<16|g[c+f+2]<<8|g[c+f+3];switch(i){case3:a[e+j+1|0]=g[c+j+2];case2:a[e+j+2|0]=g[c+j+1];case1:a[e+j+3|0]=g[c+j]}},k=function(a,b,d,e,f){varg,h=this,i=f%4,j=e%4,k=e-j,l=newUint8Array(c.readAsArrayBuffer(h.slice(d,d+e)));if(k>0)switch(i){case0:a[f+3|0]=l[0];case1:a[f+2|0]=l[1];case2:a[f+1|0]=l[2];case3:a[0|f]=l[3]}for(g=4-i;k>g;g=g+=4)b[f+g>>2]=l[g]<<24|l[g+1]<<16|l[g+2]<<8|l[g+3];switch(j){case3:a[f+k+1|0]=l[k+2];case2:a[f+k+2|0]=l[k+1];case1:a[f+k+3|0]=l[k]}},l=function(a){switch(e.getDataType(a)){case"string":returni.bind(a);case"array":returnj.bind(a);case"buffer":returnj.bind(a);case"arraybuffer":returnj.bind(newUint8Array(a));case"view":returnj.bind(newUint8Array(a.buffer,a.byteOffset,a.byteLength));case"blob":returnk.bind(a)}},m=function(a){varb,c,d="0123456789abcdef",e=[],f=newUint8Array(a);for(b=0;b<f.length;b++)c=f[b],e[b]=d.charAt(c>>4&15)+d.charAt(c>>0&15);returne.join("")},n=function(a){varb;if(65536>=a)return65536;if(16777216>a)for(b=1;a>b;b<<=1);elsefor(b=16777216;a>b;b+=16777216);returnb},o=function(a){if(a%64>0)thrownewError("Chunk size must be a multiple of 128 bit");d.maxChunkLen=a,d.padMaxChunkLen=f(a),d.heap=newArrayBuffer(n(d.padMaxChunkLen+320+20)),d.h32=newInt32Array(d.heap),d.h8=newInt8Array(d.heap),d.core=b({Int32Array:Int32Array,DataView:DataView},{},d.heap),d.buffer=null};o(a||65536);varp=function(a,b){varc=newInt32Array(a,b+320,5);c[0]=1732584193,c[1]=-271733879,c[2]=-1732584194,c[3]=271733878,c[4]=-1009589776},q=function(a,b){varc=f(a),e=newInt32Array(d.heap,0,c>>2);returng(e,a),h(e,a,b),c},r=function(a,b,c){l(a)(d.h8,d.h32,b,c,0)},s=function(a,b,c,e,f){varg=c;f&&(g=q(c,e)),r(a,b,c),d.core.hash(g,d.padMaxChunkLen)},t=function(a,b){varc=newInt32Array(a,b+320,5),d=newInt32Array(5),e=newDataView(d.buffer);returne.setInt32(0,c[0],!1),e.setInt32(4,c[1],!1),e.setInt32(8,c[2],!1),e.setInt32(12,c[3],!1),e.setInt32(16,c[4],!1),d},u=this.rawDigest=function(a){varb=a.byteLength||a.length||a.size||0;p(d.heap,d.padMaxChunkLen);varc=0,e=d.maxChunkLen;for(c=0;b>c+e;c+=e)s(a,c,e,b,!1);returns(a,c,b-c,b,!0),t(d.heap,d.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(a){returnm(u(a).buffer)}}functionb(a,b,c){"use asm";functiond(a,b){a|=0,b|=0;varc=0,d=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;for(f=e[b+320>>2]|0,h=e[b+324>>2]|0,j=e[b+328>>2]|0,l=e[b+332>>2]|0,n=e[b+336>>2]|0,c=0;(c|0)<(a|0);c=c+64|0){for(g=f,i=h,k=j,m=l,o=n,d=0;(d|0)<64;d=d+4|0)q=e[c+d>>2]|0,p=((f<<5|f>>>27)+(h&j|~h&l)|0)+((q+n|0)+1518500249|0)|0,n=l,l=j,j=h<<30|h>>>2,h=f,f=p,e[a+d>>2]=q;for(d=a+64|0;(d|0)<(a+80|0);d=d+4|0)q=(e[d-12>>2]^e[d-32>>2]^e[d-56>>2]^e[d-64>>2])<<1|(e[d-12>>2]^e[d-32>>2]^e[d-56>>2]^e[d-64>>2])>>>31,p=((f<<5|f>>>27)+(h&j|~h&l)|0)+((q+n|0)+1518500249|0)|0,n=l,l=j,j=h<<30|h>>>2,h=f,f=p,e[d>>2]=q;for(d=a+80|0;(d|0)<(a+160|0);d=d+4|0)q=(e[d-12>>2]^e[d-32>>2]^e[d-56>>2]^e[d-64>>2])<<1|(e[d-12>>2]^e[d-32>>2]^e[d-56>>2]^e[d-64>>2])>>>31,p=((f<<5|f>>>27)+(h^j^l)|0)+((q+n|0)+1859775393|0)|0,n=l,l=j,j=h<<30|h>>>2,h=f,f=p,e[d>>2]=q;for(d=a+160|0;(d|0)<(a+240|0);d=d+4|0)q=(e[d-12>>2]^e[d-32>>2]^e[d-56>>2]^e[d-64>>2])<<1|(e[d-12>>2]^e[d-32>>2]^e[d-56>>2]^e[d-64>>2])>>>31,p=((f<<5|f>>>27)+(h&j|h&l|j&l)|0)+((q+n|0)-1894007588|0)|0,n=l,l=j,j=h<<30|h>>>2,h=f,f=p,e[d>>2]=q;for(d=a+240|0;(d|0)<(a+320|0);d=d+4|0)q=(e[d-12>>2]^e[d-32>>2]^e[d-56>>2]^e[d-64>>2])<<1|(e[d-12>>2]^e[d-32>>2]^e[d-56>>2]^e[d-64>>2])>>>31,p=((f<<5|f>>>27)+(h^j^l)|0)+((q+n|0)-899497514|0)|0,n=l,l=j,j=h<<30|h>>>2,h=f,f=p,e[d>>2]=q;f=f+g|0,h=h+i|0,j=j+k|0,l=l+m|0,n=n+o|0}e[b+320>>2]=f,e[b+324>>2]=h,e[b+328>>2]=j,e[b+332>>2]=l,e[b+336>>2]=n}vare=newa.Int32Array(c);return{hash:d}}if("undefined"!=typeofmodule?module.exports=a:"undefined"!=typeofwindow&&(window.Rusha=a),"undefined"!=typeofFileReaderSync){varc=newFileReaderSync,d=newa(4194304);self.onmessage=function(a){varb,c=a.data.data;try{b=d.digest(c),self.postMessage({id:a.data.id,hash:b})}catch(e){self.postMessage({id:a.data.id,error:e.name})}}}vare={getDataType:function(a){if("string"==typeofa)return"string";if(ainstanceofArray)return"array";if("undefined"!=typeofglobal&&global.Buffer&&global.Buffer.isBuffer(a))return"buffer";if(ainstanceofArrayBuffer)return"arraybuffer";if(a.bufferinstanceofArrayBuffer)return"view";if(ainstanceofBlob)return"blob";thrownewError("Unsupported data type.")}}}(),function(a,b,c,d){"use strict";functione(a){if(void0!==a&&"string"!=typeofa)thrownewTypeError("You must pass a string.");this.message=a||"Skip some asynchronous code"}functionf(a){returnB.digestFromString(a)}functiong(a){returnB.digestFromArrayBuffer(a)}functionh(b){if(this._query_options=b.query||{},void0!==b.signature_hash_key&&(this._query_options.select_list=[b.signature_hash_key]),this._signature_hash_key=b.signature_hash_key,this._local_sub_storage=a.createJIO(b.local_sub_storage),this._remote_sub_storage=a.createJIO(b.remote_sub_storage),b.hasOwnProperty("signature_sub_storage")?(this._signature_sub_storage=a.createJIO(b.signature_sub_storage),this._custom_signature_sub_storage=!0):(this._signature_hash="_replicate_"+f(d(b.local_sub_storage)+d(b.remote_sub_storage)+d(this._query_options)),this._signature_sub_storage=a.createJIO({type:"query",sub_storage:{type:"document",document_id:this._signature_hash,sub_storage:b.local_sub_storage}}),this._custom_signature_sub_storage=!1),this._use_remote_post=b.use_remote_post||!1,this._parallel_operation_attachment_amount=b.parallel_operation_attachment_amount||1,this._parallel_operation_amount=b.parallel_operation_amount||1,this._conflict_handling=b.conflict_handling||0,this._conflict_handling!==C&&this._conflict_handling!==D&&this._conflict_handling!==E&&this._conflict_handling!==F)thrownewa.util.jIOError("Unsupported conflict handling: "+this._conflict_handling,400);this._check_local_modification=b.check_local_modification,void0===this._check_local_modification&&(this._check_local_modification=!0),this._check_local_creation=b.check_local_creation,void0===this._check_local_creation&&(this._check_local_creation=!0),this._check_local_deletion=b.check_local_deletion,void0===this._check_local_deletion&&(this._check_local_deletion=!0),this._check_remote_modification=b.check_remote_modification,void0===this._check_remote_modification&&(this._check_remote_modification=!0),this._check_remote_creation=b.check_remote_creation,void0===this._check_remote_creation&&(this._check_remote_creation=!0),this._check_remote_deletion=b.check_remote_deletion,void0===this._check_remote_deletion&&(this._check_remote_deletion=!0),this._check_local_attachment_modification=b.check_local_attachment_modification,void0===this._check_local_attachment_modification&&(this._check_local_attachment_modification=!1),this._check_local_attachment_creation=b.check_local_attachment_creation,void0===this._check_local_attachment_creation&&(this._check_local_attachment_creation=!1),this._check_local_attachment_deletion=b.check_local_attachment_deletion,void0===this._check_local_attachment_deletion&&(this._check_local_attachment_deletion=!1),this._check_remote_attachment_modification=b.check_remote_attachment_modification,void0===this._check_remote_attachment_modification&&(this._check_remote_attachment_modification=!1),this._check_remote_attachment_creation=b.check_remote_attachment_creation,void0===this._check_remote_attachment_creation&&(this._check_remote_attachment_creation=!1),this._check_remote_attachment_deletion=b.check_remote_attachment_deletion,void0===this._check_remote_attachment_deletion&&(this._check_remote_attachment_deletion=!1)}functioni(a,c,d,e){functionf(e){e.push(function(){if(d.length>0){varg=d.shift(),h=newb.Queue;returng[0]=h,c.apply(a,g),f(e),h}})}varg,h=[];for(g=0;e>g;g+=1)h.push(newb.Queue),f(h[g]);returne>1?b.all(h):h[0]}functionj(a,c,d,e){return(newb.Queue).push(function(){returnd.hasOwnProperty(e)?void0:c.allDocs(a._query_options).push(function(a){varb,c={};for(b=0;b<a.data.total_rows;b+=1)c[a.data.rows[b].id]=a.data.rows[b].value;d[e]=c})}).push(function(){returnd[e]})}functionk(a,b,c,d,e){returnc.removeAttachment(d,e).push(function(){returna._signature_sub_storage.removeAttachment(d,e)}).push(function(){b[e]=null})}functionl(a,b,c,d,e,f,g){returnc.putAttachment(f,g,d).push(function(){returna._signature_sub_storage.putAttachment(f,g,JSON.stringify({hash:e}))}).push(function(){b[g]=null})}functionm(b,c,d,e,f,h,i,j,m,n,o,p){varq;returni.getAttachment(j,m).push(function(b){returnq=b,a.util.readBlobAsArrayBuffer(q)}).push(function(a){returng(a.target.result)},function(b){if(binstanceofa.util.jIOError&&404===b.status_code)returnq=null,null;throwb}).push(function(g){if(e===g)returnnull===e?b._signature_sub_storage.removeAttachment(j,m).push(function(){c[m]=null}):b._signature_sub_storage.putAttachment(j,m,JSON.stringify({hash:e})).push(function(){c[m]=null});if(g===d||n===!0)returnnull===e?k(b,c,i,j,m):l(b,c,i,f,e,j,m);if(p!==!0){if(o===!0||null===e)returnnull===g?k(b,c,h,j,m):l(b,c,h,q,g,j,m);if(null===g)returnl(b,c,i,f,e,j,m);thrownewa.util.jIOError("Conflict on '"+j+"' with attachment '"+m+"'",409)}})}functionn(c,d,e,f,h,i,j,k,l,n,o,p){varq,r;c.push(function(){if(o===!0)returnb.all([f.getAttachment(i,j),{hash:null}]);if(p===!0)returnb.all([f.getAttachment(i,j),d._signature_sub_storage.getAttachment(i,j,{format:"json"})]);thrownewa.util.jIOError("Unexpected call of checkAttachmentSignatureDifference",409)}).push(function(b){returnq=b[0],r=b[1].hash,a.util.readBlobAsArrayBuffer(q)}).push(function(a){varb=a.target.result,c=g(b);returnc!==r?m(d,e,r,c,q,f,h,i,j,k,l,n):void0})}functiono(a,b,c,d,e,f,g,h,i,j){vark;a.push(function(){returnb._signature_sub_storage.getAttachment(e,f,{format:"json"})}).push(function(a){returnk=a.hash,m(b,c,k,null,null,g,d,e,f,h,i,j)})}functionp(b,c,d,e,f,g,h){varj={},k={};returne.allAttachments(d).push(void0,function(b){if(binstanceofa.util.jIOError&&404===b.status_code)return{};throwb}).push(function(a){varl,m,o,p=[];for(oina)a.hasOwnProperty(o)&&(c.hasOwnProperty(o)||(j[o]=null));for(oing)g.hasOwnProperty(o)&&(c.hasOwnProperty(o)||(k[o]=null));for(oinj)j.hasOwnProperty(o)&&(l=k.hasOwnProperty(o)&&h.check_modification,m=!k.hasOwnProperty(o)&&h.check_creation,(l===!0||m===!0)&&p.push([void0,b,c,e,f,d,o,h.conflict_force,h.conflict_revert,h.conflict_ignore,m,l]));returni(b,n,p,b._parallel_operation_attachment_amount)}).push(function(){vara,g=[];if(h.check_deletion===!0){for(aink)k.hasOwnProperty(a)&&(j.hasOwnProperty(a)||g.push([void0,b,c,f,d,a,e,h.conflict_force,h.conflict_revert,h.conflict_ignore]));returni(b,o,g,b._parallel_operation_attachment_amount)}})}functionq(a,b,c,d){returna.push(function(){returnd.removeAttachment(b,c)})}functionr(b,c,d,e,f,g,h){returnb.push(function(){returng.getAttachment(c,d,{format:"json"}).push(void0,function(b){if(binstanceofa.util.jIOError&&404===b.status_code)return{hash:null};throwb}).push(function(a){returna.hash!==h?e.getAttachment(c,d).push(function(a){returnf.putAttachment(c,d,a)}).push(function(){returng.putAttachment(c,d,JSON.stringify({hash:h}))}):void0})})}functions(a,c,d,e,f){returnd!==e?(newb.Queue).push(function(){returnb.all([a._signature_sub_storage.allAttachments(c),a._local_sub_storage.allAttachments(c),a._remote_sub_storage.allAttachments(c)])}).push(function(e){varg,h,j,k,l,m=[],n=[],o=e[0],p=e[1],s=e[2],t=a._check_local_attachment_modification,u=a._check_local_attachment_creation,v=a._check_local_attachment_deletion,w=a._check_remote_attachment_modification,x=a._check_remote_attachment_creation,y=a._check_remote_attachment_deletion;f?(h=p,j=s,k=a._local_sub_storage,l=a._remote_sub_storage):(h=s,j=p,k=a._remote_sub_storage,l=a._local_sub_storage,t=w,u=x,v=y,x=u,y=v);for(ginh)h.hasOwnProperty(g)&&(u&&!o.hasOwnProperty(g)||t&&o.hasOwnProperty(g))&&m.push([void0,c,g,k,l,a._signature_sub_storage,d]);for(gino)o.hasOwnProperty(g)&&v&&!h.hasOwnProperty(g)&&n.push([void0,c,g,a._signature_sub_storage]);for(ginj)j.hasOwnProperty(g)&&(h.hasOwnProperty(g)||(v&&o.hasOwnProperty(g)||x&&!o.hasOwnProperty(g))&&n.push([void0,c,g,l]));returnb.all([i(a,r,m,a._parallel_operation_attachment_amount),i(a,q,n,a._parallel_operation_attachment_amount)])}).push(function(){returna._signature_sub_storage.put(c,{hash:d,attachment_hash:d,from_local:f})}):void0}functiont(c,d,e,f,g,h){if(void0!==e)returns(c,d,f,g,h);vari={};return(newb.Queue).push(function(){returnc._check_local_attachment_modification||c._check_local_attachment_creation||c._check_local_attachment_deletion||c._check_remote_attachment_modification||c._check_remote_attachment_creation||c._check_remote_attachment_deletion?c._signature_sub_storage.allAttachments(d):{}}).push(void0,function(b){if(binstanceofa.util.jIOError&&404===b.status_code)return{};throwb}).push(function(a){returnc._check_local_attachment_modification||c._check_local_attachment_creation||c._check_local_attachment_deletion?p(c,i,d,c._local_sub_storage,c._remote_sub_storage,a,{conflict_force:c._conflict_handling===D,conflict_revert:c._conflict_handling===E,conflict_ignore:c._conflict_handling===F,check_modification:c._check_local_attachment_modification,check_creation:c._check_local_attachment_creation,check_deletion:c._check_local_attachment_deletion}).push(function(){returna}):a}).push(function(a){returnc._check_remote_attachment_modification||c._check_remote_attachment_creation||c._check_remote_attachment_deletion?p(c,i,d,c._remote_sub_storage,c._local_sub_storage,a,{use_revert_post:c._use_remote_post,conflict_force:c._conflict_handling===E,conflict_revert:c._conflict_handling===D,conflict_ignore:c._conflict_handling===F,check_modification:c._check_remote_attachment_modification,check_creation:c._check_remote_attachment_creation,check_deletion:c._check_remote_attachment_deletion}):void0})}functionu(c,d,f,g,h,i,j,k,l){varm,n,o=newb.Queue,p=!0;returnvoid0===l&&(l={}),n=l.from_local,null===g&&o.push(function(){returnd.get(i)}).push(function(a){g=a},function(b){if(binstanceofa.util.jIOError&&404===b.status_code)thrownewe(i);throwb}),l.use_post?o.push(function(){returnf.post(g)}).push(function(a){returnp=!1,m=a,d.put(m,g)}).push(function(){returnd.allAttachments(i)}).push(function(a){functionc(a){f.push(function(){returnd.getAttachment(i,a)}).push(function(b){returnd.putAttachment(m,a,b)})}vare,f=newb.Queue;for(eina)a.hasOwnProperty(e)&&c(e);returnf}).push(function(){returnd.remove(i)}).push(function(){returnc._signature_sub_storage.remove(i)}).push(function(){returnp=!0,c._signature_sub_storage.put(m,{hash:h,from_local:n})}).push(function(){j[m]=null}):o.push(function(){returnl.create_new_document===!0?(deletek[i],c._signature_sub_storage.remove(i)):void0}).push(function(){returnf.put(i,g)}).push(function(){returnc._signature_sub_storage.put(i,{hash:h,from_local:n})}),o.push(function(){p&&(j[i]=null)}).push(void0,function(a){if(!(ainstanceofe))throwa})}functionv(b,c,d,e,f){varg;returng=void0!==b._signature_hash_key?c.remove(d).push(function(){returnb._signature_sub_storage.remove(d)}):t(b,d).push(function(){returnc.allAttachments(d)}).push(function(a){return"{}"===JSON.stringify(a)?c.remove(d).push(function(){returnb._signature_sub_storage.remove(d)}):void0},function(b){if(!(binstanceofa.util.jIOError&&404===b.status_code))throwb}),g.push(function(){e[d]=null,f[d]=null})}functionw(c,e,g,h,i,k,l,m,n,o,p,q,r,s,t){varw=t.from_local;return(newb.Queue).push(function(){returnvoid0!==t.signature_hash_key?j(c,o,h,i).push(function(a){returna.hasOwnProperty(p)?[null,a[p][t.signature_hash_key]]:[null,null]}):o.get(p).push(function(a){return[a,f(d(a))]},function(b){if(binstanceofa.util.jIOError&&404===b.status_code)return[null,null];throwb})}).push(function(b){varf=b[0],h=b[1];if(l===h)returnnull===l?c._signature_sub_storage.remove(p).push(function(){e[p]=null}):c._signature_sub_storage.put(p,{hash:l,from_local:w}).push(function(){e[p]=null});if(h===k||q===!0)returnnull===l?v(c,o,p,e,g):u(c,n,o,m,l,p,e,g,{use_post:t.use_post&&null===h,from_local:w,create_new_document:null===h&&null!==k});if(s!==!0){if(r===!0||null===l)returnnull===h?v(c,n,p,e,g):u(c,o,n,f,h,p,e,g,{use_post:t.use_revert_post&&null===l,from_local:!w,create_new_document:null===l&&null!==k});if(null===h)returnu(c,n,o,m,l,p,e,g,{use_post:t.use_post,from_local:w,create_new_document:null!==k});throwm=m||l,f=f||h,newa.util.jIOError("Conflict on '"+p+"': "+d(m)+" !== "+d(f),409)}})}functionx(a,b,c,d,e,f,g,h,i,j,k,l,m){varn;a.push(function(){returnb._signature_sub_storage.get(h)}).push(function(a){returnn=a.hash,w(b,c,d,e,f,n,null,null,i,g,h,j,k,l,m)})}functiony(a,b,c,e,g,h,i,j,k,l,m,n,o,p,q){a.push(function(){returnnull===o?i.get(k):null}).push(function(a){returnnull===o&&(o=f(d(a))),o!==p?w(b,c,e,g,h,p,o,a,i,j,k,l,m,n,q):void0})}functionz(a,c,d,e,f,g,h,k,l,m){varn=[],o=[];returnm.hasOwnProperty("use_post")||(m.use_post=!1),m.hasOwnProperty("use_revert_post")||(m.use_revert_post=!1),j(a,h,e,f).push(function(f){varj,p,q,r,s,t,u={},v={},w=newb.Queue;for(tinf)f.hasOwnProperty(t)&&(c.hasOwnProperty(t)||(u[t]=f[t]));for(j=0;j<l.data.total_rows;j+=1)c.hasOwnProperty(l.data.rows[j].id)||(v[l.data.rows[j].id]=l.data.rows[j].value.hash);for(tinu)u.hasOwnProperty(t)&&(p=v.hasOwnProperty(t)&&m.check_modification,q=!v.hasOwnProperty(t)&&m.check_creation,q===!0?r=null:p===!0&&(r=v[t]),s=null,void0!==m.signature_hash_key&&(s=u[t][m.signature_hash_key],p===!0&&(p=!1,s!==r&&(p=!0))),(p===!0||q===!0)&&n.push([void0,a,c,d,e,g,h,k,t,m.conflict_force,m.conflict_revert,m.conflict_ignore,s,r,m]));w.push(function(){returni(a,y,n,m.operation_amount)});for(tinv)v.hasOwnProperty(t)&&(u.hasOwnProperty(t)||(m.check_deletion===!0?o.push([void0,a,c,d,e,g,k,t,h,m.conflict_force,m.conflict_revert,m.conflict_ignore,m]):d[t]=null));return0!==o.length&&w.push(function(){returni(a,x,o,m.operation_amount)}),w})}functionA(a,b,c,d,e,f,g){a.push(function(){returnt(b,c,d,e,f,g)})}varB=newc,C=0,D=1,E=2,F=3;e.prototype=newError,e.prototype.constructor=e,h.prototype.remove=function(b){if(b===this._signature_hash)thrownewa.util.jIOError(this._signature_hash+" is frozen",403);returnthis._local_sub_storage.remove.apply(this._local_sub_storage,arguments)},h.prototype.post=function(){returnthis._local_sub_storage.post.apply(this._local_sub_storage,arguments)},h.prototype.put=function(b){if(b===this._signature_hash)thrownewa.util.jIOError(this._signature_hash+" is frozen",403);returnthis._local_sub_storage.put.apply(this._local_sub_storage,arguments)},h.prototype.get=function(){returnthis._local_sub_storage.get.apply(this._local_sub_storage,arguments)},h.prototype.getAttachment=function(){returnthis._local_sub_storage.getAttachment.apply(this._local_sub_storage,arguments)},h.prototype.allAttachments=function(){returnthis._local_sub_storage.allAttachments.apply(this._local_sub_storage,arguments)},h.prototype.putAttachment=function(b){if(b===this._signature_hash)thrownewa.util.jIOError(this._signature_hash+" is frozen",403);returnthis._local_sub_storage.putAttachment.apply(this._local_sub_storage,arguments)},h.prototype.removeAttachment=function(b){if(b===this._signature_hash)thrownewa.util.jIOError(this._signature_hash+" is frozen",403);returnthis._local_sub_storage.removeAttachment.apply(this._local_sub_storage,arguments)},h.prototype.hasCapacity=function(){returnthis._local_sub_storage.hasCapacity.apply(this._local_sub_storage,arguments)},h.prototype.buildQuery=function(){returnthis._local_sub_storage.buildQuery.apply(this._local_sub_storage,arguments)},h.prototype.repair=function(){varc=this,d=arguments,e={},f={},g={};return(newb.Queue).push(function(){returnc._custom_signature_sub_storage===!1?(e[c._signature_hash]=null,c._signature_sub_storage.__storage._sub_storage.__storage._sub_storage.get(c._signature_hash)):void0}).push(void0,function(b){if(binstanceofa.util.jIOError&&404===b.status_code)returnc._signature_sub_storage.__storage._sub_storage.__storage._sub_storage.put(c._signature_hash,{});throwb}).push(function(){returnb.all([c._local_sub_storage.repair.apply(c._local_sub_storage,d),c._remote_sub_storage.repair.apply(c._remote_sub_storage,d)])}).push(function(){returnc._check_local_modification||c._check_local_creation||c._check_local_deletion||c._check_remote_modification||c._check_remote_creation||c._check_remote_deletion?c._signature_sub_storage.allDocs({select_list:["hash"]}):void0}).push(function(a){returnc._check_local_modification||c._check_local_creation||c._check_local_deletion?z(c,e,f,g,"local","remote",c._local_sub_storage,c._remote_sub_storage,a,{use_post:c._use_remote_post,conflict_force:c._conflict_handling===D,conflict_revert:c._conflict_handling===E,conflict_ignore:c._conflict_handling===F,check_modification:c._check_local_modification,check_creation:c._check_local_creation,check_deletion:c._check_local_deletion,operation_amount:c._parallel_operation_amount,signature_hash_key:c._signature_hash_key,from_local:!0}).push(function(){returna}):a}).push(function(a){returnc._check_remote_modification||c._check_remote_creation||c._check_remote_deletion?z(c,e,f,g,"remote","local",c._remote_sub_storage,c._local_sub_storage,a,{use_revert_post:c._use_remote_post,conflict_force:c._conflict_handling===E,conflict_revert:c._conflict_handling===D,conflict_ignore:c._conflict_handling===F,check_modification:c._check_remote_modification,check_creation:c._check_remote_creation,check_deletion:c._check_remote_deletion,operation_amount:c._parallel_operation_amount,signature_hash_key:c._signature_hash_key,from_local:!1}):void0}).push(function(){returnc._check_local_attachment_modification||c._check_local_attachment_creation||c._check_local_attachment_deletion||c._check_remote_attachment_modification||c._check_remote_attachment_creation||c._check_remote_attachment_deletion?c._signature_sub_storage.allDocs({select_list:["hash","attachment_hash","from_local"]}).push(function(a){varb,d,e=[],g=a.data.total_rows;for(b=0;g>b;b+=1)d=a.data.rows[b],f.hasOwnProperty(d.id)||e.push([void0,c,d.id,c._signature_hash_key,d.value.hash,d.value.attachment_hash,d.value.from_local]);returni(c,A,e,c._parallel_operation_amount)}):void0})},a.addStorage("replicate",h)}(jIO,RSVP,Rusha,jIO.util.stringify),function(a){"use strict";functionb(a){this._sub_storage=jIO.createJIO(a.sub_storage)}varc=newa;b.prototype.post=function(a){returnthis._sub_storage.put(c.digestFromString(JSON.stringify(a)),a)},b.prototype.get=function(){returnthis._sub_storage.get.apply(this._sub_storage,arguments)},b.prototype.remove=function(){returnthis._sub_storage.remove.apply(this._sub_storage,arguments)},b.prototype.hasCapacity=function(){returnthis._sub_storage.hasCapacity.apply(this._sub_storage,arguments)},b.prototype.buildQuery=function(){returnthis._sub_storage.buildQuery.apply(this._sub_storage,arguments)},b.prototype.getAttachment=function(){returnthis._sub_storage.getAttachment.apply(this._sub_storage,arguments)},b.prototype.putAttachment=function(){returnthis._sub_storage.putAttachment.apply(this._sub_storage,arguments)},b.prototype.removeAttachment=function(){returnthis._sub_storage.removeAttachment.apply(this._sub_storage,arguments)},b.prototype.allAttachments=function(){returnthis._sub_storage.allAttachments.apply(this._sub_storage,arguments)},b.prototype.repair=function(){returnthis._sub_storage.repair.apply(this._sub_storage,arguments)},jIO.addStorage("sha",b)}(Rusha),function(a){"use strict";functionb(b){this._sub_storage=a.createJIO(b.sub_storage)}b.prototype.get=function(){returnthis._sub_storage.get.apply(this._sub_storage,arguments)},b.prototype.allAttachments=function(){returnthis._sub_storage.allAttachments.apply(this._sub_storage,arguments)},b.prototype.post=function(a){functionb(){return("0000"+Math.floor(65536*Math.random()).toString(16)).slice(-4)}varc=b()+b()+"-"+b()+"-"+b()+"-"+b()+"-"+b()+b()+b();returnthis.put(c,a)},b.prototype.put=function(){returnthis._sub_storage.put.apply(this._sub_storage,arguments)},b.prototype.remove=function(){returnthis._sub_storage.remove.apply(this._sub_storage,arguments)},b.prototype.getAttachment=function(){returnthis._sub_storage.getAttachment.apply(this._sub_storage,arguments)},b.prototype.putAttachment=function(){returnthis._sub_storage.putAttachment.apply(this._sub_storage,arguments)},b.prototype.removeAttachment=function(){returnthis._sub_storage.removeAttachment.apply(this._sub_storage,arguments)},b.prototype.repair=function(){returnthis._sub_storage.repair.apply(this._sub_storage,arguments)},b.prototype.hasCapacity=function(a){returnthis._sub_storage.hasCapacity(a)},b.prototype.buildQuery=function(){returnthis._sub_storage.buildQuery.apply(this._sub_storage,arguments)},a.addStorage("uuid",b)}(jIO),function(a,b,c){"use strict";functiond(){this._database={}}d.prototype.put=function(a,c){returnthis._database.hasOwnProperty(a)||(this._database[a]={attachments:{}}),this._database[a].doc=b.stringify(c),a},d.prototype.get=function(c){try{returnb.parse(this._database[c].doc)}catch(d){if(dinstanceofTypeError)thrownewa.util.jIOError("Cannot find document: "+c,404);throwd}},d.prototype.allAttachments=function(b){varc,d={};try{for(cinthis._database[b].attachments)this._database[b].attachments.hasOwnProperty(c)&&(d[c]={})}catch(e){if(einstanceofTypeError)thrownewa.util.jIOError("Cannot find document: "+b,404);throwe}returnd},d.prototype.remove=function(a){returndeletethis._database[a],a},d.prototype.getAttachment=function(b,c){try{vard=this._database[b].attachments[c];if(void0===d)thrownewa.util.jIOError("Cannot find attachment: "+b+" , "+c,404);returna.util.dataURItoBlob(d)}catch(e){if(einstanceofTypeError)thrownewa.util.jIOError("Cannot find attachment: "+b+" , "+c,404);throwe}},d.prototype.putAttachment=function(b,d,e){varf;try{f=this._database[b].attachments}catch(g){if(ginstanceofTypeError)thrownewa.util.jIOError("Cannot find document: "+b,404);throwg}return(newc.Queue).push(function(){returna.util.readBlobAsDataURL(e)}).push(function(a){f[d]=a.target.result})},d.prototype.removeAttachment=function(b,c){try{deletethis._database[b].attachments[c]}catch(d){if(dinstanceofTypeError)thrownewa.util.jIOError("Cannot find document: "+b,404);throwd}},d.prototype.hasCapacity=function(a){return"list"===a||"include"===a},d.prototype.buildQuery=function(a){varc,d=[];for(cinthis._database)this._database.hasOwnProperty(c)&&(a.include_docs===!0?d.push({id:c,value:{},doc:b.parse(this._database[c].doc)}):d.push({id:c,value:{}}));returnd},a.addStorage("memory",d)}(jIO,JSON,RSVP),function(a,b,c,d){"use strict";functione(a){this._sub_storage=jIO.createJIO(a.sub_storage)}functionf(a,b){returna.indexOf(b)===a.length-b.length}varg="application/x-jio-utf16_lz_string";e.prototype.get=function(){returnthis._sub_storage.get.apply(this._sub_storage,arguments)},e.prototype.post=function(){returnthis._sub_storage.post.apply(this._sub_storage,arguments)},e.prototype.put=function(){returnthis._sub_storage.put.apply(this._sub_storage,arguments)},e.prototype.remove=function(){returnthis._sub_storage.remove.apply(this._sub_storage,arguments)},e.prototype.hasCapacity=function(){returnthis._sub_storage.hasCapacity.apply(this._sub_storage,arguments)},e.prototype.buildQuery=function(){returnthis._sub_storage.buildQuery.apply(this._sub_storage,arguments)},e.prototype.getAttachment=function(b,e){varf=this;returnf._sub_storage.getAttachment(b,e).push(function(b){returnb.type!==g?b:(newa.Queue).push(function(){returnjIO.util.readBlobAsText(b,"utf16")}).push(function(a){vare=c.decompressFromUTF16(a.target.result);if(""===e)returnb;try{returnjIO.util.dataURItoBlob(e)}catch(f){if(finstanceofd)returnb;throwf}})})},e.prototype.putAttachment=function(d,e,h){vari=this;return0===h.type.indexOf("text/")||f(h.type,"xml")||f(h.type,"json")?(newa.Queue).push(function(){returnjIO.util.readBlobAsDataURL(h)}).push(function(a){varf=c.compressToUTF16(a.target.result);returnh=newb([f],{type:g}),i._sub_storage.putAttachment(d,e,h)}):this._sub_storage.putAttachment.apply(this._sub_storage,arguments)},e.prototype.removeAttachment=function(){returnthis._sub_storage.removeAttachment.apply(this._sub_storage,arguments)},e.prototype.allAttachments=function(){returnthis._sub_storage.allAttachments.apply(this._sub_storage,arguments)},jIO.addStorage("zip",e)}(RSVP,Blob,LZString,DOMException),function(a,b,c,d){"use strict";functione(b){if(0!==b.indexOf("/"))thrownewa.util.jIOError("id "+b+" is forbidden (no begin /)",400);if(b.lastIndexOf("/")!==b.length-1)thrownewa.util.jIOError("id "+b+" is forbidden (no end /)",400);returnb}functionf(b){if(-1!==b.indexOf("/"))thrownewa.util.jIOError("attachment "+b+" is forbidden",400)}functiong(a){if("string"!=typeofa.access_token||!a.access_token)thrownewTypeError("Access Token' must be a string which contains more than one character.");if("string"!=typeofa.root||!a.root||"dropbox"!==a.root&&"sandbox"!==a.root)thrownewTypeError("root must be 'dropbox' or 'sandbox'");this._access_token=a.access_token,this._root=a.root}varh="https://content.dropboxapi.com/1/files_put/{+root}{+id}{+name}{?access_token}",i=d.parse(h),j="https://api.dropboxapi.com/1/fileops/create_folder{?access_token,root,path}",k=d.parse(j),l="https://api.dropboxapi.com/1/fileops/delete/{?access_token,root,path}",m=d.parse(l),n="https://content.dropboxapi.com/1/files{/root,id}{+name}{?access_token}",o=d.parse(n),p="https://api.dropboxapi.com/1/metadata{/root}{+id}{?access_token}",q=d.parse(p);g.prototype.put=function(c,d){varf=this;if(c=e(c),Object.getOwnPropertyNames(d).length>0)thrownewa.util.jIOError("Can not store properties: "+Object.getOwnPropertyNames(d),400);return(newb.Queue).push(function(){returna.util.ajax({type:"POST",url:k.expand({access_token:f._access_token,root:f._root,path:c})})}).push(void0,function(a){if(void0===a.target||405!==a.target.status)throwa})},g.prototype.remove=function(b){returnb=e(b),a.util.ajax({type:"POST",url:m.expand({access_token:this._access_token,root:this._root,path:b})})},g.prototype.get=function(c){vard=this;return"/"===c?{}:(c=e(c),(newb.Queue).push(function(){returna.util.ajax({type:"GET",url:q.expand({access_token:d._access_token,root:d._root,id:c})})}).push(function(b){vard=JSON.parse(b.target.response||b.target.responseText);if(d.is_dir)return{};thrownewa.util.jIOError("Not a directory: "+c,404)},function(b){if(void0!==b.target&&404===b.target.status)thrownewa.util.jIOError("Cannot find document: "+c,404);throwb}))},g.prototype.allAttachments=function(c){vard=this;returnc=e(c),(newb.Queue).push(function(){returna.util.ajax({type:"GET",url:q.expand({access_token:d._access_token,root:d._root,id:c})})}).push(function(b){vard,e=JSON.parse(b.target.response||b.target.responseText),f={};if(!e.is_dir)thrownewa.util.jIOError("Not a directory: "+c,404);for(d=0;d<e.contents.length;d+=1)e.contents[d].is_dir||(f[e.contents[d].path.split("/").pop()]={});returnf},function(b){if(void0!==b.target&&404===b.target.status)thrownewa.util.jIOError("Cannot find document: "+c,404);throwb})},g.prototype.putAttachment=function(b,c,d){returnb=e(b),f(c),a.util.ajax({type:"PUT",url:i.expand({root:this._root,id:b,name:c,access_token:this._access_token}),dataType:d.type,data:d})},g.prototype.getAttachment=function(d,g){varh=this;returnd=e(d),f(g),(newb.Queue).push(function(){returna.util.ajax({type:"GET",dataType:"blob",url:o.expand({root:h._root,id:d,name:g,access_token:h._access_token})})}).push(function(a){returnnewc([a.target.response||a.target.responseText],{type:a.target.getResponseHeader("Content-Type")||"application/octet-stream"})},function(b){if(void0!==b.target&&404===b.target.status)thrownewa.util.jIOError("Cannot find attachment: "+d+", "+g,404);throwb})},g.prototype.removeAttachment=function(c,d){varg=this;returnc=e(c),f(d),(newb.Queue).push(function(){returna.util.ajax({type:"POST",url:m.expand({access_token:g._access_token,root:g._root,path:c+d})})}).push(void0,function(b){if(void0!==b.target&&404===b.target.status)thrownewa.util.jIOError("Cannot find attachment: "+c+", "+d,404);throwb})},a.addStorage("dropbox",g)}(jIO,RSVP,Blob,UriTemplate),function(a,b,c,d){"use strict";functione(c,d){returnvoid0===d&&(d={}),void0!==c._authorization&&(void0===d.headers&&(d.headers={}),d.headers.Authorization=c._authorization),void0!==c._with_credentials&&(void0===d.xhrFields&&(d.xhrFields={}),d.xhrFields.withCredentials=c._with_credentials),(newb.Queue).push(function(){returna.util.ajax(d)})}functionf(b){if(0!==b.indexOf("/"))thrownewa.util.jIOError("id "+b+" is forbidden (no begin /)",400);if(b.lastIndexOf("/")!==b.length-1)thrownewa.util.jIOError("id "+b+" is forbidden (no end /)",400);returnb}functiong(b){if(-1!==b.indexOf("/"))thrownewa.util.jIOError("attachment "+b+" is forbidden",400)}functionh(a){if("string"!=typeofa.url)thrownewTypeError("DavStorage 'url' is not of type string");this._url=a.url,"string"==typeofa.basic_login&&(this._authorization="Basic "+a.basic_login),this._with_credentials=a.with_credentials}h.prototype.put=function(c,d){varg=this;if(c=f(c),Object.getOwnPropertyNames(d).length>0)thrownewa.util.jIOError("Can not store properties: "+Object.getOwnPropertyNames(d),400);return(newb.Queue).push(function(){returne(g,{type:"MKCOL",url:g._url+c})}).push(void0,function(a){if(void0===a.target||405!==a.target.status)throwa})},h.prototype.remove=function(a){returna=f(a),e(this,{type:"DELETE",url:this._url+a})},h.prototype.get=function(c){vard=this;returnc=f(c),(newb.Queue).push(function(){returne(d,{type:"PROPFIND",url:d._url+c,dataType:"text",headers:{Depth:"1"}})}).push(function(){return{}},function(b){if(void0!==b.target&&404===b.target.status)thrownewa.util.jIOError("Cannot find document",404);throwb})},h.prototype.allAttachments=function(d){varg=this;returnd=f(d),(newb.Queue).push(function(){returne(g,{type:"PROPFIND",url:g._url+d,dataType:"text",headers:{Depth:"1"}})}).push(function(a){varb,d,e={},f=(newc).parseFromString(a.target.responseText,"text/xml").querySelectorAll("D\\:response, response");for(b=1;b<f.length;b+=1)d=f[b].querySelector("D\\:href, href").textContent.split("/").slice(-1)[0],void0!==d&&""!==d&&(e[d]={});returne},function(b){if(void0!==b.target&&404===b.target.status)thrownewa.util.jIOError("Cannot find document",404);throwb})},h.prototype.putAttachment=function(c,d,h){vari=this;returnc=f(c),g(d),(newb.Queue).push(function(){returne(i,{type:"PUT",url:i._url+c+d,data:h})}).push(void0,function(b){if(403===b.target.status||424===b.target.status)thrownewa.util.jIOError("Cannot access subdocument",404);throwb})},h.prototype.getAttachment=function(c,h){vari=this;returnc=f(c),g(h),(newb.Queue).push(function(){returne(i,{type:"GET",url:i._url+c+h,dataType:"blob"})}).push(function(a){returnnewd([a.target.response||a.target.responseText],{type:a.target.getResponseHeader("Content-Type")||"application/octet-stream"})},function(b){if(void0!==b.target&&404===b.target.status)thrownewa.util.jIOError("Cannot find attachment: "+c+" , "+h,404);throwb})},h.prototype.removeAttachment=function(c,d){varh=this;returnc=f(c),g(d),(newb.Queue).push(function(){returne(h,{type:"DELETE",url:h._url+c+d})}).push(void0,function(b){if(void0!==b.target&&404===b.target.status)thrownewa.util.jIOError("Cannot find attachment: "+c+" , "+d,404);throwb})},a.addStorage("dav",h)}(jIO,RSVP,DOMParser,Blob),function(a,b,c,d,e){"use strict";functionf(b,c){if(404===b.target.status)thrownewa.util.jIOError("Cannot find document: "+c,404);throwb}functiong(b,d){varg,h;return(newc.Queue).push(function(){returna.util.ajax({type:"GET",url:s.expand({pageToken:b.nextPageToken||"",access_token:d})})}).push(function(a){for(h=e.parse(a.target.response||a.target.responseText),g=0;g<h.items.length;g+=1)h.items[g].value={},b.push(h.items[g]);returnb.nextPageToken=h.nextPageToken,b},f)}functionh(b){if("enclosure"!==b)thrownewa.util.jIOError("Only support 'enclosure' attachment",400)}functioni(a){if(void0===a||void0===a.access_token||"string"!=typeofa.access_token)thrownewTypeError("Access Token must be a string which contains more than one character.");if(void0!==a.trashing&&a.trashing!==!0&&a.trashing!==!1)thrownewTypeError("trashing parameter must be a boolean (true or false)");this._trashing=a.trashing||!0,this._access_token=a.access_token}functionj(a,b){return(newc.Queue).push(function(){returng(a,b)}).push(function(){returna.nextPageToken?j(a,b):a})}functionk(b,d,g){varh="-------314159265358979323846";return(newc.Queue).push(function(){returna.util.ajax({type:b?"PUT":"POST",url:o.expand({access_token:g,id:b||[],upload:b?[]:"upload",uploadType:"multipart"}),headers:{"Content-Type":'multipart/related; boundary="'+h+'"'},data:"--"+h+"\nContent-Type: application/json; charset=UTF-8\n\n"+e.stringify(d)+"\n\n--"+h+"--"})}).push(function(a){varb=e.parse(a.target.responseText);returnb.id},function(a){f(a,b)})}functionl(b,d,g){return(newc.Queue).push(function(){returna.util.ajax({type:"PUT",url:o.expand({access_token:g,upload:"upload",id:b,uploadType:"media"}),data:d})}).push(function(b){if(b=e.parse(b.target.responseText),"application/vnd.google-apps.folder"===b.mimeType)thrownewa.util.jIOError("cannot put attachments to folder",400);returnb},function(a){f(a,b)})}functionm(d,g,h){return(newc.Queue).push(function(){returna.util.ajax({type:"GET",dataType:g?"blob":"json",url:u.expand({id:d,alt:g?"media":[],access_token:h}),headers:{Authorization:"Bearer "+h}})}).push(function(a){returna.target.response||(g?newb([a.target.responseText],{type:a.target.responseHeaders["Content-Type"]}):e.parse(a.target.responseText))},function(a){f(a,d)})}varn="https://www.googleapis.com{/upload}/drive/v2/files{/id}{?uploadType,access_token}",o=d.parse(n),p="https://www.googleapis.com/drive/v2/files{/id,trash}{?access_token}",q=d.parse(p),r="https://www.googleapis.com/drive/v2/files?prettyPrint=false{&pageToken}&q=trashed=false&fields=nextPageToken,items(id){&access_token}",s=d.parse(r),t="https://www.googleapis.com/drive/v2/files{/id}{?alt}",u=d.parse(t);i.prototype.hasCapacity=function(a){return"list"===a},i.prototype.buildQuery=function(){returnj([],this._access_token)},i.prototype.put=function(a,b){returnk(a,b,this._access_token)},i.prototype.post=function(a){returnk(void0,a,this._access_token)},i.prototype.putAttachment=function(a,b,c){returnh(b),l(a,c,this._access_token)},i.prototype.remove=function(b){vard=this;return(newc.Queue).push(function(){returna.util.ajax({type:d._trashing?"POST":"DELETE",url:q.expand({id:b,access_token:d._access_token,trash:d._trashing?"trash":[]})})}).push(void0,function(a){f(a,b)})},i.prototype.get=function(a){returnm(a,!1,this._access_token)},i.prototype.getAttachment=function(a,b){returnh(b),m(a,!0,this._access_token)},i.prototype.allAttachments=function(a){varb=this._access_token;return(newc.Queue).push(function(){returnm(a,!1,b)}).push(function(a){return"application/vnd.google-apps.folder"===a.mimeType?{}:{enclosure:{}}})},a.addStorage("gdrive",i)}(jIO,Blob,RSVP,UriTemplate,JSON),function(a,b){"use strict";functionc(b){if(!Array.isArray(b.storage_list))thrownewa.util.jIOError("storage_list is not an Array",400);varc;for(this._storage_list=[],c=0;c<b.storage_list.length;c+=1)this._storage_list.push(a.createJIO(b.storage_list[c]))}c.prototype._getWithStorageIndex=function(){functionb(b){g.push(void0,function(c){if(cinstanceofa.util.jIOError&&404===c.status_code)returne._storage_list[b].get.apply(e._storage_list[b],f).push(function(a){returnd=b,a});throwc})}varc,d=0,e=this,f=arguments,g=this._storage_list[0].get.apply(this._storage_list[0],f);for(c=1;c<this._storage_list.length;c+=1)b(c);returng.push(function(a){return[d,a]})},c.prototype.get=function(){returnthis._getWithStorageIndex.apply(this,arguments).push(function(a){returna[1]})},c.prototype.allAttachments=function(){vara=arguments,b=this;returnthis._getWithStorageIndex.apply(this,arguments).push(function(c){vard=b._storage_list[c[0]];returnd.allAttachments.apply(d,a)})},c.prototype.post=function(){returnthis._storage_list[0].post.apply(this._storage_list[0],arguments)},c.prototype.put=function(){varb=arguments,c=this;returnthis._getWithStorageIndex(b[0]).push(void0,function(b){if(binstanceofa.util.jIOError&&404===b.status_code)return[0];throwb}).push(function(a){vard=c._storage_list[a[0]];returnd.put.apply(d,b)})},c.prototype.remove=function(){vara=arguments,b=this;returnthis._getWithStorageIndex(a[0]).push(function(c){vard=b._storage_list[c[0]];returnd.remove.apply(d,a)})},c.prototype.buildQuery=function(){vara,c,d=[],e={},f=this._storage_list.length;for(a=0;f>a;a+=1)c=this._storage_list[a],d.push(c.buildQuery.apply(c,arguments));return(newb.Queue).push(function(){returnb.all(d)}).push(function(b){varc,d,g,h=[];for(f=b.length,a=0;f>a;a+=1)for(c=b[a],d=c.length,g=0;d>g;g+=1)e.hasOwnProperty(c[g].id)||(e[c[g].id]=null,h.push(c[g]));returnh})},c.prototype.hasCapacity=function(a){varb,c,d,e;if("list"===a||"query"===a||"select"===a){for(d=!0,c=this._storage_list.length,b=0;c>b;b+=1)e=this._storage_list[b],d=d&&e.hasCapacity(a);returnd}return!1},c.prototype.repair=function(){vara,c=[];for(a=0;a<this._storage_list.length;a+=1)c.push(this._storage_list[a].repair.apply(this._storage_list[a],arguments));returnb.all(c)},c.prototype.getAttachment=function(){vara=arguments,b=this;returnthis._getWithStorageIndex.apply(this,arguments).push(function(c){vard=b._storage_list[c[0]];returnd.getAttachment.apply(d,a)})},c.prototype.putAttachment=function(){vara=arguments,b=this;returnthis._getWithStorageIndex.apply(this,arguments).push(function(c){vard=b._storage_list[c[0]];returnd.putAttachment.apply(d,a)})},c.prototype.removeAttachment=function(){vara=arguments,b=this;returnthis._getWithStorageIndex.apply(this,arguments).push(function(c){vard=b._storage_list[c[0]];returnd.removeAttachment.apply(d,a)})},a.addStorage("union",c)}(jIO,RSVP),function(a,b,c,d,e,f,g,h){"use strict";functioni(b){return(newd.Queue).push(function(){returna.util.ajax({type:"GET",url:b._url,xhrFields:{withCredentials:!0}})}).push(function(a){returnJSON.parse(a.target.responseText)})}functionj(c,e,f){returnvoid0===f&&(f={}),i(c).push(function(c){return(newd.Queue).push(function(){returna.util.ajax({type:"GET",url:b.parse(c._links.traverse.href).expand({relative_url:e,view:f._view}),xhrFields:{withCredentials:!0}})}).push(void0,function(b){if(void0!==b.target&&404===b.target.status)thrownewa.util.jIOError("Cannot find document: "+e,404);throwb})})}functionk(a){return(newd.Queue).push(function(){varb,c,d,f,g=a._embedded._view,h={portal_type:a._links.type.name},i={};a._links.hasOwnProperty("parent")&&(h.parent_relative_url=newe(a._links.parent.href).segment(2)),i.form_id={key:[g.form_id.key],"default":g.form_id["default"]};for(cing)g.hasOwnProperty(c)&&(b=g[c],d=0,0===c.indexOf("my_")&&b.editable&&(d=3),0===c.indexOf("your_")&&(d=5),0!==d&&q.hasOwnProperty(b.type)&&(i[c.substring(d)]={"default":b["default"],key:b.key},h[c.substring(d)]=b["default"]));returnf={data:h,form_data:i},g.hasOwnProperty("_actions")&&g._actions.hasOwnProperty("put")&&(f.action_href=g._actions.put.href),f})}functionl(b,c){returnb.getAttachment(c,"view").push(function(b){returna.util.readBlobAsText(b)}).push(function(a){returnJSON.parse(a.target.result)}).push(function(a){returnk(a)})}functionm(a){if("string"!=typeofa.url||!a.url)thrownewTypeError("ERP5 'url' must be a string which contains more than one character.");this._url=a.url,this._default_view_reference=a.default_view_reference}functionn(a){varb,c=a.data;for(binc)c.hasOwnProperty(b)&&(c[b]||deletec[b]);returnc}functiono(a){returnainstanceofg&&"local_roles"===a.key?a.value:void0}functionp(a){varb,c,d=!0,e=[];if(ainstanceofh&&"OR"===a.operator){for(b=0;b<a.query_list.length;b+=1)c=a.query_list[b],cinstanceofg&&"local_roles"===c.key?e.push(c.value):d=!1;if(d)returne}}varq={StringField:null,EmailField:null,IntegerField:null,FloatField:null,TextAreaField:null};m.prototype.get=function(a){returnl(this,a).push(function(a){returnn(a)})},m.prototype.post=function(b){vard,f=this;returni(this).push(function(d){vare=newc;returne.append("portal_type",b.portal_type),e.append("parent_relative_url",b.parent_relative_url),a.util.ajax({type:"POST",url:d._actions.add.href,data:e,xhrFields:{withCredentials:!0}})}).push(function(a){varc=a.target.getResponseHeader("X-Location"),g=newe(c);returnd=g.segment(2),f.put(d,b)}).push(function(){returnd})},m.prototype.put=function(b,c){vard=this;returnl(d,b).push(function(e){varg,h=e.form_data,i={};i[h.form_id.key]=h.form_id["default"];for(ginc)if(c.hasOwnProperty(g)){if("form_id"===g)thrownewa.util.jIOError("ERP5: forbidden property: "+g,400);if("portal_type"!==g&&"parent_relative_url"!==g){if(!h.hasOwnProperty(g))thrownewa.util.jIOError("ERP5: can not store property: "+g,400);i[h[g].key]=c[g]}}if(!e.hasOwnProperty("action_href"))thrownewa.util.jIOError("ERP5: can not modify document: "+b,403);returnd.putAttachment(b,e.action_href,newf([JSON.stringify(i)],{type:"application/json"}))})},m.prototype.allAttachments=function(a){varb=this;returnj(this,a).push(function(){returnvoid0===b._default_view_reference?{links:{}}:{view:{},links:{}}})},m.prototype.getAttachment=function(b,c,e){if(void0===e&&(e={}),"view"===c){if(void0===this._default_view_reference)thrownewa.util.jIOError("Cannot find attachment view for: "+b,404);returnj(this,b,{_view:this._default_view_reference}).push(function(a){varb=JSON.parse(a.target.responseText);returnnewf([JSON.stringify(b)],{type:"application/hal+json"})})}if("links"===c)returnj(this,b).push(function(a){returnnewf([JSON.stringify(JSON.parse(a.target.responseText))],{type:"application/hal+json"})});if(0===c.indexOf(this._url))return(newd.Queue).push(function(){varb,d,f,g={type:"GET",dataType:"blob",url:c,xhrFields:{withCredentials:!0}};if(void0!==e.start||void0!==e.end){if(b=e.start||0,d=e.end,void0!==d&&0>d)thrownewa.util.jIOError("end must be positive",400);if(0>b)f="bytes="+b;elseif(void0===d)f="bytes="+b+"-";else{if(b>d)thrownewa.util.jIOError("start is greater than end",400);f="bytes="+b+"-"+d}g.headers={Range:f}}returna.util.ajax(g)}).push(function(a){returnvoid0===a.target.response?newf([a.target.responseText],{type:a.target.getResponseHeader("Content-Type")}):a.target.response});thrownewa.util.jIOError("ERP5: not support get attachment: "+c,400)},m.prototype.putAttachment=function(b,e,f){if(0!==e.indexOf(this._url))thrownewa.util.jIOError("Can not store outside ERP5: "+e,400);return(newd.Queue).push(function(){returna.util.readBlobAsText(f)}).push(function(b){vard,f,g,h,i=JSON.parse(b.target.result),j=newc;for(gini)if(i.hasOwnProperty(g))for(d=Array.isArray(i[g])?i[g]:[i[g]],f=0;f<d.length;f+=1)h=d[f],"object"==typeofh?j.append(g,a.util.dataURItoBlob(h.url),h.file_name):j.append(g,h);returna.util.ajax({type:"POST",url:e,data:j,dataType:"blob",xhrFields:{withCredentials:!0}})})},m.prototype.hasCapacity=function(a){return"list"===a||"query"===a||"select"===a||"limit"===a||"sort"===a},m.prototype.buildQuery=function(c){returni(this).push(function(d){vare,f,g,i,j,k=c.query,l=[];if(c.query)if(f=a.QueryFactory.create(c.query),i=o(f))k=void0,j=i;elseif(i=p(f))k=void0,j=i;elseif(finstanceofh&&"AND"===f.operator)for(e=0;e<f.query_list.length;e+=1)g=f.query_list[e],i=o(g),i?(j=i,f.query_list.splice(e,1),k=a.Query.objectToSearchText(f),e=f.query_list.length):(i=p(g),i&&(j=i,f.query_list.splice(e,1),k=a.Query.objectToSearchText(f),e=f.query_list.length));if(c.sort_on)for(e=0;e<c.sort_on.length;e+=1)l.push(JSON.stringify(c.sort_on[e]));returna.util.ajax({type:"GET",url:b.parse(d._links.raw_search.href).expand({query:k,select_list:c.select_list||["title","reference"],limit:c.limit,sort_on:l,local_roles:j}),xhrFields:{withCredentials:!0}})}).push(function(a){returnJSON.parse(a.target.responseText)}).push(function(a){varb,c,d,f=a._embedded.contents,g=f.length,h=[];for(b=0;g>b;b+=1)d=f[b],c=newe(d._links.self.href),deleted._links,h.push({id:c.segment(2),value:d});returnh})},a.addStorage("erp5",m)}(jIO,UriTemplate,FormData,RSVP,URI,Blob,SimpleQuery,ComplexQuery),function(a,b){"use strict";functionc(b){this._sub_storage=a.createJIO(b.sub_storage),this._key_schema=b.key_schema}c.prototype.get=function(){returnthis._sub_storage.get.apply(this._sub_storage,arguments)},c.prototype.allAttachments=function(){returnthis._sub_storage.allAttachments.apply(this._sub_storage,arguments)},c.prototype.post=function(){returnthis._sub_storage.post.apply(this._sub_storage,arguments)},c.prototype.put=function(){returnthis._sub_storage.put.apply(this._sub_storage,arguments)},c.prototype.remove=function(){returnthis._sub_storage.remove.apply(this._sub_storage,arguments)},c.prototype.getAttachment=function(){returnthis._sub_storage.getAttachment.apply(this._sub_storage,arguments)},c.prototype.putAttachment=function(){returnthis._sub_storage.putAttachment.apply(this._sub_storage,arguments)},c.prototype.removeAttachment=function(){returnthis._sub_storage.removeAttachment.apply(this._sub_storage,arguments)},c.prototype.repair=function(){returnthis._sub_storage.repair.apply(this._sub_storage,arguments)},c.prototype.hasCapacity=function(a){varb=["limit","sort","select","query"];return-1!==b.indexOf(a)?!0:"list"===a?this._sub_storage.hasCapacity(a):!1},c.prototype.buildQuery=function(c){vard=this._sub_storage,e=this,f={},g=!1,h=!1;if(d.hasCapacity("list")){try{void0!==c.query&&!d.hasCapacity("query")||void0!==c.sort_on&&!d.hasCapacity("sort")||void0!==c.select_list&&!d.hasCapacity("select")||void0!==c.limit&&!d.hasCapacity("limit")||(f.query=c.query,f.sort_on=c.sort_on,f.select_list=c.select_list,f.limit=c.limit)}catch(i){if(!(iinstanceofa.util.jIOError&&501===i.status_code))throwi;g=!0}try{(g||c.include_docs===!0)&&d.hasCapacity("include")&&(f.include_docs=!0)}catch(i){if(!(iinstanceofa.util.jIOError&&501===i.status_code))throwi;h=!0}returnd.buildQuery(f).push(function(c){functione(b){vare=c[b].id;returnd.get(e).push(function(a){returna._id=e,a},function(b){if(!(binstanceofa.util.jIOError&&404===b.status_code))throwb})}varf,g,i=[c];if(h){for(f=c.length,g=0;f>g;g+=1)i.push(e(g));c=b.all(i)}returnc}).push(function(a){varb,c,d;if(h){for(b=a[0],c=b.length,d=0;c>d;d+=1)b[d].doc=a[d+1];a=b}returna}).push(function(b){vard,f,h=[];if(g){for(d=b.length,f=0;d>f;f+=1)b[f].doc.__id=b[f].id,h.push(b[f].doc);c.select_list&&c.select_list.push("__id"),b=a.QueryFactory.create(c.query||"",e._key_schema).exec(h,c)}returnb}).push(function(a){varb,d,e,f=[];if(g){for(d=a.length,e=0;d>e;e+=1){if(b={id:a[e].__id,value:c.select_list?a[e]:{},doc:{}},c.select_list&&deleteb.value.__id,c.include_docs)thrownewError("QueryStorage does not support include docs");f.push(b)}a=f}returna})}},a.addStorage("query",c)}(jIO,RSVP),function(a,b,c){"use strict";functiond(b){this._sub_storage=a.createJIO(b.sub_storage)}functione(a,b){return-1!==a.indexOf(b,a.length-b.length)}varf=".json",g="/.jio_documents/",h="/";d.prototype.get=function(c){vard=this;return(newb.Queue).push(function(){returnd._sub_storage.getAttachment(g,c+f,{format:"json"})}).push(void0,function(b){if(binstanceofa.util.jIOError&&404===b.status_code)returnd._sub_storage.allAttachments(h).push(function(b){if(b.hasOwnProperty(c))return{};thrownewa.util.jIOError("Cannot find document "+c,404)});throwb})},d.prototype.allAttachments=function(b){varc=this;returnc._sub_storage.allAttachments(h).push(function(d){returnd.hasOwnProperty(b)?{enclosure:{}}:c._sub_storage.getAttachment(g,b+f).push(function(){return{}},function(c){if(cinstanceofa.util.jIOError&&404===c.status_code)thrownewa.util.jIOError("Cannot find document "+b,404);throwc})})},d.prototype.put=function(b,d){vare=this;returne._sub_storage.putAttachment(g,b+f,newc([JSON.stringify(d)],{type:"application/json"})).push(void0,function(h){if(hinstanceofa.util.jIOError&&404===h.status_code)returne._sub_storage.put(g,{}).push(function(){returne._sub_storage.putAttachment(g,b+f,newc([JSON.stringify(d)],{type:"application/json"}))});throwh}).push(function(){returnb})},d.prototype.remove=function(c){vard=this,e=!1;return(newb.Queue).push(function(){returnd._sub_storage.removeAttachment(h,c)}).push(void0,function(b){if(binstanceofa.util.jIOError&&404===b.status_code)returnvoid(e=!0);throwb}).push(function(){returnd._sub_storage.removeAttachment(g,c+f)}).push(void0,function(b){if(!e&&binstanceofa.util.jIOError&&404===b.status_code)returnc;throwb})},d.prototype.hasCapacity=function(a){return"list"===a},d.prototype.buildQuery=function(){varc={},d=this;return(newb.Queue).push(function(){returnd._sub_storage.allAttachments(g)}).push(function(a){varb;for(bina)a.hasOwnProperty(b)&&e(b,f)&&(c[b.substring(0,b.length-f.length)]=null)},function(b){if(!(binstanceofa.util.jIOError&&404===b.status_code))throwb}).push(function(){returnd._sub_storage.allAttachments(h)}).push(function(a){varb;for(bina)a.hasOwnProperty(b)&&(c[b]=null)}).push(function(){vara,b=[];for(ainc)c.hasOwnProperty(a)&&b.push({id:a,value:{}});returnb})},d.prototype.getAttachment=function(b,c){if("enclosure"!==c)thrownewa.util.jIOError("Only support 'enclosure' attachment",400);returnthis._sub_storage.getAttachment(h,b)},d.prototype.putAttachment=function(b,c,d){if("enclosure"!==c)thrownewa.util.jIOError("Only support 'enclosure' attachment",400);returnthis._sub_storage.putAttachment(h,b,d)},d.prototype.removeAttachment=function(b,c){if("enclosure"!==c)thrownewa.util.jIOError("Only support 'enclosure' attachment",400);returnthis._sub_storage.removeAttachment(h,b)},d.prototype.repair=function(){returnthis._sub_storage.repair.apply(this._sub_storage,arguments)},a.addStorage("drivetojiomapping",d)}(jIO,RSVP,Blob),function(a,b,c,d,e){"use strict";functionf(b){this._sub_storage=a.createJIO(b.sub_storage),this._document_id=b.document_id,this._repair_attachment=b.repair_attachment||!1}functiong(a,b){returnvoid0===b?"jio_document/"+d(a)+h:"jio_attachment/"+d(a)+"/"+d(b)}varh=".json",i=newRegExp("^jio_document/([\\w=]+)"+h+"$"),j=newRegExp("^jio_attachment/([\\w=]+)/([\\w=]+)$");f.prototype.get=function(a){returnthis._sub_storage.getAttachment(this._document_id,g(a),{format:"json"})},f.prototype.allAttachments=function(a){returnthis._sub_storage.allAttachments(this._document_id).push(function(b){vard,e,f={};for(einb)if(b.hasOwnProperty(e)&&j.test(e)){d=j.exec(e);try{c(d[1])===a&&(f[c(d[2])]={})}catch(g){if(!ginstanceofReferenceError)throwg}}returnf})},f.prototype.put=function(a,c){returnthis._sub_storage.putAttachment(this._document_id,g(a),newb([JSON.stringify(c)],{type:"application/json"})).push(function(){returna})},f.prototype.remove=function(a){varb=this;returnthis.allAttachments(a).push(function(c){vard,f=[];for(dinc)c.hasOwnProperty(d)&&f.push(b.removeAttachment(a,d));returne.all(f)}).push(function(){returnb._sub_storage.removeAttachment(b._document_id,g(a))}).push(function(){returna})},f.prototype.repair=function(){vara=this;returnthis._sub_storage.repair.apply(this._sub_storage,arguments).push(function(b){returna._repair_attachment?a._sub_storage.allAttachments(a._document_id).push(function(b){vard,f,g,h,k=[],l={},m={};for(hinb)if(b.hasOwnProperty(h))if(d=void0,f=void0,i.test(h)){try{d=c(i.exec(h)[1])}catch(n){if(!ninstanceofReferenceError)thrown}void0!==d&&(l[d]=null)}elseif(j.test(h)){g=j.exec(h);try{d=c(g[1]),f=c(g[2])}catch(n){if(!ninstanceofReferenceError)thrown}void0!==f&&(l.hasOwnProperty(d)||(m.hasOwnProperty(d)||(m[d]={}),m[d][f]=null))}for(dinm)if(m.hasOwnProperty(d)&&!l.hasOwnProperty(d))for(finm[d])m[d].hasOwnProperty(f)&&k.push(a.removeAttachment(d,f));returne.all(k)}):b})},f.prototype.hasCapacity=function(a){return"list"===a},f.prototype.buildQuery=function(){returnthis._sub_storage.allAttachments(this._document_id).push(function(a){varb,d=[];for(bina)if(a.hasOwnProperty(b)&&i.test(b))try{d.push({id:c(i.exec(b)[1]),value:{}})}catch(e){if(!einstanceofReferenceError)throwe}returnd})},f.prototype.getAttachment=function(a,b){returnthis._sub_storage.getAttachment(this._document_id,g(a,b))},f.prototype.putAttachment=function(a,b,c){returnthis._sub_storage.putAttachment(this._document_id,g(a,b),c)},f.prototype.removeAttachment=function(a,b){returnthis._sub_storage.removeAttachment(this._document_id,g(a,b))},a.addStorage("document",f)}(jIO,Blob,atob,btoa,RSVP),function(a,b,c,d){"use strict";functione(a){a.sessiononly===!0?this._storage=b:this._storage=c}functionf(b){if("/"!==b)thrownewa.util.jIOError("id "+b+" is forbidden (!== /)",400)}e.prototype.get=function(a){returnf(a),{}},e.prototype.allAttachments=function(a){f(a);varb,c={};for(binthis._storage)this._storage.hasOwnProperty(b)&&(c[b]={});returnc},e.prototype.getAttachment=function(b,c){f(b);vard=this._storage.getItem(c);if(null===d)thrownewa.util.jIOError("Cannot find attachment "+c,404);returna.util.dataURItoBlob(d)},e.prototype.putAttachment=function(b,c,e){varg=this;returnf(b),(newd.Queue).push(function(){returna.util.readBlobAsDataURL(e)}).push(function(a){g._storage.setItem(c,a.target.result)})},e.prototype.removeAttachment=function(a,b){returnf(a),this._storage.removeItem(b)},e.prototype.hasCapacity=function(a){return"list"===a},e.prototype.buildQuery=function(){return[{id:"/",value:{}}]},a.addStorage("local",e)}(jIO,sessionStorage,localStorage,RSVP),function(a,b,c,d,e,f,g,h){"use strict";functioni(a){if("string"!=typeofa.database||""===a.database)thrownewTypeError("IndexedDBStorage 'database' description property must be a non-empty string");this._database_name="jio:"+a.database}functionj(a){returna.join("_")}functionk(a){varb,c=a.target.result;b=c.createObjectStore("metadata",{keyPath:"_id",autoIncrement:!1}),b.createIndex("_id","_id",{unique:!0}),b=c.createObjectStore("attachment",{keyPath:"_key_path",autoIncrement:!1}),b.createIndex("_id","_id",{unique:!1}),b=c.createObjectStore("blob",{keyPath:"_key_path",autoIncrement:!1}),b.createIndex("_id_attachment",["_id","_attachment"],{unique:!1}),b.createIndex("_id","_id",{unique:!1})}functionl(b){functiond(b,c){vard=a.open(e);d.onerror=function(a){d.result&&d.result.close(),c(void0!==a&&a.targetinstanceofg&&a.target.errorinstanceofh?"Connection to: "+e+" failed: "+a.target.error.message:a)},d.onabort=function(){d.result.close(),c("Aborting connection to: "+e)},d.ontimeout=function(){d.result.close(),c("Connection to: "+e+" timeout")},d.onblocked=function(){d.result.close(),c("Connection to: "+e+" was blocked")},d.onupgradeneeded=k,d.onversionchange=function(){d.result.close(),c(e+" was upgraded")},d.onsuccess=function(){b(d.result)}}vare=b._database_name;return(newc.Queue).push(function(){returnnewc.Promise(d)})}functionm(a,b,c,d){vare=a.transaction(b,c);returnd!==!1&&(e.oncomplete=function(){a.close()}),e.onabort=function(){a.close()},e}functionn(a,b,c,d){a.onerror=function(b){a.transaction&&a.transaction.abort(),d(b)},a.onsuccess=function(a){vare=a.target.result;if(e){try{b(e)}catch(f){d(f)}e["continue"]()}elsec()}}functiono(a,c,d,e){varf=a.get(c);f.onerror=e,f.onsuccess=function(){f.result?d(f.result):e(newb.util.jIOError("IndexedDB: cannot find object '"+c+"' in the '"+a.name+"' store",404))}}functionp(a,b,c){a.onerror=c,a.onsuccess=function(){b(a.result)}}functionq(a){a["delete"]()}functionr(a,b,c,d,e){functiong(){n(a.objectStore("blob").index("_id_attachment").openCursor(f.only([b,c])),q,d,e)}p(a.objectStore("attachment")["delete"](j([b,c])),g,e)}vars=2e6;i.prototype.hasCapacity=function(a){return"list"===a||"include"===a},i.prototype.buildQuery=function(a){functionb(a){e.push({id:a.key,value:{},doc:a.value.doc})}functiond(a){e.push({id:a.key,value:{}})}vare=[];returnl(this).push(function(e){returnnewc.Promise(function(c,f){varg=m(e,["metadata"],"readonly");a.include_docs===!0?n(g.objectStore("metadata").index("_id").openCursor(),b,c,f):n(g.objectStore("metadata").index("_id").openKeyCursor(),d,c,f)})}).push(function(){returne})},i.prototype.get=function(a){returnl(this).push(function(b){returnnewc.Promise(function(c,d){vare=m(b,["metadata"],"readonly");o(e.objectStore("metadata"),a,c,d)})}).push(function(a){returna.doc})},i.prototype.allAttachments=function(a){functionb(a){d[a.value._attachment]={}}vard={};returnl(this).push(function(d){returnnewc.Promise(function(c,e){functiong(){n(h.objectStore("attachment").index("_id").openCursor(f.only(a)),b,c,e)}varh=m(d,["metadata","attachment"],"readonly");o(h.objectStore("metadata"),a,g,e)})}).push(function(){returnd})},i.prototype.put=function(a,b){returnl(this).push(function(d){returnnewc.Promise(function(c,e){varf=m(d,["metadata"],"readwrite");p(f.objectStore("metadata").put({_id:a,doc:b}),c,e)})})},i.prototype.remove=function(a){varb=0;returnl(this).push(function(d){returnnewc.Promise(function(c,e){functiong(){2>b?b+=1:c()}varh=m(d,["metadata","attachment","blob"],"readwrite");p(h.objectStore("metadata")["delete"](a),g,e),n(h.objectStore("attachment").index("_id").openCursor(f.only(a)),q,g,e),n(h.objectStore("blob").index("_id").openCursor(f.only(a)),q,g,e)})})},i.prototype.getAttachment=function(a,f,g){varh,i,k,n;returnvoid0===g&&(g={}),l(this).push(function(d){returnnewc.Promise(function(c,l){functionp(d){functionm(a){u.push(a),c(u)}functionp(b){returnfunction(c){c&&u.push(c),b+=1,o(v,j([a,f,b]),r>=b?p(b):m,l)}}varq,r,t=d.info.length,u=[],v=h.objectStore("blob");if(i=d.info.content_type,k=g.start||0,n=g.end||t,n>t&&(n=t),0>k||0>n)thrownewb.util.jIOError("_start and _end must be positive",400);if(k>n)thrownewb.util.jIOError("_start is greater than _end",400);q=e.floor(k/s),r=e.floor(n/s)-1,n%s===0&&(r-=1),p(q-1)()}h=m(d,["attachment","blob"],"readonly"),o(h.objectStore("attachment"),j([a,f]),p,l)})}).push(function(a){varb,c,f,h=[],j=a.length;for(c=0;j>c;c+=1)h.push(a[c].blob);returnvoid0===g.start&&void0===g.end?newd(h,{type:i}):(f=e.floor(k/s)*s,b=newd(h,{type:"application/octet-stream"}),b.slice(k-f,n-f,"application/octet-stream"))})},i.prototype.putAttachment=function(a,d,e){varf,g,h=[];returnl(this).push(function(a){returng=a,b.util.readBlobAsArrayBuffer(e)}).push(function(b){for(vari=b.target.result,k=e.size,l=0;k>l;)h.push(i.slice(l,l+s)),l+=s;returnf=m(g,["attachment","blob"],"readwrite"),newc.Promise(function(b,c){functiong(){functiong(e){returnfunction(){e+=1,p(l.put({_key_path:j([a,d,e]),_id:a,_attachment:d,_part:e,blob:h[e]}),i>e?g(e):b,c)}}vari=h.length-1,k=f.objectStore("attachment"),l=f.objectStore("blob");p(k.put({_key_path:j([a,d]),_id:a,_attachment:d,info:{content_type:e.type,length:e.size}}),g(-1),c)}r(f,a,d,g,c)})})},i.prototype.removeAttachment=function(a,b){returnl(this).push(function(d){vare=m(d,["attachment","blob"],"readwrite");returnnewc.Promise(function(c,d){r(e,a,b,c,d)})})},b.addStorage("indexeddb",i)}(indexedDB,jIO,RSVP,Blob,Math,IDBKeyRange,IDBOpenDBRequest,DOMError),function(a,b,c,d,e,f,g){"use strict";functionh(b){this._key=b.key,this._jsonKey=!0,this._sub_storage=a.createJIO(b.sub_storage)}functioni(a){return(newb.Queue).push(function(){returne.subtle.importKey("jwk",a._key,"AES-GCM",!1,["encrypt","decrypt"])}).push(function(b){a._key=b,a._jsonKey=!1})}varj="application/x-jio-aes-gcm-encryption";h.prototype.get=function(){returnthis._sub_storage.get.apply(this._sub_storage,arguments);},h.prototype.post=function(){returnthis._sub_storage.post.apply(this._sub_storage,arguments)},h.prototype.put=function(){returnthis._sub_storage.put.apply(this._sub_storage,arguments)},h.prototype.remove=function(){returnthis._sub_storage.remove.apply(this._sub_storage,arguments)},h.prototype.hasCapacity=function(){returnthis._sub_storage.hasCapacity.apply(this._sub_storage,arguments)},h.prototype.buildQuery=function(){returnthis._sub_storage.buildQuery.apply(this._sub_storage,arguments)},h.prototype.putAttachment=function(c,h,k){varl=e.getRandomValues(newf(12)),m=this;return(newb.Queue).push(function(){returnm._jsonKey===!0?i(m):void0}).push(function(){returna.util.readBlobAsDataURL(k)}).push(function(a){varb,c=a.target.result.length,d=newg(c),h=newf(d);for(a=a.target.result,b=0;c>b;b+=1)h[b]=a.charCodeAt(b);returne.subtle.encrypt({name:"AES-GCM",iv:l},m._key,d)}).push(function(a){varb=newd([l,a],{type:j});returnm._sub_storage.putAttachment(c,h,b)})},h.prototype.getAttachment=function(d,g){varh=this;returnh._sub_storage.getAttachment(d,g).push(function(d){returnd.type!==j?d:(newb.Queue).push(function(){returnh._jsonKey===!0?i(h):void0}).push(function(){returna.util.readBlobAsArrayBuffer(d)}).push(function(g){vari;returng=g.target.result,i=newf(g.slice(0,12)),(newb.Queue).push(function(){returne.subtle.decrypt({name:"AES-GCM",iv:i},h._key,g.slice(12))}).push(function(b){returnb=String.fromCharCode.apply(null,newf(b)),a.util.dataURItoBlob(b)}).push(void0,function(a){if(ainstanceofc)returnd;throwa})})})},h.prototype.removeAttachment=function(){returnthis._sub_storage.removeAttachment.apply(this._sub_storage,arguments)},h.prototype.allAttachments=function(){returnthis._sub_storage.allAttachments.apply(this._sub_storage,arguments)},a.addStorage("crypt",h)}(jIO,RSVP,DOMException,Blob,crypto,Uint8Array,ArrayBuffer),function(a,b,c,d){"use strict";functione(a,c,d){returnnewb.Promise(function(b,e){a.transaction(function(a){functionf(a,c){j.push(c),j.length===i&&b(j)}functiong(a,b){returne(b),!0}varh,i=c.length,j=[];for(h=0;i>h;h+=1)a.executeSql(c[h],d[h],f,g)},function(a,b){e(b)})})}functionf(a){varc=["CREATE TABLE IF NOT EXISTS document(id VARCHAR PRIMARY KEY NOT NULL, data TEXT)","CREATE TABLE IF NOT EXISTS attachment(id VARCHAR, attachment VARCHAR, part INT, blob TEXT)","CREATE TRIGGER IF NOT EXISTS removeAttachment BEFORE DELETE ON document FOR EACH ROW BEGIN DELETE from attachment WHERE id = OLD.id;END;","CREATE INDEX IF NOT EXISTS index_document ON document (id);","CREATE INDEX IF NOT EXISTS index_attachment ON attachment (id, attachment);"];return(newb.Queue).push(function(){returne(a,c,[])})}functiong(a){if("string"!=typeofa.database||!a.database)thrownewTypeError("database must be a string which contains more than one character.");if(this._database=d("jio:"+a.database,"1.0","",2097152),a.blob_length&&("number"!=typeofa.blob_length||a.blob_length<20))thrownewTypeError("blob_len parameter must be a number >= 20");this._blob_length=a.blob_length||2e6,this._init_db_promise=f(this._database)}functionh(b,c,d,e){e.push(function(){returna.util.readBlobAsDataURL(b)}).push(function(a){c[d+2].push(a.target.result)})}g.prototype.put=function(a,c){vard=this._database,f=this,g=JSON.stringify(c);return(newb.Queue).push(function(){returnf._init_db_promise}).push(function(){returne(d,["INSERT OR REPLACE INTO document(id, data) VALUES(?,?)"],[[a,g]])}).push(function(){returna})},g.prototype.remove=function(c){vard=this._database,f=this;return(newb.Queue).push(function(){returnf._init_db_promise}).push(function(){returne(d,["DELETE FROM document WHERE id = ?"],[[c]])}).push(function(b){if(0===b[0].rowsAffected)thrownewa.util.jIOError("Cannot find document",404);returnc})},g.prototype.get=function(c){vard=this._database,f=this;return(newb.Queue).push(function(){returnf._init_db_promise}).push(function(){returne(d,["SELECT data FROM document WHERE id = ?"],[[c]])}).push(function(b){if(0===b[0].rows.length)thrownewa.util.jIOError("Cannot find document",404);returnJSON.parse(b[0].rows[0].data)})},g.prototype.allAttachments=function(c){vard=this._database,f=this;return(newb.Queue).push(function(){returnf._init_db_promise}).push(function(){returne(d,["SELECT id FROM document WHERE id = ?","SELECT DISTINCT attachment FROM attachment WHERE id = ?"],[[c],[c]])}).push(function(b){if(0===b[0].rows.length)thrownewa.util.jIOError("Cannot find document",404);varc,d=b[1].rows.length,e={};for(c=0;d>c;c+=1)e[b[1].rows[c].attachment]={};returne})},g.prototype.putAttachment=function(c,d,f){varg=this._database,i=this,j=this._blob_length;return(newb.Queue).push(function(){returni._init_db_promise}).push(function(){returne(g,["SELECT id FROM document WHERE id = ?"],[[c]])}).push(function(i){vark,l,m=[],n=[],o=f.size,p=newb.Queue;if(0===i[0].rows.length)thrownewa.util.jIOError("Cannot access subdocument",404);for(m.push("DELETE FROM attachment WHERE id = ? AND attachment = ?"),n.push([c,d]),m.push("INSERT INTO attachment(id, attachment, part, blob)VALUES(?, ?, ?, ?)"),n.push([c,d,-1,f.type||"application/octet-stream"]),k=0,l=0;o>k;k+=j,l+=1)m.push("INSERT INTO attachment(id, attachment, part, blob)VALUES(?, ?, ?, ?)"),n.push([c,d,l]),h(f.slice(k,k+j),n,l,p);returnp.push(function(){returne(g,m,n)}),p})},g.prototype.getAttachment=function(d,f,g){varh,i,j,k,l=this._database,m=this,n=this._blob_length;if(void0===g&&(g={}),h=g.start||0,i=g.end||-1,0>h||void0!==g.end&&g.end<0)thrownewa.util.jIOError("_start and _end must be positive",400);if(h>i&&-1!==i)thrownewa.util.jIOError("_start is greater than _end",400);returnj=Math.floor(h/n),0===h&&(j-=1),k=Math.floor(i/n),i%n===0&&(k-=1),(newb.Queue).push(function(){returnm._init_db_promise}).push(function(){vara="SELECT part, blob FROM attachment WHERE id = ? AND attachment = ? AND part >= ?",b=[d,f,j];return-1!==i&&(a+=" AND part <= ?",b.push(k)),e(l,[a],[b])}).push(function(b){vard,e,f,k,l=[];if(e=b[0].rows,0===e.length)thrownewa.util.jIOError("Cannot find document",404);for(d=0;d<e.length;d+=1)-1===e[d].part?(k=e[d].blob,j+=1):l.push(a.util.dataURItoBlob(e[d].blob));return0===h&&void0===g.end?newc(l,{type:k}):(f=newc(l,{}),f.slice(h-j*n,-1===i?f.size:i-j*n,"application/octet-stream"))})},g.prototype.removeAttachment=function(c,d){varf=this._database,g=this;return(newb.Queue).push(function(){returng._init_db_promise}).push(function(){returne(f,["DELETE FROM attachment WHERE id = ? AND attachment = ?"],[[c,d]])}).push(function(b){if(0===b[0].rowsAffected)thrownewa.util.jIOError("Cannot find document",404);returnd})},g.prototype.hasCapacity=function(a){return"list"===a||"include"===a},g.prototype.buildQuery=function(a){varc=this._database,d=this,f="SELECT id";return(newb.Queue).push(function(){returnd._init_db_promise}).push(function(){returnvoid0===a&&(a={}),a.include_docs===!0&&(f+=", data AS doc"),f+=" FROM document",e(c,[f],[[]])}).push(function(a){varb,c=[],d=a[0].rows.length;for(b=0;d>b;b+=1)c.push(a[0].rows[b]),c[b].value={},void0!==c[b].doc&&(c[b].doc=JSON.parse(c[b].doc));returnc})},a.addStorage("websql",g)}(jIO,RSVP,Blob,openDatabase);