text: if(!self.window){window=self;}
  (function(){'use strict';function aa(){return function(){}}function ba(a){return function(b){this[a]=b}}function h(a){return function(){return this[a]}}function m(a){return function(){return a}}var n,ca=this||self;function q(a){return void 0!==a}function da(a){return"string"==typeof a}function ea(){}
  function fa(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
  else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ha(a){return null!=a}function ia(a){var b=fa(a);return"array"==b||"object"==b&&"number"==typeof a.length}function ja(a){return"function"==fa(a)}function ka(a){return a[la]||(a[la]=++ma)}var la="closure_uid_"+(1E9*Math.random()>>>0),ma=0;function oa(a,b,c){return a.call.apply(a.bind,arguments)}
  function pa(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}function qa(a,b,c){qa=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?oa:pa;return qa.apply(null,arguments)}
  function ra(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){a=a.split(".");var c=ca;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&q(b)?c[d]=b:c=c[d]&&c[d]!==Object.prototype[d]?c[d]:c[d]={}}
  function u(a,b){function c(){}c.prototype=b.prototype;a.hb=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.dh=function(d,e,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[e].apply(d,g)}};function sa(a){if(Error.captureStackTrace)Error.captureStackTrace(this,sa);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))}u(sa,Error);sa.prototype.name="CustomError";var ta=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(da(a))return da(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},ua=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=da(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},va=Array.prototype.map?function(a,b){return Array.prototype.map.call(a,b,void 0)}:function(a,b){for(var c=
  a.length,d=Array(c),e=da(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d},wa=Array.prototype.reduce?function(a,b,c){return Array.prototype.reduce.call(a,b,c)}:function(a,b,c){var d=c;ua(a,function(e,f){d=b.call(void 0,d,e,f,a)});return d},xa=Array.prototype.some?function(a,b){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=da(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1};
  function ya(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)}function za(a){for(var b=[],c=0;c<a;c++)b[c]=0;return b}function Aa(a){for(var b=[],c=0;c<arguments.length;c++){var d=arguments[c];if("array"==fa(d))for(var e=0;e<d.length;e+=8192)for(var f=Aa.apply(null,ya(d,e,e+8192)),g=0;g<f.length;g++)b.push(f[g]);else b.push(d)}return b};function Ba(a,b){this.xg=100;this.Wf=a;this.Sg=b;this.rd=0;this.gd=null}Ba.prototype.get=function(){if(0<this.rd){this.rd--;var a=this.gd;this.gd=a.next;a.next=null}else a=this.Wf();return a};Ba.prototype.put=function(a){this.Sg(a);this.rd<this.xg&&(this.rd++,a.next=this.gd,this.gd=a)};function Ca(a,b){this.yf=a===Da&&b||"";this.Ff=Ea}Ca.prototype.toString=function(){return"Const{"+this.yf+"}"};var Ea={},Da={},Fa=new Ca(Da,"");function Ga(){}Ga.prototype.Ab=function(){return this};(new Ga).Ab("");function Ha(){this.mf="";this.Bf=null;this.Gf=Ia}var Ia={};var Ja=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};function Ka(a,b){return-1!=a.indexOf(b)}
  function La(a){var b=0;a=Ja(String(a)).split(".");for(var c=Ja("10").split("."),d=Math.max(a.length,c.length),e=0;0==b&&e<d;e++){var f=a[e]||"",g=c[e]||"";do{f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];if(0==f[0].length&&0==g[0].length)break;b=Ma(0==f[1].length?0:parseInt(f[1],10),0==g[1].length?0:parseInt(g[1],10))||Ma(0==f[2].length,0==g[2].length)||Ma(f[2],g[2]);f=f[3];g=g[3]}while(0==b)}return b}function Ma(a,b){return a<b?-1:a>b?1:0};function Na(){}Na.prototype.Ab=function(){return this};(new Na).Ab("");function Oa(){}Oa.prototype.Ab=function(){return this};(new Oa).Ab("");var Pa;a:{var Qa=ca.navigator;if(Qa){var Ra=Qa.userAgent;if(Ra){Pa=Ra;break a}}Pa=""}function v(a){return Ka(Pa,a)};function Sa(){return v("Safari")&&!(Ua()||v("Coast")||v("Opera")||v("Edge")||v("Edg/")||v("OPR")||v("Firefox")||v("FxiOS")||v("Silk")||v("Android"))}function Ua(){return(v("Chrome")||v("CriOS"))&&!v("Edge")};function Va(){this.lf="";this.Ef=Wa}function Xa(){var a=Ya;if(a instanceof Va&&a.constructor===Va&&a.Ef===Wa)return a.lf;fa(a);return"type_error:SafeHtml"}var Wa={};Va.prototype.Ab=function(a){this.lf=a;return this};(new Va).Ab("<!DOCTYPE html>");var Ya=(new Va).Ab("");(new Va).Ab("<br>");function Za(a){var b=new Ha;b.mf=Fa instanceof Ca&&Fa.constructor===Ca&&Fa.Ff===Ea?Fa.yf:"type_error:Const";b.Bf?b=b.Bf:(b instanceof Ha&&b.constructor===Ha&&b.Gf===Ia?b=b.mf:(fa(b),b="type_error:TrustedResourceUrl"),b=b.toString());a.src=b};function $a(a){ca.setTimeout(function(){throw a;},0)}var ab;
  function bb(){var a=ca.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!v("Presto")&&(a=function(){var e=document.createElement("IFRAME");e.style.display="none";Za(e);document.documentElement.appendChild(e);var f=e.contentWindow;e=f.document;e.open();e.write(Xa());e.close();var g="callImmediate"+Math.random(),k="file:"==f.location.protocol?"*":f.location.protocol+"//"+f.location.host;e=qa(function(l){if(("*"==k||l.origin==k)&&l.data==
  g)this.port1.onmessage()},this);f.addEventListener("message",e,!1);this.port1={};this.port2={postMessage:function(){f.postMessage(g,k)}}});if("undefined"!==typeof a&&!v("Trident")&&!v("MSIE")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(q(c.next)){c=c.next;var e=c.Ge;c.Ge=null;e()}};return function(e){d.next={Ge:e};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?function(e){var f=document.createElement("SCRIPT");
  f.onreadystatechange=function(){f.onreadystatechange=null;f.parentNode.removeChild(f);f=null;e();e=null};document.documentElement.appendChild(f)}:function(e){ca.setTimeout(e,0)}};function cb(){this.Cd=this.pc=null}var eb=new Ba(function(){return new db},function(a){a.reset()});cb.prototype.add=function(a,b){var c=eb.get();c.set(a,b);this.Cd?this.Cd.next=c:this.pc=c;this.Cd=c};cb.prototype.remove=function(){var a=null;this.pc&&(a=this.pc,this.pc=this.pc.next,this.pc||(this.Cd=null),a.next=null);return a};function db(){this.next=this.scope=this.Ud=null}db.prototype.set=function(a,b){this.Ud=a;this.scope=b;this.next=null};
  db.prototype.reset=function(){this.next=this.scope=this.Ud=null};function fb(a,b){gb||hb();jb||(gb(),jb=!0);kb.add(a,b)}var gb;function hb(){if(ca.Promise&&ca.Promise.resolve){var a=ca.Promise.resolve(void 0);gb=function(){a.then(lb)}}else gb=function(){var b=lb;!ja(ca.setImmediate)||ca.Window&&ca.Window.prototype&&!v("Edge")&&ca.Window.prototype.setImmediate==ca.setImmediate?(ab||(ab=bb()),ab(b)):ca.setImmediate(b)}}var jb=!1,kb=new cb;function lb(){for(var a;a=kb.remove();){try{a.Ud.call(a.scope)}catch(b){$a(b)}eb.put(a)}jb=!1};function w(a,b){this.Sa=0;this.rf=void 0;this.Wc=this.dc=this.C=null;this.fd=this.Sd=!1;if(a!=ea)try{var c=this;a.call(b,function(d){mb(c,2,d)},function(d){mb(c,3,d)})}catch(d){mb(this,3,d)}}function nb(){this.next=this.context=this.ic=this.Ic=this.child=null;this.Fd=!1}nb.prototype.reset=function(){this.context=this.ic=this.Ic=this.child=null;this.Fd=!1};var ob=new Ba(function(){return new nb},function(a){a.reset()});function pb(a,b,c){var d=ob.get();d.Ic=a;d.ic=b;d.context=c;return d}
  function x(a){if(a instanceof w)return a;var b=new w(ea);mb(b,2,a);return b}function qb(a){return new w(function(b,c){c(a)})}function rb(a,b,c){sb(a,b,c,null)||fb(ra(b,a))}function tb(a){return new w(function(b,c){var d=a.length,e=[];if(d)for(var f=function(p,r){d--;e[p]=r;0==d&&b(e)},g=function(p){c(p)},k=0,l;k<a.length;k++)l=a[k],rb(l,ra(f,k),g);else b(e)})}function ub(){var a,b,c=new w(function(d,e){a=d;b=e});return new vb(c,a,b)}
  w.prototype.then=function(a,b,c){return wb(this,ja(a)?a:null,ja(b)?b:null,c)};w.prototype.$goog_Thenable=!0;w.prototype.we=function(a,b){return wb(this,null,a,b)};function xb(a,b){a.dc||2!=a.Sa&&3!=a.Sa||yb(a);a.Wc?a.Wc.next=b:a.dc=b;a.Wc=b}
  function wb(a,b,c,d){var e=pb(null,null,null);e.child=new w(function(f,g){e.Ic=b?function(k){try{var l=b.call(d,k);f(l)}catch(p){g(p)}}:f;e.ic=c?function(k){try{var l=c.call(d,k);!q(l)&&k instanceof zb?g(k):f(l)}catch(p){g(p)}}:g});e.child.C=a;xb(a,e);return e.child}w.prototype.Yg=function(a){this.Sa=0;mb(this,2,a)};w.prototype.Zg=function(a){this.Sa=0;mb(this,3,a)};
  function mb(a,b,c){0==a.Sa&&(a===c&&(b=3,c=new TypeError("Promise cannot resolve to itself")),a.Sa=1,sb(c,a.Yg,a.Zg,a)||(a.rf=c,a.Sa=b,a.C=null,yb(a),3!=b||c instanceof zb||Ab(a,c)))}function sb(a,b,c,d){if(a instanceof w)return xb(a,pb(b||ea,c||null,d)),!0;if(a)try{var e=!!a.$goog_Thenable}catch(g){e=!1}else e=!1;if(e)return a.then(b,c,d),!0;e=typeof a;if("object"==e&&null!=a||"function"==e)try{var f=a.then;if(ja(f))return Bb(a,f,b,c,d),!0}catch(g){return c.call(d,g),!0}return!1}
  function Bb(a,b,c,d,e){function f(l){k||(k=!0,d.call(e,l))}function g(l){k||(k=!0,c.call(e,l))}var k=!1;try{b.call(a,g,f)}catch(l){f(l)}}function yb(a){a.Sd||(a.Sd=!0,fb(a.cg,a))}function Cb(a){var b=null;a.dc&&(b=a.dc,a.dc=b.next,b.next=null);a.dc||(a.Wc=null);return b}
  w.prototype.cg=function(){for(var a;a=Cb(this);){var b=this.Sa,c=this.rf;if(3==b&&a.ic&&!a.Fd){var d;for(d=this;d&&d.fd;d=d.C)d.fd=!1}if(a.child)a.child.C=null,Db(a,b,c);else try{a.Fd?a.Ic.call(a.context):Db(a,b,c)}catch(e){Eb.call(null,e)}ob.put(a)}this.Sd=!1};function Db(a,b,c){2==b?a.Ic.call(a.context,c):a.ic&&a.ic.call(a.context,c)}function Ab(a,b){a.fd=!0;fb(function(){a.fd&&Eb.call(null,b)})}var Eb=$a;function zb(a){sa.call(this,a)}u(zb,sa);zb.prototype.name="cancel";
  function vb(a,b,c){this.ha=a;this.resolve=b;this.reject=c};function Fb(a,b,c,d){c=c||function(r,W){return r==W};d=d||function(r){return a[r]};for(var e=a.length,f=b.length,g=[],k=0;k<e+1;k++)g[k]=[],g[k][0]=0;for(var l=0;l<f+1;l++)g[0][l]=0;for(k=1;k<=e;k++)for(l=1;l<=f;l++)c(a[k-1],b[l-1])?g[k][l]=g[k-1][l-1]+1:g[k][l]=Math.max(g[k-1][l],g[k][l-1]);var p=[];k=e;for(l=f;0<k&&0<l;)c(a[k-1],b[l-1])?(p.unshift(d(k-1,l-1)),k--,l--):g[k-1][l]>g[k][l-1]?k--:l--;return p}function Gb(a){return wa(arguments,function(b,c){return b+c},0)}
  function Hb(a){return Gb.apply(null,arguments)/arguments.length}function Ib(a){var b=arguments.length;if(2>b)return 0;var c=Hb.apply(null,arguments);return Gb.apply(null,va(arguments,function(d){return Math.pow(d-c,2)}))/(b-1)}function Jb(a){return Math.sqrt(Ib.apply(null,arguments))};var Kb="StopIteration"in ca?ca.StopIteration:{message:"StopIteration",stack:""};function Lb(){}Lb.prototype.next=function(){throw Kb;};Lb.prototype.qc=function(){return this};function Mb(a){if(a instanceof Lb)return a;if("function"==typeof a.qc)return a.qc(!1);if(ia(a)){var b=0,c=new Lb;c.next=function(){for(;;){if(b>=a.length)throw Kb;if(b in a)return a[b++];b++}};return c}throw Error("Not implemented");}
  function Nb(a,b){if(ia(a))try{ua(a,b,void 0)}catch(c){if(c!==Kb)throw c;}else{a=Mb(a);try{for(;;)b.call(void 0,a.next(),void 0,a)}catch(c){if(c!==Kb)throw c;}}}function Ob(a){if(xa(arguments,function(e){return!e.length})||!arguments.length)return new Lb;var b=new Lb,c=arguments,d=za(c.length);b.next=function(){if(d){for(var e=va(d,function(g,k){return c[k][g]}),f=d.length-1;0<=f;f--){if(d[f]<c[f].length-1){d[f]++;break}if(0==f){d=null;break}d[f]=0}return e}throw Kb;};return b};function Pb(a,b){this.l={};this.a=[];this.Ta=this.Fb=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.addAll(a)}n=Pb.prototype;n.zc=h("Fb");n.wa=function(){Qb(this);for(var a=[],b=0;b<this.a.length;b++)a.push(this.l[this.a[b]]);return a};function Rb(a){Qb(a);return a.a.concat()}n.Oa=function(a){return Sb(this.l,a)};n.kd=function(){return 0==this.Fb};
  n.clear=function(){this.l={};this.Ta=this.Fb=this.a.length=0};n.remove=function(a){return Sb(this.l,a)?(delete this.l[a],this.Fb--,this.Ta++,this.a.length>2*this.Fb&&Qb(this),!0):!1};function Qb(a){if(a.Fb!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];Sb(a.l,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.Fb!=a.a.length){var e={};for(c=b=0;b<a.a.length;)d=a.a[b],Sb(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}}n.get=function(a,b){return Sb(this.l,a)?this.l[a]:b};
  n.set=function(a,b){Sb(this.l,a)||(this.Fb++,this.a.push(a),this.Ta++);this.l[a]=b};n.addAll=function(a){if(a instanceof Pb)for(var b=Rb(a),c=0;c<b.length;c++)this.set(b[c],a.get(b[c]));else for(b in a)this.set(b,a[b])};n.forEach=function(a,b){for(var c=Rb(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};n.clone=function(){return new Pb(this)};
  n.qc=function(a){Qb(this);var b=0,c=this.Ta,d=this,e=new Lb;e.next=function(){if(c!=d.Ta)throw Error("The map has changed since the iterator was created");if(b>=d.a.length)throw Kb;var f=d.a[b++];return a?f:d.l[f]};return e};function Sb(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function Tb(){return v("iPhone")&&!v("iPod")&&!v("iPad")};function Ub(a){var b=Vb;return Object.prototype.hasOwnProperty.call(b,10)?b[10]:b[10]=a(10)};var Wb=v("Opera"),Xb=v("Trident")||v("MSIE"),Yb=v("Edge"),Zb=v("Gecko")&&!(Ka(Pa.toLowerCase(),"webkit")&&!v("Edge"))&&!(v("Trident")||v("MSIE"))&&!v("Edge"),$b=Ka(Pa.toLowerCase(),"webkit")&&!v("Edge"),ac=v("Macintosh"),bc=v("Windows"),cc=v("Android"),dc=Tb(),ec=v("iPad"),fc=v("iPod"),gc;
  a:{var hc="",ic=function(){var a=Pa;if(Zb)return/rv:([^\);]+)(\)|;)/.exec(a);if(Yb)return/Edge\/([\d\.]+)/.exec(a);if(Xb)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if($b)return/WebKit\/(\S+)/.exec(a);if(Wb)return/(?:Version)[ \/]?(\S+)/.exec(a)}();ic&&(hc=ic?ic[1]:"");if(Xb){var jc,kc=ca.document;jc=kc?kc.documentMode:void 0;if(null!=jc&&jc>parseFloat(hc)){gc=String(jc);break a}}gc=hc}var lc=gc,Vb={};function mc(){return Ub(function(){return 0<=La(lc)})};var nc=function(){if(bc){var a=/Windows NT ([0-9.]+)/;return(a=a.exec(Pa))?a[1]:"0"}return ac?(a=/10[_.][0-9_.]+/,(a=a.exec(Pa))?a[0].replace(/_/g,"."):"10"):cc?(a=/Android\s+([^\);]+)(\)|;)/,(a=a.exec(Pa))?a[1]:""):dc||ec||fc?(a=/(?:iPhone|CPU)\s+OS\s+(\S+)/,(a=a.exec(Pa))?a[1].replace(/_/g,"."):""):""}();var oc=Tb()||v("iPod"),pc=v("iPad");/*
  
   Copyright 2015 The Lovefield Project Authors. All Rights Reserved.
  
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
  
       http://www.apache.org/licenses/LICENSE-2.0
  
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
  */
  function qc(){var a;!(a=Sa()&&!mc())&&(a=pc||oc)&&(a=!(0<=La(nc)));this.be=a;this.ng=!(this.be||Xb&&!mc());this.bh=Ua()||Sa();this.Cg=q(window.Map)&&q(window.Map.prototype.values)&&q(window.Map.prototype.forEach)&&!this.be;this.Dg=q(window.Set)&&q(window.Set.prototype.values)&&q(window.Set.prototype.forEach)&&!this.be}var rc;function sc(){q(rc)||(rc=new qc);return rc};function z(){this.l=new Pb;Object.defineProperty(this,"size",{get:function(){return this.l.zc()}})}z.prototype.clear=function(){this.l.clear()};z.prototype.clear=z.prototype.clear;z.prototype.delete=function(a){return this.l.remove(a)};z.prototype["delete"]=z.prototype.delete;z.prototype.forEach=function(a,b){return this.l.forEach(a,b)};z.prototype.forEach=z.prototype.forEach;z.prototype.get=function(a){return this.l.get(a)};z.prototype.get=z.prototype.get;z.prototype.has=function(a){return this.l.Oa(a)};
  z.prototype.has=z.prototype.has;z.prototype.set=function(a,b){return this.l.set(a,b)};z.prototype.set=z.prototype.set;var tc=sc().Cg;function A(){return tc?new window.Map:new z}function uc(a){return a instanceof z?Rb(a.l):Array.from(a.keys())}function B(a){return a instanceof z?a.l.wa():Array.from(a.values())};/*
  
   Copyright 2014 The Lovefield Project Authors. All Rights Reserved.
  
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
  
       http://www.apache.org/licenses/LICENSE-2.0
  
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
  */
  function vc(a,b){this.ra=a;this.m=b||this.Le()}var wc=0;n=vc.prototype;n.id=h("ra");n.Le=function(){return{}};n.Af=h("m");n.Ja=function(){return{id:this.ra,value:this.Af()}};n.nb=function(a){return"#"==a.substr(-1)?this.ra:null};function xc(a){return new vc(a.id,a.value)}function yc(a){return new vc(wc++,a||{})}function zc(a){if(null==a)return null;a=new Uint8Array(a);for(var b="",c=0;c<a.length;++c){var d=a[c].toString(16);b+=2>d.length?"0"+d:d}return b};var Ac={};t("lf.TransactionType",Ac);Ac.READ_ONLY=0;Ac.READ_WRITE=1;function C(a,b,c,d,e){this.xd=a;this.rg=b;this.ah=c;this.Yf=d;this.Rf=e}t("lf.TransactionStats",C);C.prototype.Wg=h("xd");C.prototype.success=C.prototype.Wg;C.prototype.qg=h("rg");C.prototype.insertedRowCount=C.prototype.qg;C.prototype.$g=h("ah");C.prototype.updatedRowCount=C.prototype.$g;C.prototype.Xf=h("Yf");C.prototype.deletedRowCount=C.prototype.Xf;C.prototype.Qf=h("Rf");C.prototype.changedTableCount=C.prototype.Qf;function Bc(a,b){this.zd=a;this.Qa=b||null;this.S=ub();this.xd=!1;this.za=null}Bc.prototype.ka=function(){return(0==this.zd?this.sc():Cc(this)).then(function(a){this.xd=!0;return a}.bind(this))};function Cc(a){try{Dc(a.Qa)}catch(b){return qb(b)}return Ec(a).then(function(b){this.Qa.ka();return b}.bind(a))}function Ec(a){Fc(a);Gc(a);return a.sc()}
  function Fc(a){a.Qa.ib.forEach(function(b,c){c=this.Qa.da().get(c);c=this.I(c.getName(),c.kb.bind(c),0);var d=B(b.va).map(function(f){return f.id()});b=B(b.la).map(function(f){return f[1]}).concat(B(b.ua));var e=0<b.length;0<d.length&&c.remove(d,e).we(this.Ue,this);c.put(b).we(this.Ue,this)},a)}function Gc(a){Hc(a.Qa).forEach(function(b){var c=this.I(b.getName(),xc,1);c.remove([]);c.put(b.Ja())},a)}Bc.prototype.Ue=function(a){this.S.reject(a)};
  Bc.prototype.Y=function(){if(null===this.za)if(this.xd)if(0==this.zd)this.za=new C(!0,0,0,0,0);else{var a=0,b=0,c=0,d=0;this.Qa.ib.forEach(function(e){d++;a+=e.ua.size;c+=e.la.size;b+=e.va.size});this.za=new C(!0,a,c,b,d)}else this.za=new C(!1,0,0,0,0);return this.za};function Ic(a){this.Tg=a}Ic.prototype.toString=h("Tg");var Jc=new Ic("backstore"),Kc=new Ic("cache"),Lc=new Ic("indexstore"),Mc=new Ic("engine"),Nc=new Ic("runner"),Oc=new Ic("observerregistry"),Pc=new Ic("schema");function Qc(a){if(a.wa&&"function"==typeof a.wa)return a.wa();if(da(a))return a.split("");if(ia(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b};function Rc(a){this.l=new Pb;a&&this.addAll(a)}function Sc(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+ka(a):b.substr(0,1)+a}n=Rc.prototype;n.zc=function(){return this.l.zc()};n.add=function(a){this.l.set(Sc(a),a)};n.addAll=function(a){a=Qc(a);for(var b=a.length,c=0;c<b;c++)this.add(a[c])};n.remove=function(a){return this.l.remove(Sc(a))};n.clear=function(){this.l.clear()};n.kd=function(){return this.l.kd()};n.contains=function(a){return this.l.Oa(Sc(a))};n.wa=function(){return this.l.wa()};
  n.clone=function(){return new Rc(this)};n.qc=function(){return this.l.qc(!1)};function Tc(a){this.Zb=new Rc(a);Object.defineProperty(this,"size",{get:function(){return this.Zb.zc()}})}Tc.prototype.add=function(a){this.Zb.add(a)};Tc.prototype.add=Tc.prototype.add;Tc.prototype.clear=function(){this.Zb.clear()};Tc.prototype.clear=Tc.prototype.clear;Tc.prototype.delete=function(a){return this.Zb.remove(a)};Tc.prototype["delete"]=Tc.prototype.delete;Tc.prototype.forEach=function(a,b){this.Zb.wa().forEach(a,b)};Tc.prototype.has=function(a){return this.Zb.contains(a)};
  Tc.prototype.has=Tc.prototype.has;var Uc=sc().Dg;function D(a){return Uc?q(a)?new window.Set(a):new window.Set:new Tc(a)}function E(a){return a instanceof Tc?a.Zb.wa():Array.from(a)}function Vc(a,b){if(b.size>a.size)return!1;var c=!0;b.forEach(function(d){c=c&&a.has(d)});return c};function Wc(a,b){this.ra=a;this.m=b||{}}function Xc(a){var b=D();a.forEach(function(c){b.add(c>>9)});return E(b)}Wc.prototype.W=h("ra");function Yc(a,b){b.forEach(function(c){this.m[c.id()]=c.Ja()},a)}function Zc(a,b){b.forEach(function(c){delete this.m[c]},a)}Wc.prototype.Ja=function(){return{id:this.ra,value:JSON.stringify(this.m)}};function $c(a){return new Wc(a.id,JSON.parse(a.value))};function ad(a,b,c){this.ba=a;this.Pb=b;this.sf=c}n=ad.prototype;n.get=function(a){if(0==a.length)return this.Wd();var b=this.Pb;return bd(this,a).then(function(c){return a.map(function(d){var e=c.get(d>>9);return b(e.m[d])})})};function bd(a,b){var c=A(),d=ub();a=Xc(b).map(function(e){return new w(function(f,g){try{var k=this.ba.get(e)}catch(l){g(l);return}k.onerror=g;k.onsuccess=function(l){l=$c(l.target.result);c.set(l.W(),l);f()}},this)},a);tb(a).then(function(){d.resolve(c)});return d.ha}
  n.Wd=function(){return new w(function(a,b){var c=[];try{var d=this.ba.openCursor()}catch(e){b(e);return}d.onerror=b;d.onsuccess=function(){var e=d.result;if(e){var f=$c(e.value).m,g;for(g in f)c.push(this.Pb(f[g]));e.continue()}else a(c)}.bind(this)},this)};n.Vb=function(a){return new w(function(b,c){try{var d=a()}catch(e){c(e);return}d.onsuccess=b;d.onerror=c},this)};
  n.put=function(a){if(0==a.length)return x();var b=A();a.forEach(function(c){var d=c.id()>>9,e=b.get(d)||null;null===e&&(e=this.sf(this.ba.name,d));Yc(e,[c]);b.set(d,e)},this);a=B(b).map(function(c){return this.Vb(function(){return this.ba.put(c.Ja())}.bind(this))},this);return tb(a)};
  n.remove=function(a){if(0==a.length)return this.Vb(function(){return this.ba.clear()}.bind(this));var b=A();a.forEach(function(c){var d=c>>9,e=b.get(d)||null;null===e&&(e=this.sf(this.ba.name,d));Zc(e,[c]);b.set(d,e)},this);a=B(b).map(function(c){return this.Vb(function(){return 0==Object.keys(c.m).length?this.ba.delete(c.W()):this.ba.put(c.Ja())}.bind(this))},this);return tb(a)};function cd(a,b,c){a=a.b(Kc);var d=[c<<9,(c+1<<9)-1];b=a.Ua(b,d[0],d[1]);c=new Wc(c);Yc(c,b);return c}
  function dd(a,b){return new Wc(b)};function ed(a){this.V=a.b(Kc);this.B=a.b(Lc);this.g=a.b(Pc)}ed.prototype.update=function(a){a.forEach(function(b){fd(this,b);gd(this,b)},this)};function gd(a,b){var c=b.getName();b.va.forEach(function(d,e){this.V.remove(c,e)},a);b.ua.forEach(function(d){this.V.set(c,d)},a);b.la.forEach(function(d){this.V.set(c,d[1])},a)}function fd(a,b){var c=a.g.table(b.getName());hd(b).forEach(function(d){id(this,c,d)},a)}
  function id(a,b,c){var d=a.B.lc.get(b.getName())||[],e=0;d.forEach(function(f){try{jd(f,c),e++}catch(g){throw d.slice(0,e).forEach(function(k){jd(k,[c[1],c[0]])},this),g;}},a)}function jd(a,b){var c=null===b[1]?void 0:b[1].nb(a.getName()),d=null===b[0]?void 0:b[0].nb(a.getName());if(!q(d)&&q(c))a.add(c,b[1].id());else if(q(d)&&q(c)){if(null===c||null===d){if(c==d)return}else if(0==a.jb().compare(d,c))return;a.add(c,b[1].id());a.remove(d,b[0].id())}else q(d)&&!q(c)&&a.remove(d,b[0].id())};var kd={};t("lf.ConstraintAction",kd);kd.RESTRICT=0;kd.CASCADE=1;var ld={};t("lf.ConstraintTiming",ld);ld.IMMEDIATE=0;ld.DEFERRABLE=1;var md={};t("lf.Order",md);md.DESC=0;md.ASC=1;var nd={};t("lf.Type",nd);nd.ARRAY_BUFFER=0;nd.BOOLEAN=1;nd.DATE_TIME=2;nd.INTEGER=3;nd.NUMBER=4;nd.STRING=5;nd.OBJECT=6;var od={0:null,1:!1,2:Object.freeze(new Date(0)),3:0,4:0,5:"",6:null};t("lf.type.DEFAULT_VALUES",od);function F(a,b){this.message="http://google.github.io/lovefield/error_lookup/src/error_lookup.html?c="+a;if(1<arguments.length)for(var c=1;c<=Math.min(4,arguments.length-1);++c)this.message+="&p"+(c-1)+"="+encodeURIComponent(String(arguments[c]).slice(0,64))}u(F,Error);function pd(){this.l=A();this.size=0}n=pd.prototype;n.has=function(a){return this.l.has(a)};n.set=function(a,b){var c=this.l.get(a)||null;null===c&&(c=D(),this.l.set(a,c));c.has(b)||(c.add(b),this.size++);return this};n.Yb=function(a,b){var c=this.l.get(a)||null;null===c&&(c=D(),this.l.set(a,c));b.forEach(function(d){c.has(d)||(c.add(d),this.size++)},this)};n.ce=function(a){a.keys().forEach(function(b){var c=a.get(b);this.Yb(b,c)},this)};
  n.delete=function(a,b){var c=this.l.get(a)||null;if(null===c)return!1;if(b=c.delete(b))--this.size,0==c.size&&this.l.delete(a);return b};n.get=function(a){a=this.l.get(a)||null;return null===a?null:E(a)};n.clear=function(){this.l.clear();this.size=0};n.keys=function(){return uc(this.l)};n.values=function(){var a=[];this.l.forEach(function(b){a.push.apply(a,E(b))});return a};function qd(a){this.B=a.b(Lc);this.g=a.b(Pc);this.V=a.b(Kc);this.ad=null}function rd(a,b,c){var d=b.Nb.Fg;c.forEach(function(e){d.forEach(function(f){if(null==e.m[f.getName()])throw new F(202,f.j());},this)},a)}function sd(a,b,c,d){b.Nb.Vd.forEach(function(e){e.timing==d&&td(this,e,c)},a)}function td(a,b,c){var d=ud(a,b);c.forEach(function(e){if(vd(e[0],e[1],b.name)&&(e=e[1].nb(b.name),null!==e&&!d.Oa(e)))throw new F(203,b.name);},a)}
  function ud(a,b){null===a.ad&&(a.ad=A());var c=a.ad.get(b.name)||null;null===c&&(c=a.g.table(b.Wa)[b.Jc].Ca(),c=a.B.get(c.j()),a.ad.set(b.name,c));return c}function vd(a,b,c){return(null===a?null!==b:null===b)||a.nb(c)!=b.nb(c)}function wd(a,b,c,d){b=xd(a.g.info(),b.getName(),0);null!==b&&(b=b.filter(function(e){return e.timing==d}),0!=b.length&&yd(a,b,c,function(e,f,g){if(f.Oa(g))throw new F(203,e.name);}))}
  function zd(a,b,c){b=xd(a.g.info(),b.getName(),1);if(null===b)return null;var d=new pd;yd(a,b,c,function(e,f,g){f=f.get(g);0<f.length&&d.Yb(e.He,f)});return d}function Ad(a,b,c){var d=new pd;yd(a,c,b,function(e,f,g,k){f.get(g).forEach(function(l){d.set(l,{Td:e,Kg:k[1]})})});return d}function yd(a,b,c,d){b.forEach(function(e){var f=this.B.get(e.name),g=ud(this,e);c.forEach(function(k){if(vd(k[0],k[1],g.getName())){var l=k[0].nb(g.getName());d(e,f,l,k)}},this)},a)}
  function Bd(a,b,c,d){0!=c.length&&(c=c.map(function(e){return[null,e]}),sd(a,b,c,d))}function Cd(a,b,c,d){0!=c.length&&(sd(a,b,c,d),wd(a,b,c,d))}function Dd(a,b,c,d){0!=c.length&&(c=c.map(function(e){return[e,null]}),wd(a,b,c,d))}
  function Ed(a,b,c){var d={ve:[],uf:new pd},e=new pd;e.Yb(b.getName(),c.map(function(g){return g.id()}));do{var f=new pd;e.keys().forEach(function(g){var k=this.g.table(g);g=e.get(g).map(function(l){return[this.V.get(l),null]},this);k=zd(this,k,g);null!==k&&(d.ve.unshift.apply(d.ve,k.keys()),f.ce(k))},a);e=f;d.uf.ce(e)}while(0<e.size);return d};function Fd(a){this.ua=A();this.la=A();this.va=A();this.A=a}n=Fd.prototype;n.getName=h("A");n.add=function(a){if(this.va.has(a.id())){var b=[this.va.get(a.id()),a];this.la.set(a.id(),b);this.va.delete(a.id())}else this.ua.set(a.id(),a)};n.modify=function(a){var b=a[1],c=a[0].id();this.ua.has(c)?this.ua.set(c,b):this.la.has(c)?(a=[this.la.get(a[0].id())[0],b],this.la.set(c,a)):this.la.set(c,a)};
  n.delete=function(a){if(this.ua.has(a.id()))this.ua.delete(a.id());else if(this.la.has(a.id())){var b=this.la.get(a.id())[0];this.la.delete(a.id());this.va.set(a.id(),b)}else this.va.set(a.id(),a)};n.ce=function(a){a.ua.forEach(function(b){this.add(b)},this);a.la.forEach(function(b){this.modify(b)},this);a.va.forEach(function(b){this.delete(b)},this)};
  function hd(a){var b=[];a.ua.forEach(function(c){b.push([null,c])});a.la.forEach(function(c){b.push(c)});a.va.forEach(function(c){b.push([c,null])});return b}n.toString=function(){return"["+uc(this.ua).toString()+"], ["+uc(this.la).toString()+"], ["+uc(this.va).toString()+"]"};function Gd(a){var b=new Fd(a.A);a.ua.forEach(function(c){b.delete(c)});a.va.forEach(function(c){b.add(c)});a.la.forEach(function(c){b.modify([c[1],c[0]])});return b}
  n.kd=function(){return 0==this.ua.size&&0==this.va.size&&0==this.la.size};function Hd(a,b){this.$=A();b.forEach(function(c){this.$.set(c.getName(),c)},this);this.g=a.b(Pc);this.V=a.b(Kc);this.B=a.b(Lc);this.Aa=new qd(a);this.hd=new ed(a);this.ib=A()}function Hc(a){var b=[];uc(a.ib).map(function(c){return this.$.get(c)},a).forEach(function(c){c.Db()&&(c.Da().forEach(function(d){b.push(this.B.get(d.j()))},this),b.push(this.B.get(c.getName()+".#")))},a);return b}n=Hd.prototype;n.da=h("$");
  n.Bb=function(a,b){Id(this,a);rd(this.Aa,a,b);Bd(this.Aa,a,b,0);for(var c=0;c<b.length;c++)Jd(this,a,[null,b[c]])};function Jd(a,b,c){var d=b.getName(),e=a.ib.get(d)||new Fd(d);a.ib.set(d,e);try{id(a.hd,b,c)}catch(g){throw g;}b=c[0];var f=c[1];null===b&&null!==f?(a.V.set(d,f),e.add(f)):null!==b&&null!==f?(a.V.set(d,f),e.modify(c)):null!==b&&null===f&&(a.V.remove(d,b.id()),e.delete(b))}
  n.update=function(a,b){Id(this,a);rd(this.Aa,a,b);b=b.map(function(c){return[this.V.get(c.id()),c]},this);Kd(this,a,b);Cd(this.Aa,a,b,0);b.forEach(function(c){Jd(this,a,c)},this)};n.Xd=function(a,b){Id(this,a);rd(this.Aa,a,b);for(var c=0;c<b.length;c++){var d=b[c],e=null,f=a.Nb.td;if(null===f)var g=null;else{g=this.Aa;f=f.j();var k=d.nb(f);g=g.B.get(f).get(k);g=0==g.length?null:g[0]}null!=g?(e=this.V.get(g),d.ra=g,Cd(this.Aa,a,[[e,d]],0)):Bd(this.Aa,a,[d],0);Jd(this,a,[e,d])}};
  n.remove=function(a,b){Id(this,a);Ld(this,a,b);Dd(this.Aa,a,b,0);for(var c=0;c<b.length;c++)Jd(this,a,[b[c],null])};function Kd(a,b,c){b=xd(a.g.info(),b.getName(),1);if(null!==b){var d=Ad(a.Aa,c,b);d.keys().forEach(function(e){d.get(e).forEach(function(f){var g=this.g.table(f.Td.He),k=this.V.get(e),l=g.kb(k.Ja());l.m[f.Td.vb]=f.Kg.m[f.Td.Jc];Jd(this,g,[k,l])},this)},a)}}
  function Ld(a,b,c){if(null!==xd(a.g.info(),b.getName(),1)){b=Ed(a.Aa,b,c);var d=b.uf;b.ve.forEach(function(e){var f=this.g.table(e);e=d.get(e).map(function(g){return this.V.get(g)},this);Dd(this.Aa,f,e,0);e.forEach(function(g){Jd(this,f,[g,null])},this)},a)}}function Dc(a){a.ib.forEach(function(b){var c=this.$.get(b.getName());Bd(this.Aa,c,B(b.ua),1);Dd(this.Aa,c,B(b.va),1);Cd(this.Aa,c,B(b.la),1)},a)}n.ka=aa();n.Jb=function(){var a=B(this.ib).map(function(b){return Gd(b)});this.hd.update(a)};
  function Id(a,b){if(!a.$.has(b.getName()))throw new F(106,b.getName());};function Md(a,b,c,d){this.from=a;this.o=b;this.ea=this.from==G?!1:c;this.na=this.o==G?!1:d}var G=new (aa());Md.prototype.toString=function(){return(this.ea?"(":"[")+(this.from==G?"unbound":this.from)+", "+(this.o==G?"unbound":this.o)+(this.na?")":"]")};function Nd(a){if(Od(a))return[];var b=null,c=null;a.from==G||(b=new Md(G,a.from,!1,!a.ea));a.o==G||(c=new Md(a.o,G,!a.na,!1));return[b,c].filter(function(d){return null!==d})}Md.prototype.reverse=function(){return new Md(this.o,this.from,this.na,this.ea)};
  function Pd(a,b){var c=Qd(a.from,b.from,!0,a.ea,b.ea);if(0==c)return!0;var d=-1==c?a:b;a=1==c?a:b;return d.o==G||d.o>a.from||d.o==a.from&&!d.na&&!a.ea}function Rd(){return new Md(G,G,!1,!1)}function Od(a){return a.from==G&&a.o==G}function Sd(a){return a.from==a.o&&a.from!=G&&!a.ea&&!a.na}Md.prototype.contains=function(a){var b=this.o==G||a<this.o||a==this.o&&!this.na;return(this.from==G||a>this.from||a==this.from&&!this.ea)&&b};
  function Qd(a,b,c,d,e){function f(g){return c?g:1==g?-1:1}d=d||!1;e=e||!1;return a==G?b==G?(d?!e:e)?d?f(1):f(-1):0:f(-1):b==G?f(1):a<b?-1:a==b?(d?!e:e)?d?f(1):f(-1):0:1}function Td(a,b){var c=Qd(a.from,b.from,!0,a.ea,b.ea);0==c&&(c=Qd(a.o,b.o,!1,a.na,b.na));return c}function Ud(a){if(0==a.length)return[];a.sort(Td);for(var b=Array(a.length+1),c=0;c<b.length;c++)b[c]=0==c?new Md(G,a[c].from,!1,!0):c==b.length-1?new Md(a[c-1].o,G,!0,!1):new Md(a[c-1].o,a[c].from,!0,!0);return b};function Vd(a){this.kc=[];q(a)&&this.add(a)}Vd.prototype.toString=function(){return this.kc.map(function(a){return a.toString()}).join(",")};Vd.prototype.Oa=function(a){return this.kc.some(function(b){return b.contains(a)})};Vd.prototype.wa=h("kc");
  Vd.prototype.add=function(a){if(0!=a.length)if(a=this.kc.concat(a),1==a.length)this.kc=a;else{a.sort(Td);for(var b=[],c=a[0],d=1;d<a.length;++d)if(Pd(c,a[d])){var e=a[d],f=Rd();if(c.from!=G&&e.from!=G){var g=Qd(c.from,e.from,!0);1!=g?(f.from=c.from,f.ea=0!=g?c.ea:c.ea&&e.ea):(f.from=e.from,f.ea=e.ea)}c.o!=G&&e.o!=G&&(g=Qd(c.o,e.o,!1),-1!=g?(f.o=c.o,f.na=0!=g?c.na:c.na&&e.na):(f.o=e.o,f.na=e.na));c=f}else b.push(c),c=a[d];b.push(c);this.kc=b}};
  function Wd(a,b){var c=[];a.wa().map(function(d){return b.wa().map(function(e){if(Pd(d,e)){var f=Rd();var g=Qd(d.from,e.from,!0);g=0==g?d.ea?d:e:-1!=g?d:e;f.from=g.from;f.ea=g.ea;d.o==G||e.o==G?e=d.o==G?e:d:(g=Qd(d.o,e.o,!1),e=0==g?d.na?d:e:-1==g?d:e);f.o=e.o;f.na=e.na}else f=null;return f})}).forEach(function(d){c=c.concat(d)});return new Vd(c.filter(function(d){return null!==d}))};function H(a,b){this.entries=a;this.M=D(b);this.Za=null}H.prototype.s=function(){return E(this.M)};function Xd(a){return a.entries.map(function(b){return b.ta.m})}function Yd(a){return a.entries.map(function(b){return b.ta.id()})}function Zd(a,b){return a.Za.get(b.j())}var $d=null;function ae(){null===$d&&($d=new H([],[]));return $d}
  function be(a){if(0==a.length)return ae();var b=a.reduce(function(g,k){return g+k.entries.length},0),c=Array(b),d=0;b=a.map(function(g){var k=A();g.entries.forEach(function(l){c[d++]=l;k.set(l.id,l)});return k});for(var e=A(),f=0;f<c.length;f++)b.every(function(g){return g.has(c[f].id)})&&e.set(c[f].id,c[f]);return new H(B(e),E(a[0].M))}function ce(a){if(0==a.length)return ae();var b=A();a.forEach(function(c){c.entries.forEach(function(d){b.set(d.id,d)})});return new H(B(b),E(a[0].M))}
  function de(a,b){var c=1<b.length;a=a.map(function(d){return new ee(d,c)});return new H(a,b)}function ee(a,b){this.ta=a;this.id=fe++;this.Zd=b}var fe=0;function I(a,b){var c=b.Ka;return null!==c&&a.ta.m.hasOwnProperty(c)?a.ta.m[c]:a.Zd?a.ta.m[ge(b.I())][b.getName()]:a.ta.m[b.getName()]}function he(a,b,c){var d=b.Ka;if(null!=d)a.ta.m[d]=c;else if(a.Zd){d=ge(b.I());var e=a.ta.m[d];null==e&&(e={},a.ta.m[d]=e);e[b.getName()]=c}else a.ta.m[b.getName()]=c}
  function ie(a,b,c,d){function e(g,k){if(g.Zd){g=g.ta.m;for(var l in g)f[l]=g[l]}else f[k[0]]=g.ta.m}var f={};e(a,b);e(c,d);a=new vc(-1,f);return new ee(a,!0)};t("lf.bind",function(a){return new je(a)});function je(a){this.fa=a}t("lf.Binder",je);je.prototype.Ca=h("fa");function ke(){this.$e=le();var a=me();this.Qb=A();this.Qb.set(1,ne());this.Qb.set(2,oe());this.Qb.set(4,a);this.Qb.set(3,a);this.Qb.set(5,pe());this.Qb.set(6,qe())}var re;function se(){null!=re||(re=new ke);return re}function te(a,b,c){a=a.Qb.get(b)||null;if(null===a)throw new F(550);c=a.get(c)||null;if(null===c)throw new F(550);return c}
  function le(){function a(c){return c}var b=A();b.set(1,function(c){return null===c?null:c?1:0});b.set(2,function(c){return null===c?null:c.getTime()});b.set(3,a);b.set(4,a);b.set(5,a);return b}function ne(){var a=A();a.set("eq",function(b,c){return b==c});a.set("neq",function(b,c){return b!=c});return a}
  function me(){var a=ne();a.set("between",function(b,c){return null===b||null===c[0]||null===c[1]?!1:b>=c[0]&&b<=c[1]});a.set("gte",function(b,c){return null===b||null===c?!1:b>=c});a.set("gt",function(b,c){return null===b||null===c?!1:b>c});a.set("in",function(b,c){return-1!=c.indexOf(b)});a.set("lte",function(b,c){return null===b||null===c?!1:b<=c});a.set("lt",function(b,c){return null===b||null===c?!1:b<c});return a}
  function pe(){var a=me();a.set("match",function(b,c){return null===b||null===c?!1:(new RegExp(c)).test(b)});return a}function qe(){var a=A();a.set("eq",function(b,c){if(null!==c)throw new F(550);return null===b});a.set("neq",function(b,c){if(null!==c)throw new F(550);return null!==b});return a}
  function oe(){var a=A();a.set("between",function(b,c){return null===b||null===c[0]||null===c[1]?!1:b.getTime()>=c[0].getTime()&&b.getTime()<=c[1].getTime()});a.set("eq",function(b,c){return(null===b?-1:b.getTime())==(null===c?-1:c.getTime())});a.set("gte",function(b,c){return null===b||null===c?!1:b.getTime()>=c.getTime()});a.set("gt",function(b,c){return null===b||null===c?!1:b.getTime()>c.getTime()});a.set("in",function(b,c){return c.some(function(d){return d.getTime()==b.getTime()})});a.set("lte",
  function(b,c){return null===b||null===c?!1:b.getTime()<=c.getTime()});a.set("lt",function(b,c){return null===b||null===c?!1:b.getTime()<c.getTime()});a.set("neq",function(b,c){return(null===b?-1:b.getTime())!=(null===c?-1:c.getTime())});return a};function J(){this.h=this.C=null}var ue=[];J.prototype.getParent=h("C");J.prototype.bb=function(){for(var a=this;null!==a.getParent();)a=a.getParent();return a};function ve(a){for(var b=0;null!==a.getParent();)b++,a=a.getParent();return b}function M(a){return a.h||ue}function we(a,b){return M(a)[b]||null}function xe(a,b,c){b.C=a;null===a.h?a.h=[b]:a.h.splice(c,0,b)}function ye(a,b){b.C=a;null===a.h?a.h=[b]:a.h.push(b)}
  function ze(a,b){var c=a.h&&a.h[b];return c?(c.C=null,a.h.splice(b,1),0==a.h.length&&(a.h=null),c):null}J.prototype.removeChild=function(a){return ze(this,M(this).indexOf(a))};function Ae(a,b,c){we(a,c).C=null;b.C=a;a.h[c]=b}function Be(a,b,c){!1!==b.call(c,a)&&M(a).forEach(function(d){Be(d,b,c)})};function Ce(){J.call(this);this.ra=De++}u(Ce,J);var De=0;Ce.prototype.W=h("ra");function Ee(a,b,c){Ce.call(this);this.J=a;this.value=b;this.F=c;this.vc=te(se(),this.J.G(),this.F);this.Va=!1;this.cc=b}u(Ee,Ce);n=Ee.prototype;n.Ob=function(){var a=new Ee(this.J,this.value,this.F);a.cc=this.cc;a.wd(this.Va);var b=this.W();a.ra=b;return a};n.lb=function(a){return null!=a?(a.push(this.J),a):[this.J]};n.s=function(a){a=null!=a?a:D();a.add(this.J.I());return a};n.wd=ba("Va");
  function Fe(a){var b=!1;a.value instanceof je||(b="array"==fa(a.value)?!a.value.some(function(c){return c instanceof je}):!0);if(!b)throw new F(501);}n.eval=function(a){Fe(this);if("in"==this.F)return Ge(this,a);var b=a.entries.filter(function(c){return this.vc(I(c,this.J),this.value)!=this.Va},this);return new H(b,a.s())};
  n.bind=function(a){if(this.cc instanceof je){var b=this.cc.Ca();if(a.length<=b)throw new F(510);this.value=a[b]}else"array"==fa(this.cc)&&(this.value=this.cc.map(function(c){if(c instanceof je){var d=c.Ca();if(a.length<=d)throw new F(510);return a[c.Ca()]}return c}))};function Ge(a,b){var c=D(a.value),d=function(e){return null===e?!1:c.has(e)!=this.Va}.bind(a);a=b.entries.filter(function(e){return d(I(e,this.J))},a);return new H(a,b.s())}
  n.toString=function(){return"value_pred("+this.J.j()+" "+this.F+(this.Va?"(complement)":"")+" "+this.value+")"};n.md=function(){Fe(this);return null!==this.value&&("between"==this.F||"in"==this.F||"eq"==this.F||"gt"==this.F||"gte"==this.F||"lt"==this.F||"lte"==this.F)};
  n.xe=function(){var a=null;if("between"==this.F)a=new Md(He(this,this.value[0]),He(this,this.value[1]),!1,!1);else{if("in"==this.F)return a=this.value.map(function(b){return new Md(b,b,!1,!1)}),new Vd(this.Va?Ud(a):a);a=He(this,this.value);a="eq"==this.F?new Md(a,a,!1,!1):"gte"==this.F?new Md(a,G,!1,!1):"gt"==this.F?new Md(a,G,!0,!1):"lte"==this.F?new Md(G,a,!1,!1):new Md(G,a,!1,!0)}return new Vd(this.Va?Nd(a):[a])};function He(a,b){return 2==a.J.G()?b.getTime():b};function Ie(a){this.aa=a;this.Xc=this.Ga=null}function Je(a,b){null===a.Ga&&null!=a.w&&(a.Ga=Ke(a.w));return a.Ga.get(b)||null}function Ke(a){var b=A();Be(a,function(c){b.set(c.W(),c)});return b}function Le(a,b){b.w&&(a.w=b.w.Ob());a.Xc=b}Ie.prototype.bind=function(){return this};function Me(a,b){a=a.w;null!=a&&Be(a,function(c){c instanceof Ee&&c.bind(b)})};function Ne(a){Ie.call(this,a)}u(Ne,Ie);function Oe(a){var b="";a.forEach(function(c,d){b+=c.J.j()+" ";b+=1==c.order?"ASC":"DESC";d<a.length-1&&(b+=", ")});return b}Ne.prototype.da=function(){return D(this.from)};Ne.prototype.clone=function(){var a=new Ne(this.aa);Le(a,this);this.f&&(a.f=this.f.slice());this.from&&(a.from=this.from.slice());a.X=this.X;a.L=this.L;this.N&&(a.N=this.N.slice());this.qa&&(a.qa=this.qa.slice());this.Ub&&(a.Ub=this.Ub);this.Kb&&(a.Kb=this.Kb);a.eb=this.eb;return a};
  Ne.prototype.bind=function(a){Ne.hb.bind.call(this,a);null!=this.Ub&&(this.X=a[this.Ub.Ca()]);null!=this.Kb&&(this.L=a[this.Kb.Ca()]);Me(this,a);return this};function Pe(a,b){this.Ha=a;this.$=b}Pe.prototype.bb=h("Ha");Pe.prototype.da=h("$");function Qe(a){var b=D();a.forEach(function(c){c.da().forEach(b.add.bind(b))});return b};function Re(a,b){this.global=a;this.ab=a.b(Jc);this.ud=b.map(function(c){return c.context});this.kf=b.map(function(c){return c.ke});this.Nd=Qe(this.kf);this.ye=Se(this);this.Eb=ub()}function Se(a){return a.ud.some(function(b){return!(b instanceof Ne)})?1:0}n=Re.prototype;
  n.exec=function(){function a(){var f=d.shift();if(f){var g=e[c.length];return f.bb().exec(b,g).then(function(k){c.push(k[0]);return a()})}return x()}var b=0==this.ye?void 0:new Hd(this.global,this.Nd),c=[],d=this.kf.slice(),e=this.ud;return a().then(function(){this.ja=this.ab.Gb(this.ye,E(this.Nd),b);return this.ja.ka()}.bind(this)).then(function(){this.he(c);return c}.bind(this),function(f){null!=b&&b.Jb();throw f;})};n.G=h("ye");n.da=h("Nd");n.W=function(){return ka(this)};n.he=aa();
  n.Y=function(){var a=null;null!=this.ja&&(a=this.ja.Y());return null===a?new C(!1,0,0,0,0):a};function Te(a,b){Re.call(this,a,b);this.Ib=a.b(Oc)}u(Te,Re);Te.prototype.getPriority=m(0);Te.prototype.he=function(a){this.ud.forEach(function(b,c){Ue(this.Ib,b,a[c])},this)};function Ve(a,b){this.c=a;this.Ib=a.b(Oc);this.Ia=a.b(Nc);this.hd=new ed(a);this.ib=b;var c=a.b(Pc);a=this.ib.map(function(d){return c.table(d.getName())});this.$=D(a);this.Eb=ub()}n=Ve.prototype;n.exec=function(){this.hd.update(this.ib);this.Mc();return x()};n.G=m(1);n.da=h("$");n.W=function(){return ka(this)};n.getPriority=m(1);n.Mc=function(){var a=We(this.Ib,this.$);0!=a.length&&(a=new Te(this.c,a),Xe(this.Ia,a))};function Ye(a){this.c=a;this.ab=a.b(Jc);this.Ia=a.b(Nc)}Ye.prototype.fe=function(a){a=new Ve(this.c,a);Xe(this.Ia,a)};function N(a,b){this.Ta=a;this.i=b;this.Ya=A()}t("lf.backstore.FirebaseRawBackStore",N);N.prototype.dd=h("i");N.prototype.ed=function(){throw new F(351);};function Ze(a,b){var c=ub(),d=a;b.length&&(d=a.child(b));d.once("value",function(e){c.resolve(e.val())},function(e){c.reject(e)});return c.ha}function $e(a,b,c){function d(f){f?e.reject(f):e.resolve()}c=c||!1;var e=ub();c?a.set(b,d):a.update(b,d);return e.ha}
  N.prototype.Ea=function(a){return Ze(this.i,"@rev/R").then(function(b){this.Ra=b;return Ze(this.i,"@table")}.bind(this)).then(function(b){var c=0;for(d in b)this.Ya.set(d,b[d]),b[d]>c&&(c=b[d]);a.oa().forEach(function(e){this.Ya.has(e.getName())||(b[e.getName()]=++c)},this);var d=this.i.child("@table");return $e(d,b)}.bind(this))};
  function af(a,b,c){var d=a.Ya.get(b);return null!=d?function(){var e={},f=ub();this.i.orderByChild("T").equalTo(d).once("value",function(g){g.forEach(function(k){var l=c(k.val());e[parseInt(k.key(),10)]=l});f.resolve(e)});return f.ha}.call(a).then(function(e){e["@rev"]={R:++this.Ra};return $e(this.i,e)}.bind(a)):x()}N.prototype.tc=function(a){return af(this,a,m(null)).then(function(){this.Ya.delete(a);return $e(this.i.child("@table/"+a),null,!0)}.bind(this))};N.prototype.dropTable=N.prototype.tc;
  N.prototype.rc=function(a,b,c){return af(this,a,function(d){var e=d.P;e[b]=c;return{R:this.Ra+1,T:d.T,P:e}}.bind(this))};N.prototype.addTableColumn=N.prototype.rc;N.prototype.uc=function(a,b){return af(this,a,function(c){var d=c.P;delete d[b];return{R:this.Ra+1,T:c.T,P:d}}.bind(this))};N.prototype.dropTableColumn=N.prototype.uc;N.prototype.Lc=function(a,b,c){return af(this,a,function(d){var e=d.P;e[c]=e[b];delete e[b];return{R:this.Ra+1,T:d.T,P:e}}.bind(this))};N.prototype.renameTableColumn=N.prototype.Lc;
  N.prototype.xb=function(){throw new F(351);};N.prototype.createRow=N.prototype.xb;N.prototype.Cc=h("Ta");N.prototype.getVersion=N.prototype.Cc;N.prototype.ec=function(a){var b=ub();a=this.Ya.get(a);this.i.orderByChild("T").equalTo(a).once("value",function(c){var d=[];c.forEach(function(e){d.push(e.val().P)});b.resolve(d)});return b.ha};N.prototype.dump=function(){var a={},b=uc(this.Ya).map(function(c){return this.ec(c).then(function(d){a[c]=d})}.bind(this));return tb(b).then(function(){return a})};
  N.prototype.dump=N.prototype.dump;function bf(a,b,c){Bc.call(this,b,c);this.i=a}u(bf,Bc);bf.prototype.I=function(a){return this.i.Ac(a)};
  bf.prototype.sc=function(){if(0==this.zd)return this.S.resolve(),this.S.ha;var a=this.Qa.ib;if(0==a.size)this.S.resolve();else{var b=this.i.Ra+1;this.i.Ra=b;var c={"@rev":{R:b}};a.forEach(function(d,e){var f=this.i.Ya.get(e);d.ua.forEach(function(g,k){c[k]={R:b,T:f,P:g.m}});d.la.forEach(function(g,k){c[k]={R:b,T:f,P:g[1].m}});d.va.forEach(function(g,k){c[k]=null})},this);this.i.i.update(c,function(d){null===d?this.S.resolve():(this.i.Ra=b-1,d=B(a).map(function(e){return cf(this.i,e.getName())},this),
  tb(d).then(this.S.reject.bind(this.S),this.S.reject.bind(this.S)))}.bind(this))}return this.S.ha};function df(){this.Ba=A()}function ef(a,b){if(0==b.length)return B(a.Ba);var c=[];b.forEach(function(d){d=this.Ba.get(d)||null;null===d||c.push(d)},a);return c}df.prototype.getData=h("Ba");df.prototype.get=function(a){return x(ef(this,a))};function ff(a,b){b.forEach(function(c){this.Ba.set(c.id(),c)},a)}df.prototype.put=function(a){ff(this,a);return x()};function gf(a,b){0==b.length||b.length==a.Ba.size?a.Ba.clear():b.forEach(function(c){this.Ba.delete(c)},a)}
  df.prototype.remove=function(a){gf(this,a);return x()};function hf(a){return 0==a.Ba.size?0:uc(a.Ba).reduce(function(b,c){return b>c?b:c},0)};function jf(a,b){this.g=a;this.Lf=b;this.Kc=A();this.Ra=-1;this.M=A();this.Ya=A();this.Kd=null}n=jf.prototype;
  n.Ea=function(a){this.i=this.Lf.child(this.g.name());var b=a||function(){return x()};return Ze(this.i,"@db/version").then(function(c){return null===c?$e(this.i,kf(this),!0).then(function(){var d=new N(0,this.i);return b(d)}.bind(this)).then(function(){return this.Ea()}.bind(this)):c==this.g.version()?Ze(this.i,"@rev/R").then(function(d){this.Ra=d;return Ze(this.i,"@table")}.bind(this)).then(function(d){for(var e in d)this.Ya.set(e,d[e]);d=this.g.oa().map(function(f){return cf(this,f.getName())},this);
  return tb(d)}.bind(this)).then(function(){mf(this);nf(this);return x()}.bind(this)):this.ie(c,b).then(function(){return this.Ea()}.bind(this))}.bind(this))};n.ie=function(a,b){var c=new N(a,this.i);return c.Ea(this.g).then(function(){return x()}.bind(this)).then(function(){return b(c)}).then(function(){var d=this.i.child("@db");return $e(d,{version:this.g.version()},!0)}.bind(this))};
  function nf(a){a.i.off();a.i.on("child_removed",a.Hg.bind(a));a.Ld&&(a.Ld.off(),a.Kc.clear());a.Ld=a.i.orderByChild("R").startAt(a.Ra+1);a.Ld.on("value",a.fe.bind(a))}function mf(a){wc=B(a.M).map(function(b){return hf(b)}).reduce(function(b,c){return b>c?b:c},0)+1}n.Hg=function(a){var b=a.val(),c=this.Kc.get(b.T)||null;null===c&&(c=D(),this.Kc.set(b.T,c));c.add(parseInt(a.key(),10))};
  n.fe=function(a){var b=a.child("@rev/R").val();null!=b&&b!=this.Ra&&(this.Ra=b,a=of(this,a),a.forEach(function(c){var d=this.M.get(c.getName()),e=uc(c.va);0<e.length&&gf(d,e);var f=B(c.ua);c.la.forEach(function(g){f.push(g[1])});ff(d,f)},this),0<a.length&&this.Gc(a),nf(this))};
  function of(a,b){var c=D(),d=A();a.Ya.forEach(function(e,f){var g=this.M.get(f),k=new Fd(f);this.Kc.has(e)&&(f=E(this.Kc.get(e)),f.forEach(function(l){c.add(l)}),ef(g,f).forEach(function(l){k.delete(l)}));d.set(e,k)}.bind(a));b.forEach(function(e){if("@rev"!=e.key()){var f=parseInt(e.key(),10);if(!c.has(f)){var g=e.val();e=d.get(g.T);var k=this.M.get(e.getName());g=this.g.table(e.getName()).kb({id:f,value:g.P});k.getData().has(f)?e.modify([ef(k,[f])[0],g]):e.add(g)}}}.bind(a));return B(d).filter(function(e){return!e.kd()})}
  function cf(a,b){var c=ub(),d=a.Ya.get(b),e=a.g.table(b);a.i.orderByChild("T").equalTo(d).once("value",function(f){var g=new df,k=[];f.forEach(function(l){k.push(e.kb({id:parseInt(l.key(),10),value:l.val().P}))});ff(g,k);this.M.set(b,g);c.resolve()}.bind(a));return c.ha}function kf(a){var b={};b["@db"]={version:a.g.version()};b["@rev"]={R:1};a.Ra=1;b["@table"]={};a.g.oa().forEach(function(c,d){c=c.getName();b["@table"][c]=d;this.M.set(c,new df);this.Ya.set(c,d)},a);return b}
  n.Gb=function(a,b,c){return new bf(this,a,c)};n.Ac=function(a){var b=this.M.get(a)||null;if(null!==b)return b;throw new F(101,a);};n.close=aa();n.subscribe=ba("Kd");n.Gc=function(a){null!=this.Kd&&this.Kd(a)};n.Pc=m(!1);function O(a,b,c,d){this.i=b;this.ja=c;this.Ta=a;this.Vc=d}t("lf.backstore.IndexedDBRawBackStore",O);O.prototype.dd=h("i");O.prototype.getRawDBInstance=O.prototype.dd;O.prototype.ed=h("ja");O.prototype.getRawTransaction=O.prototype.ed;O.prototype.tc=function(a){return new w(function(b,c){try{this.i.deleteObjectStore(a)}catch(d){c(d);return}b()},this)};O.prototype.dropTable=O.prototype.tc;
  function pf(a,b,c,d){return new w(function(e,f){try{var g=this.ja.objectStore(b);var k=g.openCursor()}catch(l){f(l);return}k.onsuccess=function(){var l=k.result;l?(c(l),l.continue()):(d(g),e())};k.onerror=f},a)}function qf(a){return a instanceof ArrayBuffer?zc(a):a instanceof Date?a.getTime():a}function rf(a,b,c){function d(f){var g=$c(f.value),k=g.m,l;for(l in k){var p=xc(k[l]);c(p);k[l]=p.Ja()}f.update(g.Ja())}function e(f){var g=xc(f.value);c(g);f.update(g.Ja())}return pf(a,b,a.Vc?d:e,aa())}
  O.prototype.rc=function(a,b,c){var d=qf(c);return rf(this,a,function(e){e.m[b]=d})};O.prototype.addTableColumn=O.prototype.rc;O.prototype.uc=function(a,b){return rf(this,a,function(c){delete c.m[b]})};O.prototype.dropTableColumn=O.prototype.uc;O.prototype.Lc=function(a,b,c){return rf(this,a,function(d){d.m[c]=d.m[b];delete d.m[b]})};O.prototype.renameTableColumn=O.prototype.Lc;
  function sf(a,b){var c=[];return new w(function(d,e){try{var f=this.ja.objectStore(b).openCursor()}catch(g){e(g);return}f.onsuccess=function(){var g=f.result;if(g){if(this.Vc){var k=$c(g.value).m,l;for(l in k)c.push(k[l])}else c.push(g.value);g.continue()}else d(c)}.bind(this);f.onerror=e},a)}O.prototype.xb=function(a){var b={},c;for(c in a)b[c]=qf(a[c]);return yc(b)};O.prototype.createRow=O.prototype.xb;O.prototype.Cc=h("Ta");O.prototype.getVersion=O.prototype.Cc;
  O.prototype.dump=function(){for(var a=this.i.objectStoreNames,b=[],c=0;c<a.length;++c){var d=a.item(c);b.push(this.ec(d))}return tb(b).then(function(e){var f={};e.forEach(function(g,k){f[a.item(k)]=g});return f})};O.prototype.dump=O.prototype.dump;O.prototype.ec=function(a){return sf(this,a).then(function(b){return b.map(function(c){return c.value})})};function tf(a,b){this.ba=a;this.Pb=b}tf.prototype.get=function(a){if(0==a.length)return uf(this);a=a.map(function(b){return new w(function(c,d){try{var e=this.ba.get(b)}catch(f){d(f);return}e.onerror=d;e.onsuccess=function(f){c(this.Pb(f.target.result))}.bind(this)},this)},this);return tb(a)};
  function uf(a){return new w(function(b,c){var d=[];try{var e=this.ba.openCursor()}catch(f){c(f);return}e.onerror=c;e.onsuccess=function(){var f=e.result;f?(d.push(this.Pb(f.value)),f.continue()):b(d)}.bind(this)},a)}tf.prototype.Vb=function(a){return new w(function(b,c){try{var d=a()}catch(e){c(e);return}d.onsuccess=b;d.onerror=c},this)};tf.prototype.put=function(a){if(0==a.length)return x();a=a.map(function(b){return this.Vb(function(){return this.ba.put(b.Ja())}.bind(this))},this);return tb(a)};
  tf.prototype.remove=function(a,b){function c(){var e=a.map(function(f){return d.Vb(function(){return d.ba.delete(f)})});return tb(e)}var d=this;return b?c():new w(function(e,f){var g=d.ba.count();g.onsuccess=function(k){0==a.length||k.target.result==a.length?d.Vb(function(){return d.ba.clear()}).then(e,f):c().then(e,f)};g.onerror=f})};function vf(a,b,c,d,e){Bc.call(this,c,e);this.c=a;this.ja=b;this.Vc=d;this.ja.oncomplete=this.S.resolve.bind(this.S);this.ja.onabort=this.S.reject.bind(this.S)}u(vf,Bc);vf.prototype.I=function(a,b,c){return this.Vc?(c=null!=c?c:0,a=this.ja.objectStore(a),new ad(a,b,0==c?ra(cd,this.c):dd)):new tf(this.ja.objectStore(a),b)};vf.prototype.sc=function(){return this.S.ha};function wf(a,b){this.c=a;this.g=b;this.Hd=b.le.$f||!1}n=wf.prototype;
  n.Ea=function(a){var b=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;if(null==b)throw new F(352);var c=a||function(){return x()};return new w(function(d,e){try{var f=b.open(this.g.name(),this.g.version())}catch(g){e(g);return}f.onerror=function(g){g=g.target.error;e(new F(361,g.name,g.message))};f.onupgradeneeded=function(g){xf(this,c,g).then(aa(),e)}.bind(this);f.onsuccess=function(g){this.i=g.target.result;this.re().then(function(k){wc=Math.max(wc,k+1);d(this.i)}.bind(this))}.bind(this)},
  this)};function xf(a,b,c){var d=c.target.result;c=new O(c.oldVersion,d,c.target.transaction,a.Hd);yf(d);a.g.oa().forEach(ra(a.Tf,d),a);return b(c)}function yf(a){for(var b=[],c=0;c<a.objectStoreNames.length;++c){var d=a.objectStoreNames.item(c);-1!=d.indexOf(".")&&b.push(d)}b.forEach(function(e){try{a.deleteObjectStore(e)}catch(f){}})}
  n.Tf=function(a,b){a.objectStoreNames.contains(b.getName())||a.createObjectStore(b.getName(),{keyPath:"id"});b.Db()&&(b.Da().forEach(function(c){zf(a,c.j())},this),zf(a,Af(b)))};function zf(a,b){a.objectStoreNames.contains(b)||a.createObjectStore(b,{keyPath:"id"})}n.Gb=function(a,b,c){b=this.i.transaction(Bf(b),0==a?"readonly":"readwrite");return new vf(this.c,b,a,this.Hd,c)};
  function Bf(a){var b=D();a.forEach(function(c){b.add(c.getName());c.Db()&&(c.Da().forEach(function(d){b.add(d.j())}),b.add(Af(c)))});return E(b)}
  n.re=function(){function a(){if(0==c.length)return x();var g=c.shift();return b(g).then(a)}function b(g){return new w(function(k,l){try{var p=d.transaction([g]).objectStore(g).openCursor(null,"prev")}catch(r){l(r);return}p.onsuccess=function(r){(r=r.target.result)&&(e=Math.max(e,f(r)));k(e)};p.onerror=function(){k(e)}})}var c=this.g.oa().map(function(g){return g.getName()}),d=this.i,e=0,f=function(g){return this.Hd?(g=$c(g.value),Object.keys(g.m).reduce(function(k,l){return Math.max(k,l)},0)):g.key}.bind(this);
  return new w(function(g){a().then(function(){g(e)})})};n.close=function(){this.i.close()};n.Ac=function(){throw new F(511);};n.subscribe=aa();n.Gc=aa();n.Pc=m(!0);function Cf(a,b,c){Bc.call(this,b,c);this.ba=a;0==b&&this.S.resolve()}u(Cf,Bc);Cf.prototype.I=function(a){return this.ba.Ac(a)};Cf.prototype.sc=function(){this.S.resolve();return this.S.ha};function Df(a){this.g=a;this.M=A()}n=Df.prototype;n.Ea=function(){this.g.oa().forEach(this.og,this);return x()};n.Ac=function(a){var b=this.M.get(a)||null;if(null===b)throw new F(101,a);return b};n.Gb=function(a,b,c){return new Cf(this,a,c)};function Ef(a,b){if(!a.M.has(b)){var c=new df;a.M.set(b,c)}}n.og=function(a){Ef(this,a.getName());a.Db()&&(a.Da().forEach(function(b){Ef(this,b.j())},this),Ef(this,Af(a)))};n.close=aa();n.subscribe=aa();n.Gc=aa();n.Pc=m(!0);function Ff(a){Df.call(this,a);this.qd=null}u(Ff,Df);Ff.prototype.subscribe=function(a){null===this.qd&&(this.qd=a)};Ff.prototype.Gc=function(a){null===this.qd||this.qd(a)};Ff.prototype.Pc=m(!1);function Gf(a,b,c){this.ja=a;this.A='"'+b+'"';this.Pb=c}Gf.prototype.get=function(a){var b=this.Pb;return Hf(this.ja,"SELECT id, value FROM "+this.A+" "+(0==a.length?"":"WHERE id IN ("+a.join(",")+")"),[],function(c){for(var d=c.rows.length,e=Array(d),f=0;f<d;++f)e[f]=b({id:c.rows.item(f).id,value:JSON.parse(c.rows.item(f).value)});return e})};
  Gf.prototype.put=function(a){if(0==a.length)return x();var b="INSERT OR REPLACE INTO "+this.A+"(id, value) VALUES (?, ?)";a.forEach(function(c){Hf(this.ja,b,[c.id(),JSON.stringify(c.m)])},this);return x()};Gf.prototype.remove=function(a){Hf(this.ja,"DELETE FROM "+this.A+" "+(0==a.length?"":"WHERE id IN ("+a.join(",")+")"),[]);return x()};function If(a,b,c){Bc.call(this,b,c);this.i=a;this.M=A();this.Od=[]}u(If,Bc);function Jf(a){return a.replace(".","__d__").replace("#","__s__")}If.prototype.I=function(a,b){var c=this.M.get(a)||null;null===c&&(c=new Gf(this,Jf(a),b),this.M.set(a,c));return c};function Hf(a,b,c,d){var e=ub();a.Od.push({Vg:b,Lg:c,transform:d,S:e});return e.ha}
  If.prototype.sc=function(){var a=null,b=this.S.reject.bind(this.S),c=function(f,g){this.S.reject(g)}.bind(this),d=[],e=function(f,g){if(null!==a){var k=g;null!=a.transform&&null!=g&&(k=a.transform(g));d.push(k);a.S.resolve(k)}0<this.Od.length?(a=g=this.Od.shift(),f.executeSql(g.Vg,g.Lg,e,c)):this.S.resolve(d)}.bind(this);0==this.zd?this.i.readTransaction(e,b):this.i.transaction(e,b);return this.S.ha};function P(a,b,c){this.i=c;this.c=a;this.Ta=b}t("lf.backstore.WebSqlRawBackStore",P);P.prototype.dd=h("i");P.prototype.getRawDBInstance=P.prototype.dd;P.prototype.ed=function(){throw new F(356);};P.prototype.getRawTransaction=P.prototype.ed;function Kf(a){return new If(a.i,1,new Hd(a.c,D()))}P.prototype.tc=function(a){var b=Kf(this);Hf(b,"DROP TABLE "+a,[]);return b.ka()};P.prototype.dropTable=P.prototype.tc;
  P.prototype.ec=function(a){var b=Kf(this);Hf(b,"SELECT id, value FROM "+a,[]);return b.ka().then(function(c){for(var d=c[0].rows.length,e=Array(d),f=0;f<d;++f)e[f]={id:c[0].rows.item(f).id,value:JSON.parse(c[0].rows.item(f).value)};return x(e)})};function Lf(a,b,c){var d=Kf(a),e="UPDATE "+b+" SET value=? WHERE id=?";return a.ec(b).then(function(f){f.forEach(function(g){g=c(g);Hf(d,e,[JSON.stringify(g.value),g.id])});return d.ka()})}
  P.prototype.rc=function(a,b,c){var d=qf(c);return Lf(this,a,function(e){e.value[b]=d;return e})};P.prototype.addTableColumn=P.prototype.rc;P.prototype.uc=function(a,b){return Lf(this,a,function(c){delete c.value[b];return c})};P.prototype.dropTableColumn=P.prototype.uc;P.prototype.Lc=function(a,b,c){return Lf(this,a,function(d){d.value[c]=d.value[b];delete d.value[b];return d})};P.prototype.renameTableColumn=P.prototype.Lc;P.prototype.xb=function(a){var b={},c;for(c in a)b[c]=qf(a[c]);return yc(b)};
  P.prototype.createRow=P.prototype.xb;P.prototype.Cc=h("Ta");P.prototype.getVersion=P.prototype.Cc;function Mf(a){Hf(a,'SELECT tbl_name FROM sqlite_master WHERE type="table"',[],function(b){for(var c=Array(b.rows.length),d=0;d<c.length;++d)c[d]=b.rows.item(d).tbl_name;return c})}
  P.prototype.dump=function(){var a=ub(),b=Kf(this);Mf(b);var c={};b.ka().then(function(d){d=d[0].filter(function(e){return"__lf_ver"!=e&&"__WebKitDatabaseInfoTable__"!=e}).map(function(e){return this.ec(e).then(function(f){c[e]=f})},this);tb(d).then(function(){a.resolve(c)})}.bind(this));return a.ha};P.prototype.dump=P.prototype.dump;function Nf(a,b,c){this.c=a;this.g=b;this.Ug=c||1}n=Nf.prototype;n.Ea=function(a){if(null==window.openDatabase)throw new F(353);var b=a||function(){return x()};return new w(function(c,d){var e=window.openDatabase(this.g.name(),"",this.g.name(),this.Ug);if(null!=e)this.i=e,Of(this,b).then(function(){this.re().then(c,d)}.bind(this),function(f){if(f instanceof F)throw f;throw new F(354,f.message);});else throw new F(354);},this)};
  function Of(a,b){var c=ub(),d=new If(a.i,1,new Hd(a.c,D()));Hf(d,"CREATE TABLE IF NOT EXISTS __lf_ver(id INTEGER PRIMARY KEY, v INTEGER)",[]);Hf(d,"SELECT v FROM __lf_ver WHERE id = 0",[]);d.ka().then(function(e){var f=0;e[1].rows.length&&(f=e[1].rows.item(0).v);f<this.g.version()?this.ie(b,f).then(c.resolve.bind(c)):f>this.g.version()?c.reject(new F(108)):c.resolve()}.bind(a),c.reject.bind(c));return c.ha}n.Gb=function(a,b,c){if(null!=this.i)return new If(this.i,a,c);throw new F(2);};n.close=aa();
  n.Ac=function(){throw new F(512);};n.subscribe=function(){throw new F(355);};n.Gc=function(){throw new F(355);};n.ie=function(a,b){return Pf(this).then(function(){return a(new P(this.c,b,this.i))}.bind(this))};
  function Pf(a){var b=a.g.oa(),c=new If(a.i,1,new Hd(a.c,D())),d=new If(a.i,1,new Hd(a.c,D()));Hf(c,"INSERT OR REPLACE INTO __lf_ver VALUES (0, ?)",[a.g.version()]);Mf(c);return c.ka().then(function(e){var f=e[1];f.filter(function(p){return-1!=p.indexOf("__d__")}).forEach(function(p){Hf(d,'DROP TABLE "'+(p+'"'),[])});var g=[],k=[],l=[];b.map(function(p){-1==f.indexOf(p.getName())&&g.push(p.getName());p.Db&&(p.Da().forEach(function(r){r=Jf(r.j());g.push(r);k.push(r)}),p=Jf(Af(p)),g.push(p),l.push(p))});
  g.forEach(function(p){Hf(d,'CREATE TABLE "'+(p+'"(id INTEGER PRIMARY KEY, value TEXT)'),[])});return d.ka()})}n.re=function(){var a=0,b=ub(),c=function(e){var f=new If(this.i,0);Hf(f,'SELECT MAX(id) FROM "'+(e+'"'),[]);return f.ka().then(function(g){g=g[0].rows.item(0)["MAX(id)"];a=Math.max(g,a)})}.bind(this),d=this.g.oa().map(function(e){return c(e.getName())});tb(d).then(function(){wc=Math.max(wc,a+1);b.resolve()},function(e){b.reject(e)});return b.ha};n.Pc=m(!0);function Qf(a){this.l=A();this.nc=A();a.oa().forEach(function(b){this.nc.set(b.getName(),D())},this)}n=Qf.prototype;n.set=function(a,b){this.l.set(b.id(),b);this.nc.get(a).add(b.id())};n.Yb=function(a,b){var c=this.nc.get(a);b.forEach(function(d){this.l.set(d.id(),d);c.add(d.id())},this)};n.get=function(a){return this.l.get(a)||null};function Rf(a,b){return b.map(function(c){return this.get(c)},a)}
  n.Ua=function(a,b,c){var d=[],e=Math.min(b,c),f=Math.max(b,c);a=this.nc.get(a);if(a.size<f-e)a.forEach(function(g){g>=e&&g<=f&&(g=this.l.get(g),d.push(g))},this);else for(b=e;b<=f;++b)a.has(b)&&(c=this.l.get(b),d.push(c));return d};n.remove=function(a,b){this.l.delete(b);this.nc.get(a).delete(b)};n.zc=function(){return this.l.size};n.clear=function(){this.l.clear();this.nc.clear()};function Sf(a,b,c){var d=0,e=a.length;for(c=c||Tf;d<e;){var f=d+e>>1;0>c(a[f],b)?d=f+1:e=f}return d==e&&a[d]==b?d:~d}function Tf(a,b){return a-b}function Uf(a,b,c){c=Sf(a,b,c);return 0>c?(a.splice(-(c+1),0,b),!0):!1};function Vf(a,b,c,d){a=b?a.reverse():a;if(null==c&&null==d)return a;c=Math.min(q(c)?c:a.length,a.length);if(0==c)return[];d=Math.min(d||0,a.length);return a.slice(d,d+c)};function Wf(){this.ia=0;this.Fc=null}Wf.prototype.add=function(a,b){this.ia+=b;this.Fc=null===this.Fc?a:a>this.Fc?a:this.Fc};Wf.prototype.remove=function(a,b){this.ia-=b};Wf.prototype.clear=function(){this.ia=0};function Xf(a,b){a.clear();b.forEach(function(c){this.ia+=c.ia},a)};function Yf(a,b,c){this.A=a;this.Z=b;this.Df=c;this.za=new Wf;this.clear()}var Zf=[];n=Yf.prototype;n.getName=h("A");n.toString=function(){return this.ya.toString()};n.add=function(a,b){this.ya=this.ya.Bb(a,b)};n.set=function(a,b){this.ya=this.ya.Bb(a,b,!0)};n.remove=function(a,b){this.ya=this.ya.remove(a,b)};n.get=function(a){return this.ya.get(a)};n.$c=function(a){if(null==a)return this.Y().ia;if(a instanceof Md){if(Od(a))return this.Y().ia;if(Sd(a))return this.get(a.from).length}return this.Ua([a]).length};
  n.Y=h("za");n.Wd=function(a,b,c){var d=Array(a);this.ya.fill({offset:b?this.za.ia-a-c:c,count:a,ue:0},d);return b?d.reverse():d};
  n.Ua=function(a,b,c,d){var e=$f(this.ya).a[0];if(!q(e)||0==c)return Zf;b=b||!1;c=null!=c?Math.min(c,this.za.ia):this.za.ia;d=d||0;var f=Math.min(Math.max(this.za.ia-d,0),c);if(0==f)return Zf;if(!q(a)||1==a.length&&a[0]instanceof Md&&Od(a[0]))return this.Wd(f,b,d);a=this.Z.xf(a);var g=Array(b?this.za.ia:f),k={count:0,X:g.length,reverse:b,L:d},l=1<this.jb().$d();a.forEach(function(p){var r=this.Z.vd(p);r=this.Z.Yd(p)?e:r[0];r=this.ya.fg(r);for(var W=0;null!=r&&k.count<k.X;){if(l){for(var K=r,y=p,L=
  k,V=g,na=K.u.jb(),ib=-1,Ta=0;Ta<K.a.length;++Ta)if(na.Cb(K.a[Ta],y)){ib=Ta;break}if(-1!=ib)for(Ta=ib;Ta<K.a.length&&L.count<L.X;++Ta)na.Cb(K.a[Ta],y)&&ag(K,L,V,Ta)}else r.Ua(p,k,g);0!=k.L||r.ld(p)?W=0:W++;r=2==W?null:r.next()}},this);g.length>k.count&&g.splice(k.count,g.length-k.count);return b?Vf(g,b,c,d):g};n.clear=function(){this.ya=bg(this);this.za.clear()};n.Oa=function(a){return this.ya.Oa(a)};n.min=function(){return this.Hb(this.Z.min.bind(this.Z))};n.max=function(){return this.Hb(this.Z.max.bind(this.Z))};
  function cg(a,b,c){if(!a.Z.Pd(b.a[c]))if(1<b.a[c].length){if(null===b.a[c][0])return null}else return null;return[b.a[c],a.Df?[b.D[c]]:b.D[c]]}n.Hb=function(a){a:{var b=$f(this.ya);var c=0;do if(c>=b.a.length)b=b.xa,c=0;else{var d=cg(this,b,c);if(null!==d){b=d;break a}c++}while(null!==b);b=null}a:{c=dg(this.ya);d=c.a.length-1;do if(0>d)c=c.qb,d=0;else{var e=cg(this,c,d);if(null!==e){c=e;break a}d--}while(null!==c);c=null}return null===b||null===c?null:1==a(b[0],c[0])?b:c};n.Ma=h("Df");n.jb=h("Z");
  n.Pa=function(a,b){return null!=a?0==this.Z.compare(a,b):!1};n.Ja=function(){for(var a=[],b=$f(this.ya);b;)a.push(new vc(b.ra,[b.a,b.D])),b=b.xa;return a};function eg(a,b,c,d){a=new Yf(b,a,c);d=fg(d,a);a.ya=d;return a}function gg(a,b){this.ra=a;this.u=b;this.mb=0;this.xa=this.qb=this.C=null;this.a=[];this.D=[];this.h=[];this.fg=1==b.jb().$d()?this.Qe:this.Pe}function bg(a){return new gg(wc++,a)}function hg(a){return 0==a.mb}n=gg.prototype;n.next=h("xa");
  function ig(a){function b(g){return null!=g?g.ra.toString():"_"}var c=a.ra+"["+a.a.join("|")+"]",d=a.h.map(function(g){return g.ra}).join("|"),e=a.D.join("/"),f=b(a.qb)+"{";f=hg(a)?f+e:f+d;f=f+"}"+b(a.C);a.xa&&(a=ig(a.xa),c=c+"  "+a[0],f=f+"  "+a[1]);return[c,f]}n.toString=function(){var a="",b=ig(this);a+=b[0]+"\n"+b[1]+"\n";this.h.length&&(a+=this.h[0].toString());return a};function $f(a){return hg(a)?a:$f(a.h[0])}function dg(a){return hg(a)?a:dg(a.h[a.h.length-1])}
  function jg(a,b){b&&(b.qb=a);a&&(a.xa=b)}function kg(a){var b=a[0],c=bg(b.u);c.mb=b.mb+1;c.h=a;for(b=0;b<a.length;++b)a[b].C=c,0<b&&c.a.push(a[b].a[0]);return c}function lg(a){var b=a,c=[];do c.push(b),b=b.xa;while(b);if(512>=c.length)b=kg(c);else{var d=c.length,e=0;b=bg(a.u);for(b.mb=a.mb+2;0<d;){a=768<=d?511:257<=d&&511>=d?d:257;var f=c.slice(e,e+a),g=kg(f);g.C=b;b.h.length&&(b.a.push(f[0].a[0]),jg(b.h[b.h.length-1],g));b.h.push(g);e+=a;d-=a}}return b}
  n.get=function(a){var b=mg(this,a);if(hg(this)){var c=Zf;this.u.Pa(this.a[b],a)&&(c=c.concat(this.D[b]));return c}b=this.u.Pa(this.a[b],a)?b+1:b;return this.h[b].get(a)};n.Oa=function(a){var b=mg(this,a);return this.u.Pa(this.a[b],a)?!0:hg(this)?!1:this.h[b].Oa(a)};n.remove=function(a,b){ng(this,a,-1,b);return null===this.C?(a=this,1==this.h.length&&(a=this.h[0],a.C=null),a):this};function og(a){return hg(a)?a.a[0]:og(a.h[0])}
  function pg(a){a.a=[];for(var b=1;b<a.h.length;++b)a.a.push(og(a.h[b]))}
  function ng(a,b,c,d){var e=mg(a,b),f=hg(a);if(!f){var g=a.u.Pa(a.a[e],b)?e+1:e;if(ng(a.h[g],b,g,d))pg(a);else return!1}else if(!a.u.Pa(a.a[e],b))return!1;if(a.a.length>e&&a.u.Pa(a.a[e],b)){if(q(d)&&!a.u.Ma()&&f&&(g=a.D[e],d=Sf(g,d,void 0),0>d?d=!1:(g.splice(d,1),d=!0),d&&a.u.Y().remove(b,1),a.D[e].length))return!1;a.a.splice(e,1);f&&(f=a.u.Ma()?1:a.D[e].length,a.D.splice(e,1),a.u.Y().remove(b,f))}if(256>a.a.length&&null!==a.C){a:{if(a.xa&&256<a.xa.a.length)b=a.xa,e=d=0,f=a.a.length+1;else if(a.qb&&
  256<a.qb.a.length)b=a.qb,d=a.qb.a.length-1,e=hg(a)?d:d+1,f=0;else{b=!1;break a}a.a.splice(f,0,b.a[d]);b.a.splice(d,1);d=hg(a)?a.D:a.h;hg(a)?g=b.D:(g=b.h,g[e].C=a);d.splice(f,0,g[e]);g.splice(e,1);hg(b)||(pg(b),pg(a));b=!0}b||qg(a,c)}return!0}
  function qg(a,b){var c;if(a.xa&&511>a.xa.a.length){var d=a.xa;var e=c=0}else a.qb&&(d=a.qb,c=d.a.length,e=hg(d)?d.D.length:d.h.length);c=[c,0].concat(a.a);Array.prototype.splice.apply(d.a,c);c=null;hg(a)?c=a.D:(c=a.h,c.forEach(function(f){f.C=d}));c=[e,0].concat(c);Array.prototype.splice.apply(hg(d)?d.D:d.h,c);jg(a.qb,a.xa);hg(d)||pg(d);-1!=b&&(a.C.a.splice(b,1),a.C.h.splice(b,1))}
  n.Bb=function(a,b,c){var d=mg(this,a);if(hg(this)){if(this.u.Pa(this.a[d],a)){if(c)this.u.Y().remove(a,this.u.Ma()?1:this.D[d].length),this.D[d]=this.u.Ma()?b:[b];else{if(this.u.Ma())throw new F(201,this.u.getName(),JSON.stringify(a));if(!Uf(this.D[d],b))throw new F(109);}this.u.Y().add(a,1);return this}this.a.splice(d,0,a);this.D.splice(d,0,this.u.Ma()?b:[b]);this.u.Y().add(a,1);512==this.a.length?(d=bg(this.u),a=bg(this.u),a.mb=1,a.a=[this.a[256]],a.h=[this,d],a.C=this.C,this.C=a,d.a=this.a.splice(256),
  d.D=this.D.splice(256),d.C=a,jg(d,this.xa),jg(this,d),d=a):d=this;return d}d=this.u.Pa(this.a[d],a)?d+1:d;a=this.h[d].Bb(a,b,c);hg(a)||1!=a.a.length||(this.a.splice(d,0,a.a[0]),a.h[1].C=this,a.h[0].C=this,this.h.splice(d,1,a.h[1]),this.h.splice(d,0,a.h[0]));return 512==this.a.length?rg(this):this};
  function rg(a){var b=bg(a.u),c=bg(a.u);b.C=a.C;b.mb=a.mb+1;b.a=[a.a[256]];b.h=[a,c];a.a.splice(256,1);c.C=b;c.mb=a.mb;c.a=a.a.splice(256);c.h=a.h.splice(257);c.h.forEach(function(d){d.C=c});a.C=b;jg(c,a.xa);jg(a,c);return b}function mg(a,b){for(var c=0,d=a.a.length,e=a.u.jb();c<d;){var f=c+d>>1;-1==e.compare(a.a[f],b)?c=f+1:d=f}return c}n.Qe=function(a){if(!hg(this)){var b=mg(this,a);this.u.Pa(this.a[b],a)&&b++;return this.h[b].Qe(a)}return this};
  n.Pe=function(a){if(!hg(this)){var b=mg(this,a);this.u.Pa(this.a[b],a)&&(a.some(function(c){return c==G})||b++);return this.h[b].Pe(a)}return this};
  n.Ua=function(a,b,c){function d(y){return y[0]?y[1]?0:1:-1}var e=this.u.jb(),f=0,g=this.a.length-1,k=this.a,l=d(e.wb(k[f],a)),p=d(e.wb(k[g],a));if(1!=l&&(-1!=l||-1!=p)){var r=function(y,L){L=y+L>>1;return L==y?L+1:L},W=function(y,L,V){if(y>=L)return 0==V?L:-1;var na=d(e.wb(k[y],a));if(0==na)return y;if(1==na)return-1;na=r(y,L);if(na==L)return 0==V?L:-1;var ib=d(e.wb(k[na],a));return 0==ib?W(y,na,ib):-1==ib?W(na+1,L,V):W(y+1,na,ib)},K=function(y,L){if(y>=L)return y;var V=d(e.wb(k[L],a));if(0==V)return L;
  if(-1==V)return y;V=r(y,L);if(V==L)return y;var na=d(e.wb(k[V],a));return 0==na?K(V,L):1==na?K(y,V-1):-1};0!=l&&(f=W(f+1,g,p));-1!=f&&(g=K(f,g),-1!=g&&g>=f&&sg(this,b,c,f,g+1))}};function ag(a,b,c,d){if(a.u.Ma())!b.reverse&&b.L?b.L--:c[b.count++]=a.D[d];else for(var e=0;e<a.D[d].length&&b.count<c.length;++e)!b.reverse&&b.L?b.L--:c[b.count++]=a.D[d][e]}function sg(a,b,c,d,e){for(;d<e&&(b.reverse||!(b.count>=b.X));++d)ag(a,b,c,d)}
  n.fill=function(a,b){if(hg(this))for(var c=0;c<this.D.length&&0<a.count;++c)if(0<a.offset){if(a.offset-=this.u.Ma()?1:this.D[c].length,0>a.offset)for(var d=this.D[c].length+a.offset;d<this.D[c].length&&0<a.count;++d)b[a.ue++]=this.D[c][d],a.count--}else if(this.u.Ma())b[a.ue++]=this.D[c],a.count--;else for(d=0;d<this.D[c].length&&0<a.count;++d)b[a.ue++]=this.D[c][d],a.count--;else for(c=0;c<this.h.length&&0<a.count;++c)this.h[c].fill(a,b)};
  function fg(a,b){var c=b.Y();a=a.map(function(e){var f=new gg(e.id(),b);f.a=e.m[0];f.D=e.m[1];f.a.forEach(function(g,k){c.add(g,b.Ma()?1:f.D[k].length)});return f});for(var d=0;d<a.length-1;++d)jg(a[d],a[d+1]);return 1<a.length?lg(a[0]):a[0]}n.ld=function(a){return this.u.jb().ld(this.a[0],a)};function tg(a){this.Yc=0==a?ug:vg;this.de=0==a?function(b){return null!=b?b.reverse():null}:function(b){return b||null};this.je=0==a?wg:xg}function vg(a,b){return a>b?1:a<b?-1:0}function ug(a,b){return vg(b,a)}function xg(a,b){return Td(a,b)}function wg(a,b){return Td(b,a)}n=tg.prototype;n.wb=function(a,b){b=this.de(b);var c=[b.from==G,b.o==G];if(!c[0]){var d=this.Yc(a,b.from);c[0]=b.ea?1==d:-1!=d}c[1]||(d=this.Yc(a,b.o),c[1]=b.na?-1==d:1!=d);return c};n.compare=function(a,b){return this.Yc(a,b)};
  n.min=function(a,b){return a<b?1:a==b?0:-1};n.max=function(a,b){return a>b?1:a==b?0:-1};n.Cb=function(a,b){a=this.wb(a,b);return a[0]&&a[1]};n.ld=function(a,b){return this.Cb(a,b)};n.xf=function(a){return a.filter(function(b){return null!==b}).sort(function(b,c){return this.je(b,c)}.bind(this))};n.Yd=function(a){return this.de(a).from==G};n.vd=function(a){a=this.de(a);return[a.from,a.o]};n.Pd=function(a){return null!==a};n.$d=m(1);
  n.toString=function(){return this.compare==ug?"SimpleComparator_DESC":"SimpleComparator_ASC"};function yg(a){tg.call(this,a);this.Yc=0==a?zg:Ag}u(yg,tg);function Ag(a,b){return null===a?null===b?0:-1:null===b?1:vg(a,b)}function zg(a,b){return Ag(b,a)}yg.prototype.Cb=function(a,b){return null===a?Od(b):yg.hb.Cb.call(this,a,b)};yg.prototype.Hb=function(a,b){return null===a?null===b?0:-1:null===b?1:null};yg.prototype.min=function(a,b){var c=this.Hb(a,b);null===c&&(c=yg.hb.min.call(this,a,b));return c};
  yg.prototype.max=function(a,b){var c=this.Hb(a,b);null===c&&(c=yg.hb.max.call(this,a,b));return c};function Bg(a){this.pa=a.map(function(b){return new tg(b)})}function Cg(a,b,c,d){for(var e=0,f=0;f<a.pa.length&&0==e;++f)e=d(a.pa[f],b[f],c[f]);return e}n=Bg.prototype;n.compare=function(a,b){return Cg(this,a,b,function(c,d,e){return d==G||e==G?0:c.compare(d,e)})};n.min=function(a,b){return Cg(this,a,b,function(c,d,e){return c.min(d,e)})};n.max=function(a,b){return Cg(this,a,b,function(c,d,e){return c.max(d,e)})};
  n.wb=function(a,b){for(var c=[!0,!0],d=0;d<this.pa.length&&(c[0]||c[1]);++d){var e=this.pa[d].wb(a[d],b[d]);c[0]=c[0]&&e[0];c[1]=c[1]&&e[1]}return c};n.Cb=function(a,b){for(var c=!0,d=0;d<this.pa.length&&c;++d)c=this.pa[d].Cb(a[d],b[d]);return c};n.ld=function(a,b){return this.pa[0].Cb(a[0],b[0])};
  n.xf=function(a){var b=a.filter(function(d){return d.every(ha)});a=Array(this.pa.length);for(var c=0;c<a.length;c++)a[c]=b.map(function(d){return d[c]});a.forEach(function(d,e){d.sort(function(f,g){return this.pa[e].je(f,g)}.bind(this))},this);b=Array(b.length);for(c=0;c<b.length;c++)b[c]=a.map(function(d){return d[c]});return b.sort(function(d,e){for(var f=0,g=0;g<this.pa.length&&0==f;++g)f=this.pa[g].je(d[g],e[g]);return f}.bind(this))};n.Yd=function(a){return this.pa[0].Yd(a[0])};
  n.vd=function(a){var b=a.map(function(c,d){return this.pa[d].vd(c)[0]},this);a=a.map(function(c,d){return this.pa[d].vd(c)[1]},this);return[b,a]};n.Pd=function(a){return a.every(function(b,c){return this.pa[c].Pd(b)},this)};n.$d=function(){return this.pa.length};function Dg(a){Bg.call(this,a);this.pa=a.map(function(b){return new yg(b)})}u(Dg,Bg);function Eg(a){if(1==a.f.length)return new tg(a.f[0].order);var b=a.f.map(function(c){return c.order});return a.f.some(function(c){return c.aa.hc()})?new Dg(b):new Bg(b)};function Fg(a){this.fa=a;this.ob=D();this.Oc=new Wf;this.za=new Wf}n=Fg.prototype;n.getName=function(){return this.fa.getName()};n.add=function(a,b){null===a?(this.ob.add(b),this.Oc.add(a,1)):this.fa.add(a,b)};n.set=function(a,b){null===a?(this.ob.clear(),this.Oc.clear(),this.add(a,b)):this.fa.set(a,b)};n.remove=function(a,b){null===a?b?(this.ob.delete(b),this.Oc.remove(a,1)):(this.ob.clear(),this.Oc.clear()):this.fa.remove(a,b)};n.get=function(a){return null===a?E(this.ob):this.fa.get(a)};n.$c=function(a){return this.fa.$c(a)};
  n.Y=function(){Xf(this.za,[this.fa.Y(),this.Oc]);return this.za};n.Ua=function(a,b,c,d){b=this.fa.Ua(a,b,c,d);return null!=a?b:b.concat(E(this.ob))};n.clear=function(){this.ob.clear();this.fa.clear()};n.Oa=function(a){return null===a?0!=this.ob.size:this.fa.Oa(a)};n.min=function(){return this.fa.min()};n.max=function(){return this.fa.max()};n.Ja=function(){return[new vc(-2,E(this.ob))].concat(this.fa.Ja())};n.jb=function(){return this.fa.jb()};
  function Gg(a,b){for(var c=-1,d=0;d<b.length;++d)if(-2==b[d].id()){c=d;break}if(-1==c)throw new F(102);d=b[c].m;b=b.slice(0);b.splice(c,1);a=a(b);var e=new Fg(a);d.forEach(function(f){e.ob.add(f)});return e}n.Ma=function(){return this.fa.Ma()};function Hg(a){this.A=a;this.sb=D();this.Z=new tg(1)}n=Hg.prototype;n.getName=h("A");n.add=function(a){if("number"!=typeof a)throw new F(103);this.sb.add(a)};n.set=function(a,b){this.add(a,b)};n.remove=function(a){this.sb.delete(a)};n.get=function(a){return this.Oa(a)?[a]:[]};n.min=function(){return this.Hb(this.Z.min.bind(this.Z))};n.max=function(){return this.Hb(this.Z.max.bind(this.Z))};
  n.Hb=function(a){if(0==this.sb.size)return null;var b=E(this.sb).reduce(function(c,d){return null===c||1==a(d,c)?d:c},null);return[b,[b]]};n.$c=function(){return this.sb.size};n.Ua=function(a,b,c,d){var e=a||[Rd()];a=E(this.sb).filter(function(f){return e.some(function(g){return this.Z.Cb(f,g)},this)},this);return Vf(a,b,c,d)};n.clear=function(){this.sb.clear()};n.Oa=function(a){return this.sb.has(a)};n.Ja=function(){return[new vc(0,E(this.sb))]};n.jb=h("Z");
  function Ig(a,b){var c=new Hg(a);b[0].m.forEach(function(d){c.add(d,d)});return c}n.Ma=m(!0);n.Y=function(){var a=new Wf;a.ia=this.sb.size;return a};function Jg(a){this.ab=a.b(Jc);this.B=a.b(Lc);this.V=a.b(Kc)}Jg.prototype.Ea=function(a){var b=a.oa(),c=function(){if(0==b.length)return x();var d=b.shift();return(d.Db()?Kg(this,d):Lg(this,d)).then(c)}.bind(this);return c()};function Lg(a,b){var c=a.ab.Gb(0,[b]);a=c.I(b.getName(),b.kb.bind(b),0).get([]).then(function(d){this.V.Yb(b.getName(),d);Mg(this,b,d)}.bind(a));c.ka();return a}
  function Mg(a,b,c){var d=a.B.lc.get(b.getName())||[];c.forEach(function(e){d.forEach(function(f){var g=e.nb(f.getName());f.add(g,e.id())})})}function Kg(a,b){var c=a.ab.Gb(0,[b]),d=c.I(b.getName(),b.kb,0).get([]).then(function(e){this.V.Yb(b.getName(),e)}.bind(a));a=b.Da().map(function(e){return Ng(this,e,c)},a).concat(Og(a,b,c));c.ka();return tb(a.concat(d))}
  function Ng(a,b,c){c=c.I(b.j(),xc,1);var d=Eg(b);return c.get([]).then(function(e){if(0<e.length)if(Pg(b)){var f=eg.bind(void 0,d,b.j(),b.Dc);e=Gg(f,e);this.B.set(b.mc,e)}else e=eg(d,b.j(),b.Dc,e),this.B.set(b.mc,e)}.bind(a))}function Og(a,b,c){return c.I(Af(b),xc,1).get([]).then(function(d){0<d.length&&(d=Ig(Af(b),d),this.B.set(b.getName(),d))}.bind(a))};function Qg(){this.ba=A();this.lc=A()}Qg.prototype.Ea=function(a){a.oa().forEach(function(b){var c=[];this.lc.set(b.getName(),c);var d=Af(b);if(null===this.get(d)){var e=new Hg(d);c.push(e);this.ba.set(d,e)}b.Da().forEach(function(f){var g=Eg(f);g=new Yf(f.j(),g,f.Dc);g=Pg(f)&&1==f.f.length?new Fg(g):g;c.push(g);this.ba.set(f.j(),g)},this)},this);return x()};Qg.prototype.get=function(a){return this.ba.get(a)||null};
  Qg.prototype.set=function(a,b){var c=this.lc.get(a)||null;null===c&&(c=[],this.lc.set(a,c));a=null;for(var d=0;d<c.length;d++)if(c[d].getName()==b.getName()){a=d;break}null!==a&&0<c.length?c.splice(a,1,b):c.push(b);this.ba.set(b.getName(),b)};function Rg(a,b){var c=[],d=null,e=null;Be(a,function(f){var g=b(f);null==f.getParent()?e=g:ye(d,g);var k=f.getParent();null!==k&&M(k).length==M(d).length&&(k=c.indexOf(d),-1!=k&&c.splice(k,1));1<M(f).length&&c.push(g);d=null===f.h?c[c.length-1]:g});return e}function Sg(a){return Tg(a,function(b){return null===b.h})}
  function Ug(a){var b=a.getParent(),c=0;null!==b&&(c=M(b).indexOf(a),b.removeChild(a));var d=M(a).slice();d.forEach(function(e,f){a.removeChild(e);null===b||xe(b,e,c+f)});return{parent:b,children:d}}function Vg(a,b){M(a).slice().forEach(function(c){a.removeChild(c);ye(b,c)});ye(a,b)}function Wg(a){var b=we(a,0);Ug(a);Vg(b,a);return b}
  function Xg(a,b,c){var d=we(a,0),e=M(d).slice();if(!e.some(function(f){return b(f)}))return a;Ug(a);e.forEach(function(f,g){if(b(f)){var k=c(a);ze(d,g);ye(k,f);xe(d,k,g)}});return d}function Yg(a,b,c,d){var e=a.getParent();null!==e&&(a=M(e).indexOf(a),ze(e,a),xe(e,c,a));M(b).slice().forEach(function(f){b.removeChild(f);ye(d,f)});return c}function Tg(a,b,c){function d(f){b(f)&&e.push(f);null!=c&&c(f)||M(f).forEach(d)}var e=[];d(a);return e}
  function Zg(a,b){var c=b||function(e){return e.toString()+"\n"},d="";Be(a,function(e){for(var f=0;f<ve(e);f++)d+="-";d+=c(e)});return d};function $g(a){Ce.call(this);this.pb=a;this.Va=!1}u($g,Ce);n=$g.prototype;n.Ob=function(){return Rg(this,function(a){if(a instanceof $g){var b=new $g(a.pb);b.Va=a.Va;a=a.W();b.ra=a;return b}return a.Ob()})};n.lb=function(a){var b=a||[];Be(this,function(c){c!=this&&c.lb(b)}.bind(this));a=D(b);return E(a)};n.s=function(a){var b=null!=a?a:D();Be(this,function(c){c!=this&&c.s(b)}.bind(this));return b};n.wd=function(a){this.Va!=a&&(this.Va=a,this.pb="and"==this.pb?"or":"and",M(this).forEach(function(b){return b.wd(a)}))};
  n.eval=function(a){var b=M(this).map(function(c){return c.eval(a)});return ah(this,b)};function ah(a,b){return"and"==a.pb?be(b):ce(b)}n.toString=function(){return"combined_pred_"+this.pb.toString()};n.xe=function(){if("or"==this.pb){var a=new Vd;M(this).forEach(function(b){b=b.xe().wa();a.add(b)});return a}return new Vd};n.md=function(){return"or"==this.pb?bh(this):!1};
  function bh(a){var b=null;return M(a).every(function(c){if(!(c instanceof Ee&&c.md()))return!1;null===b&&(b=c.J);return b.j()==c.J.j()})};function ch(a,b,c){Ce.call(this);this.ga=a;this.ma=b;this.F=c;this.ee=null;a=se();this.vc=te(a,this.ga.G(),this.F);this.vg=a.$e.get(this.ga.G())||null}u(ch,Ce);n=ch.prototype;n.Ob=function(){var a=new ch(this.ga,this.ma,this.F),b=this.W();a.ra=b;return a};n.lb=function(a){return null!=a?(a.push(this.ga),a.push(this.ma),a):[this.ga,this.ma]};n.s=function(a){a=null!=a?a:D();a.add(this.ga.I());a.add(this.ma.I());return a};
  n.reverse=function(){var a=this.F;switch(this.F){case "gt":a="lt";break;case "lt":a="gt";break;case "gte":a="lte";break;case "lte":a="gte"}return new ch(this.ma,this.ga,a)};n.eval=function(a){var b=a.entries.filter(function(c){var d=I(c,this.ga);c=I(c,this.ma);return this.vc(d,c)},this);return new H(b,a.s())};n.toString=function(){return"join_pred("+this.ga.j()+" "+this.F+" "+this.ma.j()+")"};
  function dh(a,b,c){if(-1!=b.s().indexOf(ge(a.ga.I()))){var d=b;b=c}else d=c;if(d.entries.length>b.entries.length){a:{c=a.ga;a.ga=a.ma;a.ma=c;switch(a.F){case "gt":c="lt";break;case "lt":c="gt";break;case "gte":c="lte";break;case "lte":c="gte";break;default:break a}a.F=c;a.vc=te(se(),a.ga.G(),a.F)}return[b,d]}return[d,b]}function eh(a){var b={};a.lb().forEach(function(c){b[c.getName()]=null});return b}
  function fh(a,b,c){null===a.ee&&(a.ee=eh(a.ma.I()));var d=new ee(new vc(-1,a.ee),!1);return ie(b,c,d,[ge(a.ma.I())])}
  function gh(a,b,c,d){var e=[b,c];d||(e=dh(a,b,c));b=e[0];c=e[1];e=b;var f=c,g=a.ga,k=a.ma;d&&(e=c,f=b,g=a.ma,k=a.ga);var l=new pd,p=[];e.entries.forEach(function(K){var y=String(I(K,g));l.set(y,K)});var r=e.s(),W=f.s();f.entries.forEach(function(K){var y=I(K,k),L=String(y);null!==y&&l.has(L)?l.get(L).forEach(function(V){V=ie(K,W,V,r);p.push(V)}):d&&p.push(fh(this,K,W))}.bind(a));a=b.s().concat(c.s());return new H(p,a)}
  function hh(a,b,c,d,e){function f(K,y){y=new ee(y,1<r.length);K=ie(K,W,y,r);p.push(K)}var g=d.lg.I(),k=b,l=c;-1!=b.s().indexOf(ge(g))&&(k=c,l=b);var p=[],r=l.s(),W=k.s();k.entries.forEach(function(K){var y=this.vg(I(K,d.Eg));y=d.index.get(y);0!=y.length&&(d.index.Ma()?f(K,e.get(y[0])):Rf(e,y).forEach(f.bind(null,K)))},a);a=k.s().concat(l.s());return new H(p,a)};function ih(a,b,c){return null===b?new Ee(a,b,c):q(b.j)?new ch(a,b,c):new Ee(a,b,c)};var jh={};t("lf.schema.DataStoreType",jh);jh.INDEXED_DB=0;jh.MEMORY=1;jh.LOCAL_STORAGE=2;jh.FIREBASE=3;jh.WEB_SQL=4;jh.OBSERVABLE_STORE=5;function kh(a,b,c,d){this.mc=a;this.name=b;this.Dc=c;this.f=d}kh.prototype.j=function(){return this.mc+"."+this.name};function Pg(a){return a.f.some(function(b){return b.aa.hc()})}function Q(a,b,c,d){this.A=a;this.sa=c;this.K=b;this.sd=d;this.Ka=null}t("lf.schema.Table",Q);Q.prototype.getName=h("A");Q.prototype.getName=Q.prototype.getName;
  function ge(a){return a.Ka||a.A}Q.prototype.as=function(a){var b=new this.constructor(this.A);b.Ka=a;b.Qg=this.Qg;return b};Q.prototype.as=Q.prototype.as;Q.prototype.createRow=Q.prototype.xb;Q.prototype.deserializeRow=Q.prototype.kb;Q.prototype.Da=h("sa");Q.prototype.getIndices=Q.prototype.Da;Q.prototype.lb=h("K");Q.prototype.getColumns=Q.prototype.lb;Q.prototype.getConstraint=Q.prototype.Oe;Q.prototype.Db=h("sd");Q.prototype.persistentIndex=Q.prototype.Db;function Af(a){return a.A+".#"};function R(a,b){this.child=a;this.Mb=b;this.Ka=null}n=R.prototype;n.getName=function(){return this.Mb+"("+this.child.getName()+")"};n.j=function(){return this.Mb+"("+this.child.j()+")"};n.I=function(){return this.child.I()};n.toString=function(){return this.j()};n.G=function(){return this.child.G()};n.Da=function(){return[]};n.Ca=m(null);n.hc=m(!1);n.as=function(a){this.Ka=a;return this};R.prototype.as=R.prototype.as;
  function lh(a){for(var b=[a];a instanceof R;)b.push(a.child),a=a.child;return b}function mh(){this.Ka=null;this.U=new Q("#UnknownTable",[],[],!1)}n=mh.prototype;n.getName=m("*");n.j=function(){return this.getName()};n.toString=function(){return this.j()};n.I=h("U");n.G=m(4);n.Da=function(){return[]};n.Ca=m(null);n.hc=m(!1);t("lf.fn.avg",function(a){return new R(a,"AVG")});function nh(a){return new R(a||new mh,"COUNT")}t("lf.fn.count",nh);function oh(a){return new R(a,"DISTINCT")}t("lf.fn.distinct",oh);t("lf.fn.max",function(a){return new R(a,"MAX")});t("lf.fn.min",function(a){return new R(a,"MIN")});t("lf.fn.stddev",function(a){return new R(a,"STDDEV")});t("lf.fn.sum",function(a){return new R(a,"SUM")});t("lf.fn.geomean",function(a){return new R(a,"GEOMEAN")});function S(a,b){J.call(this);this.bg=b}u(S,J);S.prototype.exec=function(a,b){switch(this.bg){case 1:return ph(this,a,b);case 0:return qh(this,a,b);default:return rh(this,a,b)}};S.prototype.toString=m("dummy_node");S.prototype.Qc=function(){return this.toString()};function rh(a,b,c){return new w(function(d){d(this.ca([],b,c))}.bind(a))}function ph(a,b,c){return we(a,0).exec(b,c).then(function(d){return this.ca(d,b,c)}.bind(a))}
  function qh(a,b,c){var d=M(a).map(function(e){return e.exec(b,c)});return tb(d).then(function(e){var f=[];e.forEach(function(g){for(var k=0;k<g.length;++k)f.push(g[k])});return this.ca(f,b,c)}.bind(a))};function sh(a){S.call(this,-1,1);this.De=a}u(sh,S);sh.prototype.toString=function(){return"aggregation("+this.De.map(function(a){return a.j()}).toString()+")"};sh.prototype.ca=function(a){a.forEach(function(b){th(new uh(b,this.De))},this);return a};function uh(a,b){this.Na=a;this.K=b}
  function th(a){a.K.forEach(function(b){b=lh(b).reverse();for(var c=1;c<b.length;c++){var d=b[c],e=lh(d).slice(-1)[0],f=d.child instanceof R?Zd(this.Na,d.child):this.Na;if(null!==f.Za&&f.Za.has(d.j()))break;f=vh(d.Mb,f,e);e=this.Na;null===e.Za&&(e.Za=A());e.Za.set(d.j(),f)}},a)}
  function vh(a,b,c){var d=null;switch(a){case "MIN":d=wh(b,c,function(e,f){return f<e?f:e});break;case "MAX":d=wh(b,c,function(e,f){return f>e?f:e});break;case "DISTINCT":d=xh(b,c);break;case "COUNT":d=yh(b,c);break;case "SUM":d=zh(b,c);break;case "AVG":a=yh(b,c);0<a&&(d=zh(b,c)/a);break;case "GEOMEAN":d=Ah(b,c);break;default:d=Bh(b,c)}return d}function wh(a,b,c){return a.entries.reduce(function(d,e){e=I(e,b);return null===e?d:null===d?e:c(d,e)},null)}
  function yh(a,b){return b instanceof mh?a.entries.length:a.entries.reduce(function(c,d){return c+(null===I(d,b)?0:1)},0)}function zh(a,b){return wh(a,b,function(c,d){return d+c})}function Bh(a,b){var c=[];a.entries.forEach(function(d){d=I(d,b);null===d||c.push(d)});return 0==c.length?null:Jb.apply(null,c)}function Ah(a,b){var c=0;a=a.entries.reduce(function(d,e){e=I(e,b);if(0==e||null===e)return d;c++;return d+Math.log(e)},0);return 0==c?null:Math.pow(Math.E,a/c)}
  function xh(a,b){var c=A();a.entries.forEach(function(d){var e=I(d,b);c.set(e,d)});return new H(B(c),a.s())};function Ch(a,b){this.Ha=a;this.$=b}Ch.prototype.bb=h("Ha");Ch.prototype.da=h("$");function Dh(){J.call(this)}u(Dh,J);function Eh(a,b){J.call(this);this.table=a;this.values=b}u(Eh,Dh);function Fh(a,b){Eh.call(this,a,b)}u(Fh,Eh);function Gh(a){J.call(this);this.table=a}u(Gh,Dh);Gh.prototype.toString=function(){return"delete("+this.table.getName()+")"};function Hh(a){J.call(this);this.table=a}u(Hh,Dh);Hh.prototype.toString=function(){return"update("+this.table.getName()+")"};
  function Ih(a){J.call(this);this.O=a}u(Ih,Dh);Ih.prototype.toString=function(){return"select("+this.O.toString()+")"};function Jh(a){J.call(this);this.table=a}u(Jh,Dh);Jh.prototype.toString=function(){var a="table_access("+this.table.getName();null===this.table.Ka||(a+=" as "+this.table.Ka);return a+")"};function Kh(){J.call(this)}u(Kh,Dh);Kh.prototype.toString=m("cross_product");function Lh(a,b){J.call(this);this.f=a;this.Rb=b}u(Lh,Dh);
  Lh.prototype.toString=function(){var a="project("+this.f.toString();if(null!==this.Rb){var b=this.Rb.map(function(c){return c.j()}).join(", ");a+=", groupBy("+b+")"}return a+")"};function Mh(a){J.call(this);this.N=a}u(Mh,Dh);Mh.prototype.toString=function(){return"order_by("+Oe(this.N)+")"};function Nh(a){J.call(this);this.f=a}u(Nh,Dh);Nh.prototype.toString=function(){return"aggregation("+this.f.toString()+")"};function Oh(a){J.call(this);this.f=a}u(Oh,Dh);
  Oh.prototype.toString=function(){return"group_by("+this.f.toString()+")"};function Ph(a){J.call(this);this.X=a}u(Ph,Dh);Ph.prototype.toString=function(){return"limit("+this.X+")"};function Qh(a){J.call(this);this.L=a}u(Qh,Dh);Qh.prototype.toString=function(){return"skip("+this.L+")"};function Rh(a,b){J.call(this);this.O=a;this.Tb=b}u(Rh,Dh);Rh.prototype.toString=function(){return"join(type: "+(this.Tb?"outer":"inner")+", "+this.O.toString()+")"};function Sh(){};function Th(){}u(Th,Sh);Th.prototype.gb=function(a){this.H=a;this.ub(this.H);return this.H};Th.prototype.ub=function(a){if(a instanceof Ih){var b=Uh(this,a.O);b=Vh(this,b);Yg(a,a,b[0],b[1]);a==this.H&&(this.H=b[0]);a=b[0]}M(a).forEach(function(c){this.ub(c)},this)};function Uh(a,b){if(0==M(b).length||"and"!=b.pb)return[b];a=M(b).slice().map(function(c){b.removeChild(c);return Uh(this,c)},a);return Aa(a)}
  function Vh(a,b){var c=null,d=null;b.map(function(e,f){e=new Ih(e);0==f?c=e:ye(d,e);d=e},a);return[c,d]};function Wh(){}u(Wh,Sh);Wh.prototype.gb=function(a,b){if(3>b.from.length)return a;this.H=a;this.ub(this.H);return this.H};Wh.prototype.ub=function(a){if(a instanceof Kh)for(;2<M(a).length;){for(var b=new Kh,c=0;2>c;c++){var d=ze(a,0);ye(b,d)}xe(a,b,0)}M(a).forEach(function(e){this.ub(e)},this)};function Xh(){S.call(this,2,0)}u(Xh,S);Xh.prototype.toString=m("cross_product");Xh.prototype.ca=function(a){var b=a[0],c=a[1];a=[];for(var d=b.s(),e=c.s(),f=0;f<b.entries.length;f++)for(var g=0;g<c.entries.length;g++){var k=ie(b.entries[f],d,c.entries[g],e);a.push(k)}b=b.s().concat(c.s());return[new H(a,b)]};function Yh(a,b){Re.call(this,a,b);this.Ia=a.b(Nc);this.Ib=a.b(Oc)}u(Yh,Re);Yh.prototype.getPriority=m(2);Yh.prototype.he=function(a){0==this.G()?Zh(this,a):this.Mc()};function Zh(a,b){a.ud.forEach(function(c,d){c instanceof Ne&&Ue(this.Ib,c,b[d])},a)}Yh.prototype.Mc=function(){var a=We(this.Ib,this.da());0!=a.length&&(a=new Te(this.global,a),Xe(this.Ia,a))};function $h(a){Ie.call(this,a)}u($h,Ie);$h.prototype.da=function(){var a=D();a.add(this.from);ai(this,this.from.getName(),a);return a};function ai(a,b,c){var d=bi(a.aa.info(),b,1);bi(a.aa.info(),b).forEach(c.add.bind(c));d.forEach(function(e){ai(this,e.getName(),c)},a)}$h.prototype.clone=function(){var a=new $h(this.aa);Le(a,this);a.from=this.from;return a};$h.prototype.bind=function(a){$h.hb.bind.call(this,a);Me(this,a);return this};function ci(a){Ie.call(this,a)}u(ci,Ie);ci.prototype.da=function(){var a=D();a.add(this.La);var b=this.aa.info();di(this.La.getName(),b.hf).forEach(a.add.bind(a));this.ac&&bi(b,this.La.getName()).forEach(a.add.bind(a));return a};ci.prototype.clone=function(){var a=new ci(this.aa);Le(a,this);a.La=this.La;this.values&&(a.values=this.values instanceof je?this.values:this.values.slice());a.ac=this.ac;a.bc=this.bc;return a};
  ci.prototype.bind=function(a){ci.hb.bind.call(this,a);this.bc&&(this.values=this.bc instanceof je?a[this.bc.Ca()]:this.bc.map(function(b){return b instanceof je?a[b.Ca()]:b}));return this};function ei(a){Ie.call(this,a)}u(ei,Ie);ei.prototype.da=function(){var a=D();a.add(this.table);var b=this.set.map(function(d){return d.J.j()}),c=this.aa.info();fi(c,b).forEach(a.add.bind(a));gi(c,b).forEach(a.add.bind(a));return a};ei.prototype.clone=function(){var a=new ei(this.aa);Le(a,this);a.table=this.table;a.set=this.set?hi(this.set):this.set;return a};ei.prototype.bind=function(a){ei.hb.bind.call(this,a);this.set.forEach(function(b){-1!=b.Uc&&(b.value=a[b.Uc])});Me(this,a);return this};
  function hi(a){return a.map(function(b){var c={},d;for(d in b)c[d]=b[d];return c})};function ii(a,b){if(null==b)return"NULL";switch(a){case 1:return b?1:0;case 3:case 4:return b;case 0:return"'"+zc(b)+"'";default:return"'"+b.toString()+"'"}}function ji(a,b){var c=a.ac?"INSERT OR REPLACE":"INSERT",d=a.La.lb();c+=" INTO "+a.La.getName()+"(";c+=d.map(function(e){return e.getName()}).join(", ");c+=") VALUES (";return a.values.map(function(e){var f=d.map(function(g){var k=e.m[g.getName()];return b?null!=k?"#":"NULL":ii(g.G(),k)});return c+f.join(", ")+");"}).join("\n")}
  function ki(a){switch(a){case "between":return"BETWEEN";case "eq":return"=";case "gte":return">=";case "gt":return">";case "in":return"IN";case "lte":return"<=";case "lt":return"<";case "match":return"LIKE";case "neq":return"<>";default:return"UNKNOWN"}}function li(a,b,c,d){return a instanceof je?"?"+a.Ca().toString():d?null!=a?"#":"NULL":"match"==b?"'"+a.toString()+"'":"in"==b?"("+a.map(function(e){return ii(c,e)}).join(", ")+")":"between"==b?ii(c,a[0])+" AND "+ii(c,a[1]):ii(c,a).toString()}
  function mi(a,b){return M(a).map(function(c){return"("+ni(c,b)+")"}).join("and"==a.pb?" AND ":" OR ")}function oi(a){return[a.ga.j(),ki(a.F),a.ma.j()].join(" ")}function ni(a,b){if(a instanceof Ee){var c=a.J.j(),d=ki(a.F);a=li(a.value,a.F,a.J.G(),b);return"="==d&&"NULL"==a?[c,"IS NULL"].join(" "):"<>"==d&&"NULL"==a?[c,"IS NOT NULL"].join(" "):[c,d,a].join(" ")}if(a instanceof $g)return mi(a,b);if(a instanceof ch)return oi(a);throw new F(357,typeof a);}
  function pi(a,b){return(a=ni(a,b))?" WHERE "+a:""}function qi(a,b){var c="UPDATE "+a.table.getName()+" SET ";c+=a.set.map(function(d){var e=d.J.j()+" = ";return-1!=d.Uc?e+"?"+d.Uc.toString():e+ii(d.J.G(),d.value).toString()}).join(", ");a.w&&(c+=pi(a.w,b));return c+";"}
  function ri(a,b){var c="*";a.f.length&&(c=a.f.map(function(d){return d.Ka?d.j()+" AS "+d.Ka:d.j()}).join(", "));c="SELECT "+c+" FROM ";null!=a.eb&&0!=a.eb.size?c+=si(a,b):(c+=a.from.map(ti).join(", "),a.w&&(c+=pi(a.w,b)));a.N&&(b=a.N.map(function(d){return d.J.j()+(0==d.order?" DESC":" ASC")}).join(", "),c+=" ORDER BY "+b);a.qa&&(b=a.qa.map(function(d){return d.j()}).join(", "),c+=" GROUP BY "+b);a.X&&(c+=" LIMIT "+a.X.toString());a.L&&(c+=" SKIP "+a.L.toString());return c+";"}
  function ti(a){return ge(a)!=a.getName()?a.getName()+" AS "+ge(a):a.getName()}function si(a,b){for(var c=Tg(a.w,function(k){return k instanceof ch}),d=c.map(oi),e=ti(a.from[0]),f=1;f<a.from.length;f++){var g=ti(a.from[f]);e=a.eb.has(c[d.length-f].W())?e+(" LEFT OUTER JOIN "+g):e+(" INNER JOIN "+g);e+=" ON ("+d[d.length-f]+")"}a=a.w;a=0<M(a).length?we(a,0):a;a instanceof ch||(e+=" WHERE "+ni(a,b));return e}
  function ui(a,b){b=b||!1;a=a.getQuery();if(a instanceof ci)return ji(a,b);if(a instanceof $h){var c="DELETE FROM "+a.from.getName();a.w&&(c+=pi(a.w,b));return c+";"}if(a instanceof ei)return qi(a,b);if(a instanceof Ne)return ri(a,b);throw new F(358,typeof a);};function T(a,b){this.global=a;this.Pg=a.b(Mc);this.Ia=a.b(Nc);this.query=b}t("lf.query.BaseBuilder",T);T.prototype.exec=function(){try{this.$a()}catch(a){return qb(a)}return new w(function(a,b){var c=new Yh(this.global,[this.Bc()]);Xe(this.Ia,c).then(function(d){a(Xd(d[0]))},b)},this)};T.prototype.exec=T.prototype.exec;T.prototype.dg=function(){var a=function(b){return b.Qc(this.query)+"\n"}.bind(this);return Zg(vi(this).bb(),a)};T.prototype.explain=T.prototype.dg;
  T.prototype.bind=function(a){this.query.bind(a);return this};T.prototype.bind=T.prototype.bind;T.prototype.Xg=function(a){return ui(this,a)};T.prototype.toSql=T.prototype.Xg;T.prototype.$a=aa();T.prototype.getQuery=function(){return this.query.clone()};function vi(a){if(null==a.jf){var b=a.Pg;var c=a.query,d=b.yg.create(c);b=b.Mg.create(d,c);a.jf=b}return a.jf}T.prototype.Bc=function(){return{context:this.getQuery(),ke:vi(this)}};function wi(a){T.call(this,a,new $h(a.b(Pc)))}u(wi,T);t("lf.query.DeleteBuilder",wi);wi.prototype.from=function(a){if(null!=this.query.from)throw new F(515);this.query.from=a;return this};wi.prototype.from=wi.prototype.from;wi.prototype.w=function(a){this.Gd();this.query.w=a;return this};wi.prototype.where=wi.prototype.w;wi.prototype.Gd=function(){if(null==this.query.from)throw new F(548);if(null!=this.query.w)throw new F(516);};
  wi.prototype.$a=function(){wi.hb.$a.call(this);if(null==this.query.from)throw new F(517);};function xi(a,b){T.call(this,a,new ci(a.b(Pc)));this.query.ac=b||!1}u(xi,T);t("lf.query.InsertBuilder",xi);xi.prototype.$a=function(){xi.hb.$a.call(this);var a=this.query;if(null==a.La||null==a.values)throw new F(518);if(a.ac&&null===a.La.Nb.td)throw new F(519);};xi.prototype.La=function(a){if(null!=this.query.La)throw new F(520);this.query.La=a;return this};xi.prototype.into=xi.prototype.La;
  xi.prototype.values=function(a){if(null!=this.query.values)throw new F(521);a instanceof je||a.some(function(b){return b instanceof je})?this.query.bc=a:this.query.values=a;return this};xi.prototype.values=xi.prototype.values;function yi(a){return zi("and",Array.prototype.slice.call(arguments))}t("lf.op.and",yi);t("lf.op.or",function(a){return zi("or",Array.prototype.slice.call(arguments))});function zi(a,b){var c=new $g(a);b.forEach(function(d){ye(c,d)});return c}t("lf.op.not",function(a){a.wd(!0);return a});function U(a,b){T.call(this,a,new Ne(a.b(Pc)));this.Ne=this.Bd=!1;this.query.f=b;Ai(this);Bi(this)}u(U,T);t("lf.query.SelectBuilder",U);U.prototype.$a=function(){U.hb.$a.call(this);var a=this.query;if(null==a.from)throw new F(522);if(q(a.Ub)&&!q(a.X)||q(a.Kb)&&!q(a.L))throw new F(523);null!=this.query.qa?Ci(this):Di(this)};function Ai(a){var b=a.query.f.filter(function(c){return c instanceof R&&"DISTINCT"==c.Mb},a);if(0!=b.length&&(1!=b.length||1!=a.query.f.length))throw new F(524);}
  function Ci(a){if(a.query.qa.some(function(b){b=b.G();return 6==b||0==b}))throw new F(525);}function Di(a){var b=a.query.f.some(function(c){return c instanceof R},a);a=a.query.f.some(function(c){return!(c instanceof R)},a)||0==a.query.f.length;if(b&&a)throw new F(526);}function Bi(a){a.query.f.forEach(function(b){if(b instanceof R&&!Ei(b.Mb,b.G()))throw new F(527,b.j());},a)}function Fi(a,b){if(null==a.query.from)throw new F(b);}
  U.prototype.from=function(a){if(this.Ne)throw new F(515);this.Ne=!0;null==this.query.from&&(this.query.from=[]);this.query.from.push.apply(this.query.from,Array.prototype.slice.call(arguments));return this};U.prototype.from=U.prototype.from;U.prototype.w=function(a){Fi(this,548);if(this.Bd)throw new F(516);this.Bd=!0;Gi(this,a);return this};U.prototype.where=U.prototype.w;function Gi(a,b){null!=a.query.w?(b=yi(b,a.query.w),a.query.w=b):a.query.w=b}
  U.prototype.pg=function(a,b){Fi(this,542);if(this.Bd)throw new F(547);this.query.from.push(a);Gi(this,b);return this};U.prototype.innerJoin=U.prototype.pg;U.prototype.wg=function(a,b){Fi(this,542);if(!(b instanceof ch))throw new F(541);if(this.Bd)throw new F(547);this.query.from.push(a);null==this.query.eb&&(this.query.eb=D());var c=b;ge(a)!=ge(b.ma.I())&&(c=b.reverse());this.query.eb.add(c.W());Gi(this,c);return this};U.prototype.leftOuterJoin=U.prototype.wg;
  U.prototype.X=function(a){if(null!=(this.query.X||this.query.Ub))throw new F(528);if(a instanceof je)this.query.Ub=a;else{if(0>a)throw new F(531);this.query.X=a}return this};U.prototype.limit=U.prototype.X;U.prototype.L=function(a){if(null!=(this.query.L||this.query.Kb))throw new F(529);if(a instanceof je)this.query.Kb=a;else{if(0>a)throw new F(531);this.query.L=a}return this};U.prototype.skip=U.prototype.L;
  U.prototype.N=function(a,b){Fi(this,549);null==this.query.N&&(this.query.N=[]);this.query.N.push({J:a,order:null!=b?b:1});return this};U.prototype.orderBy=U.prototype.N;U.prototype.qa=function(a){Fi(this,549);if(null!=this.query.qa)throw new F(530);null==this.query.qa&&(this.query.qa=[]);this.query.qa.push.apply(this.query.qa,Array.prototype.slice.call(arguments));return this};U.prototype.groupBy=U.prototype.qa;
  function Ei(a,b){switch(a){case "COUNT":case "DISTINCT":return!0;case "AVG":case "GEOMEAN":case "STDDEV":case "SUM":return 4==b||3==b;case "MAX":case "MIN":return 4==b||3==b||5==b||2==b}return!1}U.prototype.clone=function(){var a=new U(this.global,this.query.f);a.query=this.query.clone();a.query.Xc=null;return a};U.prototype.clone=U.prototype.clone;function Hi(a,b){T.call(this,a,new ei(a.b(Pc)));this.query.table=b}u(Hi,T);t("lf.query.UpdateBuilder",Hi);Hi.prototype.set=function(a,b){a={Uc:b instanceof je?b.Ca():-1,J:a,value:b};null!=this.query.set?this.query.set.push(a):this.query.set=[a];return this};Hi.prototype.set=Hi.prototype.set;Hi.prototype.w=function(a){this.Gd();this.query.w=a;return this};Hi.prototype.where=Hi.prototype.w;Hi.prototype.Gd=function(){if(null!=this.query.w)throw new F(516);};
  Hi.prototype.$a=function(){Hi.hb.$a.call(this);if(null==this.query.set)throw new F(532);if(this.query.set.some(function(a){return a.value instanceof je}))throw new F(501);};function Ii(a){this.query=a;this.Ha=null}Ii.prototype.gc=function(){null===this.Ha&&(this.Ha=this.bd());return this.Ha};function Ji(a){Ii.call(this,a)}u(Ji,Ii);Ji.prototype.bd=function(){return this.query.ac?new Fh(this.query.La,this.query.values):new Eh(this.query.La,this.query.values)};function Ki(a){Ii.call(this,a)}u(Ki,Ii);
  Ki.prototype.bd=function(){var a=new Hh(this.query.table),b=null!=this.query.w?new Ih(this.query.w.Ob()):null,c=new Jh(this.query.table);null===b?ye(a,c):(ye(b,c),ye(a,b));return a};function Li(a,b,c){this.Ha=a;this.me=b;this.Xb=c}Li.prototype.gc=function(){this.Xb.forEach(function(a){this.Ha=a.gb(this.Ha,this.me)},this);return this.Ha};function Mi(a,b){Ii.call(this,a);this.Xb=b}u(Mi,Ii);Mi.prototype.bd=function(){var a=new Gh(this.query.from),b=null!=this.query.w?new Ih(this.query.w.Ob()):null,c=new Jh(this.query.from);null===b?ye(a,c):(ye(b,c),ye(a,b));return(new Li(a,this.query,this.Xb)).gc()};function Ni(){}u(Ni,Sh);Ni.prototype.gb=function(a,b){if(2>b.from.length)return a;this.H=a;this.ub(this.H,b);return this.H};Ni.prototype.ub=function(a,b){if(a instanceof Ih&&a.O instanceof ch){var c=a.O.W(),d=we(a,0);d instanceof Kh&&(c=null!=b.eb&&b.eb.has(c),c=new Rh(a.O,c),Yg(a,d,c,c),a==this.H&&(this.H=c),a=c)}M(a).forEach(function(e){this.ub(e,b)},this)};function Oi(){this.Tc=D()}u(Oi,Sh);Oi.prototype.gb=function(a,b){if(!q(b.w))return a;this.Tc.clear();this.H=a;this.ub(this.H,b);this.Tc.clear();return this.H};Oi.prototype.ub=function(a,b){var c=function(e){M(e).forEach(d)}.bind(this),d=function(e){if(!this.Tc.has(e)){if(e instanceof Ih){var f=e.O.s(),g=function(k){return Pi(this,k,f)}.bind(this);g=Qi(this,b,e,g);this.Tc.add(e);g!=e&&(null===g.getParent()&&(this.H=g),d(g))}c(e)}}.bind(this);d(a)};
  function Qi(a,b,c,d){var e=c;if(Ri(b,c))e=Wg(c),Qi(a,b,c,d);else if(Si(c)){var f=[];e=Xg(c,d,function(g){g=new Ih(g.O);f.push(g);return g});f.forEach(function(g){Qi(this,b,g,d)},a)}return e}function Pi(a,b,c){var d=D();Sg(b).forEach(function(e){d.add(e.table)},a);b instanceof Jh&&d.add(b.table);return Vc(d,c)}function Si(a){a=we(a,0);return a instanceof Kh||a instanceof Rh}
  function Ri(a,b){var c=we(b,0);if(!(c instanceof Ih))return!1;if(null==a.eb)return!0;b=b.O instanceof ch;a=a.eb.has(c.O.W());return b||!a};function Ti(a,b){Ii.call(this,a);this.Xb=b;this.nf=this.df=this.wf=this.gf=this.Ee=this.Te=this.vf=this.Ke=this.zf=null}u(Ti,Ii);
  Ti.prototype.bd=function(){Ui(this);2<=this.query.from.length&&(this.Ke=new Kh);this.vf=null!=this.query.w?new Ih(this.query.w.Ob()):null;this.query.N&&(this.gf=new Mh(this.query.N));if(null!=this.query.L&&0<this.query.L||null!=this.query.Kb)this.wf=new Qh(this.query.L);null!=this.query.X&&(this.df=new Ph(this.query.X));null!=this.query.qa&&(this.Te=new Oh(this.query.qa));Vi(this);this.nf=new Lh(this.query.f||[],this.query.qa||null);var a=Wi(this);return(new Li(a,this.query,this.Xb)).gc()};
  function Wi(a){for(var b=[a.df,a.wf,a.nf,a.gf,a.Ee,a.Te,a.vf,a.Ke],c=-1,d=null,e=0;e<b.length;e++){var f=b[e];null!==f&&(null===d?d=f:ye(b[c],f),c=e)}a.zf.forEach(function(g){ye(b[c],g)});return d}function Ui(a){a.zf=a.query.from.map(function(b){return new Jh(b)},a)}function Vi(a){var b=a.query.f.filter(function(c){return c instanceof R});null!=a.query.N&&a.query.N.forEach(function(c){c.J instanceof R&&b.push(c.J)});0<b.length&&(a.Ee=new Nh(b))};function Xi(){this.se=[new Th,new Wh,new Oi,new Ni];this.Qd=[new Th]}Xi.prototype.create=function(a){if(a instanceof ci)var b=new Ji(a);else if(a instanceof $h)b=new Mi(a,this.Qd);else if(a instanceof Ne)b=new Ti(a,this.se);else if(a instanceof ei)b=new Ki(a);else throw new F(513);b=b.gc();return new Ch(b,a.da())};function Yi(a){S.call(this,1,1);this.U=a}u(Yi,S);Yi.prototype.toString=function(){return"delete("+this.U.getName()+")"};Yi.prototype.ca=function(a,b){a=a[0].entries.map(function(c){return c.ta});b.remove(this.U,a);return[ae()]};function Zi(a,b){S.call(this,0,-1);this.table=b;this.B=a.b(Lc)}u(Zi,S);Zi.prototype.toString=function(){return"get_row_count("+this.table.getName()+")"};Zi.prototype.ca=function(){var a=this.B.get(Af(this.table)),b=new H([],[this.table.getName()]),c=nh();a=a.Y().ia;null===b.Za&&(b.Za=A());b.Za.set(c.j(),a);return[b]};function $i(a,b){S.call(this,0,-1);this.V=a.b(Kc);this.B=a.b(Lc);this.table=b}u($i,S);$i.prototype.toString=function(){var a="table_access("+this.table.getName();null===this.table.Ka||(a+=" as "+this.table.Ka);return a+")"};$i.prototype.ca=function(){var a=this.B.get(Af(this.table)).Ua();return[de(Rf(this.V,a),[ge(this.table)])]};function aj(a){this.c=a}u(aj,Sh);aj.prototype.gb=function(a,b){this.H=a;if(!this.Id(b))return a;a=Tg(a,function(c){return c instanceof $i})[0];b=new Zi(this.c,a.table);Yg(a,a,b,b);return this.H};aj.prototype.Id=function(a){return 1==a.f.length&&1==a.from.length&&null==a.w&&null==a.X&&null==a.L&&null==a.qa?(a=a.f[0],a instanceof R&&"COUNT"==a.Mb&&a.child instanceof mh):!1};function bj(a){S.call(this,1,1);this.Se=a}u(bj,S);bj.prototype.toString=function(){return"groupBy("+this.Se.map(function(a){return a.j()}).toString()+")"};bj.prototype.ca=function(a){return cj(this,a[0])};function cj(a,b){var c=new pd,d=function(e){return this.Se.map(function(f){return I(e,f)},this).join(",")}.bind(a);b.entries.forEach(function(e){c.set(d(e),e)},a);return c.keys().map(function(e){return new H(c.get(e),b.s())},a)};function dj(a,b,c){S.call(this,2,0);this.B=a.b(Lc);this.V=a.b(Kc);this.O=b;this.Tb=c;this.Ed="eq"==this.O.F?0:2;this.Ve=null}u(dj,S);var ej=["hash","index_nested_loop","nested_loop"];dj.prototype.toString=function(){return"join(type: "+(this.Tb?"outer":"inner")+", impl: "+ej[this.Ed]+", "+this.O.toString()+")"};
  dj.prototype.ca=function(a){switch(this.Ed){case 0:return[gh(this.O,a[0],a[1],this.Tb)];case 1:return[hh(this.O,a[0],a[1],this.Ve,this.V)];default:var b=this.O,c=a[0];a=a[1];var d=this.Tb,e=[c,a];d||(e=dh(b,c,a));c=e[0];a=e[1];e=[];for(var f=c.s(),g=a.s(),k=c.entries.length,l=a.entries.length,p=l+256-1>>8,r=0;r<p;){for(var W=0;W<k;W++){var K=!1,y=I(c.entries[W],b.ga);if(null!==y)for(var L=Math.min(r+1<<8,l),V=r<<8;V<L;V++)if(b.vc(y,I(a.entries[V],b.ma))){K=!0;var na=ie(c.entries[W],f,a.entries[V],
  g);e.push(na)}d&&!K&&e.push(fh(b,c.entries[W],f))}r++}b=c.s().concat(a.s());return[new H(e,b)]}};function fj(a,b){a.Ed=1;var c=a.B.get(b.Ca().j());a.Ve={lg:b,Eg:b==a.O.ga?a.O.ma:a.O.ga,index:c}};function gj(a){S.call(this,-1,-1);this.pf=a}u(gj,S);gj.prototype.toString=function(){return"no_op_step("+this.pf[0].s().join(",")+")"};gj.prototype.ca=h("pf");function hj(){}u(hj,Sh);hj.prototype.gb=function(a,b){this.H=a;if(!this.Id(b))return a;Tg(a,function(c){return c instanceof dj}).forEach(this.Og,this);return this.H};hj.prototype.Id=function(a){return 1<a.from.length};
  hj.prototype.Og=function(a){if("eq"==a.O.F&&!a.Tb){var b=function(e){if(!(e instanceof $i))return null;e=ge(e.table)==ge(a.O.ma.I())?a.O.ma:a.O.ga;return null===e.Ca()?null:e},c=b(we(a,0));b=b(we(a,1));if(null!==c||null!==b){b=null===b?c:b;fj(a,b);var d=new H([],[ge(b.I())]);Ae(a,new gj([d]),b==c?0:1)}}};function ij(a){a=a.map(function(c){return c.wa()});a=Ob.apply(null,a);var b=[];Nb(a,function(c){b.push(c)});return b}function jj(a){this.Sb=a}jj.prototype.cd=function(){return 1==this.Sb.f.length?[Rd()]:[this.Sb.f.map(function(){return Rd()})]};function kj(a,b){this.Sb=a;this.Ga=b;this.Md=this.bf=null}
  function lj(a,b){var c=A();a.Ga.keys().forEach(function(d){var e=this.Ga.get(d).map(function(g){return Je(b,g)},this),f=new Vd([Rd()]);e.forEach(function(g){f=Wd(f,g.xe())});c.set(d,f)},a);return c}kj.prototype.cd=function(a){if(this.bf==a)return this.Md;for(var b=lj(this,a),c=this.Sb.f.length-1;0<=c;c--){var d=this.Sb.f[c];if(null!==(b.get(d.aa.getName())||null))break;b.set(d.aa.getName(),new Vd([Rd()]))}this.Md=1==this.Sb.f.length?B(b)[0].wa():ij(mj(this,b));this.bf=a;return this.Md};
  function mj(a,b){var c=A(),d=0;a.Sb.f.forEach(function(e){c.set(e.aa.getName(),d);d++});return uc(b).sort(function(e,f){return c.get(e)-c.get(f)}).map(function(e){return b.get(e)})};function nj(a,b){this.yd=b;this.B=a.b(Lc)}function oj(a){a=a.B.get(Af(a.yd));return Math.floor(.02*a.Y().ia)}function pj(a,b,c){c=c.filter(a.sg,a);if(0==c.length)return null;a=qj(a,c);if(0==a.length)return null;if(1==a.length)return a[0];var d=Number.MAX_VALUE;return a.reduce(function(e,f){var g=rj(f,b);return g<d?(d=g,f):e},null)}
  function qj(a,b){return a.yd.Da().map(function(c){c=new sj(this.B,c);tj(c,b);return c},a).filter(function(c){if(null===c.Ga)c=!1;else{for(var d=!1,e=!0,f=0;f<c.cb.f.length;f++){var g=c.Ga.has(c.cb.f[f].aa.getName());if(d&&g){e=!1;break}g||(d=!0)}c=e}return c})}nj.prototype.sg=function(a){return a instanceof Ee?!a.md()||a.J.I()!=this.yd||"in"==a.F&&a.value.length>oj(this)?!1:!0:a instanceof $g?a.md()&&we(a,0).J.I()==this.yd?M(a).length<=oj(this):!1:!1};
  function sj(a,b){this.B=a;this.cb=b;this.mg=D(this.cb.f.map(function(c){return c.aa.getName()}));this.ae=this.Ga=null}function uj(a){null===a.ae&&(a.ae=new kj(a.cb,a.Ga));return a.ae}function tj(a,b){b.forEach(function(c){var d=c.lb()[0].getName();this.mg.has(d)&&(null===this.Ga&&(this.Ga=new pd),this.Ga.set(d,c.W()))},a)}function rj(a,b){b=uj(a).cd(b);var c=a.B.get(a.cb.j());return b.reduce(function(d,e){return d+c.$c(e)},0)};function vj(a,b,c,d){S.call(this,0,-1);this.B=a.b(Lc);this.index=b;this.af=c;this.qe=d;this.Sc=this.Rc=!1}u(vj,S);vj.prototype.toString=function(){return"index_range_scan("+this.index.j()+", ?, "+(this.qe?"reverse":"natural")+(this.Rc?", limit:?":"")+(this.Sc?", skip:?":"")+")"};vj.prototype.Qc=function(a){var b=this.toString(),c=this.af.cd(a);b=b.replace("?",c.toString());this.Rc&&(b=b.replace("?",a.X.toString()));this.Sc&&(b=b.replace("?",a.L.toString()));return b};
  vj.prototype.ca=function(a,b,c){a=this.af.cd(c);b=this.B.get(this.index.j());c=(1==a.length&&a[0]instanceof Md&&Sd(a[0])?Vf(b.get(a[0].from),!1,this.Rc?c.X:void 0,this.Sc?c.L:void 0):b.Ua(a,this.qe,this.Rc?c.X:void 0,this.Sc?c.L:void 0)).map(function(d){return new vc(d,{})},this);return[de(c,[this.index.mc])]};function wj(){S.call(this,-1,0)}u(wj,S);wj.prototype.toString=m("multi_index_range_scan()");
  wj.prototype.ca=function(a){var b=A();a.forEach(function(d){d.entries.forEach(function(e){b.set(e.ta.id(),e)})});var c=B(b);return[new H(c,a[0].s())]};function xj(a){S.call(this,1,1);this.jc=a}u(xj,S);xj.prototype.toString=m("select(?)");xj.prototype.Qc=function(a){a=Je(a,this.jc);return this.toString().replace("?",a.toString())};xj.prototype.ca=function(a,b,c){return[Je(c,this.jc).eval(a[0])]};function yj(a,b){S.call(this,1,1);this.V=a.b(Kc);this.U=b}u(yj,S);yj.prototype.toString=function(){return"table_access_by_row_id("+this.U.getName()+")"};yj.prototype.ca=function(a){return[de(Rf(this.V,Yd(a[0])),[ge(this.U)])]};function zj(a){this.c=a}u(zj,Sh);zj.prototype.gb=function(a,b){this.H=a;Tg(a,function(c){return c instanceof $i}).forEach(function(c){var d=Aj(c);if(0!=d.length){var e=pj(new nj(this.c,c.table),b,d.map(function(g){return Je(b,g.jc)}));if(null!==e){var f=A();d.forEach(function(g){f.set(g.jc,g)},this);this.H=Bj(this,e,f,c)}}},this);return this.H};function Aj(a){var b=[];for(a=a.getParent();a;){if(a instanceof xj)b.push(a);else if(a instanceof dj)break;a=a.getParent()}return b}
  function Bj(a,b,c,d){(null===b.Ga?[]:b.Ga.values()).map(function(e){return c.get(e)}).forEach(Ug);b=new vj(a.c,b.cb,uj(b),!1);a=new yj(a.c,d.table);ye(a,b);Yg(d,d,a,b);return b.bb()};function Cj(a,b){S.call(this,0,-1);this.B=a.b(Lc);this.U=b}u(Cj,S);Cj.prototype.toString=function(){return"insert("+this.U.getName()+")"};Cj.prototype.ca=function(a,b,c){Dj(this.U,c.values,this.B);b.Bb(this.U,c.values);return[de(c.values,[this.U.getName()])]};function Dj(a,b,c){a=a.Nb.td;if(null===a?0:a.f[0].autoIncrement){var d=a.f[0].aa.getName();c=c.get(a.j()).Y().Fc;var e=null===c?0:c;b.forEach(function(f){if(0==f.m[d]||null==f.m[d])e++,f.m[d]=e})}}
  function Ej(a,b){S.call(this,0,-1);this.B=a.b(Lc);this.U=b}u(Ej,S);Ej.prototype.toString=function(){return"insert_replace("+this.U.getName()+")"};Ej.prototype.ca=function(a,b,c){Dj(this.U,c.values,this.B);b.Xd(this.U,c.values);return[de(c.values,[this.U.getName()])]};function Fj(){S.call(this,1,1)}u(Fj,S);Fj.prototype.toString=m("limit(?)");Fj.prototype.Qc=function(a){return this.toString().replace("?",a.X.toString())};Fj.prototype.ca=function(a,b,c){a[0].entries.splice(c.X);return a};function Gj(a){S.call(this,-1,1);this.N=a}u(Gj,S);n=Gj.prototype;n.toString=function(){return"order_by("+Oe(this.N)+")"};n.ca=function(a){if(1==a.length){var b=a[0];for(var c=null,d=0;d<this.N.length;d++){var e=oh(this.N[d].J);if(null!==b.Za&&b.Za.has(e.j())){c=e;break}}b=c;(null===b?a[0]:Zd(a[0],b)).entries.sort(this.ag.bind(this))}else a.sort(this.Rg.bind(this));return a};
  n.Z=function(a,b){var c=-1;do{c++;var d=this.N[c].J;var e=this.N[c].order;var f=a(d);d=b(d)}while(f==d&&c+1<this.N.length);a=f<d?-1:f>d?1:0;return 1==e?a:-a};n.Rg=function(a,b){return this.Z(function(c){return c instanceof R?Zd(a,c):I(a.entries[a.entries.length-1],c)},function(c){return c instanceof R?Zd(b,c):I(b.entries[b.entries.length-1],c)})};n.ag=function(a,b){return this.Z(function(c){return I(a,c)},function(c){return I(b,c)})};function Hj(a,b){this.Na=a;this.K=b}function Ij(a){return a.K.some(function(b){return b instanceof R},a)?Jj(a):Kj(a)}function Jj(a){if(1==a.K.length&&"DISTINCT"==a.K[0].Mb)return a=Zd(a.Na,a.K[0]).entries.map(function(c){var d=new ee(new vc(-1,{}),1<this.Na.M.size);he(d,this.K[0],I(c,this.K[0].child));return d},a),new H(a,[]);var b=new ee(new vc(-1,{}),1<a.Na.M.size);a.K.forEach(function(c){var d=c instanceof R?Zd(this.Na,c):I(this.Na.entries[0],c);he(b,c,d)},a);return new H([b],a.Na.s())}
  function Kj(a){var b=Array(a.Na.entries.length),c=1<a.Na.M.size;a.Na.entries.forEach(function(d,e){b[e]=new ee(new vc(d.ta.id(),{}),c);this.K.forEach(function(f){he(b[e],f,I(d,f))},this)},a);return new H(b,a.Na.s())}function Lj(a,b){var c=a.map(function(d){return Ij(new Hj(d,b)).entries[0]});return new H(c,a[0].s())};function Mj(a,b){S.call(this,-1,1);this.f=a;this.Rb=b}u(Mj,S);Mj.prototype.toString=function(){var a="project("+this.f.toString();if(null!==this.Rb){var b=this.Rb.map(function(c){return c.j()}).join(", ");a+=", groupBy("+b+")"}return a+")"};Mj.prototype.ca=function(a){0==a.length?a=[ae()]:1==a.length?(a=a[0],a=[0==this.f.length?a:Ij(new Hj(a,this.f))]):a=[Lj(a,this.f)];return a};function Nj(a){return a.f.some(function(b){return b instanceof R})||null!==a.Rb};function Oj(){S.call(this,1,1)}u(Oj,S);Oj.prototype.toString=m("skip(?)");Oj.prototype.Qc=function(a){return this.toString().replace("?",a.L.toString())};Oj.prototype.ca=function(a,b,c){return[new H(a[0].entries.slice(c.L),a[0].s())]};function Pj(){}u(Pj,Sh);Pj.prototype.gb=function(a,b){if(!q(b.X)&&!q(b.L))return a;var c=Qj(a);if(null===c)return a;Tg(a,function(d){return d instanceof Fj||d instanceof Oj}).forEach(function(d){d instanceof Fj?c.Rc=!0:c.Sc=!0;Ug(d)},this);return c.bb()};function Qj(a){a=Tg(a,function(b){return b instanceof vj},function(b){return b instanceof Mj&&Nj(b)||b instanceof Gj||1!=M(b).length||b instanceof xj});return 0<a.length?a[0]:null};function Rj(a){this.c=a}u(Rj,Sh);Rj.prototype.gb=function(a,b){this.H=a;var c=Sj(this,b);if(0==c.length)return this.H;var d=0;do{var e=c[d++];a=Tj(this,e,b)}while(null===a&&d<c.length);if(null===a)return this.H;b=Uj(this,a[0].cb.mc);return null===b?this.H:this.H=Vj(this,e,b,a)};function Sj(a,b){return Tg(a.H,function(c){if(!(c instanceof xj))return!1;c=Je(b,c.jc);return c instanceof $g&&"or"==c.pb})}
  function Uj(a,b){return Tg(a.H,function(c){return c instanceof $i&&c.table.getName()==b})[0]||null}function Tj(a,b,c){b=Je(c,b.jc);var d=b.s();if(1!=d.size)return null;d=E(d)[0];var e=new nj(a.c,d),f=null;return M(b).every(function(g){g=pj(e,c,[g]);null===g||(null===f?f=[g]:f.push(g));return null!==g})?f:null}function Vj(a,b,c,d){var e=new yj(a.c,c.table),f=new wj;ye(e,f);d.forEach(function(g){g=new vj(this.c,g.cb,uj(g),!1);ye(f,g)},a);Ug(b);Yg(c,c,e,f);return f.bb()};function Wj(a){this.c=a}u(Wj,Sh);Wj.prototype.gb=function(a,b){b=Xj(a,b);if(null===b)return a;a:{var c=b;a=Yj(we(b,0));if(null!==a){var d=b.N;for(var e=null,f=a.table.Da(),g=0;g<f.length&&null===e;g++)e=Zj(f[g],d);d=e;if(null===d){a=c;break a}c=new vj(this.c,d.cb,new jj(d.cb),d.Ye);d=new yj(this.c,a.table);ye(d,c);Ug(b);c=Yg(a,a,d,c)}a=c}a==b&&(a=b,c=ak(we(b,0)),null!==c&&(d=Zj(c.index,b.N),null!==d&&(c.qe=d.Ye,a=Ug(b).parent)));return a.bb()};
  function ak(a){a=Tg(a,function(b){return b instanceof vj},function(b){return 1!=M(b).length});return 0<a.length?a[0]:null}function Yj(a){a=Tg(a,function(b){return b instanceof $i},function(b){return 1!=M(b).length});return 0<a.length?a[0]:null}function Xj(a,b){return q(b.N)?Tg(a,function(c){return c instanceof Gj})[0]:null}function Zj(a,b){if(a.f.length!=b.length||!b.every(function(c,d){return c.J.getName()==a.f[d].aa.getName()}))return null;b=bk(b,a);return b[0]||b[1]?{cb:a,Ye:b[1]}:null}
  function bk(a,b){var c=a.reduce(function(e,f){return e<<1|(0==f.order?0:1)},0),d=b.f.reduce(function(e,f){return e<<1|(0==f.order?0:1)},0);c^=d;return[0==c,c==Math.pow(2,Math.max(a.length,b.f.length))-1]};function ck(a,b,c){this.Ha=a;this.me=b;this.Xb=c}ck.prototype.gc=function(){this.Xb.forEach(function(a){this.Ha=a.gb(this.Ha,this.me)},this);return this.Ha};function dk(a){S.call(this,1,1);this.U=a}u(dk,S);dk.prototype.toString=function(){return"update("+this.U.getName()+")"};dk.prototype.ca=function(a,b,c){a=a[0].entries.map(function(d){var e=this.U.kb(d.ta.Ja());c.set.forEach(function(f){e.m[f.J.getName()]=f.value},this);return e},this);b.update(this.U,a);return[ae()]};function ek(a){this.c=a;this.se=[new hj,new zj(this.c),new Rj(this.c),new Wj(this.c),new Pj,new aj(this.c)];this.Qd=[new zj(this.c)]}ek.prototype.create=function(a,b){var c=a.bb();if(c instanceof Fh||c instanceof Eh)return fk(this,a,b);if(c instanceof Lh||c instanceof Ph||c instanceof Qh)return fk(this,a,b,this.se);if(c instanceof Gh||c instanceof Hh)return fk(this,a,b,this.Qd);throw new F(8);};
  function fk(a,b,c,d){a=Rg(b.bb(),a.Bg.bind(a));null!=d&&(a=(new ck(a,c,d)).gc());return new Pe(a,b.da())}
  ek.prototype.Bg=function(a){if(a instanceof Lh)return new Mj(a.f,a.Rb);if(a instanceof Oh)return new bj(a.f);if(a instanceof Nh)return new sh(a.f);if(a instanceof Mh)return new Gj(a.N);if(a instanceof Qh)return new Oj;if(a instanceof Ph)return new Fj;if(a instanceof Ih)return new xj(a.O.W());if(a instanceof Kh)return new Xh;if(a instanceof Rh)return new dj(this.c,a.O,a.Tb);if(a instanceof Jh)return new $i(this.c,a.table);if(a instanceof Gh)return new Yi(a.table);if(a instanceof Hh)return new dk(a.table);
  if(a instanceof Fh)return new Ej(this.c,a.table);if(a instanceof Eh)return new Cj(this.c,a.table);throw new F(514);};function gk(a){this.yg=new Xi;this.Mg=new ek(a)};function hk(){this.ef=A()}function ik(a,b){var c=a.ef.get(b.getName())||null;null===c&&(c=new jk,a.ef.set(b.getName(),c));return c}function kk(a,b,c,d){c.forEach(function(e){e=ik(this,e);0==d?(e.fb=null,e.wc=b):3==d?(null===e.$b&&(e.$b=D()),e.$b.add(b),null===e.Xa&&(e.Xa=D()),e.Xa.delete(b)):1==d?(null===e.Xa&&(e.Xa=D()),e.Xa.add(b)):2==d&&(e.fb=b)},a)}
  function lk(a,b,c,d){var e=!0;c.forEach(function(f){if(e){f=ik(this,f);var g=null===f.Xa||0==f.Xa.size;e=0==d?(null===f.$b||0==f.$b.size)&&g&&null===f.wc&&null!==f.fb&&f.fb==b:3==d?null===f.wc&&null===f.fb&&null!==f.Xa&&f.Xa.has(b):1==d?null===f.fb:g&&(null===f.fb||f.fb==b)}},a);return e}function mk(a,b,c,d){var e=lk(a,b,c,d);e&&kk(a,b,c,d);return e}hk.prototype.releaseLock=function(a,b){b.forEach(function(c){ik(this,c).releaseLock(a)},this)};
  function nk(a,b){b.forEach(function(c){ik(this,c).fb=null},a)}function jk(){this.$b=this.Xa=this.fb=this.wc=null}jk.prototype.releaseLock=function(a){this.wc==a&&(this.wc=null);this.fb==a&&(this.fb=null);null===this.Xa||this.Xa.delete(a);null===this.$b||this.$b.delete(a)};function ok(){this.Wb=new pk;this.Ec=new hk}function Xe(a,b){(2>b.getPriority()||2>b.getPriority())&&nk(a.Ec,b.da());a.Wb.Bb(b);qk(a);return b.Eb.ha}function qk(a){for(var b=a.Wb.wa(),c=0;c<b.length;c++){var d=b[c];if(0==d.G()?rk(a,d,1,3):rk(a,d,2,0)){a.Wb.remove(d);var e=a;d.exec().then(e.Jg.bind(e,d),e.Ig.bind(e,d))}}}function rk(a,b,c,d){var e=!1;mk(a.Ec,b.W(),b.da(),c)&&(e=mk(a.Ec,b.W(),b.da(),d));return e}ok.prototype.Jg=function(a,b){this.Ec.releaseLock(a.W(),a.da());a.Eb.resolve(b);qk(this)};
  ok.prototype.Ig=function(a,b){this.Ec.releaseLock(a.W(),a.da());a.Eb.reject(b);qk(this)};function pk(){this.Wb=[]}pk.prototype.Bb=function(a){Uf(this.Wb,a,function(b,c){var d=b.getPriority()-c.getPriority();return 0==d?b.W()-c.W():d})};pk.prototype.wa=function(){return this.Wb.slice()};pk.prototype.remove=function(a){var b=this.Wb;a=ta(b,a);var c;(c=0<=a)&&Array.prototype.splice.call(b,a,1);return c};function sk(){this.Nc=A()}var tk;function uk(){tk||(tk=new sk);return tk}sk.prototype.clear=function(){this.Nc.clear()};sk.prototype.clear=sk.prototype.clear;sk.prototype.rb=function(a,b){this.Nc.set(a.toString(),b);return b};sk.prototype.registerService=sk.prototype.rb;sk.prototype.b=function(a){var b=this.Nc.get(a.toString())||null;if(null===b)throw new F(7,a.toString());return b};sk.prototype.getService=sk.prototype.b;sk.prototype.nd=function(a){return this.Nc.has(a.toString())};
  sk.prototype.isRegistered=sk.prototype.nd;function vk(){var a=uk();return uc(a.Nc)};function wk(a,b,c,d){return null!=a?null!=b?xk(a,b,c,d):yk(a):zk()}function Ak(a){var b="";try{b=JSON.stringify(a)}catch(c){}return b}function Bk(a){var b=uk();a=new Ic("ns_"+a);return b.nd(a)?b.b(a):null}function zk(){var a={};vk().forEach(function(b){"ns_"==b.substring(0,3)&&(b=b.substring(3),a[b]=Bk(b).b(Pc).version())});return Ak(a)}function yk(a){a=Bk(a);var b={};if(null!=a){var c=a.b(Lc);a.b(Pc).oa().forEach(function(d){b[d.getName()]=c.get(Af(d)).Y().ia})}return Ak(b)}
  function xk(a,b,c,d){var e=Bk(a);a=[];if(null!=e){var f=null;try{f=e.b(Pc).table(b)}catch(g){}null!=f&&(b=e.b(Lc),e=e.b(Kc),c=b.get(Af(f)).Ua(void 0,!1,c,d),c.length&&(a=Rf(e,c).map(function(g){return g.m})))}return Ak(a)};function Ck(a,b){this.Rd=se();this.ne=a;this.pd=b;this.K=Dk(this)}function Dk(a){if(0<a.ne.f.length)return a.ne.f;var b=[];a.ne.from.forEach(function(c){c.lb().forEach(function(d){b.push(d)})});return b}Ck.prototype.Z=function(a,b){return this.K.every(function(c){return 6==c.G()||0==c.G()?I(a,c)===I(b,c):te(this.Rd,c.G(),"eq")(I(a,c),I(b,c))},this)};
  function Ek(a,b,c){var d=null===b?[]:b.entries,e=Fb(d,c.entries,a.Z.bind(a),function(l){return d[l]});b=[];for(var f=0,g=0;g<d.length;g++){var k=d[g];e[f]==k?f++:(k=a.pd.splice(f,1),k=Fk(g,k,0,a.pd),b.push(k))}e=Fb(d,c.entries,a.Z.bind(a),function(l,p){return c.entries[p]});for(g=f=0;g<c.entries.length;g++)k=c.entries[g],e[f]==k?f++:(a.pd.splice(g,0,k.ta.m),k=Fk(g,[],1,a.pd),b.push(k));return b}function Fk(a,b,c,d){return{addedCount:c,index:a,object:d,removed:b,type:"splice"}};function Gk(){this.fc=A()}Gk.prototype.Dd=function(a,b){var c=ka(a.query).toString(),d=this.fc.get(c)||null;null===d&&(d=new Hk(a),this.fc.set(c,d));d.Dd(b)};Gk.prototype.oe=function(a,b){a=ka(a.query).toString();var c=this.fc.get(a)||null;c.oe(b);0<c.Hc.size||this.fc.delete(a)};function We(a,b){var c=D();b.forEach(function(e){c.add(e.getName())});var d=[];a.fc.forEach(function(e){e=e.Bc();e.context.from.some(function(f){return c.has(f.getName())})&&d.push(e)});return d}
  function Ue(a,b,c){b=ka(null!=b.Xc?b.Xc:b).toString();a=a.fc.get(b)||null;null!==a&&Ik(a,c)}function Hk(a){this.Pf=a;this.Hc=D();this.Gg=[];this.cf=null;this.Zf=new Ck(a.query,this.Gg)}Hk.prototype.Dd=function(a){this.Hc.has(a)||this.Hc.add(a)};Hk.prototype.oe=function(a){this.Hc.delete(a)};Hk.prototype.Bc=function(){var a=this.Pf;return{context:a.query,ke:vi(a)}};function Ik(a,b){var c=Ek(a.Zf,a.cf,b);a.cf=b;0<c.length&&a.Hc.forEach(function(d){d(c)})};function Jk(a,b){var c=a.b(Pc),d=b||{};b=new Qf(c);a.rb(Kc,b);b=null;var e=!1;null!=d.storeType?b=d.storeType:(b=sc(),b=b.ng?0:b.bh?4:1);switch(b){case 0:b=new wf(a,c);break;case 1:b=new Df(c);break;case 5:b=new Ff(c);break;case 4:b=new Nf(a,c,d.webSqlDbSize);break;case 3:b=new jf(c,d.firebase);e=!0;break;default:throw new F(300);}a.rb(Jc,b);var f=new Qg;a.rb(Lc,f);return b.Ea(d.onUpgrade).then(function(){var g=new gk(a);a.rb(Mc,g);g=new ok;a.rb(Nc,g);g=new Gk;a.rb(Oc,g);return f.Ea(c)}).then(function(){if(e){var g=
  new Ye(a);g.ab.subscribe(g.fe.bind(g))}d.enableInspector&&(window.top["#lfInspect"]=wk);return(new Jg(a)).Ea(c)})};function Kk(a){this.c=a;this.g=a.b(Pc);this.$=D(this.g.oa());this.Eb=ub()}function Lk(a){var b=a.c.b(Lc),c=a.c.b(Kc),d={};a.g.oa().forEach(function(e){var f=b.get(Af(e)).Ua();f=Rf(c,f).map(function(g){return g.m});d[e.getName()]=f});return{name:a.g.name(),version:a.g.version(),tables:d}}n=Kk.prototype;n.exec=function(){var a=Lk(this);a=new ee(new vc(-1,a),!0);return x([new H([a],[])])};n.G=m(0);n.da=h("$");n.W=function(){return ka(this)};n.getPriority=m(0);function Mk(a,b){this.c=a;this.g=a.b(Pc);this.$=D(this.g.oa());this.Eb=ub();this.Ba=b;this.ab=a.b(Jc);this.V=a.b(Kc);this.B=a.b(Lc)}n=Mk.prototype;n.exec=function(){if(!this.ab.Pc())throw new F(300);a:{var a=this.g.oa();for(var b=0;b<a.length;++b)if(0<this.B.get(Af(a[b])).Y().ia){a=!1;break a}a=!0}if(!a)throw new F(110);if(this.g.name()!=this.Ba.name||this.g.version()!=this.Ba.version)throw new F(111);if(null==this.Ba.tables)throw new F(112);return Nk(this)};n.G=m(1);n.da=h("$");n.W=function(){return ka(this)};
  n.getPriority=m(0);function Nk(a){var b=new Hd(a.c,a.$);b=a.ab.Gb(a.G(),E(a.$),b);for(var c in a.Ba.tables){var d=a.g.table(c),e=a.Ba.tables[c].map(function(k){return d.xb(k)}),f=b.I(c,d.kb,0);a.V.Yb(c,e);var g=a.B.lc.get(c)||[];e.forEach(function(k){g.forEach(function(l){var p=k.nb(l.getName());l.add(p,k.id())})});f.put(e)}return b.ka()};function Ok(a,b){this.c=a;this.ab=a.b(Jc);this.Ia=a.b(Nc);this.Ib=a.b(Oc);this.$=D(b);this.Qa=new Hd(this.c,this.$);this.Eb=ub();this.xc=ub();this.Ae=ub()}n=Ok.prototype;n.exec=function(){this.Ae.resolve();return this.xc.ha};n.G=m(1);n.da=h("$");n.W=function(){return ka(this)};n.getPriority=m(2);function Pk(a){Xe(a.Ia,a);return a.Ae.ha}
  function Qk(a,b){b=b.Bc();return b.ke.bb().exec(a.Qa,b.context).then(function(c){return Xd(c[0])},function(c){this.Qa.Jb();var d=new zb(c.name);this.xc.reject(d);throw c;}.bind(a))}n.ka=function(){this.ja=this.ab.Gb(this.G(),E(this.$),this.Qa);this.ja.ka().then(function(){this.Mc();this.xc.resolve()}.bind(this),function(a){this.Qa.Jb();this.xc.reject(a)}.bind(this));return this.Eb.ha};n.Jb=function(){this.Qa.Jb();this.xc.resolve();return this.Eb.ha};
  n.Mc=function(){var a=We(this.Ib,this.$);0!=a.length&&(a=new Te(this.c,a),Xe(this.Ia,a))};n.Y=function(){var a=null;null!=this.ja&&(a=this.ja.Y());return null===a?new C(!1,0,0,0,0):a};function Rk(a){this.c=a;this.Ia=a.b(Nc);this.Lb=null;this.Sa=0;0==Sk.size&&(Sk.set(0,D([1,4])),Sk.set(1,D([2])),Sk.set(2,D([3,5,6])),Sk.set(3,D([2,7])),Sk.set(4,D([7])),Sk.set(5,D([7])),Sk.set(6,D([7])))}t("lf.proc.Transaction",Rk);var Sk=A();function Tk(a,b){var c=Sk.get(a.Sa)||null;if(null===c||!c.has(b))throw new F(107,a.Sa,b);a.Sa=b}
  Rk.prototype.exec=function(a){Tk(this,4);var b=[];try{a.forEach(function(c){c.$a();b.push(c.Bc())},this)}catch(c){return Tk(this,7),qb(c)}this.Lb=new Yh(this.c,b);return Xe(this.Ia,this.Lb).then(function(c){Tk(this,7);return c.map(function(d){return Xd(d)})}.bind(this),function(c){Tk(this,7);throw c;}.bind(this))};Rk.prototype.exec=Rk.prototype.exec;Rk.prototype.Nf=function(a){Tk(this,1);this.Lb=new Ok(this.c,a);return Pk(this.Lb).then(function(){Tk(this,2)}.bind(this))};Rk.prototype.begin=Rk.prototype.Nf;
  Rk.prototype.Mf=function(a){Tk(this,3);try{a.$a()}catch(b){return Tk(this,7),qb(b)}return Qk(this.Lb,a).then(function(b){Tk(this,2);return b}.bind(this),function(b){Tk(this,7);throw b;}.bind(this))};Rk.prototype.attach=Rk.prototype.Mf;Rk.prototype.ka=function(){Tk(this,5);return this.Lb.ka().then(function(){Tk(this,7)}.bind(this))};Rk.prototype.commit=Rk.prototype.ka;Rk.prototype.Jb=function(){Tk(this,6);return this.Lb.Jb().then(function(){Tk(this,7)}.bind(this))};Rk.prototype.rollback=Rk.prototype.Jb;
  Rk.prototype.Y=function(){if(7!=this.Sa)throw new F(105);return this.Lb.Y()};Rk.prototype.stats=Rk.prototype.Y;function X(a){this.c=a;this.g=a.b(Pc);this.jd=!1}t("lf.proc.Database",X);X.prototype.Ea=function(a){this.c.rb(Pc,this.g);return Jk(this.c,a).then(function(){this.jd=!0;this.Ia=this.c.b(Nc);return this}.bind(this))};X.prototype.init=X.prototype.Ea;X.prototype.zb=h("g");X.prototype.getSchema=X.prototype.zb;function Uk(a){if(!a.jd)throw new F(2);}X.prototype.select=function(a){Uk(this);return new U(this.c,1!=arguments.length||null!=arguments[0]?Array.prototype.slice.call(arguments):[])};
  X.prototype.select=X.prototype.select;X.prototype.Bb=function(){Uk(this);return new xi(this.c)};X.prototype.insert=X.prototype.Bb;X.prototype.Xd=function(){Uk(this);return new xi(this.c,!0)};X.prototype.insertOrReplace=X.prototype.Xd;X.prototype.update=function(a){Uk(this);return new Hi(this.c,a)};X.prototype.update=X.prototype.update;X.prototype.delete=function(){Uk(this);return new wi(this.c)};X.prototype["delete"]=X.prototype.delete;
  X.prototype.observe=function(a,b){Uk(this);this.c.b(Oc).Dd(a,b)};X.prototype.observe=X.prototype.observe;X.prototype.unobserve=function(a,b){Uk(this);this.c.b(Oc).oe(a,b)};X.prototype.unobserve=X.prototype.unobserve;X.prototype.Vf=function(){Uk(this);return new Rk(this.c)};X.prototype.createTransaction=X.prototype.Vf;X.prototype.close=function(){try{this.c.b(Jc).close()}catch(a){}this.c.clear();this.jd=!1};X.prototype.close=X.prototype.close;
  X.prototype.eg=function(){Uk(this);var a=new Kk(this.c);return Xe(this.Ia,a).then(function(b){return Xd(b[0])[0]})};X.prototype["export"]=X.prototype.eg;X.prototype.import=function(a){Uk(this);a=new Mk(this.c,a);return Xe(this.Ia,a).then(m(null))};X.prototype["import"]=X.prototype.import;function Y(a,b,c,d,e,f){this.U=a;this.A=b;this.Ze=c;this.Xe=d;this.Cf=e;this.Ka=f||null}t("lf.schema.BaseColumn",Y);n=Y.prototype;n.getName=h("A");n.j=function(){return ge(this.U)+"."+this.A};n.toString=function(){return this.j()};n.I=h("U");n.G=h("Cf");Y.prototype.getType=Y.prototype.G;Y.prototype.Da=function(){null==this.sa&&(this.sa=[],this.I().Da().forEach(function(a){-1!=a.f.map(function(b){return b.aa.getName()}).indexOf(this.A)&&this.sa.push(a)},this));return this.sa};
  Y.prototype.Ca=function(){if(!q(this.fa)){var a=this.Da().filter(function(b){return 1!=b.f.length?!1:b.f[0].aa.getName()==this.getName()},this);this.fa=0<a.length?a[0]:null}return this.fa};Y.prototype.hc=h("Xe");Y.prototype.isNullable=Y.prototype.hc;Y.prototype.Dc=h("Ze");Y.prototype.Pa=function(a){return ih(this,a,"eq")};Y.prototype.eq=Y.prototype.Pa;Y.prototype.ff=function(a){return ih(this,a,"neq")};Y.prototype.neq=Y.prototype.ff;Y.prototype.zg=function(a){return ih(this,a,"lt")};
  Y.prototype.lt=Y.prototype.zg;Y.prototype.Ag=function(a){return ih(this,a,"lte")};Y.prototype.lte=Y.prototype.Ag;Y.prototype.ig=function(a){return ih(this,a,"gt")};Y.prototype.gt=Y.prototype.ig;Y.prototype.jg=function(a){return ih(this,a,"gte")};Y.prototype.gte=Y.prototype.jg;Y.prototype.match=function(a){return ih(this,a,"match")};Y.prototype.match=Y.prototype.match;Y.prototype.Of=function(a,b){return ih(this,[a,b],"between")};Y.prototype.between=Y.prototype.Of;
  Y.prototype.kg=function(a){return ih(this,a,"in")};Y.prototype["in"]=Y.prototype.kg;Y.prototype.ug=function(){return this.Pa(null)};Y.prototype.isNull=Y.prototype.ug;Y.prototype.tg=function(){return this.ff(null)};Y.prototype.isNotNull=Y.prototype.tg;Y.prototype.as=function(a){return new Y(this.U,this.A,this.Ze,this.Xe,this.Cf,a)};Y.prototype.as=Y.prototype.as;function Vk(a){this.g=a;this.Jd=new pd;this.pe=new pd;this.hf=new pd;this.Je=A();this.h=new pd;this.Fe=new pd;this.qf=new pd;this.Ie=new pd;Wk(this)}function Wk(a){a.g.oa().forEach(function(b){var c=b.getName();b.Nb.Vd.forEach(function(d){this.hf.set(c,this.g.table(d.Wa));this.h.set(d.Wa,b);0==d.action?(this.pe.set(d.Wa,d),this.qf.set(d.Wa,b)):(this.Jd.set(d.Wa,d),this.Fe.set(d.Wa,b));this.Je.set(b.getName()+"."+d.vb,d.Wa);this.Ie.set(d.Wa+"."+d.Jc,b.getName())},this)},a)}
  function xd(a,b,c){if(null!=c)return 1==c?a.Jd.get(b):a.pe.get(b);c=a.Jd.get(b);a=a.pe.get(b);return null===c&&null===a?null:(c||[]).concat(a||[])}function di(a,b){a=b.get(a);return null===a?[]:a}function fi(a,b){var c=D();b.forEach(function(d){(d=this.Je.get(d))&&c.add(d)},a);return E(c).map(function(d){return this.g.table(d)},a)}function bi(a,b,c){return null!=c?0==c?di(b,a.qf):di(b,a.Fe):di(b,a.h)}
  function gi(a,b){var c=D();b.forEach(function(d){(d=this.Ie.get(d))&&d.forEach(function(e){c.add(e)})},a);return E(c).map(function(d){return this.g.table(d)},a)};function Xk(a,b,c){this.td=a;this.Fg=b;this.Vd=c}t("lf.schema.Constraint",Xk);Xk.prototype.hg=h("td");Xk.prototype.getPrimaryKey=Xk.prototype.hg;Xk.prototype.gg=h("Vd");Xk.prototype.getForeignKeys=Xk.prototype.gg;function Yk(a,b,c){var d=a.ref.split(".");if(2!=d.length)throw new F(540,c);this.He=b;this.vb=a.local;this.Wa=d[0];this.Jc=d[1];this.name=b+"."+c;this.action=a.action;this.timing=a.timing};function Z(a){Zk(a);this.Rd=se();this.A=a;this.K=A();this.Ad=D();this.oc=D();this.od=D();this.Fa=null;this.sa=A();this.sd=!1;this.yb=[]}t("lf.schema.TableBuilder",Z);function $k(a){this.name=a.name;this.order=a.order;this.autoIncrement=a.autoIncrement}var al=D([0,6]);function Zk(a){if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(a))throw new F(502,a);}function bl(a,b){if(b==a.A)throw new F(546,b);if(a.K.has(b)||a.sa.has(b)||a.oc.has(b))throw new F(503,a.A+"."+b);}
  function cl(a,b){var c=!1;b.forEach(function(d){var e=this.K.get(d.name);c=c||d.autoIncrement;if(d.autoIncrement&&3!=e)throw new F(504);},a);if(c&&1<b.length)throw new F(505);}function dl(a){if(null!==a.Fa){var b=a.sa.get(a.Fa).map(function(d){return d.name}),c=0;if(a.yb.some(function(d,e){c=e;return-1!=b.indexOf(d.vb)},a))throw new F(543,a.yb[c].name);}}
  function el(a){if(null!==a.Fa){var b=function(d){return d.name},c=JSON.stringify(a.sa.get(a.Fa).map(b));a.sa.forEach(function(d,e){if(e!=this.Fa&&(d=d.map(b),JSON.stringify(d)==c))throw new F(544,this.A+"."+e);},a)}}function fl(a){null===a.Fa||a.sa.get(a.Fa).forEach(function(b){if(this.od.has(b.name))throw new F(545,this.A+"."+b.name);},a)}Z.prototype.Hf=function(a,b){Zk(a);bl(this,a);this.K.set(a,b);al.has(b)&&this.Ce([a]);return this};Z.prototype.addColumn=Z.prototype.Hf;
  Z.prototype.Jf=function(a,b){var c=this.A;this.Fa="pk"+(c[0].toUpperCase()+c.substring(1));Zk(this.Fa);bl(this,this.Fa);a=gl(this,a,!0,void 0,b);cl(this,a);1==a.length&&this.Ad.add(a[0].name);this.oc.add(this.Fa);this.sa.set(this.Fa,a);return this};Z.prototype.addPrimaryKey=Z.prototype.Jf;
  Z.prototype.If=function(a,b){Zk(a);bl(this,a);b=new Yk(b,this.A,a);q(b.action)||(b.action=0);q(b.timing)||(b.timing=0);if(1==b.action&&1==b.timing)throw new F(506);if(!this.K.has(b.vb))throw new F(540,a);this.yb.push(b);this.Be(a,[b.vb],this.Ad.has(b.vb));return this};Z.prototype.addForeignKey=Z.prototype.If;Z.prototype.Kf=function(a,b){Zk(a);bl(this,a);b=gl(this,b,!0);1==b.length&&(this.Ad.add(b[0].name),hl(this,b[0].name));this.sa.set(a,b);this.oc.add(a);return this};Z.prototype.addUnique=Z.prototype.Kf;
  function hl(a,b){a.yb.forEach(function(c){c.vb==b&&this.oc.add(c.name.split(".")[1])},a)}Z.prototype.Ce=function(a){gl(this,a,!1).forEach(function(b){this.od.add(b.name)},this);return this};Z.prototype.addNullable=Z.prototype.Ce;Z.prototype.Be=function(a,b,c,d){Zk(a);bl(this,a);b=gl(this,b,!0,d);c&&this.oc.add(a);this.sa.set(a,b);return this};Z.prototype.addIndex=Z.prototype.Be;Z.prototype.Db=ba("sd");Z.prototype.persistentIndex=Z.prototype.Db;
  Z.prototype.zb=function(){dl(this);el(this);fl(this);return new (il(this))};Z.prototype.getSchema=Z.prototype.zb;function gl(a,b,c,d,e){var f=b;f="string"==typeof b[0]?b.map(function(g){return new $k({name:g,order:null!=d?d:1,autoIncrement:e||!1})}):b.map(function(g){return new $k(g)});f.forEach(function(g){if(!this.K.has(g.name))throw new F(508,this.A,g.name);if(c){var k=this.K.get(g.name);if(0==k||6==k)throw new F(509,this.A,g.name);}},a);return f}
  function il(a){function b(){function c(k){return a.sa.get(k).map(function(l){return{aa:this[l.name],order:l.order,autoIncrement:l.autoIncrement}},this)}var d=uc(a.K).map(function(k){this[k]=new Y(this,k,a.Ad.has(k),a.od.has(k),a.K.get(k));return this[k]},this),e=uc(a.sa).map(function(k){return new kh(a.A,k,a.oc.has(k),c.call(this,k))},this);Q.call(this,a.A,d,e,a.sd);var f=null===a.Fa?null:new kh(a.A,a.Fa,!0,c.call(this,a.Fa)),g=d.filter(function(k){return!a.od.has(k.getName())});this.Nb=new Xk(f,
  g,a.yb);this.tf=jl(a,d,e)}u(b,Q);b.prototype.xb=function(c){return new this.tf(wc++,c)};b.prototype.createRow=b.prototype.xb;b.prototype.kb=function(c){var d={};this.lb().forEach(function(e){var f=e.getName();e=e.G();var g=c.value[f];if(0==e)if(e=g,null!=e&&""!=e){0!=e.length%2&&(e="0"+e);g=new ArrayBuffer(e.length/2);for(var k=new Uint8Array(g),l=0,p=0;l<e.length;l+=2)k[p++]=parseInt(e.substr(l,2),16);e=g}else e=null;else e=2==e?null!=g?new Date(g):null:g;d[f]=e},this);return new this.tf(c.id,d)};
  b.prototype.deserializeRow=b.prototype.kb;b.prototype.Oe=h("Nb");b.prototype.getConstraint=b.prototype.Oe;return b}
  function jl(a,b,c){function d(k,l){this.K=b;this.sa=c;vc.call(this,k,l)}u(d,vc);d.prototype.Le=function(){var k={};this.K.forEach(function(l){k[l.getName()]=l.hc()?null:od[l.G()]});return k};d.prototype.Af=function(){var k={};this.K.forEach(function(l){var p=l.getName();l=l.G();var r=this.m[p];k[p]=0==l?null!=r?zc(r):null:2==l?null!=r?r.getTime():null:6==l?null!=r?r:null:r},this);return k};var e=function(k){var l=this.K.get(k.getName()),p=this.Rd.$e.get(l)||null;return function(r){return p(r[k.getName()])}}.bind(a),
  f=function(k){var l=k.map(function(p){return e(p.aa)});return function(p){return l.map(function(r){return r(p)})}}.bind(a),g={};c.forEach(function(k){var l=k.j();k=1==k.f.length?e(k.f[0].aa):f(k.f);g[l]=k});d.prototype.nb=function(k){return-1!=k.indexOf("#")?this.id():g.hasOwnProperty(k)?g[k](this.m):null};return d};function kl(a,b){this.g=new ll(a,b);this.tb=A();this.yc=!1;this.i=null;this.Zc=!1}t("lf.schema.Builder",kl);function ml(a,b){b.yb.forEach(function(c){var d=c.Wa;if(!this.tb.has(d))throw new F(536,c.name);d=this.tb.get(d).zb();var e=c.Jc;if(!d.hasOwnProperty(e))throw new F(537,c.name);if(b.zb()[c.vb].G()!=d[e].G())throw new F(538,c.name);if(!d[e].Dc())throw new F(539,c.name);},a)}
  kl.prototype.Sf=function(a){a.yb.forEach(function(b){this.tb.get(b.Wa).yb.forEach(function(c){if(c.vb==b.Jc)throw new F(534,b.name);},this)},this)};function nl(a){a.yc||(a.tb.forEach(function(b){ml(this,b);b=b.zb();this.g.M.set(b.getName(),b)},a),B(a.tb).forEach(a.Sf,a),ol(a),a.tb.clear(),a.yc=!0)}function pl(a,b,c){b.ze||(b.ze=!0,b.ge=!0,b.Me.forEach(function(d){d=c.get(d);if(!d.ze)pl(this,d,c);else if(d.ge&&b!=d)throw new F(533);},a));b.ge=!1}
  function ol(a){var b=A();a.g.M.forEach(function(c,d){b.set(d,new ql(d))},a);a.tb.forEach(function(c,d){c.yb.forEach(function(e){b.get(e.Wa).Me.add(d)})});B(b).forEach(function(c){pl(this,c,b)},a)}function ql(a){this.ge=this.ze=!1;this.Me=D();this.mc=a}kl.prototype.zb=function(){this.yc||nl(this);return this.g};kl.prototype.getSchema=kl.prototype.zb;kl.prototype.Re=function(){var a=new Ic("ns_"+this.g.name()),b=uk();if(b.nd(a))var c=b.b(a);else c=new sk,b.rb(a,c);return c};kl.prototype.getGlobal=kl.prototype.Re;
  kl.prototype.connect=function(a){if(this.Zc||null!==this.i&&this.i.jd)throw new F(113);this.Zc=!0;if(null===this.i){var b=this.Re();b.nd(Pc)||b.rb(Pc,this.zb());this.i=new X(b)}return this.i.Ea(a).then(function(c){this.Zc=!1;return c}.bind(this),function(c){this.Zc=!1;this.i.close();throw c;}.bind(this))};kl.prototype.connect=kl.prototype.connect;kl.prototype.Uf=function(a){if(this.tb.has(a))throw new F(503,a);if(this.yc)throw new F(535);this.tb.set(a,new Z(a));return this.tb.get(a)};
  kl.prototype.createTable=kl.prototype.Uf;kl.prototype.te=function(a){if(this.yc)throw new F(535);this.g.te(a);return this};kl.prototype.setPragma=kl.prototype.te;function ll(a,b){this.A=a;this.Ta=b;this.M=A();this.le={$f:!1}}t("lf.schema.DatabaseSchema",ll);ll.prototype.name=h("A");ll.prototype.name=ll.prototype.name;ll.prototype.version=h("Ta");ll.prototype.version=ll.prototype.version;ll.prototype.oa=function(){return B(this.M)};ll.prototype.tables=ll.prototype.oa;
  ll.prototype.table=function(a){if(!this.M.has(a))throw new F(101,a);return this.M.get(a)};ll.prototype.table=ll.prototype.table;ll.prototype.info=function(){this.We||(this.We=new Vk(this));return this.We};ll.prototype.Ng=h("le");ll.prototype.pragma=ll.prototype.Ng;ll.prototype.te=ba("le");t("lf.schema.create",function(a,b){return new kl(a,b)});w.prototype.catch=w.prototype.we;w.prototype["catch"]=w.prototype.catch;
  try{if(module){module.exports=lf;}}catch(e){}}.bind(window))();
  //# sourceMappingURL=lovefield.min.js.map
  